From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 1 01:48:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 01 Nov 2006 09:48:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9767 - /vtigercrm/tags/vtigercrm-5.0.2/ Message-ID: <20061101094805.35FD3788CBB@vtiger.fosslabs.com> Author: richie Date: Wed Nov 1 02:47:59 2006 New Revision: 9767 Log: 5.0.2 version tagged Added: vtigercrm/tags/vtigercrm-5.0.2/ - copied from r9766, vtigercrm/trunk/ From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 1 01:57:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 01 Nov 2006 09:57:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9768 - /vtigercrm/branches/5.0.3/ Message-ID: <20061101095721.EE09B788CBB@vtiger.fosslabs.com> Author: richie Date: Wed Nov 1 02:57:16 2006 New Revision: 9768 Log: branch created for 5.0.3 release Added: vtigercrm/branches/5.0.3/ - copied from r9767, vtigercrm/trunk/ From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 1 04:21:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 01 Nov 2006 12:21:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9769 - in /vtigercrm/branches/5.0.3/modules: Accounts/Accounts.php Leads/Leads.php Message-ID: <20061101122113.A495C787DD6@vtiger.fosslabs.com> Author: richie Date: Wed Nov 1 05:21:08 2006 New Revision: 9769 Log: * Added variable entity_table which is used in export function Modified: vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php vtigercrm/branches/5.0.3/modules/Leads/Leads.php Modified: vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php (original) +++ vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php Wed Nov 1 05:21:08 2006 @@ -42,6 +42,7 @@ var $tab_name = Array('vtiger_crmentity','vtiger_account','vtiger_accountbillads','vtiger_accountshipads','vtiger_accountscf'); var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid'); + var $entity_table = "vtiger_crmentity"; var $column_fields = Array(); Modified: vtigercrm/branches/5.0.3/modules/Leads/Leads.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Leads/Leads.php (original) +++ vtigercrm/branches/5.0.3/modules/Leads/Leads.php Wed Nov 1 05:21:08 2006 @@ -35,7 +35,7 @@ var $tab_name = Array('vtiger_crmentity','vtiger_leaddetails','vtiger_leadsubdetails','vtiger_leadaddress','vtiger_leadscf'); var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_leaddetails'=>'leadid','vtiger_leadsubdetails'=>'leadsubscriptionid','vtiger_leadaddress'=>'leadaddressid','vtiger_leadscf'=>'leadid'); - + var $entity_table = "vtiger_crmentity"; //construct this from database; var $column_fields = Array(); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 00:13:40 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 08:13:40 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9770 - /vtigercrm/branches/5.0.3/include/CustomFieldUtil.php Message-ID: <20061106081340.75F56788A33@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 01:13:36 2006 New Revision: 9770 Log: i18n issue in listview custom fields fixed Modified: vtigercrm/branches/5.0.3/include/CustomFieldUtil.php Modified: vtigercrm/branches/5.0.3/include/CustomFieldUtil.php ============================================================================== --- vtigercrm/branches/5.0.3/include/CustomFieldUtil.php (original) +++ vtigercrm/branches/5.0.3/include/CustomFieldUtil.php Mon Nov 6 01:13:36 2006 @@ -19,6 +19,8 @@ */ function getCustomFieldTypeName($uitype) { + + global $mod_strings,$app_strings; global $log; $log->debug("Entering getCustomFieldTypeName(".$uitype.") method ..."); global $log; @@ -27,55 +29,55 @@ if($uitype == 1) { - $fldname = 'Text'; + $fldname = $mod_strings['Text']; } elseif($uitype == 7) { - $fldname = 'Number'; + $fldname = $mod_strings['Number']; } elseif($uitype == 9) { - $fldname = 'Percent'; + $fldname = $mod_strings['Percent']; } elseif($uitype == 5) { - $fldname = 'Date'; + $fldname = $mod_strings['Date']; } elseif($uitype == 13) { - $fldname = 'Email'; + $fldname = $mod_strings['Email']; } elseif($uitype == 11) { - $fldname = 'Phone'; + $fldname = $mod_strings['Phone']; } elseif($uitype == 15) { - $fldname = 'PickList'; + $fldname = $mod_strings['PickList']; } elseif($uitype == 17) { - $fldname = 'Url'; + $fldname = $mod_strings['LBL_URL']; } elseif($uitype == 56) { - $fldname = 'Checkbox'; + $fldname = $mod_strings['LBL_CHECK_BOX']; } elseif($uitype == 71) { - $fldname = 'Currency'; + $fldname = $mod_strings['Currency']; } elseif($uitype == 21) { - $fldname = 'Text Area'; + $fldname = $mod_strings['LBL_TEXT_AREA']; } elseif($uitype == 33) { - $fldname = 'Multi-Select Combo Box'; + $fldname = $mod_strings['LBL_MULTISELECT_COMBO']; } elseif($uitype == 85) { - $fldname = 'Skype'; + $fldname = $mod_strings['Skype']; } $log->debug("Exiting getCustomFieldTypeName method ..."); return $fldname; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 01:25:53 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 09:25:53 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9771 - /vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php Message-ID: <20061106092553.AE959787F32@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 02:25:50 2006 New Revision: 9771 Log: duplicate label removed Modified: vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php Mon Nov 6 02:25:50 2006 @@ -362,7 +362,6 @@ 'LBL_INVITE'=>'Invite', 'LBL_REPEAT'=>'Repeat', 'LBL_REMINDER'=>'Reminder', -'LBL_ENABLE_REPEAT'=>'Enable Repeat', 'LBL_SENDREMINDER'=>'Send Reminder', 'LBL_NOTIFICATION'=>'Notification', 'LBL_SENDNOTIFICATION'=>'Send Notification', From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 01:41:49 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 09:41:49 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9772 - in /vtigercrm/branches/5.0.3: Smarty/templates/ProfileDetailView.tpl include/utils/UserInfoUtil.php modules/Users/profilePrivileges.php Message-ID: <20061106094150.C293D787F32@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 02:41:42 2006 New Revision: 9772 Log: error during profile creation - fixed. Fixes #2529 Modified: vtigercrm/branches/5.0.3/Smarty/templates/ProfileDetailView.tpl vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php vtigercrm/branches/5.0.3/modules/Users/profilePrivileges.php Modified: vtigercrm/branches/5.0.3/Smarty/templates/ProfileDetailView.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/ProfileDetailView.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/ProfileDetailView.tpl Mon Nov 6 02:41:42 2006 @@ -139,11 +139,11 @@ - + - +
{$APP.LBL_PROFILE_NAME} :
{$APP.LBL_DESCRIPTION} :
Modified: vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php (original) +++ vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php Mon Nov 6 02:41:42 2006 @@ -1359,7 +1359,7 @@ $sql1 = "select description from vtiger_profile where profileid=".$profileid; $result = $adb->query($sql1); $profileDescription = $adb->query_result($result,0,"description"); - $log->debug("Exiting getProfileName method ..."); + $log->debug("Exiting getProfileDescription method ..."); return $profileDescription; } Modified: vtigercrm/branches/5.0.3/modules/Users/profilePrivileges.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/profilePrivileges.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/profilePrivileges.php Mon Nov 6 02:41:42 2006 @@ -21,6 +21,8 @@ $image_path=$theme_path."images/"; $profileId=$_REQUEST['profileid']; $profileName=''; +$profileDescription=''; + $parentProfileId=$_REQUEST['parentprofile']; if($_REQUEST['mode'] =='create' && $_REQUEST['radiobutton'] != 'baseprofile') $parentProfileId = ''; @@ -66,14 +68,16 @@ if(isset($_REQUEST['profile_description']) && $_REQUEST['profile_description'] != '' && $_REQUEST['mode'] == 'create') - $smarty->assign("PROFILE_DESCRIPTION",$_REQUEST['profile_description']); + $profileDescription = $_REQUEST['profile_description']; else { - $profileDescription = getProfileDescription($profileId); -} - -$smarty->assign("Profile_Name", $profileName); -$smarty->assign("Profile_Description", $profileDescription); + if($profileId != null) + { + $profileDescription = getProfileDescription($profileId); + } +} + +$smarty->assign("PROFILE_DESCRIPTION", $profileDescription); if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != '') $smarty->assign("MODE",$_REQUEST['mode']); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 02:55:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 10:55:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9773 - /vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Message-ID: <20061106105517.C3EDE787E57@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 03:55:14 2006 New Revision: 9773 Log: fixes made to show emails even the values are empty Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php (original) +++ vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Mon Nov 6 03:55:14 2006 @@ -1112,6 +1112,9 @@ }elseif(trim($value) == "" && $datatype == "V") { $rtvalue = " = ".$adb->quote($value); + }elseif(trim($value) == "" && $datatype == "E") + { + $rtvalue = " = ".$adb->quote($value); }else { $rtvalue = " is NULL"; @@ -1126,6 +1129,9 @@ { $rtvalue = " <> ".$adb->quote($value); }elseif(trim($value) == "" && $datatype == "V") + { + $rtvalue = " <> ".$adb->quote($value); + }elseif(trim($value) == "" && $datatype == "E") { $rtvalue = " <> ".$adb->quote($value); }else From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 05:05:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 13:05:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9774 - /vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Message-ID: <20061106130547.71C91788DF8@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 06:05:43 2006 New Revision: 9774 Log: i18n support for advance and basic search fields Modified: vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/SearchUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/SearchUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Mon Nov 6 06:05:43 2006 @@ -182,12 +182,12 @@ if($fieldname!='parent_id') { $fld_name=$fieldname; - $search_header[$fld_name]=$name; + $search_header[$fld_name]=$mod_strings[$name]; } } } } - $log->debug("Exiting getSearchListHeaderValues method ..."); + $log->debug("Exiting getSearchListHeaderValues method ..."); return $search_header; } @@ -451,7 +451,7 @@ $block = $adb->query_result($result,$i,"block"); $fieldtype = explode("~",$fieldtype); $fieldtypeofdata = $fieldtype[0]; - $fieldlabel = $adb->query_result($result,$i,"fieldlabel"); + $fieldlabel = $mod_strings[$adb->query_result($result,$i,"fieldlabel")]; if($fieldlabel == "Related To") { $fieldlabel = "Related to"; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 23:40:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 07:40:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9775 - /vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Message-ID: <20061107074039.792AC788FB2@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 00:40:34 2006 New Revision: 9775 Log: alphabet case issue fixed. Fixes #1811 Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js ============================================================================== --- vtigercrm/branches/5.0.3/include/js/dtlviewajax.js (original) +++ vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Tue Nov 7 00:40:34 2006 @@ -349,7 +349,7 @@ 'index.php', {queue: {position: 'end', scope: 'command'}, method: 'post', - postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +tagValue, + postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +escape(tagValue), onComplete: function(response) { getObj('tagfields').innerHTML = response.responseText; $("vtbusy_info").style.display="none"; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 23:46:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 07:46:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9776 - /vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php Message-ID: <20061107074624.970EF788FB2@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 00:46:20 2006 New Revision: 9776 Log: Home Page Quote Status is inconsistent. Fixes #1857 Modified: vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php Modified: vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php (original) +++ vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php Tue Nov 7 00:46:20 2006 @@ -60,7 +60,10 @@ //<<<<<<<<>>>>>>>> $date_var = date('Y-m-d'); - $where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and vtiger_quotes.validtill >= \''.$date_var.'\''; + $where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and vtiger_quotes.quotestage != "Rejected" and vtiger_quotes.validtill >= \''.$date_var.'\''; + //$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and vtiger_quotes.validtill >= \''.$date_var.'\''; + + $query = getListQuery("Quotes",$where); $query .=" ORDER BY total DESC"; //<<<<<<<>>>>>>>> From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 00:01:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 08:01:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9777 - in /vtigercrm/branches/5.0.3/Smarty/templates: DetailViewHidden.tpl EditViewHidden.tpl Message-ID: <20061107080143.99D91788FAB@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 01:01:34 2006 New Revision: 9777 Log: Made changes for module addition tool Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailViewHidden.tpl vtigercrm/branches/5.0.3/Smarty/templates/EditViewHidden.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailViewHidden.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/DetailViewHidden.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/DetailViewHidden.tpl Tue Nov 7 01:01:34 2006 @@ -192,6 +192,14 @@ +{else} + + + + + + + {/if} Modified: vtigercrm/branches/5.0.3/Smarty/templates/EditViewHidden.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/EditViewHidden.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/EditViewHidden.tpl Tue Nov 7 01:01:34 2006 @@ -76,6 +76,9 @@
+{else} + {$ERROR_MESSAGE} + {/if} From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 05:21:53 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 13:21:53 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9778 - /vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl Message-ID: <20061107132153.87DF0788FC0@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 06:21:46 2006 New Revision: 9778 Log: multiple select option issue in customfield fixed . Fixes #2392 Modified: vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl Tue Nov 7 06:21:46 2006 @@ -101,10 +101,11 @@ From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 07:46:58 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 15:46:58 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9779 - /vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php Message-ID: <20061107154658.2D7CF788FCF@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 08:46:52 2006 New Revision: 9779 Log: Date fields are filled automatically - resolved . Fixes #1577 Modified: vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php Tue Nov 7 08:46:52 2006 @@ -68,7 +68,7 @@ if($value=='') { //modified to fix the issue in trac(http://vtiger.fosslabs.com/cgi-bin/trac.cgi/ticket/1469) - if($fieldname != 'birthday' && $generatedtype != 2)// && $fieldname != 'due_date')//due date is today's date by default + if($fieldname != 'birthday' && $generatedtype != 2 && getTabid($module_name) !=14)// && $fieldname != 'due_date')//due date is today's date by default $disp_value=getNewDisplayDate(); //Added to display the Contact - Support End Date as one year future instead of today's date -- 30-11-2005 From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 07:52:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 15:52:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9780 - /vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php Message-ID: <20061107155222.00CAE788FCF@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 08:52:17 2006 New Revision: 9780 Log: solution to escape sql injection. Fixes #2369 Modified: vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php Modified: vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php (original) +++ vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php Tue Nov 7 08:52:17 2006 @@ -38,7 +38,7 @@ if($tabname[1]!='') $custom=true; -for($i = 0; $i < $count; $i++) +/*for($i = 0; $i < $count; $i++) { $pickArray[$i] = trim($pickArray[$i]); if($pickArray[$i] != '') @@ -50,6 +50,17 @@ $adb->query($query); } -} +}*/ +/* ticket2369 fixed*/ +$columnName = $tableName; +foreach ($pickArray as $index => $data) { + $data = trim($data); + if(!empty($data)){ + $data = $adb->formatString("vtiger_$tableName",$columnName,$data); + $query = "insert into vtiger_$tableName values('',$data,$index,1)"; + $adb->query($query); + } +} + header("Location:index.php?action=SettingsAjax&module=Settings&directmode=ajax&file=PickList&fld_module=".$fld_module); ?> From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:20:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:20:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9781 - /vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Message-ID: <20061108072047.DBDDF789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:20:39 2006 New Revision: 9781 Log: Updated foreign key constraints for tabid in various tables Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml ============================================================================== --- vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml (original) +++ vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Wed Nov 8 00:20:39 2006 @@ -229,6 +229,13 @@ + + ADD CONSTRAINT fk_1_vtiger_blocks FOREIGN KEY (tabid) REFERENCES vtiger_tab(tabid) ON DELETE CASCADE + Type=InnoDB + + +
+ @@ -4123,11 +4130,21 @@ - - - - - Type=InnoDB + + + + + entitytype + + + Type=InnoDB +
+ + + ADD CONSTRAINT fk_1_vtiger_customview FOREIGN KEY (entitytype) REFERENCES vtiger_tab (name) ON DELETE CASCADE + Type=InnoDB + +
@@ -4152,12 +4169,12 @@ Type=InnoDB
- -ADD CONSTRAINT fk_1_vtiger_cvcolumnlist FOREIGN KEY (cvid) REFERENCES vtiger_customview (cvid) ON DELETE CASCADE -Type=InnoDB - - -
+ + ADD CONSTRAINT fk_1_vtiger_cvcolumnlist FOREIGN KEY (cvid) REFERENCES vtiger_customview (cvid) ON DELETE CASCADE + Type=InnoDB + + +
@@ -5417,10 +5434,10 @@
- - - - + + + + @@ -5432,6 +5449,20 @@ parenttabidType=InnoDB +
+ + + ADD CONSTRAINT fk_1_vtiger_parenttabrel FOREIGN KEY (tabid) REFERENCES vtiger_tab(tabid) ON DELETE CASCADE + Type=InnoDB + + +
+ + + ADD CONSTRAINT fk_2_vtiger_parenttabrel FOREIGN KEY (parenttabid) REFERENCES vtiger_parenttab(parenttabid) ON DELETE CASCADE + Type=InnoDB + +
@@ -6105,6 +6136,13 @@ Type=InnoDB
+ + ADD CONSTRAINT fk_1_vtiger_entityname FOREIGN KEY (tabid) REFERENCES vtiger_tab(tabid) ON DELETE CASCADE + Type=InnoDB + + +
+ From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:28:52 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:28:52 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9782 - /vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php Message-ID: <20061108072852.37599788FE3@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:28:44 2006 New Revision: 9782 Log: Added function isPresentRelatedLists Modified: vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php Wed Nov 8 00:28:44 2006 @@ -1327,6 +1327,30 @@ return $focus_list; } +/** This function returns whether related lists is present for this particular module or not +* Param $module - module name +* Param $activity_mode - mode of activity +* Return type true or false +*/ + + +function isPresentRelatedLists($module,$activity_mode='') +{ + global $adb; + $retval='true'; + $tab_id=getTabid($module); + $query= "select count(*) as count from vtiger_relatedlists where tabid=".$tab_id; + $result=$adb->query($query); + $count=$adb->query_result($result,0,'count'); + if($count < 1 || ($module =='Calendar' && $activity_mode=='task')) + { + $retval='false'; + } + return $retval; + + +} + /** This function returns the detailed block information of a record in a module. * Param $module - module name * Param $block - block id From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:32:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:32:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9783 - /vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl Message-ID: <20061108073256.44B72789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:32:28 2006 New Revision: 9783 Log: Hard Coding of Related Lists Removed Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl Wed Nov 8 00:32:28 2006 @@ -128,7 +128,7 @@ - {if $MODULE eq 'Notes' || $MODULE eq 'Faq' || $MODULE eq 'Webmails' || ($MODULE eq 'Calendar' && $ACTIVITY_MODE eq 'Task')} + {if $IS_REL_LIST eq 'false'} {else} @@ -380,7 +380,7 @@ {/if} - {if $SinglePane_View eq 'true'} + {if $SinglePane_View eq 'true' && $IS_REL_LIST eq 'true'} {include file= 'RelatedListNew.tpl'} {/if}
 {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  
From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:37:19 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:37:19 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9784 - /vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php Message-ID: <20061108073719.6B1F8789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:37:11 2006 New Revision: 9784 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php Wed Nov 8 00:37:11 2006 @@ -110,6 +110,7 @@ $smarty->assign("MODULE",$currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:38:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:38:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9785 - /vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php Message-ID: <20061108073844.F18BD789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:38:36 2006 New Revision: 9785 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php Wed Nov 8 00:38:36 2006 @@ -70,6 +70,7 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:40:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:40:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9786 - /vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php Message-ID: <20061108074021.1E79A789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:40:14 2006 New Revision: 9786 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php Wed Nov 8 00:40:14 2006 @@ -121,6 +121,7 @@ $smarty->assign("MODULE",$currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:41:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:41:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9787 - /vtigercrm/branches/5.0.3/modules/Faq/DetailView.php Message-ID: <20061108074130.ACD42789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:41:23 2006 New Revision: 9787 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Faq/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Faq/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Faq/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Faq/DetailView.php Wed Nov 8 00:41:23 2006 @@ -76,6 +76,8 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + $tabid = getTabid("Faq"); $validationData = getDBValidationData($focus->tab_name,$tabid); $data = split_validationdataArray($validationData); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:42:25 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:42:25 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9788 - /vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php Message-ID: <20061108074225.AD145789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:42:18 2006 New Revision: 9788 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php Wed Nov 8 00:42:18 2006 @@ -104,6 +104,7 @@ $smarty->assign("MODULE",$currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:43:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:43:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9789 - /vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php Message-ID: <20061108074344.9FCD5789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:43:37 2006 New Revision: 9789 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php Wed Nov 8 00:43:37 2006 @@ -90,6 +90,7 @@ $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:44:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:44:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9790 - /vtigercrm/branches/5.0.3/modules/Leads/DetailView.php Message-ID: <20061108074428.59E2A789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:44:19 2006 New Revision: 9790 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Leads/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Leads/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Leads/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Leads/DetailView.php Wed Nov 8 00:44:19 2006 @@ -125,6 +125,8 @@ $smarty->assign("MODULE", $currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:45:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:45:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9791 - /vtigercrm/branches/5.0.3/modules/Notes/DetailView.php Message-ID: <20061108074503.B4CCA789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:44:55 2006 New Revision: 9791 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Notes/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Notes/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Notes/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Notes/DetailView.php Wed Nov 8 00:44:55 2006 @@ -104,6 +104,9 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); + +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + $tabid = getTabid("Notes"); $validationData = getDBValidationData($focus->tab_name,$tabid); $data = split_validationdataArray($validationData); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:45:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:45:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9792 - /vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php Message-ID: <20061108074551.61032789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:45:44 2006 New Revision: 9792 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php Wed Nov 8 00:45:44 2006 @@ -100,6 +100,8 @@ $smarty->assign("RELATEDLISTS", $related_array); } +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + $smarty->assign("SinglePane_View", $singlepane_view); $smarty->display("DetailView.tpl"); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:46:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:46:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9793 - /vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php Message-ID: <20061108074628.58278789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:46:20 2006 New Revision: 9793 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php Wed Nov 8 00:46:20 2006 @@ -80,6 +80,7 @@ $related_array = getRelatedLists($currentModule,$focus); $smarty->assign("RELATEDLISTS", $related_array); } +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); $smarty->assign("SinglePane_View", $singlepane_view); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:47:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:47:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9794 - /vtigercrm/branches/5.0.3/modules/Products/DetailView.php Message-ID: <20061108074747.C3414789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:47:38 2006 New Revision: 9794 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Products/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Products/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Products/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Products/DetailView.php Wed Nov 8 00:47:38 2006 @@ -91,6 +91,8 @@ $smarty->assign("MODULE", $currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:51:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:51:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9795 - /vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php Message-ID: <20061108075106.CE512789051@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:50:57 2006 New Revision: 9795 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php Wed Nov 8 00:50:57 2006 @@ -92,6 +92,8 @@ $smarty->assign("CHECK", $check_button); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:51:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:51:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9796 - /vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php Message-ID: <20061108075159.E292D789051@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:51:52 2006 New Revision: 9796 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php Wed Nov 8 00:51:52 2006 @@ -101,6 +101,8 @@ $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:52:52 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:52:52 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9797 - /vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php Message-ID: <20061108075253.0E1B9789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:52:43 2006 New Revision: 9797 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php Wed Nov 8 00:52:43 2006 @@ -98,6 +98,8 @@ $smarty->assign("CHECK", $check_button); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 23:54:02 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:54:02 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9798 - /vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php Message-ID: <20061108075402.B8DA4789051@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:53:54 2006 New Revision: 9798 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php Wed Nov 8 00:53:54 2006 @@ -71,6 +71,8 @@ $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:13:53 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 10:13:53 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9799 - in /vtigercrm/branches/5.0.3: data/CRMEntity.php include/utils/ExportUtils.php modules/Reports/AdvancedFilter.php Message-ID: <20061108101353.88944788FE3@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 03:13:46 2006 New Revision: 9799 Log: typo error fixed Modified: vtigercrm/branches/5.0.3/data/CRMEntity.php vtigercrm/branches/5.0.3/include/utils/ExportUtils.php vtigercrm/branches/5.0.3/modules/Reports/AdvancedFilter.php Modified: vtigercrm/branches/5.0.3/data/CRMEntity.php ============================================================================== --- vtigercrm/branches/5.0.3/data/CRMEntity.php (original) +++ vtigercrm/branches/5.0.3/data/CRMEntity.php Wed Nov 8 03:13:46 2006 @@ -972,15 +972,15 @@ for($i=0; $i < $numRows;$i++) { $columnName = $adb->query_result($result,$i,"columnname"); - $fieldlable = $adb->query_result($result,$i,"fieldlabel"); + $fieldlabel = $adb->query_result($result,$i,"fieldlabel"); //construct query as below if($i == 0) { - $sql3 .= $tablename.".".$columnName. " '" .$fieldlable."'"; + $sql3 .= $tablename.".".$columnName. " '" .$fieldlabel."'"; } else { - $sql3 .= ", ".$tablename.".".$columnName. " '" .$fieldlable."'"; + $sql3 .= ", ".$tablename.".".$columnName. " '" .$fieldlabel."'"; } } Modified: vtigercrm/branches/5.0.3/include/utils/ExportUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/ExportUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/ExportUtils.php Wed Nov 8 03:13:46 2006 @@ -87,21 +87,21 @@ for($i=0; $i < $num_rows;$i++) { $columnName = $adb->query_result($result,$i,"columnname"); - $fieldlable = $adb->query_result($result,$i,"fieldlabel"); + $fieldlabel = $adb->query_result($result,$i,"fieldlabel"); $tablename = $adb->query_result($result,$i,"tablename"); //HANDLE HERE - Mismatch fieldname-tablename in field table, in future we have to avoid these if elses if($columnName == 'smownerid')//for all assigned to user name { - $fields .= "vtiger_users.user_name as '".$fieldlable."', "; + $fields .= "vtiger_users.user_name as '".$fieldlabel."', "; } elseif($tablename == 'vtiger_account' && $columnName == 'parentid')//Account - Member Of { - $fields .= "vtiger_account2.accountname as '".$fieldlable."', "; + $fields .= "vtiger_account2.accountname as '".$fieldlabel."', "; } elseif($tablename == 'vtiger_contactdetails' && $columnName == 'accountid')//Contact - Account Name { - $fields .= "vtiger_account.accountname as '".$fieldlable."', "; + $fields .= "vtiger_account.accountname as '".$fieldlabel."', "; } elseif($tablename == 'vtiger_contactdetails' && $columnName == 'reportsto')//Contact - Reports To { @@ -109,11 +109,11 @@ } elseif($tablename == 'vtiger_potential' && $columnName == 'accountid')//Potential - Account Name { - $fields .= "vtiger_account.accountname as '".$fieldlable."',"; + $fields .= "vtiger_account.accountname as '".$fieldlabel."',"; } elseif($tablename == 'vtiger_potential' && $columnName == 'campaignid')//Potential - Campaign Source { - $fields .= "vtiger_campaign.campaignname as '".$fieldlable."',"; + $fields .= "vtiger_campaign.campaignname as '".$fieldlabel."',"; } elseif($tablename == 'vtiger_seproductsrel' && $columnName == 'crmid')//Product - Related To { @@ -131,7 +131,7 @@ } elseif($tablename == 'vtiger_products' && $columnName == 'vendor_id')//Product - Vendor Name { - $fields .= "vtiger_vendor.vendorname as '".$fieldlable."',"; + $fields .= "vtiger_vendor.vendorname as '".$fieldlabel."',"; } elseif($tablename == 'vtiger_producttaxrel' && $columnName == 'taxclass')//avoid product - taxclass { @@ -155,11 +155,11 @@ } elseif($tablename == 'vtiger_attachments' && $columnName == 'filename')//Emails filename { - $fields .= $tablename.".name '".$fieldlable."',"; + $fields .= $tablename.".name '".$fieldlabel."',"; } else { - $fields .= $tablename.".".$columnName. " '" .$fieldlable."',"; + $fields .= $tablename.".".$columnName. " '" .$fieldlabel."',"; } } $fields = trim($fields,","); Modified: vtigercrm/branches/5.0.3/modules/Reports/AdvancedFilter.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Reports/AdvancedFilter.php (original) +++ vtigercrm/branches/5.0.3/modules/Reports/AdvancedFilter.php Wed Nov 8 03:13:46 2006 @@ -140,7 +140,7 @@ { foreach($ogReport->sec_module_columnslist[$secmodule[$i]][$key] as $field=>$fieldlabel) { - if(isset($mod_strings[$fieldlable])) + if(isset($mod_strings[$fieldlabel])) { if($selected == $field) { From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 03:09:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 11:09:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9800 - /vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php Message-ID: <20061108110923.D21C9789062@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 04:09:19 2006 New Revision: 9800 Log: error message color changed Modified: vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php Modified: vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php (original) +++ vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php Wed Nov 8 04:09:19 2006 @@ -21,7 +21,7 @@ $smarty = new vtigerCRM_Smarty; if($_REQUEST['error'] != '') { - $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); + $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); } $sql="select * from vtiger_systems where server_type = 'proxy'"; $result = $adb->query($sql); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 03:15:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 11:15:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9801 - /vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Message-ID: <20061108111538.E0D2F789062@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 04:15:30 2006 New Revision: 9801 Log: Fixed the issue in Custom View if the module name and field label is same --By Jeri Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php (original) +++ vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Wed Nov 8 04:15:30 2006 @@ -764,7 +764,12 @@ //Ends $tablefield[$list[0]] = $list[1]; - $fieldlabel = trim(str_replace($this->escapemodule," ",$list[3])); + + //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); + $this->list_fields[$fieldlabel] = $tablefield; $this->list_fields_name[$fieldlabel] = $list[2]; } From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 03:18:48 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 11:18:48 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9802 - /vtigercrm/branches/5.0.3/include/js/Mail.js Message-ID: <20061108111848.99A3B789061@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 04:18:43 2006 New Revision: 9802 Log: Spelling error fixed. Fixes #2204 Modified: vtigercrm/branches/5.0.3/include/js/Mail.js Modified: vtigercrm/branches/5.0.3/include/js/Mail.js ============================================================================== --- vtigercrm/branches/5.0.3/include/js/Mail.js (original) +++ vtigercrm/branches/5.0.3/include/js/Mail.js Wed Nov 8 04:18:43 2006 @@ -79,7 +79,7 @@ window.close(); }else { - alert('The Record '+parentname+' does\'t have email id' ); + alert('The user "'+parentname+'" doesn\'t have an email id' ); return false; } } From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 03:39:04 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 11:39:04 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9803 - /vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Message-ID: <20061108113904.0F2F8788CE8@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 04:39:01 2006 New Revision: 9803 Log: unable to add tag could in IE - fixed Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js ============================================================================== --- vtigercrm/branches/5.0.3/include/js/dtlviewajax.js (original) +++ vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Wed Nov 8 04:39:01 2006 @@ -316,7 +316,7 @@ { /* Wordwrap a long list of multi-select combo box items at the * item separator string */ - const DETAILVIEW_WORDWRAP_WIDTH = "70"; // must match value in DetailViewUI.tpl. + var DETAILVIEW_WORDWRAP_WIDTH = "70"; // must match value in DetailViewUI.tpl. var lineLength = 0; for(var i=0; i < r.length; i++) { @@ -339,11 +339,9 @@ showHide(dtlView,editArea); //show,hide itsonview=false; } - -function SaveTag(txtBox,crmId,module) -{ - var tagValue = document.getElementById(txtBox).value; - document.getElementById(txtBox).value =''; +function SaveTag(tagfield,crmId,module) +{ + var tagValue = $(tagfield).value; $("vtbusy_info").style.display="inline"; new Ajax.Request( 'index.php', @@ -353,6 +351,7 @@ onComplete: function(response) { getObj('tagfields').innerHTML = response.responseText; $("vtbusy_info").style.display="none"; + $(tagfield).value = ''; } } ); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 04:17:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 12:17:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9804 - /vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php Message-ID: <20061108121730.AD921789061@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 05:17:26 2006 New Revision: 9804 Log: ordering activities by due date . Fixes #1889 Modified: vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php Wed Nov 8 05:17:26 2006 @@ -76,7 +76,7 @@ //for pending activities $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$pending_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; } - + $list_query.= " ORDER BY due_date ASC"; $res = $adb->query($list_query); $noofrecords = $adb->num_rows($res); $open_activity_list = array(); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 05:10:19 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 13:10:19 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9805 - /vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php Message-ID: <20061108131019.33FC778905F@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 06:10:15 2006 New Revision: 9805 Log: dashboard homepage doesn't display potential stats - fixed Modified: vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php Modified: vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php (original) +++ vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php Wed Nov 8 06:10:15 2006 @@ -37,6 +37,8 @@ var $log; var $db; + var $module_name="Potentials"; + var $module_id = "potentialid"; var $tab_name = Array('vtiger_crmentity','vtiger_potential','vtiger_potentialscf'); var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_potential'=>'potentialid','vtiger_potentialscf'=>'potentialid'); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 05:20:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 13:20:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9806 - in /vtigercrm/branches/5.0.3: modules/Users/DefaultDataPopulator.php schema/DatabaseSchema.xml Message-ID: <20061108132009.28C7C78906F@vtiger.fosslabs.com> Author: jerrydgeorge Date: Wed Nov 8 06:19:54 2006 New Revision: 9806 Log: columnname for the corresponding field as we have in the fieldtable for the related field has been added --Jeri Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Wed Nov 8 06:19:54 2006 @@ -913,25 +913,24 @@ //The Entity Name for the modules are maintained in this table -$this->db->query("insert into vtiger_entityname values(7,'Leads','vtiger_leaddetails','lastname,firstname','leadid')"); -$this->db->query("insert into vtiger_entityname values(6,'Accounts','vtiger_account','accountname','accountid')"); -$this->db->query("insert into vtiger_entityname values(4,'Contacts','vtiger_contactdetails','lastname,firstname','contactid')"); -$this->db->query("insert into vtiger_entityname values(2,'Potentials','vtiger_potential','potentialname','potentialid')"); -$this->db->query("insert into vtiger_entityname values(8,'Notes','vtiger_notes','title','notesid')"); -$this->db->query("insert into vtiger_entityname values(13,'HelpDesk','vtiger_troubletickets','title','ticketid')"); -$this->db->query("insert into vtiger_entityname values(9,'Calendar','vtiger_activity','subject','activityid')"); -$this->db->query("insert into vtiger_entityname values(10,'Emails','vtiger_activity','subject','activityid')"); -$this->db->query("insert into vtiger_entityname values(14,'Products','vtiger_products','productname','productid')"); -$this->db->query("insert into vtiger_entityname values(29,'Users','vtiger_users','last_name,first_name','id')"); -$this->db->query("insert into vtiger_entityname values(23,'Invoice','vtiger_invoice','subject','invoiceid')"); -$this->db->query("insert into vtiger_entityname values(20,'Quotes','vtiger_quotes','subject','quoteid')"); -$this->db->query("insert into vtiger_entityname values(21,'PurchaseOrder','vtiger_purchaseorder','subject','purchaseorderid')"); -$this->db->query("insert into vtiger_entityname values(22,'SalesOrder','vtiger_salesorder','subject','salesorderid')"); -$this->db->query("insert into vtiger_entityname values(18,'Vendors','vtiger_vendor','vendorname','vendorid')"); -$this->db->query("insert into vtiger_entityname values(19,'PriceBooks','vtiger_pricebook','bookname','pricebookid')"); -$this->db->query("insert into vtiger_entityname values(26,'Campaigns','vtiger_campaign','campaignname','campaignid')"); -$this->db->query("insert into vtiger_entityname values(15,'Faq','vtiger_faq','question','id')"); - +$this->db->query("insert into vtiger_entityname values(7,'Leads','vtiger_leaddetails','lastname,firstname','leadid','leadid')"); +$this->db->query("insert into vtiger_entityname values(6,'Accounts','vtiger_account','accountname','accountid','account_id')"); +$this->db->query("insert into vtiger_entityname values(4,'Contacts','vtiger_contactdetails','lastname,firstname','contactid','contact_id')"); +$this->db->query("insert into vtiger_entityname values(2,'Potentials','vtiger_potential','potentialname','potentialid','potential_id')"); +$this->db->query("insert into vtiger_entityname values(8,'Notes','vtiger_notes','title','notesid','notesid')"); +$this->db->query("insert into vtiger_entityname values(13,'HelpDesk','vtiger_troubletickets','title','ticketid','ticketid')"); +$this->db->query("insert into vtiger_entityname values(9,'Calendar','vtiger_activity','subject','activityid','activityid')"); +$this->db->query("insert into vtiger_entityname values(10,'Emails','vtiger_activity','subject','activityid','activityid')"); +$this->db->query("insert into vtiger_entityname values(14,'Products','vtiger_products','productname','productid','product_id')"); +$this->db->query("insert into vtiger_entityname values(29,'Users','vtiger_users','lastname,firstname','id','id')"); +$this->db->query("insert into vtiger_entityname values(23,'Invoice','vtiger_invoice','subject','invoiceid','invoiceid')"); +$this->db->query("insert into vtiger_entityname values(20,'Quotes','vtiger_quotes','subject','quoteid','quote_id')"); +$this->db->query("insert into vtiger_entityname values(21,'PurchaseOrder','vtiger_purchaseorder','subject','purchaseorderid','purchaseorderid')"); +$this->db->query("insert into vtiger_entityname values(22,'SalesOrder','vtiger_salesorder','subject','salesorderid','salesorder_id')"); +$this->db->query("insert into vtiger_entityname values(18,'Vendors','vtiger_vendor','vendorname','vendorid','vendor_id')"); +$this->db->query("insert into vtiger_entityname values(19,'PriceBooks','vtiger_pricebook','bookname','pricebookid','pricebookid')"); +$this->db->query("insert into vtiger_entityname values(26,'Campaigns','vtiger_campaign','campaignname','campaignid','campaignid')"); +$this->db->query("insert into vtiger_entityname values(15,'Faq','vtiger_faq','question','id','id')"); // Insert End //Inserting into vtiger_groups table Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml ============================================================================== --- vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml (original) +++ vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Wed Nov 8 06:19:54 2006 @@ -6130,6 +6130,9 @@ + + + tabid From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 9 00:20:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 09 Nov 2006 08:20:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9807 - /vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Message-ID: <20061109082009.3AA20789080@vtiger.fosslabs.com> Author: richie Date: Thu Nov 9 01:20:05 2006 New Revision: 9807 Log: * Removed the unwanted code to get the translation, now get the translated string in a single line in the function getSearchListHeaderValues which is used to get the search fields Modified: vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/SearchUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/SearchUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Thu Nov 9 01:20:05 2006 @@ -126,68 +126,16 @@ if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0 || in_array($fieldname,$field)) { - if(isset($focus->sortby_fields) && $focus->sortby_fields !='') - { - //Added on 14-12-2005 to avoid if and else check for every list vtiger_field for arrow image and change order - - foreach($focus->list_fields[$name] as $tab=>$col) - { - if(in_array($col,$focus->sortby_fields)) - { - if($relatedlist !='') - { - if($app_strings[$name]) - { - $name = $app_strings[$name]; - } - else - { - $name = $mod_strings[$name]; - } - } - else - { - if($app_strings[$name]) - { - $lbl_name = $app_strings[$name]; - } - else - { - $lbl_name = $mod_strings[$name]; - } - $name = $lbl_name; - } - } - else - { if($app_strings[$name]) - { - $name = $app_strings[$name]; - } - elseif($mod_strings[$name]) - { - $name = $mod_strings[$name]; - } - } - } - } - //Added condition to hide the close column in Related Lists - //if($name == 'Close' && $relatedlist != '') - if($name == 'Close') - { - //$list_header .= ''; - // $list_header[] = ''; - } - else - { - if($fieldname!='parent_id') - { - $fld_name=$fieldname; - $search_header[$fld_name]=$mod_strings[$name]; - } - } + if($fieldname!='parent_id') + { + $fld_name=$fieldname; + + //assign the translated string + $search_header[$fld_name] = getTranslatedString($name); + } } } - $log->debug("Exiting getSearchListHeaderValues method ..."); + $log->debug("Exiting getSearchListHeaderValues method ..."); return $search_header; } From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 9 00:27:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 09 Nov 2006 08:27:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9808 - /vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Message-ID: <20061109082724.CF746788FAB@vtiger.fosslabs.com> Author: richie Date: Thu Nov 9 01:27:20 2006 New Revision: 9808 Log: * Function added to get the translated string - Mickie Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Thu Nov 9 01:27:20 2006 @@ -2528,4 +2528,17 @@ } } + +/** Function used to get the translated string to the input string + * @param string $str - input string which we want to translate + * @return string $str - translated string, if the translated string is available then the translated string other wise original string will be returned + */ +function getTranslatedString($str) +{ + global $app_strings, $mod_strings, $log; + $str = ($app_strings[$str] != '')?$app_strings[$str]:(($mod_strings[$str] != '')?$mod_strings[$str]:$str); + $log->debug("function getTranslatedString($str) - translated to ($str)"); + return $str; +} + ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 9 00:31:00 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 09 Nov 2006 08:31:00 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9809 - /vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php Message-ID: <20061109083100.4DB4B788FAB@vtiger.fosslabs.com> Author: richie Date: Thu Nov 9 01:30:56 2006 New Revision: 9809 Log: * Changed the customerportal ticket detail link in the notification mail -- Mickie Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php (original) +++ vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php Thu Nov 9 01:30:56 2006 @@ -124,7 +124,7 @@ $bodydetails .= 'There is a reply to '.$_REQUEST['ticket_title'].' in the "Customer Portal" at VTiger.'; $bodydetails .= "You can use the following link to view the replies made:
"; - $bodydetails .= "Ticket Details"; + $bodydetails .= "Ticket Details"; $bodydetails .= "

Thanks,

Vtiger Support Team "; $email_body = $bodysubject.'

'.$bodydetails; From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 9 23:24:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 10 Nov 2006 07:24:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9810 - in /vtigercrmoutlook/trunk/vtigercrmoladdin/source: frmSyncStatus.frm vtigeroladdin.vbp vtigeroladdin.vbw Message-ID: <20061110072435.4D8D2788903@vtiger.fosslabs.com> Author: richie Date: Fri Nov 10 00:23:48 2006 New Revision: 9810 Log: String updation changed to updating in the sync status messages--Bharath Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmSyncStatus.frm vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbp vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbw Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmSyncStatus.frm ============================================================================== Binary files - no diff available. Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbp ============================================================================== Binary files - no diff available. Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 03:09:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 10 Nov 2006 11:09:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9811 - /vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl Message-ID: <20061110110938.479BF78914D@vtiger.fosslabs.com> Author: richie Date: Fri Nov 10 04:09:33 2006 New Revision: 9811 Log: Moved 'More..' links inside the tables in homepage - mozilla issue fixed Modified: vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl Fri Nov 10 04:09:33 2006 @@ -126,7 +126,7 @@ -
+
{foreach item=elements from=$tabledetail.Entries} @@ -141,18 +141,16 @@ {/foreach}
-
- - - - -
- {if $modulename neq 'CustomView' && $modulename neq 'GroupAllocation'} - {$APP.LBL_MORE}.. - {else} -   - {/if} -
+
+ + + + + {if $modulename neq 'CustomView' && $modulename neq 'GroupAllocation'} + {$APP.LBL_MORE}.. + {else} +   + {/if} From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 03:17:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 10 Nov 2006 11:17:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9812 - /vtigercrm/branches/5.0.3/modules/Emails/Emails.php Message-ID: <20061110111708.3051278914F@vtiger.fosslabs.com> Author: richie Date: Fri Nov 10 04:17:04 2006 New Revision: 9812 Log: Error during sync between OL and vtiger fixed Modified: vtigercrm/branches/5.0.3/modules/Emails/Emails.php Modified: vtigercrm/branches/5.0.3/modules/Emails/Emails.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Emails/Emails.php (original) +++ vtigercrm/branches/5.0.3/modules/Emails/Emails.php Fri Nov 10 04:17:04 2006 @@ -36,8 +36,13 @@ var $db; // Stored vtiger_fields - // added to check email save from plugin or not - var $plugin_save = false; + // added to check email save from plugin or not + var $plugin_save = false; + +var $rel_users_table = "vtiger_salesmanactivityrel"; +var $rel_contacts_table = "vtiger_cntactivityrel"; +var $rel_serel_table = "vtiger_seactivityrel"; + var $tab_name = Array('vtiger_crmentity','vtiger_activity'); From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 03:20:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Fri, 10 Nov 2006 11:20:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9813 - /vtigercrm/branches/5.0.3/soap/vtigerolservice.php Message-ID: <20061110112059.4FD4B78914F@vtiger.fosslabs.com> Author: richie Date: Fri Nov 10 04:20:55 2006 New Revision: 9813 Log: Salutation missing during sync from OL to vtiger- fixed Modified: vtigercrm/branches/5.0.3/soap/vtigerolservice.php Modified: vtigercrm/branches/5.0.3/soap/vtigerolservice.php ============================================================================== --- vtigercrm/branches/5.0.3/soap/vtigerolservice.php (original) +++ vtigercrm/branches/5.0.3/soap/vtigerolservice.php Fri Nov 10 04:20:55 2006 @@ -595,7 +595,7 @@ { if(isset($cntrow)) { - $contact->column_fields[salutation]=in_array('salutation',$permitted_lists) ? $cntrow["title"] : ""; + $contact->column_fields[salutationtype]=in_array('salutationtype',$permitted_lists) ? $cntrow["title"] : ""; $contact->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $cntrow["firstname"] : ""; if($cntrow["middlename"] != "") @@ -677,7 +677,7 @@ if(isset($cntrow)) { $contact->retrieve_entity_info($cntrow["id"],"Contacts"); - $contact->column_fields[salutation]=in_array('salutation',$permitted_lists) ? $cntrow["title"] : ""; + $contact->column_fields[salutationtype]=in_array('salutationtype',$permitted_lists) ? $cntrow["title"] : ""; $contact->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $cntrow["firstname"] : ""; if($cntrow["middlename"] != "") { From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 17:37:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Sat, 11 Nov 2006 01:37:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9814 - in /vtigercrm/branches/4.2/modules/squirrelmail-1.4.4: redirect.php webmail.php Message-ID: <20061111013717.3294F788A22@vtiger.fosslabs.com> Author: allanbush Date: Fri Nov 10 18:37:13 2006 New Revision: 9814 Log: Fixed php 5 issue with global variable $theme being reused in squirrelmail. Refs #1287. Modified: vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/redirect.php vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/webmail.php Modified: vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/redirect.php ============================================================================== --- vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/redirect.php (original) +++ vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/redirect.php Fri Nov 10 18:37:13 2006 @@ -17,6 +17,11 @@ * Path for SquirrelMail required files. * @ignore */ + +// store this value as squirrelmail uses this variable in the global scope as well +$vtiger_theme = $theme; +unset($theme); + define('SM_PATH','modules/squirrelmail-1.4.4/'); //define('SM_PATH','../'); @@ -165,6 +170,7 @@ } */ +$theme = $vtiger_theme; /* Write session data and send them off to the appropriate page. */ //session_write_close(); @header("Location: $redirect_url"); Modified: vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/webmail.php ============================================================================== --- vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/webmail.php (original) +++ vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/webmail.php Fri Nov 10 18:37:13 2006 @@ -26,6 +26,8 @@ require_once ($theme_path."layout_utils.php"); */ +$vtiger_theme = $theme; +unset($theme); define('SM_PATH','modules/squirrelmail-1.4.4/'); @@ -172,6 +174,7 @@ } */ +$theme = $vtiger_theme; $smodule = $_REQUEST['smodule']; header("Location: index.php?module=squirrelmail-1.4.4&action=right_main&smodule=$smodule"); From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 17:51:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Sat, 11 Nov 2006 01:51:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9815 - in /vtigercrm/branches/4.2: config.template.php install/2setConfig.php Message-ID: <20061111015105.9FD64787F04@vtiger.fosslabs.com> Author: allanbush Date: Fri Nov 10 18:51:02 2006 New Revision: 9815 Log: Removed $disable_persistent_connections config option as it was unused and a duplicate of $dbconfigoption['persistent']. Closes #2551. Modified: vtigercrm/branches/4.2/config.template.php vtigercrm/branches/4.2/install/2setConfig.php Modified: vtigercrm/branches/4.2/config.template.php ============================================================================== --- vtigercrm/branches/4.2/config.template.php (original) +++ vtigercrm/branches/4.2/config.template.php Fri Nov 10 18:51:02 2006 @@ -156,10 +156,6 @@ // default_user_is_admin default value = false $default_user_is_admin = false; -// if your MySQL/PHP configuration does not support persistent connections set this to true to avoid a large performance slowdown -// disable_persistent_connections default value = false -$disable_persistent_connections = false; - // defined languages available. the key must be the language file prefix. (Example 'en_us' is the prefix for every 'en_us.lang.php' file) // languages default value = en_us=>US English $languages = Array('en_us'=>'US English',); Modified: vtigercrm/branches/4.2/install/2setConfig.php ============================================================================== --- vtigercrm/branches/4.2/install/2setConfig.php (original) +++ vtigercrm/branches/4.2/install/2setConfig.php Fri Nov 10 18:51:02 2006 @@ -48,9 +48,6 @@ if(isset($allow_exports)) $_SESSION['allow_exports'] = $allow_exports; - - if(isset($disable_persistent_connections)) - $_SESSION['disable_persistent_connections'] = $disable_persistent_connections; if(isset($default_language)) $_SESSION['default_language'] = $default_language; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 00:36:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 08:36:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9816 - in /vtigercrm/branches/5.0.3: index.php modules/Webmails/ListView.php modules/Webmails/MailBox.php Message-ID: <20061113083634.80A1278893A@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 01:36:28 2006 New Revision: 9816 Log: * Fixed some issues with connection string and Full Email View page error - Mickie Modified: vtigercrm/branches/5.0.3/index.php vtigercrm/branches/5.0.3/modules/Webmails/ListView.php vtigercrm/branches/5.0.3/modules/Webmails/MailBox.php Modified: vtigercrm/branches/5.0.3/index.php ============================================================================== --- vtigercrm/branches/5.0.3/index.php (original) +++ vtigercrm/branches/5.0.3/index.php Mon Nov 13 01:36:28 2006 @@ -438,6 +438,9 @@ require_once("modules/$currentModule/Activity.php"); $focus = new Activity(); break; + case 'Webmails': + //No need to create a webmail object here + break; default: require_once("modules/$currentModule/$currentModule.php"); $focus = new $currentModule(); Modified: vtigercrm/branches/5.0.3/modules/Webmails/ListView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/ListView.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/ListView.php Mon Nov 13 01:36:28 2006 @@ -177,6 +177,8 @@ $numEmails = $elist["count"]; $headers = $elist["headers"]; +$mails_per_page = $MailBox->mails_per_page; + if($start == 1 || $start == "") { $start_message=$numEmails; } else { Modified: vtigercrm/branches/5.0.3/modules/Webmails/MailBox.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/MailBox.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/MailBox.php Mon Nov 13 01:36:28 2006 @@ -56,12 +56,12 @@ $this->mail_protocol=$this->boxinfo["mail_protocol"]; $this->ssltype=$this->boxinfo["ssltype"]; $this->sslmeth=$this->boxinfo["sslmeth"]; + $this->box_refresh=trim($this->boxinfo["box_refresh"]); - $this->mails_per_page=trim($this->boxinf["mails_per_page"]); + $this->mails_per_page=trim($this->boxinfo["mails_per_page"]); if($this->mails_per_page < 1) $this->mails_per_page=20; - $this->mail_protocol=$this->boxinfo["mail_protocol"]; $this->account_name=$this->boxinfo["account_name"]; $this->display_name=$this->boxinfo["display_name"]; //$this->imapServerAddress=$this->boxinfo["mail_servername"]; @@ -105,46 +105,73 @@ if($this->mail_protocol == "pop3") $port = "110"; - else { - if($mods["imap"]["SSL Support"] == "enabled" && $this->ssltype == "ssl") + else + { + if($mods["imap"]["SSL Support"] == "enabled" && $this->ssltype == "tls") $port = "993"; else $port = "143"; } $this->db->println("Building connection string"); - if(preg_match("/@/",$this->login_username)) { + if(preg_match("/@/",$this->login_username)) + { $mailparts = split("@",$this->login_username); $user="".trim($mailparts[0]).""; $domain="".trim($mailparts[1]).""; // This section added to fix a bug when connecting as user at domain.com - if($this->readonly == "true") { - if($mods["imap"]["SSL Support"] == "enabled") - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/".$this->ssltype."/".$this->sslmeth."/user={$user}@{$domain}/readonly}".$this->mailbox; + if($this->readonly == "true") + { + if($mods["imap"]["SSL Support"] == "enabled") + $connectString = "/".$this->ssltype."/".$this->sslmeth."/user={$user}@{$domain}/readonly"; else - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/notls/novalidate-cert/user={$user}@{$domain}/readonly}".$this->mailbox; - } else { - if($mods["imap"]["SSL Support"] == "enabled") - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/".$this->ssltype."/".$this->sslmeth."/user={$user}@{$domain}}".$this->mailbox; + $connectString = "/notls/novalidate-cert/user={$user}@{$domain}/readonly"; + } + else + { + if($mods["imap"]["SSL Support"] == "enabled") + $connectString = "/".$this->ssltype."/".$this->sslmeth."/user={$user}@{$domain}"; else - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/notls/novalidate-cert/user={$user}@{$domain}}".$this->mailbox; - } - } else { - if($this->readonly == "true") { - if($mods["imap"]["SSL Support"] == "enabled") - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/".$this->ssltype."/".$this->sslmeth."/readonly}".$this->mailbox; + $connectString = "/notls/novalidate-cert/user={$user}@{$domain}"; + } + } + else + { + if($this->readonly == "true") + { + if($mods["imap"]["SSL Support"] == "enabled") + $connectString = "/".$this->ssltype."/".$this->sslmeth."/readonly"; else - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/notls/novalidate-cert/readonly}".$this->mailbox; - } else { - if($mods["imap"]["SSL Support"] == "enabled") - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/".$this->ssltype."/".$this->sslmeth."}".$this->mailbox; + $connectString = "/notls/novalidate-cert/readonly"; + } + else + { + if($mods["imap"]["SSL Support"] == "enabled") + $connectString = "/".$this->ssltype."/".$this->sslmeth; else - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/notls/novalidate-cert}".$this->mailbox; - } - } + $connectString = "/notls/novalidate-cert"; + } + } + + $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port.$connectString."}".$this->mailbox; + //Reference - http://forums.vtiger.com/viewtopic.php?p=33478#33478 - which has no tls or validate-cert + $connectString1 = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."}".$this->mailbox; + $this->db->println("Done Building Connection String.. Connecting to box"); - $this->mbox = imap_open($connectString, $this->login_username, $this->secretkey); + + if(!$this->mbox = @imap_open($connectString, $this->login_username, $this->secretkey)) + { + //try second string which has no tls or validate-cert + if(!$this->mbox = @imap_open($connectString1, $this->login_username, $this->secretkey)) + { + global $current_user; + $this->db->println("CONNECTION ERROR - Could not be connected to the server using imap_open function through the connection strings $connectString and $connectString1"); + echo "
 Could not connect to the server. Please check the server details Here "; + exit; + } + } + $this->db->println("Done connecting to box"); } } // END CLASS From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 01:34:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 09:34:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9817 - /vtigercrm/branches/5.0.3/include/utils/RecurringType.php Message-ID: <20061113093433.AFC0F78907B@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 02:34:28 2006 New Revision: 9817 Log: Calendar weekly event not shown properly - fixed. Fixes #2341 Modified: vtigercrm/branches/5.0.3/include/utils/RecurringType.php Modified: vtigercrm/branches/5.0.3/include/utils/RecurringType.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/RecurringType.php (original) +++ vtigercrm/branches/5.0.3/include/utils/RecurringType.php Mon Nov 13 02:34:28 2006 @@ -91,6 +91,8 @@ $startdate = $this->startdate->get_formatted_date(); $tempdate = $startdate; $enddate = $this->enddate->get_formatted_date(); + + $recurringDates[]=$startdate; while($tempdate <= $enddate) { if($this->recur_type == 'Daily') @@ -113,6 +115,7 @@ 'year' => $st_date[0] ); $tempdateObj = new DateTime($date_arr,true); + if(isset($this->dayofweek_to_rpt) && $this->dayofweek_to_rpt != null) { $weekstartObj = $tempdateObj->getThisweekDaysbyIndex(0); @@ -120,10 +123,12 @@ { for($i=0;$idayofweek_to_rpt);$i++) { + $repeatdateObj = $weekstartObj->getThisweekDaysbyIndex($this->dayofweek_to_rpt[$i]); if($repeatdateObj->get_formatted_date() <= $enddate) $recurringDates[] = $repeatdateObj->get_formatted_date(); } + if(isset($this->recur_freq)) $index = $this->recur_freq * 7; else @@ -134,9 +139,31 @@ 'year' => $st_date[0] ); $tempdateObj = new DateTime($date_arr,true); - } + + //echo '
';print_r($recurringDates); echo '
'; + + } + else { + + $eventStart = $this->startdate->get_formatted_date(); + for($i=0;$idayofweek_to_rpt);$i++) + { + + $repeatDay = $weekstartObj->getThisweekDaysbyIndex($this->dayofweek_to_rpt[$i]); + $repeatDate= $repeatDay->get_formatted_date(); + + if($repeatDate >= $eventStart) + { + + if($repeatDate <= $enddate) + $recurringDates[] = $repeatDate; + + } + + } + if(isset($this->recur_freq)) $index = $this->recur_freq * 7; else From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 02:05:12 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 10:05:12 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9818 - /vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php Message-ID: <20061113100512.97EA278907B@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 03:05:08 2006 New Revision: 9818 Log: Issue in change owner in calender - fixed. Fixes #2213 Modified: vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php Modified: vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php Mon Nov 13 03:05:08 2006 @@ -79,7 +79,9 @@ //First we have to delete the group relationship $delete_query = "delete from ". $deletegroup_array[$return_module] ." where " . $tableId_array[$return_module] . "='".$id."'"; $result = $adb->query($delete_query); - + //Inserting changed owner information to salesmanactivityrel table + $insert = "insert into vtiger_salesmanactivityrel values(".$idval.",".$id.")"; + $result = $adb->query($insert); //Now we have to update the smownerid $sql = "update vtiger_crmentity set modifiedby=".$current_user->id.",smownerid='" .$idval ."', modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid='" .$id."'"; $result = $adb->query($sql); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 02:29:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 10:29:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9819 - /vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php Message-ID: <20061113102913.9B903787FBF@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 03:29:08 2006 New Revision: 9819 Log: Export report to excel - fields truncated : fixed. Fixes #2449 Modified: vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php Modified: vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php ============================================================================== --- vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php (original) +++ vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php Mon Nov 13 03:29:08 2006 @@ -110,7 +110,7 @@ $rowmax = 65536; // 16384 in Excel 5 $colmax = 256; - $strmax = 255; + $strmax = 20000; $this->_name = $name; $this->_index = $index; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 03:48:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 11:48:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9820 - /vtigercrm/branches/5.0.3/include/language/en_us.lang.php Message-ID: <20061113114856.484F9787FBF@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 04:48:44 2006 New Revision: 9820 Log: Modified the Quick Create Labels for Module Addition Tools Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/include/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/include/language/en_us.lang.php Mon Nov 13 04:48:44 2006 @@ -1,1255 +1,762 @@ -'ISO-8859-1', - -'LBL_BROWSER_TITLE'=>'vtiger CRM 5 - Commercial Open Source CRM', - -'LBL_MY_ACCOUNT'=>'My Account', - -'LBL_MY_PREFERENCES'=>'My Preferences', - -'LBL_ADMIN'=>'Admin', - -'LBL_LOGOUT'=>'Sign out', - -'LBL_SEARCH'=>'Search', - -'LBL_LAST_VIEWED'=>'Last Viewed', - -'LBL_TODAY'=>'Today', - -'LBL_ALL'=>'All', - -'LBL_SHOW'=>'Show :', - -'today'=>"Today's", - -'all'=>'All', - -'LBL_UPCOMING_EVENTS'=>'Upcoming Activities', - -'LBL_PENDING_EVENTS'=>'Pending Activities', - -'NTC_WELCOME_MESSAGE'=>"Welcome to vtiger CRM!", - -'NTC_DESCRIPTION'=>"Use a valid username and password to login to the vtiger CRM.", - -'NTC_WELCOME'=>'Welcome', - -'NTC_NO_ITEMS_DISPLAY'=>'none', - -'LBL_OR'=>'or', - -'LBL_ALT_HOT_KEY'=>'Alt+', -//added for 4.2 -'LBL_SAVE_LABEL'=>'Save', - -'LBL_SEND_MAIL_BUTTON'=>'Send Mail', - - -'LBL_SAVE_BUTTON_TITLE'=>'Save [Alt+S]', - -'LBL_EDIT_BUTTON_TITLE'=>'Edit [Alt+E]', - -'LBL_CONVERTSO_BUTTON_TITLE'=>'Create SalesOrder', -'LBL_CONVERTINVOICE_BUTTON_TITLE'=>'Create Invoice', - -'LBL_EDIT_BUTTON'=>'Edit', - -'LBL_DUPLICATE_BUTTON_TITLE'=>'Duplicate [Alt+U]', - -'LBL_DUPLICATE_BUTTON'=>'Duplicate', - -'LBL_TABCUSTOMISE_BUTTON_TITLE'=>'Customise [Alt+C]', - -'LBL_FORUM_HIDE_BUTTON_TITLE'=>'Hide Forum [Alt+I]', - -'LBL_FORUM_HIDE_BUTTON_KEY'=>'H', - -'LBL_FORUM_SHOW_BUTTON_TITLE'=>'Show Forum [Alt+W]', - -'LBL_FORUM_SHOW_BUTTON_KEY'=>'W', - -'LBL_TABCUSTOMISE_BUTTON'=>'Customise', - -'LBL_DELETE_BUTTON_TITLE'=>'Delete [Alt+D]', - -'LBL_DELETE_BUTTON'=>'Delete', - -'LBL_FIND_BUTTON'=>'Find', - -'LBL_CONVERT_BUTTON_TITLE'=>'Convert [Alt+C]', - -'LBL_CONVERT_BUTTON_KEY'=>'C', - -'LBL_CONVERT_BUTTON_LABEL'=>'Convert Lead', - -'LBL_TABCUSTOMISE_BUTTON_KEY'=>'C', - -'LBL_TABCUSTOMISE_BUTTON_LABEL'=>'Customize Tab', - -'LBL_ROLES_BUTTON_LABEL'=>'Show Roles', - -'LBL_LISTROLES_BUTTON_LABEL'=>'List Roles', - -'LBL_FORUM_HIDE_BUTTON_LABEL'=>'Hide Forums', - -'LBL_FORUM_SHOW_BUTTON_LABEL'=>'Show Forums', - -'LBL_NEW_BUTTON_TITLE'=>'New [Alt+N]', - -'LBL_CHANGE_BUTTON_TITLE'=>'Change [Alt+G]', - -'LBL_CANCEL_BUTTON_TITLE'=>'Cancel [Alt+X]', - -'LBL_SEARCH_BUTTON_TITLE'=>'Search [Alt+Q]', - -'LBL_CLEAR_BUTTON_TITLE'=>'Clear [Alt+C]', - -'LBL_SELECT_BUTTON_TITLE'=>'Select [Alt+T]', - -'LBL_CREATE_BUTTON_LABEL' =>'Create', - -'LBL_GENERATE'=>'Generate', - -'LBL_SAVE_BUTTON_KEY'=>'S', - -'LBL_EDIT_BUTTON_KEY'=>'E', -'LBL_CONVERTSO_BUTTON_KEY'=>'S', -'LBL_CONVERTINVOICE_BUTTON_KEY'=>'I', - -'LBL_DUPLICATE_BUTTON_KEY'=>'U', - -'LBL_DELETE_BUTTON_KEY'=>'D', - -'LBL_NEW_BUTTON_KEY'=>'N', - -'LBL_CHANGE_BUTTON_KEY'=>'G', - -'LBL_CANCEL_BUTTON_KEY'=>'X', - -'LBL_SEARCH_BUTTON_KEY'=>'Q', - -'LBL_CLEAR_BUTTON_KEY'=>'C', - -'LBL_SELECT_BUTTON_KEY'=>'T', - -'LBL_SAVE_BUTTON_LABEL'=>'Save', - -'LBL_EDIT_BUTTON_LABEL'=>'Edit', -'LBL_CONVERTSO_BUTTON_LABEL'=>'Create SalesOrder', -'LBL_CONVERTINVOICE_BUTTON_LABEL'=>'Create Invoice', - -'LBL_DUPLICATE_BUTTON_LABEL'=>'Duplicate', - -'LBL_DELETE_BUTTON_LABEL'=>'Delete', - -'LBL_NEW_BUTTON_LABEL'=>'New', - -'LBL_CHANGE_BUTTON_LABEL'=>'Change', - -'LBL_CANCEL_BUTTON_LABEL'=>'Cancel', - -'LBL_SEARCH_BUTTON_LABEL'=>'Search', - -'LBL_CLEAR_BUTTON_LABEL'=>'Clear', - -'LBL_SELECT_BUTTON_LABEL'=>'Select', - -'LBL_SELECT_CONTACT_BUTTON_TITLE'=>'Select Contact [Alt+T]', - -'LBL_SELECT_CONTACT_BUTTON_KEY'=>'T', - -'LBL_SELECT_CONTACT_BUTTON_LABEL'=>'Select Contact', - -'LBL_SELECT_CAMPAIGN_BUTTON_LABEL'=>'Select Campaign', - -'LBL_SELECT_USER_BUTTON_TITLE'=>'Select User [Alt+U]', - -'LBL_SELECT_USER_BUTTON_KEY'=>'U', - -'LBL_SELECT_USER_BUTTON_LABEL'=>'Select User', - -'LBL_SETTINGS'=>'Settings', - -'LBL_LIST_USERIP'=>'User IP', - -'LBL_LIST_SIGNIN'=>'Sign in Time', - -'LBL_LIST_SIGNOUT'=>'Sign out Time', - -'LBL_LIST_STATUS'=>'Status', - - - -'LBL_LIST_NAME'=>'Name', - -'LBL_LIST_USER_NAME'=>'User Name', - -'LBL_LIST_EMAIL'=>'Email', - -'LBL_LIST_PHONE'=>'Phone', - -'LBL_LIST_CONTACT_NAME'=>'Contact Name', - -'LBL_LIST_ACCOUNT_NAME'=>'Account Name', - -'LBL_USER_LIST'=>'User List', - -'LBL_CONTACT_LIST'=>'Contact List', - -'LBL_LNK_SETTINGS'=> 'Settings', - -'LNK_IMPORT_LEADS'=>'Import Leads', - -'LBL_LOCATE_MAP'=>'Locate Map', - -'LBL_ADDRESS'=>'Address', - -'LBL_ADD_TAG'=>'Add Tag', - -'LBL_TAG_IT'=>'Tag it', - -'LBL_CLOSE'=>'Close', - -'LNK_ADVANCED_SEARCH'=>'Advanced Search', - -'LNK_BASIC_SEARCH'=>'Basic Search', - -'LNK_EDIT'=>'edit', - -'LNK_REMOVE'=>'rem', - -'LNK_DELETE'=>'del', - -'LNK_LIST_START'=>'Start', - -'LNK_LIST_NEXT'=>'Next', - -'LNK_LIST_PREVIOUS'=>'Previous', - -'LNK_LIST_END'=>'End', - -'LBL_LIST_OF'=>'of', - -'LNK_PRINT'=>'Print', - -'LNK_HELP'=>'Help', - -'LNK_VTDOCS'=>'vtiger Docs', - -'LNK_ABOUT'=>'About', - -'LNK_OUTLOOK'=>'./include/images/outlook_download.gif', - -'LNK_NEW_HDESK'=>'New Ticket', - -'LNK_NEW_PRODUCT'=>'New Product', - -'LNK_NEW_CONTACT'=>'New Contact', - -'LNK_NEW_CAMPAIGN'=>'New Campaign', - -'LNK_NEW_LEAD'=>'New Lead', - -'LNK_NEW_ACCOUNT'=>'New Account', - -'LNK_NEW_OPPORTUNITY'=>'New Potential', - -'LNK_NEW_NOTE'=>'New Note', - -'LNK_NEW_EMAIL'=>'New Email', - -'LNK_NEW_TASK'=>'New Task', - -'LNK_NEW_EVENT'=>'New Event', -'LNK_NEW_QUOTE'=>'New Quote', -'LNK_NEW_PO'=>'New Purchase Order', -'LNK_NEW_SO'=>'New Sales Order', -'LNK_NEW_INVOICE'=>'New Invoice', -'LNK_NEW_VENDOR'=>'New Vendor', -'LNK_NEW_PRICEBOOK'=>'New PriceBook', - - -'NTC_REQUIRED'=>'Indicates required field', - -'LBL_REQUIRED_SYMBOL'=>'*', - -'LBL_CURRENCY_SYMBOL'=>'$', - -'LBL_THOUSANDS_SYMBOL'=>'K', - -'NTC_DATE_FORMAT'=>'(yyyy-mm-dd)', - -'NTC_TIME_FORMAT'=>'(24:00)', - -'NTC_DATE_TIME_FORMAT'=>'(yyyy-mm-dd 24:00)', - -'NTC_DELETE_CONFIRMATION'=>'Are you sure you want to delete this record?', - -'ERR_DELETE_RECORD'=>'A record number must be specified to delete the contact.', - -'ERR_CREATING_TABLE'=>'Error creating table: ', - -'ERR_CREATING_FIELDS'=>'Error filling in additional detail fields: ', - -'ERR_MISSING_REQUIRED_FIELDS'=>'Missing required fields:', - -'ERR_INVALID_EMAIL_ADDRESS'=>'not a valid email address.', - -'ERR_INVALID_DATE_FORMAT'=>'The date format must be: yyyy-mm-dd', - -'ERR_INVALID_MONTH'=>'Please enter a valid month.', - -'ERR_INVALID_DAY'=>'Please enter a valid day.', - -'ERR_INVALID_YEAR'=>'Please enter a valid 4 digit year.', - -'ERR_INVALID_DATE'=>'Please enter a valid date.', - -'ERR_INVALID_HOUR'=>'Please enter a valid hour.', - -'ERR_INVALID_TIME'=>'Please enter a valid time.', - -'NTC_CLICK_BACK'=>'Please click the browser back button and fix the error.', - -'LBL_LIST_ASSIGNED_USER'=>'Assigned To', - -'LBL_ASSIGNED_TO'=>'Assigned To:', - -'LBL_DATE_MODIFIED'=>'Last Modified:', - -'LBL_DATE_ENTERED'=>'Created:', - -'LBL_CURRENT_USER_FILTER'=>'Only my items:', - -'NTC_LOGIN_MESSAGE'=>"Login", - -'LBL_NONE'=>'--None--', - -'LBL_BACK'=>'Back', - -'LBL_IMPORT'=>'Import', - -'LBL_EXPORT'=>'Export', - -'LBL_EXPORT_ALL'=>'Export All', - -'LBL_QUICK_CREATE'=>'Quick Create', - -'Export'=>'Export', -'Import'=>'Import', -'Merge'=>'Merge', -'ConvertLead'=>'ConvertLead', - - -'LBL_SHOW_RESULTS'=>'Show Results in', -'LBL_TOTAL_RECORDS_FOUND'=>'Total Records found :', -'LBL_SEARCH_RESULTS_FOR'=>' -- Search results for ', -'LBL_TAG_SEARCH'=>' -- Tag search for ', -'LBL_NO_DATA'=>'No Data Found', - - -//3.2 release - -'NTC_MERGE_CONFIRMATION'=>'Are you sure you want to merge this record?', - -'LBL_MERGE_BUTTON_TITLE'=>'Merge', - -'LBL_MERGE_BUTTON_KEY'=> 'Merge', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE'=>'Select Email Template', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_KEY'=>'Select Email Template', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL'=>'Select Email Template', - -'LBL_MERGE_BUTTON_LABEL'=>'Merge', - -'LBL_SENDMAIL_BUTTON_TITLE'=>'SendMail', - -'LBL_SENDMAIL_BUTTON_KEY'=> 'SendMail', - -'LBL_SENDMAIL_BUTTON_LABEL'=>'Send Mail', - - - -//Added fields for upload file as attachment -- 4 Beta - -'LBL_UPD_DESC'=>'Description', - -'LBL_FILENAME'=>'File Name', - -'LBL_FILE'=>'File', - -'LBL_TYPE'=>'File Type', - -'LBL_DOWNLOAD'=>'Download Now', - -'LBL_OPERATION'=>'Operation', - -'LBL_GROUP_ALLOCATION_TITLE'=>'My Group Allocation ', - -'LBL_ENTITY_NAME'=>'Entity Name', - -'LBL_GROUP_NAME'=>'Group', - -'LBL_ENTITY_TYPE'=>'Type', - - - -//Added fields for Ticket Attachment in RelatedTicketListUtil - -'LBL_NEW_TICKET'=>'New Ticket', - -'LBL_TITLE'=>'Title', - -'LBL_PRIORITY'=>'Priority', - -'LBL_STATUS'=>'Status', - - - -//Added fields for Change Owner and Change Status in all modules -- after 4 Beta - -'LBL_CHANGE_OWNER'=>'Change Owner', - -'LBL_CHANGE_STATUS'=>'Change Status', - -'LBL_MASS_DELETE'=>'Delete', -//added by raju - -'LBL_ADD_ITEM'=>'Add', - -'LBL_ADD_NEW'=>'Add', - -'LBL_DEDUCT'=>'Deduct', -//Added for version 5 - -'LBL_CALENDAR_TITLE'=>'Open Calendar...', -'LBL_CALENDAR_ALT'=>'Open Calendar...', - -'LBL_CALCULATOR_TITLE'=>'Open Calculator...', -'LBL_CALCULATOR_ALT'=>'Open Calculator...', - -'LBL_CLOCK_TITLE'=>'Show World Clock...', -'LBL_CLOCK_ALT'=>'Show World Clock...', - -'LBL_ALL_MENU_TITLE'=>'Open All Menu...', -'LBL_ALL_MENU_ALT'=>'Open All Menu...', - -'LBL_CHAT_TITLE'=>'Chat...', -'LBL_CHAT_ALT'=>'Chat...', - -'LBL_SEARCH_TITLE'=>'Search in ', -'LBL_SEARCH_ALT'=>'Search in ', - -'LBL_SEARCH_STRING'=>'Search...', - -'LBL_SEARCH_FOR'=>'Search for', -'LBL_SEARCH_NOW_BUTTON'=>'Search Now', -'LBL_GO_TO'=>'Go to', -'LBL_FEWER_BUTTON'=>'Fewer', -'LBL_IN'=>'In', - -'LBL_ADV_SEARCH_MSG_ANY'=>'Match Any of the Following', -'LBL_ADV_SEARCH_MSG_ALL'=>'Match All of the Following', - -'COMBO_ALL'=>'All', - -// Added fields for Related Field Display Informations in Detail View of All Modules - -'LBL_OPEN_ACTIVITIES'=>'Open Activities', - -'LBL_HISTORY'=>'History', - -'LBL_ACTIVITY_HISTORY'=>'Activity History', - -'LBL_ATTACHMENTS'=>'Attachments', - -'LBL_ATTACHMENT'=>'Attachment', - -'LBL_TYPE'=>'Type', - -'LBL_ASSIGNED_TO'=>'Assigned To', - -'LBL_TIME'=>'Time', - -'LBL_ACTION'=>'Action', - -'LBL_SUBJECT'=>'Subject', - -'LBL_RELATED_TO'=>'Related To', - -//added by raju for emails - -'LBL_MULTIPLE'=>'Multiple', - -'LBL_DUE_DATE'=>'Due Date', - -'LBL_LAST_MODIFIED'=>'Last Modified', - -'LBL_CREATED'=>'Created', // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Added - -'LBL_DESCRIPTION'=>'Description', - - - -'LBL_NEW_TASK'=>'New Task', - -'LBL_NEW_EVENT'=>'New Event', - -'LBL_ATTACHMENT_AND_NOTES'=>'Attachments & Notes', - -'LBL_POTENTIAL_NAME'=>'Potential Name', - -'LBL_CONTACT_NAME'=>'Contact Name', - -'LBL_DEPARTMENT'=>'Department', - -'LBL_ROLE'=>'Role', - -'LBL_EMAIL'=>'Email', - -'LBL_PHONE'=>'Phone', - -'LBL_PRODUCT'=>'Product', - -'LBL_AMOUNT'=>'Amount', - -'LBL_CLOSE_DATE'=>'Close Date', - -'LBL_NEW_ATTACHMENT'=>'New Attachment', - -'LBL_NEW_NOTE'=>'New Note', - - - -'LBL_PRODUCT_TITLE'=>'Products', - -'LBL_NEW_PRODUCT'=>'New Product', - -'LBL_PRODUCT_NAME'=>'Product Name', - -'LBL_QUANTITY'=>'Quantity', - -'LBL_SALES_PRICE'=>'Sale Price', - -'LBL_PURCHASE_DATE'=>'Purchase Date', - -'LBL_TICKET_ID'=>'Ticket Id', - -'LBL_NEW_TICKET'=>'New Ticket', - -'LBL_TICKETS'=>'Tickets', - - - -'LBL_POTENTIAL_TITLE'=>'Potentials', - -'LBL_NEW_POTENTIAL'=>'New Potential', - -'LBL_LEAD_NAME'=>'Lead Name', - -'LBL_ACCOUNT_NAME'=>'Account Name', - -'LBL_ACCOUNT_TYPE'=>'Account Type', - -'LBL_USER_TITLE'=>'Users', - -'LBL_CONTACT_TITLE'=>'Contacts', - - - -// 4 GA - -'LBL_SHOWING' => 'Showing', - -// - - - -//Added fields after RC1 - Release - -'LBL_SELECT_PRODUCT_BUTTON_LABEL'=>'Select Product', - -'LBL_VIEW'=>'Filters :', -// Mike Crowe Mod --------------------------------------------------------Added for group sort -'LBL_GROUP_VIEW'=>'Group', - - -'LBL_SALES_STAGE'=>'Sales Stage', - -'LBL_PROBABILITY'=>'Probability', - -'LBL_BULK_MAILS'=>'Bulk Mails', - - - -'LBL_WORLD_CLOCK'=>'World Clock', - -'LBL_CALCULATOR'=>'Calculator', - -'LBL_CLOSE_WON' =>'Closed Won', # 'Closed Won' -'LBL_CLOSE_LOST'=>'Closed Lost', # 'Closed Lost' - -'LBL_USER'=>'User', - -'LBL_TEAM'=>'Team', - -'LBL_GROUP'=>'Group', - -'LBL_NONE_NO_LINE'=>'none', - -'LBL_SELECT_GROUP'=>'Select a group', - -'LBL_HOUR_AND_MINUTE'=>'(hours/minutes)', - -'YEAR_MONTH_DATE'=>'24:00', - - - -'COMBO_LEADS'=>'Leads', - -'COMBO_ACCOUNTS'=>'Accounts', - -'COMBO_CONTACTS'=>'Contacts', - -'COMBO_POTENTIALS'=>'Potentials', - -'COMBO_PRODUCTS'=>'Products', - -'COMBO_HELPDESK'=>'Trouble Tickets', - -'COMBO_USERS'=>'Users', - -'COMBO_CAMPAIGNS'=>'Campaigns', - - -'LBL_SELECT'=>'Select', - -'LBL_EDIT'=>'Edit', - -'LBL_DELETE'=>'Delete', - - - -//List Fields - -'Name'=>'Name', - -'Company'=>'Company', - -'Phone'=>'Phone', - -'Website'=>'Website', - -'Email'=>'Email', - -'Assigned To'=>'Assigned To', - -'Account Name'=>'Account Name', - -'City'=>'City', - -'Title'=>'Title', - -'Potential'=>'Potential', - -'Sales Stage'=>'Sales Stage', - -'Amount'=>'Amount', - -'Expected Close'=>'Expected Close', - -'Subject'=>'Subject', - -'Contact Name'=>'Contact Name', - -'Related to'=>'Related To', - -'File'=>'File', - -'Last Modified'=>'Last Modified', - -'Close'=>'Close', - -'Type'=>'Type', - -'Start Date/Due Date'=>'Start Date/Due Date', - -'Date Sent'=>'Date Sent', - -'Ticket ID'=>'Ticket ID', - -'Status'=>'Status', - -'Priority'=>'Priority', - -'Product Name'=>'Product Name', - -'Product Code'=>'Part Number', - -'Commission Rate'=>'Commission Rate', - -'Qty/Unit'=>'Qty/Unit', - -'Unit Price'=>'Unit Price', - -'Question'=>'Question', - -'Category'=>'Category', - -'Price Book Name'=>'Price Book Name', -'LBL_EVENT_ENDDATE'=>'End Date & Time', - -//Added after 4 GA -'LBL_CUSTOM_INFORMATION'=>'Custom Information', - -//Added fields to display the related lists titles and None Scheduled -'LBL_NONE_SCHEDULED'=>'None Scheduled', - -'Leads'=>'Leads', -'Accounts'=>'Accounts', -'Accounts & Contacts'=>'Accounts & Contacts', -'Contacts'=>'Contacts', -'Potentials'=>'Potentials', -'Products'=>'Products', -'Emails'=>'Emails', -'HelpDesk'=>'Trouble Tickets', -'Activities'=>'Activities', -'Events'=>'Events', -'Tasks'=>'Tasks', -'Todo'=>'To Do', -'Call'=>'Call', -'Meeting'=>'Meeting', -'Quotes'=>'Quotes', -'PriceBook'=>'Price Books', -'PurchaseOrder'=>'Purchase Order', -'SalesOrder'=>'Sales Order', -'Invoice'=>'Invoices', -'Calendar'=>'Calendar', -'Home'=>'Home', -'Campaigns'=>'Campaigns', -'PriceBooks'=>'Price Books', -'Notes'=>'Notes', -'Faq'=>'FAQ', -'Dashboards'=>'Dashboard', -'Reports'=>'Reports', -'Vendors'=>'Vendors', -'Rss'=>'RSS', -'Portal'=>'My Sites', -'Webmails'=>'Webmails', -'Attachments'=>'Attachments', -'Activity History'=>'Activity History', -'Ticket History'=>'Ticket History', -'Purchase Order'=>'Purchase Order', -'Sales Stage History'=>'Sales Stage History', -'Users'=>'Users', -'Admin'=>'Admin', -'PurchaseOrder Status History'=>'PurchaseOrder Status History', -'SalesOrder Status History'=>'SalesOrder Status History', -'Quote Stage History'=>'Quote Stage History', -'Invoice Status History'=>'Invoice Status History', -'LBL_TROUBLE_TICKET'=>'Trouble Ticket', - -//Added language for Parent Tab - -'My Home Page'=>'My Home Page', -'Marketing'=>'Marketing', -'Sales'=>'Sales', -'Support'=>'Support', -'Analytics'=>'Analytics', -'Inventory'=>'Inventory', -'Tools'=>'Tools', -'Settings'=>'Settings', - -'LBL_INFORMATION'=>'Information', -'LBL_MORE'=>'More', -'LBL_BASIC'=>'Basic', -'LBL_CREATING'=>'Creating', -'LBL_EDITING'=>'Editing', -'LBL_NEW'=>'New', - -//Added for Detail/Edit/Related List of all modules - -'Lead'=>'Lead', -'Account'=>'Account', -'Contact'=>'Contact', -'Potential'=>'Potential', -'Opportunity'=>'Potential', -'Product'=>'Product', -'Email'=>'Email', -'Activity'=>'Activity', -'Event'=>'Event', -'Task'=>'Task', -'Quote'=>'Quote', -'PriceBook'=>'PriceBook', -'PurchaseOrder'=>'Purchase Order', -'Ticket'=>'Ticket', -'SalesOrder'=>'Sales Orders', -'Campaign'=>'Campaign', -'Note'=>'Note', -'Dashboard'=>'Dashboards', -'Report'=>'Report', -'Vendor'=>'Vendor', -'Webmail'=>'Webmail', - -'LBL_NONE_INCLUDED'=>'None Included', -'LBL_ADD_TO'=>'Add to', - -'LBL_SELECT_TEMPLATE_TO_MAIL_MERGE'=>'Select template to Mail Merge:', -'LBL_TITLE_OR_DESCRIPTION'=>'Title / Description', - -//Added for RSS Module -'LBL_RSS_FEEDS'=>'RSS Feeds', -'LBL_ADD_RSS_FEEDS'=>'Add New RSS Feed', - -//Added fields after 4.2 alpha -'COMBO_ACCOUNTS'=>'Accounts', -'LNK_NEW_FAQ'=>'New FAQ', -'Vendor Name'=>'Vendor Name', -'LNK_WEARE'=>'About us', -'LBL_ABOUTUS_TITLE'=>'vtiger CRM - About Us', -'LBL_DISCUSS'=>'Discuss with other users', -'Quote Stage'=>'Quote Stage', -'Potential Name'=>'Potential Name', -'Total'=>'Total Amount', -'First Name'=>'First Name', -'Last Name'=>'Last Name', -'User Name'=>'User Name', - /* For purchase order related list in vendor */ -'LBL_PORDER_BUTTON_TITLE'=>'New Purchase Order [Alt+O]', -'LBL_PORDER_BUTTON'=>'New Purchase Order', -'LBL_PORDER_BUTTON_KEY'=>'O', -'Tracking Number'=>'Tracking Number', -'Order Id'=>'Order Id', -'Quote Name'=>'Quote Name', -'Invoice Id'=>'Invoice Id', -'Quote Id'=>'Quote Id', -'Sales Order'=>'Sales Order', - // Added Quote in activity parent type selection / Related list -'COMBO_QUOTES'=>'Quotes', -'End Date'=>'End Date', -'Start Date'=>'Start Date', -'Related to'=>'Related To', -'Recurring Type'=> 'Recurring Type', -'SalesOrders'=> 'Sales Order', -'PurchaseOrder'=> 'Purchase Orders', -'LBL_QUOTE_NAME'=>'Quote Name', - //Added Orders in activity parent type selection / Related list -'LBL_NEW_QUOTE_BUTTON_TITLE'=>'New Quote [Alt+Q]', -'LBL_NEW_QUOTE_BUTTON_KEY'=>'Q', -'LBL_NEW_QUOTE_BUTTON'=>'New Quote', -'COMBO_PORDER'=>'Purchase Order', -'COMBO_SORDER'=>'Sales Order', -'LBL_PORDER_NAME'=>'Purchase Order', -'LBL_SORDER_NAME'=>'Sales Order', - // Added Invoice in activity parent type selection / Related list -'COMBO_INVOICES'=>'Invoice', -'LBL_INVOICE_NAME'=>'Invoice', -'LBL_HELPDESK_NAME'=>'Trouble Ticket', -'LBL_CAMPAIGN_NAME'=>'Campaign Name', - -'LBL_NEW_INVOICE_BUTTON_TITLE'=>'New Invoice [Alt+I]', -'LBL_NEW_INVOICE_BUTTON_KEY'=>'I', -'LBL_NEW_INVOICE_BUTTON'=>'New Invoice', -'LBL_NEW_SORDER_BUTTON_TITLE'=>'New Sales Order [Alt+E]', -'LBL_NEW_SORDER_BUTTON_KEY'=>'E', -'LBL_NEW_SORDER_BUTTON'=>'New Sales Order', - -'LBL_PRODUCT_DETAILS'=>'Product Details', -'LBL_PRODUCT'=>'Product', -'LBL_QTY_IN_STOCK'=>'Qty In Stock', -'LBL_QTY'=>'Qty', -'LBL_UNIT_PRICE'=>'Unit Price', -'LBL_LIST_PRICE'=>'List Price', -'LBL_TOTAL'=>'Total', -'LBL_ADD_PRODUCT'=>'Add Product', -'LBL_SUB_TOTAL'=>'Sub Total', -'LBL_TAX'=>'Tax', -'LBL_ADJUSTMENT'=>'Adjustment', -'LBL_GRAND_TOTAL'=>'Grand Total', -'LBL_QUOTE_ID'=>'Quote Id', -'LBL_SALES_ORDER_ID'=>'Sales Order Id', -'LBL_PURCHASE_ORDER_ID'=>'Purchase Order Id', -'LBL_EXPORT_TO_PDF'=>'Export To PDF', - -//Added for 4.2 Patch I -'LBL_HOME_KEY_METRICS'=>'Key Metrics', -'LBL_HOME_METRICS'=>'Metrics', -'LBL_HOME_COUNT'=>'Count', - -//Added for 4.2 patch 2 -'LBL_JSCALENDAR_LANG'=>'en', -'LNK_CV_EDIT'=>'Edit', -'LNK_CV_DELETE'=>'Delete', -'LNK_CV_CREATEVIEW'=>'New', -//Added for 5.0 -'LBL_UPD_FIELD_ORD'=>'Update Field Order', -'LBL_SEND_CUSTOM_MAIL_BUTTON'=>'Send Custom Mail', -'LBL_UPDATED_TODAY'=>'Updated today', -'LBL_UPDATED'=>'Updated', -'LBL_DAY_AGO'=>'day ago', -'LBL_DAYS_AGO'=>'days ago', - -//Added to convert Month string in update info - ahmed - -'Jan'=>'Jan', -'Feb'=>'Feb', -'Mar'=>'Mar', -'Apr'=>'Apr', -'May'=>'May', -'Jun'=>'Jun', -'Jul'=>'Jul', -'Aug'=>'Aug', -'Sep'=>'Sep', -'Oct'=>'Oct', -'Nov'=>'Nov', -'Dec'=>'Dec', - -//Added after 5.0 Alpha5 -'Campaign Name'=>'Campaign Name', -'Campaign Type'=>'Campaign Type', -'Campaign Status'=>'Campaign Status', -'Expected Revenue'=>'Expected Revenue', -'Expected Close Date'=>'Expected Close Date', -'LBL_ACTIONS'=>'Actions', -'LBL_SEND'=>'Send', -'LBL_VAT'=>'VAT', -'LBL_SALES'=>'Sales', -'LBL_SERVICE'=>'Service', -'LBL_TAX_DETAILS'=>'Tax Details', -'LBL_TAX_CALCULATION'=>'Tax Calculation', -'COVERED_PERCENTAGE'=>'(%)', - -'LBL_TAG_CLOUD'=>'Tag Cloud', -'LBL_FOR'=>'for', -'LBL_PO_STATUS'=>'PurchaseOrder Status', -'LBL_SO_STATUS'=>'SalesOrder Status', -'LBL_INVOICE_STATUS'=>'Invoice Status', -'LBL_NOTE'=>'Note', -'LBL_MODULE'=>'Module', -'Active'=>'Active', -'Inactive'=>'Inactive', -'Today'=>'Today', -'Last 2 Days'=>'Last 2 Days', -'Last Week'=>'Last Week', -'This Week'=>'This Week', -'This Month'=>'This Month', -'This Year'=>'This Year', -'LBL_PLEASE_CLICK'=>'Please Click', -'LBL_TO_CONFIGURE'=>'to Configure', -'LBL_HERE'=>'here', -'LBL_RECORDS'=>'Records', -'LBL_SCROLL'=>'[Scroll to Top]', -'LBL_EXPAND_COLLAPSE'=>'Expand/Collapse', -'LBL_RCPY_ADDRESS'=>'Copy Shipping address', -'LBL_LCPY_ADDRESS'=>'Copy Billing address', -'LBL_RECORD_ID'=>'Record ID', -'LBL_ACTION_DATE'=>'Action Date', -'LBL_HOMEPAGE_DASHBOARD'=>'HomePage Dashboard', -'LBL_NO'=>'No', -'LBL_FOUND'=>'Found', -'LBL_YOU_CAN_CREATE'=>'You can Create', -'LBL_NOW'=>'now', -'LBL_CLICK_THE_LINK'=>'Click the link below', -'LBL_CREATE'=>'Create', -'LBL_A'=>'a', -'LBL_AN'=>'an', -'LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE'=>'You are not allowed to create', -'LBL_TRANSFER_OWNERSHIP'=>'Transfer Ownership to', -'LBL_SELECT_STATUS'=>'Select New Status', -'LBL_UPDATE_OWNER'=>'Update Owner', -'LBL_UPDATE_STATUS'=>'Update Status', - -//added for tax calculations - after 5beta2 -'LBL_NET_PRICE'=>'Net Price', -'LBL_TOOLS'=>'Tools', -'LBL_DISCOUNT'=>'Discount', -'LBL_TOTAL_AFTER_DISCOUNT'=>'Total After Discount', -'LBL_NET_TOTAL'=>'Net Total', -'LBL_SHIPPING_AND_HANDLING_CHARGES'=>'Shipping & Handling Charges', -'LBL_TAX_FOR_SHIPPING_AND_HANDLING'=>'Taxes For Shipping and Handling', -'LBL_FINISH'=>'Finish', -'LBL_IMAGE_DELETED'=>'Image Deleted', -'LBL_TAX_MODE'=>'Tax Mode', -'LBL_CLEAR_COMMENT'=>'Clear Comment', -'LBL_ZERO_DISCOUNT'=>'Zero Discount', -'LBL_OF_PRICE'=>'of Price', -'LBL_DIRECT_PRICE_REDUCTION'=>'Direct Price Reduction', -'LBL_INDIVIDUAL'=>'Individual', - -//Added the address strings for Contacts Module -'LBL_CPY_MAILING_ADDRESS'=>'Copy Mailing Address', -'LBL_CPY_OTHER_ADDRESS'=>'Copy Other Address', - -'LBL_PERMISSION'=>'You are not permitted to execute this Operation', -'VTIGER'=>'vtiger', - -//Added for Inventory Tax details -'LBL_DIRECT_AMOUNT_DISCOUNT'=>'Direct Amount Discount', -'LBL_NO_DISCOUNT_FOR_THIS_PRODUCT'=>'No Discount for this Product', -'LBL_TOTAL_TAX_AMOUNT'=>'Total Tax Amount', -'LBL_FINAL_DISCOUNT_AMOUNT'=>'Final Discount Amount', -'LBL_SHIPPING_AND_HANDLING_CHARGE'=>'Shipping & Handling Charge', -'LBL_GO_BACK'=>'Go Back', - -//Record deleted message -'LBL_RECORD_DELETE'=>'The record you are trying to view has been deleted.', -'Part Number'=>'Part Number', - -//Added after 5.0.1 -'Salutation'=>'Salutation ', -'Rating'=>'Rating', -'industry'=>'Industry', -'Severity'=>'Severity', -'Product Category'=>'Product Category', -'GL Account'=>'GL Account', -'Usage Unit'=>'Usage Unit', -'Carrier'=>'Carrier', -'Expected Response'=>'Expected Response', -'LBL_ADDRESS_INF'=>'Address Information', - -'yes'=>'yes', -'LBL_RENAMEPROFILE_BUTTON_LABEL'=>'Rename', -'LBL_RENAME_PROFILE'=>'Rename Profile', -'LBL_PROFILE_NAME'=>'Profile Name', -'LBL_START_DATE'=>'Start Date', -'LBL_END_DATE'=>'End Date', - -); - - - -//the left value is the key stored in the db and the right value is the display value - -//to translate, only modify the right value in each key/value pair - -$app_list_strings = Array( - -//e.g. auf Deutsch 'Contacts'=>'Contakten', - -'moduleList' => Array('Home'=>'Home' - - , 'Dashboard'=>'Dashboard' - - , 'Leads'=>'Leads' - - , 'Contacts'=>'Contacts' - - , 'Accounts'=>'Accounts' - - , 'Potentials'=>'Potentials' - - , 'Campaigns'=>'Campaigns' - - , 'Notes'=>'Notes' - - , 'Emails'=>'Emails' - - , 'Activities'=>'Activities' - - , 'Products'=>'Products' - - , 'HelpDesk'=>'Trouble Tickets' - - , 'Faq'=>'FAQ' - - , 'Calendar'=>'Calendar' - - , 'Quotes'=>'Quotes' - - , 'PurchaseOrder'=>'PurchaseOrder' - - , 'Invoice'=>'Invoice' - - , 'Rss'=>'RSS' - - , 'Reports'=>'Reports' - - , 'Vendors'=>'Vendors' - - , 'PriceBooks'=>'PriceBooks' - - , 'SalesOrder'=>'SalesOrder' - - , 'Portal'=>'My Sites' - - ), - - - -//Note: do not translate opportunity_relationship_type_default_key - -// it is the key for the default opportunity_relationship_type_dom value - -'opportunity_relationship_type_default_key' => 'Primary Decision Maker', - -'opportunity_relationship_type_dom' => Array(''=>'' - - , 'Primary Decision Maker'=>'Primary Decision Maker' - - , 'Business Decision Maker'=>'Business Decision Maker' - - , 'Business Evaluator'=>'Business Evaluator' - - , 'Technical Decision Maker'=>'Technical Decision Maker' - - , 'Technical Evaluator'=>'Technical Evaluator' - - , 'Executive Sponsor'=>'Executive Sponsor' - - , 'Influencer'=>'Influencer' - - , 'Other'=>'Other' - - ), - - - -//Note: do not translate case_relationship_type_default_key - -// it is the key for the default case_relationship_type_dom value - -'case_relationship_type_default_key' => 'Primary Contact', - -'case_relationship_type_dom' => Array(''=>'' - - , 'Primary Contact'=>'Primary Contact' - - , 'Alternate Contact'=>'Alternate Contact' - - ), - - - -'task_priority_dom' => Array('High'=>'High' - - , 'Medium'=>'Medium' - - , 'Low'=>'Low' - - ), - - - -'task_status_dom' => Array('Planned'=>'Planned' - - , 'Completed'=>'Completed' - - , 'Deferred'=>'Deferred' - - ), - - - -'meeting_status_dom' => Array('Planned'=>'Planned' - - , 'Held'=>'Held' - - , 'Not Held'=>'Not Held' - - ), - - - -'call_status_dom' => Array('Planned'=>'Planned' - - , 'Held'=>'Held' - - , 'Not Held'=>'Not Held' - - ), - - - -//Note: do not translate case_status_default_key - -// it is the key for the default case_status_dom value - -'case_status_default_key' => 'New', - -'case_status_dom' => Array('New'=>'New' - - , 'Assigned'=>'Assigned' - - , 'Closed'=>'Closed' - - , 'Pending Input'=>'Pending Input' - - , 'Rejected'=>'Rejected' - - ), - - - -'user_status_dom' => Array('Active'=>'Active' - - , 'Inactive'=>'Inactive' - - ), - - - -//Note: do not translate record_type_default_key - -// it is the key for the default record_type_module value - -'record_type_default_key' => 'Accounts', - -'record_type_display' => array('Accounts' => 'Account', - - 'Leads' => 'Lead', - - 'Opportunities' => 'Opportunity'), - -); - - - -?> + 'ISO-8859-1', + 'LBL_BROWSER_TITLE' => 'vtiger CRM 5 - Commercial Open Source CRM', + 'LBL_MY_ACCOUNT' => 'My Account', + 'LBL_MY_PREFERENCES' => 'My Preferences', + 'LBL_ADMIN' => 'Admin', + 'LBL_LOGOUT' => 'Sign out', + 'LBL_SEARCH' => 'Search', + 'LBL_LAST_VIEWED' => 'Last Viewed', + 'NTC_WELCOME_MESSAGE' => 'Welcome to vtiger CRM!', + 'NTC_DESCRIPTION' => 'Use a valid username and password to login to the vtiger CRM.', + 'NTC_WELCOME' => 'Welcome', + 'NTC_NO_ITEMS_DISPLAY' => 'none', + 'LBL_OR' => 'or', + 'LBL_ALT_HOT_KEY' => 'Alt+', + 'LBL_SAVE_LABEL' => 'Save', + 'LBL_SEND_MAIL_BUTTON' => 'Send Mail', + 'LBL_SAVE_BUTTON_TITLE' => 'Save [Alt+S]', + 'LBL_EDIT_BUTTON_TITLE' => 'Edit [Alt+E]', + 'LBL_CONVERTSO_BUTTON_TITLE' => 'Create SalesOrder', + 'LBL_CONVERTINVOICE_BUTTON_TITLE' => 'Create Invoice', + 'LBL_EDIT_BUTTON' => 'Edit', + 'LBL_DUPLICATE_BUTTON_TITLE' => 'Duplicate [Alt+U]', + 'LBL_DUPLICATE_BUTTON' => 'Duplicate', + 'LBL_TABCUSTOMISE_BUTTON_TITLE' => 'Customise [Alt+C]', + 'LBL_FORUM_HIDE_BUTTON_TITLE' => 'Hide Forum [Alt+I]', + 'LBL_FORUM_HIDE_BUTTON_KEY' => 'H', + 'LBL_FORUM_SHOW_BUTTON_TITLE' => 'Show Forum [Alt+W]', + 'LBL_FORUM_SHOW_BUTTON_KEY' => 'W', + 'LBL_TABCUSTOMISE_BUTTON' => 'Customise', + 'LBL_DELETE_BUTTON_TITLE' => 'Delete [Alt+D]', + 'LBL_DELETE_BUTTON' => 'Delete', + 'LBL_FIND_BUTTON' => 'Find', + 'LBL_CONVERT_BUTTON_TITLE' => 'Convert [Alt+C]', + 'LBL_CONVERT_BUTTON_KEY' => 'C', + 'LBL_CONVERT_BUTTON_LABEL' => 'Convert Lead', + 'LBL_TABCUSTOMISE_BUTTON_KEY' => 'C', + 'LBL_TABCUSTOMISE_BUTTON_LABEL' => 'Customize Tab', + 'LBL_ROLES_BUTTON_LABEL' => 'Show Roles', + 'LBL_LISTROLES_BUTTON_LABEL' => 'List Roles', + 'LBL_FORUM_HIDE_BUTTON_LABEL' => 'Hide Forums', + 'LBL_FORUM_SHOW_BUTTON_LABEL' => 'Show Forums', + 'LBL_NEW_BUTTON_TITLE' => 'New [Alt+N]', + 'LBL_CHANGE_BUTTON_TITLE' => 'Change [Alt+G]', + 'LBL_CANCEL_BUTTON_TITLE' => 'Cancel [Alt+X]', + 'LBL_SEARCH_BUTTON_TITLE' => 'Search [Alt+Q]', + 'LBL_CLEAR_BUTTON_TITLE' => 'Clear [Alt+C]', + 'LBL_SELECT_BUTTON_TITLE' => 'Select [Alt+T]', + 'LBL_CREATE_BUTTON_LABEL' => 'Create', + 'LBL_GENERATE' => 'Generate', + 'LBL_SAVE_BUTTON_KEY' => 'S', + 'LBL_EDIT_BUTTON_KEY' => 'E', + 'LBL_CONVERTSO_BUTTON_KEY' => 'S', + 'LBL_CONVERTINVOICE_BUTTON_KEY' => 'I', + 'LBL_DUPLICATE_BUTTON_KEY' => 'U', + 'LBL_DELETE_BUTTON_KEY' => 'D', + 'LBL_NEW_BUTTON_KEY' => 'N', + 'LBL_CHANGE_BUTTON_KEY' => 'G', + 'LBL_CANCEL_BUTTON_KEY' => 'X', + 'LBL_SEARCH_BUTTON_KEY' => 'Q', + 'LBL_CLEAR_BUTTON_KEY' => 'C', + 'LBL_SELECT_BUTTON_KEY' => 'T', + 'LBL_SAVE_BUTTON_LABEL' => 'Save', + 'LBL_EDIT_BUTTON_LABEL' => 'Edit', + 'LBL_CONVERTSO_BUTTON_LABEL' => 'Create SalesOrder', + 'LBL_CONVERTINVOICE_BUTTON_LABEL' => 'Create Invoice', + 'LBL_DUPLICATE_BUTTON_LABEL' => 'Duplicate', + 'LBL_DELETE_BUTTON_LABEL' => 'Delete', + 'LBL_NEW_BUTTON_LABEL' => 'New', + 'LBL_CHANGE_BUTTON_LABEL' => 'Change', + 'LBL_CANCEL_BUTTON_LABEL' => 'Cancel', + 'LBL_SEARCH_BUTTON_LABEL' => 'Search', + 'LBL_CLEAR_BUTTON_LABEL' => 'Clear', + 'LBL_SELECT_BUTTON_LABEL' => 'Select', + 'LBL_SELECT_CONTACT_BUTTON_TITLE' => 'Select Contact [Alt+T]', + 'LBL_SELECT_CONTACT_BUTTON_KEY' => 'T', + 'LBL_SELECT_CONTACT_BUTTON_LABEL' => 'Select Contact', + 'LBL_SELECT_CAMPAIGN_BUTTON_LABEL' => 'Select Campaign', + 'LBL_SELECT_USER_BUTTON_TITLE' => 'Select User [Alt+U]', + 'LBL_SELECT_USER_BUTTON_KEY' => 'U', + 'LBL_SELECT_USER_BUTTON_LABEL' => 'Select User', + 'LBL_SETTINGS' => 'Settings', + 'LBL_LIST_USERIP' => 'User IP', + 'LBL_LIST_SIGNIN' => 'Sign in Time', + 'LBL_LIST_SIGNOUT' => 'Sign out Time', + 'LBL_LIST_STATUS' => 'Status', + 'LBL_LIST_NAME' => 'Name', + 'LBL_LIST_USER_NAME' => 'User Name', + 'LBL_LIST_EMAIL' => 'Email', + 'LBL_LIST_PHONE' => 'Phone', + 'LBL_LIST_CONTACT_NAME' => 'Contact Name', + 'LBL_LIST_ACCOUNT_NAME' => 'Account Name', + 'LBL_USER_LIST' => 'User List', + 'LBL_CONTACT_LIST' => 'Contact List', + 'LBL_LNK_SETTINGS' => 'Settings', + 'LNK_IMPORT_LEADS' => 'Import Leads', + 'LBL_LOCATE_MAP' => 'Locate Map', + 'LBL_ADDRESS' => 'Address', + 'LBL_ADD_TAG' => 'Add Tag', + 'LBL_TAG_IT' => 'Tag it', + 'LBL_CLOSE' => 'Close', + 'LNK_ADVANCED_SEARCH' => 'Advanced Search', + 'LNK_BASIC_SEARCH' => 'Basic Search', + 'LNK_EDIT' => 'edit', + 'LNK_REMOVE' => 'rem', + 'LNK_DELETE' => 'del', + 'LNK_LIST_START' => 'Start', + 'LNK_LIST_NEXT' => 'Next', + 'LNK_LIST_PREVIOUS' => 'Previous', + 'LNK_LIST_END' => 'End', + 'LBL_LIST_OF' => 'of', + 'LNK_PRINT' => 'Print', + 'LNK_HELP' => 'Help', + 'LNK_VTDOCS' => 'vtiger Docs', + 'LNK_ABOUT' => 'About', + 'LNK_OUTLOOK' => './include/images/outlook_download.gif', + 'SINGLE_Accounts' => 'Account', + 'SINGLE_Contacts' => 'Contact', + 'SINGLE_Campaigns' => 'Campaign', + 'SINGLE_HelpDesk' => 'Ticket', + 'SINGLE_Leads' => 'Lead', + 'SINGLE_Events' => 'Event', + 'SINGLE_Calendar' => 'Task', + 'SINGLE_Dashboard' => 'Dashboard', + 'SINGLE_Emails' => 'Email', + 'SINGLE_Faq' => 'Faq', + 'SINGLE_Home' => 'Home', + 'SINGLE_Invoice' => 'Invoice', + 'SINGLE_Potentials' => 'Potential', + 'SINGLE_Notes' => 'Note', + 'SINGLE_Products' => 'Product', + 'SINGLE_Vendors' => 'Vendor', + 'SINGLE_PriceBooks' => 'PriceBook', + 'SINGLE_Quotes' => 'Quote', + 'SINGLE_PurchaseOrder' => 'PurchaseOrder', + 'SINGLE_SalesOrder' => 'SalesOrder', + 'SINGLE_Rss' => 'Rss', + 'SINGLE_Reports' => 'Report', + 'SINGLE_Portal' => 'Portal', + 'SINGLE_Webmails' => 'Webmail', + 'SINGLE_Users' => 'User', + 'NEW' => 'New', + 'NTC_REQUIRED' => 'Indicates required field', + 'LBL_REQUIRED_SYMBOL' => '*', + 'LBL_CURRENCY_SYMBOL' => '$', + 'LBL_THOUSANDS_SYMBOL' => 'K', + 'NTC_DATE_FORMAT' => '(yyyy-mm-dd)', + 'NTC_TIME_FORMAT' => '(24:00)', + 'NTC_DATE_TIME_FORMAT' => '(yyyy-mm-dd 24:00)', + 'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to delete this record?', + 'ERR_DELETE_RECORD' => 'A record number must be specified to delete the contact.', + 'ERR_CREATING_TABLE' => 'Error creating table: ', + 'ERR_CREATING_FIELDS' => 'Error filling in additional detail fields: ', + 'ERR_MISSING_REQUIRED_FIELDS' => 'Missing required fields:', + 'ERR_INVALID_EMAIL_ADDRESS' => 'not a valid email address.', + 'ERR_INVALID_DATE_FORMAT' => 'The date format must be: yyyy-mm-dd', + 'ERR_INVALID_MONTH' => 'Please enter a valid month.', + 'ERR_INVALID_DAY' => 'Please enter a valid day.', + 'ERR_INVALID_YEAR' => 'Please enter a valid 4 digit year.', + 'ERR_INVALID_DATE' => 'Please enter a valid date.', + 'ERR_INVALID_HOUR' => 'Please enter a valid hour.', + 'ERR_INVALID_TIME' => 'Please enter a valid time.', + 'NTC_CLICK_BACK' => 'Please click the browser back button and fix the error.', + 'LBL_LIST_ASSIGNED_USER' => 'Assigned To', + 'LBL_ASSIGNED_TO' => 'Assigned To', + 'LBL_DATE_MODIFIED' => 'Last Modified:', + 'LBL_DATE_ENTERED' => 'Created:', + 'LBL_CURRENT_USER_FILTER' => 'Only my items:', + 'NTC_LOGIN_MESSAGE' => 'Login', + 'LBL_NONE' => '--None--', + 'LBL_BACK' => 'Back', + 'LBL_IMPORT' => 'Import', + 'LBL_EXPORT' => 'Export', + 'LBL_EXPORT_ALL' => 'Export All', + 'LBL_QUICK_CREATE' => 'Quick Create', + 'Export' => 'Export', + 'Import' => 'Import', + 'Merge' => 'Merge', + 'ConvertLead' => 'ConvertLead', + 'LBL_SHOW_RESULTS' => 'Show Results in', + 'LBL_TOTAL_RECORDS_FOUND' => 'Total Records found :', + 'LBL_SEARCH_RESULTS_FOR' => ' -- Search results for ', + 'LBL_TAG_SEARCH' => ' -- Tag search for ', + 'LBL_NO_DATA' => 'No Data Found', + 'NTC_MERGE_CONFIRMATION' => 'Are you sure you want to merge this record?', + 'LBL_MERGE_BUTTON_TITLE' => 'Merge', + 'LBL_MERGE_BUTTON_KEY' => 'Merge', + 'LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE' => 'Select Email Template', + 'LBL_SELECTEMAILTEMPLATE_BUTTON_KEY' => 'Select Email Template', + 'LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL' => 'Select Email Template', + 'LBL_MERGE_BUTTON_LABEL' => 'Merge', + 'LBL_SENDMAIL_BUTTON_TITLE' => 'SendMail', + 'LBL_SENDMAIL_BUTTON_KEY' => 'SendMail', + 'LBL_SENDMAIL_BUTTON_LABEL' => 'Send Mail', + 'LBL_UPD_DESC' => 'Description', + 'LBL_FILENAME' => 'File Name', + 'LBL_FILE' => 'File', + 'LBL_TYPE' => 'Type', + 'LBL_DOWNLOAD' => 'Download Now', + 'LBL_OPERATION' => 'Operation', + 'LBL_GROUP_ALLOCATION_TITLE' => 'My Group Allocation ', + 'LBL_ENTITY_NAME' => 'Entity Name', + 'LBL_GROUP_NAME' => 'Group', + 'LBL_ENTITY_TYPE' => 'Type', + 'LBL_NEW_TICKET' => 'New Ticket', + 'LBL_TITLE' => 'Title', + 'LBL_PRIORITY' => 'Priority', + 'LBL_STATUS' => 'Status', + 'LBL_CHANGE_OWNER' => 'Change Owner', + 'LBL_CHANGE_STATUS' => 'Change Status', + 'LBL_MASS_DELETE' => 'Delete', + 'LBL_ADD_ITEM' => 'Add', + 'LBL_ADD_NEW' => 'Add', + 'LBL_DEDUCT' => 'Deduct', + 'LBL_CALENDAR_TITLE' => 'Open Calendar...', + 'LBL_CALENDAR_ALT' => 'Open Calendar...', + 'LBL_CALCULATOR_TITLE' => 'Open Calculator...', + 'LBL_CALCULATOR_ALT' => 'Open Calculator...', + 'LBL_CLOCK_TITLE' => 'Show World Clock...', + 'LBL_CLOCK_ALT' => 'Show World Clock...', + 'LBL_ALL_MENU_TITLE' => 'Open All Menu...', + 'LBL_ALL_MENU_ALT' => 'Open All Menu...', + 'LBL_CHAT_TITLE' => 'Chat...', + 'LBL_CHAT_ALT' => 'Chat...', + 'LBL_SEARCH_TITLE' => 'Search in ', + 'LBL_SEARCH_ALT' => 'Search in ', + 'LBL_SEARCH_STRING' => 'Search...', + 'LBL_SEARCH_FOR' => 'Search for', + 'LBL_SEARCH_NOW_BUTTON' => 'Search Now', + 'LBL_GO_TO' => 'Go to', + 'LBL_FEWER_BUTTON' => 'Fewer', + 'LBL_IN' => 'In', + 'LBL_ADV_SEARCH_MSG_ANY' => 'Match Any of the Following', + 'LBL_ADV_SEARCH_MSG_ALL' => 'Match All of the Following', + 'COMBO_ALL' => 'All', + 'LBL_OPEN_ACTIVITIES' => 'Open Activities', + 'LBL_HISTORY' => 'History', + 'LBL_ACTIVITY_HISTORY' => 'Activity History', + 'LBL_ATTACHMENTS' => 'Attachments', + 'LBL_ATTACHMENT' => 'Attachment', + 'LBL_TIME' => 'Time', + 'LBL_ACTION' => 'Action', + 'LBL_SUBJECT' => 'Subject', + 'LBL_RELATED_TO' => 'Related To', + 'LBL_MULTIPLE' => 'Multiple', + 'LBL_DUE_DATE' => 'Due Date', + 'LBL_LAST_MODIFIED' => 'Last Modified', + 'LBL_CREATED' => 'Created', + 'LBL_DESCRIPTION' => 'Description', + 'LBL_NEW_TASK' => 'New Task', + 'LBL_NEW_EVENT' => 'New Event', + 'LBL_ATTACHMENT_AND_NOTES' => 'Attachments & Notes', + 'LBL_POTENTIAL_NAME' => 'Potential Name', + 'LBL_CONTACT_NAME' => 'Contact Name', + 'LBL_DEPARTMENT' => 'Department', + 'LBL_ROLE' => 'Role', + 'LBL_EMAIL' => 'Email', + 'LBL_PHONE' => 'Phone', + 'LBL_PRODUCT' => 'Product', + 'LBL_AMOUNT' => 'Amount', + 'LBL_CLOSE_DATE' => 'Close Date', + 'LBL_NEW_ATTACHMENT' => 'New Attachment', + 'LBL_NEW_NOTE' => 'New Note', + 'LBL_PRODUCT_TITLE' => 'Products', + 'LBL_NEW_PRODUCT' => 'New Product', + 'LBL_PRODUCT_NAME' => 'Product Name', + 'LBL_QUANTITY' => 'Quantity', + 'LBL_SALES_PRICE' => 'Sale Price', + 'LBL_PURCHASE_DATE' => 'Purchase Date', + 'LBL_TICKET_ID' => 'Ticket Id', + 'LBL_TICKETS' => 'Tickets', + 'LBL_POTENTIAL_TITLE' => 'Potentials', + 'LBL_NEW_POTENTIAL' => 'New Potential', + 'LBL_LEAD_NAME' => 'Lead Name', + 'LBL_ACCOUNT_NAME' => 'Account Name', + 'LBL_ACCOUNT_TYPE' => 'Account Type', + 'LBL_USER_TITLE' => 'Users', + 'LBL_CONTACT_TITLE' => 'Contacts', + 'LBL_SHOWING' => 'Showing', + 'LBL_SELECT_PRODUCT_BUTTON_LABEL' => 'Select Product', + 'LBL_VIEW' => 'Filters :', + 'LBL_GROUP_VIEW' => 'Group', + 'LBL_SALES_STAGE' => 'Sales Stage', + 'LBL_PROBABILITY' => 'Probability', + 'LBL_BULK_MAILS' => 'Bulk Mails', + 'LBL_WORLD_CLOCK' => 'World Clock', + 'LBL_CALCULATOR' => 'Calculator', + 'LBL_CLOSE_WON' => 'Closed Won', + 'LBL_CLOSE_LOST' => 'Closed Lost', + 'LBL_USER' => 'User', + 'LBL_TEAM' => 'Team', + 'LBL_GROUP' => 'Group', + 'LBL_NONE_NO_LINE' => 'none', + 'LBL_SELECT_GROUP' => 'Select a group', + 'LBL_HOUR_AND_MINUTE' => '(hours/minutes)', + 'YEAR_MONTH_DATE' => '24:00', + 'COMBO_LEADS' => 'Leads', + 'COMBO_ACCOUNTS' => 'Accounts', + 'COMBO_CONTACTS' => 'Contacts', + 'COMBO_POTENTIALS' => 'Potentials', + 'COMBO_PRODUCTS' => 'Products', + 'COMBO_HELPDESK' => 'Trouble Tickets', + 'COMBO_USERS' => 'Users', + 'COMBO_CAMPAIGNS' => 'Campaigns', + 'LBL_SELECT' => 'Select', + 'LBL_EDIT' => 'Edit', + 'LBL_DELETE' => 'Delete', + 'Name' => 'Name', + 'Company' => 'Company', + 'Phone' => 'Phone', + 'Website' => 'Website', + 'Email' => 'Email', + 'Assigned To' => 'Assigned To', + 'Account Name' => 'Account Name', + 'City' => 'City', + 'Title' => 'Title', + 'Potential' => 'Potential', + 'Sales Stage' => 'Sales Stage', + 'Amount' => 'Amount', + 'Expected Close' => 'Expected Close', + 'Subject' => 'Subject', + 'Contact Name' => 'Contact Name', + 'Related to' => 'Related To', + 'File' => 'File', + 'Last Modified' => 'Last Modified', + 'Close' => 'Close', + 'Type' => 'Type', + 'Start Date/Due Date' => 'Start Date/Due Date', + 'Date Sent' => 'Date Sent', + 'Ticket ID' => 'Ticket ID', + 'Status' => 'Status', + 'Priority' => 'Priority', + 'Product Name' => 'Product Name', + 'Product Code' => 'Part Number', + 'Commission Rate' => 'Commission Rate', + 'Qty/Unit' => 'Qty/Unit', + 'Unit Price' => 'Unit Price', + 'Question' => 'Question', + 'Category' => 'Category', + 'Price Book Name' => 'Price Book Name', + 'LBL_EVENT_ENDDATE' => 'End Date & Time', + 'LBL_CUSTOM_INFORMATION' => 'Custom Information', + 'LBL_NONE_SCHEDULED' => 'None Scheduled', + 'Leads' => 'Leads', + 'Accounts' => 'Accounts', + 'Accounts & Contacts' => 'Accounts & Contacts', + 'Contacts' => 'Contacts', + 'Potentials' => 'Potentials', + 'Products' => 'Products', + 'Emails' => 'Emails', + 'HelpDesk' => 'Trouble Tickets', + 'Activities' => 'Activities', + 'Events' => 'Events', + 'Tasks' => 'Tasks', + 'Todo' => 'To Do', + 'Call' => 'Call', + 'Meeting' => 'Meeting', + 'Quotes' => 'Quotes', + 'PriceBook' => 'PriceBook', + 'PurchaseOrder' => 'Purchase Orders', + 'SalesOrder' => 'Sales Orders', + 'Invoice' => 'Invoices', + 'Calendar' => 'Calendar', + 'Home' => 'Home', + 'Campaigns' => 'Campaigns', + 'PriceBooks' => 'Price Books', + 'Notes' => 'Notes', + 'Faq' => 'FAQ', + 'Dashboards' => 'Dashboard', + 'Reports' => 'Reports', + 'Vendors' => 'Vendors', + 'Rss' => 'RSS', + 'Portal' => 'My Sites', + 'Webmails' => 'Webmails', + 'Attachments' => 'Attachments', + 'Activity History' => 'Activity History', + 'Ticket History' => 'Ticket History', + 'Purchase Order' => 'Purchase Order', + 'Sales Stage History' => 'Sales Stage History', + 'Users' => 'Users', + 'Admin' => 'Admin', + 'PurchaseOrder Status History' => 'PurchaseOrder Status History', + 'SalesOrder Status History' => 'SalesOrder Status History', + 'Quote Stage History' => 'Quote Stage History', + 'Invoice Status History' => 'Invoice Status History', + 'LBL_TROUBLE_TICKET' => 'Trouble Ticket', + 'My Home Page' => 'My Home Page', + 'Marketing' => 'Marketing', + 'Sales' => 'Sales', + 'Support' => 'Support', + 'Analytics' => 'Analytics', + 'Inventory' => 'Inventory', + 'Tools' => 'Tools', + 'Settings' => 'Settings', + 'LBL_INFORMATION' => 'Information', + 'LBL_MORE' => 'More', + 'LBL_BASIC' => 'Basic', + 'LBL_CREATING' => 'Creating', + 'LBL_EDITING' => 'Editing', + 'LBL_NEW' => 'New', + 'Lead' => 'Lead', + 'Account' => 'Account', + 'Contact' => 'Contact', + 'Opportunity' => 'Potential', + 'Product' => 'Product', + 'Activity' => 'Activity', + 'Event' => 'Event', + 'Task' => 'Task', + 'Quote' => 'Quote', + 'Ticket' => 'Ticket', + 'Campaign' => 'Campaign', + 'Note' => 'Note', + 'Dashboard' => 'Dashboards', + 'Report' => 'Report', + 'Vendor' => 'Vendor', + 'Webmail' => 'Webmail', + 'LBL_NONE_INCLUDED' => 'None Included', + 'LBL_ADD_TO' => 'Add to', + 'LBL_SELECT_TEMPLATE_TO_MAIL_MERGE' => 'Select template to Mail Merge:', + 'LBL_TITLE_OR_DESCRIPTION' => 'Title / Description', + 'LBL_RSS_FEEDS' => 'RSS Feeds', + 'LBL_ADD_RSS_FEEDS' => 'Add New RSS Feed', + 'LNK_NEW_FAQ' => 'New FAQ', + 'Vendor Name' => 'Vendor Name', + 'LNK_WEARE' => 'About us', + 'LBL_ABOUTUS_TITLE' => 'vtiger CRM - About Us', + 'LBL_DISCUSS' => 'Discuss with other users', + 'Quote Stage' => 'Quote Stage', + 'Potential Name' => 'Potential Name', + 'Total' => 'Total Amount', + 'First Name' => 'First Name', + 'Last Name' => 'Last Name', + 'User Name' => 'User Name', + 'LBL_PORDER_BUTTON_TITLE' => 'New Purchase Order [Alt+O]', + 'LBL_PORDER_BUTTON' => 'New Purchase Order', + 'LBL_PORDER_BUTTON_KEY' => 'O', + 'Tracking Number' => 'Tracking Number', + 'Order Id' => 'Order Id', + 'Quote Name' => 'Quote Name', + 'Invoice Id' => 'Invoice Id', + 'Quote Id' => 'Quote Id', + 'Sales Order' => 'Sales Order', + 'COMBO_QUOTES' => 'Quotes', + 'End Date' => 'End Date', + 'Start Date' => 'Start Date', + 'Recurring Type' => 'Recurring Type', + 'SalesOrders' => 'Sales Order', + 'LBL_QUOTE_NAME' => 'Quote Name', + 'LBL_NEW_QUOTE_BUTTON_TITLE' => 'New Quote [Alt+Q]', + 'LBL_NEW_QUOTE_BUTTON_KEY' => 'Q', + 'LBL_NEW_QUOTE_BUTTON' => 'New Quote', + 'COMBO_PORDER' => 'Purchase Order', + 'COMBO_SORDER' => 'Sales Order', + 'LBL_PORDER_NAME' => 'Purchase Order', + 'LBL_SORDER_NAME' => 'Sales Order', + 'COMBO_INVOICES' => 'Invoice', + 'LBL_INVOICE_NAME' => 'Invoice', + 'LBL_HELPDESK_NAME' => 'Trouble Ticket', + 'LBL_CAMPAIGN_NAME' => 'Campaign Name', + 'LBL_NEW_INVOICE_BUTTON_TITLE' => 'New Invoice [Alt+I]', + 'LBL_NEW_INVOICE_BUTTON_KEY' => 'I', + 'LBL_NEW_INVOICE_BUTTON' => 'New Invoice', + 'LBL_NEW_SORDER_BUTTON_TITLE' => 'New Sales Order [Alt+E]', + 'LBL_NEW_SORDER_BUTTON_KEY' => 'E', + 'LBL_NEW_SORDER_BUTTON' => 'New Sales Order', + 'LBL_PRODUCT_DETAILS' => 'Product Details', + 'LBL_QTY_IN_STOCK' => 'Qty In Stock', + 'LBL_QTY' => 'Qty', + 'LBL_UNIT_PRICE' => 'Unit Price', + 'LBL_LIST_PRICE' => 'List Price', + 'LBL_TOTAL' => 'Total', + 'LBL_ADD_PRODUCT' => 'Add Product', + 'LBL_SUB_TOTAL' => 'Sub Total', + 'LBL_TAX' => 'Tax', + 'LBL_ADJUSTMENT' => 'Adjustment', + 'LBL_GRAND_TOTAL' => 'Grand Total', + 'LBL_QUOTE_ID' => 'Quote Id', + 'LBL_SALES_ORDER_ID' => 'Sales Order Id', + 'LBL_PURCHASE_ORDER_ID' => 'Purchase Order Id', + 'LBL_EXPORT_TO_PDF' => 'Export To PDF', + 'LBL_HOME_KEY_METRICS' => 'Key Metrics', + 'LBL_HOME_METRICS' => 'Metrics', + 'LBL_HOME_COUNT' => 'Count', + 'LBL_JSCALENDAR_LANG' => 'en', + 'LNK_CV_EDIT' => 'Edit', + 'LNK_CV_DELETE' => 'Delete', + 'LNK_CV_CREATEVIEW' => 'New', + 'LBL_UPD_FIELD_ORD' => 'Update Field Order', + 'LBL_SEND_CUSTOM_MAIL_BUTTON' => 'Send Custom Mail', + 'LBL_UPDATED_TODAY' => 'Updated today', + 'LBL_UPDATED' => 'Updated', + 'LBL_DAY_AGO' => 'day ago', + 'LBL_DAYS_AGO' => 'days ago', + 'Jan' => 'Jan', + 'Feb' => 'Feb', + 'Mar' => 'Mar', + 'Apr' => 'Apr', + 'May' => 'May', + 'Jun' => 'Jun', + 'Jul' => 'Jul', + 'Aug' => 'Aug', + 'Sep' => 'Sep', + 'Oct' => 'Oct', + 'Nov' => 'Nov', + 'Dec' => 'Dec', + 'Campaign Name' => 'Campaign Name', + 'Campaign Type' => 'Campaign Type', + 'Campaign Status' => 'Campaign Status', + 'Expected Revenue' => 'Expected Revenue', + 'Expected Close Date' => 'Expected Close Date', + 'LBL_ACTIONS' => 'Actions', + 'LBL_SEND' => 'Send', + 'LBL_VAT' => 'VAT', + 'LBL_SALES' => 'Sales', + 'LBL_SERVICE' => 'Service', + 'LBL_TAX_DETAILS' => 'Tax Details', + 'LBL_TAX_CALCULATION' => 'Tax Calculation', + 'COVERED_PERCENTAGE' => '(%)', + 'LBL_TAG_CLOUD' => 'Tag Cloud', + 'LBL_FOR' => 'for', + 'LBL_PO_STATUS' => 'PurchaseOrder Status', + 'LBL_SO_STATUS' => 'SalesOrder Status', + 'LBL_INVOICE_STATUS' => 'Invoice Status', + 'LBL_NOTE' => 'Note', + 'LBL_MODULE' => 'Module', + 'Active' => 'Active', + 'Inactive' => 'Inactive', + 'Today' => 'Today', + 'Last 2 Days' => 'Last 2 Days', + 'Last Week' => 'Last Week', + 'This Week' => 'This Week', + 'This Month' => 'This Month', + 'This Year' => 'This Year', + 'LBL_PLEASE_CLICK' => 'Please Click', + 'LBL_TO_CONFIGURE' => 'to Configure', + 'LBL_HERE' => 'here', + 'LBL_RECORDS' => 'Records', + 'LBL_SCROLL' => '[Scroll to Top]', + 'LBL_EXPAND_COLLAPSE' => 'Expand/Collapse', + 'LBL_RCPY_ADDRESS' => 'Copy Shipping address', + 'LBL_LCPY_ADDRESS' => 'Copy Billing address', + 'LBL_RECORD_ID' => 'Record ID', + 'LBL_ACTION_DATE' => 'Action Date', + 'LBL_HOMEPAGE_DASHBOARD' => 'HomePage Dashboard', + 'LBL_NO' => 'No', + 'LBL_FOUND' => 'Found', + 'LBL_YOU_CAN_CREATE' => 'You can Create', + 'LBL_NOW' => 'now', + 'LBL_CLICK_THE_LINK' => 'Click the link below', + 'LBL_CREATE' => 'Create', + 'LBL_A' => 'a', + 'LBL_AN' => 'an', + 'LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE' => 'You are not allowed to create', + 'LBL_TRANSFER_OWNERSHIP' => 'Transfer Ownership to', + 'LBL_SELECT_STATUS' => 'Select New Status', + 'LBL_UPDATE_OWNER' => 'Update Owner', + 'LBL_UPDATE_STATUS' => 'Update Status', + 'LBL_NET_PRICE' => 'Net Price', + 'LBL_TOOLS' => 'Tools', + 'LBL_DISCOUNT' => 'Discount', + 'LBL_TOTAL_AFTER_DISCOUNT' => 'Total After Discount', + 'LBL_NET_TOTAL' => 'Net Total', + 'LBL_SHIPPING_AND_HANDLING_CHARGES' => 'Shipping & Handling Charges', + 'LBL_TAX_FOR_SHIPPING_AND_HANDLING' => 'Taxes For Shipping and Handling', + 'LBL_FINISH' => 'Finish', + 'LBL_IMAGE_DELETED' => 'Image Deleted', + 'LBL_TAX_MODE' => 'Tax Mode', + 'LBL_CLEAR_COMMENT' => 'Clear Comment', + 'LBL_ZERO_DISCOUNT' => 'Zero Discount', + 'LBL_OF_PRICE' => 'of Price', + 'LBL_DIRECT_PRICE_REDUCTION' => 'Direct Price Reduction', + 'LBL_INDIVIDUAL' => 'Individual', + 'LBL_CPY_MAILING_ADDRESS' => 'Copy Mailing Address', + 'LBL_CPY_OTHER_ADDRESS' => 'Copy Other Address', + 'LBL_PERMISSION' => 'You are not permitted to execute this Operation', + 'VTIGER' => 'vtiger', + 'LBL_DIRECT_AMOUNT_DISCOUNT' => 'Direct Amount Discount', + 'LBL_NO_DISCOUNT_FOR_THIS_PRODUCT' => 'No Discount for this Product', + 'LBL_TOTAL_TAX_AMOUNT' => 'Total Tax Amount', + 'LBL_FINAL_DISCOUNT_AMOUNT' => 'Final Discount Amount', + 'LBL_SHIPPING_AND_HANDLING_CHARGE' => 'Shipping & Handling Charge', + 'LBL_GO_BACK' => 'Go Back', + 'LBL_RECORD_DELETE' => 'The record you are trying to view has been deleted.', + 'Part Number' => 'Part Number', + 'Salutation' => 'Salutation ', + 'Rating' => 'Rating', + 'industry' => 'Industry', + 'Severity' => 'Severity', + 'Product Category' => 'Product Category', + 'GL Account' => 'GL Account', + 'Usage Unit' => 'Usage Unit', + 'Carrier' => 'Carrier', + 'Expected Response' => 'Expected Response', + 'LBL_ADDRESS_INF' => 'Address Information', + 'yes' => 'yes', + 'don' => 'don', + 'nayanthara' => 'nayanthara', + 'LNK_NEW_DON' => 'New don', + 'patient' => 'patient', + 'medical' => 'medical', + 'LNK_NEW_PATIENT' => 'New patient', + 'cars' => 'cars', + 'automobile' => 'automobile', + 'LNK_NEW_CARS' => 'New cars', + 'king' => 'king', + 'LNK_NEW_KING' => 'New king', + 'Forests' => 'Forests', + 'Congo' => 'Congo', + 'LNK_NEW_FORESTS' => 'New Forests', + 'rock' => 'rock', + 'Solid' => 'Solid', + 'LNK_NEW_ROCK' => 'New rock', + 'lexus' => 'lexus', + 'toyota' => 'toyota', + 'LNK_NEW_LEXUS' => 'New lexus', + 'medicine' => 'medicine', + 'Indica' => 'Indica', + 'Tata' => 'Tata', + 'SINGLE_Indica' => 'Indica', +);$app_list_strings = array ( + 'moduleList' => + array ( + 'Home' => 'Home', + 'Dashboard' => 'Dashboard', + 'Leads' => 'Leads', + 'Contacts' => 'Contacts', + 'Accounts' => 'Accounts', + 'Potentials' => 'Potentials', + 'Campaigns' => 'Campaigns', + 'Notes' => 'Notes', + 'Emails' => 'Emails', + 'Activities' => 'Activities', + 'Products' => 'Products', + 'HelpDesk' => 'Trouble Tickets', + 'Faq' => 'FAQ', + 'Calendar' => 'Calendar', + 'Quotes' => 'Quotes', + 'PurchaseOrder' => 'PurchaseOrder', + 'Invoice' => 'Invoice', + 'Rss' => 'RSS', + 'Reports' => 'Reports', + 'Vendors' => 'Vendors', + 'PriceBooks' => 'PriceBooks', + 'SalesOrder' => 'SalesOrder', + 'Portal' => 'My Sites', + 'don' => 'don', + 'patient' => 'patient', + 'cars' => 'cars', + 'king' => 'king', + 'Forests' => 'Forests', + 'rock' => 'rock', + 'lexus' => 'lexus', + 'Indica' => 'Indica', + ), + 'opportunity_relationship_type_default_key' => 'Primary Decision Maker', + 'opportunity_relationship_type_dom' => + array ( + '' => '', + 'Primary Decision Maker' => 'Primary Decision Maker', + 'Business Decision Maker' => 'Business Decision Maker', + 'Business Evaluator' => 'Business Evaluator', + 'Technical Decision Maker' => 'Technical Decision Maker', + 'Technical Evaluator' => 'Technical Evaluator', + 'Executive Sponsor' => 'Executive Sponsor', + 'Influencer' => 'Influencer', + 'Other' => 'Other', + ), + 'case_relationship_type_default_key' => 'Primary Contact', + 'case_relationship_type_dom' => + array ( + '' => '', + 'Primary Contact' => 'Primary Contact', + 'Alternate Contact' => 'Alternate Contact', + ), + 'task_priority_dom' => + array ( + 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', + ), + 'task_status_dom' => + array ( + 'Planned' => 'Planned', + 'Completed' => 'Completed', + 'Deferred' => 'Deferred', + ), + 'meeting_status_dom' => + array ( + 'Planned' => 'Planned', + 'Held' => 'Held', + 'Not Held' => 'Not Held', + ), + 'call_status_dom' => + array ( + 'Planned' => 'Planned', + 'Held' => 'Held', + 'Not Held' => 'Not Held', + ), + 'case_status_default_key' => 'New', + 'case_status_dom' => + array ( + 'New' => 'New', + 'Assigned' => 'Assigned', + 'Closed' => 'Closed', + 'Pending Input' => 'Pending Input', + 'Rejected' => 'Rejected', + ), + 'user_status_dom' => + array ( + 'Active' => 'Active', + 'Inactive' => 'Inactive', + ), + 'record_type_default_key' => 'Accounts', + 'record_type_display' => + array ( + 'Accounts' => 'Account', + 'Leads' => 'Lead', + 'Opportunities' => 'Opportunity', + ), +); ?> From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 03:53:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 11:53:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9821 - /vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Message-ID: <20061113115334.29446788CB8@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 04:53:20 2006 New Revision: 9821 Log: Removed the Hardcoding in Quick Create labels Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Mon Nov 13 04:53:20 2006 @@ -1821,20 +1821,6 @@ global $mod_strings; - $new_label=Array('Leads'=>'LNK_NEW_LEAD', - 'Accounts'=>'LNK_NEW_ACCOUNT', - 'Calendar'=>'LNK_NEW_TASK', - 'Campaigns'=>'LNK_NEW_CAMPAIGN', - 'Emails'=>'LNK_NEW_EMAIL', - 'Events'=>'LNK_NEW_EVENT', - 'HelpDesk'=>'LNK_NEW_HDESK', - 'Notes'=>'LNK_NEW_NOTE', - 'Potentials'=>'LNK_NEW_OPPORTUNITY', - 'PriceBooks'=>'LNK_NEW_PRICEBOOK', - 'Products'=>'LNK_NEW_PRODUCT', - 'Contacts'=>'LNK_NEW_CONTACT', - 'Vendors'=>'LNK_NEW_VENDOR'); - $qc_query = "select distinct vtiger_tab.tablabel,vtiger_tab.name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid where quickcreate=0 order by vtiger_tab.tablabel"; $result = $adb->query($qc_query); $noofrows = $adb->num_rows($result); @@ -1844,7 +1830,7 @@ $tablabel = $adb->query_result($result,$i,'tablabel'); $tabname = $adb->query_result($result,$i,'name'); - $tablabel = $new_label[$tabname]; + $tablabel = "SINGLE_$tabname"; if(isPermitted($tabname,'EditView','') == 'yes') { $return_qcmodule[] = $tablabel; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 04:00:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 12:00:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9822 - /vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl Message-ID: <20061113120003.7AE35788CB8@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 04:59:54 2006 New Revision: 9822 Log: Changes are done for Quick Create Label Modified: vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl Mon Nov 13 04:59:54 2006 @@ -78,14 +78,14 @@ {else} From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 04:03:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 12:03:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9823 - /vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl Message-ID: <20061113120327.D05E4787F27@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 05:03:19 2006 New Revision: 9823 Log: Changes are done for supporting Quick Create for generic module additioon API's Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl Mon Nov 13 05:03:19 2006 @@ -17,71 +17,12 @@
{/if} -{if $MODULE eq 'Accounts'} +{if $MODULE eq 'Calendar'} + +{elseif $MODULE eq 'Events'} + +{/if} + + - - - - -{elseif $MODULE eq 'Leads'} - - - - - -{elseif $MODULE eq 'Contacts'} - - - - - -{elseif $MODULE eq 'Calendar'} - - - - - -{elseif $MODULE eq 'Events'} - - - - - -{elseif $MODULE eq 'HelpDesk'} - - - - - - - -{elseif $MODULE eq 'Notes'} - - - - -{elseif $MODULE eq 'Potentials'} - - - - -{elseif $MODULE eq 'Campaigns'} - - - - -{elseif $MODULE eq 'PriceBooks'} - - - - -{elseif $MODULE eq 'Vendors'} - - - - - -{/if} - - From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 04:06:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 12:06:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9824 - /vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Message-ID: <20061113120647.68540787FBF@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 05:06:33 2006 New Revision: 9824 Log: Code Changes are done for module addition tool Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Mon Nov 13 05:06:33 2006 @@ -1594,8 +1594,9 @@ require('user_privileges/user_privileges_'.$current_user->id.'.php'); require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); $tab_id = getTabid($module); - if($module == "HelpDesk") - { + switch($module) + { + Case "HelpDesk": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_troubletickets.title, vtiger_troubletickets.status, vtiger_troubletickets.priority, vtiger_troubletickets.parent_id, @@ -1627,10 +1628,9 @@ $query .= $sec_parameter; } - - } - if($module == "Accounts") - { + break; + + Case "Accounts": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_account.accountname, vtiger_account.email1, @@ -1689,10 +1689,9 @@ WHERE userid=".$current_user->id." AND tabid=".$tab_id.")))) "; } - - } - if ($module == "Potentials") - { + break; + + Case "Potentials": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_account.accountname, @@ -1722,10 +1721,9 @@ $query .= $sec_parameter; } - - } - if($module == "Leads") - { + break; + + Case "Leads": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_leaddetails.firstname, vtiger_leaddetails.lastname, vtiger_leaddetails.company, vtiger_leadaddress.phone, @@ -1753,9 +1751,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Products") - { + break; + Case "Products": $query = "SELECT vtiger_crmentity.crmid, vtiger_products.*, vtiger_productcf.* FROM vtiger_products INNER JOIN vtiger_crmentity @@ -1772,9 +1769,8 @@ OR vtiger_seproductsrel.crmid IN (".getReadEntityIds('Accounts').") OR vtiger_seproductsrel.crmid IN (".getReadEntityIds('Potentials').") OR vtiger_products.contactid IN (".getReadEntityIds('Contacts').")) "; - } - if($module == "Notes") - { + break; + Case "Notes": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.modifiedtime, vtiger_notes.title, vtiger_notes.contact_id, vtiger_notes.filename, vtiger_senotesrel.crmid AS relatedto, @@ -1799,9 +1795,8 @@ OR vtiger_senotesrel.crmid IN (".getReadEntityIds('PurchaseOrder').") OR vtiger_senotesrel.crmid IN (".getReadEntityIds('SalesOrder').") OR vtiger_notes.contact_id IN (".getReadEntityIds('Contacts').")) "; - } - if($module == "Contacts") - { + break; + Case "Contacts": //Query modified to sort by assigned to $query = "SELECT vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_contactdetails.title, vtiger_contactdetails.accountid, @@ -1831,9 +1826,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Calendar") - { + break; + Case "Calendar": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, @@ -1871,9 +1865,8 @@ } //$query .=" group by vtiger_activity.activityid "; //included by Jaguar - } - if($module == "Emails") - { + break; + Case "Emails": $query = "SELECT DISTINCT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.date_start, @@ -1906,10 +1899,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - - if($module == "Faq") - { + break; + Case "Faq": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.createdtime, vtiger_crmentity.modifiedtime, vtiger_faq.* FROM vtiger_faq @@ -1923,27 +1914,23 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - - } - - if($module == "Vendors") - { + break; + + Case "Vendors": $query = "SELECT vtiger_crmentity.crmid, vtiger_vendor.* FROM vtiger_vendor INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_vendor.vendorid WHERE vtiger_crmentity.deleted = 0"; - } - if($module == "PriceBooks") - { + break; + Case "PriceBooks": $query = "SELECT vtiger_crmentity.crmid, vtiger_pricebook.* FROM vtiger_pricebook INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_pricebook.pricebookid WHERE vtiger_crmentity.deleted = 0"; - } - if($module == "Quotes") - { + break; + Case "Quotes": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.*, vtiger_quotes.*, @@ -1976,9 +1963,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "PurchaseOrder") - { + break; + Case "PurchaseOrder": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.*, vtiger_purchaseorder.*, @@ -2008,9 +1994,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "SalesOrder") - { + break; + Case "SalesOrder": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.*, vtiger_salesorder.*, @@ -2043,9 +2028,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Invoice") - { + break; + Case "Invoice": //Query modified to sort by assigned to //query modified -Code contribute by Geoff(http://forums.vtiger.com/viewtopic.php?t=3376) $query = "SELECT vtiger_crmentity.*, @@ -2079,9 +2063,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Campaigns") - { + break; + Case "Campaigns": //Query modified to sort by assigned to //query modified -Code contribute by Geoff(http://forums.vtiger.com/viewtopic.php?t=3376) $query = "SELECT vtiger_crmentity.*, @@ -2103,12 +2086,14 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Users") - { + break; + Case "Users": $query = "select id,user_name,roleid,first_name,last_name,email1,phone_mobile,phone_work,is_admin,status from vtiger_users inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where deleted=0 ".$where ; - } - + break; + default: + $focus = new $module(); + $query = $focus->getListQuery($module); + } $log->debug("Exiting getListQuery method ..."); return $query; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 04:23:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 12:23:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9825 - /vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php Message-ID: <20061113122346.91D2E7893A1@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 05:23:32 2006 New Revision: 9825 Log: Changes done for the generic module addition --By Don Modified: vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php Modified: vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php (original) +++ vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php Mon Nov 13 05:23:32 2006 @@ -76,7 +76,9 @@ $oCustomView = ''; $oCustomView = new CustomView($module); - + $viewid = $oCustomView->getViewId($module); + $oCustomView->getCvColumnListSQL($viewid); + if($search_module != '')//This is for Tag search { @@ -93,7 +95,7 @@ if($where != '') $listquery .= ' and ('.$where.')'; - + $list_result = $adb->query($listquery); $noofrows = $adb->num_rows($list_result); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 05:02:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 13:02:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9826 - in /vtigercrm/branches/5.0.3/modules: Calendar/OpenListView.php Home/index.php Message-ID: <20061113130230.EDE87787F27@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 06:02:24 2006 New Revision: 9826 Log: Mail content problem for invitees in calendar module - Fixes #2450 Modified: vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php vtigercrm/branches/5.0.3/modules/Home/index.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php Mon Nov 13 06:02:24 2006 @@ -25,15 +25,18 @@ * @param integer $mode - number to differentiate upcoming and pending activities * return array $values - activities record in array format */ -function getPendingActivities($mode) +function getPendingActivities($mode,$view='') { global $log; $log->debug("Entering getPendingActivities() method ..."); require_once("data/Tracker.php"); require_once("include/utils/utils.php"); + require_once('include/utils/CommonUtils.php'); //new + require_once('user_privileges/default_module_view.php'); + global $currentModule; - + global $singlepane_view; global $theme; global $focus; global $action; @@ -46,6 +49,8 @@ $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once($theme_path.'layout_utils.php'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); //code added to customize upcomming and pending activities if($_REQUEST['activity_view']=='') { @@ -56,12 +61,12 @@ $today = date("Y-m-d", time()); - if($activity_view == 'today') + if($view == 'today') { $upcoming_condition = " AND (date_start = '$today' OR vtiger_recurringevents.recurringdate = '$today')"; $pending_condition = " AND (due_date = '$today' OR vtiger_recurringevents.recurringdate = '$today')"; } - else if($activity_view == 'all') + else if($view == 'all') { $upcoming_condition = " AND (date_start >= '$today' OR vtiger_recurringevents.recurringdate >= '$today')"; $pending_condition = " AND (due_date <= '$today' OR vtiger_recurringevents.recurringdate <= '$today')"; @@ -69,13 +74,26 @@ if($mode != 1) { //for upcoming avtivities - $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$upcoming_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid LEFT JOIN vtiger_activitygrouprelation ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$upcoming_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[9] == 3) + { + $sec_parameter=getListViewSecurityParameter('Calendar'); + $list_query .= $sec_parameter; + + } + } else { //for pending activities - $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$pending_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; - } + $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid LEFT JOIN vtiger_activitygrouprelation ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$pending_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[9] == 3) + { + $sec_parameter=getListViewSecurityParameter('Calendar'); + $list_query .= $sec_parameter; + } + } + $list_query.= " ORDER BY due_date ASC"; $res = $adb->query($list_query); $noofrecords = $adb->num_rows($res); @@ -106,7 +124,7 @@ } $title=array(); - $title[]=$activity_view; + $title[]=$view; $title[]='myUpcoPendAct.gif'; $title[]='home_myact'; //$title[]=getActivityView($activity_view); Modified: vtigercrm/branches/5.0.3/modules/Home/index.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Home/index.php (original) +++ vtigercrm/branches/5.0.3/modules/Home/index.php Mon Nov 13 06:02:24 2006 @@ -67,8 +67,10 @@ { $activities = Array(); include("modules/Calendar/OpenListView.php") ; - $activities[] = getPendingActivities(0); - $activities[] = getPendingActivities(1); + $activities[] = getPendingActivities(0,"today"); + $activities[] = getPendingActivities(0,"all"); + $activities[] = getPendingActivities(1,"today"); + $activities[] = getPendingActivities(1,"all"); } break; case 'ALVT': @@ -176,6 +178,7 @@ $current_module_strings = return_module_language($current_language, 'Calendar'); $t=Date("Ymd"); +//echo '
';print_r($activities); echo '
'; $buttoncheck['Calendar'] = isPermitted('Calendar','index'); $smarty->assign("CHECK",$buttoncheck); $smarty->assign("IMAGE_PATH",$image_path); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 07:22:11 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 15:22:11 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9827 - /vtigercrm/branches/5.0.3/themes/bluelagoon/style.css Message-ID: <20061113152211.2C7DC7893B5@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 08:22:06 2006 New Revision: 9827 Log: * Changed the height for the mail - Mickie Modified: vtigercrm/branches/5.0.3/themes/bluelagoon/style.css Modified: vtigercrm/branches/5.0.3/themes/bluelagoon/style.css ============================================================================== --- vtigercrm/branches/5.0.3/themes/bluelagoon/style.css (original) +++ vtigercrm/branches/5.0.3/themes/bluelagoon/style.css Mon Nov 13 08:22:06 2006 @@ -817,7 +817,7 @@ font-size:12px; background-color:#FFFFFF; width:100%; - height:130px; + height:200px; overflow:auto; border:0px solid #000000; } From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 07:24:45 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 15:24:45 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9828 - in /vtigercrm/branches/5.0.3: Smarty/templates/Webmails.tpl modules/Webmails/Webmail.php Message-ID: <20061113152445.B54BD7893B5@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 08:24:22 2006 New Revision: 9828 Log: Formatted Modified: vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php Modified: vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl Mon Nov 13 08:24:22 2006 @@ -12,178 +12,208 @@ {include file='Buttons_List1.tpl'} - - - - - - + + + + + + + + + + + + +
  -  
- +
  
+ + + + + + + + + + - - + + +   + +
+ + + + + + + + + + + + + - - - - - - - -
+ + + + + + + + + +
+ +  {$MOD.LBL_CHK_MAIL} + + +  {$MOD.LBL_COMPOSE} + + +  {$MOD.LBL_SETTINGS} + + +  {$MOD.LBL_SHOW_HIDDEN} + + +  {$MOD.LBL_EXPUNGE_MAILBOX} +
+
{$MOD.LBL_EMAIL_FOLDERS}  {$ACCOUNT} > {$MAILBOX} {$NAVIGATION}
+  {$MOD.LBL_MY_MAILS}   + +
    + + {foreach item=row from=$BOXLIST} + {foreach item=row_values from=$row} + {$row_values} + {/foreach} + {/foreach} +

+ +  {$MOD.LBL_SENT_MAILS} +
+  {$MOD.LBL_TRASH} + + +
  + + - - - - - - - - + + + + - - - - - - - - - - - + + + + + + + - - - - + + + + - -
- - - - - - - - - - - - - - - - + + {if $DEGRADED_SERVICE eq 'false'} + + + {/if} + +
- - - - - - - - - -
- -  {$MOD.LBL_CHK_MAIL} - - -  {$MOD.LBL_COMPOSE} - - -  {$MOD.LBL_SETTINGS} - - -  {$MOD.LBL_SHOW_HIDDEN} - - -  {$MOD.LBL_EXPUNGE_MAILBOX} -
-
{$MOD.LBL_EMAIL_FOLDERS}  {$ACCOUNT} > {$MAILBOX} {$NAVIGATION}
-  {$MOD.LBL_MY_MAILS}   - -
    - - {foreach item=row from=$BOXLIST} - {foreach item=row_values from=$row} - {$row_values} - {/foreach} - {/foreach} -

- -  {$MOD.LBL_SENT_MAILS} -
-  {$MOD.LBL_TRASH} - - -
  - - - {if $DEGRADED_SERVICE eq 'false'} - - {/if} - -
- - {$FOLDER_SELECT} - - {$APP.LBL_SEARCH}   -   - -
  +
+ + {$FOLDER_SELECT} + + {$APP.LBL_SEARCH}  +   +   + + +
+ + +
 
- - - - {foreach item=element from=$LISTHEADER} - {$element} - {/foreach} - - {foreach item=row from=$LISTENTITY} - {foreach item=row_values from=$row} - {$row_values} - {/foreach} - {/foreach} -
-
-
 
 
-

-
 
+
+
+ +   + + - - - - - - - - - - -
  - - {include file='DetailViewHidden.tpl'} -
- - - - - - - - -
- - - - -
- [ {$ID} ] {$NAME} - {$SINGLE_MOD} {$APP.LBL_INFORMATION}    -
{$UPDATEINFO}
-
- - - - -
- - - - - -
- - - - - - - - - - -
- - - - - - -
- {if $EDIT_DUPLICATE eq 'permitted'} -   - {/if} - - {if $EDIT_DUPLICATE eq 'permitted'} -   - {/if} - {if $DELETE eq 'permitted'} -   - {/if} - -
- {foreach key=header item=detail from=$BLOCKS} - - {strip} - {/strip} - -
- {$header} -
- {/foreach} - {if $ACTIVITYDATA.activitytype neq 'Task'} - - - - {if $LABEL.activitytype neq ''} - - - {/if} - {if $LABEL.visibility neq ''} - - - {/if} - - - - - - {if $LABEL.description neq ''} - - - - - {/if} - - {if $LABEL.eventstatus neq ''} - - - {/if} - {if $LABEL.assigned_user_id neq ''} - - - {/if} - - - {if $LABEL.taskpriority neq ''} - - - {/if} - {if $LABEL.sendnotification neq ''} - - - {/if} - - - - - - - -
{$MOD.LBL_EVENTTYPE}{$ACTIVITYDATA.activitytype}{$LABEL.visibility}{$ACTIVITYDATA.visibility}
{$MOD.LBL_EVENTNAME}{$ACTIVITYDATA.subject}
{$LABEL.description}{$ACTIVITYDATA.description}
{$LABEL.eventstatus}{$ACTIVITYDATA.eventstatus}{$LABEL.assigned_user_id}{$ACTIVITYDATA.assigned_user_id}
{$LABEL.taskpriority}{$ACTIVITYDATA.taskpriority}{$LABEL.sendnotification}{$ACTIVITYDATA.sendnotification}
{if $LABEL.createdtime neq ''}{$LABEL.createdtime}{/if}{if $LABEL.createdtime neq ''}{$ACTIVITYDATA.createdtime}{/if}{if $LABEL.modifiedtime neq ''}{$LABEL.modifiedtime}{/if}{if $LABEL.modifiedtime neq ''}{$ACTIVITYDATA.modifiedtime}{/if}
- - - -
- - - - -
{$MOD.LBL_EVENTSTAT}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
- - - - -
{$MOD.LBL_EVENTEDAT}
{$ACTIVITYDATA.endhr}:{$ACTIVITYDATA.endmin}{$ACTIVITYDATA.endfmt}
{$ACTIVITYDATA.due_date}
-
-
- - - - - - - - -
- - - - - - - - - - - - -
 {$MOD.LBL_INVITE} {$MOD.LBL_REMINDER} {$MOD.LBL_REPEAT} {$MOD.LBL_LIST_RELATED_TO} 
-
- -
- - - - - -
{$MOD.LBL_USERS} - {foreach item=username key=userid from=$INVITEDUSERS} - {$username.3}
- {/foreach} -
-
- - - - - - -
- {else} - - - - - - - {if $LABEL.description neq ''} - - - - - {/if} - - - -
{$MOD.LBL_TODO}{$ACTIVITYDATA.subject}
{$LABEL.description}{$ACTIVITYDATA.description}
- - - - - - - - - - - -
{if $LABEL.taskstatus neq ''}{$LABEL.taskstatus}{/if}{if $LABEL.taskpriority neq ''}{$LABEL.taskpriority}{/if}{if $LABEL.assigned_user_id neq ''}{$LABEL.assigned_user_id}{/if}
{if $LABEL.taskstatus neq ''}{$ACTIVITYDATA.taskstatus}{/if}{if $LABEL.taskpriority neq ''}{$ACTIVITYDATA.taskpriority}{/if}{if $LABEL.taskpriority neq ''}{$ACTIVITYDATA.assigned_user_id}{/if}
-
- - - -
- - - - -
{$MOD.LBL_TIMEDATE}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
-
- - - - -
{$LABEL.due_date}
{$ACTIVITYDATA.due_date}
 
-
- - - - - - - -
{if $LABEL.createdtime neq ''}{$LABEL.createdtime}{/if}{if $LABEL.createdtime neq ''}{$ACTIVITYDATA.createdtime}{/if}{if $LABEL.modifiedtime neq ''}{$LABEL.modifiedtime}{/if}{if $LABEL.modifiedtime neq ''}{$ACTIVITYDATA.modifiedtime}{/if}
-
- - - - - - - -
- - - - - - - - -
 {$MOD.LBL_NOTIFICATION}  - {$MOD.LBL_RELATEDTO} 
-
- -
- {if $LABEL.sendnotification neq ''} - - - - - -
{$MOD.LBL_SENDNOTIFICATION}{$ACTIVITYDATA.sendnotification}
- {/if} -
- -
- {/if} - -
- - {strip} - - - {/strip} -
- {if $EDIT_DUPLICATE eq 'permitted'} -   - {/if} - - {if $EDIT_DUPLICATE eq 'permitted'} -   - {/if} - {if $DELETE eq 'permitted'} -   - {/if} - -
-
-
- - - - - - - -
-
- - - - - - - - - -
{$ALL_TAG}
- - -
- {if $MERGEBUTTON eq 'permitted'} - - - - - - - -
{$WORDTEMPLATEOPTIONS}
- - -
- {/if} -
- - - - - - -
- -{if $MODULE eq 'Products'} - - -{/if} - - - - -
-
- - - - - - - - - - - +{**} + + + + + + + + + + + +
  + + {include file='DetailViewHidden.tpl'} +
+ + + + + + + + +
+ + + + +
+ [ {$ID} ] {$NAME} - {$SINGLE_MOD} {$APP.LBL_INFORMATION}    +
{$UPDATEINFO}
+
+ + + + +
+ + + + + +
+ + + + + + + + + + +
+ + + + + + +
+ {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + + {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + {if $DELETE eq 'permitted'} +   + {/if} + +
+ {foreach key=header item=detail from=$BLOCKS} + + {strip} + {/strip} + +
+ {$header} +
+ {/foreach} + {if $ACTIVITYDATA.activitytype neq 'Task'} + + + + {if $LABEL.activitytype neq ''} + + + {/if} + {if $LABEL.visibility neq ''} + + + {/if} + + + + + + {if $LABEL.description neq ''} + + + + + {/if} + + {if $LABEL.eventstatus neq ''} + + + {/if} + {if $LABEL.assigned_user_id neq ''} + + + {/if} + + + {if $LABEL.taskpriority neq ''} + + + {/if} + {if $LABEL.sendnotification neq ''} + + + {/if} + + + + + + + +
{$MOD.LBL_EVENTTYPE}{$ACTIVITYDATA.activitytype}{$LABEL.visibility}{$ACTIVITYDATA.visibility}
{$MOD.LBL_EVENTNAME}{$ACTIVITYDATA.subject}
{$LABEL.description}{$ACTIVITYDATA.description}
{$LABEL.eventstatus}{$ACTIVITYDATA.eventstatus}{$LABEL.assigned_user_id}{$ACTIVITYDATA.assigned_user_id}
{$LABEL.taskpriority}{$ACTIVITYDATA.taskpriority}{$LABEL.sendnotification}{$ACTIVITYDATA.sendnotification}
{if $LABEL.createdtime neq ''}{$LABEL.createdtime}{/if}{if $LABEL.createdtime neq ''}{$ACTIVITYDATA.createdtime}{/if}{if $LABEL.modifiedtime neq ''}{$LABEL.modifiedtime}{/if}{if $LABEL.modifiedtime neq ''}{$ACTIVITYDATA.modifiedtime}{/if}
+ + + +
+ + + + +
{$MOD.LBL_EVENTSTAT}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
+ + + + +
{$MOD.LBL_EVENTEDAT}
{$ACTIVITYDATA.endhr}:{$ACTIVITYDATA.endmin}{$ACTIVITYDATA.endfmt}
{$ACTIVITYDATA.due_date}
+
+
+ + + + + + + + +
+ + + + + + + + + + + + +
 {$MOD.LBL_INVITE} {$MOD.LBL_REMINDER} {$MOD.LBL_REPEAT} {$MOD.LBL_LIST_RELATED_TO} 
+
+ +
+ + + + + +
{$MOD.LBL_USERS} + {foreach item=username key=userid from=$INVITEDUSERS} + {$username.3}
+ {/foreach} +
+
+ + + + + + +
+ {else} + + + + + + + {if $LABEL.description neq ''} + + + + + {/if} + + + +
{$MOD.LBL_TODO}{$ACTIVITYDATA.subject}
{$LABEL.description}{$ACTIVITYDATA.description}
+ + + + + + + + + + + +
{if $LABEL.taskstatus neq ''}{$LABEL.taskstatus}{/if}{if $LABEL.taskpriority neq ''}{$LABEL.taskpriority}{/if}{if $LABEL.assigned_user_id neq ''}{$LABEL.assigned_user_id}{/if}
{if $LABEL.taskstatus neq ''}{$ACTIVITYDATA.taskstatus}{/if}{if $LABEL.taskpriority neq ''}{$ACTIVITYDATA.taskpriority}{/if}{if $LABEL.taskpriority neq ''}{$ACTIVITYDATA.assigned_user_id}{/if}
+
+ + + +
+ + + + +
{$MOD.LBL_TIMEDATE}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
+
+ + + + +
{$LABEL.due_date}
{$ACTIVITYDATA.due_date}
 
+
+ + + + + + + +
{if $LABEL.createdtime neq ''}{$LABEL.createdtime}{/if}{if $LABEL.createdtime neq ''}{$ACTIVITYDATA.createdtime}{/if}{if $LABEL.modifiedtime neq ''}{$LABEL.modifiedtime}{/if}{if $LABEL.modifiedtime neq ''}{$ACTIVITYDATA.modifiedtime}{/if}
+
+ + + + + + + +
+ + + + + + + + +
 {$MOD.LBL_NOTIFICATION}  + {$MOD.LBL_RELATEDTO} 
+
+ +
+ {if $LABEL.sendnotification neq ''} + + + + + +
{$MOD.LBL_SENDNOTIFICATION}{$ACTIVITYDATA.sendnotification}
+ {/if} +
+ +
+ {/if} + +
+ + {strip} + + + {/strip} +
+ {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + + {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + {if $DELETE eq 'permitted'} +   + {/if} + +
+
+
+ + + + + + + + + + + + + +
  
{$ALL_TAG}
+ + +
+ {if $MERGEBUTTON eq 'permitted'} + + + + + + + +
{$WORDTEMPLATEOPTIONS}
+ + +
+ {/if} +
+ + + + + + +
+ +{if $MODULE eq 'Products'} + + +{/if} + + + + +
+
+ + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ActivityEditView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ActivityEditView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ActivityEditView.tpl Tue Nov 14 03:16:10 2006 @@ -1,868 +1,868 @@ -{**} - -{**} - - - - - - - - -{**} - - - - -
- - {include file='EditViewHidden.tpl'} -
- - - - - -
- - - -
- - {if $OP_MODE eq 'edit_view'} - [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$SINGLE_MOD} {$APP.LBL_INFORMATION}
- {$UPDATEINFO} - {/if} - {if $OP_MODE eq 'create_view'} - {$APP.LBL_CREATING} {$SINGLE_MOD}
- {/if} -
-
- - -
- - -
- - - - - - - -
- - - - - -
-
- - -
-
- - {foreach key=header item=data from=$BLOCKS} - - - - -
- {$header} -
- {/foreach} - {if $ACTIVITY_MODE neq 'Task'} - - - - - - {if $LABEL.activitytype neq ''} - - - - - {/if} - - - - - {if $LABEL.description neq ''} - - - - - {/if} - - -
{$MOD.LBL_EVENTTYPE} - - - {foreach key=tyeparrkey item=typearr from=$ACTIVITYDATA.activitytype} - {foreach key=sel_value item=value from=$typearr} - {if $value eq 'selected' && $sel_value eq 'Meeting'} - {assign var='meetcheck' value='checked'} - {assign var='callcheck' value=''} - {else} - {assign var='meetcheck' value=''} - {assign var='callcheck' value='checked'} - {/if} - {/foreach} - {/foreach} - -
{$APP.Call} - {$APP.Meeting} -
-
{$MOD.LBL_EVENTNAME}    - {if $LABEL.visibility neq ''} - {foreach key=key_one item=arr from=$ACTIVITYDATA.visibility} - {foreach key=sel_value item=value from=$arr} - {if $value eq 'selected' && $sel_value eq 'Public'} - {assign var="visiblecheck" value="checked"} - {else} - {assign var="visiblecheck" value=""} - {/if} - {/foreach} - {/foreach} - {$MOD.LBL_PUBLIC} - {/if} -
{$LABEL.description}
- - - - - - - - - - {if $LABEL.taskpriority neq ''} - - - - - {/if} -
{if $LABEL.eventstatus neq ''}{$LABEL.eventstatus}{/if}{if $LABEL.assigned_user_id != ''} - {$LABEL.assigned_user_id} - {/if}
- {if $LABEL.eventstatus neq ''} - - {/if} - - {if $ACTIVITYDATA.assigned_user_id != ''} - {assign var=check value=1} - {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} - {foreach key=sel_value item=value from=$arr} - {if $value ne ''} - {assign var=check value=$check*0} - {else} - {assign var=check value=$check*1} - {/if} - {/foreach} - {/foreach} - - {if $check eq 0} - {assign var=select_user value='checked'} - {assign var=style_user value='display:block'} - {assign var=style_group value='display:none'} - {else} - {assign var=select_group value='checked'} - {assign var=style_user value='display:none'} - {assign var=style_group value='display:block'} - {/if} -  {$APP.LBL_USER} - {if $secondvalue.assigned_user_id neq ''} -  {$APP.LBL_GROUP} - {/if} - - - - - {if $secondvalue.assigned_user_id neq ''} - - - - {/if} - {else} - - {/if} -
{if $LABEL.sendnotification neq ''} {$LABEL.sendnotification}{/if} -
{$LABEL.taskpriority} -
- -
-
-
- - - - -
- - - - -
- - - - -
{$MOD.LBL_EVENTSTAT}
{$STARTHOUR}
- {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.date_start} - {assign var=date_vl value="$date_fmt"} - {/foreach} - -
- - - - -
{$MOD.LBL_EVENTEDAT}
{$ENDHOUR} -
- {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.due_date} - {assign var=date_vl value="$date_fmt"} - {/foreach} - -
-
-
- - - - - -
- - - - - - - - - - - - -
 {$MOD.LBL_INVITE} {$MOD.LBL_REMINDER} {$MOD.LBL_REPEAT} {$MOD.LBL_RELATEDTO} 
-
- -
- - - - -
- - - - - - - - - - - - -
-
    -
  • {$MOD.LBL_INVITE_INST1} -
  • {$MOD.LBL_INVITE_INST2} -
-
{$MOD.LBL_AVL_USERS} {$MOD.LBL_SEL_USERS}
- - -
- -
- -
{$MOD.LBL_SELUSR_INFO} -
-
-
-
- - - - - -
- - {else} - - - - - - - - {if $LABEL.description != ''} - - - - - -
{$MOD.LBL_TODO}
{$LABEL.description} - {/if} - -
- - - {if $LABEL.taskstatus != ''} - - {/if} - {if $LABEL.taskpriority != ''} - - {/if} - {if $LABEL.assigned_user_id != ''} - - {/if} - - - {if $LABEL.taskstatus != ''} - - {/if} - {if $LABEL.taskpriority != ''} - - {/if} - {if $LABEL.assigned_user_id != ''} - - {else} - - {/if} - -
{$LABEL.taskstatus}{$LABEL.taskpriority}{$LABEL.assigned_user_id}
- - - - - {assign var=check value=1} - {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} - {foreach key=sel_value item=value from=$arr} - {if $value ne ''} - {assign var=check value=$check*0} - {else} - {assign var=check value=$check*1} - {/if} - {/foreach} - {/foreach} - {if $check eq 0} - {assign var=select_user value='checked'} - {assign var=style_user value='display:block'} - {assign var=style_group value='display:none'} - {else} - {assign var=select_group value='checked'} - {assign var=style_user value='display:none'} - {assign var=style_group value='display:block'} - {/if} -  User - {if $secondvalue.assigned_user_id neq ''} -  Group - {/if} - - - - {if $secondvalue.assigned_user_id neq ''} - - - - {/if} -
-
- - - - -
- - - - -
{$MOD.LBL_TODODATETIME}
{$STARTHOUR}
- {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.date_start} - {assign var=date_vl value="$date_fmt"} - {/foreach} - -
- - - -
{$LABEL.due_date}
- {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.due_date} - {assign var=date_vl value="$date_fmt"} - {/foreach} - -
-

- - - - - -
- - - - - - - -
 {$MOD.LBL_NOTIFICATION}  - {$MOD.LBL_RELATEDTO} -
-
- -
- {if $LABEL.sendnotification != ''} - - - {if $ACTIVITYDATA.sendnotification eq 1} - - {else} - - {/if} - -
{$LABEL.sendnotification} - - - -
- {/if} -
- -
- - {/if} -
-
- - -
-
-
-
-
-
- - - - - - - - - - - - - - - - +{**} + +{**} + + + + + + + + +{**} + + + + +
+ + {include file='EditViewHidden.tpl'} +
+ + + + + +
+ + + +
+ + {if $OP_MODE eq 'edit_view'} + [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$SINGLE_MOD} {$APP.LBL_INFORMATION}
+ {$UPDATEINFO} + {/if} + {if $OP_MODE eq 'create_view'} + {$APP.LBL_CREATING} {$SINGLE_MOD}
+ {/if} +
+
+ + +
+ + +
+ + + + + + + +
+ + + + + +
+
+ + +
+
+ + {foreach key=header item=data from=$BLOCKS} + + + + +
+ {$header} +
+ {/foreach} + {if $ACTIVITY_MODE neq 'Task'} + + + + + + {if $LABEL.activitytype neq ''} + + + + + {/if} + + + + + {if $LABEL.description neq ''} + + + + + {/if} + + +
{$MOD.LBL_EVENTTYPE} + + + {foreach key=tyeparrkey item=typearr from=$ACTIVITYDATA.activitytype} + {foreach key=sel_value item=value from=$typearr} + {if $value eq 'selected' && $sel_value eq 'Meeting'} + {assign var='meetcheck' value='checked'} + {assign var='callcheck' value=''} + {else} + {assign var='meetcheck' value=''} + {assign var='callcheck' value='checked'} + {/if} + {/foreach} + {/foreach} + +
{$APP.Call} + {$APP.Meeting} +
+
{$MOD.LBL_EVENTNAME}    + {if $LABEL.visibility neq ''} + {foreach key=key_one item=arr from=$ACTIVITYDATA.visibility} + {foreach key=sel_value item=value from=$arr} + {if $value eq 'selected' && $sel_value eq 'Public'} + {assign var="visiblecheck" value="checked"} + {else} + {assign var="visiblecheck" value=""} + {/if} + {/foreach} + {/foreach} + {$MOD.LBL_PUBLIC} + {/if} +
{$LABEL.description}
+ + + + + + + + + + {if $LABEL.taskpriority neq ''} + + + + + {/if} +
{if $LABEL.eventstatus neq ''}{$LABEL.eventstatus}{/if}{if $LABEL.assigned_user_id != ''} + {$LABEL.assigned_user_id} + {/if}
+ {if $LABEL.eventstatus neq ''} + + {/if} + + {if $ACTIVITYDATA.assigned_user_id != ''} + {assign var=check value=1} + {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} +  {$APP.LBL_USER} + {if $secondvalue.assigned_user_id neq ''} +  {$APP.LBL_GROUP} + {/if} + + + + + {if $secondvalue.assigned_user_id neq ''} + + + + {/if} + {else} + + {/if} +
{if $LABEL.sendnotification neq ''} {$LABEL.sendnotification}{/if} +
{$LABEL.taskpriority} +
+ +
+
+
+ + + + +
+ + + + +
+ + + + +
{$MOD.LBL_EVENTSTAT}
{$STARTHOUR}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.date_start} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+ + + + +
{$MOD.LBL_EVENTEDAT}
{$ENDHOUR} +
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.due_date} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+
+
+ + + + + +
+ + + + + + + + + + + + +
 {$MOD.LBL_INVITE} {$MOD.LBL_REMINDER} {$MOD.LBL_REPEAT} {$MOD.LBL_RELATEDTO} 
+
+ +
+ + + + +
+ + + + + + + + + + + + +
+
    +
  • {$MOD.LBL_INVITE_INST1} +
  • {$MOD.LBL_INVITE_INST2} +
+
{$MOD.LBL_AVL_USERS} {$MOD.LBL_SEL_USERS}
+ + +
+ +
+ +
{$MOD.LBL_SELUSR_INFO} +
+
+
+
+ + + + + +
+ + {else} + + + + + + + + {if $LABEL.description != ''} + + + + + +
{$MOD.LBL_TODO}
{$LABEL.description} + {/if} + +
+ + + {if $LABEL.taskstatus != ''} + + {/if} + {if $LABEL.taskpriority != ''} + + {/if} + {if $LABEL.assigned_user_id != ''} + + {/if} + + + {if $LABEL.taskstatus != ''} + + {/if} + {if $LABEL.taskpriority != ''} + + {/if} + {if $LABEL.assigned_user_id != ''} + + {else} + + {/if} + +
{$LABEL.taskstatus}{$LABEL.taskpriority}{$LABEL.assigned_user_id}
+ + + + + {assign var=check value=1} + {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} +  {$APP.LBL_USER} + {if $secondvalue.assigned_user_id neq ''} +  {$APP.LBL_GROUP} + {/if} + + + + {if $secondvalue.assigned_user_id neq ''} + + + + {/if} +
+
+ + + + +
+ + + + +
{$MOD.LBL_TODODATETIME}
{$STARTHOUR}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.date_start} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+ + + +
{$LABEL.due_date}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.due_date} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+

+ + + + + +
+ + + + + + + + + +
 {$MOD.LBL_NOTIFICATION} {$MOD.LBL_RELATEDTO} 
+
+ +
+ {if $LABEL.sendnotification != ''} + + + {if $ACTIVITYDATA.sendnotification eq 1} + + {else} + + {/if} + +
{$LABEL.sendnotification} + + + +
+ {/if} +
+ +
+ + {/if} +
+
+ + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ActivityListView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ActivityListView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ActivityListView.tpl Tue Nov 14 03:16:10 2006 @@ -1,486 +1,518 @@ -{**} - -{**} - - - - - - - {include file='Buttons_List.tpl'} - - - - - - - - -{**} -
- - - - - - - -
- - - - - -{**} - - -
- - - - - -
- - - - - - - - -
 {$APP.Calendar} {$MOD.LBL_ALL_EVENTS_TODOS} 
-
- - -
- - - -
- - -
-
- - - - - - - - - -
- - - - - - - -
- {foreach key=button_check item=button_label from=$BUTTONS} - {if $button_check eq 'del'} - - {elseif $button_check eq 's_mail'} - - {elseif $button_check eq 's_cmail'} - - {elseif $button_check eq 'c_status'} - - {elseif $button_check eq 'c_owner'} - {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} - - {/if} - {/if} - - {/foreach} - {$RECORD_COUNTS} - - {$NAVIGATION} -
-
- - - - - {if $ALL eq 'All'} - - {else} - - {/if} - -
{$APP.LBL_VIEW} - {$APP.LNK_CV_CREATEVIEW} - | - {$APP.LNK_CV_EDIT} - | - {$APP.LNK_CV_DELETE}{$APP.LNK_CV_CREATEVIEW} - | - {$APP.LNK_CV_EDIT} - | - {$APP.LNK_CV_DELETE}
-
-
- - - - {foreach name="listviewforeach" item=header from=$LISTHEADER} - - {/foreach} - - {foreach item=entity key=entity_id from=$LISTENTITY} - - - {foreach item=data from=$entity} - - {/foreach} - - {foreachelse} - - {/foreach} -
{$header}
{$data}
-
- {assign var=vowel_conf value='LBL_A'} - {assign var=MODULE_CREATE value=$SINGLE_MOD} - - {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} - - - - - - - - - -
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_CAN_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE} {$APP.LBL_NOW}. {$APP.LBL_CLICK_THE_LINK}:
- {if $MODULE neq 'Calendar'} -   -{$APP.LBL_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
- {else} -   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Meeting}
-   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Call}
-   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Todo} - {/if} -
- {else} - - - - - - - - -
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
-
- {/if} -
-
-
- - - - - - - -
- {foreach key=button_check item=button_label from=$BUTTONS} - {if $button_check eq 'del'} - - {elseif $button_check eq 's_mail'} - - {elseif $button_check eq 's_cmail'} - - {elseif $button_check eq 'c_status'} - - {elseif $button_check eq 'c_owner'} - {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} - - {/if} - {/if} - - {/foreach} - {$RECORD_COUNTS} - - {$NAVIGATION} -
-
- - - {$WORDTEMPLATEOPTIONS}{$MERGEBUTTON} - -
-
-
- -
-{$SELECT_SCRIPT} -
-
-
-
-
- -
- - -
- - - - - - - - - - - - - - - - - - -
{$APP.LBL_CHANGE_OWNER} {$APP.LBL_CLOSE}
 
{$APP.LBL_TRANSFER_OWNERSHIP}: - -
 
-    - - -
-
- - - -{/literal} - +{**} + +{**} + + + + + + + {include file='Buttons_List.tpl'} + + + + + + + + +{**} +
+ + + + + + + +
+ + + + + +{**} + + +
+ + + + + +
+ + + + + + + + +
 {$APP.Calendar} {$MOD.LBL_ALL_EVENTS_TODOS} 
+
+ + +
+ + + +
+ + +
+
+ + + + + + + + + +
+ + + + + + + +
+ {foreach key=button_check item=button_label from=$BUTTONS} + {if $button_check eq 'del'} + + {elseif $button_check eq 's_mail'} + + {elseif $button_check eq 's_cmail'} + + {elseif $button_check eq 'c_status'} + + {elseif $button_check eq 'c_owner'} + {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} + + {/if} + {/if} + + {/foreach} + {$RECORD_COUNTS} + + {$NAVIGATION} +
+
+ + + + + {if $ALL eq 'All'} + + {else} + + {/if} + +
{$APP.LBL_VIEW} + {$APP.LNK_CV_CREATEVIEW} + | + {$APP.LNK_CV_EDIT} + | + {$APP.LNK_CV_DELETE}{$APP.LNK_CV_CREATEVIEW} + | + {$APP.LNK_CV_EDIT} + | + {$APP.LNK_CV_DELETE}
+
+
+ + + + {foreach name="listviewforeach" item=header from=$LISTHEADER} + + {/foreach} + + {foreach item=entity key=entity_id from=$LISTENTITY} + + + {foreach item=data from=$entity} + + {/foreach} + + {foreachelse} + + {/foreach} +
{$header}
{$data}
+
+ {assign var=vowel_conf value='LBL_A'} + {assign var=MODULE_CREATE value=$SINGLE_MOD} + + {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} + + + + + + + + + +
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_CAN_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE} {$APP.LBL_NOW}. {$APP.LBL_CLICK_THE_LINK}:
+ {if $MODULE neq 'Calendar'} +   -{$APP.LBL_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
+ {else} +   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Meeting}
+   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Call}
+   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Todo} + {/if} +
+ {else} + + + + + + + + +
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
+
+ {/if} +
+
+
+ + + + + + + +
+ {foreach key=button_check item=button_label from=$BUTTONS} + {if $button_check eq 'del'} + + {elseif $button_check eq 's_mail'} + + {elseif $button_check eq 's_cmail'} + + {elseif $button_check eq 'c_status'} + + {elseif $button_check eq 'c_owner'} + {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} + + {/if} + {/if} + + {/foreach} + {$RECORD_COUNTS} + + {$NAVIGATION} +
+
+ + + {$WORDTEMPLATEOPTIONS}{$MERGEBUTTON} + +
+
+
+ +
+{$SELECT_SCRIPT} +
+
+
+
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + +
{$APP.LBL_CHANGE_OWNER} {$APP.LBL_CLOSE}
 
{$APP.LBL_TRANSFER_OWNERSHIP}: +
+ {$APP.LBL_USER}  + {$APP.LBL_GROUP}
+ + +
+
 
+    + + +
+
+ + + +{/literal} + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/AddMailAccount.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/AddMailAccount.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/AddMailAccount.tpl Tue Nov 14 03:16:10 2006 @@ -1,168 +1,168 @@ -{**} - - - - - - - - -
-
- {$MOD.LBL_MY_MAIL_SERVER_DET}
-

- -
- - - - - - - -
- - - - - - + +
- - - - - - - -
 {$MOD.LBL_MY_MAIL_SERVER_DET}  
-
- - - - - - + + +
- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$MOD.LBL_EMAIL_ID}
{$MOD.LBL_DISPLAY_NAME}{$MOD.LBL_NAME_EXAMPLE}
{$APP.LBL_REQUIRED_SYMBOL} {$MOD.LBL_EMAIL_ADDRESS} {$MOD.LBL_EMAIL_EXAMPLE}
 
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$APP.LBL_REQUIRED_SYMBOL}{$MOD.LBL_MAIL_SERVER_NAME} 
{$APP.LBL_REQUIRED_SYMBOL}{$APP.LBL_LIST_USER_NAME} 
{$APP.LBL_REQUIRED_SYMBOL}{$MOD.LBL_LIST_PASSWORD} 
 
{$MOD.LBL_MAIL_PROTOCOL} +{**} + + + + + + + + +
+
+ {$MOD.LBL_MY_MAIL_SERVER_DET}
+

+ + + + + + + + + +
+ + + + + + -
+ + + + + + + +
 {$MOD.LBL_MY_MAIL_SERVER_DET}  
+
+ + + + + + - -
+ + + - - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$MOD.LBL_EMAIL_ID}
{$MOD.LBL_DISPLAY_NAME}{$MOD.LBL_NAME_EXAMPLE}
{$APP.LBL_REQUIRED_SYMBOL} {$MOD.LBL_EMAIL_ADDRESS} {$MOD.LBL_EMAIL_EXAMPLE}
 
{$MOD.LBL_INCOME_SERVER_SETTINGS}
{$APP.LBL_REQUIRED_SYMBOL}{$MOD.LBL_MAIL_SERVER_NAME} 
{$APP.LBL_REQUIRED_SYMBOL}{$APP.LBL_LIST_USER_NAME} 
{$APP.LBL_REQUIRED_SYMBOL}{$MOD.LBL_LIST_PASSWORD} 
 
{$MOD.LBL_MAIL_PROTOCOL} -  {$MOD.LBL_IMAP2} -  {$MOD.LBL_IMAP4} -  
{$MOD.LBL_SSL_OPTIONS} -  {$MOD.LBL_NO_TLS} -   {$MOD.LBL_TLS}  
{$MOD.LBL_CERT_VAL} -  {$MOD.LBL_VAL_SSL_CERT} -  {$MOD.LBL_DONOT_VAL_SSL_CERT} -  
{$MOD.LBL_INT_MAILER} -  {$MOD.LBL_INT_MAILER_USE} -  {$MOD.LBL_INT_MAILER_NOUSE} -  
{$MOD.LBL_REFRESH_TIMEOUT} - -  
{$MOD.LBL_EMAILS_PER_PAGE} 
{$MOD.LBL_MAIL_DISCLAIM}
 
- -    -
 
-
-
- -
- -{$JAVASCRIPT} +  {$MOD.LBL_IMAP2} +  {$MOD.LBL_IMAP4} +
 
{$MOD.LBL_SSL_OPTIONS} +  {$MOD.LBL_NO_TLS} +   {$MOD.LBL_TLS}  
{$MOD.LBL_CERT_VAL} +  {$MOD.LBL_VAL_SSL_CERT} +  {$MOD.LBL_DONOT_VAL_SSL_CERT} +  
{$MOD.LBL_INT_MAILER} +  {$MOD.LBL_INT_MAILER_USE} +  {$MOD.LBL_INT_MAILER_NOUSE} +  
{$MOD.LBL_REFRESH_TIMEOUT} + +  
{$MOD.LBL_EMAILS_PER_PAGE} 
{$MOD.LBL_MAIL_DISCLAIM}
 
+ +    +
 
+
+ + + + + + +{$JAVASCRIPT} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/AddProductToPriceBooks.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/AddProductToPriceBooks.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/AddProductToPriceBooks.tpl Tue Nov 14 03:16:10 2006 @@ -1,157 +1,164 @@ - -{literal} - - - - - - -
 
  -{$PRICEBOOKLISTHEADER} - - - - - - - - - -
- - {$LISTHEADER} - {$LISTENTITY} -
-
 
- - -
- -  - - - - + +{literal} + + + + + + +
 
  +{$PRICEBOOKLISTHEADER} + + + + + + + + + +
+ + {$LISTHEADER} + {$LISTENTITY} +
+
 
+ + +
+ +  + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/AddProductsToPriceBook.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/AddProductsToPriceBook.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/AddProductsToPriceBook.tpl Tue Nov 14 03:16:10 2006 @@ -1,57 +1,65 @@ - - - -
-
-{$PRODUCTLISTHEADER} - - - - - - - -
- - - - {$NAVIGATION} - -
 {$RECORD_COUNTS}
-
- - {$LISTHEADER} - {$LISTENTITY} -
-
 
- - - - - + + + +
+
+{$PRODUCTLISTHEADER} + + + + + + + +
+ + + + {$NAVIGATION} + +
 {$RECORD_COUNTS}
+
+ + {$LISTHEADER} + {$LISTENTITY} +
+
 
+ + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List.tpl Tue Nov 14 03:16:10 2006 @@ -1,140 +1,140 @@ -{**} - - -{if $MODULE eq 'Calendar'} - -{/if} - - - - - - - - - - -
{$APP.$CATEGORY} > {$APP.$MODULE} - - - - - - - - - - - -
- - - - - -
- - - {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} - {if $MODULE eq 'Calendar'} - - {else} - - {/if} - {else} - - {/if} - - {if $CHECK.index eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} - - {else} - - {/if} - - -
{$APP.LBL_CREATE_BUTTON_LABEL} {$APP.$MODULE}...{$APP.LBL_SEARCH_ALT}{$APP.$MODULE}...
-
-
  - - - - {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Tools' || $CATEGORY eq 'Analytics'} - {if $CHECK.Calendar eq 'yes'} - - {else} - - {/if} - {else} - {if $CHECK.Calendar eq 'yes'} - - {else} - - {/if} - {/if} - - - - - -
{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CLOCK_ALT}{$APP.LBL_CALCULATOR_ALT}{$APP.LBL_CHAT_ALT} - {$APP.LBL_LAST_VIEWED} -
-
  - - - - {if $MODULE eq 'Contacts' || $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Potentials' || $MODULE eq 'Products' } - {if $CHECK.Import eq 'yes'} - - {else} - - {/if} - {if $CHECK.Export eq 'yes'} - - {else} - - {/if} - {elseif $MODULE eq 'Notes' || $MODULE eq 'Emails'} - - {if $CHECK.Export eq 'yes'} - - - {else} - - - {/if} - {else} - - - {/if} - -
{$APP.LBL_IMPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}
-
  - - - - - -
{$APP.LBL_ALL_MENU_ALT}
-
-
+{**} + + +{if $MODULE eq 'Calendar'} + +{/if} + + + + + + + + + + +
{$APP.$CATEGORY} > {$APP.$MODULE} + + + + + + + + + + + +
+ + + + + +
+ + + {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} + {if $MODULE eq 'Calendar'} + + {else} + + {/if} + {else} + + {/if} + + {if $CHECK.index eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} + + {else} + + {/if} + + +
{$APP.LBL_CREATE_BUTTON_LABEL} {$APP.$SINGLE_MOD}...{$APP.LBL_SEARCH_ALT}{$APP.$MODULE}...
+
+
  + + + + {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Tools' || $CATEGORY eq 'Analytics'} + {if $CHECK.Calendar eq 'yes'} + + {else} + + {/if} + {else} + {if $CHECK.Calendar eq 'yes'} + + {else} + + {/if} + {/if} + + + + + +
{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CLOCK_ALT}{$APP.LBL_CALCULATOR_ALT}{$APP.LBL_CHAT_ALT} + {$APP.LBL_LAST_VIEWED} +
+
  + + + + {if $MODULE eq 'Contacts' || $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Potentials' || $MODULE eq 'Products' } + {if $CHECK.Import eq 'yes'} + + {else} + + {/if} + {if $CHECK.Export eq 'yes'} + + {else} + + {/if} + {elseif $MODULE eq 'Notes' || $MODULE eq 'Emails'} + + {if $CHECK.Export eq 'yes'} + + + {else} + + + {/if} + {else} + + + {/if} + +
{$APP.LBL_IMPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}
+
  + + + + + +
{$APP.LBL_ALL_MENU_ALT}
+
+
Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List1.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List1.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List1.tpl Tue Nov 14 03:16:10 2006 @@ -1,140 +1,142 @@ -{**} - - -{if $MODULE eq 'Calendar'} - -{/if} - - - - - - - {if $CATEGORY eq 'Settings'} - - - {else} - - {/if} - - -
{$APP.$MODULE}{$APP.$CATEGORY} > {$APP.$MODULE} - - - - - - - - - - - -
- - - - - -
- - - {if $CHECK.EditView eq 'yes'} - {if $MODULE eq 'Calendar'} - - {else} - - {/if} - {else} - - {/if} - - - - -
{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}...{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}...
-
-
  - - - - {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Tools' || $CATEGORY eq 'Analytics'} - {if $CHECK.Calendar eq 'yes'} - - {else} - - {/if} - {else} - {if $CHECK.Calendar eq 'yes'} - - {else} - - {/if} - {/if} - - - - - -
{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CLOCK_ALT}{$APP.LBL_CALCULATOR_ALT}{$APP.LBL_CHAT_ALT} - {$APP.LBL_LAST_VIEWED} -
-
  - - - - {if $MODULE eq 'Contacts' || $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Potentials' || $MODULE eq 'Products' } - {if $CHECK.Import eq 'yes'} - - {else} - - {/if} - {if $CHECK.Export eq 'yes'} - - {else} - - {/if} - {elseif $MODULE eq 'Notes' || $MODULE eq 'Emails'} - - {if $CHECK.Export eq 'yes'} - - - {else} - - - {/if} - {else} - - - {/if} - -
{$APP.LBL_IMPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}
-
  - - - - - -
{$APP.LBL_ALL_MENU_ALT}
-
-
+{**} + + +{if $MODULE eq 'Calendar'} + +{/if} + + + + + + + {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Organization' } + + + {else} + + {/if} + + +
{$APP.$MODULE}{$APP.$CATEGORY} > {$APP.$MODULE} + + + + + + + + + + + +
+ + + + + +
+ + + {if $CHECK.EditView eq 'yes'} + {if $MODULE eq 'Calendar'} + + {elseif $MODULE eq 'OrgUnit'} + + {else} + + {/if} + {else} + + {/if} + + + + +
{$APP.LBL_CREATE_BUTTON_LABEL} {$SINGLE_MOD}...{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}...{$APP.LBL_CREATE_BUTTON_LABEL} {$SINGLE_MOD}...
+
+
  + + + + {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Tools' || $CATEGORY eq 'Analytics'} + {if $CHECK.Calendar eq 'yes'} + + {else} + + {/if} + {else} + {if $CHECK.Calendar eq 'yes'} + + {else} + + {/if} + {/if} + + + + + +
{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CLOCK_ALT}{$APP.LBL_CALCULATOR_ALT}{$APP.LBL_CHAT_ALT} + {$APP.LBL_LAST_VIEWED} +
+
  + + + + {if $MODULE eq 'Contacts' || $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Potentials' || $MODULE eq 'Products' } + {if $CHECK.Import eq 'yes'} + + {else} + + {/if} + {if $CHECK.Export eq 'yes'} + + {else} + + {/if} + {elseif $MODULE eq 'Notes' || $MODULE eq 'Emails'} + + {if $CHECK.Export eq 'yes'} + + + {else} + + + {/if} + {else} + + + {/if} + +
{$APP.LBL_IMPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}
+
  + + + + + +
{$APP.LBL_ALL_MENU_ALT}
+
+
Modified: vtigercrm/branches/5.1_jens/Smarty/templates/CreateEmailTemplate.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/CreateEmailTemplate.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/CreateEmailTemplate.tpl Tue Nov 14 03:16:10 2006 @@ -1,324 +1,324 @@ -{**} - - - - - -
- - - - - -
-
-
- - {include file='SetMenu.tpl'} - - - - - - - - - - - {if $EMODE eq 'edit'} - - {else} - - {/if} - - - - - -
Users{$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES} > {$MOD.LBL_EDIT} "{$TEMPLATENAME}" {$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES} > {$MOD.LBL_CREATE_EMAIL_TEMPLATES}
{$UMOD.LBL_EMAIL_TEMPLATE_DESC}
- -
- - - - -
- - - - {if $EMODE eq 'edit'} - - {else} - - {/if} - - -
{$UMOD.LBL_PROPERTIES} "{$TEMPLATENAME}" {$MOD.LBL_CREATE_EMAIL_TEMPLATES} -    - {if $EMODE eq 'edit'} - - {else} - - {/if} -
- - - - - - - - - - - - - - - - - - - -
*{$UMOD.LBL_NAME} 
{$UMOD.LBL_DESCRIPTION} - -
{$UMOD.LBL_FOLDER} - {if $EMODE eq 'edit'} - - {else} - - {/if} - -
- - - - -
- - - - - - - - - - - - -
{$UMOD.LBL_EMAIL_TEMPLATE}
*{$UMOD.LBL_SUBJECT} - -
{$UMOD.LBL_MESSAGE}

-
- - - - - - - - - - - - - - - -
{$UMOD.LBL_MERGE_FIELDS}
-
{$UMOD.LBL_USE_MERGE_FIELDS_TO_EMAIL_CONTENT}
{$UMOD.LBL_STEP} 1. {$UMOD.LBL_SELECT_FIELD_TYPE}
{$UMOD.LBL_STEP} 2. {$UMOD.LBL_SELECT_FIELD}
{$UMOD.LBL_STEP} 3. {$UMOD.LBL_COPY_PASTE}
-
- - - - -
{$MOD.LBL_SCROLL}
-
- - - -
- - - - - - - - - - - - - +{**} + + + + + +
+ + + + + +
+
+
+ + {include file='SetMenu.tpl'} + + + + + + + + + + + {if $EMODE eq 'edit'} + + {else} + + {/if} + + + + + +
Users{$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES} > {$MOD.LBL_EDIT} "{$TEMPLATENAME}" {$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES} > {$MOD.LBL_CREATE_EMAIL_TEMPLATES}
{$UMOD.LBL_EMAIL_TEMPLATE_DESC}
+ +
+ + + + +
+ + + + {if $EMODE eq 'edit'} + + {else} + + {/if} + + +
{$UMOD.LBL_PROPERTIES} "{$TEMPLATENAME}" {$MOD.LBL_CREATE_EMAIL_TEMPLATES} +    + {if $EMODE eq 'edit'} + + {else} + + {/if} +
+ + + + + + + + + + + + + + + + + + + +
*{$UMOD.LBL_NAME} 
{$UMOD.LBL_DESCRIPTION} + +
{$UMOD.LBL_FOLDER} + {if $EMODE eq 'edit'} + + {else} + + {/if} + +
+ + + + +
+ + + + + + + + + + + + +
{$UMOD.LBL_EMAIL_TEMPLATE}
*{$UMOD.LBL_SUBJECT} + +
{$UMOD.LBL_MESSAGE}

+
+ + + + + + + + + + + + + + + +
{$UMOD.LBL_MERGE_FIELDS}
+
{$UMOD.LBL_USE_MERGE_FIELDS_TO_EMAIL_CONTENT}
{$UMOD.LBL_STEP} 1. {$UMOD.LBL_SELECT_FIELD_TYPE}
{$UMOD.LBL_STEP} 2. {$UMOD.LBL_SELECT_FIELD}
{$UMOD.LBL_STEP} 3. {$UMOD.LBL_COPY_PASTE}
+
+ + + + +
{$MOD.LBL_SCROLL}
+
+ + + +
+ + + + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/CreateView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/CreateView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/CreateView.tpl Tue Nov 14 03:16:10 2006 @@ -1,276 +1,285 @@ -{**} - -{**} - - - - - - - - - - {include file='Buttons_List1.tpl'} - -{**} - - - - - - - -
- - - {**} -
- - {if $OP_MODE eq 'edit_view'} - [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
- {$UPDATEINFO} - {/if} - {if $OP_MODE eq 'create_view'} - {$APP.LBL_CREATING} {$APP.LBL_NEW} {$APP[$SINGLE_MOD]}
- {/if} - -
-
- - {include file='EditViewHidden.tpl'} - - {**} - - - - - - - -
- - - - - {if $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Products'} - - - - {else} - - - {/if} - -
 {$APP.LBL_BASIC} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION}  {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} 
-
- - -
- - - - - -
- - - - - - - - - -
- - - - - - - {foreach key=header item=data from=$BASBLOCKS} - - {if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} - - - - - {elseif $header== 'Address Information' && $MODULE == 'Contacts'} - - - - {else} - - - - - {include file="DisplayFields.tpl"} - - {/foreach} - - - - -
-
- - -
-
- {$header} - {$APP.LBL_RCPY_ADDRESS} - {$APP.LBL_LCPY_ADDRESS} - {$header} - {$APP.LBL_CPY_OTHER_ADDRESS} - {$APP.LBL_CPY_MAILING_ADDRESS} - {$header} - {/if} -
 
-
- {if $MODULE eq 'Emails'} - - - {/if} - - -
-
-
-
- -
- - - -
- - - - -
- {**} - - - - - - - - -
- - - - - - - {foreach key=header item=data from=$ADVBLOCKS} - - - - - - {include file="DisplayFields.tpl"} - - - {/foreach} - - - - -
-
- - -
-
- {$header} -
 
-
- {if $MODULE eq 'Emails'} - - - {/if} - - - -
-
-
-
-
- -
-
-
- - -{if ($MODULE eq 'Emails' || 'Notes') and ($FCKEDITOR_DISPLAY eq 'true')} - - -{/if} -{if $MODULE eq 'Accounts'} - -{/if} - - - - +{**} + +{**} + + + + + + + + + + {include file='Buttons_List1.tpl'} + +{**} + + + + + + + +
+ + + {**} +
+ + {if $OP_MODE eq 'edit_view'} + [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
+ {$UPDATEINFO} + {/if} + {if $OP_MODE eq 'create_view'} + {$APP.LBL_CREATING} {$APP.LBL_NEW} {$APP[$SINGLE_MOD]}
+ {/if} + +
+
+ + {include file='EditViewHidden.tpl'} + + {**} + + + + + + + +
+ + + + + {if $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Products'} + + + + {else} + + + {/if} + +
 {$APP.LBL_BASIC} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION}  {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} 
+
+ + +
+ + + + + +
+ + + + + + + + + +
+ + + + + + + {foreach key=header item=data from=$BASBLOCKS} + + {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} + + + + + {elseif $header== $MOD.LBL_ADDRESS_INFORMATION && $MODULE == 'Contacts'} + + + + {else} + + + + + {include file="DisplayFields.tpl"} + + {/foreach} + + + {if $MODULE eq "Organization"} + + + + {/if} + + + + +
+
+ + +
+
+ {$header} + {$APP.LBL_RCPY_ADDRESS} + {$APP.LBL_LCPY_ADDRESS} + {$header} + {$APP.LBL_CPY_OTHER_ADDRESS} + {$APP.LBL_CPY_MAILING_ADDRESS} + {$header} + {/if} +
 
+ {include file="DetailsViewOrgUnit.tpl"} +
+
+ {if $MODULE eq 'Emails'} + + + {/if} + + +
+
+
+
+ +
+ + + +
+ + + + +
+ {**} + + + + + + + + +
+ + + + + + + {foreach key=header item=data from=$ADVBLOCKS} + + + + + + {include file="DisplayFields.tpl"} + + + {/foreach} + + + + +
+
+ + +
+
+ {$header} +
 
+
+ {if $MODULE eq 'Emails'} + + + {/if} + + + +
+
+
+
+
+ +
+
+
+ + +{if ($MODULE eq 'Emails' || 'Notes') and ($FCKEDITOR_DISPLAY eq 'true')} + + +{/if} +{if $MODULE eq 'Accounts'} + +{/if} + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/CreateWordTemplate.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/CreateWordTemplate.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/CreateWordTemplate.tpl Tue Nov 14 03:16:10 2006 @@ -1,100 +1,100 @@ -{**} - -
- - - - - -
-
-
- - {include file='SetMenu.tpl'} - - - - - - - - - - - - - - - -
Users{$MOD.LBL_SETTINGS} > {$UMOD.LBL_WORD_TEMPLATES} > {$UMOD.LBL_NEW_TEMPLATE}
{$MOD.LBL_MAIL_MERGE_DESC}
- -
- - - - -
- - - - - - -
{$UMOD.LBL_NEW_TEMPLATE}
{$ERRORFLAG}
-   -   -
- - - - - - - - - - - - - - -
*{$UMOD.LBL_NEW} {$UMOD.LBL_TEMPLATE_FILE} - -
{$UMOD.LBL_DESCRIPTION}
{$UMOD.LBL_MODULENAMES} - -
- - - - -
[Scroll to Top]
-
- - - -
- - - - - - - - - - +{**} + +
+ + + + + +
+
+
+ + {include file='SetMenu.tpl'} + + + + + + + + + + + + + + + +
Users{$MOD.LBL_SETTINGS} > {$UMOD.LBL_WORD_TEMPLATES} > {$UMOD.LBL_NEW_TEMPLATE}
{$MOD.LBL_MAIL_MERGE_DESC}
+ +
+ + + + +
+ + + + + + +
{$UMOD.LBL_NEW_TEMPLATE}
{$ERRORFLAG}
+   +   +
+ + + + + + + + + + + + + + +
*{$UMOD.LBL_NEW} {$UMOD.LBL_TEMPLATE_FILE} + +
{$UMOD.LBL_DESCRIPTION}
{$UMOD.LBL_MODULENAMES} + +
+ + + + +
[Scroll to Top]
+
+ + + +
+ + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DetailView.tpl Tue Nov 14 03:16:10 2006 @@ -73,20 +73,28 @@ {if $MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Leads'} {if $MODULE eq 'Accounts'} - {assign var=address1 value='Billing'} - {assign var=address2 value='Shipping'} + {assign var=address1 value='$MOD.LBL_BILLING_ADDRESS'} + {assign var=address2 value='$MOD.LBL_SHIPPING_ADDRESS'} {/if} {if $MODULE eq 'Contacts'} - {assign var=address1 value='Mailing'} - {assign var=address2 value='Other'} + {assign var=address1 value='$MOD.LBL_PRIMARY_ADDRESS'} + {assign var=address2 value='$MOD.LBL_ALTERNATE_ADDRESS'} {/if} @@ -221,7 +229,7 @@     - {if $header eq 'Address Information' && ($MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Leads') } + {if $header eq $MOD.LBL_ADDRESS_INFORMATION && ($MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Leads') } {if $MODULE eq 'Leads'} {else} @@ -239,15 +247,10 @@ - {$COMMENT_BLOCK} + {$COMMENT_BLOCK}   {/if} - - - - - {strip} @@ -255,46 +258,54 @@ {/strip} - {foreach item=detail from=$detail} - - {foreach key=label item=data from=$detail} - {assign var=keyid value=$data.ui} - {assign var=keyval value=$data.value} - {assign var=keytblname value=$data.tablename} - {assign var=keyfldname value=$data.fldname} - {assign var=keyoptions value=$data.options} - {assign var=keysecid value=$data.secid} - {assign var=keyseclink value=$data.link} - {assign var=keycursymb value=$data.cursymb} - {assign var=keysalut value=$data.salut} - {assign var=keycntimage value=$data.cntimage} - {assign var=keyadmin value=$data.isadmin} - - - - {if $label ne ''} - {if $keycntimage ne ''} - {$keycntimage} - {elseif $keyid eq '71' || $keyid eq '72'} - {$label} ({$keycursymb}) - {else} - {$label} - {/if} -{if $EDIT_PERMISSION eq 'yes'} {include file="DetailViewUI.tpl"} -{else} {include file="DetailViewFields.tpl"} -{/if} - {else} -   -   - {/if} - {/foreach} - - {/foreach} + {foreach item=detail from=$detail} + + {foreach key=label item=data from=$detail} + {assign var=keyid value=$data.ui} + {assign var=keyval value=$data.value} + {assign var=keyinherit value=$data.inherit} + {assign var=keytblname value=$data.tablename} + {assign var=keyfldname value=$data.fldname} + {assign var=keyoptions value=$data.options} + {assign var=keysecid value=$data.secid} + {assign var=keyseclink value=$data.link} + {assign var=keycursymb value=$data.cursymb} + {assign var=keysalut value=$data.salut} + {assign var=keycntimage value=$data.cntimage} + {assign var=keyadmin value=$data.isadmin} + + {if $label ne ''} + {if $keycntimage ne ''} + {$keycntimage} + {elseif $keyid eq '71' || $keyid eq '72'} + {$label} ({$keycursymb}) + {else} + {$label} + {/if} + {if $EDIT_PERMISSION eq 'yes'} + {include file="DetailViewUI.tpl"} + {else} + {include file="DetailViewFields.tpl"} + {/if} + {else} +   +   + {/if} + {/foreach} + + {/foreach} {/foreach} + {if $MODULE eq "Organization"} + + + {include file="DetailsViewOrgUnit.tpl"} + + + {/if} {*-- End of Blocks--*} @@ -380,19 +391,14 @@ - - - - - -
-
- + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewFields.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewFields.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewFields.tpl Tue Nov 14 03:16:10 2006 @@ -1,91 +1,115 @@ -{**} - - - {if $keyid eq '1' || $keyid eq 2 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72'} - - {elseif $keyid eq '13'} - - {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} - - {elseif $keyid eq '17'} - - {elseif $keyid eq '19' || $keyid eq '20'} - - {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} - - {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51' || $keyid eq '57' || $keyid eq '59' || $keyid eq '75' || $keyid eq '81' || $keyid eq '76' || $keyid eq '78' || $keyid eq '80'} - - {elseif $keyid eq 82} - - {elseif $keyid eq '53'} - - {elseif $keyid eq '56'} - - {elseif $keyid eq 83} - - - - - - - - - - - - - - - {elseif $keyid eq 69} - - {else} - - {/if} +{**} + + + {if $keyid eq '1' || $keyid eq 2 ||$keyid eq 8 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72'} + + {elseif $keyid eq '13'} + + {elseif $keyid eq '14'} + + {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} + + {elseif $keyid eq '17'} + + {elseif $keyid eq '19' || $keyid eq '20'} + + {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} + + {elseif $keyid eq '12'} + + {elseif $keyid eq '3' || $keyid eq '4' || $keyid eq '32' || $keyid eq '31'} + + {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51' || $keyid eq '57' || $keyid eq '59' || $keyid eq '75' || $keyid eq '81' || $keyid eq '76' || $keyid eq '78' || $keyid eq '80'} + + {elseif $keyid eq 82} + + {elseif $keyid eq '53'} + + {elseif $keyid eq '56'} + + {elseif $keyid eq 83} + + + + + + + + + + + + + + + {elseif $keyid eq 69} + + {elseif $keyid eq 107} + + {else} + + {/if} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewHidden.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewHidden.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewHidden.tpl Tue Nov 14 03:16:10 2006 @@ -192,6 +192,17 @@ +{elseif $MODULE eq 'Organization' || $MODULE eq 'OrgUnit'} + + + + + + + + {if $MODULE eq 'OrgUnit'} + + {/if} {/if} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewUI.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewUI.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewUI.tpl Tue Nov 14 03:16:10 2006 @@ -1,277 +1,430 @@ -{**} - - - {if $keyid eq '1' || $keyid eq 2 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72' || $keyid eq '103'} - - {elseif $keyid eq '13' || $keyid eq '104'} - - - {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} - - {elseif $keyid eq '33'} - - {assign var="MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING" value=", "} {* Separates Multi-Select Combo Box items *} - {assign var="DETAILVIEW_WORDWRAP_WIDTH" value="70"} {* No. of chars for word wrapping long lines of Multi-Select Combo Box items *} - - {elseif $keyid eq '115'} - {if $keyadmin eq 1} - - {elseif $keyid eq '116'} - {if $keyadmin eq 1} - - {elseif $keyid eq '17'} - - {elseif $keyid eq '19' || $keyid eq '20'} - - {if $label eq $MOD.LBL_ADD_COMMENT} - {assign var=keyval value=''} - {/if} - {assign var="DESCRIPTION_SEPARATOR_STRING" value=" "} {* Separates Description *} - {assign var="DESCRIPTION_WORDWRAP_WIDTH" value="70"} {* No. of chars for word wrapping long lines of Description *} - - {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} - - {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51'} - - {elseif $keyid eq '57'} - - {elseif $keyid eq '59'} - - {elseif $keyid eq '75' || $keyid eq '81'} - - {elseif $keyid eq 76} - - {elseif $keyid eq 78} - - {elseif $keyid eq 82} - - {elseif $keyid eq 80} - - {elseif $keyid eq '53'} - - {elseif $keyid eq '99'} - - {elseif $keyid eq '56'} - - {elseif $keyid eq '156'} - {if $smarty.request.record neq $CURRENT_USERID && $keyadmin eq 1} - - - {elseif $keyid eq 83} - {foreach item=tax key=count from=$TAX_DETAILS} - - - - - {/foreach} - - - {elseif $keyid eq 69} - - {else} - - {/if} +{**} + + + {if $keyid eq '1' || $keyid eq 2 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72' || $keyid eq '103'} + + {elseif $keyid eq '8'} + + {elseif $keyid eq '13' || $keyid eq '104'} + + + {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} + + {elseif $keyid eq '12'} + + {elseif $keyid eq '14'} + + {elseif $keyid eq '3' || $keyid eq '4' || $keyid eq '32' || $keyid eq '31'} + + {elseif $keyid eq '33'} + + {assign var="MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING" value=", "} {* Separates Multi-Select Combo Box items *} + {assign var="DETAILVIEW_WORDWRAP_WIDTH" value="70"} {* No. of chars for word wrapping long lines of Multi-Select Combo Box items *} + + {elseif $keyid eq '115'} + {if $keyadmin eq 1} + + {elseif $keyid eq '116'} + {if $keyadmin eq 1} + + {elseif $keyid eq '17'} + + {elseif $keyid eq '85'} + + {elseif $keyid eq '18'} + + {elseif $keyid eq '19' || $keyid eq '20'} + + {if $label eq $MOD.LBL_ADD_COMMENT} + {assign var=keyval value=''} + {/if} + + + + {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} + + {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51'} + + {elseif $keyid eq '57'} + + {elseif $keyid eq '59'} + + {elseif $keyid eq '75' || $keyid eq '81'} + + {elseif $keyid eq 76} + + {elseif $keyid eq 78} + + {elseif $keyid eq 82} + + {elseif $keyid eq 80} + + {elseif $keyid eq '53'} + + {elseif $keyid eq '99'} + + {elseif $keyid eq '56'} + + {elseif $keyid eq '156'} + {if $smarty.request.record neq $CURRENT_USERID && $keyadmin eq 1} + + + {elseif $keyid eq 83} + {foreach item=tax key=count from=$TAX_DETAILS} + + + + + {/foreach} + + + {elseif $keyid eq 69} + + {elseif $keyid eq 107} + + {else} + + {/if} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DisplayFields.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DisplayFields.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DisplayFields.tpl Tue Nov 14 03:16:10 2006 @@ -1,687 +1,826 @@ -{**} - - -{foreach key=label item=subdata from=$data} - {if $header eq 'Product Details'} - - {else} - - {/if} - {foreach key=mainlabel item=maindata from=$subdata} - {assign var="uitype" value="$maindata[0][0]"} - {assign var="fldlabel" value="$maindata[1][0]"} - {assign var="fldlabel_sel" value="$maindata[1][1]"} - {assign var="fldlabel_combo" value="$maindata[1][2]"} - {assign var="fldname" value="$maindata[2][0]"} - {assign var="fldvalue" value="$maindata[3][0]"} - {assign var="secondvalue" value="$maindata[3][1]"} - {assign var="thirdvalue" value="$maindata[3][2]"} - {assign var="vt_tab" value="$maindata[4][0]"} - - {if $uitype eq 2} - - - {elseif $uitype eq 11 || $uitype eq 1 || $uitype eq 13 || $uitype eq 7 || $uitype eq 9} - - - {if $fldname eq 'tickersymbol' && $MODULE eq 'Accounts'} - - {else} - - {/if} - {elseif $uitype eq 19 || $uitype eq 20} - - {if $fldlabel eq 'Add Comment'} - {assign var=fldvalue value=""} - {/if} - - - {elseif $uitype eq 21 || $uitype eq 24} - - - {elseif $uitype eq 15 || $uitype eq 16 || $uitype eq 111} - - - {elseif $uitype eq 33} - - - - {elseif $uitype eq 53} - - - {elseif $uitype eq 52 || $uitype eq 77} - - - {elseif $uitype eq 51} - {if $MODULE eq 'Accounts'} - {assign var='popuptype' value = 'specific_account_address'} - {else} - {assign var='popuptype' value = 'specific_contact_account_address'} - {/if} - - - - {elseif $uitype eq 50} - - - {elseif $uitype eq 73} - - - - {elseif $uitype eq 75 || $uitype eq 81} - - - {elseif $uitype eq 57} - - - - {elseif $uitype eq 58} - - - - {elseif $uitype eq 80} - - - - {elseif $uitype eq 78} - - - - {elseif $uitype eq 76} - - - - {elseif $uitype eq 17} - - - - {elseif $uitype eq 71 || $uitype eq 72} - - - - {elseif $uitype eq 56} - - {if $fldname eq 'notime' && $ACTIVITY_MODE eq 'Events'} - {if $fldvalue eq 1} - - {else} - - {/if} - {else} - {if $fldvalue eq 1} - - {else} - - {/if} - {/if} - {elseif $uitype eq 23 || $uitype eq 5 || $uitype eq 6} - - - - {elseif $uitype eq 63} - - - - - {elseif $uitype eq 357} - - - - - - - - - - {elseif $uitype eq 59} - - - - {elseif $uitype eq 55} - - - - {elseif $uitype eq 22} - - - - {elseif $uitype eq 69} - - - - {elseif $uitype eq 61} - - - {elseif $uitype eq 156} - - {if $fldvalue eq 'on'} - - {else} - - {/if} - {elseif $uitype eq 98} - - - {elseif $uitype eq 104} - - - {elseif $uitype eq 115} - - - {elseif $uitype eq 105} - - - {elseif $uitype eq 103} - - - {elseif $uitype eq 101} - - - {elseif $uitype eq 116} - - - {elseif $uitype eq 106} - - - {elseif $uitype eq 99} - {if $MODE eq 'create'} - - - {/if} - {elseif $uitype eq 30} - - - {elseif $uitype eq 83} - {foreach item=tax key=count from=$TAX_DETAILS} - {if $tax.check_value eq 1} - {assign var=check_value value="checked"} - {assign var=show_value value="visible"} - {else} - {assign var=check_value value=""} - {assign var=show_value value="hidden"} - {/if} - - - - {/foreach} - - - {/if} - {/foreach} - -{/foreach} - - +{**} + + +{foreach key=label item=subdata from=$data} + {if $header eq 'Product Details'} + + {else} + + {/if} + {foreach key=mainlabel item=maindata from=$subdata} + {assign var="uitype" value="$maindata[0][0]"} + {assign var="fldlabel" value="$maindata[1][0]"} + {assign var="fldlabel_sel" value="$maindata[1][1]"} + {assign var="fldlabel_combo" value="$maindata[1][2]"} + {assign var="fldname" value="$maindata[2][0]"} + {assign var="fldvalue" value="$maindata[3][0]"} + {assign var="secondvalue" value="$maindata[3][1]"} + {assign var="thirdvalue" value="$maindata[3][2]"} + {assign var="vt_tab" value="$maindata[4][0]"} + + {if $uitype eq 2} + + + {elseif $uitype eq 8} + + + + {elseif $uitype eq 11 || $uitype eq 1 || $uitype eq 13 || $uitype eq 7 || $uitype eq 9} + + + {if $fldname eq 'tickersymbol' && $MODULE eq 'Accounts'} + + {else} + + {/if} + {elseif $uitype eq '14'} + + + {elseif $uitype eq 19 || $uitype eq 20} + + {if $fldlabel eq $MOD.LBL_ADD_COMMENT} + {assign var=fldvalue value=""} + {/if} + + + {elseif $uitype eq 21 || $uitype eq 24} + + + {elseif $uitype eq 15 || $uitype eq 16 || $uitype eq 111} + + + {elseif $uitype eq '12'} + + + {elseif $uitype eq 3 || $uitype eq 4 || $uitype eq 31 || $uitype eq 32} + {if $uitype eq 4 || $uitype eq 32} + + {else} + + {/if} + + {elseif $uitype eq 33} + + + + {elseif $uitype eq 53} + + + {elseif $uitype eq 52 || $uitype eq 77} + + + {elseif $uitype eq 51} + {if $MODULE eq 'Accounts'} + {assign var='popuptype' value = 'specific_account_address'} + {else} + {assign var='popuptype' value = 'specific_contact_account_address'} + {/if} + + + + {elseif $uitype eq 50} + + + {elseif $uitype eq 73} + + + + {elseif $uitype eq 74} + + + + {elseif $uitype eq 75 || $uitype eq 81} + + + {elseif $uitype eq 57} + + + + {elseif $uitype eq 58} + + + + {elseif $uitype eq 80} + + + + {elseif $uitype eq 78} + + + + {elseif $uitype eq 76} + + + + {elseif $uitype eq 17} + + + + {elseif $uitype eq 85} + + + + {elseif $uitype eq 18} + + + + {elseif $uitype eq 71 || $uitype eq 72} + + + + {elseif $uitype eq 56} + + {if $fldname eq 'notime' && $ACTIVITY_MODE eq 'Events'} + {if $fldvalue eq 1} + + {else} + + {/if} + {else} + {if $fldvalue eq 1} + + {else} + + {/if} + {/if} + {elseif $uitype eq 23 || $uitype eq 5 || $uitype eq 6} + + + + {elseif $uitype eq 63} + + + + + {elseif $uitype eq 357} + + + + + + + + + + {elseif $uitype eq 59} + + + + {elseif $uitype eq 55} + + + + {elseif $uitype eq 22} + + + + {elseif $uitype eq 69} + + + + {elseif $uitype eq 61} + + + {elseif $uitype eq 156} + + {if $fldvalue eq 'on'} + + {else} + + {/if} + {elseif $uitype eq 98} + + + {elseif $uitype eq 104} + + + {elseif $uitype eq 115} + + + {elseif $uitype eq 105} + + + {elseif $uitype eq 107} + + + {elseif $uitype eq 103} + + + {elseif $uitype eq 101} + + + {elseif $uitype eq 116} + + + {elseif $uitype eq 106} + + + {elseif $uitype eq 99} + {if $MODE eq 'create'} + + + {/if} + {elseif $uitype eq 30} + + + {elseif $uitype eq 83} + {foreach item=tax key=count from=$TAX_DETAILS} + {if $tax.check_value eq 1} + {assign var=check_value value="checked"} + {assign var=show_value value="visible"} + {else} + {assign var=check_value value=""} + {assign var=show_value value="hidden"} + {/if} + + + + {/foreach} + + + {/if} + {/foreach} + +{/foreach} + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/EditViewHidden.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/EditViewHidden.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/EditViewHidden.tpl Tue Nov 14 03:16:10 2006 @@ -58,8 +58,11 @@ -{elseif $MODULE eq 'Accounts' || $MODULE eq 'Faq' || $MODULE eq 'PriceBooks' || $MODULE eq 'Vendors'} +{elseif $MODULE eq 'Accounts' || $MODULE eq 'Faq' || $MODULE eq 'PriceBooks' || $MODULE eq 'Vendors' || $MODULE eq 'OrgUnit'} + +{elseif $MODULE eq 'Organization'} + {elseif $MODULE eq 'Notes'} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetailView.tpl Tue Nov 14 03:16:10 2006 @@ -61,7 +61,7 @@ {elseif $elements.fldname eq 'description'} - + {elseif $elements.fldname eq 'filename'} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetails.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetails.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetails.tpl Tue Nov 14 03:16:10 2006 @@ -1,84 +1,84 @@ -{**} -
  
{$ALL_TAG}
  - {if $keyid eq '55'} - {$keysalut} - {*elseif $keyid eq '71' || $keyid eq '72'} - {$keycursymb*} - {/if} - {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -   - {if $keyseclink eq ''} - {$keyval} - {else} - {$keyval} - {/if} -   - - {$keyval}  - - {$APP.LBL_VAT} {$APP.COVERED_PERCENTAGE} - -   - {$VAT_TAX} -  
- {$APP.LBL_SALES} {$APP.LBL_TAX} {$APP.COVERED_PERCENTAGE} -   - {$SALES_TAX} -  
- {$APP.LBL_SERVICE} {$APP.LBL_TAX} {$APP.COVERED_PERCENTAGE} -   - {$SERVICE_TAX} -  {$keyval} {$keyval}  + {if $keyid eq '55'} + {$keysalut} + {*elseif $keyid eq '71' || $keyid eq '72'} + {$keycursymb*} + {/if} + {$keyval} +  {$keyval} +  {$keyval} +  {$keyval} +  {$keyval} +  {$keyval} +  {$keyval} +  {$ASSIGN_ORGUNIT_LIST.$keyval.name} +   + {if $keyinherit == 1} + {if $keyid eq '32' || $keyid eq '31'} + {$keyval}  EXT + {else} + {$MOD.LBL_INHERIT_PARENT} + {/if} + {else} + {$keyval} + {/if} +  {$keyval} +  {$keyval} +   + {if $keyseclink eq ''} + {$keyval} + {else} + {$keyval} + {/if} +   + + {$keyval}  + + {$APP.LBL_VAT} {$APP.COVERED_PERCENTAGE} + +   + {$VAT_TAX} +  
+ {$APP.LBL_SALES} {$APP.LBL_TAX} {$APP.COVERED_PERCENTAGE} +   + {$SALES_TAX} +  
+ {$APP.LBL_SERVICE} {$APP.LBL_TAX} {$APP.COVERED_PERCENTAGE} +   + {$SERVICE_TAX} +  {$keyval} + {if $keyval ne ""} + {$keyval} + {/if} +  {$keyval} - {if $keyid eq '55'} - {$keysalut} - {*elseif $keyid eq '71' || $keyid eq '72'} - {$keycursymb*} - {/if} -   {$keyval} - -  {$keyval} - -  {$keyval} - -   - {$keyval|replace:$MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING:"\x1"|replace:" ":"\x0"|replace:"\x1":$MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING|wordwrap:$DETAILVIEW_WORDWRAP_WIDTH:"
 "|replace:"\x0":" "} -
- - -
 {$keyval} - - {else} - {$keyval} - {/if} - -  {$keyval} - - {else} - {$keyval} - {/if} - - -  {$keyval} - -   - {$keyval|replace:$DESCRIPTION_SEPARATOR_STRING:"\x1"|replace:" ":"\x0"|replace:"\x1":$DESCRIPTION_SEPARATOR_STRING|wordwrap:$DESCRIPTION_WORDWRAP_WIDTH:"
 "|replace:"\x0":" "} -
- -
 {$keyval} - -  {$keyval} -  {$keyval} - -  {$keyval} - -  {$keyval} -  {$keyval} -  {$keyval} -
{$keyval}
-
 {$keyval} -   - {if $keyoptions.0 eq 'User' && $keyadmin eq 1} - {$keyval} - {elseif $keyoptions.0 eq 'Group' && $keyadmin eq 1} - {$keyval} - {else} - {$keyval} - {/if} -   - - {$CHANGE_PW_BUTTON} {$keyval}  - -  {$keyval}  - - {else} - {$keyval} - {/if} - - {$tax.taxlabel} {$APP.COVERED_PERCENTAGE} - - - {$tax.percentage} -  
 {$keyval} {$keyval} + {if $keyid eq '55'} + {$keysalut} + {*elseif $keyid eq '71' || $keyid eq '72'} + {$keycursymb*} + {/if} +   {$keyval} + +   {$keyval} {$keyval} + +  {$keyval} + +  {$ASSIGN_ORGUNIT_LIST.$keyval.name} + + + + {foreach key=org item=sel from=$keyval} {$org}{if $sel eq 1} (*){/if}
{/foreach}
+ {if $keyval.$CURRENT_ORGANIZATION eq 1} + + + {/if} +
+ + + {if $keyinherit == 1} + {if $keyid eq '32' || $keyid eq '31'} + {$keyval}  EXT + {else} + {$MOD.LBL_INHERIT_PARENT} + {/if} + {else} + {$keyval} + {/if} + + + +   + {$keyval|replace:$MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING:"\x1"|replace:" ":"\x0"|replace:"\x1":$MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING|wordwrap:$DETAILVIEW_WORDWRAP_WIDTH:"
 "|replace:"\x0":" "} +
+ + +
 {$keyval} + + {else} + {$keyval} + {/if} + +  {$keyval} + + {else} + {$keyval} + {/if} + + +  {$keyval} + +  Skype{$keyval} + + + +  {$keyval} + + +   + {$keyval} + + +  {$keyval} + +  {$keyval} +  {$keyval} + +  {$keyval} + +  {$keyval} +  {$keyval} +  {$keyval} +
{$keyval}
+
 {$keyval} +   + {if $keyoptions.0 eq 'User' && $keyadmin eq 1} + {$keyval} + {elseif $keyoptions.0 eq 'Group' && $keyadmin eq 1} + {$keyval} + {else} + {$keyval} + {/if} +   + + {$CHANGE_PW_BUTTON} {$keyval}  + +  {$keyval}  + + {else} + {$keyval} + {/if} + + {$tax.taxlabel} {$APP.COVERED_PERCENTAGE} + + + {$tax.percentage} +  
 {$keyval} + {if $keyval ne ""} + {$keyval} + {/if} +  {$keyval}
- *{$fldlabel} - - - {$fldlabel} - - - - {if $uitype eq 20} - * - {/if} - {$fldlabel} - - - - {if $uitype eq 24} - * - {/if} - {$fldlabel} - - - - {if $uitype eq 16} - * - {/if} - {$fldlabel} - - - - {$fldlabel} - - - - {$fldlabel} - - {assign var=check value=1} - {foreach key=key_one item=arr from=$fldvalue} - {foreach key=sel_value item=value from=$arr} - {if $value ne ''} - {assign var=check value=$check*0} - {else} - {assign var=check value=$check*1} - {/if} - {/foreach} - {/foreach} - - {if $check eq 0} - {assign var=select_user value='checked'} - {assign var=style_user value='display:block'} - {assign var=style_group value='display:none'} - {else} - {assign var=select_group value='checked'} - {assign var=style_user value='display:none'} - {assign var=style_group value='display:block'} - {/if} - -  User - - {if $secondvalue neq ''} -  Group - {/if} - - - - - {if $secondvalue neq ''} - - - - {/if} - - {$fldlabel} - - {if $uitype eq 52} - - {else} - - - {$fldlabel} - -  Select  - - *{$fldlabel} - -  Select - - *{$fldlabel} - -  Select - - {if $uitype eq 81} - * - {assign var="pop_type" value="specific_vendor_address"} - {else}{assign var="pop_type" value="specific"} - {/if} - {$fldlabel} - -  Select - {if $uitype eq 75} -   - {/if} - - {$fldlabel} - -  Select  - - {$fldlabel} - -  Select  - - {$fldlabel} - -  Select  - - {$fldlabel} - -  Select  - - {$fldlabel} - -  Select  - - {$fldlabel} - -   http://  - - - {if $uitype eq 72} - * - {/if} - {$fldlabel} - - - - {$fldlabel} - - - - - - - - - - {$fldlabel} - - {foreach key=date_value item=time_value from=$fldvalue} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - - - - - {if $uitype eq 6} - - {/if} - - {foreach key=date_format item=date_str from=$secondvalue} - {assign var=dateFormat value="$date_format"} - {assign var=dateStr value="$date_str"} - {/foreach} - - {if $uitype eq 5 || $uitype eq 23} -
({$dateStr}) - {else} -
({$dateStr}) - {/if} - - - - -
- {$fldlabel} - -   - - - {elseif $uitype eq 68 || $uitype eq 66 || $uitype eq 62} - - - - - -  Select  - To:  - -   - -  Select  -
CC:  - - BCC:  - -
- {$fldlabel} - - -  Select  - {$fldlabel} - - - - *{$fldlabel} - - - - {$fldlabel} - - {if $MODULE eq 'Products'} - -
Files Maximum 6 - - {assign var=image_count value=0} - {if $maindata[3].0.name neq ''} - {foreach name=image_loop key=num item=image_details from=$maindata[3]} -
-   [{$image_details.name}] -
- {assign var=image_count value=$smarty.foreach.image_loop.iteration} - {/foreach} - {/if} -
- - - {else} - - - { if $maindata[3].0.name != "" } - -
[{$maindata[3].0.name}] Del
- {/if} - - {/if} -
- {$fldlabel} - - - {$fldvalue} - - {$fldlabel} - - {if ($secondvalue eq 1 && $CURRENT_USERID != $smarty.request.record) || ($MODE == 'create')} - - {else} - - - {/if} - - {if ($secondvalue eq 1 && $CURRENT_USERID != $smarty.request.record) || ($MODE == 'create')} - - {else} - - {/if} - - * - {$fldlabel} - - {if $thirdvalue eq 1} -   - - {else} -   - {/if} - - - * - {$fldlabel} - - {$fldlabel} - - {if $secondvalue eq 1} - - {/if} - {foreach item=arr from=$fldvalue} - {foreach key=sel_value item=value from=$arr} - - {/foreach} - {/foreach} - - - {$fldlabel} - - - - {$maindata[3].0.name} - - {$fldlabel} - - - - {$fldlabel} - -   - - {$fldlabel} - - {if $secondvalue eq 1} - - {/if} - - {foreach item=arr key=uivalueid from=$fldvalue} - {foreach key=sel_value item=value from=$arr} - - {/foreach} - {/foreach} - - - *{$fldlabel} - - {if $MODE eq 'edit'} - - {else} - - {/if} - - *{$fldlabel} - - - - {$fldlabel} - - {assign var=check value=$secondvalue[0]} - {assign var=yes_val value=$secondvalue[1]} - {assign var=no_val value=$secondvalue[2]} - -  {$yes_val}  -  {$no_val}  - - {foreach item=val_arr from=$fldvalue} - {assign var=start value="$val_arr[0]"} - {assign var=end value="$val_arr[1]"} - {assign var=sendname value="$val_arr[2]"} - {assign var=disp_text value="$val_arr[3]"} - {assign var=sel_val value="$val_arr[4]"} - -  {$disp_text} - {/foreach} - - {$tax.taxlabel} {$APP.COVERED_PERCENTAGE} - - - -
 
+ *{$fldlabel} + + + {$fldlabel}  {$fldvalue}{$fldlabel} + + + {$fldlabel} + {if $fldvalue.$CURRENT_ORGANIZATION eq 1} + + {else} + {foreach key=org item=sel from=$fldvalue}{$org}
{/foreach} + {/if} +
+ {if $uitype eq 20} + * + {/if} + {$fldlabel} + + + + {if $uitype eq 24} + * + {/if} + {$fldlabel} + + + + {if $uitype eq 16} + * + {/if} + {$fldlabel} + + + {$fldlabel} + + + *{$fldlabel} + {$fldlabel} + {if $uitype eq '32' || $uitype eq '31'} + {if $secondvalue == 1} + + {else} + + {/if} + {$MOD.LBL_EXTEND_PARENT} +
+ + {else} + {if $secondvalue == 1} + + {$MOD.LBL_INHERIT_PARENT} +
+ + {else} + + {$MOD.LBL_INHERIT_PARENT} +
+ + {/if} + {/if} +
+ {$fldlabel} + + + + {$fldlabel} + + {assign var=check value=1} + {foreach key=key_one item=arr from=$fldvalue} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} + +  {$APP.LBL_USER} + + {if $secondvalue neq ''} +  {$APP.LBL_GROUP} + {/if} + + + + + {if $secondvalue neq ''} + + + + {/if} + + {$fldlabel} + + {if $uitype eq 52} + + {else} + + + {$fldlabel} + +  Select  + + *{$fldlabel} + +  Select + + *{$fldlabel} + +  Select + + {$fldlabel} + +  Select  + + {if $uitype eq 81} + * + {assign var="pop_type" value="specific_vendor_address"} + {else}{assign var="pop_type" value="specific"} + {/if} + {$fldlabel} + +  Select + {if $uitype eq 75} +   + {/if} + + {$fldlabel} + +  Select  + + {$fldlabel} + +  Select  + + {$fldlabel} + +  Select  + + {$fldlabel} + +  Select  + + {$fldlabel} + +  Select  + + {$fldlabel} + +   http://  + + + {$fldlabel} + + Skype + + {$fldlabel} + + {if $secondvalue == 1} + + {$MOD.LBL_INHERIT_PARENT} +
+   http://  + + {else} + + {$MOD.LBL_INHERIT_PARENT} +
+   http://  + + {/if} +
+ {if $uitype eq 72} + * + {/if} + {$fldlabel} + + + + {$fldlabel} + + + + + + + + + + {$fldlabel} + + {foreach key=date_value item=time_value from=$fldvalue} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + + + + + {if $uitype eq 6} + + {/if} + + {foreach key=date_format item=date_str from=$secondvalue} + {assign var=dateFormat value="$date_format"} + {assign var=dateStr value="$date_str"} + {/foreach} + + {if $uitype eq 5 || $uitype eq 23} +
({$dateStr}) + {else} +
({$dateStr}) + {/if} + + + + +
+ {$fldlabel} + +   + + + {elseif $uitype eq 68 || $uitype eq 66 || $uitype eq 62} + + + + + +  Select  + To:  + +   + +  Select  +
CC:  + + BCC:  + +
+ {$fldlabel} + + +  Select  + {$fldlabel} + + + + *{$fldlabel} + + + + {$fldlabel} + + {if $MODULE eq 'Products'} + +
Files Maximum 6 + + {assign var=image_count value=0} + {if $maindata[3].0.name neq ''} + {foreach name=image_loop key=num item=image_details from=$maindata[3]} +
+   [{$image_details.name}] +
+ {assign var=image_count value=$smarty.foreach.image_loop.iteration} + {/foreach} + {/if} +
+ + + {else} + + + { if $maindata[3].0.name != "" } + +
[{$maindata[3].0.name}] Del
+ {/if} + + {/if} +
+ {$fldlabel} + + + {$fldvalue} + + {$fldlabel} + + {if ($secondvalue eq 1 && $CURRENT_USERID != $smarty.request.record) || ($MODE == 'create')} + + {else} + + + {/if} + + {if ($secondvalue eq 1 && $CURRENT_USERID != $smarty.request.record) || ($MODE == 'create')} + + {else} + + {/if} + + * + {$fldlabel} + + {if $thirdvalue eq 1} +   + + {else} +   + {/if} + + + * + {$fldlabel} + + {$fldlabel} + + {if $secondvalue eq 1} + + {/if} + {foreach item=arr from=$fldvalue} + {foreach key=sel_value item=value from=$arr} + + {/foreach} + {/foreach} + + + {$fldlabel} + + + + {$maindata[3].0.name} + + {$fldlabel} +   + {if $fldvalue ne ""} + {$fldvalue} +
+ {/if} + + + +
+ {$fldlabel} + + + + {$fldlabel} + +   + + {$fldlabel} + + {if $secondvalue eq 1} + + {/if} + + {foreach item=arr key=uivalueid from=$fldvalue} + {foreach key=sel_value item=value from=$arr} + + {/foreach} + {/foreach} + + + *{$fldlabel} + + {if $MODE eq 'edit'} + + {else} + + {/if} + + *{$fldlabel} + + + + {$fldlabel} + + {assign var=check value=$secondvalue[0]} + {assign var=yes_val value=$secondvalue[1]} + {assign var=no_val value=$secondvalue[2]} + +  {$yes_val}  +  {$no_val}  + + {foreach item=val_arr from=$fldvalue} + {assign var=start value="$val_arr[0]"} + {assign var=end value="$val_arr[1]"} + {assign var=sendname value="$val_arr[2]"} + {assign var=disp_text value="$val_arr[3]"} + {assign var=sel_val value="$val_arr[4]"} + +  {$disp_text} + {/foreach} + + {$tax.taxlabel} {$APP.COVERED_PERCENTAGE} + + + +
 
{$BLOCKS.4.Description.value}
{$elements.value}
- - - - - - -
- - - {if $BLOCKS neq ''} - - - {else} - - {/if} - -
-   - {if $EMAIL_FLAG neq 'WEBMAIL'} -   - {else} -   - {/if} - {foreach item=row from=$BLOCKS} - {foreach item=elements key=title from=$row} - {if $elements.fldname eq 'filename' && $elements.value != ''} - - {/if} - {/foreach} - {/foreach} -  
-
- {foreach item=row from=$BLOCKS} - {foreach item=elements from=$row} - {if $elements.fldname eq 'subject'} - - {if $EMAIL_FLAG neq 'WEBMAIL'} - - - - {else} - - {/if} - - -
{$MOD.LBL_TO} {$TO_MAIL} 
{$MOD.LBL_CC} {$CC_MAIL} 
{$MOD.LBL_BCC} {$BCC_MAIL} 
{$MOD.LBL_FROM} {$TO_MAIL} 
{$MOD.LBL_SUBJECT} {$elements.value} 
 
- {elseif $elements.fldname eq 'description'} -
- {$BLOCKS.4.Description.value} -
- {/if} - {/foreach} - {/foreach} -
-{foreach item=row from=$BLOCKS} - {foreach item=elements key=title from=$row} - {if $elements.fldname eq 'filename'} -
- - {foreach item=attachments from=$elements.options} - - - - {/foreach} -
- {$attachments} -
-
- {/if} - {/foreach} -{/foreach} - +{**} + + + + + + + +
+ + + {if $BLOCKS neq ''} + + + {else} + + {/if} + +
+   + {if $EMAIL_FLAG neq 'WEBMAIL'} +   + {else} +   + {/if} + {foreach item=row from=$BLOCKS} + {foreach item=elements key=title from=$row} + {if $elements.fldname eq 'filename' && $elements.value != ''} + + {/if} + {/foreach} + {/foreach} +  
+
+ {foreach item=row from=$BLOCKS} + {foreach item=elements from=$row} + {if $elements.fldname eq 'subject'} + + {if $EMAIL_FLAG neq 'WEBMAIL'} + + + + {else} + + {/if} + + +
{$MOD.LBL_TO} {$TO_MAIL} 
{$MOD.LBL_CC} {$CC_MAIL} 
{$MOD.LBL_BCC} {$BCC_MAIL} 
{$MOD.LBL_FROM} {$TO_MAIL} 
{$MOD.LBL_SUBJECT} {$elements.value} 
 
+ {elseif $elements.fldname eq 'description'} +
+ {$elements.value} +
+ {/if} + {/foreach} + {/foreach} +
+{foreach item=row from=$BLOCKS} + {foreach item=elements key=title from=$row} + {if $elements.fldname eq 'filename'} +
+ + {foreach item=attachments from=$elements.options} + + + + {/foreach} +
+ {$attachments} +
+
+ {/if} + {/foreach} +{/foreach} + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Header.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Header.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Header.tpl Tue Nov 14 03:16:10 2006 @@ -36,6 +36,21 @@ + {if $USER_ORGANIZATIONS_COUNT gt 1} + + {else} + + {/if} @@ -145,6 +160,26 @@
- + {**} @@ -141,7 +160,7 @@ {/if} {else}
-
vtiger CRM + + {$CURRENT_ORGANIZATION}  {$ANNOUNCEMENT}
+
@@ -169,75 +188,12 @@ - -
{$APP.LBL_HOMEPAGE_DASHBOARD} - {if $ACTIVITIES.0.Entries.noofactivities > 0} - - - - - - - - - - - - -
{$MOD.LBL_UPCOMING_EVENTS}
- - {if $ACTIVITIES.0.Entries.noofactivities eq 1} - {$ACTIVITIES.0.Entries.noofactivities} {$APP.Event} {$APP.LBL_FOR} {$MOD[$ACTIVITIES.0.Title.0]} - {else} - {$ACTIVITIES.0.Entries.noofactivities} {$APP.Events} {$APP.LBL_FOR} {$MOD[$ACTIVITIES.0.Title.0]} - {/if} -
- - - - {foreach item=entries from=$ACTIVITIES.0.Entries} - - - - - {/foreach} -
{$entries.IMAGE}{$entries.0}
{$entries.ACCOUNT_NAME}
-
-
- {/if} - - -{if $ACTIVITIES.1.Entries.noofactivities > 0} - - - - - - - - - - -
- {$MOD.LBL_PENDING_EVENTS}
- - {if $ACTIVITIES.1.Entries.noofactivities eq 1} - {$ACTIVITIES.1.Entries.noofactivities} {$MOD.LBL_SINGLE_PENDING_EVENT} - {else} - {$ACTIVITIES.1.Entries.noofactivities} {$MOD.LBL_MULTIPLE_PENDING_EVENTS} - {/if} -
- - {foreach item=entries from=$ACTIVITIES.1.Entries} - - - - - {/foreach} -
{$entries.IMAGE}{$entries.0}
{$entries.ACCOUNT_NAME}
-
- -
-{/if} - +
+ {include file="upcomingActivities.tpl"} +

+
+ {include file="pendingActivities.tpl"} +

Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ImportStep2.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ImportStep2.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ImportStep2.tpl Tue Nov 14 03:16:10 2006 @@ -1,160 +1,188 @@ -{**} - - - - - - -{include file='Buttons_List1.tpl'} - -
- - - - - -
- - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$MOD.LBL_MODULE_NAME} {$MODULE}
 
- {$MOD.LBL_STEP_2_3}   - {$MODULE} {$MOD.LBL_LIST_MAPPING} -
- {$MOD.LBL_STEP_2_MSG} {$MODULE} {$MOD.LBL_STEP_2_MSG1} - {$MOD.LBL_STEP_2_TXT} {$MODULE}. -
 
-    - {$MOD.LBL_USE_SAVED_MAPPING}   {$SAVED_MAP_LISTS} -
- - - - {if $HASHEADER eq 1} - - - - {else} - - - - {/if} - -
{$MOD.LBL_MAPPING}{$MOD.LBL_HEADERS}{$MOD.LBL_ROW} 1{$MOD.LBL_ROW} 2{$MOD.LBL_ROW} 1{$MOD.LBL_ROW} 2{$MOD.LBL_ROW} 3
- {assign var="Firstrow" value=$FIRSTROW} - {assign var="Secondrow" value=$SECONDROW} - {assign var="Thirdrow" value=$THIRDROW} - - - - - -
-
- {include file="ImportMap.tpl"} -
-
- - {foreach name=iter item=row1 from=$Firstrow} - {assign var="counter" value=$smarty.foreach.iter.iteration} - {math assign="num" equation="x - y" x=$counter y=1} - - {if $HASHEADER eq 1} - - - - {else} - - - - {/if} - - {/foreach} -
 {$row1} {$Secondrow[$num]} {$Thirdrow[$num]} {$row1} {$Secondrow[$num]} {$Thirdrow[$num]}
-
-
-    - {$MOD.LBL_SAVE_AS_CUSTOM}     - -
- -    - -
- - -
-
- +{**} + + + + + + +{include file='Buttons_List1.tpl'} + + + + + + + +
+ + + + +
+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{$MOD.LBL_MODULE_NAME} {$MODULE}
 
+ {$MOD.LBL_STEP_2_3}   + {$MODULE} {$MOD.LBL_LIST_MAPPING} +
+ {$MOD.LBL_STEP_2_MSG} {$MODULE} {$MOD.LBL_STEP_2_MSG1} + {$MOD.LBL_STEP_2_TXT} {$MODULE}. +
 
+    + {$MOD.LBL_USE_SAVED_MAPPING}   {$SAVED_MAP_LISTS} +
+ + + + {if $HASHEADER eq 1} + + + + {else} + + + + {/if} + +
{$MOD.LBL_MAPPING}{$MOD.LBL_HEADERS}{$MOD.LBL_ROW} 1{$MOD.LBL_ROW} 2{$MOD.LBL_ROW} 1{$MOD.LBL_ROW} 2{$MOD.LBL_ROW} 3
+ {assign var="Firstrow" value=$FIRSTROW} + {assign var="Secondrow" value=$SECONDROW} + {assign var="Thirdrow" value=$THIRDROW} + + + + + +
+
+ {include file="ImportMap.tpl"} +
+
+ + {foreach name=iter item=row1 from=$Firstrow} + {assign var="counter" value=$smarty.foreach.iter.iteration} + {math assign="num" equation="x - y" x=$counter y=1} + + {if $HASHEADER eq 1} + + + + {else} + + + + {/if} + + {/foreach} +
 {$row1} {$Secondrow[$num]} {$Thirdrow[$num]} {$row1} {$Secondrow[$num]} {$Thirdrow[$num]}
+
+
+    + {$MOD.LBL_SAVE_AS_CUSTOM}     + +
+ +    + +
+
+ +
+
+ Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryCreateView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryCreateView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryCreateView.tpl Tue Nov 14 03:16:10 2006 @@ -1,205 +1,205 @@ -{**} - -{**} - - - - - - - - - - -{include file='Buttons_List1.tpl'} - -{**} - - - - - - - -
- - - {**} - {include file='EditViewHidden.tpl'} -
- - {if $OP_MODE eq 'edit_view'} - [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
- {$UPDATEINFO} - {/if} - {if $OP_MODE eq 'create_view'} - {$APP.LBL_CREATING} {$APP.LBL_NEW} {$MOD[$SINGLE_MOD]}
- {/if} - -
-
- - - - {**} - - - - - - - -
- - - - - {if $BLOCKS_COUNT eq 2} - - - - {else} - - - {/if} - -
 {$APP.LBL_BASIC} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION}  {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} 
-
- - {foreach item=blockInfo key=divName from=$BLOCKS} - -
- - - - - - -
- - - - - - - - - -
- - - - - - - {foreach key=header item=data from=$blockInfo} - - {if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} - - - - {else} - - - - - {include file="DisplayFields.tpl"} - - - {/foreach} - - - {if $divName eq 'basicTab'} - {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} - - - {if $AVAILABLE_PRODUCTS eq true} - {include file="Inventory/ProductDetailsEditView.tpl"} - {else} - {include file="Inventory/ProductDetails.tpl"} - {/if} - - {/if} - {/if} - - - - -
-
- - -
-
- {$header} - {$APP.LBL_RCPY_ADDRESS} - {$APP.LBL_LCPY_ADDRESS} - {$header} - {/if} -
 
-
- - -
-
- -
-
- -
- {/foreach} -
-
-
- - - - - - +{**} + +{**} + + + + + + + + + + +{include file='Buttons_List1.tpl'} + +{**} + + + + + + + +
+ + + {**} + {include file='EditViewHidden.tpl'} +
+ + {if $OP_MODE eq 'edit_view'} + [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
+ {$UPDATEINFO} + {/if} + {if $OP_MODE eq 'create_view'} + {$APP.LBL_CREATING} {$APP.LBL_NEW} {$MOD[$SINGLE_MOD]}
+ {/if} + +
+
+ + + + {**} + + + + + + + +
+ + + + + {if $BLOCKS_COUNT eq 2} + + + + {else} + + + {/if} + +
 {$APP.LBL_BASIC} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION}  {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} 
+
+ + {foreach item=blockInfo key=divName from=$BLOCKS} + +
+ + + + + + +
+ + + + + + + + + +
+ + + + + + + {foreach key=header item=data from=$blockInfo} + + {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} + + + + {else} + + + + + {include file="DisplayFields.tpl"} + + + {/foreach} + + + {if $divName eq 'basicTab'} + {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} + + + {if $AVAILABLE_PRODUCTS eq true} + {include file="Inventory/ProductDetailsEditView.tpl"} + {else} + {include file="Inventory/ProductDetails.tpl"} + {/if} + + {/if} + {/if} + + + + +
+
+ + +
+
+ {$header} + {$APP.LBL_RCPY_ADDRESS} + {$APP.LBL_LCPY_ADDRESS} + {$header} + {/if} +
 
+
+ + +
+
+ +
+
+ +
+ {/foreach} +
+
+
+ + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryDetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryDetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryDetailView.tpl Tue Nov 14 03:16:10 2006 @@ -1,326 +1,339 @@ -{**} - - - -
- - - - - - - -
- {include file='Buttons_List1.tpl'} - - - - - - - - -
- -
- - - - - - - - - -
- [ {$ID} ] {$NAME} - {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}   -  
{$UPDATEINFO}
- -
- - - - - - - - - -
- - - - - - {if $SinglePane_View eq 'false'} - - {/if} - - -
 {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION} {$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
-
- - - - - -
- - - - - - -
- - - - -
- {include file='DetailViewHidden.tpl'} - - {strip} - - - - {/strip} -
- {if $EDIT_DUPLICATE eq 'permitted'} -   -   - {/if} - {if $DELETE eq 'permitted'} -   - {/if} - -
- - - -{foreach key=header item=detail from=$BLOCKS} - - - - - - - - - {strip} - - {/strip} - - - {foreach item=detail from=$detail} - - {foreach key=label item=data from=$detail} - {assign var=keyid value=$data.ui} - {assign var=keyval value=$data.value} - {assign var=keytblname value=$data.tablename} - {assign var=keyfldname value=$data.fldname} - {assign var=keyoptions value=$data.options} - {assign var=keysecid value=$data.secid} - {assign var=keyseclink value=$data.link} - {assign var=keycursymb value=$data.cursymb} - {assign var=keysalut value=$data.salut} - {assign var=keycntimage value=$data.cntimage} - {assign var=keyadmin value=$data.isadmin} - - - {if $label ne ''} - {if $keycntimage ne ''} - - {elseif $label neq 'Tax Class'} - {if $keyid eq '71' || $keyid eq '72'} - - {else} - - {/if} - {/if} - {if $EDIT_PERMISSION eq 'yes'} - {include file="DetailViewUI.tpl"} - {else} - {include file="DetailViewFields.tpl"} - {/if} - {else} - - - {/if} - {/foreach} - - {/foreach} -
    -
- - {$header} - -
{$keycntimage}{$label} ({$keycursymb}){$label}  
-{/foreach} -{*-- End of Blocks--*} - - -
- - - {$ASSOCIATED_PRODUCTS} - -
- -
- {if $SinglePane_View eq 'false'} - - {strip} - - - - {/strip} -
- {if $EDIT_DUPLICATE eq 'permitted'} -   -   - {/if} - {if $DELETE eq 'permitted'} -   - {/if} - -
-{/if} - - - -
- {if $SinglePane_View eq 'true'} - {include file= 'RelatedListNew.tpl'} - {/if} -
-
- - -
- - {include file="Inventory/InventoryActions.tpl"} - -
- - - - - -
- -
- -
- {include file="TagCloudDisplay.tpl"} -
-
-
- -
- -
- -
- - - - -
- - +{**} + + + +
+ + + + + + + +
+ {include file='Buttons_List1.tpl'} + + + + + + + + +
+ +
+ + + + + + + + + +
+ [ {$ID} ] {$NAME} - {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}   +  
{$UPDATEINFO}
+ +
+ + + + + + + + + +
+ + + + + + {if $SinglePane_View eq 'false'} + + {/if} + + +
 {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION} {$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
+
+ + + + + +
+ + + + + + +
+ + + + +
+ {include file='DetailViewHidden.tpl'} + + {strip} + + + + {/strip} +
+ + + + + +
+ {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + + {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + {if $DELETE eq 'permitted'} +   + {/if} +
+ +
+ + + +{foreach key=header item=detail from=$BLOCKS} + + + + + + + + + {strip} + + {/strip} + + + {foreach item=detail from=$detail} + + {foreach key=label item=data from=$detail} + {assign var=keyid value=$data.ui} + {assign var=keyval value=$data.value} + {assign var=keytblname value=$data.tablename} + {assign var=keyfldname value=$data.fldname} + {assign var=keyoptions value=$data.options} + {assign var=keysecid value=$data.secid} + {assign var=keyseclink value=$data.link} + {assign var=keycursymb value=$data.cursymb} + {assign var=keysalut value=$data.salut} + {assign var=keycntimage value=$data.cntimage} + {assign var=keyadmin value=$data.isadmin} + + + {if $label ne ''} + {if $keycntimage ne ''} + + {elseif $label neq 'Tax Class'} + {if $keyid eq '71' || $keyid eq '72'} + + {else} + + {/if} + {/if} + {if $EDIT_PERMISSION eq 'yes'} + {include file="DetailViewUI.tpl"} + {else} + {include file="DetailViewFields.tpl"} + {/if} + {else} + + + {/if} + {/foreach} + + {/foreach} +
    +
+ + {$header} + +
{$keycntimage}{$label} ({$keycursymb}){$label}  
+{/foreach} +{*-- End of Blocks--*} + + +
+ + + {$ASSOCIATED_PRODUCTS} + +
+ +
+ {if $SinglePane_View eq 'false'} + + {strip} + + + + {/strip} +
+ + + + + +
+ {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + + {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + {if $DELETE eq 'permitted'} +   + {/if} +
+ + +
+{/if} + + + +
+ {if $SinglePane_View eq 'true'} + {include file= 'RelatedListNew.tpl'} + {/if} +
+
+ + +
+ + {include file="Inventory/InventoryActions.tpl"} + +
+ +
+ {include file="TagCloudDisplay.tpl"} +
+
+
+ +
+ +
+ +
+ + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryEditView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryEditView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryEditView.tpl Tue Nov 14 03:16:10 2006 @@ -1,197 +1,197 @@ -{**} - -{**} - - - - - - - - - - {include file='Buttons_List1.tpl'} - -{**} - - - - - - -
- {**} -
- - {if $OP_MODE eq 'edit_view'} - [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
- {$UPDATEINFO} - {/if} - {if $OP_MODE eq 'create_view'} - {$APP.LBL_CREATING} {$MOD[$SINGLE_MOD]}
- {/if} - -
-
- - {include file='EditViewHidden.tpl'} - - {**} - - - - - - - -
- - - - - - - -
 {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  
-
- - - - - - - -
- {**} - - - - - - - - -
- - - - - - - - {foreach key=header item=data from=$BLOCKS} - - {if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} - - - - {else} - - - - - {include file="DisplayFields.tpl"} - - - - {/foreach} - - - - {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} - - - - {/if} - - - - -
-
- - -
-
- {$header} - {$APP.LBL_RCPY_ADDRESS} - {$APP.LBL_LCPY_ADDRESS} - {$header} - {/if} -
 
- {include file="Inventory/ProductDetailsEditView.tpl"} -
-
- - -
-
-
-
- - {include file="Inventory/InventoryActions.tpl"} -
-
-
-
- - - - - - +{**} + +{**} + + + + + + + + + + {include file='Buttons_List1.tpl'} + +{**} + + + + + + +
+ {**} +
+ + {if $OP_MODE eq 'edit_view'} + [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
+ {$UPDATEINFO} + {/if} + {if $OP_MODE eq 'create_view'} + {$APP.LBL_CREATING} {$MOD[$SINGLE_MOD]}
+ {/if} + +
+
+ + {include file='EditViewHidden.tpl'} + + {**} + + + + + + + +
+ + + + + + + +
 {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  
+
+ + + + + + + +
+ {**} + + + + + + + + +
+ + + + + + + + {foreach key=header item=data from=$BLOCKS} + + {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} + + + + {else} + + + + + {include file="DisplayFields.tpl"} + + + + {/foreach} + + + + {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} + + + + {/if} + + + + +
+
+ + +
+
+ {$header} + {$APP.LBL_RCPY_ADDRESS} + {$APP.LBL_LCPY_ADDRESS} + {$header} + {/if} +
 
+ {include file="Inventory/ProductDetailsEditView.tpl"} +
+
+ + +
+
+
+
+ + {include file="Inventory/InventoryActions.tpl"} +
+
+
+
+ + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ListEmailTemplates.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ListEmailTemplates.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ListEmailTemplates.tpl Tue Nov 14 03:16:10 2006 @@ -1,155 +1,192 @@ -{**} - - -
- - - - - -
-
-
- - {include file='SetMenu.tpl'} - - - - - - - - - - - - - - -
{$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES}
{$UMOD.LBL_EMAIL_TEMPLATE_DESC}
- -
- - - - -
- - - - - - -
{$UMOD.LBL_EMAIL_TEMPLATES}  -
- - - - - - -
- - - - - - - - - {foreach name=emailtemplate item=template from=$TEMPLATES} - - - - - - - - {/foreach} -
#{$UMOD.LBL_LIST_SELECT}{$UMOD.LBL_EMAIL_TEMPLATE}{$UMOD.LBL_DESCRIPTION}{$UMOD.LBL_TEMPLATE_TOOLS}
{$smarty.foreach.emailtemplate.iteration} - {$template.templatename} - {$template.description}  - {$UMOD.LNK_SAMPLE_EMAIL} -
- - - - -
{$MOD.LBL_SCROLL}
-
- - - -
- - - - - - - - - - - +{**} + + + +
+ + + + + +
+
+
+ + {include file='SetMenu.tpl'} + + + + + + + + + + + + + + +
{$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES}
{$UMOD.LBL_EMAIL_TEMPLATE_DESC}
+ +
+ + + + +
+ + + + + + +
{$UMOD.LBL_EMAIL_TEMPLATES}  +
+ + + + + + +
+ + + + + + + + + {foreach name=emailtemplate item=template from=$TEMPLATES} + + + + + + + + {/foreach} +
#{$UMOD.LBL_LIST_SELECT}{$UMOD.LBL_EMAIL_TEMPLATE}{$UMOD.LBL_DESCRIPTION}{$UMOD.LBL_TEMPLATE_TOOLS}
{$smarty.foreach.emailtemplate.iteration} + {$template.templatename} + {$template.description}  + {$UMOD.LNK_SAMPLE_EMAIL} +
+ + + + +
{$MOD.LBL_SCROLL}
+
+ + + +
+ + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ListRoles.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ListRoles.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ListRoles.tpl Tue Nov 14 03:16:10 2006 @@ -1,270 +1,270 @@ -{**} - - - - - -
- - - - - -
-
-
- - {include file="SetMenu.tpl"} - - - - - - - - - -
Roles{$MOD.LBL_SETTINGS} > {$MOD.LBL_ROLES}
{$MOD.LBL_ROLE_DESCRIPTION}
- -
- - - - -
- - - - - - -
{$MOD.LBL_ROLE_HIERARCHY_TREE} 
- -
- {include file='RoleTree.tpl'} -
- -{* - - - -
- -
 Organization
-
Administrator
-
CEO
-
Manager - Sales
-
Asst Manager - Sales
-
Manager - Products
-
Asst Manager - Products
-
Manager - Office
-
Asst Manager - Office
-
CFO
-
*} - - - - - - -
{$MOD.LBL_SCROLL}
-
- - - -
- - - - - - - - - - - -
 
- - +{**} + + + + + +
+ + + + + +
+
+
+ + {include file="SetMenu.tpl"} + + + + + + + + + +
Roles{$MOD.LBL_SETTINGS} > {$MOD.LBL_ROLES}
{$MOD.LBL_ROLE_DESCRIPTION}
+ +
+ + + + +
+ + + + + + +
{$MOD.LBL_ROLE_HIERARCHY_TREE} 
+ +
+ {include file='RoleTree.tpl'} +
+ +{* + + + +
+ +
 Organization
+
Administrator
+
CEO
+
Manager - Sales
+
Asst Manager - Sales
+
Manager - Products
+
Asst Manager - Products
+
Manager - Office
+
Asst Manager - Office
+
CFO
+
*} + + + + + + +
{$MOD.LBL_SCROLL}
+
+ + + +
+ + + + + + + + + + + +
 
+ + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ListView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ListView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ListView.tpl Tue Nov 14 03:16:10 2006 @@ -21,7 +21,20 @@ {/if} - - -
- - - - - - - - - - - - - - - -

- {$MOD.LBL_SETTINGS} > {$MOD.LBL_UPGRADE_VTIGER} -
-
 
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {if $GET_MYSQL_PATH eq 1} - - - - - {/if} - - - -
- {$MOD.LBL_UPGRADE_VTIGER}
- ({$MOD.LBL_UPGRADE_FROM_VTIGER_423}) -
- {$MOD.LBL_STEP} 1 : - {$MOD.LBL_SELECT_SOURCE}
- {$MOD.LBL_STEP1_DESC}

-
- - - {$MOD.LBL_RADIO_BUTTON1_TEXT}

- {$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON1_DESC} -
- - - {$MOD.LBL_RADIO_BUTTON2_TEXT}

- {$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON2_DESC} -
- - - {$MOD.LBL_RADIO_BUTTON3_TEXT}

{$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON3_DESC} -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- {$MOD.LBL_STEP} 2 : - {$MOD.LBL_HOST_DB_ACCESS_DETAILS}

-
{$MOD.LBL_SOURCE_HOST_NAME}
{$MOD.LBL_SOURCE_MYSQL_PORT_NO}
{$MOD.LBL_SOURCE_MYSQL_USER_NAME}
{$MOD.LBL_SOURCE_MYSQL_PASSWORD}
{$MOD.LBL_SOURCE_DB_NAME}
-
- - -
- - - - - - - - - - - - - -
- {$MOD.LBL_STEP} 2 : - {$MOD.LBL_LOCATE_DB_DUMP_FILE}

-
  - {$MOD.LBL_DUMP_FILE_LOCATION} - -
{$MOD.LBL_NOTE_TITLE}{$MOD.LBL_NOTES_DUMP_PROCESS}
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- {$MOD.LBL_STEP} 2 : - {$MOD.LBL_HOST_DB_ACCESS_DETAILS}

-
 {$MOD.LBL_MYSQL_HOST_NAME_IP}
 {$MOD.LBL_MYSQL_PORT}
 {$MOD.LBL_MYSQL_USER_NAME}
 {$MOD.LBL_MYSQL_PASSWORD}
 {$MOD.LBL_DB_NAME}
{$MOD.LBL_NOTE_TITLE} - - {$MOD.LBL_RADIO_BUTTON3_PROCESS} -
-
- - -
- -
- - - - - - - - -
- {$MOD.LBL_STEP} 3 : - {$MOD.LBL_ENTER_MYSQL_SERVER_PATH}
{$MOD.LBL_SERVER_PATH_DESC}

-
{$MOD.LBL_MYSQL_SERVER_PATH} - -
-
- - -
- -   -
-
-
-
 
- -
- - - +{**} + + + + + +
+ + + + + + + + + + + + + + + +

+ {$MOD.LBL_SETTINGS} > {$MOD.LBL_UPGRADE_VTIGER} + +               + {if $502_PATCH eq 'apply'} + Click here to apply the 5.0.2 Database changes from 5.0.0/5.0.1 + {/if} + +
+
 
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {if $GET_MYSQL_PATH eq 1} + + + + + {/if} + + + +
+ {$MOD.LBL_UPGRADE_VTIGER}
+ ({$MOD.LBL_UPGRADE_FROM_VTIGER_423}) +
+ {$MOD.LBL_STEP} 1 : + {$MOD.LBL_SELECT_SOURCE}
+ {$MOD.LBL_STEP1_DESC}

+
+ + + {$MOD.LBL_RADIO_BUTTON1_TEXT}

+ {$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON1_DESC} +
+ + + {$MOD.LBL_RADIO_BUTTON2_TEXT}

+ {$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON2_DESC} +
+ + + {$MOD.LBL_RADIO_BUTTON3_TEXT}

{$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON3_DESC} +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ {$MOD.LBL_STEP} 2 : + {$MOD.LBL_HOST_DB_ACCESS_DETAILS}

+
{$MOD.LBL_SOURCE_HOST_NAME}
{$MOD.LBL_SOURCE_MYSQL_PORT_NO}
{$MOD.LBL_SOURCE_MYSQL_USER_NAME}
{$MOD.LBL_SOURCE_MYSQL_PASSWORD}
{$MOD.LBL_SOURCE_DB_NAME}
+
+ + +
+ + + + + + + + + + + + + +
+ {$MOD.LBL_STEP} 2 : + {$MOD.LBL_LOCATE_DB_DUMP_FILE}

+
  + {$MOD.LBL_DUMP_FILE_LOCATION} + +
{$MOD.LBL_NOTE_TITLE}{$MOD.LBL_NOTES_DUMP_PROCESS}
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {$MOD.LBL_STEP} 2 : + {$MOD.LBL_HOST_DB_ACCESS_DETAILS}

+
 {$MOD.LBL_MYSQL_HOST_NAME_IP}
 {$MOD.LBL_MYSQL_PORT}
 {$MOD.LBL_MYSQL_USER_NAME}
 {$MOD.LBL_MYSQL_PASSWORD}
 {$MOD.LBL_DB_NAME}
{$MOD.LBL_NOTE_TITLE} + + {$MOD.LBL_RADIO_BUTTON3_PROCESS} +
+
+ + +
+ +
+ + + + + + + + +
+ {$MOD.LBL_STEP} 3 : + {$MOD.LBL_ENTER_MYSQL_SERVER_PATH}
{$MOD.LBL_SERVER_PATH_DESC}

+
{$MOD.LBL_MYSQL_SERVER_PATH} + +
+
+ + +
+ +   +
+
+
+
 
+ +
+ + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Popup.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Popup.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Popup.tpl Tue Nov 14 03:16:10 2006 @@ -18,7 +18,7 @@ Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ProfileDetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ProfileDetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ProfileDetailView.tpl Tue Nov 14 03:16:10 2006 @@ -1,312 +1,398 @@ -{**} -{literal} - -{/literal} - - -
- - - - - -
-
-
- {include file='SetMenu.tpl'} -
- - - - - - - - - - - - - - - -
{$MOD.LBL_PROFILES}{$MOD.LBL_SETTINGS} > {$CMOD.LBL_PROFILE_PRIVILEGES} > {$CMOD.LBL_VIEWING} "{$PROFILE_NAME}"
{$CMOD.LBL_PROFILE_MESG} "{$PROFILE_NAME}"
- - - - - - -
- - - - -
- - - - - -
- - - - - -
- - - - - - - - -
- - - - -
- - - - - - - -
{$CMOD.LBL_DEFINE_PRIV_FOR} <{$PROFILE_NAME}>
- {$CMOD.LBL_USE_OPTION_TO_SET_PRIV}
 
- - - - - -
- - - - -
- - - - - - -
{$CMOD.LBL_SUPER_USER_PRIV}
- - - - - -
  - - - - - - - - - - - - - - - - - - - - - -
{$GLOBAL_PRIV.0}{$CMOD.LBL_VIEW_ALL}
{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_VIEW}
 
{$GLOBAL_PRIV.1}{$CMOD.LBL_EDIT_ALL}
{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_EDIT}
-
-
- - - - - -
{$CMOD.LBL_SET_PRIV_FOR_EACH_MODULE}
- - - - - - -
  - - - - - - - - - - - - - - - {foreach key=tabid item=elements from=$TAB_PRIV} - - {assign var=modulename value=$TAB_PRIV[$tabid][0]} - - - - - - - - - - - {/foreach} - -
{$CMOD.LBL_TAB_MESG_OPTION}
{$CMOD.LBL_EDIT_PERMISSIONS}
{$CMOD.LBL_FIELDS_AND_TOOLS_SETTINGS}
{$CMOD.LBL_CREATE_EDIT} -
{$CMOD.LBL_VIEW}
{$CMOD.LBL_DELETE}
- {$TAB_PRIV[$tabid][1]} -

{$APP[$modulename]}

 
- {$STANDARD_PRIV[$tabid][1]} -
 
- {$STANDARD_PRIV[$tabid][3]} -
 
- {$STANDARD_PRIV[$tabid][2]} -
 
- {if $FIELD_PRIVILEGES[$tabid] neq NULL || $modulename eq 'Emails'} - {$APP.LBL_EXPAND_COLLAPSE} - {/if} -
- - - {if $FIELD_PRIVILEGES[$tabid] neq ''} - - {if $modulename eq 'Calendar'} - - {else} - - {/if} - - {/if} - {foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]} - - {foreach item=element from=$row_values} - - - {/foreach} - - {/foreach} - {if $modulename eq 'Calendar'} - - - - {foreach item=row_values from=$FIELD_PRIVILEGES[16]} - - {foreach item=element from=$row_values} - - - {/foreach} - - {/foreach} - {/if} - {if $UTILITIES_PRIV[$tabid] neq ''} - - - - {/if} - {foreach item=util_value from=$UTILITIES_PRIV[$tabid]} - - {foreach item=util_elements from=$util_value} - - - {/foreach} - - {/foreach} - -
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Tasks}){$CMOD.LBL_FIELDS_SELECT_DESELECT}
{$element.1}{$element.0}
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Events})
{$element.1}{$element.0}
{$CMOD.LBL_TOOLS_TO_BE_SHOWN}
{$util_elements.1}{$APP[$util_elements.0]}
-
-
-
- - - - - - -
*{$CMOD.LBL_MANDATORY_MSG}
*{$CMOD.LBL_DISABLE_FIELD_MSG}
-
- - - - - - - - - -
 
-
-
-
- - - - - - - -
-

 

- - -
{$MOD.LBL_SCROLL}
- -
- - - - - - - - - - - - - - - - +{**} +{literal} + +{/literal} + + + +{/literal} + +
+ + + + + +
+
+
+ {include file='SetMenu.tpl'} + +
+ + + + + + + + + + + + + + + + +
{$MOD.LBL_PROFILES}{$MOD.LBL_SETTINGS} > {$CMOD.LBL_PROFILE_PRIVILEGES} > {$CMOD.LBL_VIEWING} "{$PROFILE_NAME}"
{$CMOD.LBL_PROFILE_MESG} "{$PROFILE_NAME}"
+ + + + + + +
+ + + + +
+ + + + + +
+ + + + + +
+ + + + + + + + +
+ + + + +
+ + + + + + + +
{$CMOD.LBL_DEFINE_PRIV_FOR} <{$PROFILE_NAME}>
+ {$CMOD.LBL_USE_OPTION_TO_SET_PRIV}
   +
+ + + + + + + + + + +
+ + + + +
+ + + + + + +
{$CMOD.LBL_SUPER_USER_PRIV}
+ + + + + +
  + + + + + + + + + + + + + + + + + + + + + +
{$GLOBAL_PRIV.0}{$CMOD.LBL_VIEW_ALL}
{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_VIEW}
 
{$GLOBAL_PRIV.1}{$CMOD.LBL_EDIT_ALL}
{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_EDIT}
+
+
+ + + + + +
{$CMOD.LBL_SET_PRIV_FOR_EACH_MODULE}
+ + + + + + +
  + + + + + + + + + + + + + + + {foreach key=tabid item=elements from=$TAB_PRIV} + + {assign var=modulename value=$TAB_PRIV[$tabid][0]} + + + + + + + + + + + {/foreach} + +
{$CMOD.LBL_TAB_MESG_OPTION}
{$CMOD.LBL_EDIT_PERMISSIONS}
{$CMOD.LBL_FIELDS_AND_TOOLS_SETTINGS}
{$CMOD.LBL_CREATE_EDIT} +
{$CMOD.LBL_VIEW}
{$CMOD.LBL_DELETE}
+ {$TAB_PRIV[$tabid][1]} +

{$APP[$modulename]}

 
+ {$STANDARD_PRIV[$tabid][1]} +
 
+ {$STANDARD_PRIV[$tabid][3]} +
 
+ {$STANDARD_PRIV[$tabid][2]} +
 
+ {if $FIELD_PRIVILEGES[$tabid] neq NULL || $modulename eq 'Emails'} + {$APP.LBL_EXPAND_COLLAPSE} + {/if} +
+ + + {if $FIELD_PRIVILEGES[$tabid] neq ''} + + {if $modulename eq 'Calendar'} + + {else} + + {/if} + + {/if} + {foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]} + + {foreach item=element from=$row_values} + + + {/foreach} + + {/foreach} + {if $modulename eq 'Calendar'} + + + + {foreach item=row_values from=$FIELD_PRIVILEGES[16]} + + {foreach item=element from=$row_values} + + + {/foreach} + + {/foreach} + {/if} + {if $UTILITIES_PRIV[$tabid] neq ''} + + + + {/if} + {foreach item=util_value from=$UTILITIES_PRIV[$tabid]} + + {foreach item=util_elements from=$util_value} + + + {/foreach} + + {/foreach} + +
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Tasks}){$CMOD.LBL_FIELDS_SELECT_DESELECT}
{$element.1}{$element.0}
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Events})
{$element.1}{$element.0}
{$CMOD.LBL_TOOLS_TO_BE_SHOWN}
{$util_elements.1}{$APP[$util_elements.0]}
+
+
+
+ + + + + + +
*{$CMOD.LBL_MANDATORY_MSG}
*{$CMOD.LBL_DISABLE_FIELD_MSG}
+
+ + + + + + + + + +
 
+
+
+
+ + + + + + + +
+

 

+ + +
{$MOD.LBL_SCROLL}
+ +
+ + + + + + + + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/QuickCreate.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/QuickCreate.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/QuickCreate.tpl Tue Nov 14 03:16:10 2006 @@ -68,10 +68,9 @@ Modified: vtigercrm/branches/5.1_jens/Smarty/templates/RelatedListContents.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/RelatedListContents.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/RelatedListContents.tpl Tue Nov 14 03:16:10 2006 @@ -1,146 +1,147 @@ -{**} - -{if $SinglePane_View eq 'true'} - {assign var = return_modname value='DetailView'} -{else} - {assign var = return_modname value='CallRelatedList'} -{/if} - -{foreach key=header item=detail from=$RELATEDLISTS} - - - - - {if $detail ne ''} - - {$detail.navigation.1} - {/if} - - {elseif $header eq 'PriceBooks'} - {if $MODULE eq 'Products'} - - {/if} - {elseif $header eq 'Products'} - {if $MODULE eq 'PriceBooks'} - - {elseif $MODULE eq 'Potentials'} -   - - - {elseif $MODULE eq 'Vendors'} - - {else} - - {/if} - {elseif $header eq 'Leads'} - {if $MODULE eq 'Campaigns'} - {$LEADCVCOMBO} - - {/if} - - {elseif $header eq 'Contacts' } - {if $MODULE eq 'Calendar' || $MODULE eq 'Potentials' || $MODULE eq 'Vendors'} - - {elseif $MODULE eq 'Emails'} -   - - {elseif $MODULE eq 'Campaigns'} - {$CONTCVCOMBO} - - - {else} - - {/if} - {elseif $header eq 'Activities'} - {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'Invoice' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Campaigns'} - - - {else} - -   - - {/if} - {elseif $header eq 'HelpDesk'} - - {elseif $header eq 'Campaigns'} - - {elseif $header eq 'Attachments'} -   - - - {elseif $header eq 'Quotes'} - - {elseif $header eq 'Invoice'} - {if $MODULE eq 'SalesOrder'} - - {else} - - {/if} - {elseif $header eq 'Sales Order'} - {if $MODULE eq 'Quotes'} - - {else} - - {/if} - {elseif $header eq 'Purchase Order'} - - {elseif $header eq 'Emails'} - - - - {elseif $header eq 'Users'} - {if $MODULE eq 'Calendar'} - - {elseif $MODULE eq 'Emails'} -   -   - {/if} - {elseif $header eq 'Activity History'} -   - {/if} - -
{$APP.$header}{$detail.navigation.0} - {if $header eq 'Potentials'} - -
-{if $detail ne ''} - {foreach key=header item=detail from=$detail} - {if $header eq 'header'} - - - {foreach key=header item=headerfields from=$detail} - - {/foreach} - - {elseif $header eq 'entries'} - {foreach key=header item=detail from=$detail} - - {foreach key=header item=listfields from=$detail} - - {/foreach} - - {/foreach} -
{$headerfields}
{$listfields}
- {/if} - {/foreach} -{else} - - - - -
{$APP.LBL_NONE_INCLUDED}
-{/if} -

-{/foreach} +{**} + +{if $SinglePane_View eq 'true'} + {assign var = return_modname value='DetailView'} +{else} + {assign var = return_modname value='CallRelatedList'} +{/if} + +{foreach key=header item=detail from=$RELATEDLISTS} + + + + + {if $detail ne ''} + + {$detail.navigation.1} + {/if} + + {elseif $header eq 'PriceBooks'} + {if $MODULE eq 'Products'} + + {/if} + {elseif $header eq 'Products'} + {if $MODULE eq 'PriceBooks'} + + {elseif $MODULE eq 'Potentials'} +   + + + {elseif $MODULE eq 'Vendors'} + + + {else} + + {/if} + {elseif $header eq 'Leads'} + {if $MODULE eq 'Campaigns'} + {$LEADCVCOMBO} + + {/if} + + {elseif $header eq 'Contacts' } + {if $MODULE eq 'Calendar' || $MODULE eq 'Potentials' || $MODULE eq 'Vendors'} + + {elseif $MODULE eq 'Emails'} +   + + {elseif $MODULE eq 'Campaigns'} + {$CONTCVCOMBO} + + + {else} + + {/if} + {elseif $header eq 'Activities'} + {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'Invoice' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Campaigns'} + + + {else} + +   + + {/if} + {elseif $header eq 'HelpDesk'} + + {elseif $header eq 'Campaigns'} + + {elseif $header eq 'Attachments'} +   + + + {elseif $header eq 'Quotes'} + + {elseif $header eq 'Invoice'} + {if $MODULE eq 'SalesOrder'} + + {else} + + {/if} + {elseif $header eq 'Sales Order'} + {if $MODULE eq 'Quotes'} + + {else} + + {/if} + {elseif $header eq 'Purchase Order'} + + {elseif $header eq 'Emails'} + + + + {elseif $header eq 'Users'} + {if $MODULE eq 'Calendar'} + + {elseif $MODULE eq 'Emails'} +   +   + {/if} + {elseif $header eq 'Activity History'} +   + {/if} + +
{$APP.$header}{$detail.navigation.0} + {if $header eq 'Potentials'} + +
+{if $detail ne ''} + {foreach key=header item=detail from=$detail} + {if $header eq 'header'} + + + {foreach key=header item=headerfields from=$detail} + + {/foreach} + + {elseif $header eq 'entries'} + {foreach key=header item=detail from=$detail} + + {foreach key=header item=listfields from=$detail} + + {/foreach} + + {/foreach} +
{$headerfields}
{$listfields}
+ {/if} + {/foreach} +{else} + + + + +
{$APP.LBL_NONE_INCLUDED}
+{/if} +

+{/foreach} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/SetMenu.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/SetMenu.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/SetMenu.tpl Tue Nov 14 03:16:10 2006 @@ -1,190 +1,192 @@ -{**} - - - + + + +
- - - - + +
- - - - - - - {if $smarty.request.action eq 'index' || $smarty.request.action eq 'DetailView' || $smarty.request.action eq 'EditView' || $smarty.request.action eq 'ListView' } - - {else} - - {/if} - - {if $smarty.request.action eq 'listroles' || $smarty.request.action eq 'RoleDetailView' || $smarty.request.action eq 'saverole' || $smarty.request.action eq 'createrole' || $smarty.request.action eq 'RoleDeleteStep1'} - - {else} - - {/if} - - {if $smarty.request.action eq 'ListProfiles' || $smarty.request.action eq 'profilePrivileges' || $smarty.request.action eq 'CreateProfile' || $smarty.request.action eq 'SaveProfile' || $smarty.request.action eq 'UpdateProfileChanges' } - - {else} - - {/if} - - {if $smarty.request.action eq 'listgroups' || $smarty.request.action eq 'GroupDetailView' || $smarty.request.action eq 'createnewgroup' || $smarty.request.action eq 'SaveGroup'} - - {else} - - {/if} - - {if $smarty.request.action eq 'OrgSharingEditView' || $smarty.request.action eq 'OrgSharingDetailView' || $smarty.request.action eq 'SaveOrgSharing'} - - {else} - - {/if} - - {if $smarty.request.action eq 'DefaultFieldPermissions' || $smarty.request.action eq 'UpdateDefaultFieldLevelAccess' || $smarty.request.action eq 'EditDefOrgFieldLevelAccess' } - - {else} - - {/if} - - {if $smarty.request.action eq 'AuditTrailList'} - - {else} - - {/if} - - {if $smarty.request.action eq 'ListLoginHistory'} - - {else} - - {/if} - - - - {if $smarty.request.action eq 'CustomFieldList' || $smarty.request.action eq 'LeadCustomFieldMapping'} - - {else} - - {/if} - - {if $smarty.request.action eq 'PickList' || $smarty.request.action eq 'SettingsAjax'} - {else} - - {/if} - - - - {if $smarty.request.action eq 'listemailtemplates' || $smarty.request.action eq 'detailviewemailtemplate' || $smarty.request.action eq 'editemailtemplate' || $smarty.request.action eq 'saveemailtemplate' || $smarty.request.action eq 'deleteemailtemplate' || $smarty.request.action eq 'createemailtemplate'} - - {else} - - {/if} - - {if $smarty.request.action eq 'listwordtemplates' || $smarty.request.action eq 'add2db' || $smarty.request.action eq 'deletewordtemplate' || $smarty.request.action eq 'upload'} - - {else} - - {/if} - - {if $smarty.request.action eq 'listnotificationschedulers' || $smarty.request.action eq 'UsersAjax'} - - {else} - - {/if} - - {if $smarty.request.action eq 'listinventorynotifications' || $smarty.request.action eq 'UsersAjax'} - - {else} - - {/if} - - {if $smarty.request.action eq 'OrganizationTermsandConditions' || $smarty.request.action eq 'savetermsandconditions'} - - {else} - - {/if} - - - - {if $smarty.request.action eq 'OrganizationConfig' || $smarty.request.action eq 'EditCompanyDetails' || $smarty.request.action eq 'add2db'} - - {else} - - {/if} - - {if $smarty.request.action eq 'EmailConfig' || $smarty.request.action eq 'Save' } - - {else} - - {/if} - - {if $smarty.request.action eq 'BackupServerConfig' || $smarty.request.action eq 'Save'} - - {else} - - {/if} - - {if $smarty.request.action eq 'ListModuleOwners' || $smarty.request.action eq 'SettingsAjax'} - - {else} - - {/if} - - {if $smarty.request.action eq 'CurrencyListView' || $smarty.request.action eq 'CurrencyEditView' || $smarty.request.action eq 'SaveCurrencyInfo'} - - {else} - - {/if} - - {if $smarty.request.action eq 'TaxConfig'} - - {else} - - {/if} - - {if $smarty.request.action eq 'listsysconfig'} - - {else} - - {/if} - - {if $smarty.request.action eq 'ProxyServerConfig'} - - {else} - - {/if} - - {if $smarty.request.action eq 'Announcements' || $smarty.request.action eq 'UsersAjax' } - - {else} - - {/if} - - {if $smarty.request.action eq 'DefModuleView'} - - {else} - - {/if} - - -
{$MOD.LBL_USER_MANAGEMENT}
{$MOD.LBL_USERS}
{$MOD.LBL_USERS}
{$MOD.LBL_ROLES}
{$MOD.LBL_ROLES}
{$MOD.LBL_PROFILES}
{$MOD.LBL_PROFILES}
{$MOD.USERGROUPLIST}
{$MOD.USERGROUPLIST}
{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_STUDIO}
{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_COMMUNICATION_TEMPLATES}
{$MOD.EMAILTEMPLATES}
{$MOD.EMAILTEMPLATES}
{$MOD.WORDINTEGRATION}
{$MOD.WORDINTEGRATION}
{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.INVENTORYNOTIFICATION}
{$MOD.INVENTORYNOTIFICATION}
{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_OTHER_SETTINGS}
{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_MIGRATION}
- - -
- - - - +{**} + + + - - - -
+ + + + - -
+ + + + + + + {if $smarty.request.action eq 'index' || $smarty.request.action eq 'DetailView' || $smarty.request.action eq 'EditView' || $smarty.request.action eq 'ListView' } + + {else} + + {/if} + + {if $smarty.request.action eq 'listroles' || $smarty.request.action eq 'RoleDetailView' || $smarty.request.action eq 'saverole' || $smarty.request.action eq 'createrole' || $smarty.request.action eq 'RoleDeleteStep1'} + + {else} + + {/if} + + {if $smarty.request.action eq 'ListProfiles' || $smarty.request.action eq 'profilePrivileges' || $smarty.request.action eq 'CreateProfile' || $smarty.request.action eq 'SaveProfile' || $smarty.request.action eq 'UpdateProfileChanges' } + + {else} + + {/if} + + {if $smarty.request.action eq 'listgroups' || $smarty.request.action eq 'GroupDetailView' || $smarty.request.action eq 'createnewgroup' || $smarty.request.action eq 'SaveGroup'} + + {else} + + {/if} + + {if $smarty.request.action eq 'OrgSharingEditView' || $smarty.request.action eq 'OrgSharingDetailView' || $smarty.request.action eq 'SaveOrgSharing'} + + {else} + + {/if} + + {if $smarty.request.action eq 'DefaultFieldPermissions' || $smarty.request.action eq 'UpdateDefaultFieldLevelAccess' || $smarty.request.action eq 'EditDefOrgFieldLevelAccess' } + + {else} + + {/if} + + {if $smarty.request.action eq 'AuditTrailList'} + + {else} + + {/if} + + {if $smarty.request.action eq 'ListLoginHistory'} + + {else} + + {/if} + + + + {if $smarty.request.action eq 'CustomFieldList' || $smarty.request.action eq 'LeadCustomFieldMapping'} + + {else} + + {/if} + + {if $smarty.request.action eq 'PickList' || $smarty.request.action eq 'SettingsAjax'} + {else} + + {/if} + + + + {if $smarty.request.action eq 'listemailtemplates' || $smarty.request.action eq 'detailviewemailtemplate' || $smarty.request.action eq 'editemailtemplate' || $smarty.request.action eq 'saveemailtemplate' || $smarty.request.action eq 'deleteemailtemplate' || $smarty.request.action eq 'createemailtemplate'} + + {else} + + {/if} + + {if $smarty.request.action eq 'listwordtemplates' || $smarty.request.action eq 'add2db' || $smarty.request.action eq 'deletewordtemplate' || $smarty.request.action eq 'upload'} + + {else} + + {/if} + + {if $smarty.request.action eq 'listnotificationschedulers' || $smarty.request.action eq 'UsersAjax'} + + {else} + + {/if} + + {if $smarty.request.action eq 'listinventorynotifications' || $smarty.request.action eq 'UsersAjax'} + + {else} + + {/if} + + + + + {if $smarty.request.action eq 'OrganizationConfig' || $smarty.request.action eq 'EditCompanyDetails' || $smarty.request.action eq 'add2db'} + + {else} + + {/if} + + {if $smarty.request.action eq 'EmailConfig' || $smarty.request.action eq 'Save' } + + {else} + + {/if} + + {if $smarty.request.action eq 'BackupServerConfig' || $smarty.request.action eq 'Save'} + + {else} + + {/if} + + {if $smarty.request.action eq 'ListModuleOwners' || $smarty.request.action eq 'SettingsAjax'} + + {else} + + {/if} + + {if $smarty.request.action eq 'CurrencyListView' || $smarty.request.action eq 'CurrencyEditView' || $smarty.request.action eq 'SaveCurrencyInfo'} + + {else} + + {/if} + + {if $smarty.request.action eq 'TaxConfig'} + + {else} + + {/if} + + {if $smarty.request.action eq 'listsysconfig'} + + {else} + + {/if} + + {if $smarty.request.action eq 'ProxyServerConfig'} + + {else} + + {/if} + + {if $smarty.request.action eq 'Announcements' || $smarty.request.action eq 'UsersAjax' } + + {else} + + {/if} + + {if $smarty.request.action eq 'DefModuleView'} + + {else} + + {/if} + + + + {if $smarty.request.action eq 'OrganizationTermsandConditions' || $smarty.request.action eq 'savetermsandconditions'} + + {else} + + {/if} + +
{$MOD.LBL_USER_MANAGEMENT}
{$MOD.LBL_USERS}
{$MOD.LBL_USERS}
{$MOD.LBL_ROLES}
{$MOD.LBL_ROLES}
{$MOD.LBL_PROFILES}
{$MOD.LBL_PROFILES}
{$MOD.USERGROUPLIST}
{$MOD.USERGROUPLIST}
{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_STUDIO}
{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_COMMUNICATION_TEMPLATES}
{$MOD.EMAILTEMPLATES}
{$MOD.EMAILTEMPLATES}
{$MOD.WORDINTEGRATION}
{$MOD.WORDINTEGRATION}
{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.INVENTORYNOTIFICATION}
{$MOD.INVENTORYNOTIFICATION}
{$MOD.LBL_OTHER_SETTINGS}
{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_MIGRATION}
{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_INVENTORY_TANDC}
+ + +
+ + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Settings.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Settings.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Settings.tpl Tue Nov 14 03:16:10 2006 @@ -1,566 +1,507 @@ -{**} - - {include file="Buttons_List1.tpl"} - - - - - - -
-
-
- - - - - - - -
- - - {$MOD.LBL_SETTINGS} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - {$MOD.LBL_USER_MANAGEMENT} -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
{$MOD.LBL_USERS}{$MOD.LBL_USERS}
{$MOD.LBL_USER_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_ROLES}{$MOD.LBL_ROLES}
{$MOD.LBL_ROLE_DESCRIPTION}
- -
- - - - - - - - - - -
{$MOD.LBL_PROFILES}{$MOD.LBL_PROFILES}
{$MOD.LBL_PROFILE_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.USERGROUPLIST}{$MOD.USERGROUPLIST}
{$MOD.LBL_GROUP_DESCRIPTION}
- -
- - - - - - - - - - -
{$MOD.LBL_SHARING_ACCESS}{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_SHARING_ACCESS_DESCRIPTION}
-
- - - - - - - - - - - -
Fields to be shown{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_SHARING_FIELDS_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_AUDIT_TRAIL}{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_AUDIT_DESCRIPTION}
- - -
- - - - - - - - - - -
{$MOD.LBL_LOGIN_HISTORY_DETAILS}{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_LOGIN_HISTORY_DESCRIPTION}
-
- - -
- - - {$MOD.LBL_STUDIO} -
- - - - - - - - - - - -
- - - - - - - - - - -
{$MOD.LBL_CUSTOM_FIELDS}{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_CUSTOM_FIELDS_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_PICKLIST_EDITOR}{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_DESCRIPTION}
-
- - - - - - - - - - -
  
 
-
- - - - - - - - - - -
  
 
-
- - -
- - {$MOD.LBL_COMMUNICATION_TEMPLATES} -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
{$MOD.EMAILTEMPLATES}{$MOD.EMAILTEMPLATES}
{$MOD.LBL_EMAIL_TEMPLATE_DESCRIPTION}
-
- - - - - - - - - - - -
{$MOD.LBL_MAIL_MERGE}{$MOD.WORDINTEGRATION}
{$MOD.LBL_MAIL_MERGE_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.NOTIFICATIONSCHEDULERS}{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.LBL_NOTIF_SCHED_DESCRIPTION}
-
- - - - - - - - - - - -
{$MOD.INVENTORYNOTIFICATION}{$MOD.INVENTORYNOTIFICATION}
{$MOD.LBL_INV_NOTIF_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.INVENTORYTERMSANDCONDITIONS}{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_INV_TANDC_DESCRIPTION}
- -
- - - - - - - - - - -
  
 
-
- - - - - - - - - - -
  
 
-
- - - - - - - - - - -
  
 
- -
- - -
- - {$MOD.LBL_OTHER_SETTINGS} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
{$MOD.LBL_COMPANY_DETAILS}{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_COMPANY_DESCRIPTION}
- -
- - - - - - - - - - -
{$MOD.LBL_MAIL_SERVER_SETTINGS}{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_MAIL_SERVER_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_BACKUP_SERVER_SETTINGS}{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_DESCRIPTION}
- -
- - - - - - - - - - -
{$MOD.LBL_ASSIGN_MODULE_OWNERS}{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_MODULE_OWNERS_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_CURRENCY_SETTINGS}{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_CURRENCY_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_TAX_SETTINGS}{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_TAX_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_SYSTEM_INFO}{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_SYSTEM_DESCRIPTION}
-
- - - - - - - - - - - -
{$MOD.LBL_PROXY_SETTINGS}{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_PROXY_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_ANNOUNCEMENT}{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_ANNOUNCEMENT_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_DEFAULT_MODULE_VIEW}{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_DEFAULT_MODULE_VIEW_DESC}
-
- - - - - - - -
{$MOD.LBL_MIGRATION}{$MOD.LBL_MIGRATION}
{$MOD.LBL_MIGRATION_INFO}
  - -    
- - -
- -
- -
- -
- - - +{**} + + {include file="Buttons_List1.tpl"} + + + + + + + +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + {$MOD.LBL_USER_MANAGEMENT} +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
{$MOD.LBL_USERS}{$MOD.LBL_USERS}
{$MOD.LBL_USER_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_ROLES}{$MOD.LBL_ROLES}
{$MOD.LBL_ROLE_DESCRIPTION}
+ +
+ + + + + + + + + + +
{$MOD.LBL_PROFILES}{$MOD.LBL_PROFILES}
{$MOD.LBL_PROFILE_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.USERGROUPLIST}{$MOD.USERGROUPLIST}
{$MOD.LBL_GROUP_DESCRIPTION}
+ +
+ + + + + + + + + + +
{$MOD.LBL_SHARING_ACCESS}{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_SHARING_ACCESS_DESCRIPTION}
+
+ + + + + + + + + + + +
Fields to be shown{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_SHARING_FIELDS_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_AUDIT_TRAIL}{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_AUDIT_DESCRIPTION}
+ + +
+ + + + + + + + + + +
{$MOD.LBL_LOGIN_HISTORY_DETAILS}{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_LOGIN_HISTORY_DESCRIPTION}
+
+ + +
+ + + {$MOD.LBL_STUDIO} +
+ + + + + + + + + + + +
+ + + + + + + + + + +
{$MOD.LBL_CUSTOM_FIELDS}{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_CUSTOM_FIELDS_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_PICKLIST_EDITOR}{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_DESCRIPTION}
+
+ + + + + + + + + + +
  
 
+
+ + + + + + + + + + +
  
 
+
+ + +
+ + {$MOD.LBL_COMMUNICATION_TEMPLATES} +
+ + + + + + + + + + +
+ + + + + + + + + + +
{$MOD.EMAILTEMPLATES}{$MOD.EMAILTEMPLATES}
{$MOD.LBL_EMAIL_TEMPLATE_DESCRIPTION}
+
+ + + + + + + + + + + +
{$MOD.LBL_MAIL_MERGE}{$MOD.WORDINTEGRATION}
{$MOD.LBL_MAIL_MERGE_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.NOTIFICATIONSCHEDULERS}{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.LBL_NOTIF_SCHED_DESCRIPTION}
+
+ + + + + + + + + + + +
{$MOD.INVENTORYNOTIFICATION}{$MOD.INVENTORYNOTIFICATION}
{$MOD.LBL_INV_NOTIF_DESCRIPTION}
+
+ + +
+ + {$MOD.LBL_OTHER_SETTINGS} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
{$MOD.LBL_COMPANY_DETAILS}{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_COMPANY_DESCRIPTION}
+ +
+ + + + + + + + + + +
{$MOD.LBL_MAIL_SERVER_SETTINGS}{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_MAIL_SERVER_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_BACKUP_SERVER_SETTINGS}{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_DESCRIPTION}
+ +
+ + + + + + + + + + +
{$MOD.LBL_ASSIGN_MODULE_OWNERS}{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_MODULE_OWNERS_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_CURRENCY_SETTINGS}{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_CURRENCY_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_TAX_SETTINGS}{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_TAX_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_SYSTEM_INFO}{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_SYSTEM_DESCRIPTION}
+
+ + + + + + + + + + + +
{$MOD.LBL_PROXY_SETTINGS}{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_PROXY_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_ANNOUNCEMENT}{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_ANNOUNCEMENT_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_DEFAULT_MODULE_VIEW}{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_DEFAULT_MODULE_VIEW_DESC}
+
+ + + + + + + +
{$MOD.LBL_MIGRATION}{$MOD.LBL_MIGRATION}
{$MOD.LBL_MIGRATION_INFO}
+ + + + + + + + + + +
{$MOD.INVENTORYTERMSANDCONDITIONS}{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_INV_TANDC_DESCRIPTION}
+ +
+ +
+
+
+ +
+ + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Settings/PickList.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Settings/PickList.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Settings/PickList.tpl Tue Nov 14 03:16:10 2006 @@ -1,234 +1,259 @@ -{**} - - - - - -
- - - - - -
-
-
- - {include file='SetMenu.tpl'} - - - - - - - - - -
{$MOD.LBL_SETTINGS} > {$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_DESCRIPTION}
- - - - - - -
- - - - - - -
1. {$MOD.LBL_SELECT_MODULE} 
- - - - - -
{$MOD.LBL_SELECT_CRM_MODULE} - -
-
- - - - - -
-
- {include file='Settings/PickListContents.tpl'} -
-
- - -
{$MOD.LBL_SCROLL}
- -
- - - -
-
- - - -
-
-{literal} - -{/literal} +{**} + + + + + +
+ + + + + +
+
+
+ + {include file='SetMenu.tpl'} + + + + + + + + + +
{$MOD.LBL_SETTINGS} > {$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_DESCRIPTION}
+ + + + + + +
+ + + + + + +
1. {$MOD.LBL_SELECT_MODULE} 
+ + + + + +
{$MOD.LBL_SELECT_CRM_MODULE} + +
+
+ + + + + +
+
+ {include file='Settings/PickListContents.tpl'} +
+
+ + +
{$MOD.LBL_SCROLL}
+ +
+ + + +
+
+ + + +
+
+{literal} + +{/literal} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Settings/TaxConfig.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Settings/TaxConfig.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Settings/TaxConfig.tpl Tue Nov 14 03:16:10 2006 @@ -1,244 +1,262 @@ -{**} - - - - -{literal} - -{/literal} -
- - - - - - -
-
-
- - {include file='SetMenu.tpl'} - -{if $EDIT_MODE eq 'true'} - {assign var=formname value='EditTax'} - {assign var=shformname value='SHEditTax'} -{else} - {assign var=formname value='ListTax'} - {assign var=shformname value='SHListTax'} -{/if} - - - - - - - - - - - -
Users{$MOD.LBL_SETTINGS} > - {if $EDIT_MODE eq 'true'} - {$MOD.LBL_EDIT} {$MOD.LBL_TAX_SETTINGS} - {else} - {$MOD.LBL_TAX_SETTINGS} - {/if} - -
{$MOD.LBL_TAX_DESC}
- -
- - - - - - - - -
- -
- - - - - - - - - - - - - - - - - -
{$MOD.LBL_PRODUCT_TAX_SETTINGS}
  - {if $EDIT_MODE neq 'true'} - - {/if} - - {if $EDIT_MODE eq 'true'} -   - - {elseif $TAX_COUNT > 0} - - {/if} -
- - - - - {if $TAX_COUNT eq 0} - - {else} - {foreach item=tax key=count from=$TAX_VALUES} - - - {if $tax.deleted eq 0} - - {else} - - {/if} - - - - - - {/foreach} - {if $EDIT_MODE eq 'true'} - - {/if} - {/if} -
No taxes available. Please Add Tax.
{$tax.taxlabel} - {if $EDIT_MODE eq 'true'} -  % - {else} - {$tax.percentage} % - {/if} - - {if $tax.deleted eq 0} - Enable me - {else} - Enable me - {/if} -
- -
-
-
- - - - - - - - - - - - - - - - - -
{$MOD.LBL_SHIPPING_HANDLING_TAX_SETTINGS}
  - {if $SH_EDIT_MODE neq 'true'} - - {/if} - - {if $SH_EDIT_MODE eq 'true'} - -   - - {elseif $SH_TAX_COUNT > 0} - - {/if} -
- - - - - {if $SH_TAX_COUNT eq 0} - - {else} - {foreach item=tax key=count from=$SH_TAX_VALUES} - - - {if $tax.deleted eq 0} - - {else} - - {/if} - - - - - - {/foreach} - {if $SH_EDIT_MODE eq 'true'} - - {/if} - {/if} -
No taxes available. Please Add Tax.
{$tax.taxlabel} - {if $SH_EDIT_MODE eq 'true'} - -  % - {else} - {$tax.percentage} % - {/if} - - {if $tax.deleted eq 0} - Enable me - {else} - Enable me - {/if} -
- -
-
- - - - - -
{$MOD.LBL_SCROLL}
- - - - -
- - - - - - - - - - +{**} + + + + + +{literal} + +{/literal} +
+ + + + + + +
+
+
+ + {include file='SetMenu.tpl'} + +{if $EDIT_MODE eq 'true'} + {assign var=formname value='EditTax'} + {assign var=shformname value='SHEditTax'} +{else} + {assign var=formname value='ListTax'} + {assign var=shformname value='SHListTax'} +{/if} + + + + + + + + + + + +
Users{$MOD.LBL_SETTINGS} > + {if $EDIT_MODE eq 'true'} + {$MOD.LBL_EDIT} {$MOD.LBL_TAX_SETTINGS} + {else} + {$MOD.LBL_TAX_SETTINGS} + {/if} + +
{$MOD.LBL_TAX_DESC}
+ +
+ + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
{$MOD.LBL_PRODUCT_TAX_SETTINGS}
  + {if $EDIT_MODE neq 'true'} + + {/if} + + {if $EDIT_MODE eq 'true'} +   + + {elseif $TAX_COUNT > 0} + + {/if} +
+ + + + + {if $TAX_COUNT eq 0} + + {else} + {foreach item=tax key=count from=$TAX_VALUES} + + + {if $tax.deleted eq 0} + + {else} + + {/if} + + + {assign var=tax_label value="taxlabel_"|cat:$tax.taxname} + + + + + + {/foreach} + {if $EDIT_MODE eq 'true'} + + {/if} + {/if} +
No taxes available. Please Add Tax.
+ {if $EDIT_MODE eq 'true'} + + {else} + {$tax.taxlabel} + {/if} + + {if $EDIT_MODE eq 'true'} +  % + {else} + {$tax.percentage} % + {/if} + + {if $tax.deleted eq 0} + Enable me + {else} + Enable me + {/if} +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
{$MOD.LBL_SHIPPING_HANDLING_TAX_SETTINGS}
  + {if $SH_EDIT_MODE neq 'true'} + + {/if} + + {if $SH_EDIT_MODE eq 'true'} + +   + + {elseif $SH_TAX_COUNT > 0} + + {/if} +
+ + + + + {if $SH_TAX_COUNT eq 0} + + {else} + {foreach item=tax key=count from=$SH_TAX_VALUES} + + + {if $tax.deleted eq 0} + + {else} + + {/if} + + {assign var=tax_label value="taxlabel_"|cat:$tax.taxname} + + + + + {/foreach} + {if $SH_EDIT_MODE eq 'true'} + + {/if} + {/if} +
No taxes available. Please Add Tax.
+ {if $SH_EDIT_MODE eq 'true'} + + + {else} + {$tax.taxlabel} + {/if} + + {if $SH_EDIT_MODE eq 'true'} + +  % + {else} + {$tax.percentage} % + {/if} + + {if $tax.deleted eq 0} + Enable me + {else} + Enable me + {/if} +
+ +
+
+ + + + + +
{$MOD.LBL_SCROLL}
+ + + + +
+ + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/TagCloudDisplay.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/TagCloudDisplay.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/TagCloudDisplay.tpl Tue Nov 14 03:16:10 2006 @@ -19,6 +19,9 @@ +
  
+ + {$ALL_TAG} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/UserDetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/UserDetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/UserDetailView.tpl Tue Nov 14 03:16:10 2006 @@ -1,357 +1,359 @@ -{**} - - - - - - - - -
- - - - - - - -
-
-
- {if $CATEGORY eq 'Settings'} - {include file='SetMenu.tpl'} - {/if} - - - - -
-
- - - - - - {if $CATEGORY neq 'Settings'} - - {/if} - - - - - - - {if $CATEGORY eq 'Settings'} - - {/if} - - - - - - - - - - - - - - -
- - - - - - - - - - -
- {if $CATEGORY eq 'Settings'} - - {$MOD.LBL_SETTINGS} > {$MOD.LBL_USERS} >"{$USERNAME}" - {else} - - {$APP.LBL_MY_PREFERENCES} - - {/if} - -
{$UMOD.LBL_USERDETAIL_INFO} "{$USERNAME}"
-
 
- {if $IS_ADMIN eq 'true'} - - {/if} - {if $CATEGORY eq 'Settings'} - {$DUPLICATE_BUTTON} - {/if} - {$EDIT_BUTTON} - {if $CATEGORY eq 'Settings' && $ID neq 1 && $ID neq 2 & $ID neq $CURRENT_USERID} - - {/if} -
- - - - - -
- {foreach key=header name=blockforeach item=detail from=$BLOCKS} -
- - - {strip} - - - {/strip} - -
- {$smarty.foreach.blockforeach.iteration}. {$header} -  
- - - {foreach item=detail from=$detail} - - {foreach key=label item=data from=$detail} - {assign var=keyid value=$data.ui} - {assign var=keyval value=$data.value} - {assign var=keytblname value=$data.tablename} - {assign var=keyfldname value=$data.fldname} - {assign var=keyoptions value=$data.options} - {assign var=keysecid value=$data.secid} - {assign var=keyseclink value=$data.link} - {assign var=keycursymb value=$data.cursymb} - {assign var=keysalut value=$data.salut} - {assign var=keycntimage value=$data.cntimage} - {assign var=keyadmin value=$data.isadmin} - - {if $label ne ''} - - {include file="DetailViewUI.tpl"} - {else} - - - {/if} - {/foreach} - - {/foreach} -
{$label}  
- {/foreach} - -
- - - - - - -
- 5. {$UMOD.LBL_HOME_PAGE_COMP} - {$APP.LBL_EXPAND_COLLAPSE}
- - - -
- - - - - - -
- 6. {$UMOD.LBL_MY_GROUPS} - - {if $GROUP_COUNT > 0} - {$APP.LBL_EXPAND_COLLAPSE} - {else} -   - {/if} -
- - - -
-
- - {if $IS_ADMIN eq 'true'} - - - - - -
- 7. {$UMOD.LBL_LOGIN_HISTORY} - {$APP.LBL_EXPAND_COLLAPSE}
- - - -
-
- {/if} -
- - -
- -
- -
- - -
-
- - - - - - - - - - - - - -
-{$JAVASCRIPT} -
- - - - +{**} + + + + + + + + +
+ + + + + + + +
+
+
+ {if $CATEGORY eq 'Settings'} + {include file='SetMenu.tpl'} + {/if} + + + + +
+
+ + + + + + {if $CATEGORY neq 'Settings'} + + {/if} + + + + + + + {if $CATEGORY eq 'Settings'} + + {/if} + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ {if $CATEGORY eq 'Settings'} + + {$MOD.LBL_SETTINGS} > {$MOD.LBL_USERS} >"{$USERNAME}" + {else} + + {$APP.LBL_MY_PREFERENCES} + + {/if} + +
{$UMOD.LBL_USERDETAIL_INFO} "{$USERNAME}"
+
 
+ {if $IS_ADMIN eq 'true'} + + {/if} + {if $CATEGORY eq 'Settings'} + {$DUPLICATE_BUTTON} + {/if} + {$EDIT_BUTTON} + {if $CATEGORY eq 'Settings' && $ID neq 1 && $ID neq 2 & $ID neq $CURRENT_USERID} + + {/if} +
+ + + + + +
+ {foreach key=header name=blockforeach item=detail from=$BLOCKS} +
+ + + {strip} + + + {/strip} + +
+ {$smarty.foreach.blockforeach.iteration}. {$header} +  
+ + + {foreach item=detail from=$detail} + + {foreach key=label item=data from=$detail} + {assign var=keyid value=$data.ui} + {assign var=keyval value=$data.value} + {assign var=keytblname value=$data.tablename} + {assign var=keyfldname value=$data.fldname} + {assign var=keyoptions value=$data.options} + {assign var=keysecid value=$data.secid} + {assign var=keyseclink value=$data.link} + {assign var=keycursymb value=$data.cursymb} + {assign var=keysalut value=$data.salut} + {assign var=keycntimage value=$data.cntimage} + {assign var=keyadmin value=$data.isadmin} + + {if $label ne ''} + + {include file="DetailViewUI.tpl"} + {else} + + + {/if} + {/foreach} + + {/foreach} +
{$label}  
+ {/foreach} + + {include file="UserDetailOrg.tpl"} + +
+ + + + + + +
+ 6. {$UMOD.LBL_HOME_PAGE_COMP} + {$APP.LBL_EXPAND_COLLAPSE}
+ + + +
+ + + + + + +
+ 7. {$UMOD.LBL_MY_GROUPS} + + {if $GROUP_COUNT > 0} + {$APP.LBL_EXPAND_COLLAPSE} + {else} +   + {/if} +
+ + + +
+
+ + {if $IS_ADMIN eq 'true'} + + + + + +
+ 8. {$UMOD.LBL_LOGIN_HISTORY} + {$APP.LBL_EXPAND_COLLAPSE}
+ + + +
+
+ {/if} +
+ + +
+ +
+ +
+ + +
+
+ + + + + + + + + + + + + +
+{$JAVASCRIPT} +
+ + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/UserEditView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/UserEditView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/UserEditView.tpl Tue Nov 14 03:16:10 2006 @@ -1,203 +1,206 @@ -{**} - - - - - - - - - - - - - - -
-
- -
- {if $PARENTTAB eq 'Settings'} - {include file='SetMenu.tpl'} - {/if} - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - {if $MODE eq 'edit'} - - -
- - {if $PARENTTAB neq ''} - {$MOD.LBL_SETTINGS} > {$MOD.LBL_USERS} > - {if $MODE eq 'edit'} - {$UMOD.LBL_EDITING} "{$USERNAME}" - {else} - {$UMOD.LBL_CREATE_NEW_USER} - {/if} - - {else} - - {$APP.LBL_MY_PREFERENCES} - - {/if} -   -
{$UMOD.LBL_EDIT_VIEW} "{$USERNAME}" - {else} - {$UMOD.LBL_CREATE_NEW_USER} - {/if} -
-
 
- - - -
- - - -
- - - -
- - - - - - -
- {foreach key=header name=blockforeach item=data from=$BLOCKS} -
- - - {strip} - - - {/strip} - -
- {$smarty.foreach.blockforeach.iteration}. {$header} -  
- - - {include file="DisplayFields.tpl"} -
- {/foreach} -
- - - - - -
- 5. {$UMOD.LBL_HOME_PAGE_COMP} -  
- - {foreach item=homeitems key=values from=$HOMEORDER} - - {if $homeitems neq ''} - - - {else} - - - {/if} - - {/foreach} -
{$UMOD.$values} - {$UMOD.LBL_SHOW} - {$UMOD.LBL_HIDE} - {$UMOD.LBL_SHOW} - {$UMOD.LBL_HIDE}
-
-
 
- - -
-
-
-
-
-
- - - - - -
-{$JAVASCRIPT} +{**} + + + + + + + + + + + + + + +
+
+ +
+ {if $PARENTTAB eq 'Settings'} + {include file='SetMenu.tpl'} + {/if} + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + {if $MODE eq 'edit'} + + +
+ + {if $PARENTTAB neq ''} + {$MOD.LBL_SETTINGS} > {$MOD.LBL_USERS} > + {if $MODE eq 'edit'} + {$UMOD.LBL_EDITING} "{$USERNAME}" + {else} + {$UMOD.LBL_CREATE_NEW_USER} + {/if} + + {else} + + {$APP.LBL_MY_PREFERENCES} + + {/if} +   +
{$UMOD.LBL_EDIT_VIEW} "{$USERNAME}" + {else} + {$UMOD.LBL_CREATE_NEW_USER} + {/if} +
+
 
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ {foreach key=header name=blockforeach item=data from=$BLOCKS} +
+ + + {strip} + + + {/strip} + +
+ {$smarty.foreach.blockforeach.iteration}. {$header} +  
+ + + {include file="DisplayFields.tpl"} +
+ {/foreach} + + {include file="UserEditOrg.tpl"} + +
+ + + + + +
+ 6. {$UMOD.LBL_HOME_PAGE_COMP} +  
+ + {foreach item=homeitems key=values from=$HOMEORDER} + + {if $homeitems neq ''} + + + {else} + + + {/if} + + {/foreach} +
{$UMOD.$values} + {$UMOD.LBL_SHOW} + {$UMOD.LBL_HIDE} + {$UMOD.LBL_SHOW} + {$UMOD.LBL_HIDE}
+
+
 
+ + +
+
+
+
+
+
+ + + + + +
+{$JAVASCRIPT} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/salesEditView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/salesEditView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/salesEditView.tpl Tue Nov 14 03:16:10 2006 @@ -115,7 +115,7 @@ - {if $header eq 'Comments' || $header eq 'Comment Information'} + {if $header eq $MOD.LBL_COMMENTS || $header eq $MOD.LBL_COMMENT_INFORMATION}   @@ -131,14 +131,14 @@ - {if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} + {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} {$header} {$APP.LBL_RCPY_ADDRESS} {$APP.LBL_LCPY_ADDRESS} - {elseif $header== 'Address Information' && $MODULE == 'Contacts'} + {elseif $header== $MOD.LBL_ADDRESS_INFORMATION && $MODULE == 'Contacts'} {$header} @@ -154,15 +154,25 @@ {include file="DisplayFields.tpl"} + +

{/foreach} - {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} {include file="ProductDetailsEditView.tpl"} + + + {/if} + + + {if $MODULE eq "Organization"} + + + {include file="DetailsViewOrgUnit.tpl"} {/if} Modified: vtigercrm/branches/5.1_jens/connection.php ============================================================================== --- vtigercrm/branches/5.1_jens/connection.php (original) +++ vtigercrm/branches/5.1_jens/connection.php Tue Nov 14 03:16:10 2006 @@ -1,4 +1,4 @@ -mode; - - $this->db->println("TRANS saveentity starts $module"); - $this->db->startTransaction(); - - // Code included by Jaguar - starts - if(isset($this->column_fields['recurringtype']) && $this->column_fields['recurringtype']!='') - $recur_type = trim($this->column_fields['recurringtype']); - else - $recur_type=''; - // Code included by Jaguar - Ends - - //Code included by Minnie - Starts - if(isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid']!='') - { - $selected_users_string = $_REQUEST['inviteesid']; - $invitees_array = explode(';',$selected_users_string); - - } - else - $invitees_array=''; - //Code included by Minnie - Ends - - foreach($this->tab_name as $table_name) - { - if($table_name == "vtiger_crmentity") - { - $this->insertIntoCrmEntity($module); - } - elseif($table_name == "vtiger_salesmanactivityrel") - { - $this->insertIntoSmActivityRel($module); - } - //added by raju - elseif($table_name=="vtiger_seactivityrel" ) - { - //modified by Richie as raju's implementation broke the feature for addition of webmail to vtiger_crmentity.need to be more careful in future while integrating code - if($module=="Emails" && $_REQUEST['smodule']!='webmails' && (!$this->plugin_save)) - { - if($_REQUEST['currentid']!='') - { - $actid=$_REQUEST['currentid']; - } - else - { - $actid=$_REQUEST['record']; - } - $parentid=$_REQUEST['parent_id']; - if($_REQUEST['module'] != 'Emails' && $_REQUEST['module'] != 'Webmails') - { - if(!$parentid) { - $parentid = $adb->getUniqueID('vtiger_seactivityrel'); - } - $mysql='insert into vtiger_seactivityrel values('.$parentid.','.$actid.')'; - $adb->query($mysql); - } - else - { - $myids=explode("|",$parentid); //2 at 71| - for ($i=0;$i<(count($myids)-1);$i++) - { - $realid=explode("@",$myids[$i]); - $mycrmid=$realid[0]; - //added to handle the relationship of emails with vtiger_users - if($realid[1] == -1) - $mysql='insert into vtiger_salesmanactivityrel values('.$mycrmid.','.$actid.')'; - else - $mysql='insert into vtiger_seactivityrel values('.$mycrmid.','.$actid.')'; - $adb->query($mysql); - } - } - } - else - { - if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '') - { - $this->insertIntoEntityTable($table_name, $module); - } - elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit") - { - $this->deleteRelation($table_name); - } - } - } - elseif($table_name == "vtiger_seticketsrel" || $table_name == "vtiger_seproductsrel" || $table_name == "vtiger_senotesrel") - { - if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '')//raju - mass mailing ends - { - $this->insertIntoEntityTable($table_name, $module); - } - elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit") - { - $this->deleteRelation($table_name); - } - } - elseif($table_name == "vtiger_cntactivityrel") - { - if(isset($this->column_fields['contact_id']) && $this->column_fields['contact_id'] != '') - { - $this->insertIntoEntityTable($table_name, $module); - } - elseif($this->column_fields['contact_id'] =='' && $insertion_mode=="edit") - { - $this->deleteRelation($table_name); - } - - } - elseif($table_name == "vtiger_ticketcomments") - { - $this->insertIntoTicketCommentTable($table_name, $module); - } - elseif($table_name == "vtiger_faqcomments") - { - $this->insertIntoFAQCommentTable($table_name, $module); - } - elseif($table_name == "vtiger_activity_reminder") - { - if($recur_type == "--None--") - { - $this->insertIntoReminderTable($table_name,$module,""); - } - } - elseif($table_name == "vtiger_recurringevents") // Code included by Jaguar - starts - { - $recur_type = trim($this->column_fields['recurringtype']); - if($recur_type != "--None--" && $recur_type != '') - { - //Modified by Minnie - $recur_data = getrecurringObjValue(); - if(is_object($recur_data)) - $this->insertIntoRecurringTable($recur_data); - } - }// Code included by Jaguar - Ends - // Code included by Minnie - starts - elseif($table_name == "vtiger_invitees") - { - if($invitees_array != '') - { - $this->insertIntoInviteeTable($table_name,$module,$invitees_array); - } - } - // Code included by Minnie - Ends - elseif($table_name == 'vtiger_producttaxrel') - { - //avoid call this function when we use ajax edit -> save - if($_REQUEST['ajxaction'] != 'DETAILVIEW') - $this->insertTaxInformation($table_name, $module); - } - elseif($table_name == 'vtiger_attachments') - { - $this->insertIntoAttachment($this->id,$module); - } - else - { - $this->insertIntoEntityTable($table_name, $module); - } - } - - $this->db->completeTransaction(); - $this->db->println("TRANS saveentity ends"); - } - - - function insertIntoAttachment1($id,$module,$filedata,$filename,$filesize,$filetype,$user_id) - { - $date_var = date('YmdHis'); - global $current_user; - global $adb; - //global $root_directory; - global $log; - - $ownerid = $user_id; - - if($filesize != 0) - { - $data = base64_encode(fread(fopen($filedata, "r"), $filesize)); - } - - $current_id = $adb->getUniqueID("vtiger_crmentity"); - - if($module=='Emails') - { - $log->info("module is ".$module); - $idname='emailid'; $tablename='emails'; $descname='description'; - } - else - { - $idname='notesid'; $tablename='notes'; $descname='notecontent'; - } - - $sql="update ".$tablename." set filename='".$filename."' where ".$idname."=".$id; - $adb->query($sql); - - $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','"."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; - $adb->query($sql1); - - $sql2="insert into vtiger_attachments(attachmentsid, name, description, type) values(".$current_id.",'".$filename."','"."','".$filetype."')"; - $result=$adb->query($sql2); - - //TODO -- instead of put contents in db now we should store the file in harddisk - - $sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')'; - $adb->query($sql3); - } - - - /** - * This function is used to add the vtiger_attachments. This will call the function uploadAndSaveFile which will upload the attachment into the server and save that attachment information in the database. - * @param int $id - entity id to which the vtiger_files to be uploaded - * @param string $module - the current module name - */ - function insertIntoAttachment($id,$module) - { - global $log, $adb; - $log->debug("Entering into insertIntoAttachment($id,$module) method."); - - $file_saved = false; - - //This is to added to store the existing attachment id of the contact where we should delete this when we give new image - if($module == 'Contacts') - $old_attachmentid = $adb->query_result($adb->query("select * from vtiger_seattachmentsrel where crmid=$id"),0,'attachmentsid'); - - foreach($_FILES as $fileindex => $files) - { - if($files['name'] != '' && $files['size'] > 0) - { - $file_saved = $this->uploadAndSaveFile($id,$module,$files); - } - } - - //This is to handle the delete image for contacts - if($module == 'Contacts' && $file_saved) - { - $del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$old_attachmentid"); - $del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$old_attachmentid"); - } - - - //Remove the deleted vtiger_attachments from db - Products - if($module == 'Products' && $_REQUEST['del_file_list'] != '') - { - $del_file_list = explode("###",trim($_REQUEST['del_file_list'],"###")); - foreach($del_file_list as $del_file_name) - { - $attach_res = $adb->query("select vtiger_attachments.attachmentsid from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where crmid=$id and name=\"$del_file_name\""); - $attachments_id = $adb->query_result($attach_res,0,'attachmentsid'); - - $del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$attachments_id"); - $del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$attachments_id"); - } - } - - $log->debug("Exiting from insertIntoAttachment($id,$module) method."); - } - - /** - * This function is used to upload the attachment in the server and save that attachment information in db. - * @param int $id - entity id to which the file to be uploaded - * @param string $module - the current module name - * @param array $file_details - array which contains the file information(name, type, size, tmp_name and error) - * return void - */ - function uploadAndSaveFile($id,$module,$file_details) - { - global $log; - $log->debug("Entering into uploadAndSaveFile($id,$module,$file_details) method."); - - global $adb, $current_user; - global $upload_badext; - - $date_var = date('YmdHis'); - - //to get the owner id - $ownerid = $this->column_fields['assigned_user_id']; - if(!isset($ownerid) || $ownerid=='') - $ownerid = $current_user->id; - - - // Arbitrary File Upload Vulnerability fix - Philip - $binFile = $file_details['name']; - $ext_pos = strrpos($binFile, "."); - - $ext = substr($binFile, $ext_pos + 1); - - if (in_array($ext, $upload_badext)) - { - $binFile .= ".txt"; - } - // Vulnerability fix ends - - $current_id = $adb->getUniqueID("vtiger_crmentity"); - - $filename = basename($binFile); - $filetype= $file_details['type']; - $filesize = $file_details['size']; - $filetmp_name = $file_details['tmp_name']; - - //get the file path inwhich folder we want to upload the file - $upload_file_path = decideFilePath(); - - //upload the file in server - $upload_status = move_uploaded_file($filetmp_name,$upload_file_path.$current_id."_".$binFile); - - $save_file = 'true'; - //only images are allowed for these modules - if($module == 'Contacts' || $module == 'Products') - { - $save_file = validateImageFile(&$file_details); - } - - if($save_file == 'true' && $upload_status == 'true') - { - //This is only to update the attached filename in the vtiger_notes vtiger_table for the Notes module - if($module=='Notes') - { - $sql="update vtiger_notes set filename='".$filename."' where notesid = ".$id; - $adb->query($sql); - } - - $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','".$this->column_fields['description']."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; - $adb->query($sql1); - - $sql2="insert into vtiger_attachments(attachmentsid, name, description, type, path) values(".$current_id.",'".$filename."','".$this->column_fields['description']."','".$filetype."','".$upload_file_path."')"; - $result=$adb->query($sql2); - - if($_REQUEST['mode'] == 'edit') - { - if($id != '' && $_REQUEST['fileid'] != '') - { - $delquery = 'delete from vtiger_seattachmentsrel where crmid = '.$id.' and attachmentsid = '.$_REQUEST['fileid']; - $adb->query($delquery); - } - } - if($module == 'Notes') - { - $query = "delete from vtiger_seattachmentsrel where crmid = ".$id; - $adb->query($query); - } - $sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')'; - $adb->query($sql3); - - return true; - } - else - { - $log->debug("Skip the save attachment process."); - return false; - } - } - - /** Function to insert values in the vtiger_crmentity for the specified module - * @param $module -- module:: Type varchar - */ - - function insertIntoCrmEntity($module) - { - global $adb; - global $current_user; - global $log; - - $date_var = date('YmdHis'); - if($_REQUEST['assigntype'] == 'T') - { - $ownerid= 0; - } - else - { - $ownerid = $this->column_fields['assigned_user_id']; - } - - if($module == 'Products' || $module == 'Notes' || $module =='Faq' || $module == 'Vendors' || $module == 'PriceBooks') - { - $log->info("module is =".$module); - $ownerid = $current_user->id; - } - if($module == 'Events') - { - $module = 'Calendar'; - } - if($this->mode == 'edit') - { - $description_val = from_html($adb->formatString("vtiger_crmentity","description",$this->column_fields['description']),($insertion_mode == 'edit')?true:false); - - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - $tabid = getTabid($module); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0) - { - $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.",description=".$description_val.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; - } - else - { - $profileList = getCurrentUserProfileList(); - $perm_qry = "SELECT columnname 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 WHERE vtiger_field.tabid = ".$tabid." AND vtiger_profile2field.visible = 0 AND vtiger_profile2field.profileid IN ".$profileList." AND vtiger_def_org_field.visible = 0 and vtiger_field.tablename='vtiger_crmentity' and vtiger_field.displaytype in (1,3);"; - $perm_result = $adb->query($perm_qry); - $perm_rows = $adb->num_rows($perm_result); - for($i=0; $i<$perm_rows; $i++) - { - $columname[]=$adb->query_result($perm_result,$i,"columnname"); - } - if(is_array($columname) && in_array("description",$columname)) - { - $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.",description=".$description_val.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; - } - else - { - $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; - } - } - $adb->query($sql); - $sql1 ="delete from vtiger_ownernotify where crmid=".$this->id; - $adb->query($sql1); - if($ownerid != $current_user->id) - { - $sql1 = "insert into vtiger_ownernotify values(".$this->id.",".$ownerid.",null)"; - $adb->query($sql1); - } - } - else - { - //if this is the create mode and the group allocation is chosen, then do the following - $current_id = $adb->getUniqueID("vtiger_crmentity"); - $_REQUEST['currentid']=$current_id; - - $description_val = from_html($adb->formatString("vtiger_crmentity","description",$this->column_fields['description']),($insertion_mode == 'edit')?true:false); - $sql = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values('".$current_id."','".$current_user->id."','".$ownerid."','".$module."',".$description_val.",".$adb->formatDate($date_var).",".$adb->formatDate($date_var).")"; - $adb->query($sql); - $this->id = $current_id; - } - - } - - - /** Function to insert values in vtiger_salesmanactivityrel table for the specified module - * @param $module -- module:: Type varchar - */ - - function insertIntoSmActivityRel($module) - { - global $adb; - global $current_user; - if($this->mode == 'edit') - { - - $sql = "delete from vtiger_salesmanactivityrel where activityid=".$this->id." and smid = ".$this->column_fields['assigned_user_id'].""; - $adb->query($sql); - - } - $sql_qry = "insert into vtiger_salesmanactivityrel (smid,activityid) values(".$this->column_fields['assigned_user_id'].",".$this->id.")"; - $adb->query($sql_qry); - - } - - /** Function to insert values in the specifed table for the specified module - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - */ - function insertIntoEntityTable($table_name, $module) - { - global $log; - global $current_user; - $log->info("function insertIntoEntityTable ".$module.' vtiger_table name ' .$table_name); - global $adb; - $insertion_mode = $this->mode; - - //Checkin whether an entry is already is present in the vtiger_table to update - if($insertion_mode == 'edit') - { - $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; - $check_result=$adb->query($check_query); - - $num_rows = $adb->num_rows($check_result); - - if($num_rows <= 0) - { - $insertion_mode = ''; - } - } - - if($insertion_mode == 'edit') - { - $update = ''; - $tabid= getTabid($module); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0) - { - - $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3)"; - } - else - { - $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 - WHERE vtiger_field.tabid = ".$tabid." - AND vtiger_profile2field.visible = 0 - AND vtiger_profile2field.profileid IN ".$profileList." - AND vtiger_def_org_field.visible = 0 and vtiger_field.tablename='".$table_name."' and vtiger_field.displaytype in (1,3)"; - } - - } - else - { - $column = $this->tab_name_index[$table_name]; - if($column == 'id' && $table_name == 'vtiger_users') - { - $currentuser_id = $adb->getUniqueID("vtiger_users"); - $this->id = $currentuser_id; - } - $value = $this->id; - $tabid= getTabid($module); - $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3,4)"; - } - - $result = $adb->query($sql); - $noofrows = $adb->num_rows($result); - for($i=0; $i<$noofrows; $i++) - { - $fieldname=$adb->query_result($result,$i,"fieldname"); - $columname=$adb->query_result($result,$i,"columnname"); - $uitype=$adb->query_result($result,$i,"uitype"); - if(isset($this->column_fields[$fieldname])) - { - if($uitype == 56) - { - if($this->column_fields[$fieldname] == 'on' || $this->column_fields[$fieldname] == 1) - { - $fldvalue = 1; - } - else - { - $fldvalue = 0; - } - - } - elseif($uitype == 33) - { - if(is_array($this->column_fields[$fieldname])) - { - $field_list = implode(' |##| ',$this->column_fields[$fieldname]); - }else - { - $field_list = $this->column_fields[$fieldname]; - } - $fldvalue = $field_list; - } - elseif($uitype == 5 || $uitype == 6 || $uitype ==23) - { - if($_REQUEST['action'] == 'Import') - { - $fldvalue = $this->column_fields[$fieldname]; - } - else - { - $fldvalue = getDBInsertDateValue($this->column_fields[$fieldname]); - } - } - elseif($uitype == 7) - { - //strip out the spaces and commas in numbers if given ie., in amounts there may be , - $fldvalue = str_replace(",","",$this->column_fields[$fieldname]);//trim($this->column_fields[$fieldname],","); - - } - else - { - $fldvalue = $this->column_fields[$fieldname]; - $fldvalue = stripslashes($fldvalue); - } - $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); - - - - } - else - { - $fldvalue = ''; - } - if($fldvalue=='') $fldvalue ="NULL"; - if($insertion_mode == 'edit') - { - if($table_name == 'vtiger_notes' && $columname == 'filename' && $_FILES['filename']['name'] == '') - { - $fldvalue = $this->getOldFileName($this->id); - } - if($table_name == 'vtiger_products' && $columname == 'imagename') - { - - - } - if($table_name != 'vtiger_ticketcomments') - { - if($i == 0) - { - $update = $columname."=".$fldvalue.""; - } - else - { - $update .= ', '.$columname."=".$fldvalue.""; - } - } - } - else - { - $column .= ", ".$columname; - $value .= ", ".$fldvalue.""; - } - - } - - - - - - if($insertion_mode == 'edit') - { - if($_REQUEST['module'] == 'Potentials') - { - $dbquery = 'select sales_stage from vtiger_potential where potentialid = '.$this->id; - $sales_stage = $adb->query_result($adb->query($dbquery),0,'sales_stage'); - if($sales_stage != $_REQUEST['sales_stage'] && $_REQUEST['sales_stage'] != '') - { - $date_var = date('YmdHis'); - $closingdate = getDBInsertDateValue($this->column_fields['closingdate']); - $sql = "insert into vtiger_potstagehistory values('',".$this->id.",'".$this->column_fields['amount']."','".$sales_stage."','".$this->column_fields['probability']."',0,".$adb->formatString("vtiger_potstagehistory","closedate",$closingdate).",".$adb->formatString("vtiger_potstagehistory","lastmodified",$date_var).")"; - $adb->query($sql); - } - } - elseif($_REQUEST['module'] == 'PurchaseOrder' || $_REQUEST['module'] == 'SalesOrder' || $_REQUEST['module'] == 'Quotes' || $_REQUEST['module'] == 'Invoice') - { - //added to update the history for PO, SO, Quotes and Invoice - $history_field_array = Array( - "PurchaseOrder"=>"postatus", - "SalesOrder"=>"sostatus", - "Quotes"=>"quotestage", - "Invoice"=>"invoicestatus" - ); - - $inventory_module = $_REQUEST['module']; - - if($_REQUEST['ajxaction'] == 'DETAILVIEW')//if we use ajax edit - { - if($inventory_module == "PurchaseOrder") - $relatedname = getVendorName($this->column_fields['vendor_id']); - else - $relatedname = getAccountName($this->column_fields['account_id']); - - $total = $this->column_fields['hdnGrandTotal']; - } - else//using edit button and save - { - if($inventory_module == "PurchaseOrder") - $relatedname = $_REQUEST["vendor_name"]; - else - $relatedname = $_REQUEST["account_name"]; - - $total = $_REQUEST['total']; - } - - $oldvalue = getSingleFieldValue($this->table_name,$history_field_array[$inventory_module],$this->module_id,$this->id); - if($oldvalue != $this->column_fields["$history_field_array[$inventory_module]"]) - { - addInventoryHistory($inventory_module, $this->id,$relatedname,$total,$this->column_fields["$history_field_array[$inventory_module]"]); - } - } - - //Check done by Don. If update is empty the the query fails - if(trim($update) != '') - { - $sql1 = "update ".$table_name." set ".$update." where ".$this->tab_name_index[$table_name]."=".$this->id; - - $adb->query($sql1); - } - //to disable the update of groupentity relation in ajax edit for the fields except assigned_user_id field - if($_REQUEST['ajxaction'] != 'DETAILVIEW' || ($_REQUEST['ajxaction'] == 'DETAILVIEW' && $_REQUEST['fldName'] == 'assigned_user_id')) - { - if($_REQUEST['assigntype'] == 'T') - { - $groupname = $_REQUEST['assigned_group_name']; - //echo 'about to update lead group relation'; - if($module == 'Leads' && $table_name == 'vtiger_leaddetails') - { - updateLeadGroupRelation($this->id,$groupname); - } - elseif($module == 'Accounts' && $table_name == 'vtiger_account') - { - updateAccountGroupRelation($this->id,$groupname); - } - elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') - { - updateContactGroupRelation($this->id,$groupname); - } - elseif($module == 'Potentials' && $table_name == 'vtiger_potential') - { - updatePotentialGroupRelation($this->id,$groupname); - } - elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') - { - updateQuoteGroupRelation($this->id,$groupname); - } - elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') - { - updateSoGroupRelation($this->id,$groupname); - } - elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') - { - updateInvoiceGroupRelation($this->id,$groupname); - } - elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') - { - updatePoGroupRelation($this->id,$groupname); - } - elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') - { - updateTicketGroupRelation($this->id,$groupname); - } - elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') - { - updateCampaignGroupRelation($this->id,$groupname); - } - elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') - { - if($table_name == 'vtiger_activity') - { - updateActivityGroupRelation($this->id,$groupname); - } - } - - - } - else - { - //echo 'about to update lead group relation again!'; - if($module == 'Leads' && $table_name == 'vtiger_leaddetails') - { - updateLeadGroupRelation($this->id,''); - } - elseif($module == 'Accounts' && $table_name == 'vtiger_account') - { - updateAccountGroupRelation($this->id,''); - } - elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') - { - updateContactGroupRelation($this->id,''); - } - elseif($module == 'Potentials' && $table_name == 'vtiger_potential') - { - updatePotentialGroupRelation($this->id,''); - } - elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') - { - updateQuoteGroupRelation($this->id,''); - } - elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') - { - updateSoGroupRelation($this->id,''); - } - elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') - { - updateInvoiceGroupRelation($this->id,''); - } - elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') - { - updatePoGroupRelation($this->id,''); - } - elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') - { - updateTicketGroupRelation($this->id,''); - } - elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') - { - updateCampaignGroupRelation($this->id,$groupname); - } - elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') - { - if($table_name == 'vtiger_activity') - { - updateActivityGroupRelation($this->id,$groupname); - } - } - - - } - } - - } - else - { - $sql1 = "insert into ".$table_name." (".$column.") values(".$value.")"; - $adb->query($sql1); - $groupname = $_REQUEST['assigned_group_name']; - if($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_leaddetails') - { - insert2LeadGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_account') - { - insert2AccountGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_contactdetails') - { - insert2ContactGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_potential') - { - insert2PotentialGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_quotes') - { - insert2QuoteGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_salesorder') - { - insert2SoGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_invoice') - { - insert2InvoiceGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_purchaseorder') - { - insert2PoGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_activity') - { - insert2ActivityGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_troubletickets') - { - insert2TicketGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_campaign') - { - insert2CampaignGroupRelation($this->id,$groupname); - } - - } - - } - /** Function to delete a record in the specifed table - * @param $table_name -- table name:: Type varchar - * The function will delete a record .The id is obtained from the class variable $this->id and the columnname got from $this->tab_name_index[$table_name] - */ -function deleteRelation($table_name) -{ - global $adb; - $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; - $check_result=$adb->query($check_query); - $num_rows = $adb->num_rows($check_result); - - if($num_rows == 1) - { - $del_query = "DELETE from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; - $adb->query($del_query); - } - -} - /** Function to attachment filename of the given entity - * @param $notesid -- crmid:: Type Integer - * The function will get the attachmentsid for the given entityid from vtiger_seattachmentsrel table and get the attachmentsname from vtiger_attachments table - * returns the 'filename' - */ -function getOldFileName($notesid) -{ - global $log; -$log->info("in getOldFileName ".$notesid); - global $adb; - $query1 = "select * from vtiger_seattachmentsrel where crmid=".$notesid; - $result = $adb->query($query1); - $noofrows = $adb->num_rows($result); - if($noofrows != 0) - $attachmentid = $adb->query_result($result,0,'attachmentsid'); - if($attachmentid != '') - { - $query2 = "select * from vtiger_attachments where attachmentsid=".$attachmentid; - $filename = $adb->query_result($adb->query($query2),0,'name'); - } - return "'".$filename."'"; -} - /** Function to insert values in vtiger_ticketcomments for the specified tablename and module - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - */ -function insertIntoTicketCommentTable($table_name, $module) -{ - global $log; - $log->info("in insertIntoTicketCommentTable ".$table_name." module is ".$module); - global $adb; - global $current_user; - - $current_time = $adb->formatDate(date('YmdHis')); - if($this->column_fields['assigned_user_id'] != '') - $ownertype = 'user'; - else - $ownertype = 'customer'; - - if($this->column_fields['comments'] != '') - $comment = $this->column_fields['comments']; - else - $comment = $_REQUEST['comments']; - - if($comment != '') - { - $comment = addslashes($comment); - $sql = "insert into vtiger_ticketcomments values('',".$this->id.",'".$comment."','".$current_user->id."','".$ownertype."',".$current_time.")"; - $adb->query($sql); - } -} - /** Function to insert values in vtiger_faqcomments table for the specified module, - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - */ -function insertIntoFAQCommentTable($table_name, $module) -{ - global $log; - $log->info("in insertIntoFAQCommentTable ".$table_name." module is ".$module); - global $adb; - - $current_time = $adb->formatDate(date('YmdHis')); - - if($this->column_fields['comments'] != '') - $comment = $this->column_fields['comments']; - else - $comment = $_REQUEST['comments']; - - if($comment != '') - { - $comment = addslashes($comment); - $sql = "insert into vtiger_faqcomments values('',".$this->id.",'".$comment."',".$current_time.")"; - $adb->query($sql); - } -} - /** Function to insert values in vtiger_faqcomments table for the specified module, - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - */ -function insertIntoReminderTable($table_name,$module,$recurid) -{ - global $log; -$log->info("in insertIntoReminderTable ".$table_name." module is ".$module); - if($_REQUEST['set_reminder'] == 'Yes') - { -$log->debug("set reminder is set"); - $rem_days = $_REQUEST['remdays']; -$log->debug("rem_days is ".$rem_days); - $rem_hrs = $_REQUEST['remhrs']; -$log->debug("rem_hrs is ".$rem_hrs); - $rem_min = $_REQUEST['remmin']; -$log->debug("rem_minutes is ".$rem_min); - $reminder_time = $rem_days * 24 * 60 + $rem_hrs * 60 + $rem_min; -$log->debug("reminder_time is ".$reminder_time); - if ($recurid == "") - { - if($_REQUEST['mode'] == 'edit') - { - $this->activity_reminder($this->id,$reminder_time,0,$recurid,'edit'); - } - else - { - $this->activity_reminder($this->id,$reminder_time,0,$recurid,''); - } - } - else - { - $this->activity_reminder($this->id,$reminder_time,0,$recurid,''); - } - } - elseif($_REQUEST['set_reminder'] == 'No') - { - $this->activity_reminder($this->id,'0',0,$recurid,'delete'); - } -} - -// Code included by Minnie - starts - /** Function to insert values in vtiger_invitees table for the specified module,tablename ,invitees_array - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - * @param $invitees_array Array - */ -function insertIntoInviteeTable($table_name,$module,$invitees_array) -{ - global $log,$adb; - $log->debug("Entering insertIntoInviteeTable(".$table_name.",".$module.",".$invitees_array.") method ..."); - foreach($invitees_array as $inviteeid) - { - if($inviteeid != '') - { - $query="insert into vtiger_invitees values(".$this->id.",".$inviteeid.")"; - $adb->query($query); - } - } - $log->debug("Exiting insertIntoInviteeTable method ..."); - -} -// Code included by Minnie - Ends - -// Code included by Jaguar - starts - /** Function to insert values in vtiger_recurringevents table for the specified tablename,module - * @param $recurObj -- Recurring Object:: Type varchar - */ -function insertIntoRecurringTable(& $recurObj) -{ - global $log,$adb; - $log->info("in insertIntoRecurringTable "); - $st_date = $recurObj->startdate->get_formatted_date(); - $log->debug("st_date ".$st_date); - $end_date = $recurObj->enddate->get_formatted_date(); - $log->debug("end_date is set ".$end_date); - $type = $recurObj->recur_type; - $log->debug("type is ".$type); - $flag="true"; - - if($_REQUEST['mode'] == 'edit') - { - $activity_id=$this->id; - - $sql='select min(recurringdate) AS min_date,max(recurringdate) AS max_date, recurringtype, activityid from vtiger_recurringevents where activityid='. $activity_id.' group by activityid, recurringtype'; - - $result = $adb->query($sql); - $noofrows = $adb->num_rows($result); - for($i=0; $i<$noofrows; $i++) - { - $recur_type_b4_edit = $adb->query_result($result,$i,"recurringtype"); - $date_start_b4edit = $adb->query_result($result,$i,"min_date"); - $end_date_b4edit = $adb->query_result($result,$i,"max_date"); - } - if(($st_date == $date_start_b4edit) && ($end_date==$end_date_b4edit) && ($type == $recur_type_b4_edit)) - { - if($_REQUEST['set_reminder'] == 'Yes') - { - $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; - $adb->query($sql); - $sql = 'delete from vtiger_recurringevents where activityid='.$activity_id; - $adb->query($sql); - $flag="true"; - } - elseif($_REQUEST['set_reminder'] == 'No') - { - $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; - $adb->query($sql); - $flag="false"; - } - else - $flag="false"; - } - else - { - $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; - $adb->query($sql); - $sql = 'delete from vtiger_recurringevents where activityid='.$activity_id; - $adb->query($sql); - } - } - $date_array = $recurObj->recurringdates; - if(isset($recurObj->recur_freq) && $recurObj->recur_freq != null) - $recur_freq = $recurObj->recur_freq; - else - $recur_freq = 1; - if($recurObj->recur_type == 'Daily' || $recurObj->recur_type == 'Yearly') - $recurringinfo = $recurObj->recur_type; - elseif($recurObj->recur_type == 'Weekly') - { - $recurringinfo = $recurObj->recur_type; - if($recurObj->dayofweek_to_rpt != null) - $recurringinfo = $recurringinfo.'::'.implode('::',$recurObj->dayofweek_to_rpt); - } - elseif($recurObj->recur_type == 'Monthly') - { - $recurringinfo = $recurObj->recur_type.'::'.$recurObj->repeat_monthby; - if($recurObj->repeat_monthby == 'date') - $recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_datevalue; - else - $recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_daytype.'::'.$recurObj->dayofweek_to_rpt[0]; - } - else - { - $recurringinfo = ''; - } - if($flag=="true") - { - for($k=0; $k< count($date_array); $k++) - { - $tdate=$date_array[$k]; - if($tdate <= $end_date) - { - $max_recurid_qry = 'select max(recurringid) AS recurid from vtiger_recurringevents;'; - $result = $adb->query($max_recurid_qry); - $noofrows = $adb->num_rows($result); - for($i=0; $i<$noofrows; $i++) - { - $recur_id = $adb->query_result($result,$i,"recurid"); - } - $current_id =$recur_id+1; - $recurring_insert = "insert into vtiger_recurringevents values ('".$current_id."','".$this->id."','".$tdate."','".$type."','".$recur_freq."','".$recurringinfo."')"; - $adb->query($recurring_insert); - if($_REQUEST['set_reminder'] == 'Yes') - { - $this->insertIntoReminderTable("activity_reminder",$module,$current_id,''); - } - } - } - } -} - -// Code included by Jaguar - Ends - - /** Function to retrive the information of the given recordid ,module - * @param $record -- Id:: Type Integer - * @param $module -- module:: Type varchar - * This function retrives the information from the database and sets the value in the class columnfields array - */ - function retrieve_entity_info($record, $module) - { - global $adb,$log,$app_strings; - $result = Array(); - foreach($this->tab_name_index as $table_name=>$index) - { - $result[$table_name] = $adb->query("select * from ".$table_name." where ".$index."=".$record); - if($adb->query_result($result["vtiger_crmentity"],0,"deleted") == 1) - die("

".$app_strings['LBL_RECORD_DELETE']." ".$app_strings['LBL_GO_BACK'].".
"); - } - $tabid = getTabid($module); - $sql1 = "select * from vtiger_field where tabid=".$tabid; - $result1 = $adb->query($sql1); - $noofrows = $adb->num_rows($result1); - for($i=0; $i<$noofrows; $i++) - { - $fieldcolname = $adb->query_result($result1,$i,"columnname"); - $tablename = $adb->query_result($result1,$i,"tablename"); - $fieldname = $adb->query_result($result1,$i,"fieldname"); - - $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); - $this->column_fields[$fieldname] = $fld_value; - - } - if($module == 'Users') - { - for($i=0; $i<$noofrows; $i++) - { - $fieldcolname = $adb->query_result($result1,$i,"columnname"); - $tablename = $adb->query_result($result1,$i,"tablename"); - $fieldname = $adb->query_result($result1,$i,"fieldname"); - $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); - $this->$fieldname = $fld_value; - - } - } - - $this->column_fields["record_id"] = $record; - $this->column_fields["record_module"] = $module; - } - - /** Function to saves the values in all the tables mentioned in the class variable $tab_name for the specified module - * @param $module -- module:: Type varchar - */ - function save($module_name) - { - global $log; - $log->debug("module name is ".$module_name); - //GS Save entity being called with the modulename as parameter - $this->saveentity($module_name); - } - - function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1) - { - global $list_max_entries_per_page; - $this->log->debug("process_list_query: ".$query); - if(!empty($limit) && $limit != -1){ - $result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: "); - }else{ - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - } - - $list = Array(); - if($max_per_page == -1){ - $max_per_page = $list_max_entries_per_page; - } - $rows_found = $this->db->getRowCount($result); - - $this->log->debug("Found $rows_found ".$this->object_name."s"); - - $previous_offset = $row_offset - $max_per_page; - $next_offset = $row_offset + $max_per_page; - - if($rows_found != 0) - { - - // We have some data. - - for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){ - - - foreach($this->list_fields as $entry) - { - - foreach($entry as $key=>$field) // this will be cycled only once - { - if (isset($row[$field])) { - $this->column_fields[$this->list_fields_names[$key]] = $row[$field]; - - - $this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field); - } - else - { - $this->column_fields[$this->list_fields_names[$key]] = ""; - } - } - } - - - //$this->db->println("here is the bug"); - - - $list[] = clone($this);//added by Richie to support PHP5 - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - return $response; - } - - function process_full_list_query($query) - { - $this->log->debug("CRMEntity:process_full_list_query"); - $result =& $this->db->query($query, false); - $this->log->debug("CRMEntity:process_full_list_query: result is ".$result); - - - if($this->db->getRowCount($result) > 0){ - - // $this->db->println("process_full mid=".$this->module_id." mname=".$this->module_name); - // We have some data. - while ($row = $this->db->fetchByAssoc($result)) { - $rowid=$row[$this->module_id]; - - if(isset($rowid)) - $this->retrieve_entity_info($rowid,$this->module_name); - else - $this->db->println("rowid not set unable to retrieve"); - - - - //clone function added to resolvoe PHP5 compatibility issue in Dashboards - //If we do not use clone, while using PHP5, the memory address remains fixed but the - //data gets overridden hence all the rows that come in bear the same value. This in turn -//provides a wrong display of the Dashboard graphs. The data is erroneously shown for a specific month alone -//Added by Richie - $list[] = clone($this);//added by Richie to support PHP5 - } - } - - if (isset($list)) return $list; - else return null; - } - - /** This function should be overridden in each module. It marks an item as deleted. - * If it is not overridden, then marking this type of item is not allowed - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function mark_deleted($id) - { - $query = "UPDATE vtiger_crmentity set deleted=1 where crmid='$id'"; - $this->db->query($query, true,"Error marking record deleted: "); - - - } - - - function retrieve_by_string_fields($fields_array, $encode=true) - { - $where_clause = $this->get_where($fields_array); - - $query = "SELECT * FROM $this->table_name $where_clause"; - $this->log->debug("Retrieve $this->object_name: ".$query); - $result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:"); - if( empty($result)) - { - return null; - } - - $row = $this->db->fetchByAssoc($result,-1, $encode); - - foreach($this->column_fields as $field) - { - if(isset($row[$field])) - { - $this->$field = $row[$field]; - } - } - return $this; - } - - // this method is called during an import before inserting a bean - // define an associative array called $special_fields - // the keys are user defined, and don't directly map to the bean's vtiger_fields - // the value is the method name within that bean that will do extra - // processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name' - - function process_special_fields() - { - foreach ($this->special_functions as $func_name) - { - if ( method_exists($this,$func_name) ) - { - $this->$func_name(); - } - } - } - - /** - * Function to check if the custom vtiger_field vtiger_table exists - * return true or false - */ - function checkIfCustomTableExists($tablename) - { - $query = "select * from ".$tablename; - $result = $this->db->query($query); - $testrow = $this->db->num_fields($result); - if($testrow > 1) - { - $exists=true; - } - else - { - $exists=false; - } - return $exists; - } - - /** - * function to construct the query to fetch the custom vtiger_fields - * return the query to fetch the custom vtiger_fields - */ - function constructCustomQueryAddendum($tablename,$module) - { - global $adb; - $tabid=getTabid($module); - $sql1 = "select columnname,fieldlabel from vtiger_field where generatedtype=2 and tabid=".$tabid; - $result = $adb->query($sql1); - $numRows = $adb->num_rows($result); - $sql3 = "select "; - for($i=0; $i < $numRows;$i++) - { - $columnName = $adb->query_result($result,$i,"columnname"); - $fieldlable = $adb->query_result($result,$i,"fieldlabel"); - //construct query as below - if($i == 0) - { - $sql3 .= $tablename.".".$columnName. " '" .$fieldlable."'"; - } - else - { - $sql3 .= ", ".$tablename.".".$columnName. " '" .$fieldlable."'"; - } - - } - if($numRows>0) - { - $sql3=$sql3.','; - } - return $sql3; - - } - - - /** function to save the product tax information in producttarel vtiger_table - * @param string $tablename - vtiger_tablename to save the product tax relationship (producttaxrel) - * @param string $module - current module name - * $return void - */ - function insertTaxInformation($tablename, $module) - { - global $adb, $log; - $log->debug("Entering into insertTaxInformation($tablename, $module) method ..."); - $tax_details = getAllTaxes(); - - $tax_per = ''; - //Save the Product - tax relationship if corresponding tax check box is enabled - //Delete the existing tax if any - if($this->mode == 'edit') - { - for($i=0;$iquery($sql); - } - } - for($i=0;$idebug("Tax selected but value not given so default value will be saved."); - $tax_per = getTaxPercentage($tax_name); - } - - $log->debug("Going to save the Product - $tax_name tax relationship"); - - $query = "insert into vtiger_producttaxrel values($this->id,$taxid,$tax_per)"; - $adb->query($query); - } - } - - $log->debug("Exiting from insertTaxInformation($tablename, $module) method ..."); - } - - /** - * This function returns a full (ie non-paged) list of the current object type. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_full_list($order_by = "", $where = "") { - $this->log->debug("get_full_list: order_by = '$order_by' and where = '$where'"); - $query = $this->create_list_query($order_by, $where); - return $this->process_full_list_query($query); - } - - /** - * Track the viewing of a detail record. This leverages get_summary_text() which is object specific - * params $user_id - The user that is viewing the record. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function track_view($user_id, $current_module,$id='') - { - $this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)"); - - $tracker = new Tracker(); - $tracker->track_view($user_id, $current_module, $id, ''); - } - -} -?> +mode; + + $this->db->println("TRANS saveentity starts $module"); + $this->db->startTransaction(); + + + foreach($this->tab_name as $table_name) + { + + if($table_name == "vtiger_crmentity") + { + $this->insertIntoCrmEntity($module); + } + elseif($table_name == 'vtiger_entity2org') + { + $this->insertIntoEntity2Org($this->id,$module); + } + else + { + $this->insertIntoEntityTable($table_name, $module); + } + } + + //Calling the Module specific save code + $this->save_module($module); + + $this->db->completeTransaction(); + $this->db->println("TRANS saveentity ends"); + } + + + + function insertIntoAttachment1($id,$module,$filedata,$filename,$filesize,$filetype,$user_id) + { + $date_var = date('YmdHis'); + global $current_user; + global $adb; + //global $root_directory; + global $log; + + $ownerid = $user_id; + + if($filesize != 0) + { + $data = base64_encode(fread(fopen($filedata, "r"), $filesize)); + } + + $current_id = $adb->getUniqueID("vtiger_crmentity"); + + if($module=='Emails') + { + $log->info("module is ".$module); + $idname='emailid'; $tablename='emails'; $descname='description'; + } + else + { + $idname='notesid'; $tablename='notes'; $descname='notecontent'; + } + + $sql="update ".$tablename." set filename='".$filename."' where ".$idname."=".$id; + $adb->query($sql); + + $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','"."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; + $adb->query($sql1); + + $sql2="insert into vtiger_attachments(attachmentsid, name, description, type) values(".$current_id.",'".$filename."','"."','".$filetype."')"; + $result=$adb->query($sql2); + + //TODO -- instead of put contents in db now we should store the file in harddisk + + $sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')'; + $adb->query($sql3); + } + + + + /** + * This function is used to upload the attachment in the server and save that attachment information in db. + * @param int $id - entity id to which the file to be uploaded + * @param string $module - the current module name + * @param array $file_details - array which contains the file information(name, type, size, tmp_name and error) + * return void + */ + function uploadAndSaveFile($id,$module,$file_details) + { + global $log; + $log->debug("Entering into uploadAndSaveFile($id,$module,$file_details) method."); + + global $adb, $current_user; + global $upload_badext; + + $date_var = date('YmdHis'); + + //to get the owner id + $ownerid = $this->column_fields['assigned_user_id']; + if(!isset($ownerid) || $ownerid=='') + $ownerid = $current_user->id; + + + // Arbitrary File Upload Vulnerability fix - Philip + $binFile = $file_details['name']; + $ext_pos = strrpos($binFile, "."); + + $ext = substr($binFile, $ext_pos + 1); + + if (in_array($ext, $upload_badext)) + { + $binFile .= ".txt"; + } + // Vulnerability fix ends + + $current_id = $adb->getUniqueID("vtiger_crmentity"); + + $filename = basename($binFile); + $filetype= $file_details['type']; + $filesize = $file_details['size']; + $filetmp_name = $file_details['tmp_name']; + + //get the file path inwhich folder we want to upload the file + $upload_file_path = decideFilePath(); + + //upload the file in server + $upload_status = move_uploaded_file($filetmp_name,$upload_file_path.$current_id."_".$binFile); + + $save_file = 'true'; + //only images are allowed for these modules + if($module == 'Contacts' || $module == 'Products') + { + $save_file = validateImageFile(&$file_details); + } + + if($save_file == 'true' && $upload_status == 'true') + { + //This is only to update the attached filename in the vtiger_notes vtiger_table for the Notes module + if($module=='Notes') + { + $sql="update vtiger_notes set filename='".$filename."' where notesid = ".$id; + $adb->query($sql); + } + + $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','".$this->column_fields['description']."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; + $adb->query($sql1); + + $sql2="insert into vtiger_attachments(attachmentsid, name, description, type, path) values(".$current_id.",'".$filename."','".$this->column_fields['description']."','".$filetype."','".$upload_file_path."')"; + $result=$adb->query($sql2); + + if($_REQUEST['mode'] == 'edit') + { + if($id != '' && $_REQUEST['fileid'] != '') + { + $delquery = 'delete from vtiger_seattachmentsrel where crmid = '.$id.' and attachmentsid = '.$_REQUEST['fileid']; + $adb->query($delquery); + } + } + if($module == 'Notes') + { + $query = "delete from vtiger_seattachmentsrel where crmid = ".$id; + $adb->query($query); + } + $sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')'; + $adb->query($sql3); + + return true; + } + else + { + $log->debug("Skip the save attachment process."); + return false; + } + } + + /** Function to insert values in the vtiger_crmentity for the specified module + * @param $module -- module:: Type varchar + */ + + function insertIntoCrmEntity($module) + { + global $adb; + global $current_user; + global $log; + + $date_var = date('YmdHis'); + if($_REQUEST['assigntype'] == 'T') + { + $ownerid= 0; + } + else + { + $ownerid = $this->column_fields['assigned_user_id']; + } + + if($module == 'Products' || $module == 'Notes' || $module =='Faq' || $module == 'Vendors' || $module == 'PriceBooks') + { + $log->info("module is =".$module); + $ownerid = $current_user->id; + } + if($module == 'Events') + { + $module = 'Calendar'; + } + if($this->mode == 'edit') + { + $description_val = from_html($adb->formatString("vtiger_crmentity","description",$this->column_fields['description']),($insertion_mode == 'edit')?true:false); + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + $tabid = getTabid($module); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0) + { + $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.",description=".$description_val.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; + } + else + { + $profileList = getCurrentUserProfileList(); + $perm_qry = "SELECT columnname 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 WHERE vtiger_field.tabid = ".$tabid." AND vtiger_profile2field.visible = 0 AND vtiger_profile2field.profileid IN ".$profileList." AND vtiger_def_org_field.visible = 0 and vtiger_field.tablename='vtiger_crmentity' and vtiger_field.displaytype in (1,3);"; + $perm_result = $adb->query($perm_qry); + $perm_rows = $adb->num_rows($perm_result); + for($i=0; $i<$perm_rows; $i++) + { + $columname[]=$adb->query_result($perm_result,$i,"columnname"); + } + if(is_array($columname) && in_array("description",$columname)) + { + $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.",description=".$description_val.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; + } + else + { + $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; + } + } + $adb->query($sql); + $sql1 ="delete from vtiger_ownernotify where crmid=".$this->id; + $adb->query($sql1); + if($ownerid != $current_user->id) + { + $sql1 = "insert into vtiger_ownernotify values(".$this->id.",".$ownerid.",null)"; + $adb->query($sql1); + } + } + else + { + //if this is the create mode and the group allocation is chosen, then do the following + $current_id = $adb->getUniqueID("vtiger_crmentity"); + $_REQUEST['currentid']=$current_id; + + $description_val = from_html($adb->formatString("vtiger_crmentity","description",$this->column_fields['description']),($insertion_mode == 'edit')?true:false); + $sql = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values('".$current_id."','".$current_user->id."','".$ownerid."','".$module."',".$description_val.",".$adb->formatDate($date_var).",".$adb->formatDate($date_var).")"; + $adb->query($sql); + $this->id = $current_id; + + //set the organization relation for this entity + //default value: The current selected organization + $orglist = array(); + if( isset($_SESSION['authenticated_user_current_organization']) && $_SESSION['authenticated_user_current_organization'] != '') { + $orglist[0] = $_SESSION['authenticated_user_current_organization']; + } else { + global $current_organization; + $orglist[0] = $current_organization; + } + + //if we still have not got some organization + if( count( $orglist) < 0) { + $log->info("crmid ".$this->id." is not explizitely related to any organization"); + $sql = "select organizationname from vtiger_organizationdetails where deleted=0"; + $result = $adb->query($sql); + $orglist[0]=$adb->query_result($result,$i,"organizationname"); + } + if( count( $orglist) < 0) { + $log->fatal("crmid ".$this->id." is not related to any organization"); + } + + //set up the relations in the database + foreach($orglist as $org) { + $sql = "insert into vtiger_entity2org (crmid,organizationname,primarytag) values (".$this->id.",'".$org."',1)"; + $adb->query($sql); + } + } + + } + + /** Function to insert values in the vtiger_entity2org relation + * @param $crmid -- CRM id + * @param $module -- module object + */ + function insertIntoEntity2Org($crmid,$module) + { + global $current_organization; + global $log; + + $log->debug( "Entering insertIntoEntity2Org for crmid=".$crmid." module=".$module); + + // parameters + if( isset( $crmid) && $crmid != '' && + isset( $this->column_fields["otherorgs"]) && $this->column_fields["otherorgs"] != '') { + + // the organization list is the current users organization plus + // the other organizations stored in the modules parameters + if( is_array( $this->column_fields["otherorgs"])) { + // As array when enetered in EditView + $orglist = array(); + foreach( array_keys( $this->column_fields["otherorgs"]) as $key) + $orglist[] = $this->column_fields["otherorgs"][$key]; + } else { + // As string when entered in DetailView + $orglist = explode( ' |##| ', $this->column_fields["otherorgs"]); + } + $orglist[] = $current_organization; + + // get the current list of assignments + $sql = "SELECT organizationname,primarytag FROM vtiger_entity2org WHERE crmid='".$crmid."'"; + $result = $this->db->query($sql); + $delete = array(); + $noofrows = $this->db->num_rows($result); + + for( $i=0; $i<$noofrows; $i++) { + $organizationname = $this->db->query_result($result,$i,"organizationname"); + // If this organization is part of the $orglist array we'll + // just keept it. + for( $j=0; $jdb->query_result($result,$i,"primarytag"); + if( $primary == 0) + $delete[] = $organizationname; + } + + // Now we have two arrays $delete and $orglist defining the + // required database modification + $delstr = ""; + foreach( $delete as $org) { + if( $delstr == "") + $delstr = "'".$org."'"; + else + $delstr .= ",'".$org."'"; + } + if( $delstr != '') { + $sql = "DELETE from vtiger_entity2org WHERE crmid='".$crmid."' + AND organizationname IN (".$delstr.")"; + $result = $this->db->query($sql); + } + + foreach( $orglist as $org) { + $sql = "INSERT INTO vtiger_entity2org (crmid,organizationname,primarytag) + VALUES ('".$crmid."','".$org."',0)"; + $result = $this->db->query($sql); + } + } + + $log->debug( "Exit from insertIntoEntity2Org for crmid=".$crmid." module=".$module); + } + + + /** Function to insert values in the specifed table for the specified module + * @param $table_name -- table name:: Type varchar + * @param $module -- module:: Type varchar + */ + function insertIntoEntityTable($table_name, $module) + { + global $log; + global $current_user; + $log->info("function insertIntoEntityTable ".$module.' vtiger_table name ' .$table_name); + global $adb; + $insertion_mode = $this->mode; + + //Checkin whether an entry is already is present in the vtiger_table to update + if($insertion_mode == 'edit') + { + $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; + $check_result=$adb->query($check_query); + + $num_rows = $adb->num_rows($check_result); + + if($num_rows <= 0) + { + $insertion_mode = ''; + } + } + + if($insertion_mode == 'edit') + { + $update = ''; + $tabid= getTabid($module); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0) + { + + $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3)"; + } + else + { + $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 + WHERE vtiger_field.tabid = ".$tabid." + AND vtiger_profile2field.visible = 0 + AND vtiger_profile2field.profileid IN ".$profileList." + AND vtiger_def_org_field.visible = 0 and vtiger_field.tablename='".$table_name."' and vtiger_field.displaytype in (1,3)"; + } + + } + else + { + $column = $this->tab_name_index[$table_name]; + if($column == 'id' && $table_name == 'vtiger_users') + { + $currentuser_id = $adb->getUniqueID("vtiger_users"); + $this->id = $currentuser_id; + } elseif( $column == 'orgunitid' && $table_name == 'vtiger_orgunit') { + $this->id = $adb->getUniqueID("vtiger_orgunit"); + } + $value = $this->id; + $tabid= getTabid($module); + $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3,4)"; + } + + $result = $adb->query($sql); + $noofrows = $adb->num_rows($result); + for($i=0; $i<$noofrows; $i++) + { + $fieldname=$adb->query_result($result,$i,"fieldname"); + $columname=$adb->query_result($result,$i,"columnname"); + $uitype=$adb->query_result($result,$i,"uitype"); + + if(isset($this->column_fields[$fieldname])) + { + if($uitype == 56) + { + if($this->column_fields[$fieldname] == 'on' || $this->column_fields[$fieldname] == 1) + { + $fldvalue = 1; + } + else + { + $fldvalue = 0; + } + + } + // Added for inheritance and extensions fields + elseif( $uitype == '3' || $uitype == '4' || $uitype == '18' || + $uitype == '31' || $uitype == '32') { + $fldvalue = $this->column_fields[$fieldname]; + if( isset( $this->column_fields[$fieldname."@##@"]) && + $this->column_fields[$fieldname."@##@"] == 1) + $fldvalue = "@##@".$fldvalue; + } + elseif($uitype == 33) + { + if(is_array($this->column_fields[$fieldname])) + { + $field_list = implode(' |##| ',$this->column_fields[$fieldname]); + }else + { + $field_list = $this->column_fields[$fieldname]; + } + $fldvalue = $field_list; + } + elseif($uitype == 5 || $uitype == 6 || $uitype ==23) + { + if($_REQUEST['action'] == 'Import' || + ereg("^".$module."Ajax",$_REQUEST['action'])) + { + $fldvalue = $this->column_fields[$fieldname]; + } + else + { + $fldvalue = getDBInsertDateValue($this->column_fields[$fieldname]); + } + } + elseif($uitype == 7) + { + //strip out the spaces and commas in numbers if given ie., in amounts there may be , + $fldvalue = str_replace(",","",$this->column_fields[$fieldname]);//trim($this->column_fields[$fieldname],","); + + } + else + { + $fldvalue = $this->column_fields[$fieldname]; + $fldvalue = stripslashes($fldvalue); + } + $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); + } + else + { + $fldvalue = ''; + } + if($fldvalue=='') $fldvalue ="NULL"; + if($insertion_mode == 'edit') + { + if($table_name == 'vtiger_notes' && $columname == 'filename' && $_FILES['filename']['name'] == '') + { + $fldvalue = $this->getOldFileName($this->id); + } + if($table_name != 'vtiger_ticketcomments') + { + if($i == 0) + { + $update = $columname."=".$fldvalue.""; + } + else + { + $update .= ', '.$columname."=".$fldvalue.""; + } + } + } + else + { + $column .= ", ".$columname; + $value .= ", ".$fldvalue.""; + } + + } + + + + + + if($insertion_mode == 'edit') + { + if($_REQUEST['module'] == 'Potentials') + { + $dbquery = 'select sales_stage from vtiger_potential where potentialid = '.$this->id; + $sales_stage = $adb->query_result($adb->query($dbquery),0,'sales_stage'); + if($sales_stage != $_REQUEST['sales_stage'] && $_REQUEST['sales_stage'] != '') + { + $date_var = date('YmdHis'); + $closingdate = getDBInsertDateValue($this->column_fields['closingdate']); + $sql = "insert into vtiger_potstagehistory values('',".$this->id.",'".$this->column_fields['amount']."','".$sales_stage."','".$this->column_fields['probability']."',0,".$adb->formatString("vtiger_potstagehistory","closedate",$closingdate).",".$adb->formatString("vtiger_potstagehistory","lastmodified",$date_var).")"; + $adb->query($sql); + } + } + elseif($_REQUEST['module'] == 'PurchaseOrder' || $_REQUEST['module'] == 'SalesOrder' || $_REQUEST['module'] == 'Quotes' || $_REQUEST['module'] == 'Invoice') + { + //added to update the history for PO, SO, Quotes and Invoice + $history_field_array = Array( + "PurchaseOrder"=>"postatus", + "SalesOrder"=>"sostatus", + "Quotes"=>"quotestage", + "Invoice"=>"invoicestatus" + ); + + $inventory_module = $_REQUEST['module']; + + if($_REQUEST['ajxaction'] == 'DETAILVIEW')//if we use ajax edit + { + if($inventory_module == "PurchaseOrder") + $relatedname = getVendorName($this->column_fields['vendor_id']); + else + $relatedname = getAccountName($this->column_fields['account_id']); + + $total = $this->column_fields['hdnGrandTotal']; + } + else//using edit button and save + { + if($inventory_module == "PurchaseOrder") + $relatedname = $_REQUEST["vendor_name"]; + else + $relatedname = $_REQUEST["account_name"]; + + $total = $_REQUEST['total']; + } + + $oldvalue = getSingleFieldValue($this->table_name,$history_field_array[$inventory_module],$this->module_id,$this->id); + if($oldvalue != $this->column_fields["$history_field_array[$inventory_module]"]) + { + addInventoryHistory($inventory_module, $this->id,$relatedname,$total,$this->column_fields["$history_field_array[$inventory_module]"]); + } + } + + //Check done by Don. If update is empty the the query fails + if(trim($update) != '') + { + $sql1 = "update ".$table_name." set ".$update." where ".$this->tab_name_index[$table_name]."=".$this->id; + + $adb->query($sql1); + } + //to disable the update of groupentity relation in ajax edit for the fields except assigned_user_id field + if($_REQUEST['ajxaction'] != 'DETAILVIEW' || ($_REQUEST['ajxaction'] == 'DETAILVIEW' && $_REQUEST['fldName'] == 'assigned_user_id')) + { + if($_REQUEST['assigntype'] == 'T') + { + $groupname = $_REQUEST['assigned_group_name']; + //echo 'about to update lead group relation'; + if($module == 'Leads' && $table_name == 'vtiger_leaddetails') + { + updateLeadGroupRelation($this->id,$groupname); + } + elseif($module == 'Accounts' && $table_name == 'vtiger_account') + { + updateAccountGroupRelation($this->id,$groupname); + } + elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') + { + updateContactGroupRelation($this->id,$groupname); + } + elseif($module == 'Potentials' && $table_name == 'vtiger_potential') + { + updatePotentialGroupRelation($this->id,$groupname); + } + elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') + { + updateQuoteGroupRelation($this->id,$groupname); + } + elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') + { + updateSoGroupRelation($this->id,$groupname); + } + elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') + { + updateInvoiceGroupRelation($this->id,$groupname); + } + elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') + { + updatePoGroupRelation($this->id,$groupname); + } + elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') + { + updateTicketGroupRelation($this->id,$groupname); + } + elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') + { + updateCampaignGroupRelation($this->id,$groupname); + } + elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') + { + if($table_name == 'vtiger_activity') + { + updateActivityGroupRelation($this->id,$groupname); + } + } + + + } + else + { + //echo 'about to update lead group relation again!'; + if($module == 'Leads' && $table_name == 'vtiger_leaddetails') + { + updateLeadGroupRelation($this->id,''); + } + elseif($module == 'Accounts' && $table_name == 'vtiger_account') + { + updateAccountGroupRelation($this->id,''); + } + elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') + { + updateContactGroupRelation($this->id,''); + } + elseif($module == 'Potentials' && $table_name == 'vtiger_potential') + { + updatePotentialGroupRelation($this->id,''); + } + elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') + { + updateQuoteGroupRelation($this->id,''); + } + elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') + { + updateSoGroupRelation($this->id,''); + } + elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') + { + updateInvoiceGroupRelation($this->id,''); + } + elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') + { + updatePoGroupRelation($this->id,''); + } + elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') + { + updateTicketGroupRelation($this->id,''); + } + elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') + { + updateCampaignGroupRelation($this->id,$groupname); + } + elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') + { + if($table_name == 'vtiger_activity') + { + updateActivityGroupRelation($this->id,$groupname); + } + } + + + } + } + + } + else + { + $sql1 = "insert into ".$table_name." (".$column.") values(".$value.")"; + $adb->query($sql1); + $groupname = $_REQUEST['assigned_group_name']; + if($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_leaddetails') + { + insert2LeadGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_account') + { + insert2AccountGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_contactdetails') + { + insert2ContactGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_potential') + { + insert2PotentialGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_quotes') + { + insert2QuoteGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_salesorder') + { + insert2SoGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_invoice') + { + insert2InvoiceGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_purchaseorder') + { + insert2PoGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_activity') + { + insert2ActivityGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_troubletickets') + { + insert2TicketGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_campaign') + { + insert2CampaignGroupRelation($this->id,$groupname); + } + + } + + } + /** Function to delete a record in the specifed table + * @param $table_name -- table name:: Type varchar + * The function will delete a record .The id is obtained from the class variable $this->id and the columnname got from $this->tab_name_index[$table_name] + */ +function deleteRelation($table_name) +{ + global $adb; + $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; + $check_result=$adb->query($check_query); + $num_rows = $adb->num_rows($check_result); + + if($num_rows == 1) + { + $del_query = "DELETE from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; + $adb->query($del_query); + } + +} + /** Function to attachment filename of the given entity + * @param $notesid -- crmid:: Type Integer + * The function will get the attachmentsid for the given entityid from vtiger_seattachmentsrel table and get the attachmentsname from vtiger_attachments table + * returns the 'filename' + */ +function getOldFileName($notesid) +{ + global $log; +$log->info("in getOldFileName ".$notesid); + global $adb; + $query1 = "select * from vtiger_seattachmentsrel where crmid=".$notesid; + $result = $adb->query($query1); + $noofrows = $adb->num_rows($result); + if($noofrows != 0) + $attachmentid = $adb->query_result($result,0,'attachmentsid'); + if($attachmentid != '') + { + $query2 = "select * from vtiger_attachments where attachmentsid=".$attachmentid; + $filename = $adb->query_result($adb->query($query2),0,'name'); + } + return "'".$filename."'"; +} + + + + + + + + +// Code included by Jaguar - Ends + + /** Function to retrive the information of the given recordid ,module + * @param $record -- Id:: Type Integer + * @param $module -- module:: Type varchar + * This function retrives the information from the database and sets the value in the class columnfields array + */ + function retrieve_entity_info($record, $module) + { + global $adb,$log,$app_strings; + $result = Array(); + foreach($this->tab_name_index as $table_name=>$index) + { + if( $module == 'Organization') { + $result[$table_name] = $adb->query("select * from ".$table_name." where ".$index."='".$record."'"); + } elseif( $module == 'OrgUnit' ) { + $result[$table_name] = $adb->query("select * from ".$table_name." where ".$index."=".$record); + } else { + $result[$table_name] = $adb->query("select * from ".$table_name." where ".$index."=".$record); + if($adb->query_result($result["vtiger_crmentity"],0,"deleted") == 1) + die("

".$app_strings['LBL_RECORD_DELETE']." ".$app_strings['LBL_GO_BACK'].".
"); + } + } + $tabid = getTabid($module); + $sql1 = "select * from vtiger_field where tabid=".$tabid; + $result1 = $adb->query($sql1); + $noofrows = $adb->num_rows($result1); + for($i=0; $i<$noofrows; $i++) + { + $fieldcolname = $adb->query_result($result1,$i,"columnname"); + $tablename = $adb->query_result($result1,$i,"tablename"); + $fieldname = $adb->query_result($result1,$i,"fieldname"); + $uitype = $adb->query_result($result1,$i,"uitype"); + + // vtiger_entity2org results in a list value + if( $tablename == 'vtiger_entity2org') { + $fld_value = array(); + $nooforgs = $adb->num_rows( $result[$tablename]); + for($o=0; $o<$nooforgs; $o++) { + $fld_value[$adb->query_result($result[$tablename],$o,'organizationname')] = + $adb->query_result($result[$tablename],$o,'primarytag'); + } + } else { + $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); + } + + // Added for inheritance and extensions fields + if( $uitype == '3' || $uitype == '4' || $uitype == '18' || + $uitype == '31' || $uitype == '32') { + if( substr( $fld_value, 0, 4) == "@##@") { + $this->column_fields[$fieldname."@##@"] = 1; + $fld_value = substr( $fld_value, 4, strlen( $fld_value)-4); + } else { + $this->column_fields[$fieldname."@##@"] = 0; + } + } + $this->column_fields[$fieldname] = $fld_value; + + } + if($module == 'Users') + { + for($i=0; $i<$noofrows; $i++) + { + $fieldcolname = $adb->query_result($result1,$i,"columnname"); + $tablename = $adb->query_result($result1,$i,"tablename"); + $fieldname = $adb->query_result($result1,$i,"fieldname"); + $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); + $this->$fieldname = $fld_value; + + } + } + + $this->column_fields["record_id"] = $record; + $this->column_fields["record_module"] = $module; + } + + /** Function to saves the values in all the tables mentioned in the class variable $tab_name for the specified module + * @param $module -- module:: Type varchar + */ + function save($module_name) + { + global $log; + $log->debug("module name is ".$module_name); + //GS Save entity being called with the modulename as parameter + $this->saveentity($module_name); + } + + function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1) + { + global $list_max_entries_per_page; + $this->log->debug("process_list_query: ".$query); + if(!empty($limit) && $limit != -1){ + $result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: "); + }else{ + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + } + + $list = Array(); + if($max_per_page == -1){ + $max_per_page = $list_max_entries_per_page; + } + $rows_found = $this->db->getRowCount($result); + + $this->log->debug("Found $rows_found ".$this->object_name."s"); + + $previous_offset = $row_offset - $max_per_page; + $next_offset = $row_offset + $max_per_page; + + if($rows_found != 0) + { + + // We have some data. + + for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){ + + + foreach($this->list_fields as $entry) + { + + foreach($entry as $key=>$field) // this will be cycled only once + { + if (isset($row[$field])) { + $this->column_fields[$this->list_fields_names[$key]] = $row[$field]; + + + $this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field); + } + else + { + $this->column_fields[$this->list_fields_names[$key]] = ""; + } + } + } + + + //$this->db->println("here is the bug"); + + + $list[] = clone($this);//added by Richie to support PHP5 + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + return $response; + } + + function process_full_list_query($query) + { + $this->log->debug("CRMEntity:process_full_list_query"); + $result =& $this->db->query($query, false); + $this->log->debug("CRMEntity:process_full_list_query: result is ".$result); + + + if($this->db->getRowCount($result) > 0){ + + // $this->db->println("process_full mid=".$this->module_id." mname=".$this->module_name); + // We have some data. + while ($row = $this->db->fetchByAssoc($result)) { + $rowid=$row[$this->module_id]; + + if(isset($rowid)) + $this->retrieve_entity_info($rowid,$this->module_name); + else + $this->db->println("rowid not set unable to retrieve"); + + + + //clone function added to resolvoe PHP5 compatibility issue in Dashboards + //If we do not use clone, while using PHP5, the memory address remains fixed but the + //data gets overridden hence all the rows that come in bear the same value. This in turn +//provides a wrong display of the Dashboard graphs. The data is erroneously shown for a specific month alone +//Added by Richie + $list[] = clone($this);//added by Richie to support PHP5 + } + } + + if (isset($list)) return $list; + else return null; + } + + /** This function should be overridden in each module. It marks an item as deleted. + * If it is not overridden, then marking this type of item is not allowed + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function mark_deleted($id) + { + $query = "UPDATE vtiger_crmentity set deleted=1 where crmid='$id'"; + $this->db->query($query, true,"Error marking record deleted: "); + + + } + + + function retrieve_by_string_fields($fields_array, $encode=true) + { + $where_clause = $this->get_where($fields_array); + + $query = "SELECT * FROM $this->table_name $where_clause"; + $this->log->debug("Retrieve $this->object_name: ".$query); + $result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:"); + if( empty($result)) + { + return null; + } + + $row = $this->db->fetchByAssoc($result,-1, $encode); + + foreach($this->column_fields as $field) + { + if(isset($row[$field])) + { + $this->$field = $row[$field]; + } + } + return $this; + } + + // this method is called during an import before inserting a bean + // define an associative array called $special_fields + // the keys are user defined, and don't directly map to the bean's vtiger_fields + // the value is the method name within that bean that will do extra + // processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name' + + function process_special_fields() + { + foreach ($this->special_functions as $func_name) + { + if ( method_exists($this,$func_name) ) + { + $this->$func_name(); + } + } + } + + /** + * Function to check if the custom vtiger_field vtiger_table exists + * return true or false + */ + function checkIfCustomTableExists($tablename) + { + $query = "select * from ".$tablename; + $result = $this->db->query($query); + $testrow = $this->db->num_fields($result); + if($testrow > 1) + { + $exists=true; + } + else + { + $exists=false; + } + return $exists; + } + + /** + * function to construct the query to fetch the custom vtiger_fields + * return the query to fetch the custom vtiger_fields + */ + function constructCustomQueryAddendum($tablename,$module) + { + global $adb; + $tabid=getTabid($module); + $sql1 = "select columnname,fieldlabel from vtiger_field where generatedtype=2 and tabid=".$tabid; + $result = $adb->query($sql1); + $numRows = $adb->num_rows($result); + $sql3 = "select "; + for($i=0; $i < $numRows;$i++) + { + $columnName = $adb->query_result($result,$i,"columnname"); + $fieldlable = $adb->query_result($result,$i,"fieldlabel"); + //construct query as below + if($i == 0) + { + $sql3 .= $tablename.".".$columnName. " '" .$fieldlable."'"; + } + else + { + $sql3 .= ", ".$tablename.".".$columnName. " '" .$fieldlable."'"; + } + + } + if($numRows>0) + { + $sql3=$sql3.','; + } + return $sql3; + + } + + + /** + * This function returns a full (ie non-paged) list of the current object type. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_full_list($order_by = "", $where = "") { + $this->log->debug("get_full_list: order_by = '$order_by' and where = '$where'"); + $query = $this->create_list_query($order_by, $where); + return $this->process_full_list_query($query); + } + + /** + * Track the viewing of a detail record. This leverages get_summary_text() which is object specific + * params $user_id - The user that is viewing the record. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function track_view($user_id, $current_module,$id='') + { + $this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)"); + + $tracker = new Tracker(); + $tracker->track_view($user_id, $current_module, $id, ''); + } + + + +} +?> Modified: vtigercrm/branches/5.1_jens/data/SugarBean.php ============================================================================== --- vtigercrm/branches/5.1_jens/data/SugarBean.php (original) +++ vtigercrm/branches/5.1_jens/data/SugarBean.php Tue Nov 14 03:16:10 2006 @@ -1,451 +1,451 @@ -id) || $this->id == "") - { - $isUpdate = false; - } - - if ( $this->new_with_id == true ) - { - $isUpdate = false; - } - - //$this->date_modified = $this->db->formatDate(date('YmdHis')); - $this->date_modified = $this->db->formatDate(date('YmdHis')); - if (isset($current_user)) $this->modified_user_id = $current_user->id; - - if($isUpdate) - { - $query = "Update ".$this->table_name." set "; - } - else - { - //$this->date_entered = $this->db->formatDate(date('YmdHis')); - $this->date_entered = $this->db->formatDate(date('YmdHis')); - - if($this->new_schema && - $this->new_with_id == false) - { - $this->id = $this->db->getUniqueID("vtiger_users"); - } - - $query = "INSERT into ".$this->table_name; - } - // todo - add date modified to the list. - - // write out the SQL statement. - //$query .= $this->table_name." set "; - - $firstPass = 0; - $insKeys = '('; - $insValues = '('; - $updKeyValues=''; - foreach($this->column_fields as $field) - { - // Do not write out the id vtiger_field on the update statement. - // We are not allowed to change ids. - if($isUpdate && ('id' == $field)) - continue; - - // Only assign variables that have been set. - if(isset($this->$field)) - { - // Try comparing this element with the head element. - if(0 == $firstPass) - { - $firstPass = 1; - } - else - { - if($isUpdate) - { - $updKeyValues = $updKeyValues.", "; - } - else - { - $insKeys = $insKeys.", "; - $insValues = $insValues.", "; - } - } - /*else - $query = $query.", "; - - $query = $query.$field."='".$adb->quote(from_html($this->$field,$isUpdate))."'"; - */ - if($isUpdate) - { - $updKeyValues = $updKeyValues.$field."=".$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate)); - } - else - { - $insKeys = $insKeys.$field; - $insValues = $insValues.$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate)); - } - } - } - - if($isUpdate) - { - $query = $query.$updKeyValues." WHERE ID = '$this->id'"; - $this->log->info("Update $this->object_name: ".$query); - } - else - { - $query = $query.$insKeys.") VALUES ".$insValues.")"; - $this->log->info("Insert: ".$query); - } - - $this->db->query($query, true); - - // If this is not an update then store the id for later. - if(!$isUpdate && !$this->new_schema && !$this->new_with_id) - { - $this->db->println("Illegal Access - SugarBean"); - //this is mysql specific - $this->id = $this->db->getOne("SELECT LAST_INSERT_ID()" ); - } - - return $this->id; - } - - - /** - * This function retrieves a record of the appropriate type from the DB. - * It fills in all of the vtiger_fields from the DB into the object it was called on. - * param $id - If ID is specified, it overrides the current value of $this->id. If not specified the current value of $this->id will be used. - * returns this - The object that it was called apon or null if exactly 1 record was not found. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. - * All Rights Reserved. - * Contributor(s): ______________________________________.. - function retrieve($id = -1, $encodeThis=true) { - if ($id == -1) { - $id = $this->id; - } - if($id == '') { - return null; - } -// GS porting vtiger_crmentity -$query = "SELECT * FROM $this->table_name WHERE $this->module_id = '$id'"; -// $query = "SELECT * FROM $this->table_name WHERE ID = '$id'"; - $this->log->debug("Retrieve $this->object_name: ".$query); - - $result =& $this->db->requireSingleResult($query, true, "Retrieving record by id $this->table_name:$id found "); - - if(empty($result)) - { - return null; - } - - $row = $this->db->fetchByAssoc($result, -1, $encodeThis); - - foreach($this->column_fields as $field) - { - if(isset($row[$field])) - { - $this->$field = $row[$field]; - } - } - return $this; - } - */ - - function get_list($order_by = "", $where = "", $row_offset = 0, $limit=-1, $max=-1) { - $this->log->debug("get_list: order_by = '$order_by' and where = '$where' and limit = '$limit'"); - - $query = $this->create_list_query($order_by, $where); - - return $this->process_list_query($query, $row_offset, $limit, $max); - } - - /** - * This function returns a full (ie non-paged) list of the current object type. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_full_list($order_by = "", $where = "") { - $this->log->debug("get_full_list: order_by = '$order_by' and where = '$where'"); - $query = "SELECT * FROM $this->table_name "; - - if($where != "") - $query .= "where ($where) AND deleted=0"; - else - $query .= "where deleted=0"; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - - $result =& $this->db->query($query, false); - - if($this->db->getRowCount($result) > 0){ - - // We have some data. - while ($row = $this->db->fetchByAssoc($result)) { - foreach($this->list_fields as $field) - { - if (isset($row[$field])) { - $this->$field = $row[$field]; - - $this->log->debug("process_full_list: $this->object_name({$row['id']}): ".$field." = ".$this->$field); - } - else { - $this->$field = ''; - } - } - - - $list[] = clone($this); //added clone tosupport PHP5 - } - } - - if (isset($list)) return $list; - else return null; - - } - - function create_list_query($order_by, $where) - { - $query = "SELECT * FROM $this->table_name "; - - if($where != "") - $query .= "where ($where) AND deleted=0"; - else - $query .= "where deleted=0"; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - - return $query; - } - - - function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1) - { - global $list_max_entries_per_page; - $this->log->debug("process_list_query: ".$query); - if(!empty($limit) && $limit != -1){ - $result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: "); - }else{ - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - } - - $list = Array(); - if($max_per_page == -1){ - $max_per_page = $list_max_entries_per_page; - } - $rows_found = $this->db->getRowCount($result); - - $this->log->debug("Found $rows_found ".$this->object_name."s"); - - $previous_offset = $row_offset - $max_per_page; - $next_offset = $row_offset + $max_per_page; - - if($rows_found != 0) - { - - // We have some data. - - for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){ - foreach($this->list_fields as $field) - { - if (isset($row[$field])) { - $this->$field = $row[$field]; - - - $this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field); - } - else - { - $this->$field = ""; - } - } - - - $list[] = clone($this); //added clone to support PHP5 - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - return $response; - } - - - /** - * Track the viewing of a detail record. This leverages get_summary_text() which is object specific - * params $user_id - The user that is viewing the record. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function track_view($user_id, $current_module,$id='') - { - $this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)"); - - $tracker = new Tracker(); - $tracker->track_view($user_id, $current_module, $id, ''); - } - - - /** This function should be overridden in each module. It marks an item as deleted. - * If it is not overridden, then marking this type of item is not allowed - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function mark_deleted($id) - { - $query = "UPDATE $this->table_name set deleted=1 where id='$id'"; - $this->db->query($query, true,"Error marking record deleted: "); - - $this->mark_relationships_deleted($id); - - // Take the item off of the recently viewed lists. - $tracker = new Tracker(); - $tracker->delete_item_history($id); - - } - - - /* This is to allow subclasses to fill in row specific columns of a list view form - function list_view_parse_additional_sections(&$list_form) - { - } - */ - /* This function assigns all of the values into the template for the list view - function get_list_view_array(){ - $return_array = Array(); - - foreach($this->list_fields as $field) - { - $return_array[strtoupper($field)] = $this->$field; - } - - return $return_array; - } - function get_list_view_data() - { - - return $this->get_list_view_array(); - } - - function get_where(&$fields_array) - { - $where_clause = "WHERE "; - $first = 1; - foreach ($fields_array as $name=>$value) - { - if ($first) - { - $first = 0; - } - else - { - $where_clause .= " AND "; - } - - $where_clause .= "$name = ".$adb->quote($value).""; - } - - $where_clause .= " AND deleted=0"; - return $where_clause; - } - - - function retrieve_by_string_fields($fields_array, $encode=true) - { - $where_clause = $this->get_where($fields_array); - - $query = "SELECT * FROM $this->table_name $where_clause"; - $this->log->debug("Retrieve $this->object_name: ".$query); - $result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:"); - if( empty($result)) - { - return null; - } - - $row = $this->db->fetchByAssoc($result,-1, $encode); - - foreach($this->column_fields as $field) - { - if(isset($row[$field])) - { - $this->$field = $row[$field]; - } - } - return $this; - } - - // this method is called during an import before inserting a bean - // define an associative array called $special_fields - // the keys are user defined, and don't directly map to the bean's vtiger_fields - // the value is the method name within that bean that will do extra - // processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name' - - function process_special_fields() - { - foreach ($this->special_functions as $func_name) - { - if ( method_exists($this,$func_name) ) - { - $this->$func_name(); - } - } - } - - */ -} - - -?> +id) || $this->id == "") + { + $isUpdate = false; + } + + if ( $this->new_with_id == true ) + { + $isUpdate = false; + } + + //$this->date_modified = $this->db->formatDate(date('YmdHis')); + $this->date_modified = date('YmdHis'); + if (isset($current_user)) $this->modified_user_id = $current_user->id; + + if($isUpdate) + { + $query = "Update ".$this->table_name." set "; + } + else + { + //$this->date_entered = $this->db->formatDate(date('YmdHis')); + $this->date_entered = date('YmdHis'); + + if($this->new_schema && + $this->new_with_id == false) + { + $this->id = $this->db->getUniqueID("vtiger_users"); + } + + $query = "INSERT into ".$this->table_name; + } + // todo - add date modified to the list. + + // write out the SQL statement. + //$query .= $this->table_name." set "; + + $firstPass = 0; + $insKeys = '('; + $insValues = '('; + $updKeyValues=''; + foreach($this->column_fields as $field) + { + // Do not write out the id vtiger_field on the update statement. + // We are not allowed to change ids. + if($isUpdate && ('id' == $field)) + continue; + + // Only assign variables that have been set. + if(isset($this->$field)) + { + // Try comparing this element with the head element. + if(0 == $firstPass) + { + $firstPass = 1; + } + else + { + if($isUpdate) + { + $updKeyValues = $updKeyValues.", "; + } + else + { + $insKeys = $insKeys.", "; + $insValues = $insValues.", "; + } + } + /*else + $query = $query.", "; + + $query = $query.$field."='".$adb->quote(from_html($this->$field,$isUpdate))."'"; + */ + if($isUpdate) + { + $updKeyValues = $updKeyValues.$field."=".$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate)); + } + else + { + $insKeys = $insKeys.$field; + $insValues = $insValues.$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate)); + } + } + } + + if($isUpdate) + { + $query = $query.$updKeyValues." WHERE ID = '$this->id'"; + $this->log->info("Update $this->object_name: ".$query); + } + else + { + $query = $query.$insKeys.") VALUES ".$insValues.")"; + $this->log->info("Insert: ".$query); + } + + $this->db->query($query, true); + + // If this is not an update then store the id for later. + if(!$isUpdate && !$this->new_schema && !$this->new_with_id) + { + $this->db->println("Illegal Access - SugarBean"); + //this is mysql specific + $this->id = $this->db->getOne("SELECT LAST_INSERT_ID()" ); + } + + return $this->id; + } + + + /** + * This function retrieves a record of the appropriate type from the DB. + * It fills in all of the vtiger_fields from the DB into the object it was called on. + * param $id - If ID is specified, it overrides the current value of $this->id. If not specified the current value of $this->id will be used. + * returns this - The object that it was called apon or null if exactly 1 record was not found. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. + * All Rights Reserved. + * Contributor(s): ______________________________________.. + function retrieve($id = -1, $encodeThis=true) { + if ($id == -1) { + $id = $this->id; + } + if($id == '') { + return null; + } +// GS porting vtiger_crmentity +$query = "SELECT * FROM $this->table_name WHERE $this->module_id = '$id'"; +// $query = "SELECT * FROM $this->table_name WHERE ID = '$id'"; + $this->log->debug("Retrieve $this->object_name: ".$query); + + $result =& $this->db->requireSingleResult($query, true, "Retrieving record by id $this->table_name:$id found "); + + if(empty($result)) + { + return null; + } + + $row = $this->db->fetchByAssoc($result, -1, $encodeThis); + + foreach($this->column_fields as $field) + { + if(isset($row[$field])) + { + $this->$field = $row[$field]; + } + } + return $this; + } + */ + + function get_list($order_by = "", $where = "", $row_offset = 0, $limit=-1, $max=-1) { + $this->log->debug("get_list: order_by = '$order_by' and where = '$where' and limit = '$limit'"); + + $query = $this->create_list_query($order_by, $where); + + return $this->process_list_query($query, $row_offset, $limit, $max); + } + + /** + * This function returns a full (ie non-paged) list of the current object type. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_full_list($order_by = "", $where = "") { + $this->log->debug("get_full_list: order_by = '$order_by' and where = '$where'"); + $query = "SELECT * FROM $this->table_name "; + + if($where != "") + $query .= "where ($where) AND deleted=0"; + else + $query .= "where deleted=0"; + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + + $result =& $this->db->query($query, false); + + if($this->db->getRowCount($result) > 0){ + + // We have some data. + while ($row = $this->db->fetchByAssoc($result)) { + foreach($this->list_fields as $field) + { + if (isset($row[$field])) { + $this->$field = $row[$field]; + + $this->log->debug("process_full_list: $this->object_name({$row['id']}): ".$field." = ".$this->$field); + } + else { + $this->$field = ''; + } + } + + + $list[] = clone($this); //added clone tosupport PHP5 + } + } + + if (isset($list)) return $list; + else return null; + + } + + function create_list_query($order_by, $where) + { + $query = "SELECT * FROM $this->table_name "; + + if($where != "") + $query .= "where ($where) AND deleted=0"; + else + $query .= "where deleted=0"; + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + + return $query; + } + + + function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1) + { + global $list_max_entries_per_page; + $this->log->debug("process_list_query: ".$query); + if(!empty($limit) && $limit != -1){ + $result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: "); + }else{ + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + } + + $list = Array(); + if($max_per_page == -1){ + $max_per_page = $list_max_entries_per_page; + } + $rows_found = $this->db->getRowCount($result); + + $this->log->debug("Found $rows_found ".$this->object_name."s"); + + $previous_offset = $row_offset - $max_per_page; + $next_offset = $row_offset + $max_per_page; + + if($rows_found != 0) + { + + // We have some data. + + for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){ + foreach($this->list_fields as $field) + { + if (isset($row[$field])) { + $this->$field = $row[$field]; + + + $this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field); + } + else + { + $this->$field = ""; + } + } + + + $list[] = clone($this); //added clone to support PHP5 + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + return $response; + } + + + /** + * Track the viewing of a detail record. This leverages get_summary_text() which is object specific + * params $user_id - The user that is viewing the record. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function track_view($user_id, $current_module,$id='') + { + $this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)"); + + $tracker = new Tracker(); + $tracker->track_view($user_id, $current_module, $id, ''); + } + + + /** This function should be overridden in each module. It marks an item as deleted. + * If it is not overridden, then marking this type of item is not allowed + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function mark_deleted($id) + { + $query = "UPDATE $this->table_name set deleted=1 where id='$id'"; + $this->db->query($query, true,"Error marking record deleted: "); + + $this->mark_relationships_deleted($id); + + // Take the item off of the recently viewed lists. + $tracker = new Tracker(); + $tracker->delete_item_history($id); + + } + + + /* This is to allow subclasses to fill in row specific columns of a list view form + function list_view_parse_additional_sections(&$list_form) + { + } + */ + /* This function assigns all of the values into the template for the list view + function get_list_view_array(){ + $return_array = Array(); + + foreach($this->list_fields as $field) + { + $return_array[strtoupper($field)] = $this->$field; + } + + return $return_array; + } + function get_list_view_data() + { + + return $this->get_list_view_array(); + } + + function get_where(&$fields_array) + { + $where_clause = "WHERE "; + $first = 1; + foreach ($fields_array as $name=>$value) + { + if ($first) + { + $first = 0; + } + else + { + $where_clause .= " AND "; + } + + $where_clause .= "$name = ".$adb->quote($value).""; + } + + $where_clause .= " AND deleted=0"; + return $where_clause; + } + + + function retrieve_by_string_fields($fields_array, $encode=true) + { + $where_clause = $this->get_where($fields_array); + + $query = "SELECT * FROM $this->table_name $where_clause"; + $this->log->debug("Retrieve $this->object_name: ".$query); + $result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:"); + if( empty($result)) + { + return null; + } + + $row = $this->db->fetchByAssoc($result,-1, $encode); + + foreach($this->column_fields as $field) + { + if(isset($row[$field])) + { + $this->$field = $row[$field]; + } + } + return $this; + } + + // this method is called during an import before inserting a bean + // define an associative array called $special_fields + // the keys are user defined, and don't directly map to the bean's vtiger_fields + // the value is the method name within that bean that will do extra + // processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name' + + function process_special_fields() + { + foreach ($this->special_functions as $func_name) + { + if ( method_exists($this,$func_name) ) + { + $this->$func_name(); + } + } + } + + */ +} + + +?> Modified: vtigercrm/branches/5.1_jens/data/Tracker.php ============================================================================== --- vtigercrm/branches/5.1_jens/data/Tracker.php (original) +++ vtigercrm/branches/5.1_jens/data/Tracker.php Tue Nov 14 03:16:10 2006 @@ -66,151 +66,39 @@ global $adb; $this->delete_history($user_id, $item_id); global $log; -$log->info("in track view method ".$current_module); + $log->info("in track view method ".$current_module); // Add a new item to the user's list $esc_item_id = addslashes($item_id); //No genius required. Just add an if case and change the query so that it puts the tracker entry whenever you touch on the DetailView of the required entity //get the first name and last name from the respective modules - if($current_module =='Leads') - { - $query = 'select firstname,lastname from vtiger_leaddetails where leadid=' .$item_id; - $result = $this->db->query($query); - $firstname = $adb->query_result($result,0,'firstname'); - $lastname = $adb->query_result($result,0,'lastname'); - $item_summary = $lastname.' '.$firstname; - } - elseif ($current_module =='Accounts') - { - $query = 'select accountname from vtiger_account where accountid=' .$item_id; - $result = $this->db->query($query); - $accountname = $adb->query_result($result,0,'accountname'); - $item_summary = $accountname; - - } - elseif($current_module =='Contacts') - { - $query = 'select firstname,lastname from vtiger_contactdetails where contactid=' .$item_id; - $result = $this->db->query($query); - $firstname = $adb->query_result($result,0,'firstname'); - $lastname = $adb->query_result($result,0,'lastname'); - $item_summary = $lastname.' '.$firstname; - - } - elseif($current_module =='Potentials') - { - $query = 'select potentialname from vtiger_potential where potentialid=' .$item_id; - $result = $this->db->query($query); - $potentialname = $adb->query_result($result,0,'potentialname'); - $item_summary = $potentialname; - } - elseif($current_module =='Notes') - { - $query = 'select title from vtiger_notes where notesid=' .$item_id; - $result = $this->db->query($query); - $title = $adb->query_result($result,0,'title'); - $item_summary = $title; - - } - elseif($current_module =='HelpDesk') - { - $query = 'select title from vtiger_troubletickets where ticketid=' .$item_id; - $result = $this->db->query($query); - $title = $adb->query_result($result,0,'title'); - $item_summary = $title; - } - elseif($current_module =='Calendar') - { - //$query = 'select name from calls where callid=' .$item_id; - $query = 'select subject from vtiger_activity where activityid=' .$item_id; - $result = $this->db->query($query); - $name = $adb->query_result($result,0,'subject'); - $item_summary = $name; - } - elseif($current_module =='Emails') - { - //$query = 'select name from emails where emailid=' .$item_id; - $query = 'select subject from vtiger_activity where activityid=' .$item_id; - $result = $this->db->query($query); - $name = $adb->query_result($result,0,'subject'); - $item_summary = $name; - } - elseif($current_module =='Products') - { - $query = 'select productname from vtiger_products where productid=' .$item_id; - $result = $this->db->query($query); - $productname = $adb->query_result($result,0,'productname'); - $item_summary = $productname; - } - elseif($current_module =='Users') - { - $query = 'select first_name,last_name from vtiger_users where id=' .$item_id; - $result = $this->db->query($query); - $firstname = $adb->query_result($result,0,'first_name'); - $lastname = $adb->query_result($result,0,'last_name'); - $item_summary = $lastname.' '.$firstname; - } - elseif($current_module =='Invoice') - { - $query = 'select subject from vtiger_invoice where invoiceid=' .$item_id; - $result = $this->db->query($query); - $invoice = $adb->query_result($result,0,'subject'); - $item_summary = $invoice; - } - elseif($current_module =='Quotes') - { - $query = 'select subject from vtiger_quotes where quoteid=' .$item_id; - $result = $this->db->query($query); - $quote = $adb->query_result($result,0,'subject'); - $item_summary = $quote; - } - elseif($current_module =='PurchaseOrder') - { - $query = 'select subject from vtiger_purchaseorder where purchaseorderid=' .$item_id; - $result = $this->db->query($query); - $po = $adb->query_result($result,0,'subject'); - $item_summary = $po; - } - elseif($current_module =='SalesOrder') - { - $query = 'select subject from vtiger_salesorder where salesorderid=' .$item_id; - $result = $this->db->query($query); - $so = $adb->query_result($result,0,'subject'); - $item_summary = $so; - } - elseif($current_module =='Vendors') - { - $query = 'select vendorname from vtiger_vendor where vendorid=' .$item_id; - $result = $this->db->query($query); - $vendor = $adb->query_result($result,0,'vendorname'); - $item_summary = $vendor; - } - elseif($current_module =='PriceBooks') - { - $query = 'select bookname from vtiger_pricebook where pricebookid=' .$item_id; - $result = $this->db->query($query); - $pb = $adb->query_result($result,0,'bookname'); - $item_summary = $pb; - } - elseif($current_module =='Campaigns') - { - $query = 'select campaignname from vtiger_campaign where campaignid=' .$item_id; - $result = $this->db->query($query); - $pb = $adb->query_result($result,0,'campaignname'); - $item_summary = $pb; - } - elseif($current_module =='Faq') - { - $query = 'select question from vtiger_faq where id=' .$item_id; - $result = $this->db->query($query); - $pb = $adb->query_result($result,0,'question'); - if(strlen($pb) > 30) - { - $pb=substr($pb,0,30).'...'; - } - $item_summary = $pb; - } + if($current_module != '') + { + $query = "select fieldname,tablename,entityidfield from vtiger_entityname where modulename = '$current_module'"; + $result = $adb->query($query); + $fieldsname = $adb->query_result($result,0,'fieldname'); + $tablename = $adb->query_result($result,0,'tablename'); + $entityidfield = $adb->query_result($result,0,'entityidfield'); + if(!(strpos($fieldsname,',') === false)) + { + $fieldlists = explode(',',$fieldsname); + $fieldsname = "concat("; + $fieldsname = $fieldsname.implode(",' ',",$fieldlists); + $fieldsname = $fieldsname.")"; + } + if($current_module =='Organization') { + $query1 = "select $fieldsname as entityname from $tablename where $entityidfield='".$item_id."'"; + } else { + $query1 = "select $fieldsname as entityname from $tablename where $entityidfield=" .$item_id; + } + $result = $adb->query($query1); + $item_summary = $adb->query_result($result,0,'entityname'); + if(strlen($item_summary) > 30) + { + $item_summary=substr($item_summary,0,30).'...'; + } + } #if condition added to skip vtiger_faq in last viewed history $query = "INSERT into $this->table_name (user_id, module_name, item_id, item_summary) values ('$user_id', '$current_module', '$esc_item_id', ".$this->db->formatString($this->table_name,'item_summary',$item_summary).")"; @@ -238,7 +126,13 @@ } // $query = "SELECT * from $this->table_name WHERE user_id='$user_id' ORDER BY id DESC"; - $query = "SELECT * from $this->table_name inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_tracker.item_id WHERE user_id='$user_id' and vtiger_crmentity.deleted=0 ORDER BY id DESC"; + $query = "SELECT * from $this->table_name"; + if( $module_name != 'Organization') { + $query .= " inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_tracker.item_id WHERE vtiger_crmentity.deleted=0 AND "; + } else { + $query .= " WHERE "; + } + $query .= "user_id='$user_id' ORDER BY id DESC"; $this->log->debug("About to retrieve list: $query"); $result = $this->db->query($query, true); $list = Array(); Modified: vtigercrm/branches/5.1_jens/include/CustomFieldUtil.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/CustomFieldUtil.php (original) +++ vtigercrm/branches/5.1_jens/include/CustomFieldUtil.php Tue Nov 14 03:16:10 2006 @@ -73,6 +73,10 @@ { $fldname = 'Multi-Select Combo Box'; } + elseif($uitype == 85) + { + $fldname = 'Skype'; + } $log->debug("Exiting getCustomFieldTypeName method ..."); return $fldname; } @@ -216,6 +220,10 @@ { $fieldtype = '11'; } + elseif($label == 'Skype') + { + $fieldtype = '12'; + } $log->debug("Exiting getFldTypeandLengthValue method ..."); return $fieldtype; } Modified: vtigercrm/branches/5.1_jens/include/RelatedListView.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/RelatedListView.php (original) +++ vtigercrm/branches/5.1_jens/include/RelatedListView.php Tue Nov 14 03:16:10 2006 @@ -1,646 +1,518 @@ -debug("Entering GetRelatedList(".$module.",".$relatedmodule.",".$focus.",".$query.",".$button.",".$returnset.",".$edit_val.",".$del_val.") method ..."); - - require_once('Smarty_setup.php'); - require_once("data/Tracker.php"); - require_once('include/database/PearDatabase.php'); - - global $adb; - global $app_strings; - global $current_language; - - $current_module_strings = return_module_language($current_language, $module); - - global $list_max_entries_per_page; - global $urlPrefix; - - - global $currentModule; - global $theme; - global $theme_path; - global $theme_path; - global $mod_strings; - // focus_list is the means of passing data to a ListView. - global $focus_list; - $smarty = new vtigerCRM_Smarty; - if (!isset($where)) $where = ""; - - - $button = '
'.$button.'
'; - - // Added to have Purchase Order as form Title - if($relatedmodule == 'Orders') - { - $smarty->assign('ADDBUTTON',get_form_header($app_strings['PurchaseOrder'],$button, false)); - } - else - { - $smarty->assign('ADDBUTTON',get_form_header($app_strings[$relatedmodule],$button, false)); - } - - require_once('themes/'.$theme.'/layout_utils.php'); - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - $smarty->assign("MOD", $mod_strings); - $smarty->assign("APP", $app_strings); - $smarty->assign("IMAGE_PATH",$image_path); - $smarty->assign("MODULE",$relatedmodule); - - - //Retreive the list from Database - //$query = getListQuery("Accounts"); - - //echo '
*****************'.$relatedmodule.' ***************'; - //Appending the security parameter - if($relatedmodule != 'Notes' && $relatedmodule != 'Products' && $relatedmodule != 'Faq' && $relatedmodule != 'PriceBook' && $relatedmodule != 'Vendors') //Security fix by Don - { - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $tab_id=getTabid($relatedmodule); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter($relatedmodule); - $query .= ' '.$sec_parameter; - - } - } - - - if(isset($where) && $where != '') - { - $query .= ' and '.$where; - } - - if(!$_SESSION['rlvs'][$module][$relatedmodule]) - { - $modObj = new ListViewSession(); - $modObj->sortby = $focus->default_order_by; - $modObj->sorder = $focus->default_sort_order; - $_SESSION['rlvs'][$module][$relatedmodule] = get_object_vars($modObj); - } - if(isset($_REQUEST['relmodule']) && ($_REQUEST['relmodule'] == $relatedmodule)) - { - if(method_exists($focus,getSortOrder)) - $sorder = $focus->getSortOrder(); - if(method_exists($focus,getOrderBy)) - $order_by = $focus->getOrderBy(); - - if(isset($order_by) && $order_by != '') - { - $_SESSION['rlvs'][$module][$relatedmodule]['sorder'] = $sorder; - $_SESSION['rlvs'][$module][$relatedmodule]['sortby'] = $order_by; - } - - } - elseif($_SESSION['rlvs'][$module][$relatedmodule]) - { - $sorder = $_SESSION['rlvs'][$module][$relatedmodule]['sorder']; - $order_by = $_SESSION['rlvs'][$module][$relatedmodule]['sortby']; - } - else - { - $order_by = $focus->default_order_by; - $sorder = $focus->default_sort_order; - } - - $query .= ' ORDER BY '.$order_by.' '.$sorder; - $url_qry .="&order_by=".$order_by; - //Added for PHP version less than 5 - if (!function_exists("stripos")) - { - function stripos($query,$needle) - { - return strpos(strtolower($query),strtolower($needle)); - } - } - - //Retreiving the no of rows - $count_query = "select count(*) as count ".substr($query, stripos($query,'from'),strlen($query)); - $count_result = $adb->query(substr($count_query, stripos($count_query,'select'),stripos($count_query,'ORDER BY'))); - $noofrows = $adb->query_result($count_result,0,"count"); - - //Setting Listview session object while sorting/pagination - if(isset($_REQUEST['relmodule']) && $_REQUEST['relmodule']!='' && $_REQUEST['relmodule'] == $relatedmodule) - { - $relmodule = $_REQUEST['relmodule']; - if($_SESSION['rlvs'][$module][$relmodule]) - { - setSessionVar($_SESSION['rlvs'][$module][$relmodule],$noofrows,$list_max_entries_per_page,$module,$relmodule); - } - } - $start = $_SESSION['rlvs'][$module][$relatedmodule]['start']; - - $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); - - $start_rec = $navigation_array['start']; - $end_rec = $navigation_array['end_val']; - - //limiting the query - if ($start_rec ==0) - $limit_start_rec = 0; - else - $limit_start_rec = $start_rec -1; - - if( $adb->dbType == "pgsql") - $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); - else - $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); - - //Retreive the List View Table Header - if($noofrows == 0) - { - $smarty->assign('NOENTRIES',$app_strings['LBL_NONE_SCHEDULED']); - } - else - { - $id = $_REQUEST['record']; - $listview_header = getListViewHeader($focus,$relatedmodule,'',$sorder,$order_by,$id,'',$module);//"Accounts"); - if ($noofrows > 15) - { - $smarty->assign('SCROLLSTART','
'); - $smarty->assign('SCROLLSTOP','
'); - } - $smarty->assign("LISTHEADER", $listview_header); - - if($module == 'PriceBook' && $relatedmodule == 'Products') - { - $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,$edit_val,$del_val); - } - if($module == 'Products' && $relatedmodule == 'PriceBook') - { - $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'EditListPrice','DeletePriceBookProductRel'); - } - elseif($relatedmodule == 'SalesOrder') - { - $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'SalesOrderEditView','DeleteSalesOrder'); - }else - { - $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset); - } - - $navigationOutput = Array(); - $navigationOutput[] = $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; - $module_rel = $module.'&relmodule='.$relatedmodule.'&record='.$id; - $navigationOutput[] = getRelatedTableHeaderNavigation($navigation_array, $url_qry,$module_rel); - $related_entries = array('header'=>$listview_header,'entries'=>$listview_entries,'navigation'=>$navigationOutput); - $log->debug("Exiting GetRelatedList method ..."); - return $related_entries; - } -} - -/** Function to get related list entries in detailed array format - * @param $parentmodule -- parentmodulename:: Type string - * @param $query -- query:: Type string - * @param $id -- id:: Type string - * @returns $entries_list -- entries list:: Type string array - * - */ - -function getAttachmentsAndNotes($parentmodule,$query,$id,$sid='') -{ - global $log; - $log->debug("Entering getAttachmentsAndNotes(".$parentmodule.",".$query.",".$id.",".$sid.") method ..."); - global $theme; - - $list = ''; - echo $list; - - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - require_once ($theme_path."layout_utils.php"); - - global $adb; - global $mod_strings; - global $app_strings; - - $result=$adb->query($query); - $noofrows = $adb->num_rows($result); - - $header[] = $app_strings['LBL_CREATED']; - $header[] = $app_strings['LBL_SUBJECT']; - $header[] = $app_strings['LBL_DESCRIPTION']; - $header[] = $app_strings['LBL_ATTACHMENTS']; - $header[] = $app_strings['LBL_TYPE']; - $header[] = $app_strings['LBL_ACTION']; - - while($row = $adb->fetch_array($result)) - { - $entries = Array(); - if(trim($row['activitytype']) == 'Notes') - { - $module = 'Notes'; - $editaction = 'EditView'; - $deleteaction = 'Delete'; - } - elseif($row['activitytype'] == 'Attachments') - { - $module = 'uploads'; - $editaction = 'upload'; - $deleteaction = 'deleteattachments'; - } - if($row['createdtime'] != '0000-00-00 00:00:00') - { - $created_arr = explode(" ",getDisplayDate($row['createdtime'])); - $created_date = $created_arr[0]; - $created_time = substr($created_arr[1],0,5); - } - else - { - $created_date = ''; - $created_time = ''; - } - - $entries[] = $created_date; - if($module == 'Notes') - { - $entries[] = ''.$row['title'].''; - } - elseif($module == 'uploads') - { - $entries[] = ""; - } - - if(strlen($row['description']) > 40) - { - $row['description'] = substr($row['description'],0,40).'...'; - } - $entries[] = nl2br($row['description']); - $attachmentname = ltrim($row['filename'],$row['attachmentsid'].'_');//explode('_',$row['filename'],2); - - $entries[] = ''.$attachmentname.''; - - $entries[] = $row['activitytype']; - - $del_param = 'index.php?module='.$module.'&action='.$deleteaction.'&return_module='.$parentmodule.'&return_action='.$_REQUEST['action'].'&record='.$row["crmid"].'&return_id='.$_REQUEST["record"]; - - if($module == 'Notes') - { - $edit_param = 'index.php?module='.$module.'&action='.$editaction.'&return_module='.$parentmodule.'&return_action='.$_REQUEST['action'].'&record='.$row["crmid"].'&filename='.$row['filename'].'&fileid='.$row['attachmentsid'].'&return_id='.$_REQUEST["record"]; - - $entries[] .= ''.$app_strings['LNK_EDIT'].' | '.$app_strings['LNK_DELETE'].''; - } - else - { - $entries[] = ''.$app_strings['LNK_DELETE'].''; - } - $entries_list[] = $entries; - } - - if($entries_list !='') - $return_data = array('header'=>$header,'entries'=>$entries_list); - $log->debug("Exiting getAttachmentsAndNotes method ..."); - return $return_data; - -} - -/** Function to get related list entries in detailed array format - * @param $parentmodule -- parentmodulename:: Type string - * @param $query -- query:: Type string - * @param $id -- id:: Type string - * @returns $return_data -- return data:: Type string array - * - */ - -function getHistory($parentmodule,$query,$id) -{ - global $log; - $log->debug("Entering getHistory(".$parentmodule.",".$query.",".$id.") method ..."); - $parentaction = $_REQUEST['action']; - global $theme; - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - require_once ($theme_path."layout_utils.php"); - - global $adb; - global $mod_strings; - global $app_strings; - - //Appending the security parameter - global $current_user; - $rel_tab_id = getTabid("Calendar"); - - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $tab_id=getTabid('Calendar'); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter('Calendar'); - $query .= ' '.$sec_parameter; - - } - $result=$adb->query($query); - $noofrows = $adb->num_rows($result); - - $button .= '
'; - $button .= '
'; - - if($noofrows == 0) - { - } - else - { - $list .= ''; - $list .= ''; - -// Armando L?scher 15.07.2005 -> ?scrollableTables -// Desc: class="blackLine" deleted because of vertical line in title - - $class_black=""; - if($noofrows<=15) - { - $class_black='class="blackLine"'; - $colspan = 'colspan=2'; - } - - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed LBL_SUBJECT to LBL_CREATED - $header[] = $app_strings['LBL_CREATED']; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed LBL_STATUS to LBL_SUBJECT - $header[] = $app_strings['LBL_SUBJECT']; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed LBL_LIST_CONTACT_NAME to LBL_DESCRIPTION - $header[] = $app_strings['LBL_DESCRIPTION']; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed LBL_RELATED_TO to LBL_ACTION - $header[] = $app_strings['LBL_TIME']; - $header[] = $app_strings['LBL_ACTION']; - $header[] = $app_strings['LBL_RELATED_TO']; - $header[] = $app_strings['LBL_ASSIGNED_TO']; - $list .= ''; -/* // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Commented out because this is not used for the title row -*/ - $list .= ''; - $colspan = 9; - if($noofrows>15) - { - $list .= ''; - $colspan = 11; - } - $list .= ''; - - $list .= ''; - -// begin: Armando L?scher 14.07.2005 -> ?scrollableTables -// Desc: 'X' -// Insert new vtiger_table with 1 cell where all entries are in a new vtiger_table. -// This cell will be scrollable when too many entries exist - $list .= ($noofrows>15) ? '':''; -// end: Armando L?scher 14.07.2005 -> ?scrollableTables - - $list .= ''; - - $list .= '
'; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 25% to 90, inserted noWrap - - $colspan = ($noofrows<=15)?'colspan="3"':''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Inserted - $list .= $app_strings['LBL_CREATED'].''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 10% to 30%, inserted '.$colspan.' noWrap - - $list .= $app_strings['LBL_SUBJECT'].''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 18% to 70%, inserted noWrap - - $list .= $app_strings['LBL_DESCRIPTION'].''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 18% to 80, inserted noWrap - - $list .= $app_strings['LBL_ACTION'].'    
':''; -// end: Armando L?scher 14.07.2005 -> ?scrollableTables - - $i=1; - while($row = $adb->fetch_array($result)) - { - $entries = Array(); - if($row['activitytype'] == 'Task') - { - $activitymode = 'Task'; - $icon = 'Tasks.gif'; - $status = $row['status']; - } - elseif($row['activitytype'] == 'Call' || $row['activitytype'] == 'Meeting') - { - $activitymode = 'Events'; - $icon = 'Activities.gif'; - $status = $row['eventstatus']; - } - if ($i%2==0) - $trowclass = 'evenListRow'; - else - $trowclass = 'oddListRow'; - - $created_arr = explode(" ",getDisplayDate($row['createdtime'])); - $created_date = $created_arr[0]; - $created_time = substr($created_arr[1],0,5); - - $list .= ''; - $entries[] = $created_date; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 4% to 90, inserted colspan="2" align="right" valign="top" class="visibleDescriptionLink" style="padding:0px 3px 0px 3px;" noWrap, replaced with $created_date - - $list .= ''; - $list .= ''; - $entries[] = $activity; - $list .= ''; - - $list .= ''; - $list .= ''; - - if($row['firstname'] != 'NULL') - $contactname = $row['firstname'].' '; - if($ros['lastname'] != 'NULL') - $contactname .= $row['lastname']; - - $list .= ''; - - // begin: Armando L?scher 26.09.2005 -> ?visibleDescription - // Desc: Inserted because entries are displayed on 2 rows - $list .= ''; - // end: Armando L?scher 26.09.2005 -> ?visibleDescription - - $parentname = getRelatedTo('Calendar',$result,$i-1); - - $list .= ''; - - // begin: Armando L?scher 26.09.2005 -> ?visibleDescription - // Desc: Added - $list .= ''; - // end: Armando L?scher 26.09.2005 -> ?visibleDescription - - $list .= ''; - $entries[] = $created_time; - - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Inserted - -// $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Inserted - - // begin: Armando L?scher 26.09.2005 -> ?visibleDescription - // Desc: Added - $list .= ''; - $list .= ''; - - // the description is in this space - - $list .= ''; - $list .= ''; - - $list .= ''; - - $list .= ''; - - $i++; - $entries_list[] = $entries; - } - -// begin: Armando L?scher 14.07.2005 -> ?scrollableTables -// Desc: Close vtiger_table from - $list .= ($noofrows>15) ? '
'; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 10% to 70%, inserted rowspan="2" valign="top" class="visibleDescription" - $entries[] = nl2br($row['description']); - $list .= nl2br($row['description']); // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Replaced $status with nl2br($row['description']) - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 18% to 80, inserted valign="top" noWrap - // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: This if-statement replaces the line above - if(isPermitted("Calendar",1,$row["activityid"]) == 'yes') - { - $list .= ''.$app_strings['LNK_EDIT'].''; - - } - $list .= '
'; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 18% to 70, inserted align="right" valign="top" - $list .= $created_time; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Replaced $parentname with $created_time - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 15% to 8%, inserted valign="top" - $list .= $status; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Replaced $modifiedtime with $status - $entries[] = $status; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 10% to 18%, inserted valign="top" - $entries[] = $parentname; - $list .= $parentname; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Inserted - $list .= ''; - if($row['user_name']==NULL && $row['groupname']!=NULL) - { - $list .= $row['groupname']; - $entries[] = $row['groupname']; - } - else - { - $list .= $row['user_name']; - $entries[] = $row['user_name']; - - } - $list .= ''; - if(isPermitted("Calendar",2,$row["activityid"]) == 'yes') - { - $list .= ''.$app_strings['LNK_DELETE'].''; - } - $list .= ''; - - $list .= '
'; - $return_data = array('header'=>$header,'entries'=>$entries_list); - $log->debug("Exiting getHistory method ..."); - return $return_data; - } -} - -/** Function to display the Products which are related to the PriceBook - * @param string $query - query to get the list of products which are related to the current PriceBook - * @param object $focus - PriceBook object which contains all the information of the current PriceBook - * @param string $returnset - return_module, return_action and return_id which are sequenced with & to pass to the URL which is optional - * return array $return_data which will be formed like array('header'=>$header,'entries'=>$entries_list) where as $header contains all the header columns and $entries_list will contain all the Product entries - */ -function getPriceBookRelatedProducts($query,$focus,$returnset='') -{ - global $log; - $log->debug("Entering getPriceBookRelatedProducts(".$query.",".$focus.",".$returnset.") method ..."); - - global $adb; - global $app_strings; - global $mod_strings; - global $current_language; - $current_module_strings = return_module_language($current_language, 'PriceBook'); - - global $list_max_entries_per_page; - global $urlPrefix; - - global $theme; - $pricebook_id = $_REQUEST['record']; - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - require_once($theme_path.'layout_utils.php'); - - //Retreive the list from Database - $list_result = $adb->query($query); - $num_rows = $adb->num_rows($list_result); - - $header=array(); - $header[]=$mod_strings['LBL_LIST_PRODUCT_NAME']; - $header[]=$mod_strings['LBL_PRODUCT_CODE']; - $header[]=$mod_strings['LBL_PRODUCT_UNIT_PRICE']; - $header[]=$mod_strings['LBL_PB_LIST_PRICE']; - $header[]=$mod_strings['LBL_ACTION']; - - for($i=0; $i<$num_rows; $i++) - { - $entity_id = $adb->query_result($list_result,$i,"crmid"); - - $unit_price = $adb->query_result($list_result,$i,"unit_price"); - $listprice = $adb->query_result($list_result,$i,"listprice"); - $field_name=$entity_id."_listprice"; - - $entries = Array(); - $entries[] = $adb->query_result($list_result,$i,"productname"); - $entries[] = $adb->query_result($list_result,$i,"productcode"); - $entries[] = $unit_price; - $entries[] = $listprice; - $entries[] = ''.$app_strings[ | '.$app_strings['; - - $entries_list[] = $entries; - } - if($num_rows>0) - { - $return_data = array('header'=>$header,'entries'=>$entries_list); - - $log->debug("Exiting getPriceBookRelatedProducts method ..."); - return $return_data; - } -} - -?> +debug("Entering GetRelatedList(".$module.",".$relatedmodule.",".$focus.",".$query.",".$button.",".$returnset.",".$edit_val.",".$del_val.") method ..."); + + require_once('Smarty_setup.php'); + require_once("data/Tracker.php"); + require_once('include/database/PearDatabase.php'); + + global $adb; + global $app_strings; + global $current_language; + + $current_module_strings = return_module_language($current_language, $module); + + global $list_max_entries_per_page; + global $urlPrefix; + + + global $currentModule; + global $theme; + global $theme_path; + global $theme_path; + global $mod_strings; + // focus_list is the means of passing data to a ListView. + global $focus_list; + $smarty = new vtigerCRM_Smarty; + if (!isset($where)) $where = ""; + + + $button = '
'.$button.'
'; + + // Added to have Purchase Order as form Title + if($relatedmodule == 'Orders') + { + $smarty->assign('ADDBUTTON',get_form_header($app_strings['PurchaseOrder'],$button, false)); + } + else + { + $smarty->assign('ADDBUTTON',get_form_header($app_strings[$relatedmodule],$button, false)); + } + + require_once('themes/'.$theme.'/layout_utils.php'); + $theme_path="themes/".$theme."/"; + $image_path=$theme_path."images/"; + $smarty->assign("MOD", $mod_strings); + $smarty->assign("APP", $app_strings); + $smarty->assign("IMAGE_PATH",$image_path); + $smarty->assign("MODULE",$relatedmodule); + + + //Retreive the list from Database + //$query = getListQuery("Accounts"); + + //echo '
*****************'.$relatedmodule.' ***************'; + //Appending the security parameter + if($relatedmodule != 'Notes' && $relatedmodule != 'Products' && $relatedmodule != 'Faq' && $relatedmodule != 'PriceBook' && $relatedmodule != 'Vendors') //Security fix by Don + { + global $current_user; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $tab_id=getTabid($relatedmodule); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter($relatedmodule); + $query .= ' '.$sec_parameter; + + } + } + + + if(isset($where) && $where != '') + { + $query .= ' and '.$where; + } + + if(!$_SESSION['rlvs'][$module][$relatedmodule]) + { + $modObj = new ListViewSession(); + $modObj->sortby = $focus->default_order_by; + $modObj->sorder = $focus->default_sort_order; + $_SESSION['rlvs'][$module][$relatedmodule] = get_object_vars($modObj); + } + if(isset($_REQUEST['relmodule']) && ($_REQUEST['relmodule'] == $relatedmodule)) + { + if(method_exists($focus,getSortOrder)) + $sorder = $focus->getSortOrder(); + if(method_exists($focus,getOrderBy)) + $order_by = $focus->getOrderBy(); + + if(isset($order_by) && $order_by != '') + { + $_SESSION['rlvs'][$module][$relatedmodule]['sorder'] = $sorder; + $_SESSION['rlvs'][$module][$relatedmodule]['sortby'] = $order_by; + } + + } + elseif($_SESSION['rlvs'][$module][$relatedmodule]) + { + $sorder = $_SESSION['rlvs'][$module][$relatedmodule]['sorder']; + $order_by = $_SESSION['rlvs'][$module][$relatedmodule]['sortby']; + } + else + { + $order_by = $focus->default_order_by; + $sorder = $focus->default_sort_order; + } + + $query .= ' ORDER BY '.$order_by.' '.$sorder; + $url_qry .="&order_by=".$order_by; + //Added for PHP version less than 5 + if (!function_exists("stripos")) + { + function stripos($query,$needle) + { + return strpos(strtolower($query),strtolower($needle)); + } + } + + //Retreiving the no of rows + $count_query = "select count(*) as count ".substr($query, stripos($query,'from'),strlen($query)); + $count_result = $adb->query(substr($count_query, stripos($count_query,'select'),stripos($count_query,'ORDER BY'))); + $noofrows = $adb->query_result($count_result,0,"count"); + + //Setting Listview session object while sorting/pagination + if(isset($_REQUEST['relmodule']) && $_REQUEST['relmodule']!='' && $_REQUEST['relmodule'] == $relatedmodule) + { + $relmodule = $_REQUEST['relmodule']; + if($_SESSION['rlvs'][$module][$relmodule]) + { + setSessionVar($_SESSION['rlvs'][$module][$relmodule],$noofrows,$list_max_entries_per_page,$module,$relmodule); + } + } + $start = $_SESSION['rlvs'][$module][$relatedmodule]['start']; + + $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + + $start_rec = $navigation_array['start']; + $end_rec = $navigation_array['end_val']; + + //limiting the query + if ($start_rec ==0) + $limit_start_rec = 0; + else + $limit_start_rec = $start_rec -1; + + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); + + //Retreive the List View Table Header + if($noofrows == 0) + { + $smarty->assign('NOENTRIES',$app_strings['LBL_NONE_SCHEDULED']); + } + else + { + $id = $_REQUEST['record']; + $listview_header = getListViewHeader($focus,$relatedmodule,'',$sorder,$order_by,$id,'',$module);//"Accounts"); + if ($noofrows > 15) + { + $smarty->assign('SCROLLSTART','
'); + $smarty->assign('SCROLLSTOP','
'); + } + $smarty->assign("LISTHEADER", $listview_header); + + if($module == 'PriceBook' && $relatedmodule == 'Products') + { + $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,$edit_val,$del_val); + } + if($module == 'Products' && $relatedmodule == 'PriceBook') + { + $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'EditListPrice','DeletePriceBookProductRel'); + } + elseif($relatedmodule == 'SalesOrder') + { + $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'SalesOrderEditView','DeleteSalesOrder'); + }else + { + $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset); + } + + $navigationOutput = Array(); + $navigationOutput[] = $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; + $module_rel = $module.'&relmodule='.$relatedmodule.'&record='.$id; + $navigationOutput[] = getRelatedTableHeaderNavigation($navigation_array, $url_qry,$module_rel); + $related_entries = array('header'=>$listview_header,'entries'=>$listview_entries,'navigation'=>$navigationOutput); + $log->debug("Exiting GetRelatedList method ..."); + return $related_entries; + } +} + +/** Function to get related list entries in detailed array format + * @param $parentmodule -- parentmodulename:: Type string + * @param $query -- query:: Type string + * @param $id -- id:: Type string + * @returns $entries_list -- entries list:: Type string array + * + */ + +function getAttachmentsAndNotes($parentmodule,$query,$id,$sid='') +{ + global $log; + $log->debug("Entering getAttachmentsAndNotes(".$parentmodule.",".$query.",".$id.",".$sid.") method ..."); + global $theme; + + $list = ''; + echo $list; + + $theme_path="themes/".$theme."/"; + $image_path=$theme_path."images/"; + require_once ($theme_path."layout_utils.php"); + + global $adb; + global $mod_strings; + global $app_strings; + + $result=$adb->query($query); + $noofrows = $adb->num_rows($result); + + $header[] = $app_strings['LBL_CREATED']; + $header[] = $app_strings['LBL_SUBJECT']; + $header[] = $app_strings['LBL_DESCRIPTION']; + $header[] = $app_strings['LBL_ATTACHMENTS']; + $header[] = $app_strings['LBL_TYPE']; + $header[] = $app_strings['LBL_ACTION']; + + while($row = $adb->fetch_array($result)) + { + $entries = Array(); + if(trim($row['activitytype']) == 'Notes') + { + $module = 'Notes'; + $editaction = 'EditView'; + $deleteaction = 'Delete'; + } + elseif($row['activitytype'] == 'Attachments') + { + $module = 'uploads'; + $editaction = 'upload'; + $deleteaction = 'deleteattachments'; + } + if($row['createdtime'] != '0000-00-00 00:00:00') + { + $created_arr = explode(" ",getDisplayDate($row['createdtime'])); + $created_date = $created_arr[0]; + $created_time = substr($created_arr[1],0,5); + } + else + { + $created_date = ''; + $created_time = ''; + } + + $entries[] = $created_date; + if($module == 'Notes') + { + $entries[] = ''.$row['title'].''; + } + elseif($module == 'uploads') + { + $entries[] = ""; + } + + if(strlen($row['description']) > 40) + { + $row['description'] = substr($row['description'],0,40).'...'; + } + $entries[] = nl2br($row['description']); + $attachmentname = ltrim($row['filename'],$row['attachmentsid'].'_');//explode('_',$row['filename'],2); + + $entries[] = ''.$attachmentname.''; + + $entries[] = $row['activitytype']; + + $del_param = 'index.php?module='.$module.'&action='.$deleteaction.'&return_module='.$parentmodule.'&return_action='.$_REQUEST['action'].'&record='.$row["crmid"].'&return_id='.$_REQUEST["record"]; + + if($module == 'Notes') + { + $edit_param = 'index.php?module='.$module.'&action='.$editaction.'&return_module='.$parentmodule.'&return_action='.$_REQUEST['action'].'&record='.$row["crmid"].'&filename='.$row['filename'].'&fileid='.$row['attachmentsid'].'&return_id='.$_REQUEST["record"]; + + $entries[] .= ''.$app_strings['LNK_EDIT'].' | '.$app_strings['LNK_DELETE'].''; + } + else + { + $entries[] = ''.$app_strings['LNK_DELETE'].''; + } + $entries_list[] = $entries; + } + + if($entries_list !='') + $return_data = array('header'=>$header,'entries'=>$entries_list); + $log->debug("Exiting getAttachmentsAndNotes method ..."); + return $return_data; + +} + +/** Function to get related list entries in detailed array format + * @param $parentmodule -- parentmodulename:: Type string + * @param $query -- query:: Type string + * @param $id -- id:: Type string + * @returns $return_data -- return data:: Type string array + * + */ + +function getHistory($parentmodule,$query,$id) +{ + global $log; + $log->debug("Entering getHistory(".$parentmodule.",".$query.",".$id.") method ..."); + $parentaction = $_REQUEST['action']; + global $theme; + $theme_path="themes/".$theme."/"; + $image_path=$theme_path."images/"; + require_once ($theme_path."layout_utils.php"); + + global $adb; + global $mod_strings; + global $app_strings; + + //Appending the security parameter + global $current_user; + $rel_tab_id = getTabid("Calendar"); + + global $current_user; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $tab_id=getTabid('Calendar'); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter('Calendar'); + $query .= ' '.$sec_parameter; + + } + $result=$adb->query($query); + $noofrows = $adb->num_rows($result); + + if($noofrows == 0) + { + //There is no entries for history + } + else + { + //Form the header columns + $header[] = $app_strings['LBL_TYPE']; + $header[] = $app_strings['LBL_SUBJECT']; + $header[] = $app_strings['LBL_RELATED_TO']; + $header[] = $app_strings['LBL_START_DATE']; + $header[] = $app_strings['LBL_END_DATE']; + //$header[] = $app_strings['LBL_DESCRIPTION']; + $header[] = $app_strings['LBL_ACTION']; + $header[] = $app_strings['LBL_ASSIGNED_TO']; + + $i=1; + while($row = $adb->fetch_array($result)) + { + $entries = Array(); + if($row['activitytype'] == 'Task') + { + $activitymode = 'Task'; + $icon = 'Tasks.gif'; + $status = $row['status']; + } + elseif($row['activitytype'] == 'Call' || $row['activitytype'] == 'Meeting') + { + $activitymode = 'Events'; + $icon = 'Activities.gif'; + $status = $row['eventstatus']; + } + + $entries[] = $row['activitytype']; + + $activity = ''.$row['subject'].''; + $entries[] = $activity; + + $parentname = getRelatedTo('Calendar',$result,$i-1); + $entries[] = $parentname; + + $entries[] = $row['date_start']; + $entries[] = $row['due_date']; + + //$entries[] = nl2br($row['description']); + + if(isPermitted("Calendar",1,$row["activityid"]) == 'yes') + { + $list .= ''.$app_strings['LNK_EDIT'].''; + + } + + $entries[] = $status; + + if($row['user_name']==NULL && $row['groupname']!=NULL) + { + $entries[] = $row['groupname']; + } + else + { + $entries[] = $row['user_name']; + + } + + if(isPermitted("Calendar",2,$row["activityid"]) == 'yes') + { + $list .= ''.$app_strings['LNK_DELETE'].''; + } + + $i++; + $entries_list[] = $entries; + } + + $return_data = array('header'=>$header,'entries'=>$entries_list); + $log->debug("Exiting getHistory method ..."); + return $return_data; + } +} + +/** Function to display the Products which are related to the PriceBook + * @param string $query - query to get the list of products which are related to the current PriceBook + * @param object $focus - PriceBook object which contains all the information of the current PriceBook + * @param string $returnset - return_module, return_action and return_id which are sequenced with & to pass to the URL which is optional + * return array $return_data which will be formed like array('header'=>$header,'entries'=>$entries_list) where as $header contains all the header columns and $entries_list will contain all the Product entries + */ +function getPriceBookRelatedProducts($query,$focus,$returnset='') +{ + global $log; + $log->debug("Entering getPriceBookRelatedProducts(".$query.",".$focus.",".$returnset.") method ..."); + + global $adb; + global $app_strings; + global $mod_strings; + global $current_language; + $current_module_strings = return_module_language($current_language, 'PriceBook'); + + global $list_max_entries_per_page; + global $urlPrefix; + + global $theme; + $pricebook_id = $_REQUEST['record']; + $theme_path="themes/".$theme."/"; + $image_path=$theme_path."images/"; + require_once($theme_path.'layout_utils.php'); + + //Retreive the list from Database + $list_result = $adb->query($query); + $num_rows = $adb->num_rows($list_result); + + $header=array(); + $header[]=$mod_strings['LBL_LIST_PRODUCT_NAME']; + $header[]=$mod_strings['LBL_PRODUCT_CODE']; + $header[]=$mod_strings['LBL_PRODUCT_UNIT_PRICE']; + $header[]=$mod_strings['LBL_PB_LIST_PRICE']; + $header[]=$mod_strings['LBL_ACTION']; + + for($i=0; $i<$num_rows; $i++) + { + $entity_id = $adb->query_result($list_result,$i,"crmid"); + + $unit_price = $adb->query_result($list_result,$i,"unit_price"); + $listprice = $adb->query_result($list_result,$i,"listprice"); + $field_name=$entity_id."_listprice"; + + $entries = Array(); + $entries[] = $adb->query_result($list_result,$i,"productname"); + $entries[] = $adb->query_result($list_result,$i,"productcode"); + $entries[] = $unit_price; + $entries[] = $listprice; + $entries[] = ''.$app_strings[ | '.$app_strings['; + + $entries_list[] = $entries; + } + if($num_rows>0) + { + $return_data = array('header'=>$header,'entries'=>$entries_list); + + $log->debug("Exiting getPriceBookRelatedProducts method ..."); + return $return_data; + } +} + +?> Modified: vtigercrm/branches/5.1_jens/include/database/PearDatabase.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/database/PearDatabase.php (original) +++ vtigercrm/branches/5.1_jens/include/database/PearDatabase.php Tue Nov 14 03:16:10 2006 @@ -930,9 +930,20 @@ function getUniqueID($seqname) { - $this->checkConnection(); + global $log; + $this->checkConnection(); + if( $this->dbType == "pgsql") { + $keytab = $this->database->MetaPrimaryKeys($seqname); + if( count( $keytab) > 0) { + $log->info("PearDatabase: Postgres getUniqueID hack: ".$seqname."_".$keytab[0]."_seq"); + return $this->database->GenID($seqname."_".$keytab[0]."_seq",1); + } else { + $log->info("PearDatabase: Problem: getUniqueID but no key for '$seqname'"); + } + } return $this->database->GenID($seqname."_seq",1); } + function get_tables() { $this->checkConnection(); Modified: vtigercrm/branches/5.1_jens/include/database/Postgres8.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/database/Postgres8.php (original) +++ vtigercrm/branches/5.1_jens/include/database/Postgres8.php Tue Nov 14 03:16:10 2006 @@ -1,176 +1,144 @@ -info( "fixPostgresQuery: ".$query); - - // If we already have an order or group cluase separate ist for later use - if( strpos($queryRecord,'GROUP') > 0) - { - $groupClause = substr($queryRecord, strpos($queryRecord,'GROUP')+strlen('GROUP BY'), strlen($queryRecord)); - if( strpos($groupClause,'ORDER') > 0) - { - $orderClause = substr($groupClause, strpos($groupClause,'ORDER'), strlen($groupClause)); - $groupClause = substr($groupClause, 0, strpos($groupClause,'ORDER')); - } - $queryRecord = substr($queryRecord, 0, strpos($queryRecord,'GROUP')); - } - - if( strpos($queryRecord,'ORDER') > 0) - { - $orderClause = substr($queryRecord, strpos($queryRecord,'ORDER'), strlen($queryRecord)); - $queryRecord = substr($queryRecord, 0, strpos($queryRecord,'ORDER')); - } - - // Construkt the privateGroupList from the filed list by separating combined - // record.field entries - $privateGroupList = array(); - $token = strtok( $queryFields, ", () "); - while( $token !== false) { - if( strpos( $token, ".") !== false) { - array_push( $privateGroupList, $token); - } - $token = strtok( ", () "); - } - sort( $privateGroupList); - $groupFields = ""; - $last = ""; - for( $i = 0; $i < count($privateGroupList); $i++) { - if( $last != $privateGroupList[$i]) { - if( $groupFields == "") - $groupFields = $privateGroupList[$i]; - else - $groupFields .= ",".$privateGroupList[$i]; - } - $last = $privateGroupList[$i]; - } - - // Rebuild the query - $query = "SELECT ".$queryFields.$queryRecord." GROUP BY "; - if( $groupClause != "" ) - $groupClause = $groupClause.",".$groupFields; - else - $groupClause = $groupFields; - $query .= expandStar($groupClause,$log)." ".$orderClause; - - if( $debug) - $log->info( "fixPostgresQuery result: ".$query); - - return( $query); -} - -// Postgres8 will not accept a "tablename.*" entry in the GROUP BY clause -function expandStar($fieldlist,$log) -{ - $expanded=""; - $field = strtok( $fieldlist, ","); - while( $field != "") - { - //remove leading and trailing spaces - $field = trim( $field); - - //still spaces in the field indicate a complex structure - if( strpos( $field, " ") == 0) - { - - //locate table- and fieldname - $pos = strpos( $field, "."); - if( $pos > 0) - { - $table = substr( $field, 0, $pos); - $subfield = substr( $field, $pos+1, strlen($field)-$pos); - - //do we need to expand? - if( $subfield == "*") - $field = expandRecord($table,$log); - } - - //add the propably expanded field to the querylist - if( $expanded == "") - $expanded = $field; - else - $expanded .= ",".$field; - } - - //next field - $field = strtok(","); - } - - //return the expanded fieldlist - return( $expanded); -} - -//return an expanded table field list -function expandRecord($table,$log) -{ - $result = ""; - $log->info( "Debug: expandRecord"); - $subfields = array(); - - //vtiger_products table - if( $table == "vtiger_products" ) - $subfields = array ( "productid", "productname", "productcode", "productcategory", "manufacturer", "product_description", "qty_per_unit", "unit_price", "weight", "pack_size", "sales_start_date", "sales_end_date", "start_date", "expiry_date", "cost_factor", "commissionrate", "commissionmethod", "discontinued", "usageunit", "handler", "contactid", "currency", "reorderlevel", "website", "taxclass", "mfr_part_no", "vendor_part_no", "serialno", "qtyinstock", "productsheet", "qtyindemand", "glacct", "vendor_id", "imagename" ); - - //vtiger_activity table - elseif( $table == "vtiger_activity") - $subfields = array ( "activityid", "subject", "semodule", "activitytype", "date_start", "due_date", "time_start", "time_end", "sendnotification", "duration_hours", "duration_minutes", "status", "eventstatus", "priority", "location", "notime", "visibility" ); - - //vtiger_notes table - elseif( $table == "vtiger_notes") - $subfields = array ( "notesid", "contact_id", "title", "filename", "notecontent"); - - //vtiger_faq table - elseif( $table == "vtiger_faq") - $subfields = array ( "id", "product_id", "question", "answer", "category", "status"); - - //vtiger_profile2field - elseif( $table == "vtiger_profile2field") - $subfields = array ( "profileid", "tabid", "fieldid", "visible", "readonly"); - - //vtiger_field - elseif( $table == "vtiger_field") - $subfields = array ( "tabid", "fieldid", "columnname", "tablename", "generatedtype", "uitype", "fieldname", "fieldlabel", "readonly", "presence", "selected", "maximumlength", "sequence", "block", "displaytype", "typeofdata", "quickcreate", "quickcreatesequence", "info_type"); - - //vtiger_activity - elseif( $table == "vtiger_activity") - $subfields = array ( "activityid", "subject", "semodule", "activitytype", "date_start", "due_date", "time_start", "sendnotification", "duration_hours", "duration_minutes", "status", "eventstatus", "priority", "location", "notime", "visibility"); - - //fields of the requested array still undefined - else - $log->info("function expandRecord: please add structural information for table '".$table."'"); - - //construct an entity string - for( $i=0; $i 0) - $result = substr( $result, 0, strlen( $result) -1); - - //return out new string - return( $result); -} -?> +info( "fixPostgresQuery: ".$query); + + // If we already have an order or group cluase separate ist for later use + if( strpos($queryRecord,'GROUP') > 0) + { + $groupClause = substr($queryRecord, strpos($queryRecord,'GROUP')+strlen('GROUP BY'), strlen($queryRecord)); + if( strpos($groupClause,'ORDER') > 0) + { + $orderClause = substr($groupClause, strpos($groupClause,'ORDER'), strlen($groupClause)); + $groupClause = substr($groupClause, 0, strpos($groupClause,'ORDER')); + } + $queryRecord = substr($queryRecord, 0, strpos($queryRecord,'GROUP')); + } + + if( strpos($queryRecord,'ORDER') > 0) + { + $orderClause = substr($queryRecord, strpos($queryRecord,'ORDER'), strlen($queryRecord)); + $queryRecord = substr($queryRecord, 0, strpos($queryRecord,'ORDER')); + } + + // Construkt the privateGroupList from the filed list by separating combined + // record.field entries + $privateGroupList = array(); + $token = strtok( $queryFields, ", () "); + while( $token !== false) { + if( strpos( $token, ".") !== false) { + array_push( $privateGroupList, $token); + } + $token = strtok( ", () "); + } + sort( $privateGroupList); + $groupFields = ""; + $last = ""; + for( $i = 0; $i < count($privateGroupList); $i++) { + if( $last != $privateGroupList[$i]) { + if( $groupFields == "") + $groupFields = $privateGroupList[$i]; + else + $groupFields .= ",".$privateGroupList[$i]; + } + $last = $privateGroupList[$i]; + } + + // Rebuild the query + $query = "SELECT ".$queryFields.$queryRecord." GROUP BY "; + if( $groupClause != "" ) + $groupClause = $groupClause.",".$groupFields; + else + $groupClause = $groupFields; + $query .= expandStar($groupClause,$log)." ".$orderClause; + + if( $debug) + $log->info( "fixPostgresQuery result: ".$query); + + return( $query); +} + +// Postgres8 will not accept a "tablename.*" entry in the GROUP BY clause +function expandStar($fieldlist,$log) +{ + $expanded=""; + $field = strtok( $fieldlist, ","); + while( $field != "") + { + //remove leading and trailing spaces + $field = trim( $field); + + //still spaces in the field indicate a complex structure + if( strpos( $field, " ") == 0) + { + + //locate table- and fieldname + $pos = strpos( $field, "."); + if( $pos > 0) + { + $table = substr( $field, 0, $pos); + $subfield = substr( $field, $pos+1, strlen($field)-$pos); + + //do we need to expand? + if( $subfield == "*") + $field = expandRecord($table,$log); + } + + //add the propably expanded field to the querylist + if( $expanded == "") + $expanded = $field; + else + $expanded .= ",".$field; + } + + //next field + $field = strtok(","); + } + + //return the expanded fieldlist + return( $expanded); +} + +//return an expanded table field list +function expandRecord($table,$log) +{ + global $adb; + $result = ""; + $subfields = $adb->getColumnNames($table); + + //construct an entity string + for( $i=0; $i 0) + $result = substr( $result, 0, strlen( $result) -1); + + //return out new string + return( $result); +} +?> Modified: vtigercrm/branches/5.1_jens/include/js/Inventory.js ============================================================================== --- vtigercrm/branches/5.1_jens/include/js/Inventory.js (original) +++ vtigercrm/branches/5.1_jens/include/js/Inventory.js Tue Nov 14 03:16:10 2006 @@ -414,13 +414,29 @@ taxcount = eval(document.getElementById(countname).value)+1; if(countname == 'tax_count') + { taxprefix = 'tax'; + taxLabelPrefix = 'taxlabel_tax'; + } else + { taxprefix = 'shtax'; + taxLabelPrefix = 'taxlabel_shtax'; + } for(var i=1;i<=taxcount;i++) { taxval = document.getElementById(taxprefix+i).value; + taxLabelVal = document.getElementById(taxLabelPrefix+i).value; + document.getElementById(taxLabelPrefix+i).value = taxLabelVal.replace(/^\s*|\s*$/g,'').replace(/\s+/g,''); + + if(document.getElementById(taxLabelPrefix+i).value.length == 0) + { + alert("The tax label name should not be empty"); + return false + } + + //Tax value - numeric validation var temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(taxval); if(!temp) { @@ -430,6 +446,7 @@ } return true; } + //Function used to add a new product row in PO, SO, Quotes and Invoice @@ -501,12 +518,18 @@ function decideTaxDiv() { var taxtype = document.getElementById("taxtype").value + + calcTotal(); + if(taxtype == 'group') + { + //if group tax selected then we have to hide the individual taxes and also calculate the group tax hideIndividualTaxes() + calcGroupTax(); + } else if(taxtype == 'individual') hideGroupTax() - calcTotal(); } function hideIndividualTaxes() Modified: vtigercrm/branches/5.1_jens/include/js/ListView.js ============================================================================== --- vtigercrm/branches/5.1_jens/include/js/ListView.js (original) +++ vtigercrm/branches/5.1_jens/include/js/ListView.js Tue Nov 14 03:16:10 2006 @@ -1,147 +1,151 @@ -/********************************************************************************* - -** 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 change(obj,divid) -{ - var select_options = document.getElementsByName('selected_id'); - var x = select_options.length; - var viewid =getviewId(); - idstring = ""; - - xx = 0; - for(i = 0; i < x ; i++) - { - if(select_options[i].checked) - { - idstring = select_options[i].value +";"+idstring - xx++ - } - } - if (xx != 0) - { - document.getElementById('idlist').value=idstring; - } - else - { - alert("Please select at least one entity"); - return false; - } - fnvshobj(obj,divid); -} -function getviewId() -{ - if(typeof(document.getElementById("viewname")) != 'undefined') - { - var oViewname = document.getElementById("viewname"); - var viewid = oViewname.options[oViewname.selectedIndex].value; - } - else - { - var viewid =''; - } - return viewid; -} -function massDelete(module) -{ - var select_options = document.getElementsByName('selected_id'); - var x = select_options.length; - var viewid =getviewId(); - idstring = ""; - - xx = 0; - for(i = 0; i < x ; i++) - { - if(select_options[i].checked) - { - idstring = select_options[i].value +";"+idstring - xx++ - } - } - if (xx != 0) - { - document.getElementById('idlist').value=idstring; - } - else - { - alert("Please select at least one entity"); - return false; - } - if(confirm("Are you sure you want to delete the selected "+xx+" records ?")) - { - - $("status").style.display="inline"; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody:"module=Users&action=massdelete&return_module="+module+"&viewname="+viewid+"&idlist="+idstring, - onComplete: function(response) { - $("status").style.display="none"; - result = response.responseText.split('&#&#&#'); - $("ListViewContents").innerHTML= result[2]; - if(result[1] != '') - alert(result[1]); - } - } - ); - } - else - { - return false; - } - -} - -function showDefaultCustomView(selectView,module) -{ - $("status").style.display="inline"; - var viewName = selectView.options[selectView.options.selectedIndex].value; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&start=1&viewname="+viewName, - onComplete: function(response) { - $("status").style.display="none"; - result = response.responseText.split('&#&#&#'); - $("ListViewContents").innerHTML= result[2]; - if(result[1] != '') - alert(result[1]); - $('basicsearchcolumns_real').innerHTML = $('basicsearchcolumns').innerHTML - $('basicsearchcolumns').innerHTML = ''; - document.basicSearch.search_text.value = ''; - } - } - ); -} - - -function getListViewEntries_js(module,url) -{ - $("status").style.display="inline"; - if($('search_url').value!='') - urlstring = $('search_url').value; - else - urlstring = ''; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&"+url+urlstring, - onComplete: function(response) { - $("status").style.display="none"; - result = response.responseText.split('&#&#&#'); - $("ListViewContents").innerHTML= result[2]; - if(result[1] != '') - alert(result[1]); - } - } - ); -} - +/********************************************************************************* + +** 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 change(obj,divid) +{ + var select_options = document.getElementsByName('selected_id'); + var x = select_options.length; + var viewid =getviewId(); + idstring = ""; + + xx = 0; + for(i = 0; i < x ; i++) + { + if(select_options[i].checked) + { + idstring = select_options[i].value +";"+idstring + xx++ + } + } + if (xx != 0) + { + document.getElementById('idlist').value=idstring; + } + else + { + alert("Please select at least one entity"); + return false; + } + fnvshobj(obj,divid); +} +function getviewId() +{ + if(typeof(document.getElementById("viewname")) != 'undefined') + { + var oViewname = document.getElementById("viewname"); + if( oViewname.selectedIndex >= 0) { + var viewid = oViewname.options[oViewname.selectedIndex].value; + } else { + var viewid =''; + } + } + else + { + var viewid =''; + } + return viewid; +} +function massDelete(module) +{ + var select_options = document.getElementsByName('selected_id'); + var x = select_options.length; + var viewid =getviewId(); + idstring = ""; + + xx = 0; + for(i = 0; i < x ; i++) + { + if(select_options[i].checked) + { + idstring = select_options[i].value +";"+idstring + xx++ + } + } + if (xx != 0) + { + document.getElementById('idlist').value=idstring; + } + else + { + alert("Please select at least one entity"); + return false; + } + if(confirm("Are you sure you want to delete the selected "+xx+" records ?")) + { + + $("status").style.display="inline"; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody:"module=Users&action=massdelete&return_module="+module+"&viewname="+viewid+"&idlist="+idstring, + onComplete: function(response) { + $("status").style.display="none"; + result = response.responseText.split('&#&#&#'); + $("ListViewContents").innerHTML= result[2]; + if(result[1] != '') + alert(result[1]); + } + } + ); + } + else + { + return false; + } + +} + +function showDefaultCustomView(selectView,module) +{ + $("status").style.display="inline"; + var viewName = selectView.options[selectView.options.selectedIndex].value; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&start=1&viewname="+viewName, + onComplete: function(response) { + $("status").style.display="none"; + result = response.responseText.split('&#&#&#'); + $("ListViewContents").innerHTML= result[2]; + if(result[1] != '') + alert(result[1]); + $('basicsearchcolumns_real').innerHTML = $('basicsearchcolumns').innerHTML + $('basicsearchcolumns').innerHTML = ''; + document.basicSearch.search_text.value = ''; + } + } + ); +} + + +function getListViewEntries_js(module,url) +{ + $("status").style.display="inline"; + if($('search_url').value!='') + urlstring = $('search_url').value; + else + urlstring = ''; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&"+url+urlstring, + onComplete: function(response) { + $("status").style.display="none"; + result = response.responseText.split('&#&#&#'); + $("ListViewContents").innerHTML= result[2]; + if(result[1] != '') + alert(result[1]); + } + } + ); +} + Modified: vtigercrm/branches/5.1_jens/include/js/customview.js ============================================================================== --- vtigercrm/branches/5.1_jens/include/js/customview.js (original) +++ vtigercrm/branches/5.1_jens/include/js/customview.js Tue Nov 14 03:16:10 2006 @@ -1,392 +1,392 @@ -/********************************************************************************* - ** The contents of this file are subject to the vtiger CRM Public License Version 1.0 - * ("License"); You may not use this file except in compliance with the License - * The Original Code is: vtiger CRM Open Source - * The Initial Developer of the Original Code is vtiger. - * Portions created by vtiger are Copyright (C) vtiger. - * All Rights Reserved. - * - ********************************************************************************/ - -function splitValues() { - var picklistObj=getObj("fldPickList") - var pickListContent=picklistObj.value - var pickListAry=new Array() - var i=0; - - //Splitting up of Values - if (pickListContent.indexOf("\n")!=-1) { - while(pickListContent.length>0) { - if(pickListContent.indexOf("\n")!=-1) { - if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) { - pickListAry[i]=pickListContent.substr(0,pickListContent.indexOf("\n")).replace(/^\s+/g, '').replace(/\s+$/g, '') - pickListContent=pickListContent.substr(pickListContent.indexOf("\n")+1,pickListContent.length) - i++ - } else break; - } else { - pickListAry[i]=pickListContent.substr(0,pickListContent.length) - break; - } - } - } else if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) { - pickListAry[0]=pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '') - } - - return pickListAry; -} - - -function validate() { - var nummaxlength = 255; - var fieldtype = document.getElementById('selectedfieldtype').value; - var mode = document.getElementById('cfedit_mode').value; - if(fieldtype == "" && mode != 'edit') - { - alert("Field Type is not selected"); - return false; - } - lengthLayer=getObj("lengthdetails") - decimalLayer=getObj("decimaldetails") - pickListLayer=getObj("picklist") - var str = getObj("fldLabel").value; - if (!emptyCheck("fldLabel","Label")) - return false - - var re1=/^[a-z\d\_ ]+$/i - if (!re1.test(str)) - { - alert("Special characters are not allowed in Label field") - return false; - } - - if (lengthLayer.style.visibility=="visible") { - if (!emptyCheck("fldLength","Length")) - return false - - if (!intValidate("fldLength","Length")) - return false - - if (!numConstComp("fldLength","Length","GT",0)) - return false - - } - - if (decimalLayer.style.visibility=="visible") { - if (getObj("fldDecimal").value.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) - if (!intValidate("fldDecimal","Decimal")) - return false - if (!numConstComp("fldDecimal","Decimal","GE",0)) - return false - - if (!numConstComp("fldDecimal","Decimal","LE",30)) - return false - } - var decimallength = document.addtodb.fldDecimal.value; - if(fieldtype == 'Percent' || fieldtype == 'Currency' || fieldtype == 'Number') - { - if(decimallength == '') - decimallength = 0; - nummaxlength = 65 - (eval(decimallength) + 1); - } - if (!numConstComp("fldLength","Length","LE",nummaxlength)) - return false -var picklistObj=getObj("fldPickList") - if (pickListLayer.style.visibility=="visible") { - if (emptyCheck("fldPickList","Picklist values")) { - var pickListAry=new Array() - pickListAry=splitValues() - - //Empty Check validation - for (i=0;i220) { - fieldLayer.document.body.scrollTop+=height-220 - } else { - fieldLayer.document.body.scrollTop-=220-height - } - - if (window.navigator.appName.toUpperCase()=="OPERA") { - var newDiv=fieldLayer.document.createElement("DIV") - newDiv.style.zIndex="-1" - newDiv.style.position="absolute" - newDiv.style.top=findPosY(selFieldType)+"px" - newDiv.style.left="25px" - - var newObj=fieldLayer.document.createElement("INPUT") - newObj.type="text" - - fieldLayer.document.body.appendChild(newDiv) - newDiv.appendChild(newObj) - newObj.focus() - - fieldLayer.document.body.removeChild(newDiv) - } - } -} - -function selFieldType(id,scrollLayer,bool) { - currFieldIdx=id - var type=fieldTypeArr[id] - var lengthLayer=getObj("lengthdetails"); - var decimalLayer=getObj("decimaldetails"); - var pickListLayer=getObj("picklist"); - if (type=='text') { - lengthLayer.style.visibility="visible" - decimalLayer.style.visibility="hidden" - pickListLayer.style.visibility="hidden" - } else if (type=='date' || type=='email' || type=='phone' || type=='url' || type=='checkbox' || type=='textarea') { - getObj("lengthdetails").style.visibility="hidden" - decimalLayer.style.visibility="hidden" - pickListLayer.style.visibility="hidden" - } else if (type=='number' || type=='percent' || type=='currency') { - lengthLayer.style.visibility="visible" - decimalLayer.style.visibility="visible" - pickListLayer.style.visibility="hidden" - } else if (type=='picklist' || type=='multiselectcombo') { - lengthLayer.style.visibility="hidden" - decimalLayer.style.visibility="hidden" - pickListLayer.style.visibility="visible" - } - - - parent.getObj("fieldType").value = fieldValueArr[id]; -} - -function srchFieldType(ev) { - if (browser_ie) { - var keyCode=window.fieldLayer.event.keyCode - var currElement=window.fieldLayer.event.srcElement - if (currElement.id.indexOf("field")>=0) var doSearch=true - else var doSearch=false - window.fieldLayer.event.cancelBubble=true - } else if (browser_nn4 || browser_nn6) { - var keyCode=ev.which - var currElement=ev.target - if (currElement.type) doSearch=false - else doSearch=true - } - - if (doSearch==true) { - switch (keyCode) { - case 9 : //Reset Field Type - resetFieldTypeHilite();break; - case 33 : //Page Up - case 36 : //Home - selFieldType(0);break; - case 34 : //Page Down - case 35 : //End - selFieldType(totFieldType);break; - case 38 : //Up - if (currFieldIdx!=0) - selFieldType(currFieldIdx-1); - else - selFieldType(totFieldType,"yes"); - break; - case 40 : //Down - if (currFieldIdx!=totFieldType) - selFieldType(currFieldIdx+1); - else - selFieldType(0,"yes"); -default : //Character Search - if (keyCode>=65 && keyCode<=90) { - var srchChar=String.fromCharCode(keyCode) - if (currFieldIdx==totFieldType) var startIdx=0 - else var startIdx=currFieldIdx+1 - - var loop=1 - for (i=startIdx;i<=totFieldType;) { - currFieldStr=fieldLayer.getObj("field"+i).innerHTML - currFieldStr=currFieldStr.replace(/^\s+/g, '').replace(/\s+$/g, '').substr(0,1) - if (currFieldStr==srchChar) { - selFieldType(i,"yes") - i++ - } else if (i==totFieldType && loop<=2) { - i=0 - loop++ - } else i++ - } - } - } - } -} -function resetFieldTypeHilite() { - fieldLayer.getObj("field"+currFieldIdx).className="fieldType sel" -} -function validateCustomFieldAccounts() - { - var obj=document.getElementsByTagName("SELECT"); - var i,j=0,k=0,l=0; - var n=obj.length; - account = new Array; - contact = new Array; - potential = new Array; - for( i = 0; i < n; i++) - { - if(obj[i].name.indexOf("_account")>0) - { - account[j]=obj[i].value; - j++; - } - if(obj[i].name.indexOf("_contact")>0) - { - contact[k]=obj[i].value; - k++; - } - if(obj[i].name.indexOf("_potential")>0) - { - potential[l]=obj[i].value; - l++; - } - } - for( i = 0; i < account.length; i++) - { - for(j=i+1; j0) - { - var lead_dec = lead_tod[2].split(","); - var dec = tod[2].split(","); - - } - else - { - var lead_dec = lead_tod[2].split("~"); - var dec = tod[2].split("~"); - } - if(lead_dec[0] <= dec[0]) - { - if(lead_dec[1] <= dec[1]) - return true; - else - { - alert(alertmessage[4]); - document.getElementById(field_name).value = 'None'; - return false; - } - } - else - { - alert(alertmessage[3]); - document.getElementById(field_name).value = 'None'; - return false; - } - break; - } - } - } - else - { - alert(alertmessage[0]+" "+leadtype+" "+alertmessage[1]+" "+type+" "+alertmessage[2]); - document.getElementById(field_name).value = 'None'; - return false; - } - } -} +/********************************************************************************* + ** The contents of this file are subject to the vtiger CRM Public License Version 1.0 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * + ********************************************************************************/ + +function splitValues() { + var picklistObj=getObj("fldPickList") + var pickListContent=picklistObj.value + var pickListAry=new Array() + var i=0; + + //Splitting up of Values + if (pickListContent.indexOf("\n")!=-1) { + while(pickListContent.length>0) { + if(pickListContent.indexOf("\n")!=-1) { + if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) { + pickListAry[i]=pickListContent.substr(0,pickListContent.indexOf("\n")).replace(/^\s+/g, '').replace(/\s+$/g, '') + pickListContent=pickListContent.substr(pickListContent.indexOf("\n")+1,pickListContent.length) + i++ + } else break; + } else { + pickListAry[i]=pickListContent.substr(0,pickListContent.length) + break; + } + } + } else if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) { + pickListAry[0]=pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '') + } + + return pickListAry; +} + + +function validate() { + var nummaxlength = 255; + var fieldtype = document.getElementById('selectedfieldtype').value; + var mode = document.getElementById('cfedit_mode').value; + if(fieldtype == "" && mode != 'edit') + { + alert("Field Type is not selected"); + return false; + } + lengthLayer=getObj("lengthdetails") + decimalLayer=getObj("decimaldetails") + pickListLayer=getObj("picklist") + var str = getObj("fldLabel").value; + if (!emptyCheck("fldLabel","Label")) + return false + + var re1=/^[a-z\d\_ ]+$/i + if (!re1.test(str)) + { + alert("Special characters are not allowed in Label field") + return false; + } + + if (lengthLayer.style.visibility=="visible") { + if (!emptyCheck("fldLength","Length")) + return false + + if (!intValidate("fldLength","Length")) + return false + + if (!numConstComp("fldLength","Length","GT",0)) + return false + + } + + if (decimalLayer.style.visibility=="visible") { + if (getObj("fldDecimal").value.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) + if (!intValidate("fldDecimal","Decimal")) + return false + if (!numConstComp("fldDecimal","Decimal","GE",0)) + return false + + if (!numConstComp("fldDecimal","Decimal","LE",30)) + return false + } + var decimallength = document.addtodb.fldDecimal.value; + if(fieldtype == 'Percent' || fieldtype == 'Currency' || fieldtype == 'Number') + { + if(decimallength == '') + decimallength = 0; + nummaxlength = 65 - (eval(decimallength) + 1); + } + if (!numConstComp("fldLength","Length","LE",nummaxlength)) + return false +var picklistObj=getObj("fldPickList") + if (pickListLayer.style.visibility=="visible") { + if (emptyCheck("fldPickList","Picklist values")) { + var pickListAry=new Array() + pickListAry=splitValues() + + //Empty Check validation + for (i=0;i220) { + fieldLayer.document.body.scrollTop+=height-220 + } else { + fieldLayer.document.body.scrollTop-=220-height + } + + if (window.navigator.appName.toUpperCase()=="OPERA") { + var newDiv=fieldLayer.document.createElement("DIV") + newDiv.style.zIndex="-1" + newDiv.style.position="absolute" + newDiv.style.top=findPosY(selFieldType)+"px" + newDiv.style.left="25px" + + var newObj=fieldLayer.document.createElement("INPUT") + newObj.type="text" + + fieldLayer.document.body.appendChild(newDiv) + newDiv.appendChild(newObj) + newObj.focus() + + fieldLayer.document.body.removeChild(newDiv) + } + } +} + +function selFieldType(id,scrollLayer,bool) { + currFieldIdx=id + var type=fieldTypeArr[id] + var lengthLayer=getObj("lengthdetails"); + var decimalLayer=getObj("decimaldetails"); + var pickListLayer=getObj("picklist"); + if (type=='text') { + lengthLayer.style.visibility="visible" + decimalLayer.style.visibility="hidden" + pickListLayer.style.visibility="hidden" + } else if (type=='date' || type=='email' || type=='phone' || type=='url' || type=='checkbox' || type=='textarea' || type=='skype') { + getObj("lengthdetails").style.visibility="hidden" + decimalLayer.style.visibility="hidden" + pickListLayer.style.visibility="hidden" + } else if (type=='number' || type=='percent' || type=='currency') { + lengthLayer.style.visibility="visible" + decimalLayer.style.visibility="visible" + pickListLayer.style.visibility="hidden" + } else if (type=='picklist' || type=='multiselectcombo') { + lengthLayer.style.visibility="hidden" + decimalLayer.style.visibility="hidden" + pickListLayer.style.visibility="visible" + } + + + parent.getObj("fieldType").value = fieldValueArr[id]; +} + +function srchFieldType(ev) { + if (browser_ie) { + var keyCode=window.fieldLayer.event.keyCode + var currElement=window.fieldLayer.event.srcElement + if (currElement.id.indexOf("field")>=0) var doSearch=true + else var doSearch=false + window.fieldLayer.event.cancelBubble=true + } else if (browser_nn4 || browser_nn6) { + var keyCode=ev.which + var currElement=ev.target + if (currElement.type) doSearch=false + else doSearch=true + } + + if (doSearch==true) { + switch (keyCode) { + case 9 : //Reset Field Type + resetFieldTypeHilite();break; + case 33 : //Page Up + case 36 : //Home + selFieldType(0);break; + case 34 : //Page Down + case 35 : //End + selFieldType(totFieldType);break; + case 38 : //Up + if (currFieldIdx!=0) + selFieldType(currFieldIdx-1); + else + selFieldType(totFieldType,"yes"); + break; + case 40 : //Down + if (currFieldIdx!=totFieldType) + selFieldType(currFieldIdx+1); + else + selFieldType(0,"yes"); +default : //Character Search + if (keyCode>=65 && keyCode<=90) { + var srchChar=String.fromCharCode(keyCode) + if (currFieldIdx==totFieldType) var startIdx=0 + else var startIdx=currFieldIdx+1 + + var loop=1 + for (i=startIdx;i<=totFieldType;) { + currFieldStr=fieldLayer.getObj("field"+i).innerHTML + currFieldStr=currFieldStr.replace(/^\s+/g, '').replace(/\s+$/g, '').substr(0,1) + if (currFieldStr==srchChar) { + selFieldType(i,"yes") + i++ + } else if (i==totFieldType && loop<=2) { + i=0 + loop++ + } else i++ + } + } + } + } +} +function resetFieldTypeHilite() { + fieldLayer.getObj("field"+currFieldIdx).className="fieldType sel" +} +function validateCustomFieldAccounts() + { + var obj=document.getElementsByTagName("SELECT"); + var i,j=0,k=0,l=0; + var n=obj.length; + account = new Array; + contact = new Array; + potential = new Array; + for( i = 0; i < n; i++) + { + if(obj[i].name.indexOf("_account")>0) + { + account[j]=obj[i].value; + j++; + } + if(obj[i].name.indexOf("_contact")>0) + { + contact[k]=obj[i].value; + k++; + } + if(obj[i].name.indexOf("_potential")>0) + { + potential[l]=obj[i].value; + l++; + } + } + for( i = 0; i < account.length; i++) + { + for(j=i+1; j0) + { + var lead_dec = lead_tod[2].split(","); + var dec = tod[2].split(","); + + } + else + { + var lead_dec = lead_tod[2].split("~"); + var dec = tod[2].split("~"); + } + if(lead_dec[0] <= dec[0]) + { + if(lead_dec[1] <= dec[1]) + return true; + else + { + alert(alertmessage[4]); + document.getElementById(field_name).value = 'None'; + return false; + } + } + else + { + alert(alertmessage[3]); + document.getElementById(field_name).value = 'None'; + return false; + } + break; + } + } + } + else + { + alert(alertmessage[0]+" "+leadtype+" "+alertmessage[1]+" "+type+" "+alertmessage[2]); + document.getElementById(field_name).value = 'None'; + return false; + } + } +} Modified: vtigercrm/branches/5.1_jens/include/js/dtlviewajax.js ============================================================================== --- vtigercrm/branches/5.1_jens/include/js/dtlviewajax.js (original) +++ vtigercrm/branches/5.1_jens/include/js/dtlviewajax.js Tue Nov 14 03:16:10 2006 @@ -1,367 +1,420 @@ -/********************************************************************************* -** The contents of this file are subject to the vtiger CRM Public License Version 1.0 - * ("License"); You may not use this file except in compliance with the License - * The Original Code is: vtiger CRM Open Source - * The Initial Developer of the Original Code is vtiger. - * Portions created by vtiger are Copyright (C) vtiger. - * All Rights Reserved. -* - ********************************************************************************/ -var globaldtlviewspanid = ""; -var globaleditareaspanid = ""; -var globaltxtboxid = ""; -var itsonview=false; -// to retain the old value if we cancel the ajax edit -var globaltempvalue = ''; -var globaluitype = ''; -function showHide(showId, hideId) -{ - show(showId); - fnhide(hideId); -} - -function hndCancel(valuespanid,textareapanid,fieldlabel) -{ - - showHide(valuespanid,textareapanid); - if(globaluitype == '56') - { - if(globaltempvalue == 1) - getObj(globaltxtboxid).checked = true; - else - getObj(globaltxtboxid).checked = false; - } - else if(globaluitype != '53') - getObj(globaltxtboxid).value = globaltempvalue; - globaltempvalue = ''; - itsonview=false; - return false; -} - -function hndMouseOver(uitype,fieldLabel) -{ - var mouseArea=""; - mouseArea="mouseArea_"+ fieldLabel; - if(itsonview) - { - return; - } - - show("crmspanid"); - globaluitype = uitype; - globaldtlviewspanid= "dtlview_"+ fieldLabel;//valuespanid; - globaleditareaspanid="editarea_"+ fieldLabel;//textareapanid; - globalfieldlabel = fieldLabel; - if(globaluitype == 53) - { - if(typeof(document.DetailView.assigntype[0]) != 'undefined') - { - var assign_type_U = document.DetailView.assigntype[0].checked; - var assign_type_G = document.DetailView.assigntype[1].checked; - if(assign_type_U == true) - globaltxtboxid= 'txtbox_U'+fieldLabel; - else if(assign_type_G == true) - globaltxtboxid= 'txtbox_G'+fieldLabel; - }else - { - globaltxtboxid= 'txtbox_U'+fieldLabel; - } - }else - { - globaltxtboxid="txtbox_"+ fieldLabel;//textboxpanid; - } - divObj = getObj('crmspanid'); - crmy = findPosY(getObj(mouseArea)); - crmx = findPosX(getObj(mouseArea)); - if(document.all) - { - divObj.onclick=handleEdit; - } - else - { - divObj.setAttribute('onclick','handleEdit();'); - } - divObj.style.left=(crmx+getObj(mouseArea).offsetWidth -divObj.offsetWidth)+"px"; - divObj.style.top=crmy+"px"; -} - -function handleEdit() -{ - show(globaleditareaspanid) ; - fnhide(globaldtlviewspanid); - if(globaluitype != 53) - { - globaltempvalue = getObj(globaltxtboxid).value; - if(getObj(globaltxtboxid).type != 'hidden') - getObj(globaltxtboxid).focus(); - } - fnhide('crmspanid'); - itsonview=true; - return false; -} - -function trim(str) -{ - return(str.replace(/\s+$/,'')); -} - -var genUiType = ""; -var genFldValue = ""; - -function dtlViewAjaxSave(fieldLabel,module,uitype,tableName,fieldName,crmId) -{ - var dtlView = "dtlview_"+ fieldLabel; - var editArea = "editarea_"+ fieldLabel; - var groupurl = ""; - - if(globaluitype == 53) - { - if(typeof(document.DetailView.assigntype[0]) != 'undefined') - { - var assign_type_U = document.DetailView.assigntype[0].checked; - var assign_type_G = document.DetailView.assigntype[1].checked; - }else - { - var assign_type_U = document.DetailView.assigntype.checked; - } - if(assign_type_U == true) - { - var txtBox= 'txtbox_U'+fieldLabel; - } - else if(assign_type_G == true) - { - var txtBox= 'txtbox_G'+fieldLabel; - var group_name = $(txtBox).options[$(txtBox).selectedIndex].text; - var groupurl = "&assigned_group_name="+group_name+"&assigntype=T" - } - - }else if(globaluitype == 33) - { - var txtBox= "txtbox_"+ fieldLabel; - var oMulSelect = $(txtBox); - var r = new Array(); - for (iter=0;iter < oMulSelect.options.length ; iter++) - { - if (oMulSelect.options[iter].selected) - r[r.length] = oMulSelect.options[iter].value; - } - }else - { - var txtBox= "txtbox_"+ fieldLabel; - } - - var popupTxt= "popuptxt_"+ fieldLabel; - var hdTxt = "hdtxt_"+ fieldLabel; - - if(formValidate() == false) - { - return false; - } - - - $("vtbusy_info").style.display="inline"; - var isAdmin = document.getElementById("hdtxt_IsAdmin").value; - - - //overriden the tagValue based on UI Type for checkbox - if(uitype == '56') - { - if(document.getElementById(txtBox).checked == true) - { - tagValue = "1"; - }else - { - tagValue = "0"; - } - }else if(uitype == '156') - { - if(document.getElementById(txtBox).checked == true) - { - tagValue = "on"; - }else - { - tagValue = "off"; - } - }else if(uitype == '33') - { - tagValue = r.join(" |##| "); - }else - { - tagValue = trim(document.getElementById(txtBox).value); - } - - - var data = "file=DetailViewAjax&module=" + module + "&action=" + module + "Ajax&record=" + crmId+"&recordid=" + crmId ; - data = data + "&fldName=" + fieldName + "&fieldValue=" + escape(tagValue) + "&ajxaction=DETAILVIEW"+groupurl; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody: data, - onComplete: function(response) { - if(response.responseText.indexOf(":#:FAILURE")>-1) - { - alert("Error while Editing"); - } - else if(response.responseText.indexOf(":#:SUCCESS")>-1) - { - $("vtbusy_info").style.display="none"; - } - } - } - ); - if(uitype == '13' || uitype == '104') - { - getObj(dtlView).innerHTML = ""+tagValue+" "; - }else if(uitype == '17') - { - getObj(dtlView).innerHTML = ""+tagValue+" "; - }else if(uitype == '53') - { - var hdObj = getObj(hdTxt); - if(typeof(document.DetailView.assigntype[0]) != 'undefined') - { - var assign_type_U = document.DetailView.assigntype[0].checked; - var assign_type_G = document.DetailView.assigntype[1].checked; - }else - { - var assign_type_U = document.DetailView.assigntype.checked; - } - if(isAdmin == "0") - { - getObj(dtlView).innerHTML = hdObj.value; - }else if(isAdmin == "1" && assign_type_U == true) - { - getObj(dtlView).innerHTML = ""+hdObj.value+" "; - }else if(isAdmin == "1" && assign_type_G == true) - { - getObj(dtlView).innerHTML = ""+hdObj.value+" "; - } - }else if(uitype == '56') - { - if(tagValue == '1') - { - getObj(dtlView).innerHTML = "yes"; - }else - { - getObj(dtlView).innerHTML = ""; - } - - }else if(uitype == 116) - { - getObj(dtlView).innerHTML = document.getElementById(txtBox).options[document.getElementById(txtBox).selectedIndex].text; - } - else if(getObj(popupTxt)) - { - var popObj = getObj(popupTxt); - if(uitype == '50' || uitype == '73' || uitype == '51') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '57') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '59') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '75' || uitype == '81' ) - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - - } - else if(uitype == '76') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '78') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '80') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '53') - { - var hdObj = getObj(hdTxt); - if(isAdmin == "0") - { - getObj(dtlView).innerHTML = hdObj.value; - }else if(isAdmin == "1") - { - getObj(dtlView).innerHTML = ""+hdObj.value+" ";; - } - } - else if(uitype == '56') - { - if(tagValue == '1') - { - getObj(dtlView).innerHTML = "yes"; - }else - { - getObj(dtlView).innerHTML = ""; - } - - } - else - { - getObj(dtlView).innerHTML = popObj.value; - } - }else if(uitype == '33') - { - getObj(dtlView).innerHTML = r.join(", "); - }else - { - getObj(dtlView).innerHTML = tagValue; - } - showHide(dtlView,editArea); //show,hide - itsonview=false; -} - -function SaveTag(txtBox,crmId,module) -{ - var tagValue = document.getElementById(txtBox).value; - document.getElementById(txtBox).value =''; - $("vtbusy_info").style.display="inline"; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +tagValue, - onComplete: function(response) { - getObj('tagfields').innerHTML = response.responseText; - $("vtbusy_info").style.display="none"; - } - } - ); - -} -function setSelectValue(fieldLabel) -{ - if(globaluitype == 53) - { - if(typeof(document.DetailView.assigntype[0]) != 'undefined') - { - var assign_type_U = document.DetailView.assigntype[0].checked; - var assign_type_G = document.DetailView.assigntype[1].checked; - if(assign_type_U == true) - var selCombo= 'txtbox_U'+fieldLabel; - else if(assign_type_G == true) - var selCombo= 'txtbox_G'+fieldLabel; - }else - { - var selCombo= 'txtbox_U'+fieldLabel; - } - }else - { - var selCombo= 'txtbox_'+fieldLabel; - } - var hdTxtBox = 'hdtxt_'+fieldLabel; - var oHdTxtBox = document.getElementById(hdTxtBox); - var oSelCombo = document.getElementById(selCombo); - - oHdTxtBox.value = oSelCombo.options[oSelCombo.selectedIndex].text; -} - +/********************************************************************************* +** The contents of this file are subject to the vtiger CRM Public License Version 1.0 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. +* + ********************************************************************************/ +var globaldtlviewspanid = ""; +var globaleditareaspanid = ""; +var globaltxtboxid = ""; +var itsonview=false; +// to retain the old value if we cancel the ajax edit +var globaltempvalue = ''; +var globaluitype = ''; +function showHide(showId, hideId) +{ + show(showId); + fnhide(hideId); +} + +function hndCancel(valuespanid,textareapanid,fieldlabel) +{ + + showHide(valuespanid,textareapanid); + if(globaluitype == '56') + { + if(globaltempvalue == 1) + getObj(globaltxtboxid).checked = true; + else + getObj(globaltxtboxid).checked = false; + } + else if(globaluitype != '53') + getObj(globaltxtboxid).value = globaltempvalue; + globaltempvalue = ''; + itsonview=false; + return false; +} + +function hndMouseOver(uitype,fieldLabel) +{ + var mouseArea=""; + mouseArea="mouseArea_"+ fieldLabel; + if(itsonview) + { + return; + } + + show("crmspanid"); + globaluitype = uitype; + globaldtlviewspanid= "dtlview_"+ fieldLabel;//valuespanid; + globaleditareaspanid="editarea_"+ fieldLabel;//textareapanid; + globalfieldlabel = fieldLabel; + if(globaluitype == 53) + { + if(typeof(document.DetailView.assigntype[0]) != 'undefined') + { + var assign_type_U = document.DetailView.assigntype[0].checked; + var assign_type_G = document.DetailView.assigntype[1].checked; + if(assign_type_U == true) + globaltxtboxid= 'txtbox_U'+fieldLabel; + else if(assign_type_G == true) + globaltxtboxid= 'txtbox_G'+fieldLabel; + }else + { + globaltxtboxid= 'txtbox_U'+fieldLabel; + } + }else + { + globaltxtboxid="txtbox_"+ fieldLabel;//textboxpanid; + } + divObj = getObj('crmspanid'); + crmy = findPosY(getObj(mouseArea)); + crmx = findPosX(getObj(mouseArea)); + if(document.all) + { + divObj.onclick=handleEdit; + } + else + { + divObj.setAttribute('onclick','handleEdit();'); + } + divObj.style.left=(crmx+getObj(mouseArea).offsetWidth -divObj.offsetWidth)+"px"; + divObj.style.top=crmy+"px"; +} + +function handleEdit() +{ + show(globaleditareaspanid) ; + fnhide(globaldtlviewspanid); + if(globaluitype != 53) + { + globaltempvalue = getObj(globaltxtboxid).value; + if(getObj(globaltxtboxid).type != 'hidden') + getObj(globaltxtboxid).focus(); + } + fnhide('crmspanid'); + itsonview=true; + return false; +} + +function trim(str) +{ + return(str.replace(/\s+$/,'')); +} + +var genUiType = ""; +var genFldValue = ""; + +function dtlViewAjaxSave(fieldLabel,module,uitype,tableName,fieldName,crmId) +{ + var dtlView = "dtlview_"+ fieldLabel; + var editArea = "editarea_"+ fieldLabel; + var groupurl = ""; + + if(globaluitype == 53) + { + if(typeof(document.DetailView.assigntype[0]) != 'undefined') + { + var assign_type_U = document.DetailView.assigntype[0].checked; + var assign_type_G = document.DetailView.assigntype[1].checked; + }else + { + var assign_type_U = document.DetailView.assigntype.checked; + } + if(assign_type_U == true) + { + var txtBox= 'txtbox_U'+fieldLabel; + } + else if(assign_type_G == true) + { + var txtBox= 'txtbox_G'+fieldLabel; + var group_name = $(txtBox).options[$(txtBox).selectedIndex].text; + var groupurl = "&assigned_group_name="+group_name+"&assigntype=T" + } + + }else if(globaluitype == 14 || globaluitype == 33 || globaluitype == 34) + { + var txtBox= "txtbox_"+ fieldLabel; + var oMulSelect = $(txtBox); + var r = new Array(); + for (iter=0;iter < oMulSelect.options.length ; iter++) + { + if (oMulSelect.options[iter].selected) + r[r.length] = oMulSelect.options[iter].value; + } + }else + { + var txtBox= "txtbox_"+ fieldLabel; + } + + var popupTxt= "popuptxt_"+ fieldLabel; + var hdTxt = "hdtxt_"+ fieldLabel; + + if(formValidate() == false) + { + return false; + } + + + $("vtbusy_info").style.display="inline"; + var isAdmin = document.getElementById("hdtxt_IsAdmin").value; + + + //overriden the tagValue based on UI Type for checkbox + if(uitype == '56') + { + if(document.getElementById(txtBox).checked == true) + { + tagValue = "1"; + }else + { + tagValue = "0"; + } + }else if(uitype == '156') + { + if(document.getElementById(txtBox).checked == true) + { + tagValue = "on"; + }else + { + tagValue = "off"; + } + }else if(uitype == 14 || uitype == '33' || uitype == '34') + { + tagValue = r.join(" |##| "); + }else + { + tagValue = trim(document.getElementById(txtBox).value); + } + + if(uitype == '3' || uitype == '4' || uitype == '18' || uitype == '31' || uitype == '32') { + if(document.getElementById(txtBox+"_inh").checked) { + tagValue = "@##@" + tagValue; + } + } + + var data = "file=DetailViewAjax&module=" + module + "&action=" + module + "Ajax&record=" + crmId+"&recordid=" + crmId ; + data = data + "&fldName=" + fieldName + "&fieldValue=" + escape(tagValue) + "&ajxaction=DETAILVIEW"+groupurl; + data = data + "&tableName=" + tableName; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: data, + onComplete: function(response) { + if(response.responseText.indexOf(":#:FAILURE")>-1) + { + alert("Error while Editing"); + } + else if(response.responseText.indexOf(":#:SUCCESS")>-1) + { + $("vtbusy_info").style.display="none"; + } + } + } + ); + if(uitype == '13' || uitype == '104') + { + getObj(dtlView).innerHTML = ""+tagValue+" "; + }else if(uitype == '17') + { + getObj(dtlView).innerHTML = ""+tagValue+" "; + }else if(uitype == '34' || (uitype == '115' && fieldName == 'primary_org')) + { + var data = "file=UpdateUserOrg&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: data, + onComplete: function(response) { + $("dvtUserOrg").innerHTML = response.responseText; + } + } + ); + }else if(uitype == '85') + { + getObj(dtlView).innerHTML = ""+tagValue+" "; + }else if(uitype == '53') + { + var hdObj = getObj(hdTxt); + if(typeof(document.DetailView.assigntype[0]) != 'undefined') + { + var assign_type_U = document.DetailView.assigntype[0].checked; + var assign_type_G = document.DetailView.assigntype[1].checked; + }else + { + var assign_type_U = document.DetailView.assigntype.checked; + } + if(isAdmin == "0") + { + getObj(dtlView).innerHTML = hdObj.value; + }else if(isAdmin == "1" && assign_type_U == true) + { + getObj(dtlView).innerHTML = ""+hdObj.value+" "; + }else if(isAdmin == "1" && assign_type_G == true) + { + getObj(dtlView).innerHTML = ""+hdObj.value+" "; + } + }else if(uitype == '56') + { + if(tagValue == '1') + { + getObj(dtlView).innerHTML = "yes"; + }else + { + getObj(dtlView).innerHTML = ""; + } + + }else if(uitype == 116) + { + getObj(dtlView).innerHTML = document.getElementById(txtBox).options[document.getElementById(txtBox).selectedIndex].text; + } + else if(getObj(popupTxt)) + { + var popObj = getObj(popupTxt); + if(uitype == '50' || uitype == '73' || uitype == '51') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '57') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '59') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '75' || uitype == '81' ) + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + + } + else if(uitype == '76') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '78') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '80') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '53') + { + var hdObj = getObj(hdTxt); + if(isAdmin == "0") + { + getObj(dtlView).innerHTML = hdObj.value; + }else if(isAdmin == "1") + { + getObj(dtlView).innerHTML = ""+hdObj.value+" ";; + } + } + else if(uitype == '56') + { + if(tagValue == '1') + { + getObj(dtlView).innerHTML = "yes"; + }else + { + getObj(dtlView).innerHTML = ""; + } + + } + else + { + getObj(dtlView).innerHTML = popObj.value; + } + }else if(uitype == '33' || uitype == '34') + { + /* Wordwrap a long list of multi-select combo box items at the + * item separator string */ + const DETAILVIEW_WORDWRAP_WIDTH = "70"; // must match value in DetailViewUI.tpl. + + var lineLength = 0; + for(var i=0; i < r.length; i++) { + lineLength += r[i].length + 2; // + 2 for item separator string + if(lineLength > DETAILVIEW_WORDWRAP_WIDTH && i > 0) { + lineLength = r[i].length + 2; // reset. + r[i] = '
 ' + r[i]; // prepend newline. + } + // Prevent a browser splitting multiword items: + r[i] = r[i].replace(/ /g, ' '); + } + /* Join items with item separator string (which must match string in DetailViewUI.tpl, + * EditViewUtils.php and CRMEntity.php)!! + */ + getObj(dtlView).innerHTML = r.join(", "); + }else if(uitype == '3' || uitype == '4' || uitype == '14' || uitype == '18' || uitype == '31' || uitype == '32') + { + var data = "file=DetailView&module=" + module + "&action=" + module + "Ajax&record=" + crmId+"&recordid=" + crmId ; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: data, + onComplete: function(response) { + result = response.responseText.split(''); + $("mouseArea_"+fieldLabel).innerHTML= result[1]; + } + } + ); + }else + { + getObj(dtlView).innerHTML = tagValue; + } + showHide(dtlView,editArea); //show,hide + itsonview=false; +} + +function SaveTag(txtBox,crmId,module) +{ + var tagValue = document.getElementById(txtBox).value; + document.getElementById(txtBox).value =''; + $("vtbusy_info").style.display="inline"; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +tagValue, + onComplete: function(response) { + getObj('tagfields').innerHTML = response.responseText; + $("vtbusy_info").style.display="none"; + } + } + ); + +} +function setSelectValue(fieldLabel) +{ + if(globaluitype == 53) + { + if(typeof(document.DetailView.assigntype[0]) != 'undefined') + { + var assign_type_U = document.DetailView.assigntype[0].checked; + var assign_type_G = document.DetailView.assigntype[1].checked; + if(assign_type_U == true) + var selCombo= 'txtbox_U'+fieldLabel; + else if(assign_type_G == true) + var selCombo= 'txtbox_G'+fieldLabel; + }else + { + var selCombo= 'txtbox_U'+fieldLabel; + } + }else + { + var selCombo= 'txtbox_'+fieldLabel; + } + var hdTxtBox = 'hdtxt_'+fieldLabel; + var oHdTxtBox = document.getElementById(hdTxtBox); + var oSelCombo = document.getElementById(selCombo); + + oHdTxtBox.value = oSelCombo.options[oSelCombo.selectedIndex].text; +} + Modified: vtigercrm/branches/5.1_jens/include/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/language/en_us.lang.php (original) +++ vtigercrm/branches/5.1_jens/include/language/en_us.lang.php Tue Nov 14 03:16:10 2006 @@ -1,1220 +1,1258 @@ -'ISO-8859-1', - -'LBL_BROWSER_TITLE'=>'vtiger CRM 5 - Commercial Open Source CRM', - -'LBL_MY_ACCOUNT'=>'My Account', - -'LBL_MY_PREFERENCES'=>'My Preferences', - -'LBL_ADMIN'=>'Admin', - -'LBL_LOGOUT'=>'Sign out', - -'LBL_SEARCH'=>'Search', - -'LBL_LAST_VIEWED'=>'Last Viewed', - -'NTC_WELCOME_MESSAGE'=>"Welcome to vtiger CRM!", - -'NTC_DESCRIPTION'=>"Use a valid username and password to login to the vtiger CRM.", - -'NTC_WELCOME'=>'Welcome', - -'NTC_NO_ITEMS_DISPLAY'=>'none', - -'LBL_OR'=>'or', - -'LBL_ALT_HOT_KEY'=>'Alt+', -//added for 4.2 -'LBL_SAVE_LABEL'=>'Save', - -'LBL_SEND_MAIL_BUTTON'=>'Send Mail', - - -'LBL_SAVE_BUTTON_TITLE'=>'Save [Alt+S]', - -'LBL_EDIT_BUTTON_TITLE'=>'Edit [Alt+E]', - -'LBL_CONVERTSO_BUTTON_TITLE'=>'Create SalesOrder', -'LBL_CONVERTINVOICE_BUTTON_TITLE'=>'Create Invoice', - -'LBL_EDIT_BUTTON'=>'Edit', - -'LBL_DUPLICATE_BUTTON_TITLE'=>'Duplicate [Alt+U]', - -'LBL_DUPLICATE_BUTTON'=>'Duplicate', - -'LBL_TABCUSTOMISE_BUTTON_TITLE'=>'Customise [Alt+C]', - -'LBL_FORUM_HIDE_BUTTON_TITLE'=>'Hide Forum [Alt+I]', - -'LBL_FORUM_HIDE_BUTTON_KEY'=>'H', - -'LBL_FORUM_SHOW_BUTTON_TITLE'=>'Show Forum [Alt+W]', - -'LBL_FORUM_SHOW_BUTTON_KEY'=>'W', - -'LBL_TABCUSTOMISE_BUTTON'=>'Customise', - -'LBL_DELETE_BUTTON_TITLE'=>'Delete [Alt+D]', - -'LBL_DELETE_BUTTON'=>'Delete', - -'LBL_FIND_BUTTON'=>'Find', - -'LBL_CONVERT_BUTTON_TITLE'=>'Convert [Alt+C]', - -'LBL_CONVERT_BUTTON_KEY'=>'C', - -'LBL_CONVERT_BUTTON_LABEL'=>'Convert Lead', - -'LBL_TABCUSTOMISE_BUTTON_KEY'=>'C', - -'LBL_TABCUSTOMISE_BUTTON_LABEL'=>'Customize Tab', - -'LBL_ROLES_BUTTON_LABEL'=>'Show Roles', - -'LBL_LISTROLES_BUTTON_LABEL'=>'List Roles', - -'LBL_FORUM_HIDE_BUTTON_LABEL'=>'Hide Forums', - -'LBL_FORUM_SHOW_BUTTON_LABEL'=>'Show Forums', - -'LBL_NEW_BUTTON_TITLE'=>'New [Alt+N]', - -'LBL_CHANGE_BUTTON_TITLE'=>'Change [Alt+G]', - -'LBL_CANCEL_BUTTON_TITLE'=>'Cancel [Alt+X]', - -'LBL_SEARCH_BUTTON_TITLE'=>'Search [Alt+Q]', - -'LBL_CLEAR_BUTTON_TITLE'=>'Clear [Alt+C]', - -'LBL_SELECT_BUTTON_TITLE'=>'Select [Alt+T]', - -'LBL_CREATE_BUTTON_LABEL' =>'Create', - -'LBL_GENERATE'=>'Generate', - -'LBL_SAVE_BUTTON_KEY'=>'S', - -'LBL_EDIT_BUTTON_KEY'=>'E', -'LBL_CONVERTSO_BUTTON_KEY'=>'S', -'LBL_CONVERTINVOICE_BUTTON_KEY'=>'I', - -'LBL_DUPLICATE_BUTTON_KEY'=>'U', - -'LBL_DELETE_BUTTON_KEY'=>'D', - -'LBL_NEW_BUTTON_KEY'=>'N', - -'LBL_CHANGE_BUTTON_KEY'=>'G', - -'LBL_CANCEL_BUTTON_KEY'=>'X', - -'LBL_SEARCH_BUTTON_KEY'=>'Q', - -'LBL_CLEAR_BUTTON_KEY'=>'C', - -'LBL_SELECT_BUTTON_KEY'=>'T', - -'LBL_SAVE_BUTTON_LABEL'=>'Save', - -'LBL_EDIT_BUTTON_LABEL'=>'Edit', -'LBL_CONVERTSO_BUTTON_LABEL'=>'Create SalesOrder', -'LBL_CONVERTINVOICE_BUTTON_LABEL'=>'Create Invoice', - -'LBL_DUPLICATE_BUTTON_LABEL'=>'Duplicate', - -'LBL_DELETE_BUTTON_LABEL'=>'Delete', - -'LBL_NEW_BUTTON_LABEL'=>'New', - -'LBL_CHANGE_BUTTON_LABEL'=>'Change', - -'LBL_CANCEL_BUTTON_LABEL'=>'Cancel', - -'LBL_SEARCH_BUTTON_LABEL'=>'Search', - -'LBL_CLEAR_BUTTON_LABEL'=>'Clear', - -'LBL_SELECT_BUTTON_LABEL'=>'Select', - -'LBL_SELECT_CONTACT_BUTTON_TITLE'=>'Select Contact [Alt+T]', - -'LBL_SELECT_CONTACT_BUTTON_KEY'=>'T', - -'LBL_SELECT_CONTACT_BUTTON_LABEL'=>'Select Contact', - -'LBL_SELECT_CAMPAIGN_BUTTON_LABEL'=>'Select Campaign', - -'LBL_SELECT_USER_BUTTON_TITLE'=>'Select User [Alt+U]', - -'LBL_SELECT_USER_BUTTON_KEY'=>'U', - -'LBL_SELECT_USER_BUTTON_LABEL'=>'Select User', - -'LBL_SETTINGS'=>'Settings', - -'LBL_LIST_USERIP'=>'User IP', - -'LBL_LIST_SIGNIN'=>'Sign in Time', - -'LBL_LIST_SIGNOUT'=>'Sign out Time', - -'LBL_LIST_STATUS'=>'Status', - - - -'LBL_LIST_NAME'=>'Name', - -'LBL_LIST_USER_NAME'=>'User Name', - -'LBL_LIST_EMAIL'=>'Email', - -'LBL_LIST_PHONE'=>'Phone', - -'LBL_LIST_CONTACT_NAME'=>'Contact Name', - -'LBL_LIST_ACCOUNT_NAME'=>'Account Name', - -'LBL_USER_LIST'=>'User List', - -'LBL_CONTACT_LIST'=>'Contact List', - -'LBL_LNK_SETTINGS'=> 'Settings', - -'LNK_IMPORT_LEADS'=>'Import Leads', - -'LBL_LOCATE_MAP'=>'Locate Map', - -'LBL_ADDRESS'=>'Address', - -'LBL_ADD_TAG'=>'Add Tag', - -'LBL_TAG_IT'=>'Tag it', - -'LBL_CLOSE'=>'Close', - -'LNK_ADVANCED_SEARCH'=>'Advanced Search', - -'LNK_BASIC_SEARCH'=>'Basic Search', - -'LNK_EDIT'=>'edit', - -'LNK_REMOVE'=>'rem', - -'LNK_DELETE'=>'del', - -'LNK_LIST_START'=>'Start', - -'LNK_LIST_NEXT'=>'Next', - -'LNK_LIST_PREVIOUS'=>'Previous', - -'LNK_LIST_END'=>'End', - -'LBL_LIST_OF'=>'of', - -'LNK_PRINT'=>'Print', - -'LNK_HELP'=>'Help', - -'LNK_VTDOCS'=>'vtiger Docs', - -'LNK_ABOUT'=>'About', - -'LNK_OUTLOOK'=>'./include/images/outlook_download.gif', - -'LNK_NEW_HDESK'=>'New Ticket', - -'LNK_NEW_PRODUCT'=>'New Product', - -'LNK_NEW_CONTACT'=>'New Contact', - -'LNK_NEW_CAMPAIGN'=>'New Campaign', - -'LNK_NEW_LEAD'=>'New Lead', - -'LNK_NEW_ACCOUNT'=>'New Account', - -'LNK_NEW_OPPORTUNITY'=>'New Potential', - -'LNK_NEW_NOTE'=>'New Note', - -'LNK_NEW_EMAIL'=>'New Email', - -'LNK_NEW_TASK'=>'New Task', - -'LNK_NEW_EVENT'=>'New Event', -'LNK_NEW_QUOTE'=>'New Quote', -'LNK_NEW_PO'=>'New Purchase Order', -'LNK_NEW_SO'=>'New Sales Order', -'LNK_NEW_INVOICE'=>'New Invoice', -'LNK_NEW_VENDOR'=>'New Vendor', -'LNK_NEW_PRICEBOOK'=>'New PriceBook', - - -'NTC_REQUIRED'=>'Indicates required field', - -'LBL_REQUIRED_SYMBOL'=>'*', - -'LBL_CURRENCY_SYMBOL'=>'$', - -'LBL_THOUSANDS_SYMBOL'=>'K', - -'NTC_DATE_FORMAT'=>'(yyyy-mm-dd)', - -'NTC_TIME_FORMAT'=>'(24:00)', - -'NTC_DATE_TIME_FORMAT'=>'(yyyy-mm-dd 24:00)', - -'NTC_DELETE_CONFIRMATION'=>'Are you sure you want to delete this record?', - -'ERR_DELETE_RECORD'=>'A record number must be specified to delete the contact.', - -'ERR_CREATING_TABLE'=>'Error creating table: ', - -'ERR_CREATING_FIELDS'=>'Error filling in additional detail fields: ', - -'ERR_MISSING_REQUIRED_FIELDS'=>'Missing required fields:', - -'ERR_INVALID_EMAIL_ADDRESS'=>'not a valid email address.', - -'ERR_INVALID_DATE_FORMAT'=>'The date format must be: yyyy-mm-dd', - -'ERR_INVALID_MONTH'=>'Please enter a valid month.', - -'ERR_INVALID_DAY'=>'Please enter a valid day.', - -'ERR_INVALID_YEAR'=>'Please enter a valid 4 digit year.', - -'ERR_INVALID_DATE'=>'Please enter a valid date.', - -'ERR_INVALID_HOUR'=>'Please enter a valid hour.', - -'ERR_INVALID_TIME'=>'Please enter a valid time.', - -'NTC_CLICK_BACK'=>'Please click the browser back button and fix the error.', - -'LBL_LIST_ASSIGNED_USER'=>'Assigned To', - -'LBL_ASSIGNED_TO'=>'Assigned To:', - -'LBL_DATE_MODIFIED'=>'Last Modified:', - -'LBL_DATE_ENTERED'=>'Created:', - -'LBL_CURRENT_USER_FILTER'=>'Only my items:', - -'NTC_LOGIN_MESSAGE'=>"Login", - -'LBL_NONE'=>'--None--', - -'LBL_BACK'=>'Back', - -'LBL_IMPORT'=>'Import', - -'LBL_EXPORT'=>'Export', - -'LBL_EXPORT_ALL'=>'Export All', - -'LBL_QUICK_CREATE'=>'Quick Create', - -'Export'=>'Export', -'Import'=>'Import', -'Merge'=>'Merge', -'ConvertLead'=>'ConvertLead', - - -'LBL_SHOW_RESULTS'=>'Show Results in', -'LBL_TOTAL_RECORDS_FOUND'=>'Total Records found :', -'LBL_SEARCH_RESULTS_FOR'=>' -- Search results for ', -'LBL_TAG_SEARCH'=>' -- Tag search for ', -'LBL_NO_DATA'=>'No Data Found', - - -//3.2 release - -'NTC_MERGE_CONFIRMATION'=>'Are you sure you want to merge this record?', - -'LBL_MERGE_BUTTON_TITLE'=>'Merge', - -'LBL_MERGE_BUTTON_KEY'=> 'Merge', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE'=>'Select Email Template', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_KEY'=>'Select Email Template', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL'=>'Select Email Template', - -'LBL_MERGE_BUTTON_LABEL'=>'Merge', - -'LBL_SENDMAIL_BUTTON_TITLE'=>'SendMail', - -'LBL_SENDMAIL_BUTTON_KEY'=> 'SendMail', - -'LBL_SENDMAIL_BUTTON_LABEL'=>'Send Mail', - - - -//Added fields for upload file as attachment -- 4 Beta - -'LBL_UPD_DESC'=>'Description', - -'LBL_FILENAME'=>'File Name', - -'LBL_FILE'=>'File', - -'LBL_TYPE'=>'File Type', - -'LBL_DOWNLOAD'=>'Download Now', - -'LBL_OPERATION'=>'Operation', - -'LBL_GROUP_ALLOCATION_TITLE'=>'My Group Allocation ', - -'LBL_ENTITY_NAME'=>'Entity Name', - -'LBL_GROUP_NAME'=>'Group', - -'LBL_ENTITY_TYPE'=>'Type', - - - -//Added fields for Ticket Attachment in RelatedTicketListUtil - -'LBL_NEW_TICKET'=>'New Ticket', - -'LBL_TITLE'=>'Title', - -'LBL_PRIORITY'=>'Priority', - -'LBL_STATUS'=>'Status', - - - -//Added fields for Change Owner and Change Status in all modules -- after 4 Beta - -'LBL_CHANGE_OWNER'=>'Change Owner', - -'LBL_CHANGE_STATUS'=>'Change Status', - -'LBL_MASS_DELETE'=>'Delete', -//added by raju - -'LBL_ADD_ITEM'=>'Add', - -'LBL_ADD_NEW'=>'Add', - -'LBL_DEDUCT'=>'Deduct', -//Added for version 5 - -'LBL_CALENDAR_TITLE'=>'Open Calendar...', -'LBL_CALENDAR_ALT'=>'Open Calendar...', - -'LBL_CALCULATOR_TITLE'=>'Open Calculator...', -'LBL_CALCULATOR_ALT'=>'Open Calculator...', - -'LBL_CLOCK_TITLE'=>'Show World Clock...', -'LBL_CLOCK_ALT'=>'Show World Clock...', - -'LBL_ALL_MENU_TITLE'=>'Open All Menu...', -'LBL_ALL_MENU_ALT'=>'Open All Menu...', - -'LBL_CHAT_TITLE'=>'Chat...', -'LBL_CHAT_ALT'=>'Chat...', - -'LBL_SEARCH_TITLE'=>'Search in ', -'LBL_SEARCH_ALT'=>'Search in ', - -'LBL_SEARCH_STRING'=>'Search...', - -'LBL_SEARCH_FOR'=>'Search for', -'LBL_SEARCH_NOW_BUTTON'=>'Search Now', -'LBL_GO_TO'=>'Go to', -'LBL_FEWER_BUTTON'=>'Fewer', -'LBL_IN'=>'In', - -'LBL_ADV_SEARCH_MSG_ANY'=>'Match Any of the Following', -'LBL_ADV_SEARCH_MSG_ALL'=>'Match All of the Following', - -'COMBO_ALL'=>'All', - -// Added fields for Related Field Display Informations in Detail View of All Modules - -'LBL_OPEN_ACTIVITIES'=>'Open Activities', - -'LBL_HISTORY'=>'History', - -'LBL_ACTIVITY_HISTORY'=>'Activity History', - -'LBL_ATTACHMENTS'=>'Attachments', - -'LBL_ATTACHMENT'=>'Attachment', - -'LBL_TYPE'=>'Type', - -'LBL_ASSIGNED_TO'=>'Assigned To', - -'LBL_TIME'=>'Time', - -'LBL_ACTION'=>'Action', - -'LBL_SUBJECT'=>'Subject', - -'LBL_RELATED_TO'=>'Related To', - -//added by raju for emails - -'LBL_MULTIPLE'=>'Multiple', - -'LBL_DUE_DATE'=>'Due Date', - -'LBL_LAST_MODIFIED'=>'Last Modified', - -'LBL_CREATED'=>'Created', // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Added - -'LBL_DESCRIPTION'=>'Description', - - - -'LBL_NEW_TASK'=>'New Task', - -'LBL_NEW_EVENT'=>'New Event', - -'LBL_ATTACHMENT_AND_NOTES'=>'Attachments & Notes', - -'LBL_POTENTIAL_NAME'=>'Potential Name', - -'LBL_CONTACT_NAME'=>'Contact Name', - -'LBL_DEPARTMENT'=>'Department', - -'LBL_ROLE'=>'Role', - -'LBL_EMAIL'=>'Email', - -'LBL_PHONE'=>'Phone', - -'LBL_PRODUCT'=>'Product', - -'LBL_AMOUNT'=>'Amount', - -'LBL_CLOSE_DATE'=>'Close Date', - -'LBL_NEW_ATTACHMENT'=>'New Attachment', - -'LBL_NEW_NOTE'=>'New Note', - - - -'LBL_PRODUCT_TITLE'=>'Products', - -'LBL_NEW_PRODUCT'=>'New Product', - -'LBL_PRODUCT_NAME'=>'Product Name', - -'LBL_QUANTITY'=>'Quantity', - -'LBL_SALES_PRICE'=>'Sale Price', - -'LBL_PURCHASE_DATE'=>'Purchase Date', - -'LBL_TICKET_ID'=>'Ticket Id', - -'LBL_NEW_TICKET'=>'New Ticket', - -'LBL_TICKETS'=>'Tickets', - - - -'LBL_POTENTIAL_TITLE'=>'Potentials', - -'LBL_NEW_POTENTIAL'=>'New Potential', - -'LBL_LEAD_NAME'=>'Lead Name', - -'LBL_ACCOUNT_NAME'=>'Account Name', - -'LBL_ACCOUNT_TYPE'=>'Account Type', - -'LBL_USER_TITLE'=>'Users', - -'LBL_CONTACT_TITLE'=>'Contacts', - - - -// 4 GA - -'LBL_SHOWING' => 'Showing', - -// - - - -//Added fields after RC1 - Release - -'LBL_SELECT_PRODUCT_BUTTON_LABEL'=>'Select Product', - -'LBL_VIEW'=>'Filters :', -// Mike Crowe Mod --------------------------------------------------------Added for group sort -'LBL_GROUP_VIEW'=>'Group', - - -'LBL_SALES_STAGE'=>'Sales Stage', - -'LBL_PROBABILITY'=>'Probability', - -'LBL_BULK_MAILS'=>'Bulk Mails', - - - -'LBL_WORLD_CLOCK'=>'World Clock', - -'LBL_CALCULATOR'=>'Calculator', - -'LBL_CLOSE_WON' =>'Closed-Won', # 'Closed Won' -'LBL_CLOSE_LOST'=>'Closed-Lost', # 'Closed Lost' - -'LBL_USER'=>'User', - -'LBL_TEAM'=>'Team', - -'LBL_GROUP'=>'Group', - -'LBL_NONE_NO_LINE'=>'none', - -'LBL_SELECT_GROUP'=>'Select a group', - -'LBL_HOUR_AND_MINUTE'=>'(hours/minutes)', - -'YEAR_MONTH_DATE'=>'24:00', - - - -'COMBO_LEADS'=>'Leads', - -'COMBO_ACCOUNTS'=>'Accounts', - -'COMBO_CONTACTS'=>'Contacts', - -'COMBO_POTENTIALS'=>'Potentials', - -'COMBO_PRODUCTS'=>'Products', - -'COMBO_HELPDESK'=>'Trouble Tickets', - -'COMBO_USERS'=>'Users', - -'COMBO_CAMPAIGNS'=>'Campaigns', - - -'LBL_SELECT'=>'Select', - -'LBL_EDIT'=>'Edit', - -'LBL_DELETE'=>'Delete', - - - -//List Fields - -'Name'=>'Name', - -'Company'=>'Company', - -'Phone'=>'Phone', - -'Website'=>'Website', - -'Email'=>'Email', - -'Assigned To'=>'Assigned To', - -'Account Name'=>'Account Name', - -'City'=>'City', - -'Title'=>'Title', - -'Potential'=>'Potential', - -'Sales Stage'=>'Sales Stage', - -'Amount'=>'Amount', - -'Expected Close'=>'Expected Close', - -'Subject'=>'Subject', - -'Contact Name'=>'Contact Name', - -'Related to'=>'Related To', - -'File'=>'File', - -'Last Modified'=>'Last Modified', - -'Close'=>'Close', - -'Type'=>'Type', - -'Start Date/Due Date'=>'Start Date/Due Date', - -'Date Sent'=>'Date Sent', - -'Ticket ID'=>'Ticket ID', - -'Status'=>'Status', - -'Priority'=>'Priority', - -'Product Name'=>'Product Name', - -'Product Code'=>'Part Number', - -'Commission Rate'=>'Commission Rate', - -'Qty/Unit'=>'Qty/Unit', - -'Unit Price'=>'Unit Price', - -'Question'=>'Question', - -'Category'=>'Category', - -'Price Book Name'=>'Price Book Name', -'LBL_EVENT_ENDDATE'=>'End Date & Time', - -//Added after 4 GA -'LBL_CUSTOM_INFORMATION'=>'Custom Information', - -//Added fields to display the related lists titles and None Scheduled -'LBL_NONE_SCHEDULED'=>'None Scheduled', - -'Leads'=>'Leads', -'Accounts'=>'Accounts', -'Accounts & Contacts'=>'Accounts & Contacts', -'Contacts'=>'Contacts', -'Potentials'=>'Potentials', -'Products'=>'Products', -'Emails'=>'Emails', -'HelpDesk'=>'Trouble Tickets', -'Activities'=>'Activities', -'Events'=>'Events', -'Tasks'=>'Tasks', -'Todo'=>'To Do', -'Call'=>'Call', -'Meeting'=>'Meeting', -'Quotes'=>'Quotes', -'PriceBook'=>'Price Books', -'PurchaseOrder'=>'Purchase Order', -'SalesOrder'=>'Sales Order', -'Invoice'=>'Invoices', -'Calendar'=>'Calendar', -'Home'=>'Home', -'Campaigns'=>'Campaigns', -'PriceBooks'=>'Price Books', -'Notes'=>'Notes', -'Faq'=>'FAQ', -'Dashboards'=>'Dashboard', -'Reports'=>'Reports', -'Vendors'=>'Vendors', -'Rss'=>'RSS', -'Portal'=>'My Sites', -'Webmails'=>'Webmails', -'Attachments'=>'Attachments', -'Activity History'=>'Activity History', -'Ticket History'=>'Ticket History', -'Purchase Order'=>'Purchase Order', -'Sales Stage History'=>'Sales Stage History', -'Users'=>'Users', -'Admin'=>'Admin', -'PurchaseOrder Status History'=>'PurchaseOrder Status History', -'SalesOrder Status History'=>'SalesOrder Status History', -'Quote Stage History'=>'Quote Stage History', -'Invoice Status History'=>'Invoice Status History', -'LBL_TROUBLE_TICKET'=>'Trouble Ticket', - -//Added language for Parent Tab - -'My Home Page'=>'My Home Page', -'Marketing'=>'Marketing', -'Sales'=>'Sales', -'Support'=>'Support', -'Analytics'=>'Analytics', -'Inventory'=>'Inventory', -'Tools'=>'Tools', -'Settings'=>'Settings', - -'LBL_INFORMATION'=>'Information', -'LBL_MORE'=>'More', -'LBL_BASIC'=>'Basic', -'LBL_CREATING'=>'Creating', -'LBL_EDITING'=>'Editing', -'LBL_NEW'=>'New', - -//Added for Detail/Edit/Related List of all modules - -'Lead'=>'Lead', -'Account'=>'Account', -'Contact'=>'Contact', -'Potential'=>'Potential', -'Opportunity'=>'Potential', -'Product'=>'Product', -'Email'=>'Email', -'Activity'=>'Activity', -'Event'=>'Event', -'Task'=>'Task', -'Quote'=>'Quote', -'PriceBook'=>'PriceBook', -'PurchaseOrder'=>'Purchase Order', -'Ticket'=>'Ticket', -'SalesOrder'=>'Sales Orders', -'Campaign'=>'Campaign', -'Note'=>'Note', -'Dashboard'=>'Dashboards', -'Report'=>'Report', -'Vendor'=>'Vendor', -'Webmail'=>'Webmail', - -'LBL_NONE_INCLUDED'=>'None Included', -'LBL_ADD_TO'=>'Add to', - -'LBL_SELECT_TEMPLATE_TO_MAIL_MERGE'=>'Select template to Mail Merge:', -'LBL_TITLE_OR_DESCRIPTION'=>'Title / Description', - -//Added for RSS Module -'LBL_RSS_FEEDS'=>'RSS Feeds', -'LBL_ADD_RSS_FEEDS'=>'Add New RSS Feed', - -//Added fields after 4.2 alpha -'COMBO_ACCOUNTS'=>'Accounts', -'LNK_NEW_FAQ'=>'New FAQ', -'Vendor Name'=>'Vendor Name', -'LNK_WEARE'=>'About us', -'LBL_ABOUTUS_TITLE'=>'vtiger CRM - About Us', -'LBL_DISCUSS'=>'Discuss with other users', -'Quote Stage'=>'Quote Stage', -'Potential Name'=>'Potential Name', -'Total'=>'Total Amount', -'First Name'=>'First Name', -'Last Name'=>'Last Name', -'User Name'=>'User Name', - /* For purchase order related list in vendor */ -'LBL_PORDER_BUTTON_TITLE'=>'New Purchase Order [Alt+O]', -'LBL_PORDER_BUTTON'=>'New Purchase Order', -'LBL_PORDER_BUTTON_KEY'=>'O', -'Tracking Number'=>'Tracking Number', -'Order Id'=>'Order Id', -'Quote Name'=>'Quote Name', -'Invoice Id'=>'Invoice Id', -'Quote Id'=>'Quote Id', -'Sales Order'=>'Sales Order', - // Added Quote in activity parent type selection / Related list -'COMBO_QUOTES'=>'Quotes', -'End Date'=>'End Date', -'Start Date'=>'Start Date', -'Related to'=>'Related To', -'Recurring Type'=> 'Recurring Type', -'SalesOrders'=> 'Sales Order', -'PurchaseOrder'=> 'Purchase Orders', -'LBL_QUOTE_NAME'=>'Quote Name', - //Added Orders in activity parent type selection / Related list -'LBL_NEW_QUOTE_BUTTON_TITLE'=>'New Quote [Alt+Q]', -'LBL_NEW_QUOTE_BUTTON_KEY'=>'Q', -'LBL_NEW_QUOTE_BUTTON'=>'New Quote', -'COMBO_PORDER'=>'Purchase Order', -'COMBO_SORDER'=>'Sales Order', -'LBL_PORDER_NAME'=>'Purchase Order', -'LBL_SORDER_NAME'=>'Sales Order', - // Added Invoice in activity parent type selection / Related list -'COMBO_INVOICES'=>'Invoice', -'LBL_INVOICE_NAME'=>'Invoice', -'LBL_HELPDESK_NAME'=>'Trouble Ticket', -'LBL_CAMPAIGN_NAME'=>'Campaign Name', - -'LBL_NEW_INVOICE_BUTTON_TITLE'=>'New Invoice [Alt+I]', -'LBL_NEW_INVOICE_BUTTON_KEY'=>'I', -'LBL_NEW_INVOICE_BUTTON'=>'New Invoice', -'LBL_NEW_SORDER_BUTTON_TITLE'=>'New Sales Order [Alt+E]', -'LBL_NEW_SORDER_BUTTON_KEY'=>'E', -'LBL_NEW_SORDER_BUTTON'=>'New Sales Order', - -'LBL_PRODUCT_DETAILS'=>'Product Details', -'LBL_PRODUCT'=>'Product', -'LBL_QTY_IN_STOCK'=>'Qty In Stock', -'LBL_QTY'=>'Qty', -'LBL_UNIT_PRICE'=>'Unit Price', -'LBL_LIST_PRICE'=>'List Price', -'LBL_TOTAL'=>'Total', -'LBL_ADD_PRODUCT'=>'Add Product', -'LBL_SUB_TOTAL'=>'Sub Total', -'LBL_TAX'=>'Tax', -'LBL_ADJUSTMENT'=>'Adjustment', -'LBL_GRAND_TOTAL'=>'Grand Total', -'LBL_QUOTE_ID'=>'Quote Id', -'LBL_SALES_ORDER_ID'=>'Sales Order Id', -'LBL_PURCHASE_ORDER_ID'=>'Purchase Order Id', -'LBL_EXPORT_TO_PDF'=>'Export To PDF', - -//Added for 4.2 Patch I -'LBL_HOME_KEY_METRICS'=>'Key Metrics', -'LBL_HOME_METRICS'=>'Metrics', -'LBL_HOME_COUNT'=>'Count', - -//Added for 4.2 patch 2 -'LBL_JSCALENDAR_LANG'=>'en', -'LNK_CV_EDIT'=>'Edit', -'LNK_CV_DELETE'=>'Delete', -'LNK_CV_CREATEVIEW'=>'New', -//Added for 5.0 -'LBL_UPD_FIELD_ORD'=>'Update Field Order', -'LBL_SEND_CUSTOM_MAIL_BUTTON'=>'Send Custom Mail', -'LBL_UPDATED_TODAY'=>'Updated today', -'LBL_UPDATED'=>'Updated', -'LBL_DAY_AGO'=>'day ago', -'LBL_DAYS_AGO'=>'days ago', - -//Added to convert Month string in update info - ahmed - -'Jan'=>'Jan', -'Feb'=>'Feb', -'Mar'=>'Mar', -'Apr'=>'Apr', -'May'=>'May', -'Jun'=>'Jun', -'Jul'=>'Jul', -'Aug'=>'Aug', -'Sep'=>'Sep', -'Oct'=>'Oct', -'Nov'=>'Nov', -'Dec'=>'Dec', - -//Added after 5.0 Alpha5 -'Campaign Name'=>'Campaign Name', -'Campaign Type'=>'Campaign Type', -'Campaign Status'=>'Campaign Status', -'Expected Revenue'=>'Expected Revenue', -'Expected Close Date'=>'Expected Close Date', -'LBL_ACTIONS'=>'Actions', -'LBL_SEND'=>'Send', -'LBL_VAT'=>'VAT', -'LBL_SALES'=>'Sales', -'LBL_SERVICE'=>'Service', -'LBL_TAX_DETAILS'=>'Tax Details', -'LBL_TAX_CALCULATION'=>'Tax Calculation', -'COVERED_PERCENTAGE'=>'(%)', - -'LBL_TAG_CLOUD'=>'Tag Cloud', -'LBL_FOR'=>'for', -'LBL_PO_STATUS'=>'PurchaseOrder Status', -'LBL_SO_STATUS'=>'SalesOrder Status', -'LBL_INVOICE_STATUS'=>'Invoice Status', -'LBL_NOTE'=>'Note', -'LBL_MODULE'=>'Module', -'Active'=>'Active', -'Inactive'=>'Inactive', -'Today'=>'Today', -'Last 2 Days'=>'Last 2 Days', -'Last Week'=>'Last Week', -'This Week'=>'This Week', -'This Month'=>'This Month', -'This Year'=>'This Year', -'LBL_PLEASE_CLICK'=>'Please Click', -'LBL_TO_CONFIGURE'=>'to Configure', -'LBL_HERE'=>'here', -'LBL_RECORDS'=>'Records', -'LBL_SCROLL'=>'[Scroll to Top]', -'LBL_EXPAND_COLLAPSE'=>'Expand/Collapse', -'LBL_RCPY_ADDRESS'=>'Copy Shipping address', -'LBL_LCPY_ADDRESS'=>'Copy Billing address', -'LBL_RECORD_ID'=>'Record ID', -'LBL_ACTION_DATE'=>'Action Date', -'LBL_HOMEPAGE_DASHBOARD'=>'HomePage Dashboard', -'LBL_NO'=>'No', -'LBL_FOUND'=>'Found', -'LBL_YOU_CAN_CREATE'=>'You can Create', -'LBL_NOW'=>'now', -'LBL_CLICK_THE_LINK'=>'Click the link below', -'LBL_CREATE'=>'Create', -'LBL_A'=>'a', -'LBL_AN'=>'an', -'LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE'=>'You are not allowed to create', -'LBL_TRANSFER_OWNERSHIP'=>'Transfer Ownership to', -'LBL_SELECT_STATUS'=>'Select New Status', -'LBL_UPDATE_OWNER'=>'Update Owner', -'LBL_UPDATE_STATUS'=>'Update Status', - -//added for tax calculations - after 5beta2 -'LBL_NET_PRICE'=>'Net Price', -'LBL_TOOLS'=>'Tools', -'LBL_DISCOUNT'=>'Discount', -'LBL_TOTAL_AFTER_DISCOUNT'=>'Total After Discount', -'LBL_NET_TOTAL'=>'Net Total', -'LBL_SHIPPING_AND_HANDLING_CHARGES'=>'Shipping & Handling Charges', -'LBL_TAX_FOR_SHIPPING_AND_HANDLING'=>'Taxes For Shipping and Handling', -'LBL_FINISH'=>'Finish', -'LBL_IMAGE_DELETED'=>'Image Deleted', -'LBL_TAX_MODE'=>'Tax Mode', -'LBL_CLEAR_COMMENT'=>'Clear Comment', -'LBL_ZERO_DISCOUNT'=>'Zero Discount', -'LBL_OF_PRICE'=>'of Price', -'LBL_DIRECT_PRICE_REDUCTION'=>'Direct Price Reduction', -'LBL_INDIVIDUAL'=>'Individual', - -//Added the address strings for Contacts Module -'LBL_CPY_MAILING_ADDRESS'=>'Copy Mailing Address', -'LBL_CPY_OTHER_ADDRESS'=>'Copy Other Address', - -'LBL_PERMISSION'=>'You are not permitted to execute this Operation', -'VTIGER'=>'vtiger', - -//Added for Inventory Tax details -'LBL_DIRECT_AMOUNT_DISCOUNT'=>'Direct Amount Discount', -'LBL_NO_DISCOUNT_FOR_THIS_PRODUCT'=>'No Discount for this Product', -'LBL_TOTAL_TAX_AMOUNT'=>'Total Tax Amount', -'LBL_FINAL_DISCOUNT_AMOUNT'=>'Final Discount Amount', -'LBL_SHIPPING_AND_HANDLING_CHARGE'=>'Shipping & Handling Charge', -'LBL_GO_BACK'=>'Go Back', - -//Record deleted message -'LBL_RECORD_DELETE'=>'The record you are trying to view has been deleted.', -); - - - -//the left value is the key stored in the db and the right value is the display value - -//to translate, only modify the right value in each key/value pair - -$app_list_strings = Array( - -//e.g. auf Deutsch 'Contacts'=>'Contakten', - -'moduleList' => Array('Home'=>'Home' - - , 'Dashboard'=>'Dashboard' - - , 'Leads'=>'Leads' - - , 'Contacts'=>'Contacts' - - , 'Accounts'=>'Accounts' - - , 'Potentials'=>'Potentials' - - , 'Campaigns'=>'Campaigns' - - , 'Notes'=>'Notes' - - , 'Emails'=>'Emails' - - , 'Activities'=>'Activities' - - , 'Products'=>'Products' - - , 'HelpDesk'=>'Trouble Tickets' - - , 'Faq'=>'FAQ' - - , 'Calendar'=>'Calendar' - - , 'Quotes'=>'Quotes' - - , 'PurchaseOrder'=>'PurchaseOrder' - - , 'Invoice'=>'Invoice' - - , 'Rss'=>'RSS' - - , 'Reports'=>'Reports' - - , 'Vendors'=>'Vendors' - - , 'PriceBooks'=>'PriceBooks' - - , 'SalesOrder'=>'SalesOrder' - - , 'Portal'=>'My Sites' - - ), - - - -//Note: do not translate opportunity_relationship_type_default_key - -// it is the key for the default opportunity_relationship_type_dom value - -'opportunity_relationship_type_default_key' => 'Primary Decision Maker', - -'opportunity_relationship_type_dom' => Array(''=>'' - - , 'Primary Decision Maker'=>'Primary Decision Maker' - - , 'Business Decision Maker'=>'Business Decision Maker' - - , 'Business Evaluator'=>'Business Evaluator' - - , 'Technical Decision Maker'=>'Technical Decision Maker' - - , 'Technical Evaluator'=>'Technical Evaluator' - - , 'Executive Sponsor'=>'Executive Sponsor' - - , 'Influencer'=>'Influencer' - - , 'Other'=>'Other' - - ), - - - -//Note: do not translate case_relationship_type_default_key - -// it is the key for the default case_relationship_type_dom value - -'case_relationship_type_default_key' => 'Primary Contact', - -'case_relationship_type_dom' => Array(''=>'' - - , 'Primary Contact'=>'Primary Contact' - - , 'Alternate Contact'=>'Alternate Contact' - - ), - - - -'task_priority_dom' => Array('High'=>'High' - - , 'Medium'=>'Medium' - - , 'Low'=>'Low' - - ), - - - -'task_status_dom' => Array('Planned'=>'Planned' - - , 'Completed'=>'Completed' - - , 'Deferred'=>'Deferred' - - ), - - - -'meeting_status_dom' => Array('Planned'=>'Planned' - - , 'Held'=>'Held' - - , 'Not Held'=>'Not Held' - - ), - - - -'call_status_dom' => Array('Planned'=>'Planned' - - , 'Held'=>'Held' - - , 'Not Held'=>'Not Held' - - ), - - - -//Note: do not translate case_status_default_key - -// it is the key for the default case_status_dom value - -'case_status_default_key' => 'New', - -'case_status_dom' => Array('New'=>'New' - - , 'Assigned'=>'Assigned' - - , 'Closed'=>'Closed' - - , 'Pending Input'=>'Pending Input' - - , 'Rejected'=>'Rejected' - - ), - - - -'user_status_dom' => Array('Active'=>'Active' - - , 'Inactive'=>'Inactive' - - ), - - - -//Note: do not translate record_type_default_key - -// it is the key for the default record_type_module value - -'record_type_default_key' => 'Accounts', - -'record_type_display' => array('Accounts' => 'Account', - - 'Leads' => 'Lead', - - 'Opportunities' => 'Opportunity'), - -); - - - -?> +'ISO-8859-1', + +'LBL_BROWSER_TITLE'=>'vtiger CRM 5 - Commercial Open Source CRM', + +'LBL_MY_ACCOUNT'=>'My Account', + +'LBL_MY_PREFERENCES'=>'My Preferences', + +'LBL_ADMIN'=>'Admin', + +'LBL_LOGOUT'=>'Sign out', + +'LBL_SEARCH'=>'Search', + +'LBL_LAST_VIEWED'=>'Last Viewed', + +'LBL_TODAY'=>'Today', + +'LBL_ALL'=>'All', + +'LBL_SHOW'=>'Show :', + +'today'=>"Today's", + +'all'=>'All', + +'LBL_UPCOMING_EVENTS'=>'Upcoming Activities', + +'LBL_PENDING_EVENTS'=>'Pending Activities', + +'NTC_WELCOME_MESSAGE'=>"Welcome to vtiger CRM!", + +'NTC_DESCRIPTION'=>"Use a valid username and password to login to the vtiger CRM.", + +'NTC_WELCOME'=>'Welcome', + +'NTC_NO_ITEMS_DISPLAY'=>'none', + +'LBL_OR'=>'or', + +'LBL_ALT_HOT_KEY'=>'Alt+', +//added for 4.2 +'LBL_SAVE_LABEL'=>'Save', + +'LBL_SEND_MAIL_BUTTON'=>'Send Mail', + + +'LBL_SAVE_BUTTON_TITLE'=>'Save [Alt+S]', + +'LBL_EDIT_BUTTON_TITLE'=>'Edit [Alt+E]', + +'LBL_CONVERTSO_BUTTON_TITLE'=>'Create SalesOrder', +'LBL_CONVERTINVOICE_BUTTON_TITLE'=>'Create Invoice', + +'LBL_EDIT_BUTTON'=>'Edit', + +'LBL_DUPLICATE_BUTTON_TITLE'=>'Duplicate [Alt+U]', + +'LBL_DUPLICATE_BUTTON'=>'Duplicate', + +'LBL_TABCUSTOMISE_BUTTON_TITLE'=>'Customise [Alt+C]', + +'LBL_FORUM_HIDE_BUTTON_TITLE'=>'Hide Forum [Alt+I]', + +'LBL_FORUM_HIDE_BUTTON_KEY'=>'H', + +'LBL_FORUM_SHOW_BUTTON_TITLE'=>'Show Forum [Alt+W]', + +'LBL_FORUM_SHOW_BUTTON_KEY'=>'W', + +'LBL_TABCUSTOMISE_BUTTON'=>'Customise', + +'LBL_DELETE_BUTTON_TITLE'=>'Delete [Alt+D]', + +'LBL_DELETE_BUTTON'=>'Delete', + +'LBL_FIND_BUTTON'=>'Find', + +'LBL_CONVERT_BUTTON_TITLE'=>'Convert [Alt+C]', + +'LBL_CONVERT_BUTTON_KEY'=>'C', + +'LBL_CONVERT_BUTTON_LABEL'=>'Convert Lead', + +'LBL_TABCUSTOMISE_BUTTON_KEY'=>'C', + +'LBL_TABCUSTOMISE_BUTTON_LABEL'=>'Customize Tab', + +'LBL_ROLES_BUTTON_LABEL'=>'Show Roles', + +'LBL_LISTROLES_BUTTON_LABEL'=>'List Roles', + +'LBL_FORUM_HIDE_BUTTON_LABEL'=>'Hide Forums', + +'LBL_FORUM_SHOW_BUTTON_LABEL'=>'Show Forums', + +'LBL_NEW_BUTTON_TITLE'=>'New [Alt+N]', + +'LBL_CHANGE_BUTTON_TITLE'=>'Change [Alt+G]', + +'LBL_CANCEL_BUTTON_TITLE'=>'Cancel [Alt+X]', + +'LBL_SEARCH_BUTTON_TITLE'=>'Search [Alt+Q]', + +'LBL_CLEAR_BUTTON_TITLE'=>'Clear [Alt+C]', + +'LBL_SELECT_BUTTON_TITLE'=>'Select [Alt+T]', + +'LBL_CREATE_BUTTON_LABEL' =>'Create', + +'LBL_GENERATE'=>'Generate', + +'LBL_SAVE_BUTTON_KEY'=>'S', + +'LBL_EDIT_BUTTON_KEY'=>'E', +'LBL_CONVERTSO_BUTTON_KEY'=>'S', +'LBL_CONVERTINVOICE_BUTTON_KEY'=>'I', + +'LBL_DUPLICATE_BUTTON_KEY'=>'U', + +'LBL_DELETE_BUTTON_KEY'=>'D', + +'LBL_NEW_BUTTON_KEY'=>'N', + +'LBL_CHANGE_BUTTON_KEY'=>'G', + +'LBL_CANCEL_BUTTON_KEY'=>'X', + +'LBL_SEARCH_BUTTON_KEY'=>'Q', + +'LBL_CLEAR_BUTTON_KEY'=>'C', + +'LBL_SELECT_BUTTON_KEY'=>'T', + +'LBL_SAVE_BUTTON_LABEL'=>'Save', + +'LBL_EDIT_BUTTON_LABEL'=>'Edit', +'LBL_CONVERTSO_BUTTON_LABEL'=>'Create SalesOrder', +'LBL_CONVERTINVOICE_BUTTON_LABEL'=>'Create Invoice', + +'LBL_DUPLICATE_BUTTON_LABEL'=>'Duplicate', + +'LBL_DELETE_BUTTON_LABEL'=>'Delete', + +'LBL_NEW_BUTTON_LABEL'=>'New', + +'LBL_CHANGE_BUTTON_LABEL'=>'Change', + +'LBL_CANCEL_BUTTON_LABEL'=>'Cancel', + +'LBL_SEARCH_BUTTON_LABEL'=>'Search', + +'LBL_CLEAR_BUTTON_LABEL'=>'Clear', + +'LBL_SELECT_BUTTON_LABEL'=>'Select', + +'LBL_SELECT_CONTACT_BUTTON_TITLE'=>'Select Contact [Alt+T]', + +'LBL_SELECT_CONTACT_BUTTON_KEY'=>'T', + +'LBL_SELECT_CONTACT_BUTTON_LABEL'=>'Select Contact', + +'LBL_SELECT_CAMPAIGN_BUTTON_LABEL'=>'Select Campaign', + +'LBL_SELECT_USER_BUTTON_TITLE'=>'Select User [Alt+U]', + +'LBL_SELECT_USER_BUTTON_KEY'=>'U', + +'LBL_SELECT_USER_BUTTON_LABEL'=>'Select User', + +'LBL_SETTINGS'=>'Settings', + +'LBL_LIST_USERIP'=>'User IP', + +'LBL_LIST_SIGNIN'=>'Sign in Time', + +'LBL_LIST_SIGNOUT'=>'Sign out Time', + +'LBL_LIST_STATUS'=>'Status', + + + +'LBL_LIST_NAME'=>'Name', + +'LBL_LIST_USER_NAME'=>'User Name', + +'LBL_LIST_EMAIL'=>'Email', + +'LBL_LIST_PHONE'=>'Phone', + +'LBL_LIST_CONTACT_NAME'=>'Contact Name', + +'LBL_LIST_ACCOUNT_NAME'=>'Account Name', + +'LBL_USER_LIST'=>'User List', + +'LBL_CONTACT_LIST'=>'Contact List', + +'LBL_LNK_SETTINGS'=> 'Settings', + +'LNK_IMPORT_LEADS'=>'Import Leads', + +'LBL_LOCATE_MAP'=>'Locate Map', + +'LBL_ADDRESS'=>'Address', + +'LBL_ADD_TAG'=>'Add Tag', + +'LBL_TAG_IT'=>'Tag it', + +'LBL_CLOSE'=>'Close', + +'LNK_ADVANCED_SEARCH'=>'Advanced Search', + +'LNK_BASIC_SEARCH'=>'Basic Search', + +'LNK_EDIT'=>'edit', + +'LNK_REMOVE'=>'rem', + +'LNK_DELETE'=>'del', + +'LNK_LIST_START'=>'Start', + +'LNK_LIST_NEXT'=>'Next', + +'LNK_LIST_PREVIOUS'=>'Previous', + +'LNK_LIST_END'=>'End', + +'LBL_LIST_OF'=>'of', + +'LNK_PRINT'=>'Print', + +'LNK_HELP'=>'Help', + +'LNK_VTDOCS'=>'vtiger Docs', + +'LNK_ABOUT'=>'About', + +'LNK_OUTLOOK'=>'./include/images/outlook_download.gif', + +'LNK_NEW_HDESK'=>'New Ticket', + +'LNK_NEW_PRODUCT'=>'New Product', + +'LNK_NEW_CONTACT'=>'New Contact', + +'LNK_NEW_CAMPAIGN'=>'New Campaign', + +'LNK_NEW_LEAD'=>'New Lead', + +'LNK_NEW_ACCOUNT'=>'New Account', + +'LNK_NEW_OPPORTUNITY'=>'New Potential', + +'LNK_NEW_NOTE'=>'New Note', + +'LNK_NEW_EMAIL'=>'New Email', + +'LNK_NEW_TASK'=>'New Task', + +'LNK_NEW_EVENT'=>'New Event', +'LNK_NEW_QUOTE'=>'New Quote', +'LNK_NEW_PO'=>'New Purchase Order', +'LNK_NEW_SO'=>'New Sales Order', +'LNK_NEW_INVOICE'=>'New Invoice', +'LNK_NEW_VENDOR'=>'New Vendor', +'LNK_NEW_PRICEBOOK'=>'New PriceBook', + + +'NTC_REQUIRED'=>'Indicates required field', + +'LBL_REQUIRED_SYMBOL'=>'*', + +'LBL_CURRENCY_SYMBOL'=>'$', + +'LBL_THOUSANDS_SYMBOL'=>'K', + +'NTC_DATE_FORMAT'=>'(yyyy-mm-dd)', + +'NTC_TIME_FORMAT'=>'(24:00)', + +'NTC_DATE_TIME_FORMAT'=>'(yyyy-mm-dd 24:00)', + +'NTC_DELETE_CONFIRMATION'=>'Are you sure you want to delete this record?', + +'ERR_DELETE_RECORD'=>'A record number must be specified to delete the contact.', + +'ERR_CREATING_TABLE'=>'Error creating table: ', + +'ERR_CREATING_FIELDS'=>'Error filling in additional detail fields: ', + +'ERR_MISSING_REQUIRED_FIELDS'=>'Missing required fields:', + +'ERR_INVALID_EMAIL_ADDRESS'=>'not a valid email address.', + +'ERR_INVALID_DATE_FORMAT'=>'The date format must be: yyyy-mm-dd', + +'ERR_INVALID_MONTH'=>'Please enter a valid month.', + +'ERR_INVALID_DAY'=>'Please enter a valid day.', + +'ERR_INVALID_YEAR'=>'Please enter a valid 4 digit year.', + +'ERR_INVALID_DATE'=>'Please enter a valid date.', + +'ERR_INVALID_HOUR'=>'Please enter a valid hour.', + +'ERR_INVALID_TIME'=>'Please enter a valid time.', + +'NTC_CLICK_BACK'=>'Please click the browser back button and fix the error.', + +'LBL_LIST_ASSIGNED_USER'=>'Assigned To', + +'LBL_ASSIGNED_TO'=>'Assigned To:', + +'LBL_DATE_MODIFIED'=>'Last Modified:', + +'LBL_DATE_ENTERED'=>'Created:', + +'LBL_CURRENT_USER_FILTER'=>'Only my items:', + +'NTC_LOGIN_MESSAGE'=>"Login", + +'LBL_NONE'=>'--None--', + +'LBL_BACK'=>'Back', + +'LBL_IMPORT'=>'Import', + +'LBL_EXPORT'=>'Export', + +'LBL_EXPORT_ALL'=>'Export All', + +'LBL_QUICK_CREATE'=>'Quick Create', + +'Export'=>'Export', +'Import'=>'Import', +'Merge'=>'Merge', +'ConvertLead'=>'ConvertLead', + + +'LBL_SHOW_RESULTS'=>'Show Results in', +'LBL_TOTAL_RECORDS_FOUND'=>'Total Records found :', +'LBL_SEARCH_RESULTS_FOR'=>' -- Search results for ', +'LBL_TAG_SEARCH'=>' -- Tag search for ', +'LBL_NO_DATA'=>'No Data Found', + + +//3.2 release + +'NTC_MERGE_CONFIRMATION'=>'Are you sure you want to merge this record?', + +'LBL_MERGE_BUTTON_TITLE'=>'Merge', + +'LBL_MERGE_BUTTON_KEY'=> 'Merge', + +'LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE'=>'Select Email Template', + +'LBL_SELECTEMAILTEMPLATE_BUTTON_KEY'=>'Select Email Template', + +'LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL'=>'Select Email Template', + +'LBL_MERGE_BUTTON_LABEL'=>'Merge', + +'LBL_SENDMAIL_BUTTON_TITLE'=>'SendMail', + +'LBL_SENDMAIL_BUTTON_KEY'=> 'SendMail', + +'LBL_SENDMAIL_BUTTON_LABEL'=>'Send Mail', + + + +//Added fields for upload file as attachment -- 4 Beta + +'LBL_UPD_DESC'=>'Description', + +'LBL_FILENAME'=>'File Name', + +'LBL_FILE'=>'File', + +'LBL_TYPE'=>'File Type', + +'LBL_DOWNLOAD'=>'Download Now', + +'LBL_OPERATION'=>'Operation', + +'LBL_GROUP_ALLOCATION_TITLE'=>'My Group Allocation ', + +'LBL_ENTITY_NAME'=>'Entity Name', + +'LBL_GROUP_NAME'=>'Group', + +'LBL_ENTITY_TYPE'=>'Type', + + + +//Added fields for Ticket Attachment in RelatedTicketListUtil + +'LBL_NEW_TICKET'=>'New Ticket', + +'LBL_TITLE'=>'Title', + +'LBL_PRIORITY'=>'Priority', + +'LBL_STATUS'=>'Status', + + + +//Added fields for Change Owner and Change Status in all modules -- after 4 Beta + +'LBL_CHANGE_OWNER'=>'Change Owner', + +'LBL_CHANGE_STATUS'=>'Change Status', + +'LBL_MASS_DELETE'=>'Delete', +//added by raju + +'LBL_ADD_ITEM'=>'Add', + +'LBL_ADD_NEW'=>'Add', + +'LBL_DEDUCT'=>'Deduct', +//Added for version 5 + +'LBL_CALENDAR_TITLE'=>'Open Calendar...', +'LBL_CALENDAR_ALT'=>'Open Calendar...', + +'LBL_CALCULATOR_TITLE'=>'Open Calculator...', +'LBL_CALCULATOR_ALT'=>'Open Calculator...', + +'LBL_CLOCK_TITLE'=>'Show World Clock...', +'LBL_CLOCK_ALT'=>'Show World Clock...', + +'LBL_ALL_MENU_TITLE'=>'Open All Menu...', +'LBL_ALL_MENU_ALT'=>'Open All Menu...', + +'LBL_CHAT_TITLE'=>'Chat...', +'LBL_CHAT_ALT'=>'Chat...', + +'LBL_SEARCH_TITLE'=>'Search in ', +'LBL_SEARCH_ALT'=>'Search in ', + +'LBL_SEARCH_STRING'=>'Search...', + +'LBL_SEARCH_FOR'=>'Search for', +'LBL_SEARCH_NOW_BUTTON'=>'Search Now', +'LBL_GO_TO'=>'Go to', +'LBL_FEWER_BUTTON'=>'Fewer', +'LBL_IN'=>'In', + +'LBL_ADV_SEARCH_MSG_ANY'=>'Match Any of the Following', +'LBL_ADV_SEARCH_MSG_ALL'=>'Match All of the Following', + +'COMBO_ALL'=>'All', + +// Added fields for Related Field Display Informations in Detail View of All Modules + +'LBL_OPEN_ACTIVITIES'=>'Open Activities', + +'LBL_HISTORY'=>'History', + +'LBL_ACTIVITY_HISTORY'=>'Activity History', + +'LBL_ATTACHMENTS'=>'Attachments', + +'LBL_ATTACHMENT'=>'Attachment', + +'LBL_TYPE'=>'Type', + +'LBL_ASSIGNED_TO'=>'Assigned To', + +'LBL_TIME'=>'Time', + +'LBL_ACTION'=>'Action', + +'LBL_SUBJECT'=>'Subject', + +'LBL_RELATED_TO'=>'Related To', + +//added by raju for emails + +'LBL_MULTIPLE'=>'Multiple', + +'LBL_DUE_DATE'=>'Due Date', + +'LBL_LAST_MODIFIED'=>'Last Modified', + +'LBL_CREATED'=>'Created', // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Added + +'LBL_DESCRIPTION'=>'Description', + + + +'LBL_NEW_TASK'=>'New Task', + +'LBL_NEW_EVENT'=>'New Event', + +'LBL_ATTACHMENT_AND_NOTES'=>'Attachments & Notes', + +'LBL_POTENTIAL_NAME'=>'Potential Name', + +'LBL_CONTACT_NAME'=>'Contact Name', + +'LBL_DEPARTMENT'=>'Department', + +'LBL_ROLE'=>'Role', + +'LBL_EMAIL'=>'Email', + +'LBL_PHONE'=>'Phone', + +'LBL_PRODUCT'=>'Product', + +'LBL_AMOUNT'=>'Amount', + +'LBL_CLOSE_DATE'=>'Close Date', + +'LBL_NEW_ATTACHMENT'=>'New Attachment', + +'LBL_NEW_NOTE'=>'New Note', + + + +'LBL_PRODUCT_TITLE'=>'Products', + +'LBL_NEW_PRODUCT'=>'New Product', + +'LBL_PRODUCT_NAME'=>'Product Name', + +'LBL_QUANTITY'=>'Quantity', + +'LBL_SALES_PRICE'=>'Sale Price', + +'LBL_PURCHASE_DATE'=>'Purchase Date', + +'LBL_TICKET_ID'=>'Ticket Id', + +'LBL_NEW_TICKET'=>'New Ticket', + +'LBL_TICKETS'=>'Tickets', + + + +'LBL_POTENTIAL_TITLE'=>'Potentials', + +'LBL_NEW_POTENTIAL'=>'New Potential', + +'LBL_LEAD_NAME'=>'Lead Name', + +'LBL_ACCOUNT_NAME'=>'Account Name', + +'LBL_ACCOUNT_TYPE'=>'Account Type', + +'LBL_USER_TITLE'=>'Users', + +'LBL_CONTACT_TITLE'=>'Contacts', + + + +// 4 GA + +'LBL_SHOWING' => 'Showing', + +// + + + +//Added fields after RC1 - Release + +'LBL_SELECT_PRODUCT_BUTTON_LABEL'=>'Select Product', + +'LBL_VIEW'=>'Filters :', +// Mike Crowe Mod --------------------------------------------------------Added for group sort +'LBL_GROUP_VIEW'=>'Group', + + +'LBL_SALES_STAGE'=>'Sales Stage', + +'LBL_PROBABILITY'=>'Probability', + +'LBL_BULK_MAILS'=>'Bulk Mails', + + + +'LBL_WORLD_CLOCK'=>'World Clock', + +'LBL_CALCULATOR'=>'Calculator', + +'LBL_CLOSE_WON' =>'Closed Won', # 'Closed Won' +'LBL_CLOSE_LOST'=>'Closed Lost', # 'Closed Lost' + +'LBL_USER'=>'User', + +'LBL_TEAM'=>'Team', + +'LBL_GROUP'=>'Group', + +'LBL_NONE_NO_LINE'=>'none', + +'LBL_SELECT_GROUP'=>'Select a group', + +'LBL_HOUR_AND_MINUTE'=>'(hours/minutes)', + +'YEAR_MONTH_DATE'=>'24:00', + + + +'COMBO_LEADS'=>'Leads', + +'COMBO_ACCOUNTS'=>'Accounts', + +'COMBO_CONTACTS'=>'Contacts', + +'COMBO_POTENTIALS'=>'Potentials', + +'COMBO_PRODUCTS'=>'Products', + +'COMBO_HELPDESK'=>'Trouble Tickets', + +'COMBO_USERS'=>'Users', + +'COMBO_CAMPAIGNS'=>'Campaigns', + + +'LBL_SELECT'=>'Select', + +'LBL_EDIT'=>'Edit', + +'LBL_DELETE'=>'Delete', + + + +//List Fields + +'Name'=>'Name', + +'Company'=>'Company', + +'Phone'=>'Phone', + +'Website'=>'Website', + +'Email'=>'Email', + +'Assigned To'=>'Assigned To', + +'Account Name'=>'Account Name', + +'City'=>'City', + +'Title'=>'Title', + +'Potential'=>'Potential', + +'Sales Stage'=>'Sales Stage', + +'Amount'=>'Amount', + +'Expected Close'=>'Expected Close', + +'Subject'=>'Subject', + +'Contact Name'=>'Contact Name', + +'Related to'=>'Related To', + +'File'=>'File', + +'Last Modified'=>'Last Modified', + +'Close'=>'Close', + +'Type'=>'Type', + +'Start Date/Due Date'=>'Start Date/Due Date', + +'Date Sent'=>'Date Sent', + +'Ticket ID'=>'Ticket ID', + +'Status'=>'Status', + +'Priority'=>'Priority', + +'Product Name'=>'Product Name', + +'Product Code'=>'Part Number', + +'Commission Rate'=>'Commission Rate', + +'Qty/Unit'=>'Qty/Unit', + +'Unit Price'=>'Unit Price', + +'Question'=>'Question', + +'Category'=>'Category', + +'Price Book Name'=>'Price Book Name', +'LBL_EVENT_ENDDATE'=>'End Date & Time', + +//Added after 4 GA +'LBL_CUSTOM_INFORMATION'=>'Custom Information', + +//Added fields to display the related lists titles and None Scheduled +'LBL_NONE_SCHEDULED'=>'None Scheduled', + +'Leads'=>'Leads', +'Accounts'=>'Accounts', +'Accounts & Contacts'=>'Accounts & Contacts', +'Contacts'=>'Contacts', +'Potentials'=>'Potentials', +'Products'=>'Products', +'Emails'=>'Emails', +'HelpDesk'=>'Trouble Tickets', +'Activities'=>'Activities', +'Events'=>'Events', +'Tasks'=>'Tasks', +'Todo'=>'To Do', +'Call'=>'Call', +'Meeting'=>'Meeting', +'Quotes'=>'Quotes', +'PriceBook'=>'Price Books', +'PurchaseOrder'=>'Purchase Order', +'SalesOrder'=>'Sales Order', +'Invoice'=>'Invoices', +'Calendar'=>'Calendar', +'Home'=>'Home', +'Campaigns'=>'Campaigns', +'Organization'=>'Organization', +'Organization Name'=>'Organization Name', +'OrgUnit'=>'Org Unit', +'PriceBooks'=>'Price Books', +'Notes'=>'Notes', +'Faq'=>'FAQ', +'Dashboards'=>'Dashboard', +'Reports'=>'Reports', +'Vendors'=>'Vendors', +'Rss'=>'RSS', +'Portal'=>'My Sites', +'Webmails'=>'Webmails', +'Attachments'=>'Attachments', +'Activity History'=>'Activity History', +'Ticket History'=>'Ticket History', +'Purchase Order'=>'Purchase Order', +'Sales Stage History'=>'Sales Stage History', +'Users'=>'Users', +'Admin'=>'Admin', +'PurchaseOrder Status History'=>'PurchaseOrder Status History', +'SalesOrder Status History'=>'SalesOrder Status History', +'Quote Stage History'=>'Quote Stage History', +'Invoice Status History'=>'Invoice Status History', +'LBL_TROUBLE_TICKET'=>'Trouble Ticket', + +//Added language for Parent Tab + +'My Home Page'=>'My Home Page', +'Marketing'=>'Marketing', +'Sales'=>'Sales', +'Support'=>'Support', +'Analytics'=>'Analytics', +'Inventory'=>'Inventory', +'Tools'=>'Tools', +'Settings'=>'Settings', + +'LBL_INFORMATION'=>'Information', +'LBL_MORE'=>'More', +'LBL_BASIC'=>'Basic', +'LBL_CREATING'=>'Creating', +'LBL_EDITING'=>'Editing', +'LBL_NEW'=>'New', + +//Added for Detail/Edit/Related List of all modules + +'Lead'=>'Lead', +'Account'=>'Account', +'Contact'=>'Contact', +'Potential'=>'Potential', +'Opportunity'=>'Potential', +'Product'=>'Product', +'Email'=>'Email', +'Activity'=>'Activity', +'Event'=>'Event', +'Task'=>'Task', +'Quote'=>'Quote', +'PriceBook'=>'PriceBook', +'PurchaseOrder'=>'Purchase Order', +'Ticket'=>'Ticket', +'SalesOrder'=>'Sales Orders', +'Campaign'=>'Campaign', +'Note'=>'Note', +'Dashboard'=>'Dashboards', +'Report'=>'Report', +'Vendor'=>'Vendor', +'Webmail'=>'Webmail', + +'LBL_NONE_INCLUDED'=>'None Included', +'LBL_ADD_TO'=>'Add to', + +'LBL_SELECT_TEMPLATE_TO_MAIL_MERGE'=>'Select template to Mail Merge:', +'LBL_TITLE_OR_DESCRIPTION'=>'Title / Description', + +//Added for RSS Module +'LBL_RSS_FEEDS'=>'RSS Feeds', +'LBL_ADD_RSS_FEEDS'=>'Add New RSS Feed', + +//Added fields after 4.2 alpha +'COMBO_ACCOUNTS'=>'Accounts', +'LNK_NEW_FAQ'=>'New FAQ', +'Vendor Name'=>'Vendor Name', +'LNK_WEARE'=>'About us', +'LBL_ABOUTUS_TITLE'=>'vtiger CRM - About Us', +'LBL_DISCUSS'=>'Discuss with other users', +'Quote Stage'=>'Quote Stage', +'Potential Name'=>'Potential Name', +'Total'=>'Total Amount', +'First Name'=>'First Name', +'Last Name'=>'Last Name', +'User Name'=>'User Name', + /* For purchase order related list in vendor */ +'LBL_PORDER_BUTTON_TITLE'=>'New Purchase Order [Alt+O]', +'LBL_PORDER_BUTTON'=>'New Purchase Order', +'LBL_PORDER_BUTTON_KEY'=>'O', +'Tracking Number'=>'Tracking Number', +'Order Id'=>'Order Id', +'Quote Name'=>'Quote Name', +'Invoice Id'=>'Invoice Id', +'Quote Id'=>'Quote Id', +'Sales Order'=>'Sales Order', + // Added Quote in activity parent type selection / Related list +'COMBO_QUOTES'=>'Quotes', +'End Date'=>'End Date', +'Start Date'=>'Start Date', +'Related to'=>'Related To', +'Recurring Type'=> 'Recurring Type', +'SalesOrders'=> 'Sales Order', +'PurchaseOrder'=> 'Purchase Orders', +'LBL_QUOTE_NAME'=>'Quote Name', + //Added Orders in activity parent type selection / Related list +'LBL_NEW_QUOTE_BUTTON_TITLE'=>'New Quote [Alt+Q]', +'LBL_NEW_QUOTE_BUTTON_KEY'=>'Q', +'LBL_NEW_QUOTE_BUTTON'=>'New Quote', +'COMBO_PORDER'=>'Purchase Order', +'COMBO_SORDER'=>'Sales Order', +'LBL_PORDER_NAME'=>'Purchase Order', +'LBL_SORDER_NAME'=>'Sales Order', + // Added Invoice in activity parent type selection / Related list +'COMBO_INVOICES'=>'Invoice', +'LBL_INVOICE_NAME'=>'Invoice', +'LBL_HELPDESK_NAME'=>'Trouble Ticket', +'LBL_CAMPAIGN_NAME'=>'Campaign Name', + +'LBL_NEW_INVOICE_BUTTON_TITLE'=>'New Invoice [Alt+I]', +'LBL_NEW_INVOICE_BUTTON_KEY'=>'I', +'LBL_NEW_INVOICE_BUTTON'=>'New Invoice', +'LBL_NEW_SORDER_BUTTON_TITLE'=>'New Sales Order [Alt+E]', +'LBL_NEW_SORDER_BUTTON_KEY'=>'E', +'LBL_NEW_SORDER_BUTTON'=>'New Sales Order', + +'LBL_PRODUCT_DETAILS'=>'Product Details', +'LBL_PRODUCT'=>'Product', +'LBL_QTY_IN_STOCK'=>'Qty In Stock', +'LBL_QTY'=>'Qty', +'LBL_UNIT_PRICE'=>'Unit Price', +'LBL_LIST_PRICE'=>'List Price', +'LBL_TOTAL'=>'Total', +'LBL_ADD_PRODUCT'=>'Add Product', +'LBL_SUB_TOTAL'=>'Sub Total', +'LBL_TAX'=>'Tax', +'LBL_ADJUSTMENT'=>'Adjustment', +'LBL_GRAND_TOTAL'=>'Grand Total', +'LBL_QUOTE_ID'=>'Quote Id', +'LBL_SALES_ORDER_ID'=>'Sales Order Id', +'LBL_PURCHASE_ORDER_ID'=>'Purchase Order Id', +'LBL_EXPORT_TO_PDF'=>'Export To PDF', + +//Added for 4.2 Patch I +'LBL_HOME_KEY_METRICS'=>'Key Metrics', +'LBL_HOME_METRICS'=>'Metrics', +'LBL_HOME_COUNT'=>'Count', + +//Added for 4.2 patch 2 +'LBL_JSCALENDAR_LANG'=>'en', +'LNK_CV_EDIT'=>'Edit', +'LNK_CV_DELETE'=>'Delete', +'LNK_CV_CREATEVIEW'=>'New', +//Added for 5.0 +'LBL_UPD_FIELD_ORD'=>'Update Field Order', +'LBL_SEND_CUSTOM_MAIL_BUTTON'=>'Send Custom Mail', +'LBL_UPDATED_TODAY'=>'Updated today', +'LBL_UPDATED'=>'Updated', +'LBL_DAY_AGO'=>'day ago', +'LBL_DAYS_AGO'=>'days ago', + +//Added to convert Month string in update info - ahmed + +'Jan'=>'Jan', +'Feb'=>'Feb', +'Mar'=>'Mar', +'Apr'=>'Apr', +'May'=>'May', +'Jun'=>'Jun', +'Jul'=>'Jul', +'Aug'=>'Aug', +'Sep'=>'Sep', +'Oct'=>'Oct', +'Nov'=>'Nov', +'Dec'=>'Dec', + +//Added after 5.0 Alpha5 +'Campaign Name'=>'Campaign Name', +'Campaign Type'=>'Campaign Type', +'Campaign Status'=>'Campaign Status', +'Expected Revenue'=>'Expected Revenue', +'Expected Close Date'=>'Expected Close Date', +'LBL_ACTIONS'=>'Actions', +'LBL_SEND'=>'Send', +'LBL_VAT'=>'VAT', +'LBL_SALES'=>'Sales', +'LBL_SERVICE'=>'Service', +'LBL_TAX_DETAILS'=>'Tax Details', +'LBL_TAX_CALCULATION'=>'Tax Calculation', +'COVERED_PERCENTAGE'=>'(%)', + +'LBL_TAG_CLOUD'=>'Tag Cloud', +'LBL_FOR'=>'for', +'LBL_PO_STATUS'=>'PurchaseOrder Status', +'LBL_SO_STATUS'=>'SalesOrder Status', +'LBL_INVOICE_STATUS'=>'Invoice Status', +'LBL_NOTE'=>'Note', +'LBL_MODULE'=>'Module', +'Active'=>'Active', +'Inactive'=>'Inactive', +'Today'=>'Today', +'Last 2 Days'=>'Last 2 Days', +'Last Week'=>'Last Week', +'This Week'=>'This Week', +'This Month'=>'This Month', +'This Year'=>'This Year', +'LBL_PLEASE_CLICK'=>'Please Click', +'LBL_TO_CONFIGURE'=>'to Configure', +'LBL_HERE'=>'here', +'LBL_RECORDS'=>'Records', +'LBL_SCROLL'=>'[Scroll to Top]', +'LBL_EXPAND_COLLAPSE'=>'Expand/Collapse', +'LBL_RCPY_ADDRESS'=>'Copy Shipping address', +'LBL_LCPY_ADDRESS'=>'Copy Billing address', +'LBL_RECORD_ID'=>'Record ID', +'LBL_ACTION_DATE'=>'Action Date', +'LBL_HOMEPAGE_DASHBOARD'=>'HomePage Dashboard', +'LBL_NO'=>'No', +'LBL_FOUND'=>'Found', +'LBL_YOU_CAN_CREATE'=>'You can Create', +'LBL_NOW'=>'now', +'LBL_CLICK_THE_LINK'=>'Click the link below', +'LBL_CREATE'=>'Create', +'LBL_A'=>'a', +'LBL_AN'=>'an', +'LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE'=>'You are not allowed to create', +'LBL_TRANSFER_OWNERSHIP'=>'Transfer Ownership to', +'LBL_SELECT_STATUS'=>'Select New Status', +'LBL_UPDATE_OWNER'=>'Update Owner', +'LBL_UPDATE_STATUS'=>'Update Status', + +//added for tax calculations - after 5beta2 +'LBL_NET_PRICE'=>'Net Price', +'LBL_TOOLS'=>'Tools', +'LBL_DISCOUNT'=>'Discount', +'LBL_TOTAL_AFTER_DISCOUNT'=>'Total After Discount', +'LBL_NET_TOTAL'=>'Net Total', +'LBL_SHIPPING_AND_HANDLING_CHARGES'=>'Shipping & Handling Charges', +'LBL_TAX_FOR_SHIPPING_AND_HANDLING'=>'Taxes For Shipping and Handling', +'LBL_FINISH'=>'Finish', +'LBL_IMAGE_DELETED'=>'Image Deleted', +'LBL_TAX_MODE'=>'Tax Mode', +'LBL_CLEAR_COMMENT'=>'Clear Comment', +'LBL_ZERO_DISCOUNT'=>'Zero Discount', +'LBL_OF_PRICE'=>'of Price', +'LBL_DIRECT_PRICE_REDUCTION'=>'Direct Price Reduction', +'LBL_INDIVIDUAL'=>'Individual', + +//Added the address strings for Contacts Module +'LBL_CPY_MAILING_ADDRESS'=>'Copy Mailing Address', +'LBL_CPY_OTHER_ADDRESS'=>'Copy Other Address', + +'LBL_PERMISSION'=>'You are not permitted to execute this Operation', +'VTIGER'=>'vtiger', + +//Added for Inventory Tax details +'LBL_DIRECT_AMOUNT_DISCOUNT'=>'Direct Amount Discount', +'LBL_NO_DISCOUNT_FOR_THIS_PRODUCT'=>'No Discount for this Product', +'LBL_TOTAL_TAX_AMOUNT'=>'Total Tax Amount', +'LBL_FINAL_DISCOUNT_AMOUNT'=>'Final Discount Amount', +'LBL_SHIPPING_AND_HANDLING_CHARGE'=>'Shipping & Handling Charge', +'LBL_GO_BACK'=>'Go Back', + +//Record deleted message +'LBL_RECORD_DELETE'=>'The record you are trying to view has been deleted.', +'Part Number'=>'Part Number', + +//Added after 5.0.1 +'Salutation'=>'Salutation ', +'Rating'=>'Rating', +'industry'=>'Industry', +'Severity'=>'Severity', +'Product Category'=>'Product Category', +'GL Account'=>'GL Account', +'Usage Unit'=>'Usage Unit', +'Carrier'=>'Carrier', +'Expected Response'=>'Expected Response', +'LBL_ADDRESS_INF'=>'Address Information', + +'yes'=>'yes', +'LBL_RENAMEPROFILE_BUTTON_LABEL'=>'Rename', +'LBL_RENAME_PROFILE'=>'Rename Profile', +'LBL_PROFILE_NAME'=>'Profile Name', +'LBL_START_DATE'=>'Start Date', +'LBL_END_DATE'=>'End Date', + +); + + + +//the left value is the key stored in the db and the right value is the display value + +//to translate, only modify the right value in each key/value pair + +$app_list_strings = Array( + +//e.g. auf Deutsch 'Contacts'=>'Contakten', + +'moduleList' => Array('Home'=>'Home' + + , 'Dashboard'=>'Dashboard' + + , 'Leads'=>'Leads' + + , 'Contacts'=>'Contacts' + + , 'Accounts'=>'Accounts' + + , 'Potentials'=>'Potentials' + + , 'Campaigns'=>'Campaigns' + + , 'Notes'=>'Notes' + + , 'Emails'=>'Emails' + + , 'Activities'=>'Activities' + + , 'Products'=>'Products' + + , 'HelpDesk'=>'Trouble Tickets' + + , 'Faq'=>'FAQ' + + , 'Calendar'=>'Calendar' + + , 'Quotes'=>'Quotes' + + , 'PurchaseOrder'=>'PurchaseOrder' + + , 'Invoice'=>'Invoice' + + , 'Rss'=>'RSS' + + , 'Reports'=>'Reports' + + , 'Vendors'=>'Vendors' + + , 'PriceBooks'=>'PriceBooks' + + , 'SalesOrder'=>'SalesOrder' + + , 'Portal'=>'My Sites' + + ), + + + +//Note: do not translate opportunity_relationship_type_default_key + +// it is the key for the default opportunity_relationship_type_dom value + +'opportunity_relationship_type_default_key' => 'Primary Decision Maker', + +'opportunity_relationship_type_dom' => Array(''=>'' + + , 'Primary Decision Maker'=>'Primary Decision Maker' + + , 'Business Decision Maker'=>'Business Decision Maker' + + , 'Business Evaluator'=>'Business Evaluator' + + , 'Technical Decision Maker'=>'Technical Decision Maker' + + , 'Technical Evaluator'=>'Technical Evaluator' + + , 'Executive Sponsor'=>'Executive Sponsor' + + , 'Influencer'=>'Influencer' + + , 'Other'=>'Other' + + ), + + + +//Note: do not translate case_relationship_type_default_key + +// it is the key for the default case_relationship_type_dom value + +'case_relationship_type_default_key' => 'Primary Contact', + +'case_relationship_type_dom' => Array(''=>'' + + , 'Primary Contact'=>'Primary Contact' + + , 'Alternate Contact'=>'Alternate Contact' + + ), + + + +'task_priority_dom' => Array('High'=>'High' + + , 'Medium'=>'Medium' + + , 'Low'=>'Low' + + ), + + + +'task_status_dom' => Array('Planned'=>'Planned' + + , 'Completed'=>'Completed' + + , 'Deferred'=>'Deferred' + + ), + + + +'meeting_status_dom' => Array('Planned'=>'Planned' + + , 'Held'=>'Held' + + , 'Not Held'=>'Not Held' + + ), + + + +'call_status_dom' => Array('Planned'=>'Planned' + + , 'Held'=>'Held' + + , 'Not Held'=>'Not Held' + + ), + + + +//Note: do not translate case_status_default_key + +// it is the key for the default case_status_dom value + +'case_status_default_key' => 'New', + +'case_status_dom' => Array('New'=>'New' + + , 'Assigned'=>'Assigned' + + , 'Closed'=>'Closed' + + , 'Pending Input'=>'Pending Input' + + , 'Rejected'=>'Rejected' + + ), + + + +'user_status_dom' => Array('Active'=>'Active' + + , 'Inactive'=>'Inactive' + + ), + + + +//Note: do not translate record_type_default_key + +// it is the key for the default record_type_module value + +'record_type_default_key' => 'Accounts', + +'record_type_display' => array('Accounts' => 'Account', + + 'Leads' => 'Lead', + + 'Opportunities' => 'Opportunity'), + +); + + + +?> Modified: vtigercrm/branches/5.1_jens/include/nusoap/class.soap_transport_http.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/nusoap/class.soap_transport_http.php (original) +++ vtigercrm/branches/5.1_jens/include/nusoap/class.soap_transport_http.php Tue Nov 14 03:16:10 2006 @@ -1,1038 +1,1038 @@ - -* @version $Id: class.soap_transport_http.php,v 1.57 2005/07/27 19:24:42 snichol Exp $ -* @access public -*/ -class soap_transport_http extends nusoap_base { - - var $url = ''; - var $uri = ''; - var $digest_uri = ''; - var $scheme = ''; - var $host = ''; - var $port = ''; - var $path = ''; - var $request_method = 'POST'; - var $protocol_version = '1.0'; - var $encoding = ''; - var $outgoing_headers = array(); - var $incoming_headers = array(); - var $incoming_cookies = array(); - var $outgoing_payload = ''; - var $incoming_payload = ''; - var $useSOAPAction = true; - var $persistentConnection = false; - var $ch = false; // cURL handle - var $username = ''; - var $password = ''; - var $authtype = ''; - var $digestRequest = array(); - var $certRequest = array(); // keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional) - // cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem' - // sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem' - // sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem' - // passphrase: SSL key password/passphrase - // verifypeer: default is 1 - // verifyhost: default is 1 - - /** - * constructor - */ - function soap_transport_http($url){ - parent::nusoap_base(); - $this->setURL($url); - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev); - $this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')'; - $this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']); - } - - function setURL($url) { - $this->url = $url; - - $u = parse_url($url); - foreach($u as $k => $v){ - $this->debug("$k = $v"); - $this->$k = $v; - } - - // add any GET params to path - if(isset($u['query']) && $u['query'] != ''){ - $this->path .= '?' . $u['query']; - } - - // set default port - if(!isset($u['port'])){ - if($u['scheme'] == 'https'){ - $this->port = 443; - } else { - $this->port = 80; - } - } - - $this->uri = $this->path; - $this->digest_uri = $this->uri; - - // build headers - if (!isset($u['port'])) { - $this->outgoing_headers['Host'] = $this->host; - } else { - $this->outgoing_headers['Host'] = $this->host.':'.$this->port; - } - $this->debug('set Host: ' . $this->outgoing_headers['Host']); - - if (isset($u['user']) && $u['user'] != '') { - $this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : ''); - } - } - - function connect($connection_timeout=0,$response_timeout=30){ - // For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like - // "regular" socket. - // TODO: disabled for now because OpenSSL must be *compiled* in (not just - // loaded), and until PHP5 stream_get_wrappers is not available. -// if ($this->scheme == 'https') { -// if (version_compare(phpversion(), '4.3.0') >= 0) { -// if (extension_loaded('openssl')) { -// $this->scheme = 'ssl'; -// $this->debug('Using SSL over OpenSSL'); -// } -// } -// } - $this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port"); - if ($this->scheme == 'http' || $this->scheme == 'ssl') { - // use persistent connection - if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){ - if (!feof($this->fp)) { - $this->debug('Re-use persistent connection'); - return true; - } - fclose($this->fp); - $this->debug('Closed persistent connection at EOF'); - } - - // munge host if using OpenSSL - if ($this->scheme == 'ssl') { - $host = 'ssl://' . $this->host; - } else { - $host = $this->host; - } - $this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout); - - // open socket - if($connection_timeout > 0){ - $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout); - } else { - $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str); - } - - // test pointer - if(!$this->fp) { - $msg = 'Couldn\'t open socket connection to server ' . $this->url; - if ($this->errno) { - $msg .= ', Error ('.$this->errno.'): '.$this->error_str; - } else { - $msg .= ' prior to connect(). This is often a problem looking up the host name.'; - } - $this->debug($msg); - $this->setError($msg); - return false; - } - - // set response timeout - $this->debug('set response timeout to ' . $response_timeout); - socket_set_timeout( $this->fp, $response_timeout); - - $this->debug('socket connected'); - return true; - } else if ($this->scheme == 'https') { - if (!extension_loaded('curl')) { - $this->setError('CURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS'); - return false; - } - $this->debug('connect using https'); - // init CURL - $this->ch = curl_init(); - // set url - $hostURL = ($this->port != '') ? "https://$this->host:$this->port" : "https://$this->host"; - // add path - $hostURL .= $this->path; - curl_setopt($this->ch, CURLOPT_URL, $hostURL); - // follow location headers (re-directs) - curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1); - // ask for headers in the response output - curl_setopt($this->ch, CURLOPT_HEADER, 1); - // ask for the response output as the return value - curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); - // encode - // We manage this ourselves through headers and encoding -// if(function_exists('gzuncompress')){ -// curl_setopt($this->ch, CURLOPT_ENCODING, 'deflate'); -// } - // persistent connection - if ($this->persistentConnection) { - // The way we send data, we cannot use persistent connections, since - // there will be some "junk" at the end of our request. - //curl_setopt($this->ch, CURL_HTTP_VERSION_1_1, true); - $this->persistentConnection = false; - $this->outgoing_headers['Connection'] = 'close'; - $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); - } - // set timeout - if ($connection_timeout != 0) { - curl_setopt($this->ch, CURLOPT_TIMEOUT, $connection_timeout); - } - // TODO: cURL has added a connection timeout separate from the response timeout - //if ($connection_timeout != 0) { - // curl_setopt($this->ch, CURLOPT_CONNECTIONTIMEOUT, $connection_timeout); - //} - //if ($response_timeout != 0) { - // curl_setopt($this->ch, CURLOPT_TIMEOUT, $response_timeout); - //} - - // recent versions of cURL turn on peer/host checking by default, - // while PHP binaries are not compiled with a default location for the - // CA cert bundle, so disable peer/host checking. -//curl_setopt($this->ch, CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt'); - curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0); - - // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo) - if ($this->authtype == 'certificate') { - if (isset($this->certRequest['cainfofile'])) { - curl_setopt($this->ch, CURLOPT_CAINFO, $this->certRequest['cainfofile']); - } - if (isset($this->certRequest['verifypeer'])) { - curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']); - } else { - curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 1); - } - if (isset($this->certRequest['verifyhost'])) { - curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']); - } else { - curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 1); - } - if (isset($this->certRequest['sslcertfile'])) { - curl_setopt($this->ch, CURLOPT_SSLCERT, $this->certRequest['sslcertfile']); - } - if (isset($this->certRequest['sslkeyfile'])) { - curl_setopt($this->ch, CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']); - } - if (isset($this->certRequest['passphrase'])) { - curl_setopt($this->ch, CURLOPT_SSLKEYPASSWD , $this->certRequest['passphrase']); - } - } - $this->debug('cURL connection set up'); - return true; - } else { - $this->setError('Unknown scheme ' . $this->scheme); - $this->debug('Unknown scheme ' . $this->scheme); - return false; - } - } - - /** - * send the SOAP message via HTTP - * - * @param string $data message data - * @param integer $timeout set connection timeout in seconds - * @param integer $response_timeout set response timeout in seconds - * @param array $cookies cookies to send - * @return string data - * @access public - */ - function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) { - - $this->debug('entered send() with data of length: '.strlen($data)); - - $this->tryagain = true; - $tries = 0; - while ($this->tryagain) { - $this->tryagain = false; - if ($tries++ < 2) { - // make connnection - if (!$this->connect($timeout, $response_timeout)){ - return false; - } - - // send request - if (!$this->sendRequest($data, $cookies)){ - return false; - } - - // get response - $respdata = $this->getResponse(); - } else { - $this->setError('Too many tries to get an OK response'); - } - } - $this->debug('end of send()'); - return $respdata; - } - - - /** - * send the SOAP message via HTTPS 1.0 using CURL - * - * @param string $msg message data - * @param integer $timeout set connection timeout in seconds - * @param integer $response_timeout set response timeout in seconds - * @param array $cookies cookies to send - * @return string data - * @access public - */ - function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) { - return $this->send($data, $timeout, $response_timeout, $cookies); - } - - /** - * if authenticating, set user credentials here - * - * @param string $username - * @param string $password - * @param string $authtype (basic, digest, certificate) - * @param array $digestRequest (keys must be nonce, nc, realm, qop) - * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) - * @access public - */ - function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) { - $this->debug("Set credentials for authtype $authtype"); - // cf. RFC 2617 - if ($authtype == 'basic') { - $this->outgoing_headers['Authorization'] = 'Basic '.base64_encode(str_replace(':','',$username).':'.$password); - } elseif ($authtype == 'digest') { - if (isset($digestRequest['nonce'])) { - $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1; - - // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html) - - // A1 = unq(username-value) ":" unq(realm-value) ":" passwd - $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password; - - // H(A1) = MD5(A1) - $HA1 = md5($A1); - - // A2 = Method ":" digest-uri-value - $A2 = 'POST:' . $this->digest_uri; - - // H(A2) - $HA2 = md5($A2); - - // KD(secret, data) = H(concat(secret, ":", data)) - // if qop == auth: - // request-digest = <"> < KD ( H(A1), unq(nonce-value) - // ":" nc-value - // ":" unq(cnonce-value) - // ":" unq(qop-value) - // ":" H(A2) - // ) <"> - // if qop is missing, - // request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <"> - - $unhashedDigest = ''; - $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : ''; - $cnonce = $nonce; - if ($digestRequest['qop'] != '') { - $unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2; - } else { - $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2; - } - - $hashedDigest = md5($unhashedDigest); - - $this->outgoing_headers['Authorization'] = 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"'; - } - } elseif ($authtype == 'certificate') { - $this->certRequest = $certRequest; - } - $this->username = $username; - $this->password = $password; - $this->authtype = $authtype; - $this->digestRequest = $digestRequest; - - if (isset($this->outgoing_headers['Authorization'])) { - $this->debug('set Authorization: ' . substr($this->outgoing_headers['Authorization'], 0, 12) . '...'); - } else { - $this->debug('Authorization header not set'); - } - } - - /** - * set the soapaction value - * - * @param string $soapaction - * @access public - */ - function setSOAPAction($soapaction) { - $this->outgoing_headers['SOAPAction'] = '"' . $soapaction . '"'; - $this->debug('set SOAPAction: ' . $this->outgoing_headers['SOAPAction']); - } - - /** - * use http encoding - * - * @param string $enc encoding style. supported values: gzip, deflate, or both - * @access public - */ - function setEncoding($enc='gzip, deflate') { - if (function_exists('gzdeflate')) { - $this->protocol_version = '1.1'; - $this->outgoing_headers['Accept-Encoding'] = $enc; - $this->debug('set Accept-Encoding: ' . $this->outgoing_headers['Accept-Encoding']); - if (!isset($this->outgoing_headers['Connection'])) { - $this->outgoing_headers['Connection'] = 'close'; - $this->persistentConnection = false; - $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); - } - set_magic_quotes_runtime(0); - // deprecated - $this->encoding = $enc; - } - } - - /** - * set proxy info here - * - * @param string $proxyhost - * @param string $proxyport - * @param string $proxyusername - * @param string $proxypassword - * @access public - */ - function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') { - $this->uri = $this->url; - $this->host = $proxyhost; - $this->port = $proxyport; - if ($proxyusername != '' && $proxypassword != '') { - $this->outgoing_headers['Proxy-Authorization'] = ' Basic '.base64_encode($proxyusername.':'.$proxypassword); - $this->debug('set Proxy-Authorization: ' . $this->outgoing_headers['Proxy-Authorization']); - } - } - - /** - * decode a string that is encoded w/ "chunked' transfer encoding - * as defined in RFC2068 19.4.6 - * - * @param string $buffer - * @param string $lb - * @returns string - * @access public - * @deprecated - */ - function decodeChunked($buffer, $lb){ - // length := 0 - $length = 0; - $new = ''; - - // read chunk-size, chunk-extension (if any) and CRLF - // get the position of the linebreak - $chunkend = strpos($buffer, $lb); - if ($chunkend == FALSE) { - $this->debug('no linebreak found in decodeChunked'); - return $new; - } - $temp = substr($buffer,0,$chunkend); - $chunk_size = hexdec( trim($temp) ); - $chunkstart = $chunkend + strlen($lb); - // while (chunk-size > 0) { - while ($chunk_size > 0) { - $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size"); - $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size); - - // Just in case we got a broken connection - if ($chunkend == FALSE) { - $chunk = substr($buffer,$chunkstart); - // append chunk-data to entity-body - $new .= $chunk; - $length += strlen($chunk); - break; - } - - // read chunk-data and CRLF - $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); - // append chunk-data to entity-body - $new .= $chunk; - // length := length + chunk-size - $length += strlen($chunk); - // read chunk-size and CRLF - $chunkstart = $chunkend + strlen($lb); - - $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb); - if ($chunkend == FALSE) { - break; //Just in case we got a broken connection - } - $temp = substr($buffer,$chunkstart,$chunkend-$chunkstart); - $chunk_size = hexdec( trim($temp) ); - $chunkstart = $chunkend; - } - return $new; - } - - /* - * Writes payload, including HTTP headers, to $this->outgoing_payload. - */ - function buildPayload($data, $cookie_str = '') { - // add content-length header - $this->outgoing_headers['Content-Length'] = strlen($data); - $this->debug('set Content-Length: ' . $this->outgoing_headers['Content-Length']); - - // start building outgoing payload: - $req = "$this->request_method $this->uri HTTP/$this->protocol_version"; - $this->debug("HTTP request: $req"); - $this->outgoing_payload = "$req\r\n"; - - // loop thru headers, serializing - foreach($this->outgoing_headers as $k => $v){ - $hdr = $k.': '.$v; - $this->debug("HTTP header: $hdr"); - $this->outgoing_payload .= "$hdr\r\n"; - } - - // add any cookies - if ($cookie_str != '') { - $hdr = 'Cookie: '.$cookie_str; - $this->debug("HTTP header: $hdr"); - $this->outgoing_payload .= "$hdr\r\n"; - } - - // header/body separator - $this->outgoing_payload .= "\r\n"; - - // add data - $this->outgoing_payload .= $data; - } - - function sendRequest($data, $cookies = NULL) { - // build cookie string - $cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https'))); - - // build payload - $this->buildPayload($data, $cookie_str); - - if ($this->scheme == 'http' || $this->scheme == 'ssl') { - // send payload - if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) { - $this->setError('couldn\'t write message data to socket'); - $this->debug('couldn\'t write message data to socket'); - return false; - } - $this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload)); - return true; - } else if ($this->scheme == 'https') { - // set payload - // TODO: cURL does say this should only be the verb, and in fact it - // turns out that the URI and HTTP version are appended to this, which - // some servers refuse to work with - //curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $this->outgoing_payload); - foreach($this->outgoing_headers as $k => $v){ - $curl_headers[] = "$k: $v"; - } - if ($cookie_str != '') { - $curl_headers[] = 'Cookie: ' . $cookie_str; - } - curl_setopt($this->ch, CURLOPT_HTTPHEADER, $curl_headers); - if ($this->request_method == "POST") { - curl_setopt($this->ch, CURLOPT_POST, 1); - curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data); - } else { - } - $this->debug('set cURL payload'); - return true; - } - } - - function getResponse(){ - $this->incoming_payload = ''; - - if ($this->scheme == 'http' || $this->scheme == 'ssl') { - // loop until headers have been retrieved - $data = ''; - while (!isset($lb)){ - - // We might EOF during header read. - if(feof($this->fp)) { - $this->incoming_payload = $data; - $this->debug('found no headers before EOF after length ' . strlen($data)); - $this->debug("received before EOF:\n" . $data); - $this->setError('server failed to send headers'); - return false; - } - - $tmp = fgets($this->fp, 256); - $tmplen = strlen($tmp); - $this->debug("read line of $tmplen bytes: " . trim($tmp)); - - if ($tmplen == 0) { - $this->incoming_payload = $data; - $this->debug('socket read of headers timed out after length ' . strlen($data)); - $this->debug("read before timeout: " . $data); - $this->setError('socket read of headers timed out'); - return false; - } - - $data .= $tmp; - $pos = strpos($data,"\r\n\r\n"); - if($pos > 1){ - $lb = "\r\n"; - } else { - $pos = strpos($data,"\n\n"); - if($pos > 1){ - $lb = "\n"; - } - } - // remove 100 header - if(isset($lb) && ereg('^HTTP/1.1 100',$data)){ - unset($lb); - $data = ''; - }// - } - // store header data - $this->incoming_payload .= $data; - $this->debug('found end of headers after length ' . strlen($data)); - // process headers - $header_data = trim(substr($data,0,$pos)); - $header_array = explode($lb,$header_data); - $this->incoming_headers = array(); - $this->incoming_cookies = array(); - foreach($header_array as $header_line){ - $arr = explode(':',$header_line, 2); - if(count($arr) > 1){ - $header_name = strtolower(trim($arr[0])); - $this->incoming_headers[$header_name] = trim($arr[1]); - if ($header_name == 'set-cookie') { - // TODO: allow multiple cookies from parseCookie - $cookie = $this->parseCookie(trim($arr[1])); - if ($cookie) { - $this->incoming_cookies[] = $cookie; - $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); - } else { - $this->debug('did not find cookie in ' . trim($arr[1])); - } - } - } else if (isset($header_name)) { - // append continuation line to previous header - $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; - } - } - - // loop until msg has been received - if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') { - $content_length = 2147483647; // ignore any content-length header - $chunked = true; - $this->debug("want to read chunked content"); - } elseif (isset($this->incoming_headers['content-length'])) { - $content_length = $this->incoming_headers['content-length']; - $chunked = false; - $this->debug("want to read content of length $content_length"); - } else { - $content_length = 2147483647; - $chunked = false; - $this->debug("want to read content to EOF"); - } - $data = ''; - do { - if ($chunked) { - $tmp = fgets($this->fp, 256); - $tmplen = strlen($tmp); - $this->debug("read chunk line of $tmplen bytes"); - if ($tmplen == 0) { - $this->incoming_payload = $data; - $this->debug('socket read of chunk length timed out after length ' . strlen($data)); - $this->debug("read before timeout:\n" . $data); - $this->setError('socket read of chunk length timed out'); - return false; - } - $content_length = hexdec(trim($tmp)); - $this->debug("chunk length $content_length"); - } - $strlen = 0; - while (($strlen < $content_length) && (!feof($this->fp))) { - $readlen = min(8192, $content_length - $strlen); - $tmp = fread($this->fp, $readlen); - $tmplen = strlen($tmp); - $this->debug("read buffer of $tmplen bytes"); - if (($tmplen == 0) && (!feof($this->fp))) { - $this->incoming_payload = $data; - $this->debug('socket read of body timed out after length ' . strlen($data)); - $this->debug("read before timeout:\n" . $data); - $this->setError('socket read of body timed out'); - return false; - } - $strlen += $tmplen; - $data .= $tmp; - } - if ($chunked && ($content_length > 0)) { - $tmp = fgets($this->fp, 256); - $tmplen = strlen($tmp); - $this->debug("read chunk terminator of $tmplen bytes"); - if ($tmplen == 0) { - $this->incoming_payload = $data; - $this->debug('socket read of chunk terminator timed out after length ' . strlen($data)); - $this->debug("read before timeout:\n" . $data); - $this->setError('socket read of chunk terminator timed out'); - return false; - } - } - } while ($chunked && ($content_length > 0) && (!feof($this->fp))); - if (feof($this->fp)) { - $this->debug('read to EOF'); - } - $this->debug('read body of length ' . strlen($data)); - $this->incoming_payload .= $data; - $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server'); - - // close filepointer - if( - (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || - (! $this->persistentConnection) || feof($this->fp)){ - fclose($this->fp); - $this->fp = false; - $this->debug('closed socket'); - } - - // connection was closed unexpectedly - if($this->incoming_payload == ''){ - $this->setError('no response from server'); - return false; - } - - // decode transfer-encoding -// if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){ -// if(!$data = $this->decodeChunked($data, $lb)){ -// $this->setError('Decoding of chunked data failed'); -// return false; -// } - //print "
\nde-chunked:\n---------------\n$data\n\n---------------\n
"; - // set decoded payload -// $this->incoming_payload = $header_data.$lb.$lb.$data; -// } - - } else if ($this->scheme == 'https') { - // send and receive - $this->debug('send and receive with cURL'); - $this->incoming_payload = curl_exec($this->ch); - $data = $this->incoming_payload; - - $cErr = curl_error($this->ch); - if ($cErr != '') { - $err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'
'; - // TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE - foreach(curl_getinfo($this->ch) as $k => $v){ - $err .= "$k: $v
"; - } - $this->debug($err); - $this->setError($err); - curl_close($this->ch); - return false; - } else { - //echo '
';
-			//var_dump(curl_getinfo($this->ch));
-			//echo '
'; - } - // close curl - $this->debug('No cURL error, closing cURL'); - curl_close($this->ch); - - // remove 100 header(s) - while (ereg('^HTTP/1.1 100',$data)) { - if ($pos = strpos($data,"\r\n\r\n")) { - $data = ltrim(substr($data,$pos)); - } elseif($pos = strpos($data,"\n\n") ) { - $data = ltrim(substr($data,$pos)); - } - } - - // separate content from HTTP headers - if ($pos = strpos($data,"\r\n\r\n")) { - $lb = "\r\n"; - } elseif( $pos = strpos($data,"\n\n")) { - $lb = "\n"; - } else { - $this->debug('no proper separation of headers and document'); - $this->setError('no proper separation of headers and document'); - return false; - } - $header_data = trim(substr($data,0,$pos)); - $header_array = explode($lb,$header_data); - $data = ltrim(substr($data,$pos)); - $this->debug('found proper separation of headers and document'); - $this->debug('cleaned data, stringlen: '.strlen($data)); - // clean headers - foreach ($header_array as $header_line) { - $arr = explode(':',$header_line,2); - if(count($arr) > 1){ - $header_name = strtolower(trim($arr[0])); - $this->incoming_headers[$header_name] = trim($arr[1]); - if ($header_name == 'set-cookie') { - // TODO: allow multiple cookies from parseCookie - $cookie = $this->parseCookie(trim($arr[1])); - if ($cookie) { - $this->incoming_cookies[] = $cookie; - $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); - } else { - $this->debug('did not find cookie in ' . trim($arr[1])); - } - } - } else if (isset($header_name)) { - // append continuation line to previous header - $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; - } - } - } - - $arr = explode(' ', $header_array[0], 3); - $http_version = $arr[0]; - $http_status = intval($arr[1]); - $http_reason = count($arr) > 2 ? $arr[2] : ''; - - // see if we need to resend the request with http digest authentication - if (isset($this->incoming_headers['location']) && $http_status == 301) { - $this->debug("Got 301 $http_reason with Location: " . $this->incoming_headers['location']); - $this->setURL($this->incoming_headers['location']); - $this->tryagain = true; - return false; - } - - // see if we need to resend the request with http digest authentication - if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) { - $this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']); - if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) { - $this->debug('Server wants digest authentication'); - // remove "Digest " from our elements - $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']); - - // parse elements into array - $digestElements = explode(',', $digestString); - foreach ($digestElements as $val) { - $tempElement = explode('=', trim($val), 2); - $digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]); - } - - // should have (at least) qop, realm, nonce - if (isset($digestRequest['nonce'])) { - $this->setCredentials($this->username, $this->password, 'digest', $digestRequest); - $this->tryagain = true; - return false; - } - } - $this->debug('HTTP authentication failed'); - $this->setError('HTTP authentication failed'); - return false; - } - - if ( - ($http_status >= 300 && $http_status <= 307) || - ($http_status >= 400 && $http_status <= 417) || - ($http_status >= 501 && $http_status <= 505) - ) { - $this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient2->response has contents of the response)"); - return false; - } - - // decode content-encoding - if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){ - if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){ - // if decoding works, use it. else assume data wasn't gzencoded - if(function_exists('gzinflate')){ - //$timer->setMarker('starting decoding of gzip/deflated content'); - // IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress) - // this means there are no Zlib headers, although there should be - $this->debug('The gzinflate function exists'); - $datalen = strlen($data); - if ($this->incoming_headers['content-encoding'] == 'deflate') { - if ($degzdata = @gzinflate($data)) { - $data = $degzdata; - $this->debug('The payload has been inflated to ' . strlen($data) . ' bytes'); - if (strlen($data) < $datalen) { - // test for the case that the payload has been compressed twice - $this->debug('The inflated payload is smaller than the gzipped one; try again'); - if ($degzdata = @gzinflate($data)) { - $data = $degzdata; - $this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes'); - } - } - } else { - $this->debug('Error using gzinflate to inflate the payload'); - $this->setError('Error using gzinflate to inflate the payload'); - } - } elseif ($this->incoming_headers['content-encoding'] == 'gzip') { - if ($degzdata = @gzinflate(substr($data, 10))) { // do our best - $data = $degzdata; - $this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes'); - if (strlen($data) < $datalen) { - // test for the case that the payload has been compressed twice - $this->debug('The un-gzipped payload is smaller than the gzipped one; try again'); - if ($degzdata = @gzinflate(substr($data, 10))) { - $data = $degzdata; - $this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes'); - } - } - } else { - $this->debug('Error using gzinflate to un-gzip the payload'); - $this->setError('Error using gzinflate to un-gzip the payload'); - } - } - //$timer->setMarker('finished decoding of gzip/deflated content'); - //print "\nde-inflated:\n---------------\n$data\n-------------\n"; - // set decoded payload - $this->incoming_payload = $header_data.$lb.$lb.$data; - } else { - $this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); - $this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); - } - } else { - $this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); - $this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); - } - } else { - $this->debug('No Content-Encoding header'); - } - - if(strlen($data) == 0){ - $this->debug('no data after headers!'); - $this->setError('no data present after HTTP headers'); - return false; - } - - return $data; - } - - function setContentType($type, $charset = false) { - $this->outgoing_headers['Content-Type'] = $type . ($charset ? '; charset=' . $charset : ''); - $this->debug('set Content-Type: ' . $this->outgoing_headers['Content-Type']); - } - - function usePersistentConnection(){ - if (isset($this->outgoing_headers['Accept-Encoding'])) { - return false; - } - $this->protocol_version = '1.1'; - $this->persistentConnection = true; - $this->outgoing_headers['Connection'] = 'Keep-Alive'; - $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); - return true; - } - - /** - * parse an incoming Cookie into it's parts - * - * @param string $cookie_str content of cookie - * @return array with data of that cookie - * @access private - */ - /* - * TODO: allow a Set-Cookie string to be parsed into multiple cookies - */ - function parseCookie($cookie_str) { - $cookie_str = str_replace('; ', ';', $cookie_str) . ';'; - $data = split(';', $cookie_str); - $value_str = $data[0]; - - $cookie_param = 'domain='; - $start = strpos($cookie_str, $cookie_param); - if ($start > 0) { - $domain = substr($cookie_str, $start + strlen($cookie_param)); - $domain = substr($domain, 0, strpos($domain, ';')); - } else { - $domain = ''; - } - - $cookie_param = 'expires='; - $start = strpos($cookie_str, $cookie_param); - if ($start > 0) { - $expires = substr($cookie_str, $start + strlen($cookie_param)); - $expires = substr($expires, 0, strpos($expires, ';')); - } else { - $expires = ''; - } - - $cookie_param = 'path='; - $start = strpos($cookie_str, $cookie_param); - if ( $start > 0 ) { - $path = substr($cookie_str, $start + strlen($cookie_param)); - $path = substr($path, 0, strpos($path, ';')); - } else { - $path = '/'; - } - - $cookie_param = ';secure;'; - if (strpos($cookie_str, $cookie_param) !== FALSE) { - $secure = true; - } else { - $secure = false; - } - - $sep_pos = strpos($value_str, '='); - - if ($sep_pos) { - $name = substr($value_str, 0, $sep_pos); - $value = substr($value_str, $sep_pos + 1); - $cookie= array( 'name' => $name, - 'value' => $value, - 'domain' => $domain, - 'path' => $path, - 'expires' => $expires, - 'secure' => $secure - ); - return $cookie; - } - return false; - } - - /** - * sort out cookies for the current request - * - * @param array $cookies array with all cookies - * @param boolean $secure is the send-content secure or not? - * @return string for Cookie-HTTP-Header - * @access private - */ - function getCookiesForRequest($cookies, $secure=false) { - $cookie_str = ''; - if ((! is_null($cookies)) && (is_array($cookies))) { - foreach ($cookies as $cookie) { - if (! is_array($cookie)) { - continue; - } - $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { - if (strtotime($cookie['expires']) <= time()) { - $this->debug('cookie has expired'); - continue; - } - } - if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { - $domain = preg_quote($cookie['domain']); - if (! preg_match("'.*$domain$'i", $this->host)) { - $this->debug('cookie has different domain'); - continue; - } - } - if ((isset($cookie['path'])) && (! empty($cookie['path']))) { - $path = preg_quote($cookie['path']); - if (! preg_match("'^$path.*'i", $this->path)) { - $this->debug('cookie is for a different path'); - continue; - } - } - if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) { - $this->debug('cookie is secure, transport is not'); - continue; - } - $cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; '; - $this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']); - } - } - return $cookie_str; - } -} - - + +* @version $Id: class.soap_transport_http.php,v 1.57 2005/07/27 19:24:42 snichol Exp $ +* @access public +*/ +class soap_transport_http extends nusoap_base { + + var $url = ''; + var $uri = ''; + var $digest_uri = ''; + var $scheme = ''; + var $host = ''; + var $port = ''; + var $path = ''; + var $request_method = 'POST'; + var $protocol_version = '1.0'; + var $encoding = ''; + var $outgoing_headers = array(); + var $incoming_headers = array(); + var $incoming_cookies = array(); + var $outgoing_payload = ''; + var $incoming_payload = ''; + var $useSOAPAction = true; + var $persistentConnection = false; + var $ch = false; // cURL handle + var $username = ''; + var $password = ''; + var $authtype = ''; + var $digestRequest = array(); + var $certRequest = array(); // keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional) + // cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem' + // sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem' + // sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem' + // passphrase: SSL key password/passphrase + // verifypeer: default is 1 + // verifyhost: default is 1 + + /** + * constructor + */ + function soap_transport_http($url){ + parent::nusoap_base(); + $this->setURL($url); + ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev); + $this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')'; + $this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']); + } + + function setURL($url) { + $this->url = $url; + + $u = parse_url($url); + foreach($u as $k => $v){ + $this->debug("$k = $v"); + $this->$k = $v; + } + + // add any GET params to path + if(isset($u['query']) && $u['query'] != ''){ + $this->path .= '?' . $u['query']; + } + + // set default port + if(!isset($u['port'])){ + if($u['scheme'] == 'https'){ + $this->port = 443; + } else { + $this->port = 80; + } + } + + $this->uri = $this->path; + $this->digest_uri = $this->uri; + + // build headers + if (!isset($u['port'])) { + $this->outgoing_headers['Host'] = $this->host; + } else { + $this->outgoing_headers['Host'] = $this->host.':'.$this->port; + } + $this->debug('set Host: ' . $this->outgoing_headers['Host']); + + if (isset($u['user']) && $u['user'] != '') { + $this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : ''); + } + } + + function connect($connection_timeout=0,$response_timeout=30){ + // For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like + // "regular" socket. + // TODO: disabled for now because OpenSSL must be *compiled* in (not just + // loaded), and until PHP5 stream_get_wrappers is not available. +// if ($this->scheme == 'https') { +// if (version_compare(phpversion(), '4.3.0') >= 0) { +// if (extension_loaded('openssl')) { +// $this->scheme = 'ssl'; +// $this->debug('Using SSL over OpenSSL'); +// } +// } +// } + $this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port"); + if ($this->scheme == 'http' || $this->scheme == 'ssl') { + // use persistent connection + if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){ + if (!feof($this->fp)) { + $this->debug('Re-use persistent connection'); + return true; + } + fclose($this->fp); + $this->debug('Closed persistent connection at EOF'); + } + + // munge host if using OpenSSL + if ($this->scheme == 'ssl') { + $host = 'ssl://' . $this->host; + } else { + $host = $this->host; + } + $this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout); + + // open socket + if($connection_timeout > 0){ + $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout); + } else { + $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str); + } + + // test pointer + if(!$this->fp) { + $msg = 'Couldn\'t open socket connection to server ' . $this->url; + if ($this->errno) { + $msg .= ', Error ('.$this->errno.'): '.$this->error_str; + } else { + $msg .= ' prior to connect(). This is often a problem looking up the host name.'; + } + $this->debug($msg); + $this->setError($msg); + return false; + } + + // set response timeout + $this->debug('set response timeout to ' . $response_timeout); + socket_set_timeout( $this->fp, $response_timeout); + + $this->debug('socket connected'); + return true; + } else if ($this->scheme == 'https') { + if (!extension_loaded('curl')) { + $this->setError('CURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS'); + return false; + } + $this->debug('connect using https'); + // init CURL + $this->ch = curl_init(); + // set url + $hostURL = ($this->port != '') ? "https://$this->host:$this->port" : "https://$this->host"; + // add path + $hostURL .= $this->path; + curl_setopt($this->ch, CURLOPT_URL, $hostURL); + // follow location headers (re-directs) + curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1); + // ask for headers in the response output + curl_setopt($this->ch, CURLOPT_HEADER, 1); + // ask for the response output as the return value + curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); + // encode + // We manage this ourselves through headers and encoding +// if(function_exists('gzuncompress')){ +// curl_setopt($this->ch, CURLOPT_ENCODING, 'deflate'); +// } + // persistent connection + if ($this->persistentConnection) { + // The way we send data, we cannot use persistent connections, since + // there will be some "junk" at the end of our request. + //curl_setopt($this->ch, CURL_HTTP_VERSION_1_1, true); + $this->persistentConnection = false; + $this->outgoing_headers['Connection'] = 'close'; + $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); + } + // set timeout + if ($connection_timeout != 0) { + curl_setopt($this->ch, CURLOPT_TIMEOUT, $connection_timeout); + } + // TODO: cURL has added a connection timeout separate from the response timeout + //if ($connection_timeout != 0) { + // curl_setopt($this->ch, CURLOPT_CONNECTIONTIMEOUT, $connection_timeout); + //} + //if ($response_timeout != 0) { + // curl_setopt($this->ch, CURLOPT_TIMEOUT, $response_timeout); + //} + + // recent versions of cURL turn on peer/host checking by default, + // while PHP binaries are not compiled with a default location for the + // CA cert bundle, so disable peer/host checking. +//curl_setopt($this->ch, CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt'); + curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0); + + // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo) + if ($this->authtype == 'certificate') { + if (isset($this->certRequest['cainfofile'])) { + curl_setopt($this->ch, CURLOPT_CAINFO, $this->certRequest['cainfofile']); + } + if (isset($this->certRequest['verifypeer'])) { + curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']); + } else { + curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 1); + } + if (isset($this->certRequest['verifyhost'])) { + curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']); + } else { + curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 1); + } + if (isset($this->certRequest['sslcertfile'])) { + curl_setopt($this->ch, CURLOPT_SSLCERT, $this->certRequest['sslcertfile']); + } + if (isset($this->certRequest['sslkeyfile'])) { + curl_setopt($this->ch, CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']); + } + if (isset($this->certRequest['passphrase'])) { + curl_setopt($this->ch, CURLOPT_SSLKEYPASSWD , $this->certRequest['passphrase']); + } + } + $this->debug('cURL connection set up'); + return true; + } else { + $this->setError('Unknown scheme ' . $this->scheme); + $this->debug('Unknown scheme ' . $this->scheme); + return false; + } + } + + /** + * send the SOAP message via HTTP + * + * @param string $data message data + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @param array $cookies cookies to send + * @return string data + * @access public + */ + function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) { + + $this->debug('entered send() with data of length: '.strlen($data)); + + $this->tryagain = true; + $tries = 0; + while ($this->tryagain) { + $this->tryagain = false; + if ($tries++ < 2) { + // make connnection + if (!$this->connect($timeout, $response_timeout)){ + return false; + } + + // send request + if (!$this->sendRequest($data, $cookies)){ + return false; + } + + // get response + $respdata = $this->getResponse(); + } else { + $this->setError('Too many tries to get an OK response'); + } + } + $this->debug('end of send()'); + return $respdata; + } + + + /** + * send the SOAP message via HTTPS 1.0 using CURL + * + * @param string $msg message data + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @param array $cookies cookies to send + * @return string data + * @access public + */ + function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) { + return $this->send($data, $timeout, $response_timeout, $cookies); + } + + /** + * if authenticating, set user credentials here + * + * @param string $username + * @param string $password + * @param string $authtype (basic, digest, certificate) + * @param array $digestRequest (keys must be nonce, nc, realm, qop) + * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) + * @access public + */ + function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) { + $this->debug("Set credentials for authtype $authtype"); + // cf. RFC 2617 + if ($authtype == 'basic') { + $this->outgoing_headers['Authorization'] = 'Basic '.base64_encode(str_replace(':','',$username).':'.$password); + } elseif ($authtype == 'digest') { + if (isset($digestRequest['nonce'])) { + $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1; + + // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html) + + // A1 = unq(username-value) ":" unq(realm-value) ":" passwd + $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password; + + // H(A1) = MD5(A1) + $HA1 = md5($A1); + + // A2 = Method ":" digest-uri-value + $A2 = 'POST:' . $this->digest_uri; + + // H(A2) + $HA2 = md5($A2); + + // KD(secret, data) = H(concat(secret, ":", data)) + // if qop == auth: + // request-digest = <"> < KD ( H(A1), unq(nonce-value) + // ":" nc-value + // ":" unq(cnonce-value) + // ":" unq(qop-value) + // ":" H(A2) + // ) <"> + // if qop is missing, + // request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <"> + + $unhashedDigest = ''; + $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : ''; + $cnonce = $nonce; + if ($digestRequest['qop'] != '') { + $unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2; + } else { + $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2; + } + + $hashedDigest = md5($unhashedDigest); + + $this->outgoing_headers['Authorization'] = 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"'; + } + } elseif ($authtype == 'certificate') { + $this->certRequest = $certRequest; + } + $this->username = $username; + $this->password = $password; + $this->authtype = $authtype; + $this->digestRequest = $digestRequest; + + if (isset($this->outgoing_headers['Authorization'])) { + $this->debug('set Authorization: ' . substr($this->outgoing_headers['Authorization'], 0, 12) . '...'); + } else { + $this->debug('Authorization header not set'); + } + } + + /** + * set the soapaction value + * + * @param string $soapaction + * @access public + */ + function setSOAPAction($soapaction) { + $this->outgoing_headers['SOAPAction'] = '"' . $soapaction . '"'; + $this->debug('set SOAPAction: ' . $this->outgoing_headers['SOAPAction']); + } + + /** + * use http encoding + * + * @param string $enc encoding style. supported values: gzip, deflate, or both + * @access public + */ + function setEncoding($enc='gzip, deflate') { + if (function_exists('gzdeflate')) { + $this->protocol_version = '1.1'; + $this->outgoing_headers['Accept-Encoding'] = $enc; + $this->debug('set Accept-Encoding: ' . $this->outgoing_headers['Accept-Encoding']); + if (!isset($this->outgoing_headers['Connection'])) { + $this->outgoing_headers['Connection'] = 'close'; + $this->persistentConnection = false; + $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); + } + set_magic_quotes_runtime(0); + // deprecated + $this->encoding = $enc; + } + } + + /** + * set proxy info here + * + * @param string $proxyhost + * @param string $proxyport + * @param string $proxyusername + * @param string $proxypassword + * @access public + */ + function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') { + $this->uri = $this->url; + $this->host = $proxyhost; + $this->port = $proxyport; + if ($proxyusername != '' && $proxypassword != '') { + $this->outgoing_headers['Proxy-Authorization'] = ' Basic '.base64_encode($proxyusername.':'.$proxypassword); + $this->debug('set Proxy-Authorization: ' . $this->outgoing_headers['Proxy-Authorization']); + } + } + + /** + * decode a string that is encoded w/ "chunked' transfer encoding + * as defined in RFC2068 19.4.6 + * + * @param string $buffer + * @param string $lb + * @returns string + * @access public + * @deprecated + */ + function decodeChunked($buffer, $lb){ + // length := 0 + $length = 0; + $new = ''; + + // read chunk-size, chunk-extension (if any) and CRLF + // get the position of the linebreak + $chunkend = strpos($buffer, $lb); + if ($chunkend == FALSE) { + $this->debug('no linebreak found in decodeChunked'); + return $new; + } + $temp = substr($buffer,0,$chunkend); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend + strlen($lb); + // while (chunk-size > 0) { + while ($chunk_size > 0) { + $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size"); + $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size); + + // Just in case we got a broken connection + if ($chunkend == FALSE) { + $chunk = substr($buffer,$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + $length += strlen($chunk); + break; + } + + // read chunk-data and CRLF + $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + // length := length + chunk-size + $length += strlen($chunk); + // read chunk-size and CRLF + $chunkstart = $chunkend + strlen($lb); + + $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb); + if ($chunkend == FALSE) { + break; //Just in case we got a broken connection + } + $temp = substr($buffer,$chunkstart,$chunkend-$chunkstart); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend; + } + return $new; + } + + /* + * Writes payload, including HTTP headers, to $this->outgoing_payload. + */ + function buildPayload($data, $cookie_str = '') { + // add content-length header + $this->outgoing_headers['Content-Length'] = strlen($data); + $this->debug('set Content-Length: ' . $this->outgoing_headers['Content-Length']); + + // start building outgoing payload: + $req = "$this->request_method $this->uri HTTP/$this->protocol_version"; + $this->debug("HTTP request: $req"); + $this->outgoing_payload = "$req\r\n"; + + // loop thru headers, serializing + foreach($this->outgoing_headers as $k => $v){ + $hdr = $k.': '.$v; + $this->debug("HTTP header: $hdr"); + $this->outgoing_payload .= "$hdr\r\n"; + } + + // add any cookies + if ($cookie_str != '') { + $hdr = 'Cookie: '.$cookie_str; + $this->debug("HTTP header: $hdr"); + $this->outgoing_payload .= "$hdr\r\n"; + } + + // header/body separator + $this->outgoing_payload .= "\r\n"; + + // add data + $this->outgoing_payload .= $data; + } + + function sendRequest($data, $cookies = NULL) { + // build cookie string + $cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https'))); + + // build payload + $this->buildPayload($data, $cookie_str); + + if ($this->scheme == 'http' || $this->scheme == 'ssl') { + // send payload + if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) { + $this->setError('couldn\'t write message data to socket'); + $this->debug('couldn\'t write message data to socket'); + return false; + } + $this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload)); + return true; + } else if ($this->scheme == 'https') { + // set payload + // TODO: cURL does say this should only be the verb, and in fact it + // turns out that the URI and HTTP version are appended to this, which + // some servers refuse to work with + //curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $this->outgoing_payload); + foreach($this->outgoing_headers as $k => $v){ + $curl_headers[] = "$k: $v"; + } + if ($cookie_str != '') { + $curl_headers[] = 'Cookie: ' . $cookie_str; + } + curl_setopt($this->ch, CURLOPT_HTTPHEADER, $curl_headers); + if ($this->request_method == "POST") { + curl_setopt($this->ch, CURLOPT_POST, 1); + curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data); + } else { + } + $this->debug('set cURL payload'); + return true; + } + } + + function getResponse(){ + $this->incoming_payload = ''; + + if ($this->scheme == 'http' || $this->scheme == 'ssl') { + // loop until headers have been retrieved + $data = ''; + while (!isset($lb)){ + + // We might EOF during header read. + if(feof($this->fp)) { + $this->incoming_payload = $data; + $this->debug('found no headers before EOF after length ' . strlen($data)); + $this->debug("received before EOF:\n" . $data); + $this->setError('server failed to send headers'); + return false; + } + + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read line of $tmplen bytes: " . trim($tmp)); + + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of headers timed out after length ' . strlen($data)); + $this->debug("read before timeout: " . $data); + $this->setError('socket read of headers timed out'); + return false; + } + + $data .= $tmp; + $pos = strpos($data,"\r\n\r\n"); + if($pos > 1){ + $lb = "\r\n"; + } else { + $pos = strpos($data,"\n\n"); + if($pos > 1){ + $lb = "\n"; + } + } + // remove 100 header + if(isset($lb) && ereg('^HTTP/1.1 100',$data)){ + unset($lb); + $data = ''; + }// + } + // store header data + $this->incoming_payload .= $data; + $this->debug('found end of headers after length ' . strlen($data)); + // process headers + $header_data = trim(substr($data,0,$pos)); + $header_array = explode($lb,$header_data); + $this->incoming_headers = array(); + $this->incoming_cookies = array(); + foreach($header_array as $header_line){ + $arr = explode(':',$header_line, 2); + if(count($arr) > 1){ + $header_name = strtolower(trim($arr[0])); + $this->incoming_headers[$header_name] = trim($arr[1]); + if ($header_name == 'set-cookie') { + // TODO: allow multiple cookies from parseCookie + $cookie = $this->parseCookie(trim($arr[1])); + if ($cookie) { + $this->incoming_cookies[] = $cookie; + $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); + } else { + $this->debug('did not find cookie in ' . trim($arr[1])); + } + } + } else if (isset($header_name)) { + // append continuation line to previous header + $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; + } + } + + // loop until msg has been received + if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') { + $content_length = 2147483647; // ignore any content-length header + $chunked = true; + $this->debug("want to read chunked content"); + } elseif (isset($this->incoming_headers['content-length'])) { + $content_length = $this->incoming_headers['content-length']; + $chunked = false; + $this->debug("want to read content of length $content_length"); + } else { + $content_length = 2147483647; + $chunked = false; + $this->debug("want to read content to EOF"); + } + $data = ''; + do { + if ($chunked) { + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read chunk line of $tmplen bytes"); + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of chunk length timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of chunk length timed out'); + return false; + } + $content_length = hexdec(trim($tmp)); + $this->debug("chunk length $content_length"); + } + $strlen = 0; + while (($strlen < $content_length) && (!feof($this->fp))) { + $readlen = min(8192, $content_length - $strlen); + $tmp = fread($this->fp, $readlen); + $tmplen = strlen($tmp); + $this->debug("read buffer of $tmplen bytes"); + if (($tmplen == 0) && (!feof($this->fp))) { + $this->incoming_payload = $data; + $this->debug('socket read of body timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of body timed out'); + return false; + } + $strlen += $tmplen; + $data .= $tmp; + } + if ($chunked && ($content_length > 0)) { + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read chunk terminator of $tmplen bytes"); + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of chunk terminator timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of chunk terminator timed out'); + return false; + } + } + } while ($chunked && ($content_length > 0) && (!feof($this->fp))); + if (feof($this->fp)) { + $this->debug('read to EOF'); + } + $this->debug('read body of length ' . strlen($data)); + $this->incoming_payload .= $data; + $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server'); + + // close filepointer + if( + (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || + (! $this->persistentConnection) || feof($this->fp)){ + fclose($this->fp); + $this->fp = false; + $this->debug('closed socket'); + } + + // connection was closed unexpectedly + if($this->incoming_payload == ''){ + $this->setError('no response from server'); + return false; + } + + // decode transfer-encoding +// if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){ +// if(!$data = $this->decodeChunked($data, $lb)){ +// $this->setError('Decoding of chunked data failed'); +// return false; +// } + //print "
\nde-chunked:\n---------------\n$data\n\n---------------\n
"; + // set decoded payload +// $this->incoming_payload = $header_data.$lb.$lb.$data; +// } + + } else if ($this->scheme == 'https') { + // send and receive + $this->debug('send and receive with cURL'); + $this->incoming_payload = curl_exec($this->ch); + $data = $this->incoming_payload; + + $cErr = curl_error($this->ch); + if ($cErr != '') { + $err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'
'; + // TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE + foreach(curl_getinfo($this->ch) as $k => $v){ + $err .= "$k: $v
"; + } + $this->debug($err); + $this->setError($err); + curl_close($this->ch); + return false; + } else { + //echo '
';
+			//var_dump(curl_getinfo($this->ch));
+			//echo '
'; + } + // close curl + $this->debug('No cURL error, closing cURL'); + curl_close($this->ch); + + // remove 100 header(s) + while (ereg('^HTTP/1.1 100',$data)) { + if ($pos = strpos($data,"\r\n\r\n")) { + $data = ltrim(substr($data,$pos)); + } elseif($pos = strpos($data,"\n\n") ) { + $data = ltrim(substr($data,$pos)); + } + } + + // separate content from HTTP headers + if ($pos = strpos($data,"\r\n\r\n")) { + $lb = "\r\n"; + } elseif( $pos = strpos($data,"\n\n")) { + $lb = "\n"; + } else { + $this->debug('no proper separation of headers and document'); + $this->setError('no proper separation of headers and document'); + return false; + } + $header_data = trim(substr($data,0,$pos)); + $header_array = explode($lb,$header_data); + $data = ltrim(substr($data,$pos)); + $this->debug('found proper separation of headers and document'); + $this->debug('cleaned data, stringlen: '.strlen($data)); + // clean headers + foreach ($header_array as $header_line) { + $arr = explode(':',$header_line,2); + if(count($arr) > 1){ + $header_name = strtolower(trim($arr[0])); + $this->incoming_headers[$header_name] = trim($arr[1]); + if ($header_name == 'set-cookie') { + // TODO: allow multiple cookies from parseCookie + $cookie = $this->parseCookie(trim($arr[1])); + if ($cookie) { + $this->incoming_cookies[] = $cookie; + $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); + } else { + $this->debug('did not find cookie in ' . trim($arr[1])); + } + } + } else if (isset($header_name)) { + // append continuation line to previous header + $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; + } + } + } + + $arr = explode(' ', $header_array[0], 3); + $http_version = $arr[0]; + $http_status = intval($arr[1]); + $http_reason = count($arr) > 2 ? $arr[2] : ''; + + // see if we need to resend the request with http digest authentication + if (isset($this->incoming_headers['location']) && $http_status == 301) { + $this->debug("Got 301 $http_reason with Location: " . $this->incoming_headers['location']); + $this->setURL($this->incoming_headers['location']); + $this->tryagain = true; + return false; + } + + // see if we need to resend the request with http digest authentication + if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) { + $this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']); + if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) { + $this->debug('Server wants digest authentication'); + // remove "Digest " from our elements + $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']); + + // parse elements into array + $digestElements = explode(',', $digestString); + foreach ($digestElements as $val) { + $tempElement = explode('=', trim($val), 2); + $digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]); + } + + // should have (at least) qop, realm, nonce + if (isset($digestRequest['nonce'])) { + $this->setCredentials($this->username, $this->password, 'digest', $digestRequest); + $this->tryagain = true; + return false; + } + } + $this->debug('HTTP authentication failed'); + $this->setError('HTTP authentication failed'); + return false; + } + + if ( + ($http_status >= 300 && $http_status <= 307) || + ($http_status >= 400 && $http_status <= 417) || + ($http_status >= 501 && $http_status <= 505) + ) { + $this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient2->response has contents of the response)"); + return false; + } + + // decode content-encoding + if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){ + if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){ + // if decoding works, use it. else assume data wasn't gzencoded + if(function_exists('gzinflate')){ + //$timer->setMarker('starting decoding of gzip/deflated content'); + // IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress) + // this means there are no Zlib headers, although there should be + $this->debug('The gzinflate function exists'); + $datalen = strlen($data); + if ($this->incoming_headers['content-encoding'] == 'deflate') { + if ($degzdata = @gzinflate($data)) { + $data = $degzdata; + $this->debug('The payload has been inflated to ' . strlen($data) . ' bytes'); + if (strlen($data) < $datalen) { + // test for the case that the payload has been compressed twice + $this->debug('The inflated payload is smaller than the gzipped one; try again'); + if ($degzdata = @gzinflate($data)) { + $data = $degzdata; + $this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes'); + } + } + } else { + $this->debug('Error using gzinflate to inflate the payload'); + $this->setError('Error using gzinflate to inflate the payload'); + } + } elseif ($this->incoming_headers['content-encoding'] == 'gzip') { + if ($degzdata = @gzinflate(substr($data, 10))) { // do our best + $data = $degzdata; + $this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes'); + if (strlen($data) < $datalen) { + // test for the case that the payload has been compressed twice + $this->debug('The un-gzipped payload is smaller than the gzipped one; try again'); + if ($degzdata = @gzinflate(substr($data, 10))) { + $data = $degzdata; + $this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes'); + } + } + } else { + $this->debug('Error using gzinflate to un-gzip the payload'); + $this->setError('Error using gzinflate to un-gzip the payload'); + } + } + //$timer->setMarker('finished decoding of gzip/deflated content'); + //print "\nde-inflated:\n---------------\n$data\n-------------\n"; + // set decoded payload + $this->incoming_payload = $header_data.$lb.$lb.$data; + } else { + $this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); + $this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); + } + } else { + $this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); + $this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); + } + } else { + $this->debug('No Content-Encoding header'); + } + + if(strlen($data) == 0){ + $this->debug('no data after headers!'); + $this->setError('no data present after HTTP headers'); + return false; + } + + return $data; + } + + function setContentType($type, $charset = false) { + $this->outgoing_headers['Content-Type'] = $type . ($charset ? '; charset=' . $charset : ''); + $this->debug('set Content-Type: ' . $this->outgoing_headers['Content-Type']); + } + + function usePersistentConnection(){ + if (isset($this->outgoing_headers['Accept-Encoding'])) { + return false; + } + $this->protocol_version = '1.1'; + $this->persistentConnection = true; + $this->outgoing_headers['Connection'] = 'Keep-Alive'; + $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); + return true; + } + + /** + * parse an incoming Cookie into it's parts + * + * @param string $cookie_str content of cookie + * @return array with data of that cookie + * @access private + */ + /* + * TODO: allow a Set-Cookie string to be parsed into multiple cookies + */ + function parseCookie($cookie_str) { + $cookie_str = str_replace('; ', ';', $cookie_str) . ';'; + $data = split(';', $cookie_str); + $value_str = $data[0]; + + $cookie_param = 'domain='; + $start = strpos($cookie_str, $cookie_param); + if ($start > 0) { + $domain = substr($cookie_str, $start + strlen($cookie_param)); + $domain = substr($domain, 0, strpos($domain, ';')); + } else { + $domain = ''; + } + + $cookie_param = 'expires='; + $start = strpos($cookie_str, $cookie_param); + if ($start > 0) { + $expires = substr($cookie_str, $start + strlen($cookie_param)); + $expires = substr($expires, 0, strpos($expires, ';')); + } else { + $expires = ''; + } + + $cookie_param = 'path='; + $start = strpos($cookie_str, $cookie_param); + if ( $start > 0 ) { + $path = substr($cookie_str, $start + strlen($cookie_param)); + $path = substr($path, 0, strpos($path, ';')); + } else { + $path = '/'; + } + + $cookie_param = ';secure;'; + if (strpos($cookie_str, $cookie_param) !== FALSE) { + $secure = true; + } else { + $secure = false; + } + + $sep_pos = strpos($value_str, '='); + + if ($sep_pos) { + $name = substr($value_str, 0, $sep_pos); + $value = substr($value_str, $sep_pos + 1); + $cookie= array( 'name' => $name, + 'value' => $value, + 'domain' => $domain, + 'path' => $path, + 'expires' => $expires, + 'secure' => $secure + ); + return $cookie; + } + return false; + } + + /** + * sort out cookies for the current request + * + * @param array $cookies array with all cookies + * @param boolean $secure is the send-content secure or not? + * @return string for Cookie-HTTP-Header + * @access private + */ + function getCookiesForRequest($cookies, $secure=false) { + $cookie_str = ''; + if ((! is_null($cookies)) && (is_array($cookies))) { + foreach ($cookies as $cookie) { + if (! is_array($cookie)) { + continue; + } + $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); + if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if (strtotime($cookie['expires']) <= time()) { + $this->debug('cookie has expired'); + continue; + } + } + if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { + $domain = preg_quote($cookie['domain']); + if (! preg_match("'.*$domain$'i", $this->host)) { + $this->debug('cookie has different domain'); + continue; + } + } + if ((isset($cookie['path'])) && (! empty($cookie['path']))) { + $path = preg_quote($cookie['path']); + if (! preg_match("'^$path.*'i", $this->path)) { + $this->debug('cookie is for a different path'); + continue; + } + } + if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) { + $this->debug('cookie is secure, transport is not'); + continue; + } + $cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; '; + $this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']); + } + } + return $cookie_str; + } +} + + ?> Modified: vtigercrm/branches/5.1_jens/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/CommonUtils.php Tue Nov 14 03:16:10 2006 @@ -220,6 +220,33 @@ return $string; } +/** + * Function used to decodes the given single quote and double quote only. This function used for popup selection + * @param string $string - string to be converted, $encode - flag to decode + * @return string $string - the decoded value in string fromat where as only single and double quotes will be decoded + */ + +function popup_from_html($string, $encode=true) +{ + global $log; + $log->debug("Entering popup_from_html(".$string.",".$encode.") method ..."); + + $popup_toHtml = array( + '"' => '"', + "'" => ''', + ); + + //if($encode && is_string($string))$string = html_entity_decode($string, ENT_QUOTES); + if($encode && is_string($string)) + { + $string = addslashes(str_replace(array_values($popup_toHtml), array_keys($popup_toHtml), $string)); + } + + $log->debug("Exiting popup_from_html method ..."); + return $string; +} + + /** To get the Currency of the specified user * @param $id -- The user Id:: Type integer * @returns vtiger_currencyid :: Type integer @@ -411,6 +438,27 @@ $log->debug("Exiting getContactName method ..."); return $contact_name; } + +/** + * Function to get the Campaign Name when a campaign id is given + * Takes the input as $campaign_id - campaign id + * returns the Campaign Name in string format. + */ + +function getOrgUnitName($orgunit_id) +{ + global $log; + $log->debug("Entering getOrgUnitName(".$orgunit_id.") method ..."); + $log->info("in getOrgUnitName ".$orgunit_id); + + global $adb; + $sql = "select * from vtiger_orgunit where orgunitid=".$orgunit_id; + $result = $adb->query($sql); + $orgunit_name = $adb->query_result($result,0,"name"); + $log->debug("Exiting getOrgUnitName method ..."); + return $orgunit_name; +} + /** * Function to get the Campaign Name when a campaign id is given @@ -600,9 +648,6 @@ /** * Get the username by giving the user id. This method expects the user id - * param $label_list - the array of strings to that contains the option list - * param $key_list - the array of strings to that contains the values list - * param $selected - the string which contains the default value */ function getUserName($userid) @@ -620,6 +665,29 @@ } $log->debug("Exiting getUserName method ..."); return $user_name; +} + +/** +* Get the user full name by giving the user id. This method expects the user id +* DG 30 Aug 2006 +*/ + +function getUserFullName($userid) +{ + global $log; + $log->debug("Entering getUserFullName(".$userid.") method ..."); + $log->info("in getUserFullName ".$userid); + global $adb; + if($userid != '') + { + $sql = "select first_name, last_name from vtiger_users where id=".$userid; + $result = $adb->query($sql); + $first_name = $adb->query_result($result,0,"first_name"); + $last_name = $adb->query_result($result,0,"last_name"); + $user_name = $first_name." ".$last_name; + } + $log->debug("Exiting getUserFullName method ..."); + return $user_name; } /** @@ -1020,7 +1088,6 @@ $result = $adb->query($sql); $getBlockInfo=getBlockInformation($module,$result,$col_fields,$tabid,$block_label,$mode); } - $log->debug("Exiting getBlocks method ..."); $index_count =1; $max_index =0; foreach($getBlockInfo as $label=>$contents) @@ -1045,6 +1112,7 @@ } } + $log->debug("Exiting getBlocks method ..."); return $getBlockInfo; } /** @@ -1552,27 +1620,26 @@ $value = $_REQUEST[$fieldname]; $focus->column_fields[$fieldname] = $value; } - if(isset($_REQUEST['txtTax'])) - { - $value = convertToDollar($_REQUEST['txtTax'],$rate); - $focus->column_fields['txtTax'] = $value; - } - if(isset($_REQUEST['txtAdjustment'])) - { - $value = convertToDollar($_REQUEST['txtAdjustment'],$rate); - $focus->column_fields['txtAdjustment'] = $value; - } - if(isset($_REQUEST['hdnSubTotal'])) - { - $value = convertToDollar($_REQUEST['hdnSubTotal'],$rate); - $focus->column_fields['hdnSubTotal'] = $value; - } - if(isset($_REQUEST['hdnGrandTotal'])) - { - $value = convertToDollar($_REQUEST['hdnGrandTotal'],$rate); - $focus->column_fields['hdnGrandTotal'] = $value; - } - + } + if(isset($_REQUEST['txtTax'])) + { + $value = convertToDollar($_REQUEST['txtTax'],$rate); + $focus->column_fields['txtTax'] = $value; + } + if(isset($_REQUEST['txtAdjustment'])) + { + $value = convertToDollar($_REQUEST['txtAdjustment'],$rate); + $focus->column_fields['txtAdjustment'] = $value; + } + if(isset($_REQUEST['hdnSubTotal'])) + { + $value = convertToDollar($_REQUEST['hdnSubTotal'],$rate); + $focus->column_fields['hdnSubTotal'] = $value; + } + if(isset($_REQUEST['hdnGrandTotal'])) + { + $value = convertToDollar($_REQUEST['hdnGrandTotal'],$rate); + $focus->column_fields['hdnGrandTotal'] = $value; } $log->debug("Exiting setObjectValuesFromRequest method ..."); } @@ -1953,7 +2020,10 @@ foreach($object_column_fields as $fieldname => $fieldlabel) { - $description .= $fieldlabel.' : '.$focus->column_fields[$fieldname].'
'; + //Get the translated string + $temp_label = isset($app_strings[$fieldlabel])?$app_strings[$fieldlabel]:(isset($mod_strings[$fieldlabel])?$mod_strings[$fieldlabel]:$fieldlabel); + + $description .= $temp_label.' : '.$focus->column_fields[$fieldname].'
'; } $description .= '

Thank You
'; @@ -1976,6 +2046,26 @@ $change_owner = get_select_options_with_id($usernamelist,'admin'); $log->debug("Exiting getUserslist method ..."); return $change_owner; +} + + +function getGroupslist() +{ + global $log; + $log->debug("Entering getGroupslist() method ..."); + global $adb; + $result=$adb->query("select * from vtiger_groups"); + + for($i=0;$i<$adb->num_rows($result);$i++) + { + $groupidlist[$i]=$adb->query_result($result,$i,'groupid'); + $groupnamelist[$groupidlist[$i]]=$adb->query_result($result,$i,'groupname'); + + } + $change_groups_owner = get_select_options_with_id($groupnamelist,''); + $log->debug("Exiting getGroupslist method ..."); + + return $change_groups_owner; } @@ -2019,214 +2109,30 @@ global $log; $log->debug("Entering getEntityName(".$module.") method ..."); - switch ($module) - { - case "Accounts" : $query = "select accountname from vtiger_account where accountid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $account_name = array(); - for ($i = 0; $i < $numrows; $i++) - { - $acc_id = $ids_list[$i]; - $account_name[$acc_id] = $adb->query_result($result,$i,'accountname'); - } - return $account_name; - break; - - case "Leads" : $query = "select concat(firstname,' ',lastname) as leadname from vtiger_leaddetails where leadid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $lead_name = array(); - for($i = 0; $i < $numrows; $i++) - { - $lead_id = $ids_list[$i]; - $lead_name[$lead_id] = $adb->query_result($result,$i,'leadname'); - } - - return $lead_name; - break; - - case "Contacts" : $query = "select concat(firstname,' ',lastname) as contactname from vtiger_contactdetails where contactid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $contact_name = array(); - for($i=0; $i < $numrows; $i++) - { - $cont_id = $ids_list[$i]; - $contact_name[$cont_id] = $adb->query_result($result,$i,'contactname'); - } - - return $contact_name; - break; - - case "Potentials" : $query = "select potentialname from vtiger_potential where potentialid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $potential_name = array(); - for($i=0; $i < $numrows; $i++) - { - $pot_id = $ids_list[$i]; - $potential_name[$pot_id] = $adb->query_result($result,$i,'potentialname'); - } - - return $potential_name; - break; - - case "Quotes" : $query = "select subject from vtiger_quotes where quoteid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $quote_subject = array(); - for($i=0; $i < $numrows; $i++) - { - $quote_id = $ids_list[$i]; - $quote_subject[$quote_id] = $adb->query_result($result,$i,'subject'); - } - - return $quote_subject; - break; - - case "SalesOrder" : $query = "select subject from vtiger_salesorder where salesorderid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $so_subject = array(); - for($i=0; $i < $numrows; $i++) - { - $so_id = $ids_list[$i]; - $so_subject[$so_id] = $adb->query_result($result,$i,'subject'); - } - - return $so_subject; - break; - - case "Invoice" : $query = "select subject from vtiger_invoice where invoiceid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $inv_subject = array(); - for($i=0; $i < $numrows; $i++) - { - $inv_id = $ids_list[$i]; - $inv_subject[$inv_id] = $adb->query_result($result,$i,'subject'); - } - - return $inv_subject; - break; - - case "Products" : $query = "select productname from vtiger_products where productid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $product_name = array(); - for($i=0; $i < $numrows; $i++) - { - $prod_id = $ids_list[$i]; - $product_name[$prod_id] = $adb->query_result($result,$i,'productname'); - } - - return $product_name; - break; - - case "PriceBooks" : $query = "select bookname from vtiger_pricebook where pricebookid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $pbook_name = array(); - for($i=0; $i < $numrows; $i++) - { - $pbook_id = $ids_list[$i]; - $pbook_name[$pbook_id] = $adb->query_result($result,$i,'bookname'); - } - - return $pbook_name; - break; - - case "Notes" : $query = "select title from vtiger_notes where notesid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $notes_title = array(); - for($i=0; $i < $numrows; $i++) - { - $note_id = $ids_list[$i]; - $notes_title[$note_id] = $adb->query_result($result,$i,'title'); - } - - return $notes_title; - break; - - case "Calendar" : $query = "select subject from vtiger_activity where activityid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $activity_subject = array(); - for($i=0; $i < $numrows; $i++) - { - $act_id = $ids_list[$i]; - $activity_subject[$act_id] = $adb->query_result($result,$i,'subject'); - } - - return $activity_subject; - break; - - case "Campaigns" : $query = "select campaignname from vtiger_campaign where campaignid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $campaign_name = array(); - for($i=0; $i < $numrows; $i++) - { - $cmpn_id = $ids_list[$i]; - $campaign_name[$cmpn_id] = $adb->query_result($result,$i,'campaignname'); - } - - return $campaign_name; - break; - - case "Faq" : $query = "select question from vtiger_faq where id in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $faq_name = array(); - for($i=0; $i < $numrows; $i++) - { - $faq_id = $ids_list[$i]; - $faq_name[$faq_id] = $adb->query_result($result,$i,'question'); - } - - return $faq_name; - break; - - case "Vendors" : $query = "select vendorname from vtiger_vendor where vendorid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $vendor_name = array(); - for($i=0; $i < $numrows; $i++) - { - $ven_id = $ids_list[$i]; - $vendor_name[$ven_id] = $adb->query_result($result,$i,'vendorname'); - } - - return $vendor_name; - break; - - case "PurchaseOrder" : $query = "select subject from vtiger_purchaseorder where purchaseorderid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $po_name = array(); - for($i=0; $i < $numrows; $i++) - { - $po_id = $ids_list[$i]; - $po_name[$po_id] = $adb->query_result($result,$i,'subject'); - } - - return $po_name; - break; - - case "HelpDesk" : $query = "select title from vtiger_troubletickets where ticketid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $ticket_name = array(); - for($i=0; $i < $numrows; $i++) - { - $tick_id = $ids_list[$i]; - $ticket_name[$tick_id] = $adb->query_result($result,$i,'title'); - } - - return $ticket_name; - break; + if($module != '') + { + $query = "select fieldname,tablename,entityidfield from vtiger_entityname where modulename = '$module'"; + $result = $adb->query($query); + $fieldsname = $adb->query_result($result,0,'fieldname'); + $tablename = $adb->query_result($result,0,'tablename'); + $entityidfield = $adb->query_result($result,0,'entityidfield'); + if(!(strpos($fieldsname,',') === false)) + { + $fieldlists = explode(',',$fieldsname); + $fieldsname = "concat("; + $fieldsname = $fieldsname.implode(",' ',",$fieldlists); + $fieldsname = $fieldsname.")"; + } + $query1 = "select $fieldsname as entityname from $tablename where $entityidfield in (".$list.")"; + $result = $adb->query($query1); + $numrows = $adb->num_rows($result); + $account_name = array(); + for ($i = 0; $i < $numrows; $i++) + { + $entity_id = $ids_list[$i]; + $entity_info[$entity_id] = $adb->query_result($result,$i,'entityname'); + } + return $entity_info; } $log->debug("Exiting getEntityName method ..."); } @@ -2430,6 +2336,13 @@ case 'Contacts': if(is_array($fields["contacts"])) { + //Checking for salutation type and checking the table column to be queried + $key = array_search('salutationtype',$fields["contacts"]); + if(isset($key) && $key !='') + { + $fields["contacts"][$key]='salutation'; + } + $columnfields = implode(',',$fields["contacts"]); $query = 'select '.$columnfields.' from vtiger_contactdetails where contactid='.$id; $result = $adb->query($query); @@ -2443,6 +2356,12 @@ case 'Leads': if(is_array($fields["leads"])) { + //Checking for salutation type and checking the table column to be queried + $key = array_search('salutationtype',$fields["contacts"]); + if(isset($key) && $key !='') + { + $fields["contacts"][$key]='salutation'; + } $columnfields = implode(',',$fields["leads"]); $query = 'select '.$columnfields.' from vtiger_leaddetails where leadid='.$id; $result = $adb->query($query); Modified: vtigercrm/branches/5.1_jens/include/utils/DeleteUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/DeleteUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/DeleteUtils.php Tue Nov 14 03:16:10 2006 @@ -6,7 +6,7 @@ * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. -* + * ********************************************************************************/ /** @@ -341,11 +341,22 @@ $del_query = "delete from vtiger_portal where portalid=".$record; $adb->query($del_query); break; + case Organization: + $del_query = "update vtiger_orgunit set deleted=1 where organizationname='".$record."'"; + $adb->query($del_query); + $del_query = "update vtiger_organizationdetails set deleted=1 where organizationname='".$record."'"; + $adb->query($del_query); + break; + case OrgUnit: + $del_query = "update vtiger_orgunit set deleted=1 where orgunitid=".$record; + $adb->query($del_query); + break; endswitch; } //this is added to update the crmentity.deleted=1 when we delete from listview and not from relatedlist - if($return_module == $module && $return_module !='Rss' && $return_module !='Portal') + if($return_module == $module && $return_module != 'Rss' && $return_module != 'Portal' && + $return_module != 'Organization' && $return_module != 'OrgUnit') { require_once('include/freetag/freetag.class.php'); $freetag=new freetag(); @@ -354,7 +365,7 @@ } //This is to delete the entity information from tracker ie., lastviewed - if($module != 'Faq') + if($module != 'Faq' && $module != 'Organization' && $module != 'OrgUnit') { $sql_recentviewed ='delete from vtiger_tracker where user_id = '.$current_user->id.' and item_id = '.$record; $adb->query($sql_recentviewed); Modified: vtigercrm/branches/5.1_jens/include/utils/DetailViewUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/DetailViewUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/DetailViewUtils.php Tue Nov 14 03:16:10 2006 @@ -304,7 +304,8 @@ { $imgpath = "test/contact/".$imagename; $label_fld[] =$mod_strings[$fieldlabel]; - $label_fld["cntimage"] ='
 '.$mod_strings[$fieldlabel]; + //This is used to show the contact image as a thumbnail near First Name field + //$label_fld["cntimage"] ='
 '.$mod_strings[$fieldlabel]; } else { @@ -332,7 +333,8 @@ $value = $col_fields[$fieldname]; if($value == 1) { - $display_val = 'yes'; + //Since "yes" is not been translated it is given as app strings here.. + $display_val = $app_strings['yes']; } else { @@ -363,7 +365,6 @@ $label_fld[] = $campaign_name; $label_fld["secid"] = $campaign_id; $label_fld["link"] = "index.php?module=Campaigns&action=DetailView&record=".$campaign_id; - } elseif($uitype == 59) { @@ -462,7 +463,7 @@ if($tabid==4) { //$imgpath = getModuleFileStoragePath('Contacts').$col_fields[$fieldname]; - $sql = "select vtiger_attachments.* from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid where vtiger_seattachmentsrel.crmid=".$col_fields['record_id']; + $sql = "select vtiger_attachments.* from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid inner join vtiger_contactdetails on vtiger_contactdetails.imagename=vtiger_attachments.name where vtiger_seattachmentsrel.crmid=".$col_fields['record_id']; $image_res = $adb->query($sql); $image_id = $adb->query_result($image_res,0,'attachmentsid'); $image_path = $adb->query_result($image_res,0,'path'); @@ -554,11 +555,14 @@ } - elseif($uitype == 105)//Added for user image + // UItype 105 added for user image + elseif($uitype == 105) { $label_fld[] =$mod_strings[$fieldlabel]; - //$imgpath = getModuleFileStoragePath('Contacts').$col_fields[$fieldname]; - $sql = "select vtiger_attachments.* from vtiger_attachments left join vtiger_salesmanattachmentsrel on vtiger_salesmanattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid where vtiger_salesmanattachmentsrel.smid=".$col_fields['record_id']; + $sql = "select vtiger_attachments.* from vtiger_attachments + left join vtiger_salesmanattachmentsrel + on vtiger_salesmanattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + where vtiger_salesmanattachmentsrel.smid=".$col_fields['record_id']; $image_res = $adb->query($sql); $image_id = $adb->query_result($image_res,0,'attachmentsid'); $image_path = $adb->query_result($image_res,0,'path'); @@ -568,6 +572,18 @@ $label_fld[] =''.$col_fields['user_name'].''; else $label_fld[] = ''; + } + // UItype 107 added for company logo + elseif($uitype == 107) + { + $label_fld[] =$mod_strings[$fieldlabel]; + $sql = "select logoname from vtiger_organizationdetails where organizationname='".$col_fields['record_id']."'"; + $image_res = $adb->query($sql); + $image_name = $adb->query_result($image_res,0,'logoname'); + if($image_name != '') + $label_fld[] = $image_name; + else + $label_fld[] = ''; } elseif($uitype == 66) { @@ -847,6 +863,18 @@ } $label_fld["cursymb"] = $curr_symbol; $label_fld[] = $display_val; + } + elseif($uitype == 74) + { + $label_fld[] =$mod_strings[$fieldlabel]; + $orgunit_id = $col_fields[$fieldname]; + if($orgunit_id != '') + { + $orgunit_name = getOrgUnitName($orgunit_id); + } + $label_fld[] = $orgunit_name; + $label_fld["secid"] = $orgunit_id; + $label_fld["link"] = "index.php?module=Organization&action=DetailView&record=".$orgunit_id; } elseif($uitype == 75 || $uitype == 81) { @@ -932,6 +960,10 @@ $label_fld[] = ''.getRoleName($col_fields[$fieldname]).''; else $label_fld[] = getRoleName($col_fields[$fieldname]); + }elseif($uitype == 85) //Added for Skype by Minnie + { + $label_fld[] =$mod_strings[$fieldlabel]; + $label_fld[]= $col_fields[$fieldname]; } else { @@ -940,13 +972,20 @@ $col_fields[$fieldname]=''; if($uitype == 1 && ($fieldname=='expectedrevenue' || $fieldname=='budgetcost' || $fieldname=='actualcost' || $fieldname=='expectedroi' || $fieldname=='actualroi' )) { - $label_fld[] = convertFromDollar($col_fields[$fieldname],$rate); + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $label_fld[] = convertFromDollar($col_fields[$fieldname],$rate_symbol['rate']); } else $label_fld[] = $col_fields[$fieldname]; } $label_fld[]=$uitype; + // For inheritance + if ( in_array($uitype,array(3,4,18,31,32)) ) + { + $label_fld["inherit"] = $col_fields[$fieldname."@##@"]; + } + //sets whether the currenct user is admin or not if(is_admin($current_user)) { @@ -1352,7 +1391,7 @@ $custfld = getDetailViewOutputHtml($uitype, $fieldname, $fieldlabel, $col_fields,$generatedtype,$tabid); if(is_array($custfld)) { - $label_data[$block][] = array($custfld[0]=>array("value"=>$custfld[1],"ui"=>$custfld[2],"options"=>$custfld["options"],"secid"=>$custfld["secid"],"link"=>$custfld["link"],"cursymb"=>$custfld["cursymb"],"salut"=>$custfld["salut"],"cntimage"=>$custfld["cntimage"],"isadmin"=>$custfld["isadmin"],"tablename"=>$fieldtablename,"fldname"=>$fieldname)); + $label_data[$block][] = array($custfld[0]=>array("value"=>$custfld[1],"ui"=>$custfld[2],"options"=>$custfld["options"],"secid"=>$custfld["secid"],"link"=>$custfld["link"],"cursymb"=>$custfld["cursymb"],"salut"=>$custfld["salut"],"cntimage"=>$custfld["cntimage"],"isadmin"=>$custfld["isadmin"],"tablename"=>$fieldtablename,"fldname"=>$fieldname,"inherit"=>$custfld["inherit"])); } $i++; if($i<$noofrows) @@ -1370,7 +1409,7 @@ $custfld = getDetailViewOutputHtml($uitype, $fieldname, $fieldlabel, $col_fields,$generatedtype,$tabid); if(is_array($custfld)) { - $label_data[$block][] = array($custfld[0]=>array("value"=>$custfld[1],"ui"=>$custfld[2],"options"=>$custfld["options"],"secid"=>$custfld["secid"],"link"=>$custfld["link"],"cursymb"=>$custfld["cursymb"],"salut"=>$custfld["salut"],"cntimage"=>$custfld["cntimage"],"isadmin"=>$custfld["isadmin"],"tablename"=>$fieldtablename,"fldname"=>$fieldname)); + $label_data[$block][] = array($custfld[0]=>array("value"=>$custfld[1],"ui"=>$custfld[2],"options"=>$custfld["options"],"secid"=>$custfld["secid"],"link"=>$custfld["link"],"cursymb"=>$custfld["cursymb"],"salut"=>$custfld["salut"],"cntimage"=>$custfld["cntimage"],"isadmin"=>$custfld["isadmin"],"tablename"=>$fieldtablename,"fldname"=>$fieldname,"inherit"=>$custfld["inherit"])); } } Modified: vtigercrm/branches/5.1_jens/include/utils/EditViewUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/EditViewUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/EditViewUtils.php Tue Nov 14 03:16:10 2006 @@ -106,7 +106,8 @@ } else { - $curr_time = date('H:i'); + $endtime = time() + (60 * 60); + $curr_time = date('H:i',$endtime); } } $fieldvalue[] = array($disp_value => $curr_time) ; @@ -151,7 +152,12 @@ } $fieldvalue [] = $options; } - elseif($uitype == 17) + elseif($uitype == 17 || $uitype == 18) + { + $editview_label[]=$mod_strings[$fieldlabel]; + $fieldvalue [] = $value; + } + elseif($uitype == 85) //added for Skype by Minnie { $editview_label[]=$mod_strings[$fieldlabel]; $fieldvalue [] = $value; @@ -578,8 +584,8 @@ $query = 'select vtiger_attachments.path, vtiger_attachments.attachmentsid, vtiger_attachments.name from vtiger_products left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_products.productid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where productid='.$col_fields['record_id']; } else - { - $query = "select vtiger_attachments.path, vtiger_attachments.attachmentsid, vtiger_attachments.name from vtiger_contactdetails left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_contactdetails.contactid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where contactid=".$col_fields['record_id']; + { + $query = "select vtiger_attachments.* from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid inner join vtiger_contactdetails on vtiger_contactdetails.imagename=vtiger_attachments.name where vtiger_seattachmentsrel.crmid=".$col_fields['record_id']; } $result_image = $adb->query($query); for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++) @@ -857,15 +863,15 @@ $nemail=count($realid); if ($pmodule=='Accounts'){ - require_once('modules/Accounts/Account.php'); - $myfocus = new Account(); + require_once('modules/Accounts/Accounts.php'); + $myfocus = new Accounts(); $myfocus->retrieve_entity_info($entityid,"Accounts"); $fullname=br2nl($myfocus->column_fields['accountname']); $account_selected = 'selected'; } elseif ($pmodule=='Contacts'){ - require_once('modules/Contacts/Contact.php'); - $myfocus = new Contact(); + require_once('modules/Contacts/Contacts.php'); + $myfocus = new Contacts(); $myfocus->retrieve_entity_info($entityid,"Contacts"); $fname=br2nl($myfocus->column_fields['firstname']); $lname=br2nl($myfocus->column_fields['lastname']); @@ -873,8 +879,8 @@ $contact_selected = 'selected'; } elseif ($pmodule=='Leads'){ - require_once('modules/Leads/Lead.php'); - $myfocus = new Lead(); + require_once('modules/Leads/Leads.php'); + $myfocus = new Leads(); $myfocus->retrieve_entity_info($entityid,"Leads"); $fname=br2nl($myfocus->column_fields['firstname']); $lname=br2nl($myfocus->column_fields['lastname']); @@ -1195,12 +1201,14 @@ elseif($uitype == 105) { $editview_label[]=$mod_strings[$fieldlabel]; - $query = "select attachments.path, attachments.name from contactdetails left join seattachmentsrel on seattachmentsrel.crmid=contactdetails.contactid inner join attachments on attachments.attachmentsid=seattachmentsrel.attachmentsid where contactdetails.imagename=attachments.name and contactid=".$col_fields['record_id']; - $result_image = $adb->query($query); - for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++) - { - $image_array[] = $adb->query_result($result_image,$image_iter,'name'); - $image_path_array[] = $adb->query_result($result_image,$image_iter,'path'); + if( isset( $col_fields['record_id']) && $col_fields['record_id'] != '') { + $query = "select vtiger_attachments.path, vtiger_attachments.name from vtiger_contactdetails left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_contactdetails.contactid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where vtiger_contactdetails.imagename=vtiger_attachments.name and contactid=".$col_fields['record_id']; + $result_image = $adb->query($query); + for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++) + { + $image_array[] = $adb->query_result($result_image,$image_iter,'name'); + $image_path_array[] = $adb->query_result($result_image,$image_iter,'path'); + } } if(is_array($image_array)) for($img_itr=0;$img_itrdebug("Exiting getOutputHtml method ..."); return $final_arr; } @@ -1827,4 +1842,104 @@ } +/** This function returns the detailed list of organization units associated to +* the selected organization +* Param $organization - organization object +*/ + +function getOrgUnits($organization,$orgunitid="") +{ + // The array we're about to build + $orgunittab = array(); + $fields = "orgunitid,type,name,address,city,state,country,code,phone,fax,website"; + $fields .= ",logoname,quote_template,so_template,po_template,invoice_template"; + global $adb; + + // Parameter check + if( !isset( $organization) || $organization == '' || + !isset( $organization->id) || $organization->id == '') + return $orgunittab; + + // Database query + if( $orgunitid != "0") + $query = "SELECT vtiger_orgunit.orgunitid AS orgunitid,"; + else + $query = "SELECT 0 AS orgunitid,"; + + // logoname is only defined in the organization record. + $query .= "'@##@' AS logoname, vtiger_organizationdetails.logoname AS org_logoname"; + + foreach( split( ',', $fields) as $field) { + if( $field != "orgunitid" && $field != "logoname") { + if( $orgunitid != "0") + $query .= ",vtiger_orgunit.".$field." AS ".$field; + else + $query .= ",NULL AS ".$field; + if( $field != "type" && $field != "name") + $query .= ",vtiger_organizationdetails.".$field." AS org_".$field; + } + } + + if( $orgunitid != "0" ) { + // database joins + $query .= " FROM vtiger_orgunit + LEFT JOIN vtiger_organizationdetails + ON vtiger_orgunit.organizationname=vtiger_organizationdetails.organizationname "; + + // single or list query? + if( $orgunitid == "") + $query .= "WHERE vtiger_orgunit.organizationname='".$organization->id."' "; + else + $query .= "WHERE vtiger_orgunit.orgunitid=".$orgunitid." "; + + // do not return deleted orgunits + $query .= "AND vtiger_orgunit.deleted=0"; + } + + else { + $query .= " FROM vtiger_organizationdetails "; + $query .= " WHERE vtiger_organizationdetails.organizationname='".$organization->id."' "; + } + + // Do not return deleted organizations + $query .= " AND vtiger_organizationdetails.deleted=0"; + + $result = $adb->query( $query); + $noofrows = $adb->num_rows($result); + + // Get all rows from database + for($j = 0; $j < $noofrows; $j++) { + $orgunit = array(); + foreach( split( ',', $fields) as $field) { + if( $orgunitid != "0") { + $orgunit[$field] = $adb->query_result($result,$j,$field); + + // Inherited and extended fields + if( substr( $orgunit[$field], 0, 4) == "@##@") { + if( $field == "name") { + $orgunit[$field] = substr($orgunit[$field], 4, strlen( $orgunit[$field])-4); + if( $orgunitid != "") + $orgunit[$field] = $organization->id." ".$orgunit[$field]; + } else { + $orgunit[$field] = $adb->query_result($result,$j,"org_".$field); + } + } + } + + // no orgunit selected + else { + if( $field == "name") + $orgunit[$field] = $organization->id; + elseif( $field == "orgunitid") + $orgunit[$field] = 0; + else + $orgunit[$field] = $adb->query_result($result,$j,"org_".$field); + } + } + $id = $orgunit["orgunitid"]; + $orgunittab[$id] = $orgunit; + } + // Return what we've found + return $orgunittab; +} ?> Modified: vtigercrm/branches/5.1_jens/include/utils/InventoryUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/InventoryUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/InventoryUtils.php Tue Nov 14 03:16:10 2006 @@ -469,7 +469,7 @@ * @param $update_prod_stock - true or false (default), if true we have to update the stock for PO only * @return void */ -function saveInventoryProductDetails($focus, $module, $update_prod_stock='false') +function saveInventoryProductDetails($focus, $module, $update_prod_stock='false', $updateDemand='') { global $log, $adb; $log->debug("Entering into function saveInventoryProductDetails($focus, $module)."); @@ -488,6 +488,10 @@ } $tot_no_prod = $_REQUEST['totalProductCount']; + + //If the taxtype is group then retrieve all available taxes, else retrive associated taxes for each product inside loop + if($_REQUEST['taxtype'] == 'group') + $all_available_taxes = getAllTaxes('available'); $prod_seq=1; for($i=1; $i<=$tot_no_prod; $i++) @@ -508,6 +512,17 @@ { addToProductStock($prod_id,$qty); } + if($module == 'SalesOrder') + { + if($updateDemand == '-') + { + deductFromProductDemand($prod_id,$qty); + } + elseif($updateDemand == '+') + { + addToProductDemand($prod_id,$qty); + } + } $query ="insert into vtiger_inventoryproductrel(id, productid, sequence_no, quantity, listprice, comment) values($focus->id, $prod_id , $prod_seq, $qty, $listprice, '$comment')"; $prod_seq++; @@ -519,8 +534,6 @@ updateStk($prod_id,$qty,$focus->mode,$ext_prod_arr,$module); } - $taxes_for_product = getTaxDetailsForProduct($prod_id,'all'); - //we should update discount and tax details $updatequery = "update vtiger_inventoryproductrel set "; @@ -535,12 +548,11 @@ $updatequery .= " discount_amount='".$discount_amount."',"; } - if($_REQUEST['taxtype'] == 'group') { - for($tax_count=0;$tax_countquery_result($list_result,$i-1,"organizationname"); + }elseif($module != 'Users') { $entity_id = $adb->query_result($list_result,$i-1,"crmid"); $owner_id = $adb->query_result($list_result,$i-1,"smownerid"); @@ -538,22 +541,25 @@ } // Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2 // begin: Armando L??scher 05.07.2005 -> ??priority - // Code contri buted by fredy Desc: Set Priority color - $priority = $adb->query_result($list_result,$i-1,"priority"); - - $font_color_high = "color:#00DD00;"; - $font_color_medium = "color:#DD00DD;"; - $P_FONT_COLOR = ""; - switch ($priority) - { - case 'High': - $P_FONT_COLOR = $font_color_high; - break; - case 'Medium': - $P_FONT_COLOR = $font_color_medium; - break; - default: - $P_FONT_COLOR = ""; + // Code contributed by fredy Desc: Set Priority color + if($module != 'Organization') + { + $priority = $adb->query_result($list_result,$i-1,"priority"); + + $font_color_high = "color:#00DD00;"; + $font_color_medium = "color:#DD00DD;"; + $P_FONT_COLOR = ""; + switch ($priority) + { + case 'High': + $P_FONT_COLOR = $font_color_high; + break; + case 'Medium': + $P_FONT_COLOR = $font_color_medium; + break; + default: + $P_FONT_COLOR = ""; + } } //end: Armando L??scher 05.07.2005 -> ??priority @@ -572,9 +578,6 @@ if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0 || in_array($fieldname,$field)) { - - - if($fieldname == '') { $table_name = ''; @@ -772,7 +775,6 @@ } $log->debug("Exiting getListViewEntries method ..."); return $list_block; - } /**This function generates the List view entries in a popup list view @@ -861,9 +863,11 @@ { for ($i=$navigation_array['start']; $i<=$navigation_array['end_val']; $i++) { - //Getting the entityid - if($module != 'Users') + if($module == 'Organization') + { + $entity_id = $adb->query_result($list_result,$i-1,"organizationname"); + }elseif($module != 'Users') { $entity_id = $adb->query_result($list_result,$i-1,"crmid"); }else @@ -1275,6 +1279,16 @@ else $value=''; } + elseif($uitype == 74) + { + if($temp_val != '') + { + $orgunitname=getOrgUnitName($temp_val); + $value= ''.$orgunitname.''; + } + else + $value=''; + } elseif($uitype == 75 || $uitype == 81) { @@ -1309,12 +1323,13 @@ } $temp_val = str_replace("'",'\"',$temp_val); + $temp_val = popup_from_html($temp_val); //Added to avoid the error when select SO from Invoice through AjaxEdit if($module == 'SalesOrder') - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; else - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; } elseif($popuptype == "detailview") { @@ -1323,18 +1338,20 @@ elseif($colname == "lastname" && $module == 'Leads') $firstname=$adb->query_result($list_result,$list_result_count,'firstname'); $temp_val =$temp_val.' '.$firstname; + $temp_val = popup_from_html($temp_val); $focus->record_id = $_REQUEST['recordid']; if($_REQUEST['return_module'] == "Calendar") { - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; } else - $value = 'record_id.'","'.$module.'"); window.close()\'>'.$temp_val.''; + $value = 'record_id.'","'.$module.'");\'>'.$temp_val.''; } elseif($popuptype == "formname_specific") { - $value = ''.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } elseif($popuptype == "inventory_prod") { @@ -1354,7 +1371,8 @@ $unitprice = convertFromDollar($unitprice,$rate); $qty_stock=$adb->query_result($list_result,$list_result_count,'qtyinstock'); - $value = ''.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } elseif($popuptype == "inventory_prod_po") { @@ -1372,7 +1390,9 @@ $rate = $rate_symbol['rate']; $unitprice=$adb->query_result($list_result,$list_result_count,'unit_price'); $unitprice = convertFromDollar($unitprice,$rate); - $value = ''.$temp_val.''; + + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } elseif($popuptype == "inventory_pb") { @@ -1381,36 +1401,39 @@ $flname = $_REQUEST['fldname']; $listprice=getListPrice($prod_id,$entity_id); - $value = ''.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } elseif($popuptype == "specific_account_address") { - require_once('modules/Accounts/Account.php'); - $acct_focus = new Account(); + require_once('modules/Accounts/Accounts.php'); + $acct_focus = new Accounts(); $acct_focus->retrieve_entity_info($entity_id,"Accounts"); - $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'"); window.close()\'>'.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.''; } elseif($popuptype == "specific_contact_account_address") { - require_once('modules/Accounts/Account.php'); - $acct_focus = new Account(); + require_once('modules/Accounts/Accounts.php'); + $acct_focus = new Accounts(); $acct_focus->retrieve_entity_info($entity_id,"Accounts"); - $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'"); window.close()\'>'.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.''; } - elseif($popuptype == "specific_potential_account_address") { $acntid = $adb->query_result($list_result,$list_result_count,"accountid"); - require_once('modules/Accounts/Account.php'); - $acct_focus = new Account(); + require_once('modules/Accounts/Accounts.php'); + $acct_focus = new Accounts(); $acct_focus->retrieve_entity_info($acntid,"Accounts"); $account_name = getAccountName($acntid); - $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'"); window.close()\'>'.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.''; } //added by rdhital/Raju for better emails @@ -1429,7 +1452,7 @@ //Change this index 0 - to get the vtiger_fieldid based on email1 or email2 $fieldid = $adb->query_result($queryres,0,'fieldid'); - $value = ''.$name.''; + $value = ''.$name.''; }elseif ($module=='Contacts' || $module=='Leads') { @@ -1445,7 +1468,7 @@ //Change this index 0 - to get the vtiger_fieldid based on email or yahooid $fieldid = $adb->query_result($queryres,0,'fieldid'); - $value = ''.$name.''; + $value = ''.$name.''; }else { @@ -1454,23 +1477,25 @@ $name=$lastname.' '.$firstname; $emailaddress=$adb->query_result($list_result,$list_result_count,"email1"); - $value = ''.$name.''; + $value = ''.$name.''; } } elseif($popuptype == "specific_vendor_address") { - require_once('modules/Vendors/Vendor.php'); - $acct_focus = new Vendor(); + require_once('modules/Vendors/Vendors.php'); + $acct_focus = new Vendors(); $acct_focus->retrieve_entity_info($entity_id,"Vendors"); - $value = 'column_fields['street']).'", "'.br2nl($acct_focus->column_fields['city']).'", "'.br2nl($acct_focus->column_fields['state']).'", "'.br2nl($acct_focus->column_fields['postalcode']).'", "'.br2nl($acct_focus->column_fields['country']).'","'.br2nl($acct_focus->column_fields['pobox']).'"); window.close()\'>'.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = 'column_fields['street']).'", "'.br2nl($acct_focus->column_fields['city']).'", "'.br2nl($acct_focus->column_fields['state']).'", "'.br2nl($acct_focus->column_fields['postalcode']).'", "'.br2nl($acct_focus->column_fields['country']).'","'.br2nl($acct_focus->column_fields['pobox']).'");\'>'.$temp_val.''; } elseif($popuptype == "specific_campaign") { - $value = ''.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } else { @@ -1479,12 +1504,13 @@ $temp_val =$temp_val.' '.$firstname; $temp_val = str_replace("'",'\"',$temp_val); + $temp_val = popup_from_html($temp_val); $log->debug("Exiting getValue method ..."); if($_REQUEST['maintab'] == 'Calendar') - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; else - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; } } else @@ -1576,6 +1602,7 @@ function getListQuery($module,$where='') { global $log; + global $current_organization; $log->debug("Entering getListQuery(".$module.",".$where.") method ..."); global $current_user; @@ -1595,6 +1622,9 @@ ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_ticketgrouprelation ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid LEFT JOIN vtiger_groups @@ -1628,6 +1658,9 @@ FROM vtiger_account INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_account.accountid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_accountbillads ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid INNER JOIN vtiger_accountshipads @@ -1692,6 +1725,9 @@ FROM vtiger_potential INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_potential.potentialid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_account ON vtiger_potential.accountid = vtiger_account.accountid INNER JOIN vtiger_potentialscf @@ -1722,6 +1758,9 @@ FROM vtiger_leaddetails INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_leaddetails.leadid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_leadsubdetails ON vtiger_leadsubdetails.leadsubscriptionid = vtiger_leaddetails.leadid INNER JOIN vtiger_leadaddress @@ -1748,6 +1787,9 @@ FROM vtiger_products INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_products.productid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_productcf ON vtiger_products.productid = vtiger_productcf.productid LEFT JOIN vtiger_seproductsrel @@ -1771,6 +1813,9 @@ FROM vtiger_notes INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_notes.notesid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_senotesrel ON vtiger_senotesrel.notesid = vtiger_notes.notesid LEFT JOIN vtiger_contactdetails @@ -1798,6 +1843,9 @@ FROM vtiger_contactdetails INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_contactaddress ON vtiger_contactdetails.contactid = vtiger_contactaddress.contactaddressid INNER JOIN vtiger_contactsubdetails @@ -1831,6 +1879,9 @@ FROM vtiger_activity INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_cntactivityrel ON vtiger_cntactivityrel.activityid = vtiger_activity.activityid LEFT JOIN vtiger_contactdetails @@ -1870,6 +1921,9 @@ FROM vtiger_activity INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid LEFT JOIN vtiger_seactivityrel @@ -1903,6 +1957,9 @@ FROM vtiger_faq INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_faq.id + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_products ON vtiger_faq.product_id = vtiger_products.productid WHERE vtiger_crmentity.deleted = 0".$where; @@ -1920,6 +1977,9 @@ FROM vtiger_vendor INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_vendor.vendorid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' WHERE vtiger_crmentity.deleted = 0"; } if($module == "PriceBooks") @@ -1942,6 +2002,9 @@ FROM vtiger_quotes INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_quotes.quoteid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_quotesbillads ON vtiger_quotes.quoteid = vtiger_quotesbillads.quotebilladdressid INNER JOIN vtiger_quotesshipads @@ -1976,6 +2039,9 @@ FROM vtiger_purchaseorder INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_purchaseorder.purchaseorderid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT OUTER JOIN vtiger_vendor ON vtiger_purchaseorder.vendorid = vtiger_vendor.vendorid INNER JOIN vtiger_pobillads @@ -2009,6 +2075,9 @@ FROM vtiger_salesorder INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_sobillads ON vtiger_salesorder.salesorderid = vtiger_sobillads.sobilladdressid INNER JOIN vtiger_soshipads @@ -2045,6 +2114,9 @@ FROM vtiger_invoice INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_invoicebillads ON vtiger_invoice.invoiceid = vtiger_invoicebillads.invoicebilladdressid INNER JOIN vtiger_invoiceshipads @@ -2077,8 +2149,13 @@ FROM vtiger_campaign INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_campaign.campaignid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_campaigngrouprelation ON vtiger_campaign.campaignid = vtiger_campaigngrouprelation.campaignid + INNER JOIN vtiger_campaignscf + ON vtiger_campaign.campaignid = vtiger_campaignscf.campaignid LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_campaigngrouprelation.groupname LEFT JOIN vtiger_users @@ -2094,9 +2171,13 @@ { $query = "select id,user_name,roleid,first_name,last_name,email1,phone_mobile,phone_work,is_admin,status from vtiger_users inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where deleted=0 ".$where ; } + if($module == "Organization") + { + $query = "SELECT organizationname,address,city,state,code FROM vtiger_organizationdetails where deleted=0 ".$where; + } - $log->debug("Exiting getListQuery method ..."); + $log->debug("Exiting getListQuery method ... "); return $query; } Modified: vtigercrm/branches/5.1_jens/include/utils/UserInfoUtil.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/UserInfoUtil.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/UserInfoUtil.php Tue Nov 14 03:16:10 2006 @@ -1346,6 +1346,23 @@ $log->debug("Exiting getProfileName method ..."); return $profilename; } +/** Function to get the vtiger_profile Description from the vtiger_profileid + * @param $profileid -- Profile Id:: Type integer + * @returns $rolename -- Role Name:: Type varchar + * + */ +function getProfileDescription($profileid) +{ + global $log; + $log->debug("Entering getProfileDescription(".$profileid.") method ..."); + global $adb; + $sql1 = "select description from vtiger_profile where profileid=".$profileid; + $result = $adb->query($sql1); + $profileDescription = $adb->query_result($result,0,"description"); + $log->debug("Exiting getProfileName method ..."); + return $profileDescription; +} + /** Function to check if the currently logged in user is permitted to perform the specified action * @param $module -- Module Name:: Type varchar Modified: vtigercrm/branches/5.1_jens/include/utils/export.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/export.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/export.php Tue Nov 14 03:16:10 2006 @@ -20,23 +20,23 @@ require_once('config.php'); require_once('include/logging.php'); require_once('include/database/PearDatabase.php'); -require_once('modules/Accounts/Account.php'); -require_once('modules/Contacts/Contact.php'); -require_once('modules/Leads/Lead.php'); -require_once('modules/Contacts/Contact.php'); -require_once('modules/Emails/Email.php'); +require_once('modules/Accounts/Accounts.php'); +require_once('modules/Contacts/Contacts.php'); +require_once('modules/Leads/Leads.php'); +require_once('modules/Contacts/Contacts.php'); +require_once('modules/Emails/Emails.php'); require_once('modules/Calendar/Activity.php'); -require_once('modules/Notes/Note.php'); -require_once('modules/Potentials/Opportunity.php'); -require_once('modules/Users/User.php'); -require_once('modules/Products/Product.php'); +require_once('modules/Notes/Notes.php'); +require_once('modules/Potentials/Potentials.php'); +require_once('modules/Users/Users.php'); +require_once('modules/Products/Products.php'); require_once('include/utils/UserInfoUtil.php'); global $allow_exports; session_start(); -$current_user = new User(); +$current_user = new Users(); if(isset($_SESSION['authenticated_user_id'])) { @@ -87,51 +87,15 @@ { global $log; $log->debug("Entering export_all(".$type.") method ..."); - $contact_fields = Array(); - $account_fields = Array(); global $adb; + $focus = 0; $content = ''; - if ($type == "Contacts") + if ($type != "") { - $focus = new Contact; + $focus = new $type; } - else if ($type == "Accounts") - { - $focus = new Account; - $exp_query="SELECT columnname, fieldlabel FROM vtiger_field where tabid=6"; - $account_result=$adb->query($exp_query); - if($adb->num_rows($account_result)!=0) - { - while($result = $adb->fetch_array($account_result)) - { - $account_columnname = $result['columnname']; - $account_fieldlabel = $result['fieldlabel']; - $account_fields[$account_columnname] = $account_fieldlabel; - } - } - } - else if ($type == "Potentials") - { - $focus = new Potential; - } - else if ($type == "Notes") - { - $focus = new Note; - } - else if ($type == "Leads") - { - $focus = new Lead; - } - else if ($type == "Emails") - { - $focus = new Email; - } - else if ($type == "Products") - { - $focus = new Product; - } $log = LoggerManager::getLogger('export_'.$type); $db = new PearDatabase(); Modified: vtigercrm/branches/5.1_jens/include/utils/utils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/utils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/utils.php Tue Nov 14 03:16:10 2006 @@ -385,6 +385,35 @@ $return_value = $mod_strings; $mod_strings = $temp_mod_strings; + + $log->debug("Exiting return_module_language method ..."); + return $return_value; +} + +/*This function returns the mod_strings for the current language and the specified module +*/ + +function return_specified_module_language($language, $module) +{ + global $log; + global $default_language, $translation_string_prefix; + + @include("modules/$module/language/$language.lang.php"); + if(!isset($mod_strings)) + { + $log->warn("Unable to find the module language file for language: ".$language." and module: ".$module); + require("modules/$module/language/$default_language.lang.php"); + $language_used = $default_language; + } + + if(!isset($mod_strings)) + { + $log->fatal("Unable to load the module($module) language file for the selected language($language) or the default language($default_language)"); + $log->debug("Exiting return_module_language method ..."); + return null; + } + + $return_value = $mod_strings; $log->debug("Exiting return_module_language method ..."); return $return_value; @@ -837,7 +866,8 @@ $log->debug("Entering to_html(".$string.",".$encode.") method ..."); global $toHtml; if($encode && is_string($string)){//$string = htmlentities($string, ENT_QUOTES); - $string = str_replace(array_keys($toHtml), array_values($toHtml), $string); + if (is_array($toHtml)) + $string = str_replace(array_keys($toHtml), array_values($toHtml), $string); } $log->debug("Exiting to_html method ..."); return $string; @@ -947,8 +977,11 @@ $noofrows = $adb->num_rows($result); for($i=0; $i<$noofrows; $i++) { + $uitype = $adb->query_result($result,$i,"uitype"); $fieldname = $adb->query_result($result,$i,"fieldname"); $column_fld[$fieldname] = ''; + if( $uitype == 3 || $uitype == 4 || $uitype == 18 || $uitype == 31 || $uitype == 32) + $column_fld[$fieldname."@##@"] = 0; } $log->debug("Exiting getColumnFields method ..."); return $column_fld; @@ -2047,9 +2080,9 @@ $log->debug("Entering getEmailParentsList(".$module.",".$id.") method ..."); global $adb; if($module == 'Contacts') - $focus = new Contact(); + $focus = new Contacts(); if($module == 'Leads') - $focus = new Lead(); + $focus = new Leads(); $focus->retrieve_entity_info($id,$module); $fieldid = 0; @@ -2104,6 +2137,59 @@ $log->debug("Exiting addToProductStock method ..."); } + +/** This Function adds the specified product quantity to the Product Quantity in Demand in the Warehouse + * @param int $productId - ProductId + * @param int $qty - Quantity to be added + */ +function addToProductDemand($productId,$qty) +{ + global $log; + $log->debug("Entering addToProductDemand(".$productId.",".$qty.") method ..."); + global $adb; + $qtyInStck=getProductQtyInDemand($productId); + $updQty=$qtyInStck + $qty; + $sql = "UPDATE vtiger_products set qtyindemand=$updQty where productid=".$productId; + $adb->query($sql); + $log->debug("Exiting addToProductDemand method ..."); + +} + +/** This Function subtract the specified product quantity to the Product Quantity in Stock in the Warehouse + * @param int $productId - ProductId + * @param int $qty - Quantity to be subtracted + */ +function deductFromProductStock($productId,$qty) +{ + global $log; + $log->debug("Entering deductFromProductStock(".$productId.",".$qty.") method ..."); + global $adb; + $qtyInStck=getProductQtyInStock($productId); + $updQty=$qtyInStck - $qty; + $sql = "UPDATE vtiger_products set qtyinstock=$updQty where productid=".$productId; + $adb->query($sql); + $log->debug("Exiting deductFromProductStock method ..."); + +} + +/** This Function subtract the specified product quantity to the Product Quantity in Demand in the Warehouse + * @param int $productId - ProductId + * @param int $qty - Quantity to be subtract + */ +function deductFromProductDemand($productId,$qty) +{ + global $log; + $log->debug("Entering deductFromProductDemand(".$productId.",".$qty.") method ..."); + global $adb; + $qtyInStck=getProductQtyInDemand($productId); + $updQty=$qtyInStck - $qty; + $sql = "UPDATE vtiger_products set qtyindemand=$updQty where productid=".$productId; + $adb->query($sql); + $log->debug("Exiting deductFromProductDemand method ..."); + +} + + /** This Function returns the current product quantity in stock. * The following is the input parameter for the function: * $product_id --> ProductId, Type:Integer @@ -2121,6 +2207,23 @@ } + +/** This Function returns the current product quantity in demand. + * @param int $product_id - ProductId + * @return int $qtyInDemand - Quantity in Demand of a product + */ +function getProductQtyInDemand($product_id) +{ + global $log; + $log->debug("Entering getProductQtyInDemand(".$product_id.") method ..."); + global $adb; + $query1 = "select qtyindemand from vtiger_products where productid=".$product_id; + $result = $adb->query($query1); + $qtyInDemand = $adb->query_result($result,0,"qtyindemand"); + $log->debug("Exiting getProductQtyInDemand method ..."); + return $qtyInDemand; +} + /** Function to seperate the Date and Time * This function accepts a sting with date and time and * returns an array of two elements.The first element @@ -2175,6 +2278,12 @@ { $tablename = $adb->query_result($res,0,'tablename'); } + + //Since the introduction of the entity2org table, crmid has become + //ambiguous. So we need to explicitely set the vtiger_crmentity table + //in this case ... + if( $tablename == '' && $fieldname == 'crmid') + $tablename = 'vtiger_crmentity'; $log->debug("Exiting getTableNameForField method ..."); return $tablename; @@ -2617,4 +2726,40 @@ global $current_user,$adb; return $adb->query_result($adb->query("select int_mailer from vtiger_mail_accounts where user_id='".$current_user->id."'"),0,"int_mailer"); } + +/** +* the function is like unescape in javascript +* added by dingjianting on 2006-10-1 for picklist editor +*/ +function utf8RawUrlDecode ($source) { + $decodedStr = ""; + $pos = 0; + $len = strlen ($source); + while ($pos < $len) { + $charAt = substr ($source, $pos, 1); + if ($charAt == '%') { + $pos++; + $charAt = substr ($source, $pos, 1); + if ($charAt == 'u') { + // we got a unicode character + $pos++; + $unicodeHexVal = substr ($source, $pos, 4); + $unicode = hexdec ($unicodeHexVal); + $entity = "&#". $unicode . ';'; + $decodedStr .= utf8_encode ($entity); + $pos += 4; + } + else { + // we have an escaped ascii character + $hexVal = substr ($source, $pos, 2); + $decodedStr .= chr (hexdec ($hexVal)); + $pos += 2; + } + } else { + $decodedStr .= $charAt; + $pos++; + } + } + return $decodedStr; +} ?> Modified: vtigercrm/branches/5.1_jens/index.php ============================================================================== --- vtigercrm/branches/5.1_jens/index.php (original) +++ vtigercrm/branches/5.1_jens/index.php Tue Nov 14 03:16:10 2006 @@ -101,7 +101,7 @@ set_default_config($default_config_values); require_once('include/logging.php'); -require_once('modules/Users/User.php'); +require_once('modules/Users/Users.php'); global $currentModule; @@ -164,7 +164,7 @@ } //Code added for 'Multiple SQL Injection Vulnerabilities & XSS issue' fixes - Philip -if(isset($_REQUEST['record']) && !is_numeric($_REQUEST['record']) && $_REQUEST['record']!='') +if(isset($_REQUEST['record']) && $module!="Organization" && !is_numeric($_REQUEST['record']) && $_REQUEST['record']!='') { die("An invalid record number specified to view details."); } @@ -350,9 +350,15 @@ $action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : ""; $record = (isset($_REQUEST['record'])) ? $_REQUEST['record'] : ""; $lang_crm = (isset($_SESSION['authenticated_user_language'])) ? $_SESSION['authenticated_user_language'] : ""; + +if( isset($_REQUEST['org']) && $_REQUEST['org'] != '') { + $_SESSION['authenticated_user_current_organization'] = $_REQUEST['org']; + $log->debug("Change organization for user id ".$current_user->id.":".$_REQUEST['org']); +} + $GLOBALS['request_string'] = "&module=$module&action=$action&record=$record&lang_crm=$lang_crm"; -$current_user = new User(); +$current_user = new Users(); if($use_current_login) { @@ -417,6 +423,58 @@ } $log->debug('current_language is: '.$current_language); +//Current Organization +if( $use_current_login) { + if(isset($_SESSION['authenticated_user_organizations']) && $_SESSION['authenticated_user_organizations'] != '') { + $user_organizations = $_SESSION['authenticated_user_organizations']; + + } else { + $user_org_query = "SELECT organizationname,primarytag FROM vtiger_user2org WHERE userid=".$current_user->id; + $user_org_result = $adb->query($user_org_query); + $user_organizations = ''; + $current_organization = ''; + while($user_org = $adb->fetch_array($user_org_result)) { + if( $user_organizations != '') + $user_organizations .= "|"; + $user_organizations .= $user_org["organizationname"]; + if( $user_org["primarytag"] == 1) + $current_organization = $user_org["organizationname"]; + } + if( $current_organization == '') { + if( strpos($user_organizations,"|")) { + $current_organization = substr($user_organizations,0,strpos($user_organizations,"|")); + } else { + $current_organization = $user_organizations; + } + } + + $_SESSION['authenticated_user_organizations'] = $user_organizations; + $log->debug("Reloaded organizations for user id ".$current_user->id.":".$user_organizations); + $log->debug("Primary organization for user id ".$current_user->id.":".$current_organization); + } + + if(isset($_SESSION['authenticated_user_current_organization']) && $_SESSION['authenticated_user_current_organization'] != '') { + $current_organization = $_SESSION['authenticated_user_current_organization']; + $log->debug("Current organization for user id ".$current_user->id.":".$current_organization); + + } else { + if( $current_organization == '') { + $current_organization = "-- NONE --"; + } else { + $_SESSION['authenticated_user_current_organization'] = $current_organization; + } + } + +//No user authenticated, thus no organizations +} else { + $_SESSION['authenticated_user_current_organization'] = ''; + $_SESSION['authenticated_user_organizations'] = ''; +} + +//As long as we are modifying an existing record, the default organization may +//not change +$org_change_ok = ($record != "" || $action == "EditView") ? 0 : 1; + //set module and application string arrays based upon selected language $app_strings = return_application_language($current_language); $app_list_strings = return_app_list_strings_language($current_language); @@ -432,90 +490,22 @@ // Use the record to track the viewing. // todo - Have a record of modules and thier primary object names. //Getting the actual module - $actualModule = $currentModule; switch($currentModule) { - case 'Leads': - require_once("modules/$currentModule/Lead.php"); - $focus = new Lead(); - break; - case 'Contacts': - require_once("modules/$currentModule/Contact.php"); - $focus = new Contact(); - break; - case 'Accounts': - require_once("modules/$currentModule/Account.php"); - $focus = new Account(); - break; - case 'Potentials': - require_once("modules/$currentModule/Opportunity.php"); - $focus = new Potential(); - break; case 'Calendar': require_once("modules/$currentModule/Activity.php"); $focus = new Activity(); break; - case 'Notes': - require_once("modules/$currentModule/Note.php"); - $focus = new Note(); - break; - case 'Emails': - require_once("modules/$currentModule/Email.php"); - $focus = new Email(); - break; - case 'Users': - require_once("modules/$currentModule/User.php"); - $focus = new User(); - break; - case 'Products': - require_once("modules/$currentModule/Product.php"); - $focus = new Product(); - break; - case 'Vendors': - require_once("modules/$currentModule/Vendor.php"); - $focus = new Vendor(); - $actualModule = 'Vendors'; - break; - case 'PriceBooks': - require_once("modules/$currentModule/PriceBook.php"); - $focus = new PriceBook(); - $actualModule = 'PriceBooks'; - break; - case 'HelpDesk': - require_once("modules/$currentModule/HelpDesk.php"); - $focus = new HelpDesk(); - break; - case 'Faq': - require_once("modules/$currentModule/Faq.php"); - $focus = new Faq(); - break; - case 'Quotes': - require_once("modules/$currentModule/Quote.php"); - $focus = new Quote(); - break; - case 'PurchaseOrder': - require_once("modules/$currentModule/PurchaseOrder.php"); - $focus = new Order(); - break; - case 'SalesOrder': - require_once("modules/$currentModule/SalesOrder.php"); - $focus = new SalesOrder(); - break; - - case 'Invoice': - require_once("modules/$currentModule/Invoice.php"); - $focus = new Invoice(); - break; - case 'Campaigns': - require_once("modules/$currentModule/Campaign.php"); - $focus = new Campaign(); + default: + require_once("modules/$currentModule/$currentModule.php"); + $focus = new $currentModule(); break; } if(isset($_REQUEST['record']) && $_REQUEST['record']!='' && $_REQUEST["module"] != "Webmails") { // Only track a viewing if the record was retrieved. - $focus->track_view($current_user->id, $actualModule,$_REQUEST['record']); + $focus->track_view($current_user->id, $currentModule,$_REQUEST['record']); } } @@ -586,6 +576,7 @@ if(!$skipSecurityCheck) { + require_once('include/utils/UserInfoUtil.php'); @@ -707,7 +698,7 @@ echo ""; echo ''; echo "


"; - echo ""; + echo ""; echo "
vtiger CRM 5.0.0 | Visit www.vtiger.com for more information
vtiger CRM 5.0.2 | Visit www.vtiger.com for more information © Copyright Details
"; // echo "'; - } - - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - //SQL - $query = "SELECT vtiger_contactdetails.*, - vtiger_crmentity.crmid, - vtiger_crmentity.smownerid, - vtiger_users.user_name - FROM vtiger_contactdetails - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_contactdetails.accountid = ".$id; - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Accounts','Contacts',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated opportunities - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_opportunities($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_opportunities(".$id.") method ..."); - global $mod_strings; - - $focus = new Potential(); - $button = ''; - - if(isPermitted("Potentials",1,"") == 'yes') - { - $button .= ''; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_potential.potentialid, vtiger_potential.accountid, - vtiger_potential.potentialname, vtiger_potential.sales_stage, - vtiger_potential.potentialtype, vtiger_potential.amount, - vtiger_potential.closingdate, vtiger_potential.potentialtype, - vtiger_users.user_name, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid - FROM vtiger_potential - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_potential.potentialid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - LEFT JOIN vtiger_potentialgrouprelation - ON vtiger_potential.potentialid = vtiger_potentialgrouprelation.potentialid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_potentialgrouprelation.groupname - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_potential.accountid = ".$id; - $log->debug("Exiting get_opportunities method ..."); - - return GetRelatedList('Accounts','Potentials',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated tasks - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_activities($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - - $focus = new Activity(); - $button = ''; - if(isPermitted("Calendar",1,"") == 'yes') - { - - $button .= ' '; - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_activity.*, - vtiger_seactivityrel.*, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid, - vtiger_crmentity.modifiedtime, - vtiger_users.user_name, - vtiger_recurringevents.recurringtype - FROM vtiger_activity - INNER JOIN vtiger_seactivityrel - ON vtiger_seactivityrel.activityid = vtiger_activity.activityid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_activity.activityid - LEFT JOIN vtiger_users - ON vtiger_users.id = vtiger_crmentity.smownerid - LEFT OUTER JOIN vtiger_recurringevents - ON vtiger_recurringevents.activityid = vtiger_activity.activityid - LEFT JOIN vtiger_activitygrouprelation - ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname - WHERE vtiger_seactivityrel.crmid = ".$id." - AND (activitytype='Task' - OR activitytype='Call' - OR activitytype='Meeting') - AND vtiger_crmentity.deleted = 0 - AND ((vtiger_activity.status IS NOT NULL - AND vtiger_activity.status != 'Completed') - AND (vtiger_activity.status IS NOT NULL - AND vtiger_activity.status != 'Deferred') - OR (vtiger_activity.eventstatus !='' - AND vtiger_activity.eventstatus != 'Held'))"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Accounts','Calendar',$focus,$query,$button,$returnset); - - } - /** - * Function to get Account related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - accountid - * returns related Task or Event record in array format - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, - vtiger_activity.status, vtiger_activity.eventstatus, - vtiger_activity.activitytype, - vtiger_crmentity.modifiedtime, vtiger_crmentity.createdtime, - vtiger_crmentity.description, - vtiger_users.user_name - FROM vtiger_activity - INNER JOIN vtiger_seactivityrel - ON vtiger_seactivityrel.activityid = vtiger_activity.activityid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_activity.activityid - LEFT JOIN vtiger_activitygrouprelation - ON vtiger_activitygrouprelation.activityid = vtiger_activity.activityid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname - INNER JOIN vtiger_users - ON vtiger_crmentity.smcreatorid = vtiger_users.id - WHERE (vtiger_activity.activitytype = 'Meeting' - OR vtiger_activity.activitytype = 'Call' - OR vtiger_activity.activitytype = 'Task') - AND (vtiger_activity.status = 'Completed' - OR vtiger_activity.status = 'Deferred' - OR (vtiger_activity.eventstatus = 'Held' - AND vtiger_activity.eventstatus != '')) - AND vtiger_seactivityrel.crmid = ".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - $log->debug("Exiting get_history method ..."); - return getHistory('Accounts',$query,$id); - } - /** - * Function to get Account related Attachments - * @param integer $id - accountid - * returns related Attachment record in array format - */ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - $query = "SELECT vtiger_notes.title, vtiger_notes.notecontent AS description, - vtiger_notes.filename, vtiger_notes.notesid AS crmid, - 'Notes ' AS ActivityType, - vtiger_attachments.type AS FileType, - crm2.modifiedtime AS lastmodified, crm2.createdtime, - vtiger_seattachmentsrel.attachmentsid, - vtiger_users.user_name - FROM vtiger_notes - INNER JOIN vtiger_senotesrel - ON vtiger_senotesrel.notesid = vtiger_notes.notesid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_senotesrel.crmid - INNER JOIN vtiger_crmentity crm2 - ON crm2.crmid = vtiger_notes.notesid - AND crm2.deleted = 0 - LEFT JOIN vtiger_seattachmentsrel - ON vtiger_seattachmentsrel.crmid = vtiger_notes.notesid - LEFT JOIN vtiger_attachments - ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_users - ON crm2.smcreatorid = vtiger_users.id - WHERE vtiger_crmentity.crmid = ".$id." - UNION ALL - SELECT vtiger_attachments.description AS title, vtiger_attachments.description, - vtiger_attachments.name AS filename, - vtiger_seattachmentsrel.attachmentsid AS crmid, - 'Attachments' AS ActivityType, - vtiger_attachments.type AS FileType, - crm2.modifiedtime AS lastmodified, crm2.createdtime, - vtiger_attachments.attachmentsid, - vtiger_users.user_name - FROM vtiger_attachments - INNER JOIN vtiger_seattachmentsrel - ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_seattachmentsrel.crmid - INNER JOIN vtiger_crmentity crm2 - ON crm2.crmid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_users - ON crm2.smcreatorid = vtiger_users.id - WHERE vtiger_crmentity.crmid = ".$id." - ORDER BY createdtime DESC"; - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Accounts',$query,$id); - } - /** - * Function to get Account related Quotes - * @param integer $id - accountid - * returns related Quotes record in array format - */ - function get_quotes($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_quotes(".$id.") method ..."); - global $app_strings; - require_once('modules/Quotes/Quote.php'); - - $focus = new Quote(); - - $button = ''; - if(isPermitted("Quotes",1,"") == 'yes') - { - $button .= ' '; - } - - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, - vtiger_groups.groupname, - vtiger_crmentity.*, - vtiger_quotes.*, - vtiger_potential.potentialname, - vtiger_account.accountname - FROM vtiger_quotes - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_quotes.quoteid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_quotes.accountid - LEFT OUTER JOIN vtiger_potential - ON vtiger_potential.potentialid = vtiger_quotes.potentialid - LEFT JOIN vtiger_quotegrouprelation - ON vtiger_quotes.quoteid = vtiger_quotegrouprelation.quoteid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_quotegrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_account.accountid = ".$id; - $log->debug("Exiting get_quotes method ..."); - return GetRelatedList('Accounts','Quotes',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Invoices - * @param integer $id - accountid - * returns related Invoices record in array format - */ - function get_invoices($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_invoices(".$id.") method ..."); - global $app_strings; - require_once('modules/Invoice/Invoice.php'); - - $focus = new Invoice(); - - $button = ''; - if(isPermitted("Invoice",1,"") == 'yes') - { - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, - vtiger_groups.groupname, - vtiger_crmentity.*, - vtiger_invoice.*, - vtiger_account.accountname, - vtiger_salesorder.subject AS salessubject - FROM vtiger_invoice - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_invoice.accountid - LEFT OUTER JOIN vtiger_salesorder - ON vtiger_salesorder.salesorderid = vtiger_invoice.salesorderid - LEFT JOIN vtiger_invoicegrouprelation - ON vtiger_invoice.invoiceid = vtiger_invoicegrouprelation.invoiceid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_invoicegrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_account.accountid = ".$id; - $log->debug("Exiting get_invoices method ..."); - return GetRelatedList('Accounts','Invoice',$focus,$query,$button,$returnset); - } - - /** - * Function to get Account related SalesOrder - * @param integer $id - accountid - * returns related SalesOrder record in array format - */ - function get_salesorder($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - global $app_strings; - - $focus = new SalesOrder(); - - $button = ''; - if(isPermitted("SalesOrder",1,"") == 'yes') - { - $button .= ' '; - } - - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_crmentity.*, - vtiger_salesorder.*, - vtiger_quotes.subject AS quotename, - vtiger_account.accountname, - vtiger_users.user_name, - vtiger_groups.groupname - FROM vtiger_salesorder - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid - LEFT OUTER JOIN vtiger_quotes - ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_salesorder.accountid - LEFT JOIN vtiger_sogrouprelation - ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_salesorder.accountid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Accounts','SalesOrder',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Tickets - * @param integer $id - accountid - * returns related Ticket record in array format - */ - function get_tickets($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_tickets(".$id.") method ..."); - global $app_strings; - - $focus = new HelpDesk(); - $button = ''; - - $button .= ''; - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, vtiger_users.id, - vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, - vtiger_troubletickets.status, vtiger_troubletickets.priority, - vtiger_troubletickets.parent_id, - vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime - FROM vtiger_troubletickets - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid - LEFT JOIN vtiger_account - ON vtiger_account.accountid = vtiger_troubletickets.parent_id - LEFT JOIN vtiger_contactdetails - ON vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id - LEFT JOIN vtiger_users - ON vtiger_users.id=vtiger_crmentity.smownerid - LEFT JOIN vtiger_ticketgrouprelation - ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname - WHERE vtiger_troubletickets.parent_id=".$id." or " ; - - $query .= "vtiger_troubletickets.parent_id in(SELECT vtiger_contactdetails.contactid - FROM vtiger_contactdetails - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_contactdetails.accountid = ".$id; - - - //Appending the security parameter - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $tab_id=getTabid('Contacts'); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter('Contacts'); - $query .= ' '.$sec_parameter; - - } - - $query .= ") "; - - /* - $query .= " UNION ALL - SELECT vtiger_users.user_name, vtiger_users.id, - vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, - vtiger_troubletickets.status, vtiger_troubletickets.priority, - vtiger_troubletickets.parent_id, - vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime - FROM vtiger_troubletickets - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid - LEFT JOIN vtiger_contactdetails - ON vtiger_contactdetails.contactid = vtiger_troubletickets.parent_id - LEFT JOIN vtiger_account - ON vtiger_account.accountid = vtiger_contactdetails.accountid - LEFT JOIN vtiger_users - ON vtiger_users.id = vtiger_crmentity.smownerid - LEFT JOIN vtiger_ticketgrouprelation - ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname - WHERE vtiger_account.accountid = ".$id; - */ - $log->debug("Exiting get_tickets method ..."); - return GetRelatedList('Accounts','HelpDesk',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Products - * @param integer $id - accountid - * returns related Products record in array format - */ - function get_products($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_products(".$id.") method ..."); - require_once('modules/Products/Product.php'); - global $app_strings; - - $focus = new Product(); - - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_products.productid, vtiger_products.productname, - vtiger_products.productcode, vtiger_products.commissionrate, - vtiger_products.qty_per_unit, vtiger_products.unit_price, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid - FROM vtiger_products - INNER JOIN vtiger_seproductsrel - ON vtiger_products.productid = vtiger_seproductsrel.productid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_products.productid - INNER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_seproductsrel.crmid - WHERE vtiger_account.accountid = ".$id." - AND vtiger_crmentity.deleted = 0"; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Accounts','Products',$focus,$query,$button,$returnset); - } - - /** Function to export the account records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Accounts Query. - */ - function create_export_query(&$order_by, &$where) - { - global $log; - $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); - if($this->checkIfCustomTableExists('vtiger_accountscf')) - { - - $query = $this->constructCustomQueryAddendum('vtiger_accountscf','Accounts') . " - vtiger_account.*, - ".$this->entity_table.".*, - vtiger_accountbillads.city AS billing_city, - vtiger_accountbillads.country AS billing_country, - vtiger_accountbillads.code AS billing_code, - vtiger_accountbillads.state AS billing_state, - vtiger_accountbillads.street AS billing_street, - vtiger_accountshipads.city AS shipping_city, - vtiger_accountshipads.country AS shipping_country, - vtiger_accountshipads.code AS shipping_code, - vtiger_accountshipads.state AS shipping_state, - vtiger_accountshipads.street AS shipping_street, - vtiger_users.user_name, - vtiger_users.status AS user_status - FROM ".$this->entity_table." - INNER JOIN vtiger_account - ON vtiger_crmentity.crmid = vtiger_account.accountid - LEFT JOIN vtiger_accountbillads - ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid - LEFT JOIN vtiger_accountshipads - ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid - LEFT JOIN vtiger_accountscf - ON vtiger_accountscf.accountid = vtiger_account.accountid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id "; - - } - else - { - $query = "SELECT vtiger_account.*, - ".$this->entity_table.".*, - vtiger_accountbillads.city AS billing_city, - vtiger_accountbillads.country AS billing_country, - vtiger_accountbillads.code AS billing_code, - vtiger_accountbillads.state AS billing_state, - vtiger_accountbillads.street AS billing_street, - vtiger_accountshipads.city AS shipping_city, - vtiger_accountshipads.country AS shipping_country, - vtiger_accountshipads.code AS shipping_code, - vtiger_accountshipads.state AS shipping_state, - vtiger_accountshipads.street AS shipping_street, - vtiger_users.user_name, - vtiger_users.status AS user_status - FROM ".$this->entity_table." - INNER JOIN vtiger_account - ON vtiger_crmentity.crmid = vtiger_account.accountid - LEFT JOIN vtiger_accountbillads - ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid - LEFT JOIN vtiger_accountshipads - ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id "; - } - - $where_auto = " vtiger_users.status = 'Active' - AND vtiger_crmentity.deleted = 0 "; - - if($where != "") - $query .= "WHERE ($where) AND ".$where_auto; - else - $query .= "WHERE ".$where_auto; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - $log->debug("Exiting create_export_query method ..."); - return $query; - } - - /** Function to get the Columnnames of the Account Record - * Used By vtigerCRM Word Plugin - * Returns the Merge Fields for Word Plugin - */ - function getColumnNames_Acnt() - { - global $log,$current_user; - $log->debug("Entering getColumnNames_Acnt() method ..."); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "SELECT fieldlabel FROM vtiger_field WHERE tabid = 6"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel 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 where vtiger_field.tabid=6 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames_Acnt method ..."); - return $mergeflds; - } - -} - -?> +'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid','vtiger_entity2org'=>'crmid'); + + var $entity_table = "vtiger_crmentity"; + + var $billadr_table = "vtiger_accountbillads"; + + var $object_name = "Accounts"; + // Mike Crowe Mod --------------------------------------------------------added for general search + var $base_table_name = "vtiger_account"; + var $cf_table_name = "vtiger_accountscf"; + + var $new_schema = true; + + var $module_id = "accountid"; + + var $column_fields = Array(); + + var $sortby_fields = Array('accountname','city','website','phone','smownerid'); + + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Account Name'=>Array('vtiger_account'=>'accountname'), + 'City'=>Array('vtiger_accountbillads'=>'city'), + 'Website'=>Array('vtiger_account'=>'website'), + 'Phone'=>Array('vtiger_account'=> 'phone'), + 'Assigned To'=>Array('vtiger_crmentity'=>'smownerid') + ); + + var $list_fields_name = Array( + 'Account Name'=>'accountname', + 'City'=>'bill_city', + 'Website'=>'website', + 'Phone'=>'phone', + 'Assigned To'=>'assigned_user_id' + ); + var $list_link_field= 'accountname'; + + var $search_fields = Array( + 'Account Name'=>Array('vtiger_account'=>'accountname'), + 'City'=>Array('vtiger_accountbillads'=>'city'), + ); + + var $search_fields_name = Array( + 'Account Name'=>'accountname', + 'City'=>'bill_city', + ); + + // This is the list of vtiger_fields that are required. + var $required_fields = array("accountname"=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'accountname'; + var $default_sort_order = 'ASC'; + + function Account() { + $this->log =LoggerManager::getLogger('account'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Accounts'); + } + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['ACCOUNTS_SORT_ORDER'] != '')?($_SESSION['ACCOUNTS_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'accountname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['ACCOUNTS_ORDER_BY'] != '')?($_SESSION['ACCOUNTS_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + /** Returns a list of the associated contacts + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_contacts($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $mod_strings; + + $focus = new Contact(); + + $button = ''; + if(isPermitted("Contacts",1,"") == 'yes') + { + $button .= ' '; + } + + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + //SQL + $query = "SELECT vtiger_contactdetails.*, + vtiger_crmentity.crmid, + vtiger_crmentity.smownerid, + vtiger_users.user_name + FROM vtiger_contactdetails + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_contactdetails.accountid = ".$id; + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Accounts','Contacts',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated opportunities + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_opportunities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_opportunities(".$id.") method ..."); + global $mod_strings; + + $focus = new Potential(); + $button = ''; + + if(isPermitted("Potentials",1,"") == 'yes') + { + $button .= ''; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_potential.potentialid, vtiger_potential.accountid, + vtiger_potential.potentialname, vtiger_potential.sales_stage, + vtiger_potential.potentialtype, vtiger_potential.amount, + vtiger_potential.closingdate, vtiger_potential.potentialtype, + vtiger_users.user_name, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid + FROM vtiger_potential + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_potential.potentialid + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + LEFT JOIN vtiger_potentialgrouprelation + ON vtiger_potential.potentialid = vtiger_potentialgrouprelation.potentialid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_potentialgrouprelation.groupname + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_potential.accountid = ".$id; + $log->debug("Exiting get_opportunities method ..."); + + return GetRelatedList('Accounts','Potentials',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated tasks + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_activities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + + $focus = new Activity(); + $button = ''; + if(isPermitted("Calendar",1,"") == 'yes') + { + + $button .= ' '; + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_activity.*, + vtiger_seactivityrel.*, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid, + vtiger_crmentity.modifiedtime, + vtiger_users.user_name, + vtiger_recurringevents.recurringtype + FROM vtiger_activity + INNER JOIN vtiger_seactivityrel + ON vtiger_seactivityrel.activityid = vtiger_activity.activityid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_activity.activityid + LEFT JOIN vtiger_users + ON vtiger_users.id = vtiger_crmentity.smownerid + LEFT OUTER JOIN vtiger_recurringevents + ON vtiger_recurringevents.activityid = vtiger_activity.activityid + LEFT JOIN vtiger_activitygrouprelation + ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname + WHERE vtiger_seactivityrel.crmid = ".$id." + AND (activitytype='Task' + OR activitytype='Call' + OR activitytype='Meeting') + AND vtiger_crmentity.deleted = 0 + AND ((vtiger_activity.status IS NOT NULL + AND vtiger_activity.status != 'Completed') + AND (vtiger_activity.status IS NOT NULL + AND vtiger_activity.status != 'Deferred') + OR (vtiger_activity.eventstatus !='' + AND vtiger_activity.eventstatus != 'Held'))"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Accounts','Calendar',$focus,$query,$button,$returnset); + + } + /** + * Function to get Account related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id - accountid + * returns related Task or Event record in array format + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, + vtiger_activity.status, vtiger_activity.eventstatus, + vtiger_activity.activitytype, + vtiger_crmentity.modifiedtime, vtiger_crmentity.createdtime, + vtiger_crmentity.description, + vtiger_users.user_name + FROM vtiger_activity + INNER JOIN vtiger_seactivityrel + ON vtiger_seactivityrel.activityid = vtiger_activity.activityid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_activity.activityid + LEFT JOIN vtiger_activitygrouprelation + ON vtiger_activitygrouprelation.activityid = vtiger_activity.activityid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname + INNER JOIN vtiger_users + ON vtiger_crmentity.smcreatorid = vtiger_users.id + WHERE (vtiger_activity.activitytype = 'Meeting' + OR vtiger_activity.activitytype = 'Call' + OR vtiger_activity.activitytype = 'Task') + AND (vtiger_activity.status = 'Completed' + OR vtiger_activity.status = 'Deferred' + OR (vtiger_activity.eventstatus = 'Held' + AND vtiger_activity.eventstatus != '')) + AND vtiger_seactivityrel.crmid = ".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + $log->debug("Exiting get_history method ..."); + return getHistory('Accounts',$query,$id); + } + /** + * Function to get Account related Attachments + * @param integer $id - accountid + * returns related Attachment record in array format + */ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + $query = "SELECT vtiger_notes.title, vtiger_notes.notecontent AS description, + vtiger_notes.filename, vtiger_notes.notesid AS crmid, + 'Notes ' AS ActivityType, + vtiger_attachments.type AS FileType, + crm2.modifiedtime AS lastmodified, crm2.createdtime, + vtiger_seattachmentsrel.attachmentsid, + vtiger_users.user_name + FROM vtiger_notes + INNER JOIN vtiger_senotesrel + ON vtiger_senotesrel.notesid = vtiger_notes.notesid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_senotesrel.crmid + INNER JOIN vtiger_crmentity crm2 + ON crm2.crmid = vtiger_notes.notesid + AND crm2.deleted = 0 + LEFT JOIN vtiger_seattachmentsrel + ON vtiger_seattachmentsrel.crmid = vtiger_notes.notesid + LEFT JOIN vtiger_attachments + ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_users + ON crm2.smcreatorid = vtiger_users.id + WHERE vtiger_crmentity.crmid = ".$id." + UNION ALL + SELECT vtiger_attachments.description AS title, vtiger_attachments.description, + vtiger_attachments.name AS filename, + vtiger_seattachmentsrel.attachmentsid AS crmid, + 'Attachments' AS ActivityType, + vtiger_attachments.type AS FileType, + crm2.modifiedtime AS lastmodified, crm2.createdtime, + vtiger_attachments.attachmentsid, + vtiger_users.user_name + FROM vtiger_attachments + INNER JOIN vtiger_seattachmentsrel + ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_seattachmentsrel.crmid + INNER JOIN vtiger_crmentity crm2 + ON crm2.crmid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_users + ON crm2.smcreatorid = vtiger_users.id + WHERE vtiger_crmentity.crmid = ".$id." + ORDER BY createdtime DESC"; + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Accounts',$query,$id); + } + /** + * Function to get Account related Quotes + * @param integer $id - accountid + * returns related Quotes record in array format + */ + function get_quotes($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_quotes(".$id.") method ..."); + global $app_strings; + require_once('modules/Quotes/Quote.php'); + + $focus = new Quote(); + + $button = ''; + if(isPermitted("Quotes",1,"") == 'yes') + { + $button .= ' '; + } + + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, + vtiger_groups.groupname, + vtiger_crmentity.*, + vtiger_quotes.*, + vtiger_potential.potentialname, + vtiger_account.accountname + FROM vtiger_quotes + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_quotes.quoteid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_quotes.accountid + LEFT OUTER JOIN vtiger_potential + ON vtiger_potential.potentialid = vtiger_quotes.potentialid + LEFT JOIN vtiger_quotegrouprelation + ON vtiger_quotes.quoteid = vtiger_quotegrouprelation.quoteid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_quotegrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_account.accountid = ".$id; + $log->debug("Exiting get_quotes method ..."); + return GetRelatedList('Accounts','Quotes',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Invoices + * @param integer $id - accountid + * returns related Invoices record in array format + */ + function get_invoices($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_invoices(".$id.") method ..."); + global $app_strings; + require_once('modules/Invoice/Invoice.php'); + + $focus = new Invoice(); + + $button = ''; + if(isPermitted("Invoice",1,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, + vtiger_groups.groupname, + vtiger_crmentity.*, + vtiger_invoice.*, + vtiger_account.accountname, + vtiger_salesorder.subject AS salessubject + FROM vtiger_invoice + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_invoice.accountid + LEFT OUTER JOIN vtiger_salesorder + ON vtiger_salesorder.salesorderid = vtiger_invoice.salesorderid + LEFT JOIN vtiger_invoicegrouprelation + ON vtiger_invoice.invoiceid = vtiger_invoicegrouprelation.invoiceid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_invoicegrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_account.accountid = ".$id; + $log->debug("Exiting get_invoices method ..."); + return GetRelatedList('Accounts','Invoice',$focus,$query,$button,$returnset); + } + + /** + * Function to get Account related SalesOrder + * @param integer $id - accountid + * returns related SalesOrder record in array format + */ + function get_salesorder($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + global $app_strings; + + $focus = new SalesOrder(); + + $button = ''; + if(isPermitted("SalesOrder",1,"") == 'yes') + { + $button .= ' '; + } + + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_crmentity.*, + vtiger_salesorder.*, + vtiger_quotes.subject AS quotename, + vtiger_account.accountname, + vtiger_users.user_name, + vtiger_groups.groupname + FROM vtiger_salesorder + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid + LEFT OUTER JOIN vtiger_quotes + ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_salesorder.accountid + LEFT JOIN vtiger_sogrouprelation + ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_salesorder.accountid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Accounts','SalesOrder',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Tickets + * @param integer $id - accountid + * returns related Ticket record in array format + */ + function get_tickets($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_tickets(".$id.") method ..."); + global $app_strings; + + $focus = new HelpDesk(); + $button = ''; + + $button .= ''; + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, vtiger_users.id, + vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, + vtiger_troubletickets.status, vtiger_troubletickets.priority, + vtiger_troubletickets.parent_id, + vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime + FROM vtiger_troubletickets + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + LEFT JOIN vtiger_account + ON vtiger_account.accountid = vtiger_troubletickets.parent_id + LEFT JOIN vtiger_contactdetails + ON vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id + LEFT JOIN vtiger_users + ON vtiger_users.id=vtiger_crmentity.smownerid + LEFT JOIN vtiger_ticketgrouprelation + ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname + WHERE vtiger_troubletickets.parent_id=".$id." or " ; + + $query .= "vtiger_troubletickets.parent_id in(SELECT vtiger_contactdetails.contactid + FROM vtiger_contactdetails + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_contactdetails.accountid = ".$id; + + + //Appending the security parameter + global $current_user; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $tab_id=getTabid('Contacts'); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter('Contacts'); + $query .= ' '.$sec_parameter; + + } + + $query .= ") "; + + /* + $query .= " UNION ALL + SELECT vtiger_users.user_name, vtiger_users.id, + vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, + vtiger_troubletickets.status, vtiger_troubletickets.priority, + vtiger_troubletickets.parent_id, + vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime + FROM vtiger_troubletickets + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + LEFT JOIN vtiger_contactdetails + ON vtiger_contactdetails.contactid = vtiger_troubletickets.parent_id + LEFT JOIN vtiger_account + ON vtiger_account.accountid = vtiger_contactdetails.accountid + LEFT JOIN vtiger_users + ON vtiger_users.id = vtiger_crmentity.smownerid + LEFT JOIN vtiger_ticketgrouprelation + ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname + WHERE vtiger_account.accountid = ".$id; + */ + $log->debug("Exiting get_tickets method ..."); + return GetRelatedList('Accounts','HelpDesk',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Products + * @param integer $id - accountid + * returns related Products record in array format + */ + function get_products($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_products(".$id.") method ..."); + require_once('modules/Products/Product.php'); + global $app_strings; + + $focus = new Product(); + + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_products.productid, vtiger_products.productname, + vtiger_products.productcode, vtiger_products.commissionrate, + vtiger_products.qty_per_unit, vtiger_products.unit_price, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid + FROM vtiger_products + INNER JOIN vtiger_seproductsrel + ON vtiger_products.productid = vtiger_seproductsrel.productid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_products.productid + INNER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_seproductsrel.crmid + WHERE vtiger_account.accountid = ".$id." + AND vtiger_crmentity.deleted = 0"; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Accounts','Products',$focus,$query,$button,$returnset); + } + + /** Function to export the account records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Accounts Query. + */ + function create_export_query(&$order_by, &$where) + { + global $log; + global $current_user; + $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); + + include("include/utils/ExportUtils.php"); + + //To get the Permitted fields query and the permitted fields list + $sql = getPermittedFieldsQuery("Accounts", "detail_view"); + $fields_list = getFieldsListFromQuery($sql); + + $query = "SELECT $fields_list FROM ".$this->entity_table." + INNER JOIN vtiger_account + ON vtiger_crmentity.crmid = vtiger_account.accountid + LEFT JOIN vtiger_accountbillads + ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid + LEFT JOIN vtiger_accountshipads + ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid + LEFT JOIN vtiger_accountscf + ON vtiger_accountscf.accountid = vtiger_account.accountid + LEFT JOIN vtiger_accountgrouprelation + ON vtiger_accountscf.accountid = vtiger_accountgrouprelation.accountid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_accountgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + LEFT JOIN vtiger_account vtiger_account2 + ON vtiger_account2.accountid = vtiger_account.parentid + ";//vtiger_account2 is added to get the Member of account + + + $where_auto = " vtiger_users.status = 'Active' + AND vtiger_crmentity.deleted = 0 "; + + if($where != "") + $query .= "WHERE ($where) AND ".$where_auto; + else + $query .= "WHERE ".$where_auto; + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + //we should add security check when the user has Private Access + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[6] == 3) + { + //Added security check to get the permitted records only + $query = $query." ".getListViewSecurityParameter("Accounts"); + } + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + + $log->debug("Exiting create_export_query method ..."); + return $query; + } + + /** Function to get the Columnnames of the Account Record + * Used By vtigerCRM Word Plugin + * Returns the Merge Fields for Word Plugin + */ + function getColumnNames_Acnt() + { + global $log,$current_user; + $log->debug("Entering getColumnNames_Acnt() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "SELECT fieldlabel FROM vtiger_field WHERE tabid = 6"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel 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 where vtiger_field.tabid=6 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames_Acnt method ..."); + return $mergeflds; + } + +} + +?> Modified: vtigercrm/branches/5.1_jens/modules/Accounts/CallRelatedList.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/CallRelatedList.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/CallRelatedList.php Tue Nov 14 03:16:10 2006 @@ -11,7 +11,7 @@ require_once('Smarty_setup.php'); -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('include/utils/utils.php'); //Redirecting Header for single page layout require_once('user_privileges/default_module_view.php'); @@ -22,7 +22,7 @@ } else { -$focus = new Account(); +$focus = new Accounts(); $currentmodule = $_REQUEST['module']; $RECORD = $_REQUEST['record']; if(isset($_REQUEST['record']) && $_REQUEST['record']!='') { Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Delete.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Delete.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Delete.php Tue Nov 14 03:16:10 2006 @@ -1,37 +1,37 @@ - + Modified: vtigercrm/branches/5.1_jens/modules/Accounts/DetailView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/DetailView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/DetailView.php Tue Nov 14 03:16:10 2006 @@ -22,7 +22,7 @@ require_once('Smarty_setup.php'); require_once('data/Tracker.php'); -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); @@ -32,7 +32,10 @@ global $app_list_strings; global $log, $currentModule, $singlepane_view; -$focus = new Account(); +global $current_organization; +global $user_organizations; + +$focus = new Accounts(); if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { $focus->retrieve_entity_info($_REQUEST['record'],"Accounts"); $focus->id = $_REQUEST['record']; @@ -118,5 +121,15 @@ } $smarty->assign("SinglePane_View", $singlepane_view); +// Assigned organizations +$smarty->assign("CURRENT_ORGANIZATION",$current_organization); +$org_array=array(); +$org=strtok( $user_organizations, "|"); +while( $org !== false) { + $org_array[$org] = 1; + $org=strtok( "|"); +} +$smarty->assign("USER_ORGANIZATIONS",$org_array); + $smarty->display("DetailView.tpl"); ?> Modified: vtigercrm/branches/5.1_jens/modules/Accounts/DetailViewAjax.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/DetailViewAjax.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/DetailViewAjax.php Tue Nov 14 03:16:10 2006 @@ -1,50 +1,50 @@ -retrieve_entity_info($crmid,"Accounts"); - $acntObj->column_fields[$fieldname] = $fieldvalue; - if($fieldname == 'annual_revenue')//annual revenue converted to dollar value while saving - { - $acntObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue); - } - $acntObj->id = $crmid; - $acntObj->mode = "edit"; - $acntObj->save("Accounts"); - if($acntObj->id != "") - { - echo ":#:SUCCESS"; - }else - { - echo ":#:FAILURE"; - } - }else - { - echo ":#:FAILURE"; - } -} -?> +retrieve_entity_info($crmid,"Accounts"); + $acntObj->column_fields[$fieldname] = $fieldvalue; + if($fieldname == 'annual_revenue')//annual revenue converted to dollar value while saving + { + $acntObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue); + } + $acntObj->id = $crmid; + $acntObj->mode = "edit"; + $acntObj->save("Accounts"); + if($acntObj->id != "") + { + echo ":#:SUCCESS"; + }else + { + echo ":#:FAILURE"; + } + }else + { + echo ":#:FAILURE"; + } +} +?> Modified: vtigercrm/branches/5.1_jens/modules/Accounts/EditView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/EditView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/EditView.php Tue Nov 14 03:16:10 2006 @@ -22,16 +22,18 @@ require_once('Smarty_setup.php'); require_once('data/Tracker.php'); -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('include/CustomFieldUtil.php'); require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('include/FormValidationUtil.php'); global $app_strings,$mod_strings,$currentModule,$theme; +global $current_organization; +global $user_organizations; $smarty=new vtigerCRM_Smarty; -$focus = new Account(); +$focus = new Accounts(); if(isset($_REQUEST['record'])) { @@ -39,7 +41,10 @@ $focus->mode = 'edit'; $focus->retrieve_entity_info($_REQUEST['record'],"Accounts"); $focus->name=$focus->column_fields['accountname']; +} else { + $focus->column_fields["otherorgs"][$current_organization]=1; } + if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { $focus->id = ""; $focus->mode = ''; @@ -95,7 +100,7 @@ $smarty->assign("IMAGE_PATH", $image_path);$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); $smarty->assign("ID", $focus->id); $smarty->assign("MODULE",$currentModule); -$smarty->assign("SINGLE_MOD",$app_strings['Account']); +$smarty->assign("SINGLE_MOD",'Account'); $smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']); $smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT'])); @@ -111,6 +116,16 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); +// Assigned organizations +$smarty->assign("CURRENT_ORGANIZATION",$current_organization); +$org_array=array(); +$org=strtok( $user_organizations, "|"); +while( $org !== false) { + $org_array[$org] = 1; + $org=strtok( "|"); +} +$smarty->assign("USER_ORGANIZATIONS",$org_array); + if ($focus->mode == 'edit') $smarty->display('salesEditView.tpl'); else Modified: vtigercrm/branches/5.1_jens/modules/Accounts/HeadLines.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/HeadLines.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/HeadLines.php Tue Nov 14 03:16:10 2006 @@ -8,7 +8,7 @@ * All Rights Reserved. * ********************************************************************************/ -include("modules/Accounts/Account.php"); +include("modules/Accounts/Accounts.php"); include("getCompanyProfile.php"); $variable = $_REQUEST['tickersymbol']; $url = "http://finance.yahoo.com/q?s=".$variable; Modified: vtigercrm/branches/5.1_jens/modules/Accounts/ListView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/ListView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/ListView.php Tue Nov 14 03:16:10 2006 @@ -15,7 +15,7 @@ require_once('Smarty_setup.php'); require_once("data/Tracker.php"); -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('themes/'.$theme.'/layout_utils.php'); require_once('include/logging.php'); require_once('include/ListView/ListView.php'); @@ -43,7 +43,7 @@ $url_string = ''; -$focus = new Account(); +$focus = new Accounts(); $smarty = new vtigerCRM_Smarty; $other_text = Array(); @@ -80,6 +80,7 @@ $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid); //<<<<>>>> $smarty->assign("CHANGE_OWNER",getUserslist()); +$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist()); if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true') { list($where, $ustring) = split("#@@#",getWhereCondition($currentModule)); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/ListViewTop.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/ListViewTop.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/ListViewTop.php Tue Nov 14 03:16:10 2006 @@ -28,7 +28,7 @@ $log = LoggerManager::getLogger('top accounts_list'); $log->debug("Entering getTopAccounts() method ..."); require_once("data/Tracker.php"); - require_once('modules/Potentials/Opportunity.php'); + require_once('modules/Potentials/Potentials.php'); require_once('include/logging.php'); require_once('include/ListView/ListView.php'); global $app_strings; Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Merge.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Merge.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Merge.php Tue Nov 14 03:16:10 2006 @@ -108,7 +108,7 @@ { if($modulename == "Contacts") { - $tablename = "crmentityContacts"; + $tablename = "vtiger_crmentityContacts"; } } $querycolumns[$x] = $tablename.".".$columnname; @@ -120,20 +120,20 @@ } if($modulename == "Contacts") { - $querycolumns[$x] = "concat(usersContacts.last_name,' ',usersContacts.first_name) as userjoincname"; + $querycolumns[$x] = "concat(vtiger_usersContacts.last_name,' ',vtiger_usersContacts.first_name) as userjoincname"; } } if($columnname == "parentid") { - $querycolumns[$x] = "accountAccount.accountname"; + $querycolumns[$x] = "vtiger_accountAccount.accountname"; } if($columnname == "accountid") { - $querycolumns[$x] = "accountContacts.accountname"; + $querycolumns[$x] = "vtiger_accountContacts.accountname"; } if($columnname == "reportsto") { - $querycolumns[$x] = "contactdetailsContacts.lastname"; + $querycolumns[$x] = "vtiger_contactdetailsContacts.lastname"; } if($modulename == "Accounts") @@ -174,7 +174,7 @@ left join vtiger_contactdetails as vtiger_contactdetailsContacts on vtiger_contactdetailsContacts.contactid = vtiger_contactdetails.reportsto left join vtiger_account as vtiger_accountContacts on vtiger_accountContacts.accountid = vtiger_contactdetails.accountid left join vtiger_users as vtiger_usersContacts on vtiger_usersContacts.id = vtiger_crmentityContacts.smownerid - where vtiger_crmentity.deleted=0 and (crmentityContacts.deleted=0 || vtiger_crmentityContacts.deleted is null) and vtiger_account.accountid in(".$mass_merge.")"; + where vtiger_crmentity.deleted=0 and (vtiger_crmentityContacts.deleted=0 || vtiger_crmentityContacts.deleted is null) and vtiger_account.accountid in(".$mass_merge.")"; //echo $query; //die; $result = $adb->query($query); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Save.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Save.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Save.php Tue Nov 14 03:16:10 2006 @@ -21,14 +21,14 @@ * Contributor(s): ______________________________________.. ********************************************************************************/ -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('include/logging.php'); //require_once('database/DatabaseConnection.php'); require_once('include/database/PearDatabase.php'); $local_log =& LoggerManager::getLogger('index'); global $log; -$focus = new Account(); +$focus = new Accounts(); global $current_user; $currencyid=fetchCurrency($current_user->id); $rate_symbol = getCurrencySymbolandCRate($currencyid); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Tickerdetail.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Tickerdetail.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Tickerdetail.php Tue Nov 14 03:16:10 2006 @@ -8,7 +8,7 @@ * All Rights Reserved. * ********************************************************************************/ -require_once("modules/Accounts/Account.php"); +require_once("modules/Accounts/Accounts.php"); require_once("getCompanyProfile.php"); $variable = $_REQUEST['tickersymbol']; $url = "http://moneycentral.msn.com/investor/research/profile.asp?Symbol=".trim($variable); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/language/en_us.lang.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/language/en_us.lang.php Tue Nov 14 03:16:10 2006 @@ -1,214 +1,217 @@ -'Accounts', -'LBL_MODULE_TITLE'=>'Accounts: Home', -'LBL_SEARCH_FORM_TITLE'=>'Account Search', -'LBL_LIST_FORM_TITLE'=>'Account List', -'LBL_NEW_FORM_TITLE'=>'New Account', -'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations', -// Label for Top Accounts in Home Page, added for 4.2 GA -'LBL_TOP_ACCOUNTS'=>'My Top Accounts', -'LBL_TOP_AMOUNT'=>'Amount', -'LBL_LIST_ACCOUNT_NAME'=>'Account Name', -'LBL_LIST_CITY'=>'City', -'LBL_LIST_WEBSITE'=>'Website', -'LBL_LIST_STATE'=>'State', -'LBL_LIST_PHONE'=>'Phone', -'LBL_LIST_EMAIL_ADDRESS'=>'Email Address', -'LBL_LIST_CONTACT_NAME'=>'Contact Name', -'LBL_LIST_AMOUNT' => 'Total Opportunities', - -//DON'T CONVERT THESE THEY ARE MAPPINGS -'db_name' => 'LBL_LIST_ACCOUNT_NAME', -'db_website' => 'LBL_LIST_WEBSITE', -'db_billing_address_city' => 'LBL_LIST_CITY', - -//END DON'T CONVERT - -'LBL_ACCOUNT'=>'Account:', -'LBL_ACCOUNT_NAME'=>'Account Name:', -'LBL_PHONE'=>'Phone:', -'LBL_WEBSITE'=>'Website:', -'LBL_FAX'=>'Fax:', -'LBL_TICKER_SYMBOL'=>'Ticker Symbol:', -'LBL_OTHER_PHONE'=>'Other Phone:', -'LBL_ANY_PHONE'=>'Any Phone:', -'LBL_MEMBER_OF'=>'Member of:', -'LBL_EMAIL'=>'Email:', -'LBL_EMPLOYEES'=>'Employees:', -'LBL_OTHER_EMAIL_ADDRESS'=>'Other Email:', -'LBL_ANY_EMAIL'=>'Any Email:', -'LBL_OWNERSHIP'=>'Ownership:', -'LBL_RATING'=>'Rating:', -'LBL_INDUSTRY'=>'Industry:', -'LBL_SIC_CODE'=>'SIC Code:', -'LBL_TYPE'=>'Type:', -'LBL_ANNUAL_REVENUE'=>'Annual Revenue:', -'LBL_ADDRESS_INFORMATION'=>'Address Information', -'LBL_ACCOUNT_INFORMATION'=>'Account Information', -'LBL_CUSTOM_INFORMATION'=>'Custom Information', -'LBL_BILLING_ADDRESS'=>'Billing Address:', -'LBL_SHIPPING_ADDRESS'=>'Shipping Address:', -'LBL_ANY_ADDRESS'=>'Any Address:', -'LBL_CITY'=>'City:', -'LBL_STATE'=>'State:', -'LBL_POSTAL_CODE'=>'Postal Code:', -'LBL_COUNTRY'=>'Country:', -'LBL_DESCRIPTION_INFORMATION'=>'Description Information', -'LBL_DESCRIPTION'=>'Description:', -'NTC_COPY_BILLING_ADDRESS'=>'Copy billing address to shipping address', -'NTC_COPY_SHIPPING_ADDRESS'=>'Copy shipping address to billing address', -'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'Are you sure you want to remove this record as a member organization?', -'LBL_DUPLICATE'=>'Potential Duplicate Accounts', -'MSG_DUPLICATE' => 'Creating this vtiger_account may vtiger_potentialy create a duplicate vtiger_account. You may either select an vtiger_account from the list below or you may click on Create New Account to continue creating a new vtiger_account with the previously entered data.', - -'LBL_INVITEE'=>'Contacts', -'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.", - -'LBL_SELECT_ACCOUNT'=>'Select Account', -'LBL_GENERAL_INFORMATION'=>'General Information', - -//for v4 release added -'LBL_NEW_POTENTIAL'=>'New Potential', -'LBL_POTENTIAL_TITLE'=>'Potentials', - -'LBL_NEW_TASK'=>'New Task', -'LBL_TASK_TITLE'=>'Tasks', -'LBL_NEW_CALL'=>'New Call', -'LBL_CALL_TITLE'=>'Calls', -'LBL_NEW_MEETING'=>'New Meeting', -'LBL_MEETING_TITLE'=>'Meetings', -'LBL_NEW_EMAIL'=>'New Email', -'LBL_EMAIL_TITLE'=>'Emails', -'LBL_NEW_CONTACT'=>'New Contact', -'LBL_CONTACT_TITLE'=>'Contacts', - -//Added vtiger_fields after RC1 - Release -'LBL_ALL'=>'All', -'LBL_PROSPECT'=>'Prospect', -'LBL_INVESTOR'=>'Investor', -'LBL_RESELLER'=>'Reseller', -'LBL_PARTNER'=>'Partner', - -// Added for 4GA -'LBL_TOOL_FORM_TITLE'=>'Account Tools', -//Added for 4GA -'Account Name'=>'Account Name', -'Phone'=>'Phone', -'Website'=>'Website', -'Fax'=>'Fax', -'Ticker Symbol'=>'Ticker Symbol', -'Other Phone'=>'Other Phone', -'Member Of'=>'Member Of', -'Email'=>'Email', -'Employees'=>'Employees', -'Other Email'=>'Other Email', -'Ownership'=>'Ownership', -'Rating'=>'Rating', -'industry'=>'Industry', -'SIC Code'=>'SIC Code', -'Type'=>'Type', -'Annual Revenue'=>'Annual Revenue', -'Assigned To'=>'Assigned To', -'Billing Address'=>'Billing Address', -'Shipping Address'=>'Shipping Address', -'Billing City'=>'Billing City', -'Shipping City'=>'Shipping City', -'Billing State'=>'Billing State', -'Shipping State'=>'Shipping State', -'Billing Code'=>'Billing Postal Code', -'Shipping Code'=>'Shipping Postal Code', -'Billing Country'=>'Billing Country', -'Shipping Country'=>'Shipping Country', -'Created Time'=>'Created Time', -'Modified Time'=>'Modified Time', -'Description'=>'Description', -'Shipping Po Box'=>'Shipping Po Box', -'Billing Po Box'=>'Billing Po Box', - -//Added after 4.2 patch 2 -'Email Opt Out'=>'Email Opt Out', -'LBL_EMAIL_OPT_OUT'=>'Email Opt Out:', - -//Added after 5Alpha5 -'Notify Owner'=>'Notify Owner', - -//Added for existing picklist entries - -'--None--'=>'--None--', - -'Acquired'=>'Acquired', -'Active'=>'Active', -'Market Failed'=>'Market Failed', -'Project Cancelled'=>'Project Cancelled', -'Shutdown'=>'Shutdown', - -'Apparel'=>'Apparel', -'Banking'=>'Banking', -'Biotechnology'=>'Biotechnology', -'Chemicals'=>'Chemicals', -'Communications'=>'Communications', -'Construction'=>'Construction', -'Consulting'=>'Consulting', -'Education'=>'Education', -'Electronics'=>'Electronics', -'Energy'=>'Energy', -'Engineering'=>'Engineering', -'Entertainment'=>'Entertainment', -'Environmental'=>'Environmental', -'Finance'=>'Finance', -'Food & Beverage'=>'Food & Beverage', -'Government'=>'Government', -'Healthcare'=>'Healthcare', -'Hospitality'=>'Hospitality', -'Insurance'=>'Insurance', -'Machinery'=>'Machinery', -'Manufacturing'=>'Manufacturing', -'Media'=>'Media', -'Not For Profit'=>'Not For Profit', -'Recreation'=>'Recreation', -'Retail'=>'Retail', -'Shipping'=>'Shipping', -'Technology'=>'Technology', -'Telecommunications'=>'Telecommunications', -'Transportation'=>'Transportation', -'Utilities'=>'Utilities', -'Other'=>'Other', - -'Analyst'=>'Analyst', -'Competitor'=>'Competitor', -'Customer'=>'Customer', -'Integrator'=>'Integrator', -'Investor'=>'Investor', -'Partner'=>'Partner', -'Press'=>'Press', -'Prospect'=>'Prospect', -'Reseller'=>'Reseller', - - - - -); - -?> +'Accounts', +'LBL_MODULE_TITLE'=>'Accounts: Home', +'LBL_SEARCH_FORM_TITLE'=>'Account Search', +'LBL_LIST_FORM_TITLE'=>'Account List', +'LBL_NEW_FORM_TITLE'=>'New Account', +'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations', +// Label for Top Accounts in Home Page, added for 4.2 GA +'LBL_TOP_ACCOUNTS'=>'My Top Accounts', +'LBL_TOP_AMOUNT'=>'Amount', +'LBL_LIST_ACCOUNT_NAME'=>'Account Name', +'LBL_LIST_CITY'=>'City', +'LBL_LIST_WEBSITE'=>'Website', +'LBL_LIST_STATE'=>'State', +'LBL_LIST_PHONE'=>'Phone', +'LBL_LIST_EMAIL_ADDRESS'=>'Email Address', +'LBL_LIST_CONTACT_NAME'=>'Contact Name', +'LBL_LIST_AMOUNT' => 'Total Opportunities', + +//DON'T CONVERT THESE THEY ARE MAPPINGS +'db_name' => 'LBL_LIST_ACCOUNT_NAME', +'db_website' => 'LBL_LIST_WEBSITE', +'db_billing_address_city' => 'LBL_LIST_CITY', + +//END DON'T CONVERT + +'LBL_ACCOUNT'=>'Account:', +'LBL_ACCOUNT_NAME'=>'Account Name:', +'LBL_PHONE'=>'Phone:', +'LBL_WEBSITE'=>'Website:', +'LBL_FAX'=>'Fax:', +'LBL_TICKER_SYMBOL'=>'Ticker Symbol:', +'LBL_OTHER_PHONE'=>'Other Phone:', +'LBL_ANY_PHONE'=>'Any Phone:', +'LBL_MEMBER_OF'=>'Member of:', +'LBL_EMAIL'=>'Email:', +'LBL_EMPLOYEES'=>'Employees:', +'LBL_OTHER_EMAIL_ADDRESS'=>'Other Email:', +'LBL_ANY_EMAIL'=>'Any Email:', +'LBL_OWNERSHIP'=>'Ownership:', +'LBL_RATING'=>'Rating:', +'LBL_INDUSTRY'=>'Industry:', +'LBL_SIC_CODE'=>'SIC Code:', +'LBL_TYPE'=>'Type:', +'LBL_ANNUAL_REVENUE'=>'Annual Revenue:', +'LBL_ADDRESS_INFORMATION'=>'Address Information', +'LBL_ACCOUNT_INFORMATION'=>'Account Information', +'LBL_CUSTOM_INFORMATION'=>'Custom Information', +'LBL_BILLING_ADDRESS'=>'Billing Address:', +'LBL_SHIPPING_ADDRESS'=>'Shipping Address:', +'LBL_ANY_ADDRESS'=>'Any Address:', +'LBL_CITY'=>'City:', +'LBL_STATE'=>'State:', +'LBL_POSTAL_CODE'=>'Postal Code:', +'LBL_COUNTRY'=>'Country:', +'LBL_DESCRIPTION_INFORMATION'=>'Description Information', +'LBL_DESCRIPTION'=>'Description:', +'NTC_COPY_BILLING_ADDRESS'=>'Copy billing address to shipping address', +'NTC_COPY_SHIPPING_ADDRESS'=>'Copy shipping address to billing address', +'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'Are you sure you want to remove this record as a member organization?', +'LBL_DUPLICATE'=>'Potential Duplicate Accounts', +'MSG_DUPLICATE' => 'Creating this vtiger_account may vtiger_potentialy create a duplicate vtiger_account. You may either select an vtiger_account from the list below or you may click on Create New Account to continue creating a new vtiger_account with the previously entered data.', + +'LBL_INVITEE'=>'Contacts', +'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.", + +'LBL_SELECT_ACCOUNT'=>'Select Account', +'LBL_GENERAL_INFORMATION'=>'General Information', + +//for v4 release added +'LBL_NEW_POTENTIAL'=>'New Potential', +'LBL_POTENTIAL_TITLE'=>'Potentials', + +'LBL_NEW_TASK'=>'New Task', +'LBL_TASK_TITLE'=>'Tasks', +'LBL_NEW_CALL'=>'New Call', +'LBL_CALL_TITLE'=>'Calls', +'LBL_NEW_MEETING'=>'New Meeting', +'LBL_MEETING_TITLE'=>'Meetings', +'LBL_NEW_EMAIL'=>'New Email', +'LBL_EMAIL_TITLE'=>'Emails', +'LBL_NEW_CONTACT'=>'New Contact', +'LBL_CONTACT_TITLE'=>'Contacts', + +//Added vtiger_fields after RC1 - Release +'LBL_ALL'=>'All', +'LBL_PROSPECT'=>'Prospect', +'LBL_INVESTOR'=>'Investor', +'LBL_RESELLER'=>'Reseller', +'LBL_PARTNER'=>'Partner', + +// Added for 4GA +'LBL_TOOL_FORM_TITLE'=>'Account Tools', +//Added for 4GA +'Account Name'=>'Account Name', +'Phone'=>'Phone', +'Website'=>'Website', +'Fax'=>'Fax', +'Ticker Symbol'=>'Ticker Symbol', +'Other Phone'=>'Other Phone', +'Member Of'=>'Member Of', +'Email'=>'Email', +'Employees'=>'Employees', +'Other Email'=>'Other Email', +'Ownership'=>'Ownership', +'Rating'=>'Rating', +'industry'=>'Industry', +'SIC Code'=>'SIC Code', +'Type'=>'Type', +'Annual Revenue'=>'Annual Revenue', +'Assigned To'=>'Assigned To', +'Billing Address'=>'Billing Address', +'Shipping Address'=>'Shipping Address', +'Billing City'=>'Billing City', +'Shipping City'=>'Shipping City', +'Billing State'=>'Billing State', +'Shipping State'=>'Shipping State', +'Billing Code'=>'Billing Postal Code', +'Shipping Code'=>'Shipping Postal Code', +'Billing Country'=>'Billing Country', +'Shipping Country'=>'Shipping Country', +'Created Time'=>'Created Time', +'Modified Time'=>'Modified Time', +'Description'=>'Description', +'Shipping Po Box'=>'Shipping PO Box', +'Billing Po Box'=>'Billing PO Box', + +//Added after 4.2 patch 2 +'Email Opt Out'=>'Email Opt Out', +'LBL_EMAIL_OPT_OUT'=>'Email Opt Out:', + +//Added after 5Alpha5 +'Notify Owner'=>'Notify Owner', + +//Added for existing picklist entries + +'--None--'=>'--None--', + +'Acquired'=>'Acquired', +'Active'=>'Active', +'Market Failed'=>'Market Failed', +'Project Cancelled'=>'Project Cancelled', +'Shutdown'=>'Shutdown', + +'Apparel'=>'Apparel', +'Banking'=>'Banking', +'Biotechnology'=>'Biotechnology', +'Chemicals'=>'Chemicals', +'Communications'=>'Communications', +'Construction'=>'Construction', +'Consulting'=>'Consulting', +'Education'=>'Education', +'Electronics'=>'Electronics', +'Energy'=>'Energy', +'Engineering'=>'Engineering', +'Entertainment'=>'Entertainment', +'Environmental'=>'Environmental', +'Finance'=>'Finance', +'Food & Beverage'=>'Food & Beverage', +'Government'=>'Government', +'Healthcare'=>'Healthcare', +'Hospitality'=>'Hospitality', +'Insurance'=>'Insurance', +'Machinery'=>'Machinery', +'Manufacturing'=>'Manufacturing', +'Media'=>'Media', +'Not For Profit'=>'Not For Profit', +'Recreation'=>'Recreation', +'Retail'=>'Retail', +'Shipping'=>'Shipping', +'Technology'=>'Technology', +'Telecommunications'=>'Telecommunications', +'Transportation'=>'Transportation', +'Utilities'=>'Utilities', +'Other'=>'Other', + +'Analyst'=>'Analyst', +'Competitor'=>'Competitor', +'Customer'=>'Customer', +'Integrator'=>'Integrator', +'Investor'=>'Investor', +'Partner'=>'Partner', +'Press'=>'Press', +'Prospect'=>'Prospect', +'Reseller'=>'Reseller', +'LBL_START_DATE' => 'Start Date', +'LBL_END_DATE' => 'End Date', + +// Added for multi organization support TRAC #2035 +'LBL_COMPANY_ASSIGNMENT'=>'Organization Assignment', +'Organization Assignment'=>'Assigned to', + +); + +?> Modified: vtigercrm/branches/5.1_jens/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/Activity.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/Activity.php Tue Nov 14 03:16:10 2006 @@ -1,498 +1,740 @@ -'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid'); - - var $column_fields = Array(); - var $sortby_fields = Array('subject','due_date','date_start','smownerid','activitytype'); //Sorting is added for due date and start date - - // This is used to retrieve related vtiger_fields from form posts. - var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'); - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Close'=>Array('activity'=>'status'), - 'Type'=>Array('activity'=>'activitytype'), - 'Subject'=>Array('activity'=>'subject'), - 'Related to'=>Array('seactivityrel'=>'activityid'), - 'Start Date'=>Array('activity'=>'date_start'), - 'End Date'=>Array('activity'=>'due_date'), - 'Recurring Type'=>Array('recurringevents'=>'recurringtype'), - 'Assigned To'=>Array('crmentity'=>'smownerid') - ); - - var $range_fields = Array( - 'name', - 'date_modified', - 'start_date', - 'id', - 'status', - 'date_due', - 'time_start', - 'description', - 'contact_name', - 'priority', - 'duehours', - 'dueminutes', - 'location' - ); - - - var $list_fields_name = Array( - 'Close'=>'status', - 'Type'=>'activitytype', - 'Subject'=>'subject', - 'Contact Name'=>'lastname', - 'Related to'=>'activityid', - 'Start Date'=>'date_start', - 'End Date'=>'due_date', - 'Recurring Type'=>'recurringtype', - 'Assigned To'=>'assigned_user_id'); - - var $list_link_field= 'subject'; - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'due_date'; - var $default_sort_order = 'ASC'; - - function Activity() { - $this->log = LoggerManager::getLogger('Calendar'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Calendar'); - } - - var $new_schema = true; - - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '')?($_SESSION['ACTIVITIES_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder method ..."); - return $sorder; - } - - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'subject') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '')?($_SESSION['ACTIVITIES_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - -//Function Call for Related List -- Start - /** - * Function to get Activity related Contacts - * @param integer $id - activityid - * returns related Contacts record in array format - */ - function get_contacts($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new Contact(); - - $button = ''; - - $returnset = '&return_module=Calendar&return_action=CallRelatedList&activity_mode=Events&return_id='.$id; - - $query = 'select vtiger_users.user_name,vtiger_contactdetails.accountid,vtiger_contactdetails.contactid, vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_contactdetails.department, vtiger_contactdetails.title, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid=vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_cntactivityrel.activityid = vtiger_activitygrouprelation.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname where vtiger_cntactivityrel.activityid='.$id.' and vtiger_crmentity.deleted=0'; - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Calendar','Contacts',$focus,$query,$button,$returnset); - } - - /** - * Function to get Activity related Users - * @param integer $id - activityid - * returns related Users record in array format - */ - - function get_users($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new User(); - - $button = ''; - - $returnset = '&return_module=Calendar&return_action=CallRelatedList&return_id='.$id; - - $query = 'SELECT vtiger_users.id, vtiger_users.first_name,vtiger_users.last_name, vtiger_users.user_name, vtiger_users.email1, vtiger_users.email2, vtiger_users.status, vtiger_users.is_admin, vtiger_user2role.roleid, vtiger_users.yahoo_id, vtiger_users.phone_home, vtiger_users.phone_work, vtiger_users.phone_mobile, vtiger_users.phone_other, vtiger_users.phone_fax,vtiger_activity.date_start,vtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes from vtiger_users inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.smid=vtiger_users.id inner join vtiger_activity on vtiger_activity.activityid=vtiger_salesmanactivityrel.activityid inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where vtiger_activity.activityid='.$id; - $log->debug("Exiting get_users method ..."); - return GetRelatedList('Calendar','Users',$focus,$query,$button,$returnset); - - - } - - /** - * Function to get activities for given criteria - * @param string $criteria - query string - * returns activity records in array format($list) or null value - */ - function get_full_list($criteria) - { - global $log; - $log->debug("Entering get_full_list(".$criteria.") method ..."); - $query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 ".$criteria; - $result =& $this->db->query($query); - - if($this->db->getRowCount($result) > 0){ - - // We have some data. - while ($row = $this->db->fetchByAssoc($result)) { - foreach($this->list_fields_name as $field) - { - if (isset($row[$field])) { - $this->$field = $row[$field]; - } - else { - $this->$field = ''; - } - } - $list[] = $this; - } - } - if (isset($list)) - { - $log->debug("Exiting get_full_list method ..."); - return $list; - } - else - { - $log->debug("Exiting get_full_list method ..."); - return null; - } - - } - - -//calendarsync - /** - * Function to get meeting count - * @param string $user_name - User Name - * return integer $row["count(*)"] - count - */ - function getCount_Meeting($user_name) - { - global $log; - $log->debug("Entering getCount_Meeting(".$user_name.") method ..."); - $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - $log->debug("Exiting getCount_Meeting method ..."); - return $row["count(*)"]; - } - - function get_calendars($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_calendars(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_activity.location as location,vtiger_activity.duration_hours as duehours, vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as time_start, vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as vtiger_priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting' limit " .$from_index ."," .$offset; - $log->debug("Exiting get_calendars method ..."); - return $this->process_list_query1($query); - } -//calendarsync - /** - * Function to get task count - * @param string $user_name - User Name - * return integer $row["count(*)"] - count - */ - function getCount($user_name) - { - global $log; - $log->debug("Entering getCount(".$user_name.") method ..."); - $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - - $log->debug("Exiting getCount method ..."); - return $row["count(*)"]; - } - - /** - * Function to get list of task for user with given limit - * @param string $user_name - User Name - * @param string $from_index - query string - * @param string $offset - query string - * returns tasks in array format - */ - function get_tasks($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_tasks(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task' limit " .$from_index ."," .$offset; - $log->debug("Exiting get_tasks method ..."); - return $this->process_list_query1($query); - - } - - /** - * Function to process the activity list query - * @param string $query - query string - * return array $response - activity lists - */ - function process_list_query1($query) - { - global $log; - $log->debug("Entering process_list_query1(".$query.") method ..."); - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - $task = Array(); - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - - { - foreach($this->range_fields as $columnName) - { - if (isset($row[$columnName])) { - - $task[$columnName] = $row[$columnName]; - } - else - { - $task[$columnName] = ""; - } - } - - $task[contact_name] = return_name($row, 'cfn', 'cln'); - - $list[] = $task; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - - $log->debug("Exiting process_list_query1 method ..."); - return $response; - } - - /** - * Function to get reminder for activity - * @param integer $activity_id - activity id - * @param string $reminder_time - reminder time - * @param integer $reminder_sent - 0 or 1 - * @param integer $recurid - recuring eventid - * @param string $remindermode - string like 'edit' - */ - function activity_reminder($activity_id,$reminder_time,$reminder_sent=0,$recurid,$remindermode='') - { - global $log; - $log->debug("Entering vtiger_activity_reminder(".$activity_id.",".$reminder_time.",".$reminder_sent.",".$recurid.",".$remindermode.") method ..."); - //Check for vtiger_activityid already present in the reminder_table - $query_exist = "SELECT activity_id FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; - $result_exist = $this->db->query($query_exist); - - if($remindermode == 'edit') - { - if($this->db->num_rows($result_exist) == 1) - { - $query = "UPDATE ".$this->reminder_table." SET"; - $query .=" reminder_sent = ".$reminder_sent.","; - $query .=" reminder_time = ".$reminder_time." WHERE activity_id =".$activity_id; - } - else - { - $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; - } - } - elseif(($remindermode == 'delete') && ($this->db->num_rows($result_exist) == 1)) - { - $query = "DELETE FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; - } - else - { - $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; - } - $this->db->query($query,true,"Error in processing vtiger_table $this->reminder_table"); - $log->debug("Exiting vtiger_activity_reminder method ..."); - } - -//Used for vtigerCRM Outlook Add-In -/** - * Function to get tasks to display in outlookplugin - * @param string $username - User name - * return string $query - sql query - */ -function get_tasksforol($username) -{ - global $log,$adb; - $log->debug("Entering get_tasksforol(".$username.") method ..."); - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($username); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result1 = $adb->query($sql1); - for($i=0;$i < $adb->num_rows($result1);$i++) - { - $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); - $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); - /*if($adb->query_result($result1,$i,'columnname') == "parentid") - { - $permitted_lists[] = 'vtiger_account'; - $permitted_lists[] = 'accountname'; - }*/ - } - $permitted_lists = array_chunk($permitted_lists,2); - $column_table_lists = array(); - for($i=0;$i < count($permitted_lists);$i++) - { - $column_table_lists[] = implode(".",$permitted_lists[$i]); - } - - $query = "select vtiger_activity.activityid as taskid, ".implode(',',$column_table_lists)." from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid - left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid - where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; - $log->debug("Exiting get_tasksforol method ..."); - return $query; -} - -/** - * Function to get calendar query for outlookplugin - * @param string $username - User name * return string $query - sql query */ -function get_calendarsforol($user_name) -{ - global $log,$adb; - $log->debug("Entering get_calendarsforol(".$user_name.") method ..."); - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result1 = $adb->query($sql1); - for($i=0;$i < $adb->num_rows($result1);$i++) - { - $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); - $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); - /*if($adb->query_result($result1,$i,'columnname') == "parentid") - { - $permitted_lists[] = 'vtiger_account'; - $permitted_lists[] = 'accountname'; - }*/ - } - $permitted_lists = array_chunk($permitted_lists,2); - $column_table_lists = array(); - for($i=0;$i < count($permitted_lists);$i++) - { - $column_table_lists[] = implode(".",$permitted_lists[$i]); - } - - $query = "select vtiger_activity.activityid as clndrid, ".implode(',',$column_table_lists)." from vtiger_activity - inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid - left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; - $log->debug("Exiting get_calendarsforol method ..."); - return $query; -} -//End - -} -?> +'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid'); + + var $column_fields = Array(); + var $sortby_fields = Array('subject','due_date','date_start','smownerid','activitytype'); //Sorting is added for due date and start date + + // This is used to retrieve related vtiger_fields from form posts. + var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'); + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Close'=>Array('activity'=>'status'), + 'Type'=>Array('activity'=>'activitytype'), + 'Subject'=>Array('activity'=>'subject'), + 'Related to'=>Array('seactivityrel'=>'activityid'), + 'Start Date'=>Array('activity'=>'date_start'), + 'End Date'=>Array('activity'=>'due_date'), + 'Recurring Type'=>Array('recurringevents'=>'recurringtype'), + 'Assigned To'=>Array('crmentity'=>'smownerid') + ); + + var $range_fields = Array( + 'name', + 'date_modified', + 'start_date', + 'id', + 'status', + 'date_due', + 'time_start', + 'description', + 'contact_name', + 'priority', + 'duehours', + 'dueminutes', + 'location' + ); + + + var $list_fields_name = Array( + 'Close'=>'status', + 'Type'=>'activitytype', + 'Subject'=>'subject', + 'Contact Name'=>'lastname', + 'Related to'=>'activityid', + 'Start Date'=>'date_start', + 'End Date'=>'due_date', + 'Recurring Type'=>'recurringtype', + 'Assigned To'=>'assigned_user_id'); + + var $list_link_field= 'subject'; + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'due_date'; + var $default_sort_order = 'ASC'; + + function Activity() { + $this->log = LoggerManager::getLogger('Calendar'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Calendar'); + } + + + function save_module($module) + { + //Handling module specific save + //Insert into seactivity rel + if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '') + { + $this->insertIntoEntityTable("vtiger_seactivityrel", $module); + } + elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit") + { + $this->deleteRelation("vtiger_seactivityrel"); + } + //Insert into cntactivity rel + + if(isset($this->column_fields['contact_id']) && $this->column_fields['contact_id'] != '') + { + $this->insertIntoEntityTable('vtiger_cntactivityrel', $module); + } + elseif($this->column_fields['contact_id'] =='' && $insertion_mode=="edit") + { + $this->deleteRelation('vtiger_cntactivityrel'); + } + + //Handling for recurring type + //Insert into vtiger_activity_remainder table + if(isset($this->column_fields['recurringtype']) && $this->column_fields['recurringtype']!='') + $recur_type = trim($this->column_fields['recurringtype']); + else + $recur_type=''; + + if($recur_type == "--None--") + { + $this->insertIntoReminderTable('vtiger_activity_reminder',$module,""); + } + + //Insert into vtiger_recurring event table + $recur_type = trim($this->column_fields['recurringtype']); + if($recur_type != "--None--" && $recur_type != '') + { + $recur_data = getrecurringObjValue(); + if(is_object($recur_data)) + $this->insertIntoRecurringTable($recur_data); + } + + //Handling for invitees + if(isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid']!='') + { + $selected_users_string = $_REQUEST['inviteesid']; + $invitees_array = explode(';',$selected_users_string); + $this->insertIntoInviteeTable('vtiger_invitees',$module,$invitees_array); + + } + + //Inserting into sales man activity rel + $this->insertIntoSmActivityRel($module); + + + + } + + + /** Function to insert values in vtiger_activity_remainder table for the specified module, + * @param $table_name -- table name:: Type varchar + * @param $module -- module:: Type varchar + */ + function insertIntoReminderTable($table_name,$module,$recurid) + { + global $log; + $log->info("in insertIntoReminderTable ".$table_name." module is ".$module); + if($_REQUEST['set_reminder'] == 'Yes') + { + $log->debug("set reminder is set"); + $rem_days = $_REQUEST['remdays']; + $log->debug("rem_days is ".$rem_days); + $rem_hrs = $_REQUEST['remhrs']; + $log->debug("rem_hrs is ".$rem_hrs); + $rem_min = $_REQUEST['remmin']; + $log->debug("rem_minutes is ".$rem_min); + $reminder_time = $rem_days * 24 * 60 + $rem_hrs * 60 + $rem_min; + $log->debug("reminder_time is ".$reminder_time); + if ($recurid == "") + { + if($_REQUEST['mode'] == 'edit') + { + $this->activity_reminder($this->id,$reminder_time,0,$recurid,'edit'); + } + else + { + $this->activity_reminder($this->id,$reminder_time,0,$recurid,''); + } + } + else + { + $this->activity_reminder($this->id,$reminder_time,0,$recurid,''); + } + } + elseif($_REQUEST['set_reminder'] == 'No') + { + $this->activity_reminder($this->id,'0',0,$recurid,'delete'); + } + } + + + // Code included by Jaguar - starts + /** Function to insert values in vtiger_recurringevents table for the specified tablename,module + * @param $recurObj -- Recurring Object:: Type varchar + */ +function insertIntoRecurringTable(& $recurObj) +{ + global $log,$adb; + $log->info("in insertIntoRecurringTable "); + $st_date = $recurObj->startdate->get_formatted_date(); + $log->debug("st_date ".$st_date); + $end_date = $recurObj->enddate->get_formatted_date(); + $log->debug("end_date is set ".$end_date); + $type = $recurObj->recur_type; + $log->debug("type is ".$type); + $flag="true"; + + if($_REQUEST['mode'] == 'edit') + { + $activity_id=$this->id; + + $sql='select min(recurringdate) AS min_date,max(recurringdate) AS max_date, recurringtype, activityid from vtiger_recurringevents where activityid='. $activity_id.' group by activityid, recurringtype'; + + $result = $adb->query($sql); + $noofrows = $adb->num_rows($result); + for($i=0; $i<$noofrows; $i++) + { + $recur_type_b4_edit = $adb->query_result($result,$i,"recurringtype"); + $date_start_b4edit = $adb->query_result($result,$i,"min_date"); + $end_date_b4edit = $adb->query_result($result,$i,"max_date"); + } + if(($st_date == $date_start_b4edit) && ($end_date==$end_date_b4edit) && ($type == $recur_type_b4_edit)) + { + if($_REQUEST['set_reminder'] == 'Yes') + { + $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; + $adb->query($sql); + $sql = 'delete from vtiger_recurringevents where activityid='.$activity_id; + $adb->query($sql); + $flag="true"; + } + elseif($_REQUEST['set_reminder'] == 'No') + { + $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; + $adb->query($sql); + $flag="false"; + } + else + $flag="false"; + } + else + { + $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; + $adb->query($sql); + $sql = 'delete from vtiger_recurringevents where activityid='.$activity_id; + $adb->query($sql); + } + } + $date_array = $recurObj->recurringdates; + if(isset($recurObj->recur_freq) && $recurObj->recur_freq != null) + $recur_freq = $recurObj->recur_freq; + else + $recur_freq = 1; + if($recurObj->recur_type == 'Daily' || $recurObj->recur_type == 'Yearly') + $recurringinfo = $recurObj->recur_type; + elseif($recurObj->recur_type == 'Weekly') + { + $recurringinfo = $recurObj->recur_type; + if($recurObj->dayofweek_to_rpt != null) + $recurringinfo = $recurringinfo.'::'.implode('::',$recurObj->dayofweek_to_rpt); + } + elseif($recurObj->recur_type == 'Monthly') + { + $recurringinfo = $recurObj->recur_type.'::'.$recurObj->repeat_monthby; + if($recurObj->repeat_monthby == 'date') + $recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_datevalue; + else + $recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_daytype.'::'.$recurObj->dayofweek_to_rpt[0]; + } + else + { + $recurringinfo = ''; + } + if($flag=="true") + { + for($k=0; $k< count($date_array); $k++) + { + $tdate=$date_array[$k]; + if($tdate <= $end_date) + { + $max_recurid_qry = 'select max(recurringid) AS recurid from vtiger_recurringevents;'; + $result = $adb->query($max_recurid_qry); + $noofrows = $adb->num_rows($result); + for($i=0; $i<$noofrows; $i++) + { + $recur_id = $adb->query_result($result,$i,"recurid"); + } + $current_id =$recur_id+1; + $recurring_insert = "insert into vtiger_recurringevents values ('".$current_id."','".$this->id."','".$tdate."','".$type."','".$recur_freq."','".$recurringinfo."')"; + $adb->query($recurring_insert); + if($_REQUEST['set_reminder'] == 'Yes') + { + $this->insertIntoReminderTable("vtiger_activity_reminder",$module,$current_id,''); + } + } + } + } +} + + + /** Function to insert values in vtiger_invitees table for the specified module,tablename ,invitees_array + * @param $table_name -- table name:: Type varchar + * @param $module -- module:: Type varchar + * @param $invitees_array Array + */ + function insertIntoInviteeTable($table_name,$module,$invitees_array) + { + global $log,$adb; + $log->debug("Entering insertIntoInviteeTable(".$table_name.",".$module.",".$invitees_array.") method ..."); + foreach($invitees_array as $inviteeid) + { + if($inviteeid != '') + { + $query="insert into vtiger_invitees values(".$this->id.",".$inviteeid.")"; + $adb->query($query); + } + } + $log->debug("Exiting insertIntoInviteeTable method ..."); + + } + + + /** Function to insert values in vtiger_salesmanactivityrel table for the specified module + * @param $module -- module:: Type varchar + */ + + function insertIntoSmActivityRel($module) + { + global $adb; + global $current_user; + if($this->mode == 'edit') + { + + $sql = "delete from vtiger_salesmanactivityrel where activityid=".$this->id." and smid = ".$this->column_fields['assigned_user_id'].""; + $adb->query($sql); + + } + $sql_qry = "insert into vtiger_salesmanactivityrel (smid,activityid) values(".$this->column_fields['assigned_user_id'].",".$this->id.")"; + $adb->query($sql_qry); + + } + + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '')?($_SESSION['ACTIVITIES_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder method ..."); + return $sorder; + } + + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'subject') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '')?($_SESSION['ACTIVITIES_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + +//Function Call for Related List -- Start + /** + * Function to get Activity related Contacts + * @param integer $id - activityid + * returns related Contacts record in array format + */ + function get_contacts($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new Contacts(); + + $button = ''; + + $returnset = '&return_module=Calendar&return_action=CallRelatedList&activity_mode=Events&return_id='.$id; + + $query = 'select vtiger_users.user_name,vtiger_contactdetails.accountid,vtiger_contactdetails.contactid, vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_contactdetails.department, vtiger_contactdetails.title, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid=vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_cntactivityrel.activityid = vtiger_activitygrouprelation.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname where vtiger_cntactivityrel.activityid='.$id.' and vtiger_crmentity.deleted=0'; + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Calendar','Contacts',$focus,$query,$button,$returnset); + } + + /** + * Function to get Activity related Users + * @param integer $id - activityid + * returns related Users record in array format + */ + + function get_users($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new Users(); + + $button = ''; + + $returnset = '&return_module=Calendar&return_action=CallRelatedList&return_id='.$id; + + $query = 'SELECT vtiger_users.id, vtiger_users.first_name,vtiger_users.last_name, vtiger_users.user_name, vtiger_users.email1, vtiger_users.email2, vtiger_users.status, vtiger_users.is_admin, vtiger_user2role.roleid, vtiger_users.yahoo_id, vtiger_users.phone_home, vtiger_users.phone_work, vtiger_users.phone_mobile, vtiger_users.phone_other, vtiger_users.phone_fax,vtiger_activity.date_start,vtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes from vtiger_users inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.smid=vtiger_users.id inner join vtiger_activity on vtiger_activity.activityid=vtiger_salesmanactivityrel.activityid inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where vtiger_activity.activityid='.$id; + $log->debug("Exiting get_users method ..."); + return GetRelatedList('Calendar','Users',$focus,$query,$button,$returnset); + + + } + + /** + * Function to get activities for given criteria + * @param string $criteria - query string + * returns activity records in array format($list) or null value + */ + function get_full_list($criteria) + { + global $log; + $log->debug("Entering get_full_list(".$criteria.") method ..."); + $query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 ".$criteria; + $result =& $this->db->query($query); + + if($this->db->getRowCount($result) > 0){ + + // We have some data. + while ($row = $this->db->fetchByAssoc($result)) { + foreach($this->list_fields_name as $field) + { + if (isset($row[$field])) { + $this->$field = $row[$field]; + } + else { + $this->$field = ''; + } + } + $list[] = $this; + } + } + if (isset($list)) + { + $log->debug("Exiting get_full_list method ..."); + return $list; + } + else + { + $log->debug("Exiting get_full_list method ..."); + return null; + } + + } + + +//calendarsync + /** + * Function to get meeting count + * @param string $user_name - User Name + * return integer $row["count(*)"] - count + */ + function getCount_Meeting($user_name) + { + global $log; + $log->debug("Entering getCount_Meeting(".$user_name.") method ..."); + $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + $log->debug("Exiting getCount_Meeting method ..."); + return $row["count(*)"]; + } + + function get_calendars($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_calendars(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_activity.location as location,vtiger_activity.duration_hours as duehours, vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as time_start, vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as vtiger_priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting' limit " .$from_index ."," .$offset; + $log->debug("Exiting get_calendars method ..."); + return $this->process_list_query1($query); + } +//calendarsync + /** + * Function to get task count + * @param string $user_name - User Name + * return integer $row["count(*)"] - count + */ + function getCount($user_name) + { + global $log; + $log->debug("Entering getCount(".$user_name.") method ..."); + $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + + $log->debug("Exiting getCount method ..."); + return $row["count(*)"]; + } + + /** + * Function to get list of task for user with given limit + * @param string $user_name - User Name + * @param string $from_index - query string + * @param string $offset - query string + * returns tasks in array format + */ + function get_tasks($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_tasks(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task' limit " .$from_index ."," .$offset; + $log->debug("Exiting get_tasks method ..."); + return $this->process_list_query1($query); + + } + + /** + * Function to process the activity list query + * @param string $query - query string + * return array $response - activity lists + */ + function process_list_query1($query) + { + global $log; + $log->debug("Entering process_list_query1(".$query.") method ..."); + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + $task = Array(); + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + + { + foreach($this->range_fields as $columnName) + { + if (isset($row[$columnName])) { + + $task[$columnName] = $row[$columnName]; + } + else + { + $task[$columnName] = ""; + } + } + + $task[contact_name] = return_name($row, 'cfn', 'cln'); + + $list[] = $task; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + + $log->debug("Exiting process_list_query1 method ..."); + return $response; + } + + /** + * Function to get reminder for activity + * @param integer $activity_id - activity id + * @param string $reminder_time - reminder time + * @param integer $reminder_sent - 0 or 1 + * @param integer $recurid - recuring eventid + * @param string $remindermode - string like 'edit' + */ + function activity_reminder($activity_id,$reminder_time,$reminder_sent=0,$recurid,$remindermode='') + { + global $log; + $log->debug("Entering vtiger_activity_reminder(".$activity_id.",".$reminder_time.",".$reminder_sent.",".$recurid.",".$remindermode.") method ..."); + //Check for vtiger_activityid already present in the reminder_table + $query_exist = "SELECT activity_id FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; + $result_exist = $this->db->query($query_exist); + + if($remindermode == 'edit') + { + if($this->db->num_rows($result_exist) == 1) + { + $query = "UPDATE ".$this->reminder_table." SET"; + $query .=" reminder_sent = ".$reminder_sent.","; + $query .=" reminder_time = ".$reminder_time." WHERE activity_id =".$activity_id; + } + else + { + $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; + } + } + elseif(($remindermode == 'delete') && ($this->db->num_rows($result_exist) == 1)) + { + $query = "DELETE FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; + } + else + { + $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; + } + $this->db->query($query,true,"Error in processing vtiger_table $this->reminder_table"); + $log->debug("Exiting vtiger_activity_reminder method ..."); + } + +//Used for vtigerCRM Outlook Add-In +/** + * Function to get tasks to display in outlookplugin + * @param string $username - User name + * return string $query - sql query + */ +function get_tasksforol($username) +{ + global $log,$adb; + $log->debug("Entering get_tasksforol(".$username.") method ..."); + global $current_user; + require_once("modules/Users/Users.php"); + $seed_user=new Users(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + /*if($adb->query_result($result1,$i,'columnname') == "parentid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + }*/ + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $query = "select vtiger_activity.activityid as taskid, ".implode(',',$column_table_lists)." from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid + where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; + $log->debug("Exiting get_tasksforol method ..."); + return $query; +} + +/** + * Function to get calendar query for outlookplugin + * @param string $username - User name * return string $query - sql query */ +function get_calendarsforol($user_name) +{ + global $log,$adb; + $log->debug("Entering get_calendarsforol(".$user_name.") method ..."); + global $current_user; + require_once("modules/Users/Users.php"); + $seed_user=new Users(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + /*if($adb->query_result($result1,$i,'columnname') == "parentid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + }*/ + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $query = "select vtiger_activity.activityid as clndrid, ".implode(',',$column_table_lists)." from vtiger_activity + inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; + $log->debug("Exiting get_calendarsforol method ..."); + return $query; +} +//End + +} +?> Modified: vtigercrm/branches/5.1_jens/modules/Calendar/ActivityAjax.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/ActivityAjax.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/ActivityAjax.php Tue Nov 14 03:16:10 2006 @@ -19,6 +19,27 @@ $cal_log =& LoggerManager::getLogger('calendar'); $cal_log->debug("In CalendarAjax file"); $mysel = $_REQUEST['view']; +if($_REQUEST['file'] == 'OpenListView') +{ + require_once('Smarty_setup.php'); + $smarty = new vtigerCRM_Smarty; + require_once("modules/Calendar/OpenListView.php"); + $smarty->assign("APP",$app_strings); + $smarty->assign("IMAGE_PATH",$image_path); + if($_REQUEST['mode'] == '0') + { + $activities[0] = getPendingActivities(0); + $smarty->assign("ACTIVITIES",$activities); + $smarty->display("upcomingActivities.tpl"); + } + else if($_REQUEST['mode'] == '1') + { + $activities[1] = getPendingActivities(1); + $smarty->assign("ACTIVITIES",$activities); + $smarty->display("pendingActivities.tpl"); + } + die(); +} $calendar_arr = Array(); $calendar_arr['IMAGE_PATH'] = $image_path; $date_data = array(); Modified: vtigercrm/branches/5.1_jens/modules/Calendar/Appointment.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/Appointment.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/Appointment.php Tue Nov 14 03:16:10 2006 @@ -12,6 +12,7 @@ require_once('include/utils/CommonUtils.php'); require_once('include/utils/UserInfoUtil.php'); require_once('include/database/PearDatabase.php'); +require_once('include/database/Postgres8.php'); require_once('modules/Calendar/Activity.php'); class Appointment { @@ -56,11 +57,11 @@ function readAppointment($userid, &$from_datetime, &$to_datetime, $view) { - global $current_user,$adb; + global $current_user,$adb,$log; require('user_privileges/user_privileges_'.$current_user->id.'.php'); require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); $shared_ids = getSharedCalendarId($current_user->id); - $q= "select vtiger_activity.*, vtiger_crmentity.*, vtiger_activitygrouprelation.groupname FROM vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid left join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype in ('Call','Meeting') AND (vtiger_activity.date_start < '". $to_datetime->get_formatted_date() ."' AND vtiger_activity.date_start >= '". $from_datetime->get_formatted_date()."') "; + $q= "select vtiger_activity.*, vtiger_crmentity.*, vtiger_activitygrouprelation.groupname FROM vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid left join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname WHERE vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype in ('Call','Meeting') AND (vtiger_activity.date_start < '". $to_datetime->get_formatted_date() ."' AND vtiger_activity.date_start >= '". $from_datetime->get_formatted_date()."') "; if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[16] == 3) { $sec_parameter=getListViewSecurityParameter('Calendar'); @@ -68,7 +69,10 @@ } $q .= " AND vtiger_recurringevents.activityid is NULL "; - $q .= " group by vtiger_activity.activityid ORDER by vtiger_activity.date_start,vtiger_activity.time_start"; + $q .= " GROUP BY vtiger_activity.activityid ORDER by vtiger_activity.date_start,vtiger_activity.time_start"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $q = fixPostgresQuery( $q, $log, 0); $r = $adb->query($q); $n = $adb->getRowCount($r); $a = 0; @@ -83,7 +87,7 @@ unset($obj); } //Get Recurring events - $q = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_crmentity.description, vtiger_activity.time_start,vtiger_activity.time_end, vtiger_activity.duration_hours, vtiger_activity.duration_minutes,vtiger_activity.due_date, vtiger_activity.priority, vtiger_activity.location,vtiger_activity.eventstatus, vtiger_crmentity.*, vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start ,vtiger_recurringevents.recurringtype,vtiger_activitygrouprelation.groupname from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid"; + $q = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_crmentity.description, vtiger_activity.time_start,vtiger_activity.time_end, vtiger_activity.duration_hours, vtiger_activity.duration_minutes,vtiger_activity.due_date, vtiger_activity.priority, vtiger_activity.location,vtiger_activity.eventstatus, vtiger_crmentity.*, vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start ,vtiger_recurringevents.recurringtype,vtiger_activitygrouprelation.groupname from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname "; $q.=" where vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype in ('Call','Meeting') AND (recurringdate < '".$to_datetime->get_formatted_date()."' AND recurringdate >= '".$from_datetime->get_formatted_date(). "') "; @@ -93,7 +97,7 @@ $q .= $sec_parameter; } - $q .= " ORDER by recurringid"; + $q .= " ORDER by vtiger_recurringevents.recurringid"; $r = $adb->query($q); $n = $adb->getRowCount($r); $a = 0; Modified: vtigercrm/branches/5.1_jens/modules/Calendar/CalendarCommon.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/CalendarCommon.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/CalendarCommon.php Tue Nov 14 03:16:10 2006 @@ -182,6 +182,7 @@ function getTimeCombo($format,$bimode,$hour='',$min='',$fmt='') { $combo = ''; + $min = $min - ($min%5); if($format == 'am/pm') { $combo .= ' '; $combo .= ' '; $combo .= 'Hr '; $combo .= ' min'; } @@ -298,7 +299,7 @@ for($i = 0; $i < $noofrows; $i++) { $value = $adb->query_result($Res,$i,$fieldname); - $combo .= ''; + $combo .= ''; } $combo .= ''; Modified: vtigercrm/branches/5.1_jens/modules/Calendar/DetailView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/DetailView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/DetailView.php Tue Nov 14 03:16:10 2006 @@ -1,306 +1,306 @@ -'. $mod_strings{"LBL_NOTIFICATION_ERROR"}.'
'; -} -session_unregister('mail_send_error'); -$focus = new Activity(); -$smarty = new vtigerCRM_Smarty(); -$activity_mode = $_REQUEST['activity_mode']; -//If activity_mode == null - -if($activity_mode =='' || strlen($activity_mode) < 1) -{ - $query = "select activitytype from vtiger_activity where activityid=".$_REQUEST['record']; - $result = $adb->query($query); - $actType = $adb->query_result($result,0,'activitytype'); - if( $actType == 'Task') - { - $activity_mode = $actType; - } - elseif($actType == 'Meeting' || $actType == 'Call') - { - $activity_mode = 'Events'; - } -} - - - -if($activity_mode == 'Task') -{ - $tab_type = 'Calendar'; - $smarty->assign("SINGLE_MOD",$mod_strings['LBL_TODO']); -} -elseif($activity_mode == 'Events') -{ - $tab_type = 'Events'; - $smarty->assign("SINGLE_MOD",$mod_strings['LBL_EVENT']); -} -$tab_id=getTabid($tab_type); - - -if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { - $focus->retrieve_entity_info($_REQUEST['record'],$tab_type); - $focus->id = $_REQUEST['record']; - $focus->name=$focus->column_fields['subject']; -} - -if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { - $focus->id = ""; -} - -//needed when creating a new task with default values passed in -if (isset($_REQUEST['contactname']) && is_null($focus->contactname)) { - $focus->contactname = $_REQUEST['contactname']; -} -if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) { - $focus->contact_id = $_REQUEST['contact_id']; -} -if (isset($_REQUEST['opportunity_name']) && is_null($focus->parent_name)) { - $focus->parent_name = $_REQUEST['opportunity_name']; -} -if (isset($_REQUEST['opportunity_id']) && is_null($focus->parent_id)) { - $focus->parent_id = $_REQUEST['opportunity_id']; -} -if (isset($_REQUEST['accountname']) && is_null($focus->parent_name)) { - $focus->parent_name = $_REQUEST['accountname']; -} -if (isset($_REQUEST['accountid']) && is_null($focus->parent_id)) { - $focus->parent_id = $_REQUEST['accountid']; -} - -$act_data = getBlocks($tab_type,"detail_view",'',$focus->column_fields); -foreach($act_data as $block=>$entry) -{ - foreach($entry as $key=>$value) - { - foreach($value as $label=>$field) - { - $fldlabel[$field['fldname']] = $label; - $finaldata[$field['fldname']] = $field['value']; - } - } -} - -//Start -//To set user selected hour format -if($current_user->hour_format == '') - $format = 'am/pm'; -else - $format = $current_user->hour_format; -list($stdate,$sttime) = split(' ',$finaldata['date_start']); -list($enddate,$endtime) = split(' ',$finaldata['due_date']); -$time_arr = getaddEventPopupTime($sttime,$endtime,$format); -$data['starthr'] = $time_arr['starthour']; -$data['startmin'] = $time_arr['startmin']; -$data['startfmt'] = $time_arr['startfmt']; -$data['endhr'] = $time_arr['endhour']; -$data['endmin'] = $time_arr['endmin']; -$data['endfmt'] = $time_arr['endfmt']; -$data['record'] = $focus->id; -if(isset($finaldata['sendnotification']) && $finaldata['sendnotification'] == 'yes') - $data['sendnotification'] = 'Yes'; -else - $data['sendnotification'] = 'No'; -$data['subject'] = $finaldata['subject']; -$data['date_start'] = $stdate; -$data['due_date'] = $enddate; -$data['assigned_user_id'] = $finaldata['assigned_user_id']; -$data['taskpriority'] = $finaldata['taskpriority']; -$data['modifiedtime'] = $finaldata['modifiedtime']; -$data['createdtime'] = $finaldata['createdtime']; -$data['parent_name'] = $finaldata['parent_id']; -$data['description'] = $finaldata['description']; -if($activity_mode == 'Task') -{ - $data['taskstatus'] = $finaldata['taskstatus']; - $data['activitytype'] = $activity_mode; - $data['contact_id'] = $finaldata['contact_id']; -} -elseif($activity_mode == 'Events') -{ - $data['visibility'] = $finaldata['visibility']; - $data['eventstatus'] = $finaldata['eventstatus']; - $data['activitytype'] = $finaldata['activitytype']; - $data['location'] = $finaldata['location']; - //Calculating reminder time - $rem_days = 0; - $rem_hrs = 0; - $rem_min = 0; - if($focus->column_fields['reminder_time'] != null) - { - $data['set_reminder'] = 'Yes'; - $data['reminder_str'] = $finaldata['reminder_time']; - } - else - $data['set_reminder'] = 'No'; - //To set recurring details - $query = 'select vtiger_recurringevents.recurringfreq,vtiger_recurringevents.recurringinfo from vtiger_recurringevents where vtiger_recurringevents.activityid = '.$focus->id; - $res = $adb->query($query); - $rows = $adb->num_rows($res); - if($rows != 0) - { - $data['recurringcheck'] = 'Yes'; - $data['repeat_frequency'] = $adb->query_result($res,0,'recurringfreq'); - $recurringinfo = explode("::",$adb->query_result($res,0,'recurringinfo')); - $data['recurringtype'] = $recurringinfo[0]; - if($recurringinfo[0] == 'Weekly') - { - $weekrpt_str = ''; - if(count($recurringinfo) > 1) - { - $weekrpt_str .= 'on '; - for($i=1;$iassign("INVITEDUSERS",$related_array['Users']['entries']); - $smarty->assign("CONTACTS",$related_array['Contacts']['entries']); - - -} - -global $theme; -$theme_path="themes/".$theme."/"; -$image_path=$theme_path."images/"; -require_once($theme_path.'layout_utils.php'); - -$log->info("Calendar-Activities detail view"); -$category = getParentTab(); -$smarty->assign("CATEGORY",$category); - -$smarty->assign("MOD", $mod_strings); -$smarty->assign("APP", $app_strings); -$smarty->assign("ACTIVITY_MODE", $activity_mode); - -if (isset($focus->name)) -$smarty->assign("NAME", $focus->name); -else -$smarty->assign("NAME", ""); -$smarty->assign("UPDATEINFO",updateInfo($focus->id)); -if (isset($_REQUEST['return_module'])) -$smarty->assign("RETURN_MODULE", $_REQUEST['return_module']); -if (isset($_REQUEST['return_action'])) -$smarty->assign("RETURN_ACTION", $_REQUEST['return_action']); -if (isset($_REQUEST['return_id'])) -$smarty->assign("RETURN_ID", $_REQUEST['return_id']); -$smarty->assign("THEME", $theme); -$smarty->assign("IMAGE_PATH", $image_path); -$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string'].'&activity_mode='.$activity_mode); -$smarty->assign("ID", $focus->id); -$smarty->assign("NAME", $focus->name); -$smarty->assign("BLOCKS", $act_data); -$smarty->assign("LABEL", $fldlabel); -$smarty->assign("VIEWTYPE", $_REQUEST['viewtype']); -$smarty->assign("CUSTOMFIELD", $cust_fld); -$smarty->assign("ACTIVITYDATA", $data); -$smarty->assign("ID", $_REQUEST['record']); - -//get Description Information -if(isPermitted("Calendar","EditView",$_REQUEST['record']) == 'yes') - $smarty->assign("EDIT_DUPLICATE","permitted"); - -if(isPermitted("Calendar","Delete",$_REQUEST['record']) == 'yes') - $smarty->assign("DELETE","permitted"); - -$check_button = Button_Check($module); -$smarty->assign("CHECK", $check_button); - - $tabid = getTabid($tab_type); - $validationData = getDBValidationData($focus->tab_name,$tabid); - $data2 = split_validationdataArray($validationData); - - $smarty->assign("VALIDATION_DATA_FIELDNAME",$data2['fieldname']); - $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data2['datatype']); - $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data2['fieldlabel']); - -$smarty->assign("MODULE",$currentModule); -$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); -$smarty->display("ActivityDetailView.tpl"); - -?> +'. $mod_strings{"LBL_NOTIFICATION_ERROR"}.'
'; +} +session_unregister('mail_send_error'); +$focus = new Activity(); +$smarty = new vtigerCRM_Smarty(); +$activity_mode = $_REQUEST['activity_mode']; +//If activity_mode == null + +if($activity_mode =='' || strlen($activity_mode) < 1) +{ + $query = "select activitytype from vtiger_activity where activityid=".$_REQUEST['record']; + $result = $adb->query($query); + $actType = $adb->query_result($result,0,'activitytype'); + if( $actType == 'Task') + { + $activity_mode = $actType; + } + elseif($actType == 'Meeting' || $actType == 'Call') + { + $activity_mode = 'Events'; + } +} + + + +if($activity_mode == 'Task') +{ + $tab_type = 'Calendar'; + $smarty->assign("SINGLE_MOD",$mod_strings['LBL_TODO']); +} +elseif($activity_mode == 'Events') +{ + $tab_type = 'Events'; + $smarty->assign("SINGLE_MOD",$mod_strings['LBL_EVENT']); +} +$tab_id=getTabid($tab_type); + + +if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { + $focus->retrieve_entity_info($_REQUEST['record'],$tab_type); + $focus->id = $_REQUEST['record']; + $focus->name=$focus->column_fields['subject']; +} + +if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { + $focus->id = ""; +} + +//needed when creating a new task with default values passed in +if (isset($_REQUEST['contactname']) && is_null($focus->contactname)) { + $focus->contactname = $_REQUEST['contactname']; +} +if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) { + $focus->contact_id = $_REQUEST['contact_id']; +} +if (isset($_REQUEST['opportunity_name']) && is_null($focus->parent_name)) { + $focus->parent_name = $_REQUEST['opportunity_name']; +} +if (isset($_REQUEST['opportunity_id']) && is_null($focus->parent_id)) { + $focus->parent_id = $_REQUEST['opportunity_id']; +} +if (isset($_REQUEST['accountname']) && is_null($focus->parent_name)) { + $focus->parent_name = $_REQUEST['accountname']; +} +if (isset($_REQUEST['accountid']) && is_null($focus->parent_id)) { + $focus->parent_id = $_REQUEST['accountid']; +} + +$act_data = getBlocks($tab_type,"detail_view",'',$focus->column_fields); +foreach($act_data as $block=>$entry) +{ + foreach($entry as $key=>$value) + { + foreach($value as $label=>$field) + { + $fldlabel[$field['fldname']] = $label; + $finaldata[$field['fldname']] = $field['value']; + } + } +} + +//Start +//To set user selected hour format +if($current_user->hour_format == '') + $format = 'am/pm'; +else + $format = $current_user->hour_format; +list($stdate,$sttime) = split(' ',$finaldata['date_start']); +list($enddate,$endtime) = split(' ',$finaldata['due_date']); +$time_arr = getaddEventPopupTime($sttime,$endtime,$format); +$data['starthr'] = $time_arr['starthour']; +$data['startmin'] = $time_arr['startmin']; +$data['startfmt'] = $time_arr['startfmt']; +$data['endhr'] = $time_arr['endhour']; +$data['endmin'] = $time_arr['endmin']; +$data['endfmt'] = $time_arr['endfmt']; +$data['record'] = $focus->id; +if(isset($finaldata['sendnotification']) && $finaldata['sendnotification'] == 'yes') + $data['sendnotification'] = 'Yes'; +else + $data['sendnotification'] = 'No'; +$data['subject'] = $finaldata['subject']; +$data['date_start'] = $stdate; +$data['due_date'] = $enddate; +$data['assigned_user_id'] = $finaldata['assigned_user_id']; +$data['taskpriority'] = $mod_strings[$finaldata['taskpriority']]; +$data['modifiedtime'] = $finaldata['modifiedtime']; +$data['createdtime'] = $finaldata['createdtime']; +$data['parent_name'] = $finaldata['parent_id']; +$data['description'] = $finaldata['description']; +if($activity_mode == 'Task') +{ + $data['taskstatus'] = $mod_strings[$finaldata['taskstatus']]; + $data['activitytype'] = $activity_mode; + $data['contact_id'] = $finaldata['contact_id']; +} +elseif($activity_mode == 'Events') +{ + $data['visibility'] = $finaldata['visibility']; + $data['eventstatus'] = $mod_strings[$finaldata['eventstatus']]; + $data['activitytype'] = $finaldata['activitytype']; + $data['location'] = $finaldata['location']; + //Calculating reminder time + $rem_days = 0; + $rem_hrs = 0; + $rem_min = 0; + if($focus->column_fields['reminder_time'] != null) + { + $data['set_reminder'] = 'Yes'; + $data['reminder_str'] = $finaldata['reminder_time']; + } + else + $data['set_reminder'] = 'No'; + //To set recurring details + $query = 'select vtiger_recurringevents.recurringfreq,vtiger_recurringevents.recurringinfo from vtiger_recurringevents where vtiger_recurringevents.activityid = '.$focus->id; + $res = $adb->query($query); + $rows = $adb->num_rows($res); + if($rows != 0) + { + $data['recurringcheck'] = 'Yes'; + $data['repeat_frequency'] = $adb->query_result($res,0,'recurringfreq'); + $recurringinfo = explode("::",$adb->query_result($res,0,'recurringinfo')); + $data['recurringtype'] = $recurringinfo[0]; + if($recurringinfo[0] == 'Weekly') + { + $weekrpt_str = ''; + if(count($recurringinfo) > 1) + { + $weekrpt_str .= 'on '; + for($i=1;$iassign("INVITEDUSERS",$related_array['Users']['entries']); + $smarty->assign("CONTACTS",$related_array['Contacts']['entries']); + + +} + +global $theme; +$theme_path="themes/".$theme."/"; +$image_path=$theme_path."images/"; +require_once($theme_path.'layout_utils.php'); + +$log->info("Calendar-Activities detail view"); +$category = getParentTab(); +$smarty->assign("CATEGORY",$category); + +$smarty->assign("MOD", $mod_strings); +$smarty->assign("APP", $app_strings); +$smarty->assign("ACTIVITY_MODE", $activity_mode); + +if (isset($focus->name)) +$smarty->assign("NAME", $focus->name); +else +$smarty->assign("NAME", ""); +$smarty->assign("UPDATEINFO",updateInfo($focus->id)); +if (isset($_REQUEST['return_module'])) +$smarty->assign("RETURN_MODULE", $_REQUEST['return_module']); +if (isset($_REQUEST['return_action'])) +$smarty->assign("RETURN_ACTION", $_REQUEST['return_action']); +if (isset($_REQUEST['return_id'])) +$smarty->assign("RETURN_ID", $_REQUEST['return_id']); +$smarty->assign("THEME", $theme); +$smarty->assign("IMAGE_PATH", $image_path); +$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string'].'&activity_mode='.$activity_mode); +$smarty->assign("ID", $focus->id); +$smarty->assign("NAME", $focus->name); +$smarty->assign("BLOCKS", $act_data); +$smarty->assign("LABEL", $fldlabel); +$smarty->assign("VIEWTYPE", $_REQUEST['viewtype']); +$smarty->assign("CUSTOMFIELD", $cust_fld); +$smarty->assign("ACTIVITYDATA", $data); +$smarty->assign("ID", $_REQUEST['record']); + +//get Description Information +if(isPermitted("Calendar","EditView",$_REQUEST['record']) == 'yes') + $smarty->assign("EDIT_DUPLICATE","permitted"); + +if(isPermitted("Calendar","Delete",$_REQUEST['record']) == 'yes') + $smarty->assign("DELETE","permitted"); + +$check_button = Button_Check($module); +$smarty->assign("CHECK", $check_button); + + $tabid = getTabid($tab_type); + $validationData = getDBValidationData($focus->tab_name,$tabid); + $data2 = split_validationdataArray($validationData); + + $smarty->assign("VALIDATION_DATA_FIELDNAME",$data2['fieldname']); + $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data2['datatype']); + $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data2['fieldlabel']); + +$smarty->assign("MODULE",$currentModule); +$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->display("ActivityDetailView.tpl"); + +?> Modified: vtigercrm/branches/5.1_jens/modules/Calendar/ListView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/ListView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/ListView.php Tue Nov 14 03:16:10 2006 @@ -76,6 +76,7 @@ $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid); //<<<<>>>> $smarty->assign("CHANGE_OWNER",getUserslist()); +$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist()); $where = ""; $url_string = ''; // assigning http url string Modified: vtigercrm/branches/5.1_jens/modules/Calendar/OpenListView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/OpenListView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/OpenListView.php Tue Nov 14 03:16:10 2006 @@ -49,82 +49,67 @@ //code added to customize upcomming and pending activities if($_REQUEST['activity_view']=='') { - $query = "select activity_view from vtiger_users where id ='$current_user->id'"; - $result=$adb->query($query); - $activity_view=$adb->query_result($result,0,'activity_view'); + $activity_view='today'; } else $activity_view=$_REQUEST['activity_view']; $today = date("Y-m-d", time()); - if($activity_view == 'Today') - { - $later = date("Y-m-d",strtotime("$today +1 day")); - } - else if($activity_view == 'This Week') - { - $later = date("Y-m-d", strtotime("$today +7 days")); - } - else if($activity_view == 'This Month') - { - $later = date("Y-m-d", strtotime("$today +1 month")); - } - else if($activity_view == 'This Year') - { - $later = date("Y-m-d", strtotime("$today +1 year")); - } - else if($activity_view == 'OverDue') - { - $later = date("Y-m-d", strtotime("$today +1 day")); - } - $last_tendays = date("Y-m-d",strtotime("$today -10 days")); + if($activity_view == 'today') + { + $upcoming_condition = " AND (date_start = '$today' OR vtiger_recurringevents.recurringdate = '$today')"; + $pending_condition = " AND (due_date = '$today' OR vtiger_recurringevents.recurringdate = '$today')"; + } + else if($activity_view == 'all') + { + $upcoming_condition = " AND (date_start >= '$today' OR vtiger_recurringevents.recurringdate >= '$today')"; + $pending_condition = " AND (due_date <= '$today' OR vtiger_recurringevents.recurringdate <= '$today')"; + } if($mode != 1) { //for upcoming avtivities - $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) AND ((date_start > '$today' AND date_start < '$later') OR (vtiger_recurringevents.recurringdate between '$today' and '$later') ) AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$upcoming_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; } else { - //for pending activities for the last 10 days - $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) AND ((due_date > '$last_tendays' AND due_date <= '$today') OR (vtiger_recurringevents.recurringdate > '$last_tendays' AND vtiger_recurringevents.recurringdate <= '$today')) AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; - } + //for pending activities + $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$pending_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + } + $res = $adb->query($list_query); $noofrecords = $adb->num_rows($res); - $list_result = $adb->limitQuery($list_query,0,5); $open_activity_list = array(); - $noofrows = $adb->num_rows($list_result); - if (count($list_result)>0) + $noofrows = $adb->num_rows($res); + if (count($res)>0) for($i=0;$i<$noofrows;$i++) { - $parent_name=getRelatedTo("Calendar",$list_result,$i); - $open_activity_list[] = Array('name' => $adb->query_result($list_result,$i,'subject'), - 'id' => $adb->query_result($list_result,$i,'activityid'), - 'type' => $adb->query_result($list_result,$i,'activitytype'), - 'module' => $adb->query_result($list_result,$i,'setype'), - 'status' => $adb->query_result($list_result,$i,'status'), - 'firstname' => $adb->query_result($list_result,$i,'firstname'), - 'lastname' => $adb->query_result($list_result,$i,'lastname'), - 'accountname' => $adb->query_result($list_result,$i,'accountname'), - 'accountid' => $adb->query_result($list_result, $i, 'accountid'), - 'contactid' => $adb->query_result($list_result,$i,'contactid'), - 'date_start' => getDisplayDate($adb->query_result($list_result,$i,'date_start')), - 'due_date' => getDisplayDate($adb->query_result($list_result,$i,'due_date')), - 'recurringtype' => getDisplayDate($adb->query_result($list_result,$i,'recurringtype')), - 'recurringdate' => getDisplayDate($adb->query_result($list_result,$i,'recurringdate')), + $parent_name=getRelatedTo("Calendar",$res,$i); + $open_activity_list[] = Array('name' => $adb->query_result($res,$i,'subject'), + 'id' => $adb->query_result($res,$i,'activityid'), + 'type' => $adb->query_result($res,$i,'activitytype'), + 'module' => $adb->query_result($res,$i,'setype'), + 'status' => $adb->query_result($res,$i,'status'), + 'firstname' => $adb->query_result($res,$i,'firstname'), + 'lastname' => $adb->query_result($res,$i,'lastname'), + 'accountname' => $adb->query_result($res,$i,'accountname'), + 'accountid' => $adb->query_result($res, $i, 'accountid'), + 'contactid' => $adb->query_result($res,$i,'contactid'), + 'date_start' => getDisplayDate($adb->query_result($res,$i,'date_start')), + 'due_date' => getDisplayDate($adb->query_result($res,$i,'due_date')), + 'recurringtype' => getDisplayDate($adb->query_result($res,$i,'recurringtype')), + 'recurringdate' => getDisplayDate($adb->query_result($res,$i,'recurringdate')), 'parent'=> $parent_name, // Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2 - 'priority' => $adb->query_result($list_result,$i,'priority'), // Armando L?scher 04.07.2005 -> ?priority -> Desc: Get vtiger_priority from db + 'priority' => $adb->query_result($res,$i,'priority'), // Armando L?scher 04.07.2005 -> ?priority -> Desc: Get vtiger_priority from db ); } - $later_day = getDisplayDate(date("Y-m-d", strtotime("$later -1 day "))); $title=array(); $title[]=$activity_view; $title[]='myUpcoPendAct.gif'; - //.'('.$current_module_strings["LBL_TODAY"].' '.$later_day.')'; $title[]='home_myact'; - $title[]=getActivityView($activity_view); + //$title[]=getActivityView($activity_view); $title[]='showActivityView'; $title[]='MyUpcumingFrm'; $title[]='activity_view'; @@ -229,7 +214,6 @@ } } // Code by Jaguar Ends - $entries['noofactivities'] = $noofrecords; $entries[$event['id']] = array( '0' => ''.$event["name"].'', 'IMAGE' => '', @@ -241,7 +225,7 @@ 'RECURRINGTYPE' => ereg_replace('--','',$event['recurringtype']), ); } - $values=Array('Title'=>$title,'Header'=>$header,'Entries'=>$entries); + $values=Array('noofactivities'=>$noofrecords,'Title'=>$title,'Header'=>$header,'Entries'=>$entries); $log->debug("Exiting getPendingActivities method ..."); return $values; } Modified: vtigercrm/branches/5.1_jens/modules/Calendar/RenderRelatedListUI.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/RenderRelatedListUI.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/RenderRelatedListUI.php Tue Nov 14 03:16:10 2006 @@ -10,8 +10,8 @@ ********************************************************************************/ require_once('include/RelatedListView.php'); -require_once('modules/Contacts/Contact.php'); -require_once('modules/Products/Product.php'); +require_once('modules/Contacts/Contacts.php'); +require_once('modules/Products/Products.php'); require_once('include/utils/UserInfoUtil.php'); // functions added for group calendar -Jaguar Modified: vtigercrm/branches/5.1_jens/modules/Calendar/addEventUI.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/addEventUI.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/addEventUI.php Tue Nov 14 03:16:10 2006 @@ -177,9 +177,9 @@ - + -
"; Modified: vtigercrm/branches/5.1_jens/install/0welcome.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/0welcome.php (original) +++ vtigercrm/branches/5.1_jens/install/0welcome.php Tue Nov 14 03:16:10 2006 @@ -1,164 +1,164 @@ -]*)\">/", $val, $sub_key); - preg_match_all("/]*> - ]*>(.*)<\/td> - ]*>(.*)<\/td>/Ux", $val, $sub); - preg_match_all("/]*> - ]*>(.*)<\/td> - ]*>(.*)<\/td> - ]*>(.*)<\/td>/Ux", $val, $sub_ext); - foreach($sub[0] as $key => $val) { - if (preg_match("/Configuration File \(php.ini\) Path /", $val)) { - $val = preg_replace("/Configuration File \(php.ini\) Path /", '', $val); - $phpini = strip_tags($val); - } - } - -} -?> - - - - - vtiger CRM 5 - Configuration Wizard - Welcome - - - - - -


- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- - - - - - - - - - - - - - - - - - - - - -
Welcome to Configuration Wizard
-
-

       This Configuration Wizard will create vtiger CRM 5.0.0 databases and tables and configuration files you need to start. The entire process should take about four minutes. Click the Start button when you are ready. -

-

- vtiger CRM 5.0.0 is tested on mySQL 4.1.X, mySQL 5.0.19, PHP 5.0.19 and Apache 2.0.40.

-

vtiger CRM 5.0.0 will not work on mysql 4.0.x versions

vtiger crm can run on a system which has xampp/lampp/wampp already installed in it provided it meets the above mentioned requirements
-

The installation wizard will guide you with the installation regardless of the setup you may have. - -

Please take a moment to register your copy of vtiger CRM. Though this is optional, we encourage you to register. Only your name and email address are required for registration. We do not sell, rent, share or otherwise, distribute your information to third parties.
- -
- -
- Please read the license agreement and click the "Start" button to continue. -
-
- - -

-
-
- -
-
- - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - +]*)\">/", $val, $sub_key); + preg_match_all("/]*> + ]*>(.*)<\/td> + ]*>(.*)<\/td>/Ux", $val, $sub); + preg_match_all("/]*> + ]*>(.*)<\/td> + ]*>(.*)<\/td> + ]*>(.*)<\/td>/Ux", $val, $sub_ext); + foreach($sub[0] as $key => $val) { + if (preg_match("/Configuration File \(php.ini\) Path /", $val)) { + $val = preg_replace("/Configuration File \(php.ini\) Path /", '', $val); + $phpini = strip_tags($val); + } + } + +} +?> + + + + + vtiger CRM 5 - Configuration Wizard - Welcome + + + + + +


+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Welcome to Configuration Wizard
+
+

       This Configuration Wizard will create vtiger CRM 5.0.2 databases and tables and configuration files you need to start. The entire process should take about four minutes. Click the Start button when you are ready. +

+

- vtiger CRM 5.0.2 is tested on mySQL 4.1.X, mySQL 5.0.19, PHP 5.0.19 and Apache 2.0.40.

+

vtiger CRM 5.0.2 will not work on mysql 4.0.x versions

vtiger crm can run on a system which has xampp/lampp/wampp already installed in it provided it meets the above mentioned requirements
+

The installation wizard will guide you with the installation regardless of the setup you may have. + +

Please take a moment to register your copy of vtiger CRM. Though this is optional, we encourage you to register. Only your name and email address are required for registration. We do not sell, rent, share or otherwise, distribute your information to third parties.
+ +
+ +
+ Please read the license agreement and click the "Start" button to continue. +
+
+ + +

+
+
+ +
+
+ + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + Modified: vtigercrm/branches/5.1_jens/install/1checkSystem.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/1checkSystem.php (original) +++ vtigercrm/branches/5.1_jens/install/1checkSystem.php Tue Nov 14 03:16:10 2006 @@ -1,374 +1,374 @@ - - -]*)\">/", $val, $sub_key); - preg_match_all("/]*> - ]*>(.*)<\/td> - ]*>(.*)<\/td>/Ux", $val, $sub); - preg_match_all("/]*> - ]*>(.*)<\/td> - ]*>(.*)<\/td> - ]*>(.*)<\/td>/Ux", $val, $sub_ext); - foreach($sub[0] as $key => $val) { - if (preg_match("/Configuration File \(php.ini\) Path /", $val)) { - $val = preg_replace("/Configuration File \(php.ini\) Path /", '', $val); - $phpini = strip_tags($val); - } - } - -} - -$gd_info_alternate = 'function gd_info() { -$array = Array( - "GD Version" => "", - "FreeType Support" => 0, - "FreeType Support" => 0, - "FreeType Linkage" => "", - "T1Lib Support" => 0, - "GIF Read Support" => 0, - "GIF Create Support" => 0, - "JPG Support" => 0, - "PNG Support" => 0, - "WBMP Support" => 0, - "XBM Support" => 0 - ); - $gif_support = 0; - - ob_start(); - eval("phpinfo();"); - $info = ob_get_contents(); - ob_end_clean(); - - foreach(explode("\n", $info) as $line) { - if(strpos($line, "GD Version")!==false) - $array["GD Version"] = trim(str_replace("GD Version", "", strip_tags($line))); - if(strpos($line, "FreeType Support")!==false) - $array["FreeType Support"] = trim(str_replace("FreeType Support", "", strip_tags($line))); - if(strpos($line, "FreeType Linkage")!==false) - $array["FreeType Linkage"] = trim(str_replace("FreeType Linkage", "", strip_tags($line))); - if(strpos($line, "T1Lib Support")!==false) - $array["T1Lib Support"] = trim(str_replace("T1Lib Support", "", strip_tags($line))); - if(strpos($line, "GIF Read Support")!==false) - $array["GIF Read Support"] = trim(str_replace("GIF Read Support", "", strip_tags($line))); - if(strpos($line, "GIF Create Support")!==false) - $array["GIF Create Support"] = trim(str_replace("GIF Create Support", "", strip_tags($line))); - if(strpos($line, "GIF Support")!==false) - $gif_support = trim(str_replace("GIF Support", "", strip_tags($line))); - if(strpos($line, "JPG Support")!==false) - $array["JPG Support"] = trim(str_replace("JPG Support", "", strip_tags($line))); - if(strpos($line, "PNG Support")!==false) - $array["PNG Support"] = trim(str_replace("PNG Support", "", strip_tags($line))); - if(strpos($line, "WBMP Support")!==false) - $array["WBMP Support"] = trim(str_replace("WBMP Support", "", strip_tags($line))); - if(strpos($line, "XBM Support")!==false) - $array["XBM Support"] = trim(str_replace("XBM Support", "", strip_tags($line))); - } - - if($gif_support==="enabled") { - $array["GIF Read Support"] = 1; - $array["GIF Create Support"] = 1; - } - - if($array["FreeType Support"]==="enabled"){ - $array["FreeType Support"] = 1; } - - if($array["T1Lib Support"]==="enabled") - $array["T1Lib Support"] = 1; - - if($array["GIF Read Support"]==="enabled"){ - $array["GIF Read Support"] = 1; } - - if($array["GIF Create Support"]==="enabled") - $array["GIF Create Support"] = 1; - - if($array["JPG Support"]==="enabled") - $array["JPG Support"] = 1; - - if($array["PNG Support"]==="enabled") - $array["PNG Support"] = 1; - - if($array["WBMP Support"]==="enabled") - $array["WBMP Support"] = 1; - - if($array["XBM Support"]==="enabled") - $array["XBM Support"] = 1; - - return $array; - -}'; - -?> - - - - - - vtiger CRM 5 - Configuration Wizard - Installation Check - - - - - -


- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- - - - - - - - - -
Pre Installation Check
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Core Components
PHP version 5.0.x
Failed.
Invalid version ($php_version) Installed
" : "Passed
Version $php_version Installed
"; ?>
IMAP Support AvailabilityPassed
IMAP library available
":"Failed
Not Available
";?>
GD graphics library
version 2.0 or later
GD Graphics Library not configured. .
Check out our online documentation for tips on enabling this library. You can ignore this error and continue your vtiger CRM installation, however the chart images simply won't work.
"; - } - else { - if (!function_exists('gd_info')) - { - eval($gd_info_alternate); - } - $gd_info = gd_info(); - - if (isset($gd_info['GD Version'])) { - $gd_version = $gd_info['GD Version']; - $gd_version=preg_replace('%[^0-9.]%', '', $gd_version); - - if ($gd_version > "2.0") { - echo "Passed
Version $gd_version Installed
"; - } - else { - echo "Passed
Version $gd_version Installed.
"; - } - } - else { - echo "GD Library available, but not properly configured in your PHP installation.
You can ignore this error and continue your vtiger CRM installation, however the chart images simply won't work.
"; - } - } - ?> -
Read/Write Access
PHP Configuration
(config.inc.php)
Writeable":"Failed
Not Writeable
"; ?>
Cache Directory
(cache/)
Writeable":"Not Writeable"; ?>
Uploads Directory
(storage/)
Writeable":"Not Writeable
You might experience problems with the file vtiger_attachments feature. Refer File vtiger_attachments issue for more details
"; ?>
Install Directory
(install/)
Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?>
Installation file
(install.php)
Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?>
Tabdata File Permission
(tabdata.php)
Writeable":"Not Writeable
You will not be able to work with the product
";?>
ParentTabdata File Permission
(parent_tabdata.php)
Writeable":"Not Writeable
You will not be able to work with the product
";?>
User Privileges
(user_privileges/)
Writeable":"Not Writeable
You will not be able to login
"; ?>
Smarty Cache Directory
(Smarty/cache)
Writeable":"Not Writeable";?>
Smarty Compile Directory
(Smarty/templates_c)
Writeable":"Not Writeable
You will not be able to login
";?>
Email Templates Directory
(modules/Emails/templates/)
Writeable":"Not Writeable
You might experience problems with the email templates feature. Refer Email templates issue for more details
"; ?>
Mail Merge Template Directory
(test/wordtemplatedownload/)
Writeable":"Not Writeable
You might experience issues with the word template feature. Visit forums for more details
"; ?>
Product Image Directory
(test/product/)
Writeable":"Not Writeable
You might experience problems while attaching image for Products.Refer File vtiger_attachments issue for more details
"; ?>
User Image Directory
(test/user/)
Writeable":"Not Writeable
You might experience problems while attaching image for Users. Refer File vtiger_attachments issue for more details
"; ?>
Contact Image Directory
(test/contact/)
Writeable":"Not Writeable
You might experience problems while attaching image for Contacts. Refer File vtiger_attachments issue for more details
"; ?>
Logo Directory
(test/logo/)
Writeable":"Not Writeable
You might experience problems with the company logo in the pdf generation. Refer File vtiger_attachments issue for more details
"; ?>
-

- - - - - - - - - - - - - - - -
Recommended Settings: We strongly suggest that you check for the following values in your php.ini file
Safe Mode Off
Display Errors On
File Uploads On
Register Globals Off
Max Execution Time 600
output_buffering= On
Change the memory limit = 32M
error_reporting = E_WARNING & ~E_NOTICE
allow_call_time_reference = On
log_errors = Off
short_open_tag= On
Linux installation pre-requisites
-
-
- - -

-
-
- -
-
- - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - + + +]*)\">/", $val, $sub_key); + preg_match_all("/]*> + ]*>(.*)<\/td> + ]*>(.*)<\/td>/Ux", $val, $sub); + preg_match_all("/]*> + ]*>(.*)<\/td> + ]*>(.*)<\/td> + ]*>(.*)<\/td>/Ux", $val, $sub_ext); + foreach($sub[0] as $key => $val) { + if (preg_match("/Configuration File \(php.ini\) Path /", $val)) { + $val = preg_replace("/Configuration File \(php.ini\) Path /", '', $val); + $phpini = strip_tags($val); + } + } + +} + +$gd_info_alternate = 'function gd_info() { +$array = Array( + "GD Version" => "", + "FreeType Support" => 0, + "FreeType Support" => 0, + "FreeType Linkage" => "", + "T1Lib Support" => 0, + "GIF Read Support" => 0, + "GIF Create Support" => 0, + "JPG Support" => 0, + "PNG Support" => 0, + "WBMP Support" => 0, + "XBM Support" => 0 + ); + $gif_support = 0; + + ob_start(); + eval("phpinfo();"); + $info = ob_get_contents(); + ob_end_clean(); + + foreach(explode("\n", $info) as $line) { + if(strpos($line, "GD Version")!==false) + $array["GD Version"] = trim(str_replace("GD Version", "", strip_tags($line))); + if(strpos($line, "FreeType Support")!==false) + $array["FreeType Support"] = trim(str_replace("FreeType Support", "", strip_tags($line))); + if(strpos($line, "FreeType Linkage")!==false) + $array["FreeType Linkage"] = trim(str_replace("FreeType Linkage", "", strip_tags($line))); + if(strpos($line, "T1Lib Support")!==false) + $array["T1Lib Support"] = trim(str_replace("T1Lib Support", "", strip_tags($line))); + if(strpos($line, "GIF Read Support")!==false) + $array["GIF Read Support"] = trim(str_replace("GIF Read Support", "", strip_tags($line))); + if(strpos($line, "GIF Create Support")!==false) + $array["GIF Create Support"] = trim(str_replace("GIF Create Support", "", strip_tags($line))); + if(strpos($line, "GIF Support")!==false) + $gif_support = trim(str_replace("GIF Support", "", strip_tags($line))); + if(strpos($line, "JPG Support")!==false) + $array["JPG Support"] = trim(str_replace("JPG Support", "", strip_tags($line))); + if(strpos($line, "PNG Support")!==false) + $array["PNG Support"] = trim(str_replace("PNG Support", "", strip_tags($line))); + if(strpos($line, "WBMP Support")!==false) + $array["WBMP Support"] = trim(str_replace("WBMP Support", "", strip_tags($line))); + if(strpos($line, "XBM Support")!==false) + $array["XBM Support"] = trim(str_replace("XBM Support", "", strip_tags($line))); + } + + if($gif_support==="enabled") { + $array["GIF Read Support"] = 1; + $array["GIF Create Support"] = 1; + } + + if($array["FreeType Support"]==="enabled"){ + $array["FreeType Support"] = 1; } + + if($array["T1Lib Support"]==="enabled") + $array["T1Lib Support"] = 1; + + if($array["GIF Read Support"]==="enabled"){ + $array["GIF Read Support"] = 1; } + + if($array["GIF Create Support"]==="enabled") + $array["GIF Create Support"] = 1; + + if($array["JPG Support"]==="enabled") + $array["JPG Support"] = 1; + + if($array["PNG Support"]==="enabled") + $array["PNG Support"] = 1; + + if($array["WBMP Support"]==="enabled") + $array["WBMP Support"] = 1; + + if($array["XBM Support"]==="enabled") + $array["XBM Support"] = 1; + + return $array; + +}'; + +?> + + + + + + vtiger CRM 5 - Configuration Wizard - Installation Check + + + + + +


+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ + + + + + + + + +
Pre Installation Check
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Core Components
PHP version
Failed.
Invalid version ($php_version) Installed
" : "Passed
Version $php_version Installed
"; ?>
IMAP Support AvailabilityPassed
IMAP library available
":"Failed
Not Available
";?>
GD graphics library
version 2.0 or later
GD Graphics Library not configured. .
Check out our online documentation for tips on enabling this library. You can ignore this error and continue your vtiger CRM installation, however the chart images simply won't work.
"; + } + else { + if (!function_exists('gd_info')) + { + eval($gd_info_alternate); + } + $gd_info = gd_info(); + + if (isset($gd_info['GD Version'])) { + $gd_version = $gd_info['GD Version']; + $gd_version=preg_replace('%[^0-9.]%', '', $gd_version); + + if ($gd_version > "2.0") { + echo "Passed
Version $gd_version Installed
"; + } + else { + echo "Passed
Version $gd_version Installed.
"; + } + } + else { + echo "GD Library available, but not properly configured in your PHP installation.
You can ignore this error and continue your vtiger CRM installation, however the chart images simply won't work.
"; + } + } + ?> +
Read/Write Access
PHP Configuration
(config.inc.php)
Writeable":"Failed
Not Writeable
"; ?>
Cache Directory
(cache/)
Writeable":"Not Writeable"; ?>
Uploads Directory
(storage/)
Writeable":"Not Writeable
You might experience problems with the file vtiger_attachments feature. Refer File vtiger_attachments issue for more details
"; ?>
Install Directory
(install/)
Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?>
Installation file
(install.php)
Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?>
Tabdata File Permission
(tabdata.php)
Writeable":"Not Writeable
You will not be able to work with the product
";?>
ParentTabdata File Permission
(parent_tabdata.php)
Writeable":"Not Writeable
You will not be able to work with the product
";?>
User Privileges
(user_privileges/)
Writeable":"Not Writeable
You will not be able to login
"; ?>
Smarty Cache Directory
(Smarty/cache)
Writeable":"Not Writeable";?>
Smarty Compile Directory
(Smarty/templates_c)
Writeable":"Not Writeable
You will not be able to login
";?>
Email Templates Directory
(modules/Emails/templates/)
Writeable":"Not Writeable
You might experience problems with the email templates feature. Refer Email templates issue for more details
"; ?>
Mail Merge Template Directory
(test/wordtemplatedownload/)
Writeable":"Not Writeable
You might experience issues with the word template feature. Visit forums for more details
"; ?>
Product Image Directory
(test/product/)
Writeable":"Not Writeable
You might experience problems while attaching image for Products.Refer File vtiger_attachments issue for more details
"; ?>
User Image Directory
(test/user/)
Writeable":"Not Writeable
You might experience problems while attaching image for Users. Refer File vtiger_attachments issue for more details
"; ?>
Contact Image Directory
(test/contact/)
Writeable":"Not Writeable
You might experience problems while attaching image for Contacts. Refer File vtiger_attachments issue for more details
"; ?>
Logo Directory
(test/logo/)
Writeable":"Not Writeable
You might experience problems with the company logo in the pdf generation. Refer File vtiger_attachments issue for more details
"; ?>
+

+ + + + + + + + + + + + + + + +
Recommended Settings: We strongly suggest that you check for the following values in your php.ini file
Safe Mode Off
Display Errors On
File Uploads On
Register Globals Off
Max Execution Time 600
output_buffering= On
Change the memory limit = 32M
error_reporting = E_WARNING & ~E_NOTICE
allow_call_time_reference = On
log_errors = Off
short_open_tag= On
Linux installation pre-requisites
+
+
+ + +

+
+
+ +
+
+ + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + Modified: vtigercrm/branches/5.1_jens/install/2setConfig.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/2setConfig.php (original) +++ vtigercrm/branches/5.1_jens/install/2setConfig.php Tue Nov 14 03:16:10 2006 @@ -1,523 +1,523 @@ -$value) { - $language_keys[] = $key; - $language_values[] = $value; - } - $_SESSION['language_keys'] = urlencode(implode(",",$language_keys)); - $_SESSION['language_values'] = urlencode(implode(",",$language_values)); - } - - global $dbconfig; - - if (isset($_REQUEST['db_hostname'])) - $db_hostname = $_REQUEST['db_hostname']; - elseif (isset($dbconfig['db_hostname'])) - $db_hostname = $dbconfig['db_hostname']; - else - $db_hostname = $hostname; - - if (isset($_REQUEST['db_username'])) - $db_username = $_REQUEST['db_username']; - elseif (isset($dbconfig['db_username'])) - $db_username = $dbconfig['db_username']; - - if (isset($_REQUEST['db_password'])) - $db_password = $_REQUEST['db_password']; - elseif (isset($dbconfig['db_password'])) - $db_password = $dbconfig['db_password']; - - if (isset($_REQUEST['db_type'])) - $db_type = $_REQUEST['db_type']; - elseif (isset($dbconfig['db_type'])) - $db_type = $dbconfig['db_type']; - - if (isset($_REQUEST['db_name'])) - $db_name = $_REQUEST['db_name']; - elseif (isset($dbconfig['db_name']) && $dbconfig['db_name']!='_DBC_NAME_') - $db_name = $dbconfig['db_name']; - else - $db_name = 'vtigercrm5'; - - !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; - if (isset($_REQUEST['host_name'])) $host_name = $_REQUEST['host_name']; - else $host_name = $hostname; - - if (isset($_REQUEST['site_URL'])) $site_URL = $_REQUEST['site_URL']; - elseif (isset($site_URL) && $site_URL!='_SITE_URL_') - $site_URL = $site_URL; - else $site_URL = $web_root; - - if(isset($_REQUEST['root_directory'])) $root_directory = $_REQUEST['root_directory']; - else $root_directory = $current_dir; - - if (isset($_REQUEST['cache_dir'])) - $cache_dir= $_REQUEST['cache_dir']; - - if (isset($_REQUEST['mail_server'])) - $mail_server= $_REQUEST['mail_server']; - - if (isset($_REQUEST['mail_server_username'])) - $mail_server_username= $_REQUEST['mail_server_username']; - - if (isset($_REQUEST['mail_server_password'])) - $mail_server_password= $_REQUEST['mail_server_password']; - - if (isset($_REQUEST['admin_email'])) - $admin_email = $_REQUEST['admin_email']; - - if (isset($_REQUEST['admin_password'])) - $admin_password = $_REQUEST['admin_password']; - - if (isset($_REQUEST['currency_name'])) - $currency_name = $_REQUEST['currency_name']; - else - $currency_name = ''; - - if (isset($_REQUEST['currency_symbol'])) - $currency_symbol = $_REQUEST['currency_symbol']; - - if (isset($_REQUEST['currency_code'])) - $currency_code = $_REQUEST['currency_code']; - - } - else { - !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; - !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm5" : $db_name = $_REQUEST['db_name']; - !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; - !isset($_REQUEST['host_name']) ? $host_name= $hostname : $host_name= $_REQUEST['host_name']; - !isset($_REQUEST['site_URL']) ? $site_URL = $web_root : $site_URL = $_REQUEST['site_URL']; - !isset($_REQUEST['root_directory']) ? $root_directory = $current_dir : $root_directory = stripslashes($_REQUEST['root_directory']); - !isset($_REQUEST['cache_dir']) ? $cache_dir = $cache_dir : $cache_dir = stripslashes($_REQUEST['cache_dir']); - !isset($_REQUEST['mail_server']) ? $mail_server = $mail_server : $mail_server = stripslashes($_REQUEST['mail_server']); - !isset($_REQUEST['mail_server_username']) ? $mail_server_username = $mail_server_username : $mail_server_username = stripslashes($_REQUEST['mail_server_username']); - !isset($_REQUEST['mail_server_password']) ? $mail_server_password = $mail_server_password : $mail_server_password = stripslashes($_REQUEST['mail_server_password']); - !isset($_REQUEST['admin_email']) ? $admin_email = "" : $admin_email = $_REQUEST['admin_email']; - } - !isset($_REQUEST['check_createdb']) ? $check_createdb = "" : $check_createdb = $_REQUEST['check_createdb']; - !isset($_REQUEST['root_user']) ? $root_user = "" : $root_user = $_REQUEST['root_user']; - !isset($_REQUEST['root_password']) ? $root_password = "" : $root_password = $_REQUEST['root_password']; - // determine database options - $db_options = array(); - if(function_exists('mysql_connect')) { - $db_options['mysql'] = 'MySQL'; - } - if(function_exists('pg_connect')) { - $db_options['pgsql'] = 'Postgres'; - } -?> - - - - - - vtiger CRM 5 - Configuration Wizard - System Configuration - - - - - - - - -


- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- -
- - - - - - - - -
System Configuration
-
- - - - - - -
- Please enter your database configuration information below...
- - If you do not have root access to your database (for example you are installing in a virtual - hosting environment), you will need to have your database created for you before you proceed. - However, this installer will still be able to create the necessary database tables.

- - If you are unsure of your database host, username or password, we suggest that you use the default - values below.

- - *- required information - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Database Configuration
Database Type * - - No Database Support Deteched - - - - - - -
Host Name *" />
User Name *" />
Password" />
Database Name *" />  - - - - - -  Create Database(will drop the database if exists)
Root Username *
Root Password
- -

- - - - - - - - - - - - - - - - - - -
Site Configuration
URL * -
Path *" size="40" />
Path to Cache Directory *
(must be writable)
-

- - - - - - - - - - - - - - - - - - - - - -
Admin Configuration
User nameadmin
Password*">
Email*">
Note: The default password is 'admin'. You can change the password if necessary now or else you can change it later after logging-in.
- -

- - - - - - - - - - - - - - - - - -
Currency Configuration
Name*">
Symbol*">
Code*">
- - -
- - -
-
-
-
- -
-
- - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - - +$value) { + $language_keys[] = $key; + $language_values[] = $value; + } + $_SESSION['language_keys'] = urlencode(implode(",",$language_keys)); + $_SESSION['language_values'] = urlencode(implode(",",$language_values)); + } + + global $dbconfig; + + if (isset($_REQUEST['db_hostname'])) + $db_hostname = $_REQUEST['db_hostname']; + elseif (isset($dbconfig['db_hostname'])) + $db_hostname = $dbconfig['db_hostname']; + else + $db_hostname = $hostname; + + if (isset($_REQUEST['db_username'])) + $db_username = $_REQUEST['db_username']; + elseif (isset($dbconfig['db_username'])) + $db_username = $dbconfig['db_username']; + + if (isset($_REQUEST['db_password'])) + $db_password = $_REQUEST['db_password']; + elseif (isset($dbconfig['db_password'])) + $db_password = $dbconfig['db_password']; + + if (isset($_REQUEST['db_type'])) + $db_type = $_REQUEST['db_type']; + elseif (isset($dbconfig['db_type'])) + $db_type = $dbconfig['db_type']; + + if (isset($_REQUEST['db_name'])) + $db_name = $_REQUEST['db_name']; + elseif (isset($dbconfig['db_name']) && $dbconfig['db_name']!='_DBC_NAME_') + $db_name = $dbconfig['db_name']; + else + $db_name = 'vtigercrm502'; + + !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; + if (isset($_REQUEST['host_name'])) $host_name = $_REQUEST['host_name']; + else $host_name = $hostname; + + if (isset($_REQUEST['site_URL'])) $site_URL = $_REQUEST['site_URL']; + elseif (isset($site_URL) && $site_URL!='_SITE_URL_') + $site_URL = $site_URL; + else $site_URL = $web_root; + + if(isset($_REQUEST['root_directory'])) $root_directory = $_REQUEST['root_directory']; + else $root_directory = $current_dir; + + if (isset($_REQUEST['cache_dir'])) + $cache_dir= $_REQUEST['cache_dir']; + + if (isset($_REQUEST['mail_server'])) + $mail_server= $_REQUEST['mail_server']; + + if (isset($_REQUEST['mail_server_username'])) + $mail_server_username= $_REQUEST['mail_server_username']; + + if (isset($_REQUEST['mail_server_password'])) + $mail_server_password= $_REQUEST['mail_server_password']; + + if (isset($_REQUEST['admin_email'])) + $admin_email = $_REQUEST['admin_email']; + + if (isset($_REQUEST['admin_password'])) + $admin_password = $_REQUEST['admin_password']; + + if (isset($_REQUEST['currency_name'])) + $currency_name = $_REQUEST['currency_name']; + else + $currency_name = ''; + + if (isset($_REQUEST['currency_symbol'])) + $currency_symbol = $_REQUEST['currency_symbol']; + + if (isset($_REQUEST['currency_code'])) + $currency_code = $_REQUEST['currency_code']; + + } + else { + !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; + !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm502" : $db_name = $_REQUEST['db_name']; + !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; + !isset($_REQUEST['host_name']) ? $host_name= $hostname : $host_name= $_REQUEST['host_name']; + !isset($_REQUEST['site_URL']) ? $site_URL = $web_root : $site_URL = $_REQUEST['site_URL']; + !isset($_REQUEST['root_directory']) ? $root_directory = $current_dir : $root_directory = stripslashes($_REQUEST['root_directory']); + !isset($_REQUEST['cache_dir']) ? $cache_dir = $cache_dir : $cache_dir = stripslashes($_REQUEST['cache_dir']); + !isset($_REQUEST['mail_server']) ? $mail_server = $mail_server : $mail_server = stripslashes($_REQUEST['mail_server']); + !isset($_REQUEST['mail_server_username']) ? $mail_server_username = $mail_server_username : $mail_server_username = stripslashes($_REQUEST['mail_server_username']); + !isset($_REQUEST['mail_server_password']) ? $mail_server_password = $mail_server_password : $mail_server_password = stripslashes($_REQUEST['mail_server_password']); + !isset($_REQUEST['admin_email']) ? $admin_email = "" : $admin_email = $_REQUEST['admin_email']; + } + !isset($_REQUEST['check_createdb']) ? $check_createdb = "" : $check_createdb = $_REQUEST['check_createdb']; + !isset($_REQUEST['root_user']) ? $root_user = "" : $root_user = $_REQUEST['root_user']; + !isset($_REQUEST['root_password']) ? $root_password = "" : $root_password = $_REQUEST['root_password']; + // determine database options + $db_options = array(); + if(function_exists('mysql_connect')) { + $db_options['mysql'] = 'MySQL'; + } + if(function_exists('pg_connect')) { + $db_options['pgsql'] = 'Postgres'; + } +?> + + + + + + vtiger CRM 5 - Configuration Wizard - System Configuration + + + + + + + + +


+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ +
+ + + + + + + + +
System Configuration
+
+ + + + + + +
+ Please enter your database configuration information below...
+ + If you do not have root access to your database (for example you are installing in a virtual + hosting environment), you will need to have your database created for you before you proceed. + However, this installer will still be able to create the necessary database tables.

+ + If you are unsure of your database host, username or password, we suggest that you use the default + values below.

+ + *- required information + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Database Configuration
Database Type * + + No Database Support Detected + + + + + + +
Host Name *" />
User Name *" />
Password" />
Database Name *" />  + + + + + +  Create Database(will drop the database if exists)
Root Username *
Root Password
+ +

+ + + + + + + + + + + + + + + + + + +
Site Configuration
URL * +
Path *" size="40" />
Path to Cache Directory *
(must be writable)
+

+ + + + + + + + + + + + + + + + + + + + + +
Admin Configuration
User nameadmin
Password*">
Email*">
Note: The default password is 'admin'. You can change the password if necessary now or else you can change it later after logging-in.
+ +

+ + + + + + + + + + + + + + + + + +
Currency Configuration
Name*">
Symbol*">
Code*">
+ + +
+ + +
+
+
+
+ +
+
+ + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + + Modified: vtigercrm/branches/5.1_jens/install/4createConfigFile.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/4createConfigFile.php (original) +++ vtigercrm/branches/5.1_jens/install/4createConfigFile.php Tue Nov 14 03:16:10 2006 @@ -1,505 +1,505 @@ - - - - - - - vtiger CRM 5 - Configuration Wizard - Config File Creation - - - - - -

- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- - - - - - - - - - -
Config File Creation
-
- -
-

Successfully created configuration file (config.inc.php) in :

-

- The installation will take at least 4 minutes. Grab a coffee,sit back and relax...
-

-
-
- -

Cannot write configuration file (config.inc.php ) in :

-

-

You can continue this installation by manually creating the config.inc.php file and pasting the configuration information below inside.However, you must create the configuration file before you continue to the next step.



- 'en', 'ja'=>'jp', 'sp_ve'=>'sp', 'it_it'=>'it', 'tw_zh'=>'zh', 'pt_br'=>'pt', 'se'=>'sv', 'cn_zh'=>'zh', 'ge_ge'=>'de', 'ge_ch'=>'de', 'fr'=>'fr');\n\n"; - - $config .= "//set default module and action\n"; - $config .= "\$default_module = 'Home';\n"; - $config .= "\$default_action = 'index';\n\n"; - - $config .= "//set default theme\n"; - $config .= "\$default_theme = 'bluelagoon';\n\n"; - - $config .= "// If true, the time to compose each page is placed in the browser.\n"; - $config .= "\$calculate_response_time = true;\n"; - - $config .= "// Default Username - The default text that is placed initially in the login form for user name.\n"; - $config .= "\$default_user_name = '';\n"; - - $config .= "// Default Password - The default text that is placed initially in the login form for password.\n"; - $config .= "\$default_password = '';\n"; - - $config .= "// Create default user - If true, a user with the default username and password is created.\n"; - $config .= "\$create_default_user = false;\n"; - $config .= "\$default_user_is_admin = false;\n"; - - $config .= "// disable persistent connections - If your MySQL/PHP configuration does not support persistent connections set this to true to avoid a large performance slowdown\n"; - $config .= "\$disable_persistent_connections = false;\n"; - $config .= "// Defined languages available. The key must be the language file prefix. E.g. 'en_us' is the prefix for every 'en_us.lang.php' file. \n"; - - $language_value = "Array('en_us'=>'US English',)"; - if(isset($_SESSION['language_keys']) && isset($_SESSION['language_values'])) - { - $language_value = 'Array('; - $language_keys = explode(',', urldecode($_SESSION['language_keys'])); - $language_values = explode(',', urldecode($_SESSION['language_values'])); - $size = count($language_keys); - for($i = 0; $i < $size; $i+=1) - { - $language_value .= "'$language_keys[$i]'=>'$language_values[$i]',"; - } - $language_value .= ')'; - } - $config .= "\$languages = $language_value;\n"; - $config .= "// Master currency name\n"; - $config .= "\$currency_name = '$currency_name';\n"; - $config .= "// Default charset if the language specific character set is not found.\n"; - $config .= "\$default_charset = 'ISO-8859-1';\n"; - $config .= "// Default language in case all or part of the user's language pack is not available.\n"; - $config .= "\$default_language = 'en_us';\n"; - $config .= "// Translation String Prefix - This will add the language pack name to every translation string in the display.\n"; - $config .= "\$translation_string_prefix = false;\n"; - - $config .= "//Option to cache tabs permissions for speed.\n"; - $config .= "\$cache_tab_perms = true;\n\n"; - - $config .= "//Option to hide empty home blocks if no entries.\n"; - $config .= "\$display_empty_home_blocks = false;\n\n"; - - $config .= "// Generating Unique Application Key\n"; - $config .= "\$application_unique_key = '".md5($root_directory)."';\n\n"; - $config .= "?>"; - - echo "

"; - echo "

Did you remember to create the config.inc.php file ?

"; - - - } ?> -
-
- - - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - -
- -
-
- -
-
- - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - - + + + + + + + vtiger CRM 5 - Configuration Wizard - Config File Creation + + + + + +

+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ + + + + + + + + + +
Config File Creation
+
+ +
+

Successfully created configuration file (config.inc.php) in :

+

+ The installation will take at least 4 minutes. Grab a coffee,sit back and relax...
+

+
+
+ +

Cannot write configuration file (config.inc.php ) in :

+

+

You can continue this installation by manually creating the config.inc.php file and pasting the configuration information below inside.However, you must create the configuration file before you continue to the next step.



+ 'en', 'ja'=>'jp', 'sp_ve'=>'sp', 'it_it'=>'it', 'tw_zh'=>'zh', 'pt_br'=>'pt', 'se'=>'sv', 'cn_zh'=>'zh', 'ge_ge'=>'de', 'ge_ch'=>'de', 'fr'=>'fr');\n\n"; + + $config .= "//set default module and action\n"; + $config .= "\$default_module = 'Home';\n"; + $config .= "\$default_action = 'index';\n\n"; + + $config .= "//set default theme\n"; + $config .= "\$default_theme = 'bluelagoon';\n\n"; + + $config .= "// If true, the time to compose each page is placed in the browser.\n"; + $config .= "\$calculate_response_time = true;\n"; + + $config .= "// Default Username - The default text that is placed initially in the login form for user name.\n"; + $config .= "\$default_user_name = '';\n"; + + $config .= "// Default Password - The default text that is placed initially in the login form for password.\n"; + $config .= "\$default_password = '';\n"; + + $config .= "// Create default user - If true, a user with the default username and password is created.\n"; + $config .= "\$create_default_user = false;\n"; + $config .= "\$default_user_is_admin = false;\n"; + + $config .= "// disable persistent connections - If your MySQL/PHP configuration does not support persistent connections set this to true to avoid a large performance slowdown\n"; + $config .= "\$disable_persistent_connections = false;\n"; + $config .= "// Defined languages available. The key must be the language file prefix. E.g. 'en_us' is the prefix for every 'en_us.lang.php' file. \n"; + + $language_value = "Array('en_us'=>'US English',)"; + if(isset($_SESSION['language_keys']) && isset($_SESSION['language_values'])) + { + $language_value = 'Array('; + $language_keys = explode(',', urldecode($_SESSION['language_keys'])); + $language_values = explode(',', urldecode($_SESSION['language_values'])); + $size = count($language_keys); + for($i = 0; $i < $size; $i+=1) + { + $language_value .= "'$language_keys[$i]'=>'$language_values[$i]',"; + } + $language_value .= ')'; + } + $config .= "\$languages = $language_value;\n"; + $config .= "// Master currency name\n"; + $config .= "\$currency_name = '$currency_name';\n"; + $config .= "// Default charset if the language specific character set is not found.\n"; + $config .= "\$default_charset = 'ISO-8859-1';\n"; + $config .= "// Default language in case all or part of the user's language pack is not available.\n"; + $config .= "\$default_language = 'en_us';\n"; + $config .= "// Translation String Prefix - This will add the language pack name to every translation string in the display.\n"; + $config .= "\$translation_string_prefix = false;\n"; + + $config .= "//Option to cache tabs permissions for speed.\n"; + $config .= "\$cache_tab_perms = true;\n\n"; + + $config .= "//Option to hide empty home blocks if no entries.\n"; + $config .= "\$display_empty_home_blocks = false;\n\n"; + + $config .= "// Generating Unique Application Key\n"; + $config .= "\$application_unique_key = '".md5($root_directory)."';\n\n"; + $config .= "?>"; + + echo "

"; + echo "

Did you remember to create the config.inc.php file ?

"; + + + } ?> +
+
+ + + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + +
+ +
+
+ +
+
+ + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + + Modified: vtigercrm/branches/5.1_jens/install/5createTables.inc.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/5createTables.inc.php (original) +++ vtigercrm/branches/5.1_jens/install/5createTables.inc.php Tue Nov 14 03:16:10 2006 @@ -1,304 +1,283 @@ -column_fields["last_name"] = 'Administrator'; - $user->column_fields["user_name"] = 'admin'; - $user->column_fields["status"] = 'Active'; - $user->column_fields["is_admin"] = 'on'; - $user->column_fields["user_password"] = $admin_password; - $user->column_fields["tz"] = 'Europe/Berlin'; - $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,'; - $user->column_fields["workdays"] = '0,1,2,3,4,5,6,'; - $user->column_fields["weekstart"] = '1'; - $user->column_fields["namedays"] = ''; - $user->column_fields["currency_id"] = 1; - $user->column_fields["date_format"] = 'yyyy-mm-dd'; - $user->column_fields["hour_format"] = 'am/pm'; - $user->column_fields["start_hour"] = '08:00'; - $user->column_fields["end_hour"] = '23:00'; - $user->column_fields["imagename"] = ''; - $user->column_fields["activity_view"] = 'This Year'; - $user->column_fields["lead_view"] = 'Today'; - $user->column_fields["defhomeview"] = 'home_metrics'; - //added by philip for default default admin emailid - if($admin_email == '') - $admin_email ="admin at vtigeruser.com"; - $user->column_fields["email1"] = $admin_email; - //to get the role id for standard_user - $role_query = "select roleid from vtiger_role where rolename='CEO'"; - $db->checkConnection(); - $db->database->SetFetchMode(ADODB_FETCH_ASSOC); - $role_result = $db->query($role_query); - $role_id = $db->query_result($role_result,0,"roleid"); - $user->column_fields["roleid"] = $role_id; - - $user->save("Users"); - - //Inserting Entries into vtiger_groups table - $result = $db->query("select groupid from vtiger_groups where groupname='Team Selling';"); - $group1_id = $db->query_result($result,0,"groupid"); - $result = $db->query("select groupid from vtiger_groups where groupname='Marketing Group';"); - $group2_id = $db->query_result($result,0,"groupid"); - $result = $db->query("select groupid from vtiger_groups where groupname='Support Group';"); - $group3_id = $db->query_result($result,0,"groupid"); - - $db->query("insert into vtiger_users2group values ('".$group2_id."',".$user->id.")"); - - // we need to change the admin user to a fixed id of 1. - //$query = "update vtiger_users set id='1' where user_name='$user->user_name'"; - //$result = $db->query($query, true, "Error updating admin user ID: "); - - $log->info("Created ".$user->table_name." vtiger_table. for user $user->id"); - - //Creating the flat files - createUserPrivilegesfile($user->id); - createUserSharingPrivilegesfile($user->id); - - - //Creating the Standard User - $user = new User(); - $user->column_fields["last_name"] = 'StandardUser'; - $user->column_fields["user_name"] = 'standarduser'; - $user->column_fields["is_admin"] = 'off'; - $user->column_fields["status"] = 'Active'; - $user->column_fields["user_password"] = 'standarduser'; - $user->column_fields["tz"] = 'Europe/Berlin'; - $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,'; - $user->column_fields["workdays"] = '0,1,2,3,4,5,6,'; - $user->column_fields["weekstart"] = '1'; - $user->column_fields["namedays"] = ''; - $user->column_fields["currency_id"] = 1; - $user->column_fields["date_format"] = 'yyyy-mm-dd'; - $user->column_fields["imagename"] = ''; - $user->column_fields["activity_view"] = 'This Year'; - $user->column_fields["lead_view"] = 'Today'; - $user->column_fields["defhomeview"] = 'home_metrics'; - //added by philip for default default admin emailid - if($admin_email == '') - $std_email ="standarduser at vtigeruser.com"; - $user->column_fields["email1"] = $std_email; - //to get the role id for standard_user - $role_query = "select roleid from vtiger_role where rolename='Vice President'"; - $db->database->SetFetchMode(ADODB_FETCH_ASSOC); - $role_result = $db->query($role_query); - $role_id = $db->query_result($role_result,0,"roleid"); - $user->column_fields["roleid"] = $role_id; - - $user->save('Users'); - - //Creating the flat vtiger_files - createUserPrivilegesfile($user->id); - createUserSharingPrivilegesfile($user->id); - - $db->query("insert into vtiger_users2group values ('".$group1_id."',".$user->id.")"); - $db->query("insert into vtiger_users2group values ('".$group2_id."',".$user->id.")"); - $db->query("insert into vtiger_users2group values ('".$group3_id."',".$user->id.")"); - -} - -//$startTime = microtime(); -$modules = array("DefaultDataPopulator"); -$focus=0; -// tables creation -//eecho("Creating Core tables: "); -//$adb->setDebug(true); -$success = $adb->createTables("schema/DatabaseSchema.xml"); - -//Postgres8 fix - create sequences. -// This should be a part of "createTables" however ... - if( $adb->dbType == "pgsql" ) { - $sequences = array( - "vtiger_leadsource_seq", - "vtiger_accounttype_seq", - "vtiger_industry_seq", - "vtiger_leadstatus_seq", - "vtiger_rating_seq", - "vtiger_licencekeystatus_seq", - "vtiger_opportunity_type_seq", - "vtiger_salutationtype_seq", - "vtiger_sales_stage_seq", - "vtiger_ticketstatus_seq", - "vtiger_ticketpriorities_seq", - "vtiger_ticketseverities_seq", - "vtiger_ticketcategories_seq", - "vtiger_duration_minutes_seq", - "vtiger_eventstatus_seq", - "vtiger_taskstatus_seq", - "vtiger_taskpriority_seq", - "vtiger_manufacturer_seq", - "vtiger_productcategory_seq", - "vtiger_activitytype_seq", - "vtiger_currency_seq", - "vtiger_faqcategories_seq", - "vtiger_usageunit_seq", - "vtiger_glacct_seq", - "vtiger_quotestage_seq", - "vtiger_carrier_seq", - "vtiger_taxclass_seq", - "vtiger_recurringtype_seq", - "vtiger_faqstatus_seq", - "vtiger_invoicestatus_seq", - "vtiger_postatus_seq", - "vtiger_sostatus_seq", - "vtiger_visibility_seq", - "vtiger_campaigntype_seq", - "vtiger_campaignstatus_seq", - "vtiger_expectedresponse_seq", - "vtiger_status_seq", - "vtiger_activity_view_seq", - "vtiger_lead_view_seq", - "vtiger_date_format_seq", - "vtiger_users_seq", - "vtiger_role_seq", - "vtiger_profile_seq", - "vtiger_field_seq", - "vtiger_def_org_share_seq", - "vtiger_datashare_relatedmodules_seq", - "vtiger_relatedlists_seq", - "vtiger_notificationscheduler_seq", - "vtiger_inventorynotification_seq", - "vtiger_currency_info_seq", - "vtiger_emailtemplates_seq", - "vtiger_inventory_tandc_seq", - "vtiger_selectquery_seq", - "vtiger_customview_seq", - "vtiger_crmentity_seq", - "vtiger_seactivityrel_seq", - "vtiger_freetags_seq", - "vtiger_shippingtaxinfo_seq", - "vtiger_inventorytaxinfo_seq" - ); - - foreach ($sequences as $sequence ) { - $log->info( "Creating sequence ".$sequence); - $adb->query( "CREATE SEQUENCE ".$sequence." INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1;"); - } - } - - -// TODO HTML -if($success==0) - die("Error: Tables not created. Table creation failed.\n"); -elseif ($success==1) - die("Error: Tables partially created. Table creation failed.\n"); - //eecho("Tables Successfully created.\n"); - -foreach ($modules as $module ) -{ - $focus = new $module(); - $focus->create_tables(); -} - - -// create and populate combo tables -require_once('include/PopulateComboValues.php'); -$combo = new PopulateComboValues(); -$combo->create_tables(); - -//Writing tab data in flat file -create_tab_data_file(); -create_parenttab_data_file(); - -create_default_users(); - -// default report population -require_once('modules/Reports/PopulateReports.php'); - -// default customview population -require_once('modules/CustomView/PopulateCustomView.php'); - - -// ensure required sequences are created (adodb creates them as needed, but if -// creation occurs within a transaction we get problems -$db->getUniqueID("vtiger_crmentity"); -$db->getUniqueID("vtiger_seactivityrel"); -$db->getUniqueID("vtiger_freetags"); - -//Master currency population -//Insert into vtiger_currency vtiger_table - $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$currency_name','$currency_code','$currency_symbol',1,'Active','-11')"); - -// populate the db with seed data -if ($db_populate) { - //eecho ("Populate seed data into $db_name"); - include("install/populateSeedData.php"); - //eecho ("...done

\n"); -} - -// populate forums data -global $log, $db; - -//$endTime = microtime(); -//$deltaTime = microtime_diff($startTime, $endTime); - - -// populate calendar data - -//eecho ("total time: $deltaTime seconds.\n"); -?> +column_fields["last_name"] = 'Administrator'; + $user->column_fields["user_name"] = 'admin'; + $user->column_fields["status"] = 'Active'; + $user->column_fields["is_admin"] = 'on'; + $user->column_fields["user_password"] = $admin_password; + $user->column_fields["tz"] = 'Europe/Berlin'; + $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,'; + $user->column_fields["workdays"] = '0,1,2,3,4,5,6,'; + $user->column_fields["weekstart"] = '1'; + $user->column_fields["namedays"] = ''; + $user->column_fields["currency_id"] = 1; + $user->column_fields["date_format"] = 'yyyy-mm-dd'; + $user->column_fields["hour_format"] = 'am/pm'; + $user->column_fields["start_hour"] = '08:00'; + $user->column_fields["end_hour"] = '23:00'; + $user->column_fields["imagename"] = ''; + $user->column_fields["activity_view"] = 'This Year'; + $user->column_fields["lead_view"] = 'Today'; + $user->column_fields["defhomeview"] = 'home_metrics'; + //added by philip for default default admin emailid + if($admin_email == '') + $admin_email ="admin at vtigeruser.com"; + $user->column_fields["email1"] = $admin_email; + //to get the role id for standard_user + $role_query = "select roleid from vtiger_role where rolename='CEO'"; + $db->checkConnection(); + $db->database->SetFetchMode(ADODB_FETCH_ASSOC); + $role_result = $db->query($role_query); + $role_id = $db->query_result($role_result,0,"roleid"); + $user->column_fields["roleid"] = $role_id; + $user->column_fields["assigned_org"] = array( "0" => "vtiger"); + $user->column_fields["primray_org"] = "vtiger"; + + $user->save("Users"); + + // we need to change the admin user to a fixed id of 1. + //$query = "update vtiger_users set id='1' where user_name='$user->user_name'"; + //$result = $db->query($query, true, "Error updating admin user ID: "); + + $log->info("Created ".$user->table_name." vtiger_table. for user $user->id"); + + //Creating the flat files + createUserPrivilegesfile($user->id); + createUserSharingPrivilegesfile($user->id); + + + //Creating the Standard User + $user = new Users(); + $user->column_fields["last_name"] = 'StandardUser'; + $user->column_fields["user_name"] = 'standarduser'; + $user->column_fields["is_admin"] = 'off'; + $user->column_fields["status"] = 'Active'; + $user->column_fields["user_password"] = 'standarduser'; + $user->column_fields["tz"] = 'Europe/Berlin'; + $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,'; + $user->column_fields["workdays"] = '0,1,2,3,4,5,6,'; + $user->column_fields["weekstart"] = '1'; + $user->column_fields["namedays"] = ''; + $user->column_fields["currency_id"] = 1; + $user->column_fields["date_format"] = 'yyyy-mm-dd'; + $user->column_fields["imagename"] = ''; + $user->column_fields["activity_view"] = 'This Year'; + $user->column_fields["lead_view"] = 'Today'; + $user->column_fields["defhomeview"] = 'home_metrics'; + //added by philip for default default admin emailid + if($admin_email == '') + $std_email ="standarduser at vtigeruser.com"; + $user->column_fields["email1"] = $std_email; + //to get the role id for standard_user + $role_query = "select roleid from vtiger_role where rolename='Vice President'"; + $db->database->SetFetchMode(ADODB_FETCH_ASSOC); + $role_result = $db->query($role_query); + $role_id = $db->query_result($role_result,0,"roleid"); + $user->column_fields["roleid"] = $role_id; + $user->column_fields["assigned_org"] = array( "0" => "vtiger"); + $user->column_fields["primray_org"] = "vtiger"; + + $user->save('Users'); + + //Creating the flat vtiger_files + createUserPrivilegesfile($user->id); + createUserSharingPrivilegesfile($user->id); + + //Inserting into vtiger_groups table + $db->startTransaction(); + $result = $db->query("select groupid from vtiger_groups where groupname='Team Selling';"); + $group1_id = $db->query_result($result,0,"groupid"); + $result = $db->query("select groupid from vtiger_groups where groupname='Marketing Group';"); + $group2_id = $db->query_result($result,0,"groupid"); + $result = $db->query("select groupid from vtiger_groups where groupname='Support Group';"); + $group3_id = $db->query_result($result,0,"groupid"); + + $db->query("insert into vtiger_users2group values ('".$group1_id."',2)"); + $db->query("insert into vtiger_users2group values ('".$group2_id."',1)"); + $db->query("insert into vtiger_users2group values ('".$group2_id."',2)"); + $db->query("insert into vtiger_users2group values ('".$group3_id."',2)"); + $db->completeTransaction(); +} + +//$startTime = microtime(); +$modules = array("DefaultDataPopulator"); +$focus=0; +// tables creation +//eecho("Creating Core tables: "); +//$adb->setDebug(true); +$success = $adb->createTables("schema/DatabaseSchema.xml"); + +//Postgres8 fix - create sequences. + if( $adb->dbType == "pgsql" ) { + // Create required functions + $adb->query( 'CREATE LANGUAGE plperl'); + $adb->query( 'CREATE OR REPLACE FUNCTION concat(varchar,varchar) RETURNS varchar AS $$ + my $s = ""; + foreach my $t (@_) { $s .= $t; } + return $s; + $$ LANGUAGE plperl'); + $adb->query( 'CREATE OR REPLACE FUNCTION concat(varchar,varchar,varchar) RETURNS varchar AS $$ + my $s = ""; + foreach my $t (@_) { $s .= $t; } + return $s; + $$ LANGUAGE plperl'); + $adb->query( 'CREATE OR REPLACE FUNCTION concat(varchar,varchar,varchar,varchar) RETURNS varchar AS $$ + my $s = ""; + foreach my $t (@_) { $s .= $t; } + return $s; + $$ LANGUAGE plperl'); + + // Create sequences currently not implemented in the database schema + $sequences = array( + "vtiger_role_roleid_seq", + "vtiger_audit_trial_auditid_seq", + "vtiger_datashare_relatedmodules_datashare_relatedmodule_id_seq", + "vtiger_relatedlists_relation_id_seq", + "vtiger_inventory_tandc_id_seq", + "vtiger_customview_cvid_seq", + "vtiger_crmentity_crmid_seq", + "vtiger_seactivityrel_crmid_seq", + "vtiger_selectquery_queryid_seq", + "vtiger_systems_id_seq", + "vtiger_freetags_id_seq", + "vtiger_inventorytaxinfo_taxid_seq", + "vtiger_shippingtaxinfo_taxid_seq", + "vtiger_groups_groupid_seq" + ); + + foreach ($sequences as $sequence ) { + $log->info( "Creating sequence ".$sequence); + $adb->query( "CREATE SEQUENCE ".$sequence." INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1;"); + } + } + + +// TODO HTML +if($success==0) + die("Error: Tables not created. Table creation failed.\n"); +elseif ($success==1) + die("Error: Tables partially created. Table creation failed.\n"); + //eecho("Tables Successfully created.\n"); + +// Populate default data +foreach ($modules as $module ) +{ + $focus = new $module(); + $focus->create_tables(); +} + + +// create and populate combo tables +require_once('include/PopulateComboValues.php'); +$combo = new PopulateComboValues(); +$combo->create_tables(); + +//Writing tab data in flat file +create_tab_data_file(); +create_parenttab_data_file(); + +// Create the default users +create_default_users(); + +// default report population +require_once('modules/Reports/PopulateReports.php'); + +// default customview population +require_once('modules/CustomView/PopulateCustomView.php'); + + +// ensure required sequences are created (adodb creates them as needed, but if +// creation occurs within a transaction we get problems +$db->getUniqueID("vtiger_crmentity"); +$db->getUniqueID("vtiger_seactivityrel"); +$db->getUniqueID("vtiger_freetags"); + +//Master currency population +//Insert into vtiger_currency vtiger_table + $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$currency_name','$currency_code','$currency_symbol',1,'Active','-11')"); + +// populate the db with seed data +if ($db_populate) { + //eecho ("Populate seed data into $db_name"); + include("install/populateSeedData.php"); + //eecho ("...done

\n"); +} + +// populate forums data +global $log, $db; + +//$endTime = microtime(); +//$deltaTime = microtime_diff($startTime, $endTime); + + +// populate calendar data + +//eecho ("total time: $deltaTime seconds.\n"); +?> Modified: vtigercrm/branches/5.1_jens/install/5createTables.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/5createTables.php (original) +++ vtigercrm/branches/5.1_jens/install/5createTables.php Tue Nov 14 03:16:10 2006 @@ -1,179 +1,179 @@ - - - - - - -vtiger CRM 5 - Configuration Wizard - Finish - - - - - - - -


- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- - - - - - - - -
Configuration Completed
-
- - - - - - -
- vtigercrm-5.0.0 is all set to go! -
-
-
    -
  • Your install.php file has been renamed to install.php.txt. -
  • Your install folder too has been renamed to install/. -
  • Please log in using the "admin" user name and the password you entered in step 2. -
-
- -
-
- - -
-
- - -
-
-
- - -
-
- - - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - + + + + + + +vtiger CRM 5 - Configuration Wizard - Finish + + + + + + + +


+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ + + + + + + + +
Configuration Completed
+
+ + + + + + +
+ vtigercrm-5.0.2 is all set to go! +
+
+
    +
  • Your install.php file has been renamed to install.php.txt. +
  • Your install folder too has been renamed to install/. +
  • Please log in using the "admin" user name and the password you entered in step 2. +
+
+ +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + Modified: vtigercrm/branches/5.1_jens/install/populateSeedData.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/populateSeedData.php (original) +++ vtigercrm/branches/5.1_jens/install/populateSeedData.php Tue Nov 14 03:16:10 2006 @@ -1,1171 +1,1171 @@ -println("PSD dumping started"); - -$account_ids = Array(); -$opportunity_ids = Array(); -$vendor_ids = Array(); -$contact_ids = Array(); -$product_ids = Array(); -$pricebook_ids = Array(); -$quote_ids = Array(); -$salesorder_ids = Array(); -$purchaseorder_ids = Array(); -$invoice_ids = Array(); -$email_ids = Array(); - -// Determine the assigned user for all demo data. This is the default user if set, or admin -$assigned_user_name = "admin"; -if(isset($default_user_name) && $default_user_name != '' && isset($create_default_user) && $create_default_user) -{ - $assigned_user_name = $default_user_name; -} - -// Look up the user id for the assigned user -$seed_user = new User(); - -//$adb->println("PSD assignname=".$assigned_user_name); - -$assigned_user_id = $seed_user->retrieve_user_id($assigned_user_name); - -global $current_user; - -$current_user = new User(); -$result = $current_user->retrieve_entity_info($assigned_user_id,'Users'); - -$tagkey = 1; - -// Get _dom arrays -$comboFieldNames = Array('leadsource'=>'leadsource_dom' - ,'leadstatus'=>'lead_status_dom' - ,'industry'=>'industry_dom' - ,'rating'=>'rating_dom' - ,'opportunity_type'=>'opportunity_type_dom' - ,'sales_stage'=>'sales_stage_dom'); -$comboFieldArray = getComboArray($comboFieldNames); - -//$adb->println("PSD assignid=".$assigned_user_id); -$adb->println("company_name_array"); -$adb->println($company_name_array); - -$cloudtag = Array ('SO_vendtl', 'X-CEED', 'X-CEED', 'vtiger_50usr'); - -for($i = 0; $i < $company_name_count; $i++) -{ - - $account_name = $company_name_array[$i]; - - // Create new accounts. - $account = new Account(); - $account->column_fields["accountname"] = $account_name; - $account->column_fields["phone"] = create_phone_number(); - $account->column_fields["assigned_user_id"] = $assigned_user_id; - - $whitespace = array(" ", ".", "&", "\/"); - $website = str_replace($whitespace, "", strtolower($account->column_fields["accountname"])); - $account->column_fields["website"] = "www.".$website.".com"; - - $account->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $account->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $account->column_fields["bill_state"] = "CA"; - $account->column_fields["bill_code"] = rand(10000, 99999); - $account->column_fields["bill_country"] = 'USA'; - - $account->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $account->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $account->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $account->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $account->column_fields["ship_country"] = $account->column_fields["bill_country"]; - -// $key = array_rand($app_list_strings['industry_dom']); -// $account->industry = $app_list_strings['industry_dom'][$key]; - $key = array_rand($comboFieldArray['industry_dom']); - $account->column_fields["industry"] = $comboFieldArray['industry_dom'][$key]; - - $account->column_fields["account_type"] = "Customer"; - - //$account->saveentity("Accounts"); - $account->save("Accounts"); - - $account_ids[] = $account->id; - - if ($i > 3) - { - $freetag = $adb->getUniqueId('vtiger_freetags'); - $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[1]', '$cloudtag[1]')"; - $res = $adb->query($query); - - $date = $adb->formatDate(date('YmdHis')); - $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$account->id.", $date, 'Accounts')"; - $result = $adb->query($query_tag); - } - - -// $adb->println("PSD Account [".$account->id."] - ".$account_name); - - -//Create new opportunities - $opp = new Potential(); - - $opp->column_fields["assigned_user_id"] = $assigned_user_id; - $opp->column_fields["potentialname"] = $account_name." - 1000 units"; - $opp->column_fields["closingdate"] = & create_date(); - -// $key = array_rand($app_list_strings['lead_source_dom']); -// $opp->lead_source = $app_list_strings['lead_source_dom'][$key]; - $key = array_rand($comboFieldArray['leadsource_dom']); - $opp->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; - -// $key = array_rand($app_list_strings['sales_stage_dom']); -// $opp->sales_stage = $app_list_strings['sales_stage_dom'][$key]; - $comboSalesStageArray = Array ("Closed Won"); - $key = array_rand($comboSalesStageArray); - $opp->column_fields["sales_stage"] = $comboSalesStageArray[$key]; - -// $key = array_rand($app_list_strings['opportunity_type_dom']); -// $opp->opportunity_type = $app_list_strings['opportunity_type_dom'][$key]; - $key = array_rand($comboFieldArray['opportunity_type_dom']); - $opp->column_fields["opportunity_type"] = $comboFieldArray['opportunity_type_dom'][$key]; - - $amount = array("10000", "25000", "50000", "75000"); - $key = array_rand($amount); - $opp->column_fields["amount"] = $amount[$key]; - $opp->column_fields["account_id"] = $account->id; - - //$opp->saveentity("Potentials"); - $opp->save("Potentials"); - - $opportunity_ids[] = $opp->id; - -// $adb->println("PSD Potential [".$opp->id."] - account[".$account->id."]"); - -} - - -for($i=0; $i<10; $i++) -{ - $contact = new Contact(); - $contact->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i])); - $contact->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i])); - $contact->column_fields["assigned_user_id"] = $assigned_user_id; - - $contact->column_fields["email"] = strtolower($contact->column_fields["firstname"])."_".strtolower($contact->column_fields["lastname"])."@company.com"; - - $contact->column_fields["phone"] = create_phone_number(); - $contact->column_fields["homephone"] = create_phone_number(); - $contact->column_fields["mobile"] = create_phone_number(); - - // Fill in a bogus address - $key = array_rand($street_address_array); - $contact->column_fields["mailingstreet"] = $street_address_array[$key]; - $key = array_rand($city_array); - $contact->column_fields["mailingcity"] = $city_array[$key]; - $contact->column_fields["mailingstate"] = "CA"; - $contact->column_fields["mailingzip"] = '99999'; - $contact->column_fields["mailingcountry"] = 'USA'; - if ($contact->column_fields["mailingcity"] == "San Mateo") - $contact->column_fields["yahooid"] = "clint_oram"; - elseif ($contact->column_fields["mailingcity"] == "San Francisco") - $contact->column_fields["yahooid"] = "not_a_real_id"; - -// $key = array_rand($app_list_strings['lead_source_dom']); -// $contact->lead_source = $app_list_strings['lead_source_dom'][$key]; - $key = array_rand($comboFieldArray['leadsource_dom']); - $contact->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; - - $titles = array("President", - "VP Operations", - "VP Sales", - "Director Operations", - "Director Sales", - "Mgr Operations", - "IT Developer", - ""); - $key = array_rand($titles); - $contact->column_fields["title"] = $titles[$key]; - - $account_key = array_rand($account_ids); - $contact->column_fields["account_id"] = $account_ids[$account_key]; - - //$contact->saveentity("Contacts"); - $contact->save("Contacts"); - $contact_ids[] = $contact->id; - - - if ($i > 8) - { - $freetag = $adb->getUniqueId('vtiger_freetags'); - $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[2]', '$cloudtag[2]')"; - $res1 = $adb->query($query); - - $date = $adb->formatDate(date('YmdHis')); - $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$contact->id.", $date, 'Contacts')"; - $result1 = $adb->query($query_tag); - } - // This assumes that there will be one opportunity per company in the seed data. - $opportunity_key = array_rand($opportunity_ids); - //$query = "insert into opportunities_contacts set id='".create_guid()."', contact_id='$contact->id', contact_role='".$app_list_strings['opportunity_relationship_type_default_key']."', opportunity_id='".$opportunity_ids[$opportunity_key]."'"; - //$db->query($query, true, "unable to create seed links between opportunities and contacts"); - - $query = "insert into vtiger_contpotentialrel ( contactid, potentialid ) values (".$contact->id.",".$opportunity_ids[$opportunity_key].")"; - $db->query($query); - -// $adb->println("PSD Contact [".$contact->id."] - account[".$account_ids[$account_key]."] - potential[".$opportunity_ids[$opportunity_key]."]"); - - //Create new tasks - /*$task = new Task(); - - $key = array_rand($task->default_task_name_values); - $task->name = $task->default_task_name_values[$key]; - $task->date_due = & create_date(); - $task->time_due = date("H:i:s",time()); - $task->date_due_flag = 'off'; - $task->assigned_user_id = $assigned_user_id; - - $key = array_rand($app_list_strings['task_status_dom']); - $task->status = $app_list_strings['task_status_dom'][$key]; - $task->contact_id = $contact->id; - if ($contact->primary_address_city == "San Mateo") { - $task->parent_id = $account_ids[$account_key]; - $task->parent_type = 'Accounts'; - $task->save(); - }*/ - -} - - $company_count=0; -for($i=0; $i<10; $i++) -{ - $lead = new Lead(); - $lead->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i])); - $lead->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i])); - - if($i<5) - { - $lead->column_fields["company"] = ucfirst(strtolower($company_name_array[$i])); - } - else - { - $lead->column_fields["company"] = ucfirst(strtolower($company_name_array[$company_count])); - $company_count++; - } - - $lead->column_fields["assigned_user_id"] = $assigned_user_id; - - $lead->column_fields["email"] = strtolower($lead->column_fields["firstname"])."_".strtolower($lead->column_fields["lastname"])."@company.com"; - - $website = str_replace($whitespace, "", strtolower(ucfirst(strtolower($company_name_array[$i])))); - $lead->column_fields["website"] = "www.".$website.".com"; - - $lead->column_fields["phone"] = create_phone_number(); - $lead->column_fields["mobile"] = create_phone_number(); - - // Fill in a bogus address - $key = array_rand($street_address_array); - //$lead->address_street = $street_address_array[$key]; - $lead->column_fields["lane"] = $street_address_array[$key]; - $key = array_rand($city_array); - $lead->column_fields["city"] = $city_array[$key]; - $lead->column_fields["state"] = "CA"; - $lead->column_fields["code"] = '99999'; - $lead->column_fields["country"] = 'USA'; - if ($lead->column_fields["city"] == "San Mateo") - $lead->column_fields["yahooid"] = "clint_oram"; - elseif ($lead->column_fields["city"] == "San Francisco") - $lead->column_fields["yahooid"] = "not_a_real_id"; - -// $key = array_rand($app_list_strings['lead_source_dom']); -// $lead->lead_source = $app_list_strings['lead_source_dom'][$key]; - $key = array_rand($comboFieldArray['leadsource_dom']); - $lead->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; - -// $key = array_rand($app_list_strings['lead_status_dom']); -// $lead->lead_status = $app_list_strings['lead_status_dom'][$key]; - $key = array_rand($comboFieldArray['lead_status_dom']); - $lead->column_fields["leadstatus"] = $comboFieldArray['lead_status_dom'][$key]; - -// $key = array_rand($app_list_strings['rating_dom']); -// $lead->rating = $app_list_strings['rating_dom'][$key]; - $key = array_rand($comboFieldArray['rating_dom']); - $lead->column_fields["rating"] = $comboFieldArray['rating_dom'][$key]; - - $titles = array("President", - "VP Operations", - "VP Sales", - "Director Operations", - "Director Sales", - "Mgr Operations", - "IT Developer", - ""); - $key = array_rand($titles); - $lead->column_fields["designation"] = $titles[$key]; - - //$lead->saveentity("Leads"); - $lead->save("Leads"); - -// $adb->println("PSD Lead [".$lead->id."] - name=".$lead->column_fields["lastname"]); - -} - -// Temp fix since user is not logged in while populating data updating creatorid in crmentity - GS - - -//Populating Vendor Data -for($i=0; $i<10; $i++) -{ - $vendor = new Vendor(); - $vendor->column_fields["vendorname"] = ucfirst(strtolower($first_name_array[$i])); - $vendor->column_fields["phone"] = create_phone_number(); - $vendor->column_fields["email"] = strtolower($vendor->column_fields["vendorname"])."@company.com"; - $website = str_replace($whitespace, "", strtolower(ucfirst(strtolower($company_name_array[$i])))); - $vendor->column_fields["website"] = "www.".$website.".com"; - - $vendor->column_fields["assigned_user_id"] = $assigned_user_id; - - - - // Fill in a bogus address - $vendor->column_fields["street"] = $street_address_array[rand(0,$street_address_count-1)]; - $key = array_rand($city_array); - $vendor->column_fields["city"] = $city_array[$key]; - $vendor->column_fields["state"] = "CA"; - $vendor->column_fields["postalcode"] = '99999'; - $vendor->column_fields["country"] = 'USA'; - - $vendor->save("Vendors"); - $vendor_ids[] = $vendor->id; - - -} - - -//Populating Product Data - -$product_name_array= array( "Vtiger Single User Pack", "Vtiger 5 Users Pack", "Vtiger 10 Users Pack", - "Vtiger 25 Users Pack", "Vtiger 50 Users Pack", "Double Panel See-thru Clipboard", - "abcd1234", "Cd-R CD Recordable", "Sharp - Plain Paper Fax" , "Brother Ink Jet Cartridge"); -$product_code_array= array("001","002","003","023","005","sg-106","1324356","sg-108","sg-119","sg-125"); -$subscription_rate=array("149","699","1299","2999","4995"); -//added by jeri to populate product images -$product_image_array = array("product1.jpeg###","product2.jpeg###product3.jpeg###","product4.jpeg###product5.jpeg###product6 -.jpeg###","product7.jpeg###product8.jpeg###product9.jpeg###product10.jpeg###"); -for($i=0; $i<10; $i++) -{ - $product = new Product(); - if($i>4) - { - $parent_key = array_rand($opportunity_ids); - $product->column_fields["parent_id"]=$opportunity_ids[$parent_key]; - - $usageunit = "Each"; - $qty_per_unit = 1; - $qty_in_stock = rand(10000, 99999); - $category = "Hardware"; - $website = ""; - $manufacturer = ""; - $commission_rate= rand(10,20); - $unit_price = rand(100,999); - $product_image_name = ''; - } - else - { - $account_key = array_rand($account_ids); - $product->column_fields["parent_id"]=$account_ids[$account_key]; - - $usageunit = "Each"; - $qty_per_unit = 1; - $qty_in_stock = rand(10000, 99999); - $category = "Software"; - $website = "www.vtiger.com"; - $manufacturer = "vtiger"; - $commission_rate= rand(1,10); - $unit_price = $subscription_rate[$i]; - $product_image_name = $product_image_array[$i]; - } - - $product->column_fields["productname"] = $product_name_array[$i]; - $product->column_fields["productcode"] = $product_code_array[$i]; - $product->column_fields["manufacturer"] = $manufacturer; - - $product->column_fields["productcategory"] = $category; - $product->column_fields["website"] = $website; - $product->column_fields["productsheet"] = ""; - - $vendor_key = array_rand($vendor_ids); - $product->column_fields["vendor_id"] = $vendor_ids[$vendor_key]; - $contact_key = array_rand($contact_ids); - $product->column_fields["contact_id"] = $contact_ids[$contact_key]; - - $product->column_fields["start_date"] = & create_date(); - $product->column_fields["sales_start_date"] = & create_date(); - - $product->column_fields["unit_price"] = $unit_price; - $product->column_fields["commissionrate"] = $commission_rate; - $product->column_fields["taxclass"] = 'SalesTax'; - $product->column_fields["usageunit"] = $usageunit; - $product->column_fields["qty_per_unit"] = $qty_per_unit; - $product->column_fields["qtyinstock"] = $qty_in_stock; - $product->column_fields["imagename"] = $product_image_name; - - $product->save("Products"); - $product_ids[] = $product ->id; -} - - -//Populating HelpDesk- FAQ Data - - $status_array=array ("Draft","Reviewed","Published","Draft","Reviewed","Draft","Reviewed","Draft","Reviewed","Draft","Reviewed","Draft"); - $question_array=array ( - "How to migrate data from previous versions to the latest version?", - "Error message: The file is damaged and could not be repaired.", - "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose No when trying to add Email to vitger CRM ", - "When trying to merge a template with a contact, First I was asked allow installation of ActiveX control. I accepted. After it appears a message that it will not be installed because it can't verify the publisher. Do you have a workarround for this issue ?", - " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", - "How to migrate data from previous versions to the latest version?", - "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose No when trying to add Email to vitger CRM ", - " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", - "Error message: The file is damaged and could not be repaired.", - "When trying to merge a template with a contact, First I was asked allow installation of ActiveX control. I accepted. After it appears a message that it will not be installed because it can't verify the publisher. Do you have a workarround for this issue ?", - " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", - "How to migrate data from previous versions to the latest version?", - - ); - - - $answer_array=array ( - "Database migration scripts are available to migrate from the following versions: - - 1.0 to 2.0 - - 2.0 to 2.1 - - 2.1 to 3.0 - - 3.0 to 3.2 - - 3.2 to 4.0 - - 4.0 to 4.0.1 - - 4.0.1 to 4.2", - - "The above error message is due to version incompatibility between FPDF and PHP5. Use PHP 4.3.X version","Published", - "The above error message is displayed if you have installed the Microsoft(R) Outlook(R) E-mail Security Update. Please refer to the following URL for complete details: - -http://support.microsoft.com/default.aspx?scid=kb%3BEN-US%3B263074 - -If you want to continue working with vtiger Outlook Plug-in, select the Allow access for check box and select the time from drop-down box.", - " Since, vtigerCRM & all plugins are open source, it is not signed up with third party vendors and IE will ask to download even though the plugin are not signed. - -This message if produced by Microsoft Windows XP. I English Windows XP with the SP2 and the last updates. I told IE to accept installation of the ActiveX, but after it, this message has appeared. Provably there is a place where to tall to WinXP to not validate if the code is signed... but I don\'t know where. - -In IE from Tools->Internet Options->Security->Custom Level, there you can see various options for downloading plugins which are not signed and you can adjust according to your need, so relax your security settings for a while and give a try to vtiger Office Plugin.", - "Before modifying any templates, please ensure that you don\'t have any documents open and only one instance of word is available in your memory." - ); - -$num_array=array(0,1,2,3,4,6,7,8,9,10,11,12); -for($i=0;$i<12;$i++) -{ - - $faq = new Faq(); - - $rand=array_rand($num_array); - $faq->column_fields["product_id"] = $product_ids[$i]; - $faq->column_fields["faqcategories"] = "General"; - $faq->column_fields["faqstatus"] = $status_array[$i]; - $faq->column_fields["question"] = $question_array[$i]; - $faq->column_fields["faq_answer"] = $answer_array[$i]; - - $faq->save("Faq"); - $faq_ids[] = $faq ->id; -} - -//Populate Quote Data - -$sub_array = array ("Prod_Quote", "Cont_Quote", "SO_Quote", "PO_Quote", "Vendor_Quote"); -$stage_array = array ("Created", "Reviewed", "Delivered", "Accepted" , "Rejected"); -$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); -$validtill_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); -for($i=0;$i<5;$i++) -{ - $quote = new Quote(); - - $quote->column_fields["assigned_user_id"] = $assigned_user_id; - $account_key = array_rand($account_ids); - $quote->column_fields["account_id"] = $account_ids[$account_key]; - $op_key = array_rand($opportunity_ids); - $quote->column_fields["potential_id"] = $opportunity_ids[$op_key]; - $contact_key = array_rand($contact_ids); - $quote->column_fields["contact_id"] = $contact_ids[$contact_key]; - $rand = array_rand($num_array); - $quote->column_fields["subject"] = $sub_array[$i]; - $quote->column_fields["quotestage"] = $stage_array[$i]; - $quote->column_fields["carrier"] = $carrier_array[$i]; - $quote->column_fields["validtill"] = $validtill_array[$i]; - - $quote->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $quote->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $quote->column_fields["bill_state"] = "CA"; - $quote->column_fields["bill_code"] = rand(10000, 99999); - $quote->column_fields["bill_country"] = 'USA'; - - $quote->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $quote->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $quote->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $quote->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $quote->column_fields["ship_country"] = $account->column_fields["bill_country"]; - - - $quote->save("Quotes"); - - $quote_ids[] = $quote->id; - - $product_key = array_rand($product_ids); - $productid = $product_ids[$product_key]; - - //set the inventory product details in request then just call the saveInventoryProductDetails function - $_REQUEST['totalProductCount'] = 1; - - $_REQUEST['hdnProductId1'] = $productid; - $_REQUEST['qty1'] = $qty = 1; - $_REQUEST['listPrice1'] = $listprice = 130; - $_REQUEST['comment1'] = "This is test comment for product of Quotes"; - - $_REQUEST['deleted1'] = 0; - $_REQUEST['discount_type1'] = 'amount'; - $_REQUEST['discount_amount1'] = $discount_amount = '20'; - - $_REQUEST['taxtype'] = $taxtype = 'individual'; - $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; - $_REQUEST['discount_type_final'] = 'amount'; - $_REQUEST['discount_amount_final'] = $discount_amount_final = '10'; - - $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; - $_REQUEST['adjustmenttype'] = '+'; - $_REQUEST['adjustment'] = $adjustment = '10'; - - $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; - - //Upto this added to set the request values which will be used to save the inventory product details - - //Now call the saveInventoryProductDetails function - saveInventoryProductDetails(&$quote, 'Quotes'); -} - -//Populate SalesOrder Data - -$subj_array = array ("SO_vtiger", "SO_zoho", "SO_vtiger5usrp", "SO_vt100usrpk", "SO_vendtl"); -$status_array = array ("Created", "Delivered", "Approved" , "Cancelled" , "Created"); -$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); -$duedate_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); - -for($i=0;$i<5;$i++) -{ - $so = new SalesOrder(); - - $so->column_fields["assigned_user_id"] = $assigned_user_id; - $account_key = array_rand($account_ids); - $so->column_fields["account_id"] = $account_ids[$account_key]; - $quote_key = array_rand($quote_ids); - $so->column_fields["quote_id"] = $quote_ids[$quote_key]; - $contact_key = array_rand($contact_ids); - $so->column_fields["contact_id"] = $contact_ids[$contact_key]; - $rand = array_rand($num_array); - $so->column_fields["subject"] = $subj_array[$i]; - $so->column_fields["sostatus"] = $status_array[$i]; - $so->column_fields["hdnGrandTotal"] = $sototal_array[$i]; - $so->column_fields["carrier"] = $carrier_array[$i]; - $so->column_fields["duedate"] = $duedate_array[$i]; - - $so->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $so->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $so->column_fields["bill_state"] = "CA"; - $so->column_fields["bill_code"] = rand(10000, 99999); - $so->column_fields["bill_country"] = 'USA'; - - $so->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $so->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $so->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $so->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $so->column_fields["ship_country"] = $account->column_fields["bill_country"]; - - - $so->save("SalesOrder"); - - $salesorder_ids[] = $so->id; - - $product_key = array_rand($product_ids); - $productid = $product_ids[$product_key]; - - //set the inventory product details in request then just call the saveInventoryProductDetails function - $_REQUEST['totalProductCount'] = 1; - - $_REQUEST['hdnProductId1'] = $productid; - $_REQUEST['qty1'] = $qty = 1; - $_REQUEST['listPrice1'] = $listprice = 1230; - $_REQUEST['comment1'] = "This is test comment for product of SalesOrder"; - - $_REQUEST['deleted1'] = 0; - $_REQUEST['discount_type1'] = 'amount'; - $_REQUEST['discount_amount1'] = $discount_amount = '200'; - - $_REQUEST['taxtype'] = $taxtype = 'individual'; - $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; - $_REQUEST['discount_type_final'] = 'amount'; - $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; - - $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; - $_REQUEST['adjustmenttype'] = '+'; - $_REQUEST['adjustment'] = $adjustment = '100'; - - $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; - - //Upto this added to set the request values which will be used to save the inventory product details - - //Now call the saveInventoryProductDetails function - saveInventoryProductDetails(&$so, 'SalesOrder'); - - -} - - -//Populate PurchaseOrder Data - -$psubj_array = array ("PO_vtiger", "PO_zoho", "PO_vtiger5usrp", "PO_vt100usrpk", "PO_vendtl"); -$pstatus_array = array ("Created", "Delivered", "Approved" , "Cancelled", "Recieved Shipment"); -$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); -$trkno_array = array ("po1425", "po2587", "po7974", "po7979", "po6411"); -$duedate_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); - -for($i=0;$i<5;$i++) -{ - $po = new Order(); - - $po->column_fields["assigned_user_id"] = $assigned_user_id; - $vendor_key = array_rand($vendor_ids); - $po->column_fields["vendor_id"] = $vendor_ids[$vendor_key]; - $contact_key = array_rand($contact_ids); - $po->column_fields["contact_id"] = $contact_ids[$contact_key]; - $rand = array_rand($num_array); - $po->column_fields["subject"] = $psubj_array[$i]; - $po->column_fields["postatus"] = $pstatus_array[$i]; - $po->column_fields["carrier"] = $carrier_array[$i]; - $po->column_fields["tracking_no"] = $trkno_array[$i]; - $po->column_fields["duedate"] = $duedate_array[$i]; - - $po->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $po->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $po->column_fields["bill_state"] = "CA"; - $po->column_fields["bill_code"] = rand(10000, 99999); - $po->column_fields["bill_country"] = 'USA'; - - $po->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $po->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $po->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $po->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $po->column_fields["ship_country"] = $account->column_fields["bill_country"]; - - - $po->save("PurchaseOrder"); - - $purchaseorder_ids[] = $po->id; - - $product_key = array_rand($product_ids); - $productid = $product_ids[$product_key]; - - //set the inventory product details in request then just call the saveInventoryProductDetails function - $_REQUEST['totalProductCount'] = 1; - - $_REQUEST['hdnProductId1'] = $productid; - $_REQUEST['qty1'] = $qty = 1; - $_REQUEST['listPrice1'] = $listprice = 2200; - $_REQUEST['comment1'] = "This is test comment for product of PurchaseOrder"; - - $_REQUEST['deleted1'] = 0; - $_REQUEST['discount_type1'] = 'amount'; - $_REQUEST['discount_amount1'] = $discount_amount = '200'; - - $_REQUEST['taxtype'] = $taxtype = 'individual'; - $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; - $_REQUEST['discount_type_final'] = 'amount'; - $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; - - $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; - $_REQUEST['adjustmenttype'] = '+'; - $_REQUEST['adjustment'] = $adjustment = '100'; - - $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; - - //Upto this added to set the request values which will be used to save the inventory product details - - //Now call the saveInventoryProductDetails function - saveInventoryProductDetails(&$po, 'PurchaseOrder'); - - -} - -//Populate Invoice Data - -$isubj_array = array ("vtiger_invoice201", "zoho_inv7841", "vtiger5usrp_invoice71134", "vt100usrpk_inv113", "vendtl_inv214"); -$istatus_array = array ("Created", "Sent", "Approved" , "Credit Invoice", "Paid"); -$itotal_array = array ("4842.000", "4842.000", "4842.000", "4842.000", "4842.000"); - -for($i=0;$i<5;$i++) -{ - $invoice = new Invoice(); - - $invoice->column_fields["assigned_user_id"] = $assigned_user_id; - $account_key = array_rand($account_ids); - $invoice->column_fields["account_id"] = $account_ids[$account_key]; - $so_key = array_rand($salesorder_ids); - $invoice->column_fields["salesorder_id"] = $salesorder_ids[$so_key]; - $contact_key = array_rand($contact_ids); - $invoice->column_fields["contactid"] = $contact_ids[$contact_key]; - $rand = array_rand($num_array); - $invoice->column_fields["subject"] = $isubj_array[$i]; - $invoice->column_fields["invoicestatus"] = $istatus_array[$i]; - $invoice->column_fields["hdnGrandTotal"] = $itotal_array[$i]; - - $invoice->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $invoice->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $invoice->column_fields["bill_state"] = "CA"; - $invoice->column_fields["bill_code"] = rand(10000, 99999); - $invoice->column_fields["bill_country"] = 'USA'; - - $invoice->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $invoice->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $invoice->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $invoice->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $invoice->column_fields["ship_country"] = $account->column_fields["bill_country"]; - - - $invoice->save("Invoice"); - - $invoice_ids[] = $invoice->id; - if ($i > 3) - { - $freetag = $adb->getUniqueId('vtiger_freetags'); - $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[0]', '$cloudtag[0]')"; - $res_inv = $adb->query($query); - - $date = $adb->formatDate(date('YmdHis')); - $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$invoice->id.", $date, 'Invoice')"; - $result_inv = $adb->query($query_tag); - } - - $product_key = array_rand($product_ids); - $productid = $product_ids[$product_key]; - - //set the inventory product details in request then just call the saveInventoryProductDetails function - $_REQUEST['totalProductCount'] = 1; - - $_REQUEST['hdnProductId1'] = $productid; - $_REQUEST['qty1'] = $qty = 1; - $_REQUEST['listPrice1'] = $listprice = 4300; - $_REQUEST['comment1'] = "This is test comment for product of Invoice"; - - $_REQUEST['deleted1'] = 0; - $_REQUEST['discount_type1'] = 'amount'; - $_REQUEST['discount_amount1'] = $discount_amount = '300'; - - $_REQUEST['taxtype'] = $taxtype = 'individual'; - $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; - $_REQUEST['discount_type_final'] = 'amount'; - $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; - - $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; - $_REQUEST['adjustmenttype'] = '+'; - $_REQUEST['adjustment'] = $adjustment = '100'; - - $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; - - //Upto this added to set the request values which will be used to save the inventory product details - - //Now call the saveInventoryProductDetails function - saveInventoryProductDetails(&$invoice, 'Invoice'); - -} - -//Populate RSS Data - - - - -//Populate Email Data - -$esubj_array = array ("Vtiger 5 Released", "Try vtigercrm!", "Hi There!!!", "Welcome to Open Source", "Help needed in customization of Vtiger"); -$startdate_array = array ("2006-1-2","2003-3-4","2003-4-5","2001-2-1","2005-8-8"); -$filename_array = array ("vtiger5alpha.tar.gz", "zohowriter.zip", "hi.doc", "welcome.pps", "sos.doc"); - -$to_array = array("a at a.com","b at b.com", "tester at testvtiger.com","xanth at yaz.com","violet at bing.com"); -$cc_array = array("andrewa at a.com","casterb at b.com", "indomine at variancevtiger.com","becker at nosbest.com","electra at violet.com"); -$bcc_array = array("nathan at nathantests.com","jeff at karl1.com", "isotope at uranium.com","bunny at bugs.com","explosive at dud.com"); -$from_array = array("harvest at zss.com","rain at sunshine.com", "gloom at rainyday.com"); -$body_array = array("This is a good product! Have a go at it! ","Nice to have you visit us, very nice of you. Stay for sometime and have a look at our product. I am sure you will like it", "This will take some time to fix. Can you provide me more details please?","What a cool tool! I wish I had found it earlier. Oh it has a lot of my friends name in it too! I too can contribute. But how?","Urgent. I need this done last week! Guys, you are the ones I am depending on. Do something!"); - -for($i=0;$i<5;$i++) -{ - $email = new Email(); - - $email->column_fields["assigned_user_id"] = $assigned_user_id; - - $rand = array_rand($num_array); - $email->column_fields["subject"] = $esubj_array[$i]; - $email->column_fields["filename"] = $filename_array[$i]; - $email->column_fields["date_start"] = $startdate_array[$i]; - $email->column_fields["semodule"] = 'Tasks'; - $email->column_fields["activitytype"] = 'Emails'; - $email->column_fields["description"] = $body_array[$i]; - $email->save("Emails"); - $email_ids[] = $email->id; - - $query = "insert into vtiger_emaildetails(emailid,from_email,to_email,cc_email,bcc_email) values (".$email->id.", '".$from_array[$i]."', '".$to_array[$i]."','".$cc_array[$i]."','".$bcc_array[$i] ."')"; - $res = $adb->query($query); -} - - -//Populate PriceBook data - -$PB_array = array ("Cd-R PB", "Vtiger PB", "Gator PB", "Kyple PB", "Pastor PB", "Zoho PB", "PB_100", "Per_PB", "CST_PB", "GATE_PB", "Chevron_PB", "Pizza_PB"); -$Active_array = array ("0", "1", "1", "0", "1","0", "1", "1", "0", "1","0","1"); - -//$num_array = array(0,1,2,3,4); -for($i=0;$i<12;$i++) -{ - $pricebook = new PriceBook(); - - $rand = array_rand($num_array); - $pricebook->column_fields["bookname"] = $PB_array[$i]; - $pricebook->column_fields["active"] = $Active_array[$i]; - - $pricebook->save("PriceBooks"); - $pricebook_ids[] = $pricebook ->id; -} - - -//Populate Notes Data - -$notes_array = array ("Cont_Notes", "Prod_Notes", "Vendor_Notes", "Invoice_Notes", "Task_Notes", "Event_Notes", "Email_Notes"); - -for($i=0;$i<7;$i++) -{ - $notes = new Note(); - - $rand = array_rand($num_array); - $contact_key = array_rand($contact_ids); - $notes->column_fields["contact_id"] = $contact_ids[$contact_key]; - $notes->column_fields["notes_title"] = $notes_array[$i]; - - $notes->save("Notes"); - $notes_ids[] = $notes ->id; - - $product_key = array_rand($product_ids); - $query = "insert into vtiger_senotesrel (crmid, notesid) values (".$product_ids[$product_key].", ".$notes->id.")"; - $db->query($query); - -} - - - -// Populate Ticket data - - -//$severity_array=array("Minor","Major","Critical",""); -$status_array=array("Open","In Progress","Wait For Response","Open","Closed"); -$category_array=array("Big Problem ","Small Problem","Other Problem","Small Problem","Other Problem"); -$ticket_title_array=array("Upload Attachment problem", - "Individual Customization -Menu and RSS","Export Output query", - "Import Error CSV Leads","How to automatically add a lead from a web form to VTiger"); - -for($i=0;$i<5;$i++) -{ - $helpdesk= new HelpDesk(); - - $rand=array_rand($num_array); - $contact_key = array_rand($contact_ids); - $helpdesk->column_fields["parent_id"] = $contact_ids[$contact_key]; - - $helpdesk->column_fields["ticketpriorities"]= "Normal"; - $helpdesk->column_fields["product_id"] = $product_ids[$i]; - - $helpdesk->column_fields["ticketseverities"] = "Minor"; - $helpdesk->column_fields["ticketstatus"] = $status_array[$i]; - $helpdesk->column_fields["ticketcategories"] = $category_array[$i]; - //$rand_key = array_rand($s);$contact_key = array_rand($contact_ids); - $notes->column_fields["contact_id"] = $contact_ids[$contact_key]; - $helpdesk->column_fields["ticket_title"] = $ticket_title_array[$i]; - $helpdesk->column_fields["assigned_user_id"] = $assigned_user_id; - - $helpdesk->save("HelpDesk"); - $helpdesk_ids[] = $helpdesk->id; - - if ($i > 3) - { - $freetag = $adb->getUniqueId('vtiger_freetags'); - $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[3]', '$cloudtag[3]')"; - $res_tkt = $adb->query($query); - - $date = $adb->formatDate(date('YmdHis')); - $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$helpdesk->id.", $date, 'HelpDesk')"; - $result_tkt = $adb->query($query_tag); - } - -} - -// Populate Activities Data -$task_array=array("Tele Conference","Call user - John","Send Fax to Mary Smith"); -$event_array=array("","","Call Smith","Team Meeting","Call Richie","Meeting with Don"); -$task_status_array=array("Planned","In Progress","Completed"); -$task_priority_array=array("High","Medium","Low"); -$visibility=array("","","Private","Public","Private","Public"); - -for($i=0;$i<6;$i++) -{ - $event = new Activity(); - - $rand_num=array_rand($num_array); - - $rand_date = & create_date(); - $en=explode("-",$rand_date); - if($en[1]<10) - $en[1]="0".$en[1]; - if($en[2]<10) - $en[2]="0".$en[2]; - $recur_daily_date=date('Y-m-d',mktime(0,0,0,date($en[1]),date($en[2])+5,date($en[0]))); - $recur_week_date=date('Y-m-d',mktime(0,0,0,date($en[1]),date($en[2])+30,date($en[0]))); - - - $start_time_hr=rand(00,23); - $start_time_min=rand(00,59); - $end_time_hr=rand(00,23); - $end_time_min=rand(00,59); - if($start_time_hr<10) - $start_time_hr="0".$start_time_hr; - if($start_time_min<10) - $start_time_min="0".$start_time_min; - if($end_time_hr<10) - $end_time_hr="0".$end_time_hr; - if($end_time_min<10) - $end_time_min="0".$end_time_min; - $end_time=$end_time_hr.":".$end_time_min; - $start_time=$start_time_hr.":".$start_time_min; - if($i<2) - { - $event->column_fields["subject"] = $task_array[$i]; - if($i==1) - { - $account_key = array_rand($account_ids); - $event->column_fields["parent_id"] = $account_ids[$account_key];; - } - $event->column_fields["taskstatus"] = $task_status_array[$i]; - $event->column_fields["taskpriority"] = $task_priority_array[$i]; - $event->column_fields["activitytype"] = "Task"; - $event->column_fields["visibility"] = $visibility[$i]; - - } - else - { - $event->column_fields["subject"] = $event_array[$i]; - $event->column_fields["visibility"] = $visibility[$i]; - $event->column_fields["duration_hours"] = rand(0,3); - $event->column_fields["duration_minutes"]= rand(0,59); - $event->column_fields["eventstatus"] = "Planned"; - $event->column_fields["time_end"] = $end_time; - } - $event->column_fields["date_start"] = $rand_date; - $_REQUEST["date_start"] = $rand_date; - $event->column_fields["time_start"] = $start_time; - $event->column_fields["due_date"] = $rand_date; - $_REQUEST["due_date"] = $rand_date; - $contact_key = array_rand($contact_ids); - $event->column_fields["contact_id"] = $contact_ids[$contact_key]; - if($i==4) - { - $event->column_fields["recurringtype"] = "Daily"; - $_REQUEST["recurringtype"] = "Daily"; - $event->column_fields["activitytype"] = "Meeting"; - $event->column_fields["due_date"] = $recur_daily_date; - } - elseif($i==5) - { - $event->column_fields["recurringtype"] = "Weekly"; - $_REQUEST["recurringtype"] = "Weekly"; - $event->column_fields["activitytype"] = "Meeting"; - $event->column_fields["due_date"] = $recur_week_date; - } - elseif($i>1) - { - $event->column_fields["activitytype"] = "Call"; - } - $event->column_fields["assigned_user_id"] = $assigned_user_id; - $event->save("Calendar"); - $event_ids[] = $event->id; - -} - - -$adb->query("update vtiger_crmentity set smcreatorid=".$assigned_user_id); - -$expected_revenue = Array("250000","750000","500000"); -$budget_cost = Array("25000","50000","90000"); -$actual_cost = Array("23500","45000","80000"); -$num_sent = Array("2000","2500","3000"); -$clo_date = Array('2003-1-2','2004-2-3','2005-4-12'); - -$expected_response_count = Array("2500","7500","5000"); -$expected_sales_count = Array("25000","50000","90000"); -$expected_roi = Array("23","45","82"); - -$actual_response_count = Array("250","750","1500"); -$actual_sales_count = Array("1250","5200","2390"); -$actual_roi = Array("21","14","12"); - -$sponsor = Array("Finace","Marketing","Sales"); -$targetsize = Array("210000","13390","187424"); -$targetaudience = Array("Managers","CEOs","Rookies"); - -//$expected_response = Array(null,null,null); -for($i=0;$icolumn_fields["campaignname"] = $campaign_name; - $campaign->column_fields["campaigntype"] = $campaign_type_array[$i]; - $campaign->column_fields["campaignstatus"] = $campaign_status_array[$i]; - $campaign->column_fields["numsent"] = $num_sent[$i]; - $campaign->column_fields["expectedrevenue"] = $expected_revenue[$i]; - $campaign->column_fields["budgetcost"] = $budget_cost[$i]; - $campaign->column_fields["actualcost"] = $actual_cost[$i]; - $campaign->column_fields["closingdate"] = $clo_date[$i]; - $campaign->column_fields["expectedresponse"] = $expected_response[$i]; - $campaign->column_fields["assigned_user_id"] = $assigned_user_id; - - $campaign->column_fields["expectedresponsecount"] = $expected_response_count[$i]; - $campaign->column_fields["expectedsalescount"] = $expected_sales_count[$i]; - $campaign->column_fields["expectedroi"] = $expected_roi[$i]; - $campaign->column_fields["actualresponsecount"] = $actual_response_count[$i]; - $campaign->column_fields["actualsalescount"] = $actual_sales_count[$i]; - $campaign->column_fields["actualroi"] = $actual_roi[$i]; - $campaign->column_fields["sponsor"] = $sponsor[$i]; - $campaign->column_fields["targetsize"] = $targetsize[$i]; - $campaign->column_fields["targetaudience"] = $targetaudience[$i]; - - - - $campaign->save("Campaigns"); -} - -//Populate My Sites Data - -$portalname = array ("Vtiger", "Vtiger Blogs", "Vtiger Forums", "VtigerForge", "Vtiger Docs"); -$portalurl = array ("http://vtiger.com", "http://blogs.vtiger.com", "http://forums.vtiger.com", "http://vtigerforge.com", "http://wiki.vtiger.com"); - -for($i=0;$i<5;$i++) -{ - $portalid = $adb->getUniqueId('vtiger_portal'); - $portal_qry = "insert into vtiger_portal values (".$portalid.", '".$portalname[$i]."','".$portalurl[$i]."',0)"; - $result_qry = $adb->query($portal_qry); -} - -//Populate RSS Data -$rssname = array("vtiger - Forums","vtiger development - Active Tickets"); -$rssurl = array("http://forums.vtiger.com/rss.php?name=forums&file=rss","http://vtiger.fosslabs.com/cgi-bin/trac.cgi/report/1?format=rss&USER=anonymous"); - -for($i=0;$i<2;$i++) -{ - $rssid = $adb->getUniqueId('vtiger_rss'); - $rss_qry = "insert into vtiger_rss values (".$rssid.", '".$rssurl[$i]."','".$rssname[$i]."',0,0)"; - $result_qry = $adb->query($rss_qry); -} -?> +println("PSD dumping started"); + +$account_ids = Array(); +$opportunity_ids = Array(); +$vendor_ids = Array(); +$contact_ids = Array(); +$product_ids = Array(); +$pricebook_ids = Array(); +$quote_ids = Array(); +$salesorder_ids = Array(); +$purchaseorder_ids = Array(); +$invoice_ids = Array(); +$email_ids = Array(); + +// Determine the assigned user for all demo data. This is the default user if set, or admin +$assigned_user_name = "admin"; +if(isset($default_user_name) && $default_user_name != '' && isset($create_default_user) && $create_default_user) +{ + $assigned_user_name = $default_user_name; +} + +// Look up the user id for the assigned user +$seed_user = new Users(); + +//$adb->println("PSD assignname=".$assigned_user_name); + +$assigned_user_id = $seed_user->retrieve_user_id($assigned_user_name); + +global $current_user; + +$current_user = new Users(); +$result = $current_user->retrieve_entity_info($assigned_user_id,'Users'); + +$tagkey = 1; + +// Get _dom arrays +$comboFieldNames = Array('leadsource'=>'leadsource_dom' + ,'leadstatus'=>'lead_status_dom' + ,'industry'=>'industry_dom' + ,'rating'=>'rating_dom' + ,'opportunity_type'=>'opportunity_type_dom' + ,'sales_stage'=>'sales_stage_dom'); +$comboFieldArray = getComboArray($comboFieldNames); + +//$adb->println("PSD assignid=".$assigned_user_id); +$adb->println("company_name_array"); +$adb->println($company_name_array); + +$cloudtag = Array ('SO_vendtl', 'X-CEED', 'X-CEED', 'vtiger_50usr'); + +for($i = 0; $i < $company_name_count; $i++) +{ + + $account_name = $company_name_array[$i]; + + // Create new accounts. + $account = new Accounts(); + $account->column_fields["accountname"] = $account_name; + $account->column_fields["phone"] = create_phone_number(); + $account->column_fields["assigned_user_id"] = $assigned_user_id; + + $whitespace = array(" ", ".", "&", "\/"); + $website = str_replace($whitespace, "", strtolower($account->column_fields["accountname"])); + $account->column_fields["website"] = "www.".$website.".com"; + + $account->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $account->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $account->column_fields["bill_state"] = "CA"; + $account->column_fields["bill_code"] = rand(10000, 99999); + $account->column_fields["bill_country"] = 'USA'; + + $account->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $account->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $account->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $account->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $account->column_fields["ship_country"] = $account->column_fields["bill_country"]; + +// $key = array_rand($app_list_strings['industry_dom']); +// $account->industry = $app_list_strings['industry_dom'][$key]; + $key = array_rand($comboFieldArray['industry_dom']); + $account->column_fields["industry"] = $comboFieldArray['industry_dom'][$key]; + + $account->column_fields["account_type"] = "Customer"; + + //$account->saveentity("Accounts"); + $account->save("Accounts"); + + $account_ids[] = $account->id; + + if ($i > 3) + { + $freetag = $adb->getUniqueId('vtiger_freetags'); + $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[1]', '$cloudtag[1]')"; + $res = $adb->query($query); + + $date = $adb->formatDate(date('YmdHis')); + $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$account->id.", $date, 'Accounts')"; + $result = $adb->query($query_tag); + } + + +// $adb->println("PSD Account [".$account->id."] - ".$account_name); + + +//Create new opportunities + $opp = new Potentials(); + + $opp->column_fields["assigned_user_id"] = $assigned_user_id; + $opp->column_fields["potentialname"] = $account_name." - 1000 units"; + $opp->column_fields["closingdate"] = & create_date(); + +// $key = array_rand($app_list_strings['lead_source_dom']); +// $opp->lead_source = $app_list_strings['lead_source_dom'][$key]; + $key = array_rand($comboFieldArray['leadsource_dom']); + $opp->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; + +// $key = array_rand($app_list_strings['sales_stage_dom']); +// $opp->sales_stage = $app_list_strings['sales_stage_dom'][$key]; + $comboSalesStageArray = Array ("Closed Won"); + $key = array_rand($comboSalesStageArray); + $opp->column_fields["sales_stage"] = $comboSalesStageArray[$key]; + +// $key = array_rand($app_list_strings['opportunity_type_dom']); +// $opp->opportunity_type = $app_list_strings['opportunity_type_dom'][$key]; + $key = array_rand($comboFieldArray['opportunity_type_dom']); + $opp->column_fields["opportunity_type"] = $comboFieldArray['opportunity_type_dom'][$key]; + + $amount = array("10000", "25000", "50000", "75000"); + $key = array_rand($amount); + $opp->column_fields["amount"] = $amount[$key]; + $opp->column_fields["account_id"] = $account->id; + + //$opp->saveentity("Potentials"); + $opp->save("Potentials"); + + $opportunity_ids[] = $opp->id; + +// $adb->println("PSD Potential [".$opp->id."] - account[".$account->id."]"); + +} + + +for($i=0; $i<10; $i++) +{ + $contact = new Contacts(); + $contact->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i])); + $contact->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i])); + $contact->column_fields["assigned_user_id"] = $assigned_user_id; + + $contact->column_fields["email"] = strtolower($contact->column_fields["firstname"])."_".strtolower($contact->column_fields["lastname"])."@company.com"; + + $contact->column_fields["phone"] = create_phone_number(); + $contact->column_fields["homephone"] = create_phone_number(); + $contact->column_fields["mobile"] = create_phone_number(); + + // Fill in a bogus address + $key = array_rand($street_address_array); + $contact->column_fields["mailingstreet"] = $street_address_array[$key]; + $key = array_rand($city_array); + $contact->column_fields["mailingcity"] = $city_array[$key]; + $contact->column_fields["mailingstate"] = "CA"; + $contact->column_fields["mailingzip"] = '99999'; + $contact->column_fields["mailingcountry"] = 'USA'; + if ($contact->column_fields["mailingcity"] == "San Mateo") + $contact->column_fields["yahooid"] = "clint_oram"; + elseif ($contact->column_fields["mailingcity"] == "San Francisco") + $contact->column_fields["yahooid"] = "not_a_real_id"; + +// $key = array_rand($app_list_strings['lead_source_dom']); +// $contact->lead_source = $app_list_strings['lead_source_dom'][$key]; + $key = array_rand($comboFieldArray['leadsource_dom']); + $contact->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; + + $titles = array("President", + "VP Operations", + "VP Sales", + "Director Operations", + "Director Sales", + "Mgr Operations", + "IT Developer", + ""); + $key = array_rand($titles); + $contact->column_fields["title"] = $titles[$key]; + + $account_key = array_rand($account_ids); + $contact->column_fields["account_id"] = $account_ids[$account_key]; + + //$contact->saveentity("Contacts"); + $contact->save("Contacts"); + $contact_ids[] = $contact->id; + + + if ($i > 8) + { + $freetag = $adb->getUniqueId('vtiger_freetags'); + $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[2]', '$cloudtag[2]')"; + $res1 = $adb->query($query); + + $date = $adb->formatDate(date('YmdHis')); + $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$contact->id.", $date, 'Contacts')"; + $result1 = $adb->query($query_tag); + } + // This assumes that there will be one opportunity per company in the seed data. + $opportunity_key = array_rand($opportunity_ids); + //$query = "insert into opportunities_contacts set id='".create_guid()."', contact_id='$contact->id', contact_role='".$app_list_strings['opportunity_relationship_type_default_key']."', opportunity_id='".$opportunity_ids[$opportunity_key]."'"; + //$db->query($query, true, "unable to create seed links between opportunities and contacts"); + + $query = "insert into vtiger_contpotentialrel ( contactid, potentialid ) values (".$contact->id.",".$opportunity_ids[$opportunity_key].")"; + $db->query($query); + +// $adb->println("PSD Contact [".$contact->id."] - account[".$account_ids[$account_key]."] - potential[".$opportunity_ids[$opportunity_key]."]"); + + //Create new tasks + /*$task = new Task(); + + $key = array_rand($task->default_task_name_values); + $task->name = $task->default_task_name_values[$key]; + $task->date_due = & create_date(); + $task->time_due = date("H:i:s",time()); + $task->date_due_flag = 'off'; + $task->assigned_user_id = $assigned_user_id; + + $key = array_rand($app_list_strings['task_status_dom']); + $task->status = $app_list_strings['task_status_dom'][$key]; + $task->contact_id = $contact->id; + if ($contact->primary_address_city == "San Mateo") { + $task->parent_id = $account_ids[$account_key]; + $task->parent_type = 'Accounts'; + $task->save(); + }*/ + +} + + $company_count=0; +for($i=0; $i<10; $i++) +{ + $lead = new Leads(); + $lead->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i])); + $lead->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i])); + + if($i<5) + { + $lead->column_fields["company"] = ucfirst(strtolower($company_name_array[$i])); + } + else + { + $lead->column_fields["company"] = ucfirst(strtolower($company_name_array[$company_count])); + $company_count++; + } + + $lead->column_fields["assigned_user_id"] = $assigned_user_id; + + $lead->column_fields["email"] = strtolower($lead->column_fields["firstname"])."_".strtolower($lead->column_fields["lastname"])."@company.com"; + + $website = str_replace($whitespace, "", strtolower(ucfirst(strtolower($company_name_array[$i])))); + $lead->column_fields["website"] = "www.".$website.".com"; + + $lead->column_fields["phone"] = create_phone_number(); + $lead->column_fields["mobile"] = create_phone_number(); + + // Fill in a bogus address + $key = array_rand($street_address_array); + //$lead->address_street = $street_address_array[$key]; + $lead->column_fields["lane"] = $street_address_array[$key]; + $key = array_rand($city_array); + $lead->column_fields["city"] = $city_array[$key]; + $lead->column_fields["state"] = "CA"; + $lead->column_fields["code"] = '99999'; + $lead->column_fields["country"] = 'USA'; + if ($lead->column_fields["city"] == "San Mateo") + $lead->column_fields["yahooid"] = "clint_oram"; + elseif ($lead->column_fields["city"] == "San Francisco") + $lead->column_fields["yahooid"] = "not_a_real_id"; + +// $key = array_rand($app_list_strings['lead_source_dom']); +// $lead->lead_source = $app_list_strings['lead_source_dom'][$key]; + $key = array_rand($comboFieldArray['leadsource_dom']); + $lead->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; + +// $key = array_rand($app_list_strings['lead_status_dom']); +// $lead->lead_status = $app_list_strings['lead_status_dom'][$key]; + $key = array_rand($comboFieldArray['lead_status_dom']); + $lead->column_fields["leadstatus"] = $comboFieldArray['lead_status_dom'][$key]; + +// $key = array_rand($app_list_strings['rating_dom']); +// $lead->rating = $app_list_strings['rating_dom'][$key]; + $key = array_rand($comboFieldArray['rating_dom']); + $lead->column_fields["rating"] = $comboFieldArray['rating_dom'][$key]; + + $titles = array("President", + "VP Operations", + "VP Sales", + "Director Operations", + "Director Sales", + "Mgr Operations", + "IT Developer", + ""); + $key = array_rand($titles); + $lead->column_fields["designation"] = $titles[$key]; + + //$lead->saveentity("Leads"); + $lead->save("Leads"); + +// $adb->println("PSD Lead [".$lead->id."] - name=".$lead->column_fields["lastname"]); + +} + +// Temp fix since user is not logged in while populating data updating creatorid in crmentity - GS + + +//Populating Vendor Data +for($i=0; $i<10; $i++) +{ + $vendor = new Vendors(); + $vendor->column_fields["vendorname"] = ucfirst(strtolower($first_name_array[$i])); + $vendor->column_fields["phone"] = create_phone_number(); + $vendor->column_fields["email"] = strtolower($vendor->column_fields["vendorname"])."@company.com"; + $website = str_replace($whitespace, "", strtolower(ucfirst(strtolower($company_name_array[$i])))); + $vendor->column_fields["website"] = "www.".$website.".com"; + + $vendor->column_fields["assigned_user_id"] = $assigned_user_id; + + + + // Fill in a bogus address + $vendor->column_fields["street"] = $street_address_array[rand(0,$street_address_count-1)]; + $key = array_rand($city_array); + $vendor->column_fields["city"] = $city_array[$key]; + $vendor->column_fields["state"] = "CA"; + $vendor->column_fields["postalcode"] = '99999'; + $vendor->column_fields["country"] = 'USA'; + + $vendor->save("Vendors"); + $vendor_ids[] = $vendor->id; + + +} + + +//Populating Product Data + +$product_name_array= array( "Vtiger Single User Pack", "Vtiger 5 Users Pack", "Vtiger 10 Users Pack", + "Vtiger 25 Users Pack", "Vtiger 50 Users Pack", "Double Panel See-thru Clipboard", + "abcd1234", "Cd-R CD Recordable", "Sharp - Plain Paper Fax" , "Brother Ink Jet Cartridge"); +$product_code_array= array("001","002","003","023","005","sg-106","1324356","sg-108","sg-119","sg-125"); +$subscription_rate=array("149","699","1299","2999","4995"); +//added by jeri to populate product images +$product_image_array = array("product1.jpeg###","product2.jpeg###product3.jpeg###","product4.jpeg###product5.jpeg###product6 +.jpeg###","product7.jpeg###product8.jpeg###product9.jpeg###product10.jpeg###"); +for($i=0; $i<10; $i++) +{ + $product = new Products(); + if($i>4) + { + $parent_key = array_rand($opportunity_ids); + $product->column_fields["parent_id"]=$opportunity_ids[$parent_key]; + + $usageunit = "Each"; + $qty_per_unit = 1; + $qty_in_stock = rand(10000, 99999); + $category = "Hardware"; + $website = ""; + $manufacturer = ""; + $commission_rate= rand(10,20); + $unit_price = rand(100,999); + $product_image_name = ''; + } + else + { + $account_key = array_rand($account_ids); + $product->column_fields["parent_id"]=$account_ids[$account_key]; + + $usageunit = "Each"; + $qty_per_unit = 1; + $qty_in_stock = rand(10000, 99999); + $category = "Software"; + $website = "www.vtiger.com"; + $manufacturer = "vtiger"; + $commission_rate= rand(1,10); + $unit_price = $subscription_rate[$i]; + $product_image_name = $product_image_array[$i]; + } + + $product->column_fields["productname"] = $product_name_array[$i]; + $product->column_fields["productcode"] = $product_code_array[$i]; + $product->column_fields["manufacturer"] = $manufacturer; + + $product->column_fields["productcategory"] = $category; + $product->column_fields["website"] = $website; + $product->column_fields["productsheet"] = ""; + + $vendor_key = array_rand($vendor_ids); + $product->column_fields["vendor_id"] = $vendor_ids[$vendor_key]; + $contact_key = array_rand($contact_ids); + $product->column_fields["contact_id"] = $contact_ids[$contact_key]; + + $product->column_fields["start_date"] = & create_date(); + $product->column_fields["sales_start_date"] = & create_date(); + + $product->column_fields["unit_price"] = $unit_price; + $product->column_fields["commissionrate"] = $commission_rate; + $product->column_fields["taxclass"] = 'SalesTax'; + $product->column_fields["usageunit"] = $usageunit; + $product->column_fields["qty_per_unit"] = $qty_per_unit; + $product->column_fields["qtyinstock"] = $qty_in_stock; + $product->column_fields["imagename"] = $product_image_name; + + $product->save("Products"); + $product_ids[] = $product ->id; +} + + +//Populating HelpDesk- FAQ Data + + $status_array=array ("Draft","Reviewed","Published","Draft","Reviewed","Draft","Reviewed","Draft","Reviewed","Draft","Reviewed","Draft"); + $question_array=array ( + "How to migrate data from previous versions to the latest version?", + "Error message: The file is damaged and could not be repaired.", + "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose No when trying to add Email to vitger CRM ", + "When trying to merge a template with a contact, First I was asked allow installation of ActiveX control. I accepted. After it appears a message that it will not be installed because it can't verify the publisher. Do you have a workarround for this issue ?", + " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", + "How to migrate data from previous versions to the latest version?", + "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose No when trying to add Email to vitger CRM ", + " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", + "Error message: The file is damaged and could not be repaired.", + "When trying to merge a template with a contact, First I was asked allow installation of ActiveX control. I accepted. After it appears a message that it will not be installed because it can't verify the publisher. Do you have a workarround for this issue ?", + " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", + "How to migrate data from previous versions to the latest version?", + + ); + + + $answer_array=array ( + "Database migration scripts are available to migrate from the following versions: + + 1.0 to 2.0 + + 2.0 to 2.1 + + 2.1 to 3.0 + + 3.0 to 3.2 + + 3.2 to 4.0 + + 4.0 to 4.0.1 + + 4.0.1 to 4.2", + + "The above error message is due to version incompatibility between FPDF and PHP5. Use PHP 4.3.X version","Published", + "The above error message is displayed if you have installed the Microsoft(R) Outlook(R) E-mail Security Update. Please refer to the following URL for complete details: + +http://support.microsoft.com/default.aspx?scid=kb%3BEN-US%3B263074 + +If you want to continue working with vtiger Outlook Plug-in, select the Allow access for check box and select the time from drop-down box.", + " Since, vtigerCRM & all plugins are open source, it is not signed up with third party vendors and IE will ask to download even though the plugin are not signed. + +This message if produced by Microsoft Windows XP. I English Windows XP with the SP2 and the last updates. I told IE to accept installation of the ActiveX, but after it, this message has appeared. Provably there is a place where to tall to WinXP to not validate if the code is signed... but I don\'t know where. + +In IE from Tools->Internet Options->Security->Custom Level, there you can see various options for downloading plugins which are not signed and you can adjust according to your need, so relax your security settings for a while and give a try to vtiger Office Plugin.", + "Before modifying any templates, please ensure that you don\'t have any documents open and only one instance of word is available in your memory." + ); + +$num_array=array(0,1,2,3,4,6,7,8,9,10,11,12); +for($i=0;$i<12;$i++) +{ + + $faq = new Faq(); + + $rand=array_rand($num_array); + $faq->column_fields["product_id"] = $product_ids[$i]; + $faq->column_fields["faqcategories"] = "General"; + $faq->column_fields["faqstatus"] = $status_array[$i]; + $faq->column_fields["question"] = $question_array[$i]; + $faq->column_fields["faq_answer"] = $answer_array[$i]; + + $faq->save("Faq"); + $faq_ids[] = $faq ->id; +} + +//Populate Quote Data + +$sub_array = array ("Prod_Quote", "Cont_Quote", "SO_Quote", "PO_Quote", "Vendor_Quote"); +$stage_array = array ("Created", "Reviewed", "Delivered", "Accepted" , "Rejected"); +$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); +$validtill_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); +for($i=0;$i<5;$i++) +{ + $quote = new Quotes(); + + $quote->column_fields["assigned_user_id"] = $assigned_user_id; + $account_key = array_rand($account_ids); + $quote->column_fields["account_id"] = $account_ids[$account_key]; + $op_key = array_rand($opportunity_ids); + $quote->column_fields["potential_id"] = $opportunity_ids[$op_key]; + $contact_key = array_rand($contact_ids); + $quote->column_fields["contact_id"] = $contact_ids[$contact_key]; + $rand = array_rand($num_array); + $quote->column_fields["subject"] = $sub_array[$i]; + $quote->column_fields["quotestage"] = $stage_array[$i]; + $quote->column_fields["carrier"] = $carrier_array[$i]; + $quote->column_fields["validtill"] = $validtill_array[$i]; + + $quote->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $quote->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $quote->column_fields["bill_state"] = "CA"; + $quote->column_fields["bill_code"] = rand(10000, 99999); + $quote->column_fields["bill_country"] = 'USA'; + + $quote->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $quote->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $quote->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $quote->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $quote->column_fields["ship_country"] = $account->column_fields["bill_country"]; + + + $quote->save("Quotes"); + + $quote_ids[] = $quote->id; + + $product_key = array_rand($product_ids); + $productid = $product_ids[$product_key]; + + //set the inventory product details in request then just call the saveInventoryProductDetails function + $_REQUEST['totalProductCount'] = 1; + + $_REQUEST['hdnProductId1'] = $productid; + $_REQUEST['qty1'] = $qty = 1; + $_REQUEST['listPrice1'] = $listprice = 130; + $_REQUEST['comment1'] = "This is test comment for product of Quotes"; + + $_REQUEST['deleted1'] = 0; + $_REQUEST['discount_type1'] = 'amount'; + $_REQUEST['discount_amount1'] = $discount_amount = '20'; + + $_REQUEST['taxtype'] = $taxtype = 'individual'; + $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; + $_REQUEST['discount_type_final'] = 'amount'; + $_REQUEST['discount_amount_final'] = $discount_amount_final = '10'; + + $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; + $_REQUEST['adjustmenttype'] = '+'; + $_REQUEST['adjustment'] = $adjustment = '10'; + + $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; + + //Upto this added to set the request values which will be used to save the inventory product details + + //Now call the saveInventoryProductDetails function + saveInventoryProductDetails(&$quote, 'Quotes'); +} + +//Populate SalesOrder Data + +$subj_array = array ("SO_vtiger", "SO_zoho", "SO_vtiger5usrp", "SO_vt100usrpk", "SO_vendtl"); +$status_array = array ("Created", "Delivered", "Approved" , "Cancelled" , "Created"); +$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); +$duedate_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); + +for($i=0;$i<5;$i++) +{ + $so = new SalesOrder(); + + $so->column_fields["assigned_user_id"] = $assigned_user_id; + $account_key = array_rand($account_ids); + $so->column_fields["account_id"] = $account_ids[$account_key]; + $quote_key = array_rand($quote_ids); + $so->column_fields["quote_id"] = $quote_ids[$quote_key]; + $contact_key = array_rand($contact_ids); + $so->column_fields["contact_id"] = $contact_ids[$contact_key]; + $rand = array_rand($num_array); + $so->column_fields["subject"] = $subj_array[$i]; + $so->column_fields["sostatus"] = $status_array[$i]; + $so->column_fields["hdnGrandTotal"] = $sototal_array[$i]; + $so->column_fields["carrier"] = $carrier_array[$i]; + $so->column_fields["duedate"] = $duedate_array[$i]; + + $so->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $so->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $so->column_fields["bill_state"] = "CA"; + $so->column_fields["bill_code"] = rand(10000, 99999); + $so->column_fields["bill_country"] = 'USA'; + + $so->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $so->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $so->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $so->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $so->column_fields["ship_country"] = $account->column_fields["bill_country"]; + + + $so->save("SalesOrder"); + + $salesorder_ids[] = $so->id; + + $product_key = array_rand($product_ids); + $productid = $product_ids[$product_key]; + + //set the inventory product details in request then just call the saveInventoryProductDetails function + $_REQUEST['totalProductCount'] = 1; + + $_REQUEST['hdnProductId1'] = $productid; + $_REQUEST['qty1'] = $qty = 1; + $_REQUEST['listPrice1'] = $listprice = 1230; + $_REQUEST['comment1'] = "This is test comment for product of SalesOrder"; + + $_REQUEST['deleted1'] = 0; + $_REQUEST['discount_type1'] = 'amount'; + $_REQUEST['discount_amount1'] = $discount_amount = '200'; + + $_REQUEST['taxtype'] = $taxtype = 'individual'; + $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; + $_REQUEST['discount_type_final'] = 'amount'; + $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; + + $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; + $_REQUEST['adjustmenttype'] = '+'; + $_REQUEST['adjustment'] = $adjustment = '100'; + + $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; + + //Upto this added to set the request values which will be used to save the inventory product details + + //Now call the saveInventoryProductDetails function + saveInventoryProductDetails(&$so, 'SalesOrder'); + + +} + + +//Populate PurchaseOrder Data + +$psubj_array = array ("PO_vtiger", "PO_zoho", "PO_vtiger5usrp", "PO_vt100usrpk", "PO_vendtl"); +$pstatus_array = array ("Created", "Delivered", "Approved" , "Cancelled", "Recieved Shipment"); +$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); +$trkno_array = array ("po1425", "po2587", "po7974", "po7979", "po6411"); +$duedate_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); + +for($i=0;$i<5;$i++) +{ + $po = new PurchaseOrder(); + + $po->column_fields["assigned_user_id"] = $assigned_user_id; + $vendor_key = array_rand($vendor_ids); + $po->column_fields["vendor_id"] = $vendor_ids[$vendor_key]; + $contact_key = array_rand($contact_ids); + $po->column_fields["contact_id"] = $contact_ids[$contact_key]; + $rand = array_rand($num_array); + $po->column_fields["subject"] = $psubj_array[$i]; + $po->column_fields["postatus"] = $pstatus_array[$i]; + $po->column_fields["carrier"] = $carrier_array[$i]; + $po->column_fields["tracking_no"] = $trkno_array[$i]; + $po->column_fields["duedate"] = $duedate_array[$i]; + + $po->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $po->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $po->column_fields["bill_state"] = "CA"; + $po->column_fields["bill_code"] = rand(10000, 99999); + $po->column_fields["bill_country"] = 'USA'; + + $po->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $po->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $po->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $po->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $po->column_fields["ship_country"] = $account->column_fields["bill_country"]; + + + $po->save("PurchaseOrder"); + + $purchaseorder_ids[] = $po->id; + + $product_key = array_rand($product_ids); + $productid = $product_ids[$product_key]; + + //set the inventory product details in request then just call the saveInventoryProductDetails function + $_REQUEST['totalProductCount'] = 1; + + $_REQUEST['hdnProductId1'] = $productid; + $_REQUEST['qty1'] = $qty = 1; + $_REQUEST['listPrice1'] = $listprice = 2200; + $_REQUEST['comment1'] = "This is test comment for product of PurchaseOrder"; + + $_REQUEST['deleted1'] = 0; + $_REQUEST['discount_type1'] = 'amount'; + $_REQUEST['discount_amount1'] = $discount_amount = '200'; + + $_REQUEST['taxtype'] = $taxtype = 'individual'; + $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; + $_REQUEST['discount_type_final'] = 'amount'; + $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; + + $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; + $_REQUEST['adjustmenttype'] = '+'; + $_REQUEST['adjustment'] = $adjustment = '100'; + + $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; + + //Upto this added to set the request values which will be used to save the inventory product details + + //Now call the saveInventoryProductDetails function + saveInventoryProductDetails(&$po, 'PurchaseOrder'); + + +} + +//Populate Invoice Data + +$isubj_array = array ("vtiger_invoice201", "zoho_inv7841", "vtiger5usrp_invoice71134", "vt100usrpk_inv113", "vendtl_inv214"); +$istatus_array = array ("Created", "Sent", "Approved" , "Credit Invoice", "Paid"); +$itotal_array = array ("4842.000", "4842.000", "4842.000", "4842.000", "4842.000"); + +for($i=0;$i<5;$i++) +{ + $invoice = new Invoice(); + + $invoice->column_fields["assigned_user_id"] = $assigned_user_id; + $account_key = array_rand($account_ids); + $invoice->column_fields["account_id"] = $account_ids[$account_key]; + $so_key = array_rand($salesorder_ids); + $invoice->column_fields["salesorder_id"] = $salesorder_ids[$so_key]; + $contact_key = array_rand($contact_ids); + $invoice->column_fields["contactid"] = $contact_ids[$contact_key]; + $rand = array_rand($num_array); + $invoice->column_fields["subject"] = $isubj_array[$i]; + $invoice->column_fields["invoicestatus"] = $istatus_array[$i]; + $invoice->column_fields["hdnGrandTotal"] = $itotal_array[$i]; + + $invoice->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $invoice->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $invoice->column_fields["bill_state"] = "CA"; + $invoice->column_fields["bill_code"] = rand(10000, 99999); + $invoice->column_fields["bill_country"] = 'USA'; + + $invoice->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $invoice->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $invoice->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $invoice->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $invoice->column_fields["ship_country"] = $account->column_fields["bill_country"]; + + + $invoice->save("Invoice"); + + $invoice_ids[] = $invoice->id; + if ($i > 3) + { + $freetag = $adb->getUniqueId('vtiger_freetags'); + $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[0]', '$cloudtag[0]')"; + $res_inv = $adb->query($query); + + $date = $adb->formatDate(date('YmdHis')); + $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$invoice->id.", $date, 'Invoice')"; + $result_inv = $adb->query($query_tag); + } + + $product_key = array_rand($product_ids); + $productid = $product_ids[$product_key]; + + //set the inventory product details in request then just call the saveInventoryProductDetails function + $_REQUEST['totalProductCount'] = 1; + + $_REQUEST['hdnProductId1'] = $productid; + $_REQUEST['qty1'] = $qty = 1; + $_REQUEST['listPrice1'] = $listprice = 4300; + $_REQUEST['comment1'] = "This is test comment for product of Invoice"; + + $_REQUEST['deleted1'] = 0; + $_REQUEST['discount_type1'] = 'amount'; + $_REQUEST['discount_amount1'] = $discount_amount = '300'; + + $_REQUEST['taxtype'] = $taxtype = 'individual'; + $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; + $_REQUEST['discount_type_final'] = 'amount'; + $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; + + $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; + $_REQUEST['adjustmenttype'] = '+'; + $_REQUEST['adjustment'] = $adjustment = '100'; + + $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; + + //Upto this added to set the request values which will be used to save the inventory product details + + //Now call the saveInventoryProductDetails function + saveInventoryProductDetails(&$invoice, 'Invoice'); + +} + +//Populate RSS Data + + + + +//Populate Email Data + +$esubj_array = array ("Vtiger 5 Released", "Try vtigercrm!", "Hi There!!!", "Welcome to Open Source", "Help needed in customization of Vtiger"); +$startdate_array = array ("2006-1-2","2003-3-4","2003-4-5","2001-2-1","2005-8-8"); +$filename_array = array ("vtiger5alpha.tar.gz", "zohowriter.zip", "hi.doc", "welcome.pps", "sos.doc"); + +$to_array = array("a at a.com","b at b.com", "tester at testvtiger.com","xanth at yaz.com","violet at bing.com"); +$cc_array = array("andrewa at a.com","casterb at b.com", "indomine at variancevtiger.com","becker at nosbest.com","electra at violet.com"); +$bcc_array = array("nathan at nathantests.com","jeff at karl1.com", "isotope at uranium.com","bunny at bugs.com","explosive at dud.com"); +$from_array = array("harvest at zss.com","rain at sunshine.com", "gloom at rainyday.com"); +$body_array = array("This is a good product! Have a go at it! ","Nice to have you visit us, very nice of you. Stay for sometime and have a look at our product. I am sure you will like it", "This will take some time to fix. Can you provide me more details please?","What a cool tool! I wish I had found it earlier. Oh it has a lot of my friends name in it too! I too can contribute. But how?","Urgent. I need this done last week! Guys, you are the ones I am depending on. Do something!"); + +for($i=0;$i<5;$i++) +{ + $email = new Emails(); + + $email->column_fields["assigned_user_id"] = $assigned_user_id; + + $rand = array_rand($num_array); + $email->column_fields["subject"] = $esubj_array[$i]; + $email->column_fields["filename"] = $filename_array[$i]; + $email->column_fields["date_start"] = $startdate_array[$i]; + $email->column_fields["semodule"] = 'Tasks'; + $email->column_fields["activitytype"] = 'Emails'; + $email->column_fields["description"] = $body_array[$i]; + $email->save("Emails"); + $email_ids[] = $email->id; + + $query = "insert into vtiger_emaildetails(emailid,from_email,to_email,cc_email,bcc_email) values (".$email->id.", '".$from_array[$i]."', '".$to_array[$i]."','".$cc_array[$i]."','".$bcc_array[$i] ."')"; + $res = $adb->query($query); +} + + +//Populate PriceBook data + +$PB_array = array ("Cd-R PB", "Vtiger PB", "Gator PB", "Kyple PB", "Pastor PB", "Zoho PB", "PB_100", "Per_PB", "CST_PB", "GATE_PB", "Chevron_PB", "Pizza_PB"); +$Active_array = array ("0", "1", "1", "0", "1","0", "1", "1", "0", "1","0","1"); + +//$num_array = array(0,1,2,3,4); +for($i=0;$i<12;$i++) +{ + $pricebook = new PriceBooks(); + + $rand = array_rand($num_array); + $pricebook->column_fields["bookname"] = $PB_array[$i]; + $pricebook->column_fields["active"] = $Active_array[$i]; + + $pricebook->save("PriceBooks"); + $pricebook_ids[] = $pricebook ->id; +} + + +//Populate Notes Data + +$notes_array = array ("Cont_Notes", "Prod_Notes", "Vendor_Notes", "Invoice_Notes", "Task_Notes", "Event_Notes", "Email_Notes"); + +for($i=0;$i<7;$i++) +{ + $notes = new Notes(); + + $rand = array_rand($num_array); + $contact_key = array_rand($contact_ids); + $notes->column_fields["contact_id"] = $contact_ids[$contact_key]; + $notes->column_fields["notes_title"] = $notes_array[$i]; + + $notes->save("Notes"); + $notes_ids[] = $notes ->id; + + $product_key = array_rand($product_ids); + $query = "insert into vtiger_senotesrel (crmid, notesid) values (".$product_ids[$product_key].", ".$notes->id.")"; + $db->query($query); + +} + + + +// Populate Ticket data + + +//$severity_array=array("Minor","Major","Critical",""); +$status_array=array("Open","In Progress","Wait For Response","Open","Closed"); +$category_array=array("Big Problem ","Small Problem","Other Problem","Small Problem","Other Problem"); +$ticket_title_array=array("Upload Attachment problem", + "Individual Customization -Menu and RSS","Export Output query", + "Import Error CSV Leads","How to automatically add a lead from a web form to VTiger"); + +for($i=0;$i<5;$i++) +{ + $helpdesk= new HelpDesk(); + + $rand=array_rand($num_array); + $contact_key = array_rand($contact_ids); + $helpdesk->column_fields["parent_id"] = $contact_ids[$contact_key]; + + $helpdesk->column_fields["ticketpriorities"]= "Normal"; + $helpdesk->column_fields["product_id"] = $product_ids[$i]; + + $helpdesk->column_fields["ticketseverities"] = "Minor"; + $helpdesk->column_fields["ticketstatus"] = $status_array[$i]; + $helpdesk->column_fields["ticketcategories"] = $category_array[$i]; + //$rand_key = array_rand($s);$contact_key = array_rand($contact_ids); + $notes->column_fields["contact_id"] = $contact_ids[$contact_key]; + $helpdesk->column_fields["ticket_title"] = $ticket_title_array[$i]; + $helpdesk->column_fields["assigned_user_id"] = $assigned_user_id; + + $helpdesk->save("HelpDesk"); + $helpdesk_ids[] = $helpdesk->id; + + if ($i > 3) + { + $freetag = $adb->getUniqueId('vtiger_freetags'); + $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[3]', '$cloudtag[3]')"; + $res_tkt = $adb->query($query); + + $date = $adb->formatDate(date('YmdHis')); + $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$helpdesk->id.", $date, 'HelpDesk')"; + $result_tkt = $adb->query($query_tag); + } + +} + +// Populate Activities Data +$task_array=array("Tele Conference","Call user - John","Send Fax to Mary Smith"); +$event_array=array("","","Call Smith","Team Meeting","Call Richie","Meeting with Don"); +$task_status_array=array("Planned","In Progress","Completed"); +$task_priority_array=array("High","Medium","Low"); +$visibility=array("","","Private","Public","Private","Public"); + +for($i=0;$i<6;$i++) +{ + $event = new Activity(); + + $rand_num=array_rand($num_array); + + $rand_date = & create_date(); + $en=explode("-",$rand_date); + if($en[1]<10) + $en[1]="0".$en[1]; + if($en[2]<10) + $en[2]="0".$en[2]; + $recur_daily_date=date('Y-m-d',mktime(0,0,0,date($en[1]),date($en[2])+5,date($en[0]))); + $recur_week_date=date('Y-m-d',mktime(0,0,0,date($en[1]),date($en[2])+30,date($en[0]))); + + + $start_time_hr=rand(00,23); + $start_time_min=rand(00,59); + $end_time_hr=rand(00,23); + $end_time_min=rand(00,59); + if($start_time_hr<10) + $start_time_hr="0".$start_time_hr; + if($start_time_min<10) + $start_time_min="0".$start_time_min; + if($end_time_hr<10) + $end_time_hr="0".$end_time_hr; + if($end_time_min<10) + $end_time_min="0".$end_time_min; + $end_time=$end_time_hr.":".$end_time_min; + $start_time=$start_time_hr.":".$start_time_min; + if($i<2) + { + $event->column_fields["subject"] = $task_array[$i]; + if($i==1) + { + $account_key = array_rand($account_ids); + $event->column_fields["parent_id"] = $account_ids[$account_key];; + } + $event->column_fields["taskstatus"] = $task_status_array[$i]; + $event->column_fields["taskpriority"] = $task_priority_array[$i]; + $event->column_fields["activitytype"] = "Task"; + $event->column_fields["visibility"] = $visibility[$i]; + + } + else + { + $event->column_fields["subject"] = $event_array[$i]; + $event->column_fields["visibility"] = $visibility[$i]; + $event->column_fields["duration_hours"] = rand(0,3); + $event->column_fields["duration_minutes"]= rand(0,59); + $event->column_fields["eventstatus"] = "Planned"; + $event->column_fields["time_end"] = $end_time; + } + $event->column_fields["date_start"] = $rand_date; + $_REQUEST["date_start"] = $rand_date; + $event->column_fields["time_start"] = $start_time; + $event->column_fields["due_date"] = $rand_date; + $_REQUEST["due_date"] = $rand_date; + $contact_key = array_rand($contact_ids); + $event->column_fields["contact_id"] = $contact_ids[$contact_key]; + if($i==4) + { + $event->column_fields["recurringtype"] = "Daily"; + $_REQUEST["recurringtype"] = "Daily"; + $event->column_fields["activitytype"] = "Meeting"; + $event->column_fields["due_date"] = $recur_daily_date; + } + elseif($i==5) + { + $event->column_fields["recurringtype"] = "Weekly"; + $_REQUEST["recurringtype"] = "Weekly"; + $event->column_fields["activitytype"] = "Meeting"; + $event->column_fields["due_date"] = $recur_week_date; + } + elseif($i>1) + { + $event->column_fields["activitytype"] = "Call"; + } + $event->column_fields["assigned_user_id"] = $assigned_user_id; + $event->save("Calendar"); + $event_ids[] = $event->id; + +} + + +$adb->query("update vtiger_crmentity set smcreatorid=".$assigned_user_id); + +$expected_revenue = Array("250000","750000","500000"); +$budget_cost = Array("25000","50000","90000"); +$actual_cost = Array("23500","45000","80000"); +$num_sent = Array("2000","2500","3000"); +$clo_date = Array('2003-1-2','2004-2-3','2005-4-12'); + +$expected_response_count = Array("2500","7500","5000"); +$expected_sales_count = Array("25000","50000","90000"); +$expected_roi = Array("23","45","82"); + +$actual_response_count = Array("250","750","1500"); +$actual_sales_count = Array("1250","5200","2390"); +$actual_roi = Array("21","14","12"); + +$sponsor = Array("Finace","Marketing","Sales"); +$targetsize = Array("210000","13390","187424"); +$targetaudience = Array("Managers","CEOs","Rookies"); + +//$expected_response = Array(null,null,null); +for($i=0;$icolumn_fields["campaignname"] = $campaign_name; + $campaign->column_fields["campaigntype"] = $campaign_type_array[$i]; + $campaign->column_fields["campaignstatus"] = $campaign_status_array[$i]; + $campaign->column_fields["numsent"] = $num_sent[$i]; + $campaign->column_fields["expectedrevenue"] = $expected_revenue[$i]; + $campaign->column_fields["budgetcost"] = $budget_cost[$i]; + $campaign->column_fields["actualcost"] = $actual_cost[$i]; + $campaign->column_fields["closingdate"] = $clo_date[$i]; + $campaign->column_fields["expectedresponse"] = $expected_response[$i]; + $campaign->column_fields["assigned_user_id"] = $assigned_user_id; + + $campaign->column_fields["expectedresponsecount"] = $expected_response_count[$i]; + $campaign->column_fields["expectedsalescount"] = $expected_sales_count[$i]; + $campaign->column_fields["expectedroi"] = $expected_roi[$i]; + $campaign->column_fields["actualresponsecount"] = $actual_response_count[$i]; + $campaign->column_fields["actualsalescount"] = $actual_sales_count[$i]; + $campaign->column_fields["actualroi"] = $actual_roi[$i]; + $campaign->column_fields["sponsor"] = $sponsor[$i]; + $campaign->column_fields["targetsize"] = $targetsize[$i]; + $campaign->column_fields["targetaudience"] = $targetaudience[$i]; + + + + $campaign->save("Campaigns"); +} + +//Populate My Sites Data + +$portalname = array ("Vtiger", "Vtiger Blogs", "Vtiger Forums", "VtigerForge", "Vtiger Docs"); +$portalurl = array ("http://vtiger.com", "http://blogs.vtiger.com", "http://forums.vtiger.com", "http://vtigerforge.com", "http://wiki.vtiger.com"); + +for($i=0;$i<5;$i++) +{ + $portalid = $adb->getUniqueId('vtiger_portal'); + $portal_qry = "insert into vtiger_portal values (".$portalid.", '".$portalname[$i]."','".$portalurl[$i]."',0)"; + $result_qry = $adb->query($portal_qry); +} + +//Populate RSS Data +$rssname = array("vtiger - Forums","vtiger development - Active Tickets"); +$rssurl = array("http://forums.vtiger.com/rss.php?name=forums&file=rss","http://vtiger.fosslabs.com/cgi-bin/trac.cgi/report/1?format=rss&USER=anonymous"); + +for($i=0;$i<2;$i++) +{ + $rssid = $adb->getUniqueId('vtiger_rss'); + $rss_qry = "insert into vtiger_rss values (".$rssid.", '".$rssurl[$i]."','".$rssname[$i]."',0,0)"; + $result_qry = $adb->query($rss_qry); +} +?> Modified: vtigercrm/branches/5.1_jens/jscalendar/calendar.js ============================================================================== --- vtigercrm/branches/5.1_jens/jscalendar/calendar.js (original) +++ vtigercrm/branches/5.1_jens/jscalendar/calendar.js Tue Nov 14 03:16:10 2006 @@ -1703,7 +1703,9 @@ return str; }; +if ( Date.prototype.__msh_oldSetFullYear == null ) { Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; +} Date.prototype.setFullYear = function(y) { var d = new Date(this); d.__msh_oldSetFullYear(y); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Account.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Account.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Account.php Tue Nov 14 03:16:10 2006 @@ -1,778 +1,758 @@ -'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid'); - - var $entity_table = "vtiger_crmentity"; - - var $billadr_table = "vtiger_accountbillads"; - - var $object_name = "Accounts"; - // Mike Crowe Mod --------------------------------------------------------added for general search - var $base_table_name = "vtiger_account"; - var $cf_table_name = "vtiger_accountscf"; - - var $new_schema = true; - - var $module_id = "accountid"; - - var $column_fields = Array(); - - var $sortby_fields = Array('accountname','city','website','phone','smownerid'); - - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Account Name'=>Array('vtiger_account'=>'accountname'), - 'City'=>Array('vtiger_accountbillads'=>'city'), - 'Website'=>Array('vtiger_account'=>'website'), - 'Phone'=>Array('vtiger_account'=> 'phone'), - 'Assigned To'=>Array('vtiger_crmentity'=>'smownerid') - ); - - var $list_fields_name = Array( - 'Account Name'=>'accountname', - 'City'=>'bill_city', - 'Website'=>'website', - 'Phone'=>'phone', - 'Assigned To'=>'assigned_user_id' - ); - var $list_link_field= 'accountname'; - - var $search_fields = Array( - 'Account Name'=>Array('vtiger_account'=>'accountname'), - 'City'=>Array('vtiger_accountbillads'=>'city'), - ); - - var $search_fields_name = Array( - 'Account Name'=>'accountname', - 'City'=>'bill_city', - ); - - // This is the list of vtiger_fields that are required. - var $required_fields = array("accountname"=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'accountname'; - var $default_sort_order = 'ASC'; - - function Account() { - $this->log =LoggerManager::getLogger('account'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Accounts'); - } - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['ACCOUNTS_SORT_ORDER'] != '')?($_SESSION['ACCOUNTS_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'accountname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['ACCOUNTS_ORDER_BY'] != '')?($_SESSION['ACCOUNTS_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - /** Returns a list of the associated contacts - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_contacts($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $mod_strings; - - $focus = new Contact(); - - $button = ''; - if(isPermitted("Contacts",1,"") == 'yes') - { - $button .= ' 

  
- - + +
@@ -288,12 +288,12 @@ - - + -
+
hour_format,'start');?>
- Set date.. +
+ Set date.. Modified: vtigercrm/branches/5.1_jens/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/calendarLayout.php Tue Nov 14 03:16:10 2006 @@ -1,1959 +1,1968 @@ -debug("Entering calendar_layout() method"); - $cal_header = array (); - if (isset($param_arr['size']) && $param_arr['size'] == 'small') - $param_arr['calendar']->show_events = false; - - $cal_header['view'] = $param_arr['view']; - $cal_header['IMAGE_PATH'] = $param_arr['IMAGE_PATH']; - $cal_header['calendar'] = $param_arr['calendar']; - $eventlabel = $mod_strings['LBL_EVENTS']; - $todolabel = $mod_strings['LBL_TODOS']; - //if $param_arr['size'] is set to 'small', get small(mini) calendar - if(isset($param_arr['size']) && $param_arr['size'] == 'small') - { - get_mini_calendar($param_arr); - } - else - { - //To differentiate selected subtab from unselected one - Starts - if($subtab == 'event') - { - $eventtab_class = 'dvtSelectedCell'; - $todotab_class = 'dvtUnSelectedCell'; - $event_anchor = $eventlabel; - $todo_anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=todo&parenttab=".$category."'>".$todolabel.""; - - } - elseif($subtab == 'todo') - { - $eventtab_class = 'dvtUnSelectedCell'; - $todotab_class = 'dvtSelectedCell'; - $event_anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=event&parenttab=".$category."'>".$eventlabel.""; - $todo_anchor = $todolabel; - } - //Ends - //To get calendar header and its links(like Day,Week,Month,Year and etc.) - get_cal_header_tab($cal_header,$viewBox,$subtab); - $subheader = ""; - $subheader .=<< - - - - - - -
- - - - - - - - - -
 $event_anchor $todo_anchor 
-
-EOQ; - echo $subheader; - if($viewBox == 'hourview' && $subtab == 'event') - { - get_cal_header_data($param_arr,$viewBox,$subtab); - getHourView($param_arr); - } - elseif($viewBox == 'listview' && $subtab == 'event') - { - get_cal_header_data($param_arr,$viewBox,$subtab); - getEventListView($param_arr); - } - elseif($subtab == 'todo') - { - $todo_list = ""; - $todo_list .= getTodosListView($param_arr,'',$subtab); - $todo_list .= '

'; - echo $todo_list; - } - } - - $cal_log->debug("Exiting calendar_layout() method"); - -} - -/** - * Function creates HTML to display small(mini) Calendar - * @param array $cal - collection of objects and strings - */ -function get_mini_calendar(& $cal) -{ - global $current_user,$adb,$cal_log; - $category = getParentTab(); - $cal_log->debug('Entering get_mini_calendar() method...'); - $count = 0; - //To decide number of rows(weeks) in a month - if ($cal['calendar']->month_array[$cal['calendar']->slices[35]]->start_time->month != $cal['calendar']->date_time->month) { - $rows = 5; - } else { - $rows = 6; - } - $minical = ""; - $minical .= " - - - "; - $minical .= ""; - $minical .= ""; - //To display days in week - $minical .= ''; - for ($i = 0; $i < 7; $i ++) - { - $weekdays_row = $cal['calendar']->month_array[$cal['calendar']->slices[$i]]; - $weekday = $weekdays_row->start_time->getdayofWeek_inshort(); - $minical .= ''; - } - $minical .= ""; - $event_class = ''; - $class = ''; - for ($i = 0; $i < $rows; $i ++) - { - $minical .= ""; - for ($j = 0; $j < 7; $j ++) - { - $cal['slice'] = $cal['calendar']->month_array[$cal['calendar']->slices[$count]]; - $class = dateCheck($cal['slice']->start_time->get_formatted_date()); - if($count%7 == 0) - $minical .= ""; - //To differentiate day having events from other days - if(count($cal['slice']->activities) != 0 && ($cal['slice']->start_time->get_formatted_date() == $cal['slice']->activities[0]->start_time->get_formatted_date())) - { - $event_class = 'class="eventDay"'; - } - else - { - $event_class = ''; - } - //To differentiate current day from other days - if($class != '' ) - $class = 'class="'.$class.'"'; - else - $class = $event_class; - - //To display month dates - if ($cal['slice']->start_time->getMonth() == $cal['calendar']->date_time->getMonth()) - { - $minical .= ""; - } - else - { - $minical .= ""; - } - $count++; - } - $minical .= ''; - } - - $minical .= "
 ".get_previous_cal($cal)." "; - $minical .= "date_time->get_date_str()."&parenttab=".$category."'>".display_date($cal['view'],$cal['calendar']->date_time)." ".get_next_cal($cal)." -
Week'.$weekday.'
start_time->get_date_str()."&parenttab=".$category."'>".$cal['slice']->start_time->week.""; - $minical .= "getView()."".$cal['slice']->start_time->get_date_str()."&parenttab=".$category."'>"; - $minical .= $cal['slice']->start_time->get_Date()."
"; - echo $minical; - $cal_log->debug("Exiting get_mini_calendar() method..."); -} - -/** - * Function creates HTML to display Calendar Header and its Links - * @param array $header - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means Events ListView.if 'hourview' means Events HourView. if empty means get Todos ListView - * @param string $subtab - string 'todo' or 'event'. if 'todo' means Todos View else Events View - */ -function get_cal_header_tab(& $header,$viewBox,$subtab) -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_cal_header_tab() method..."); - $tabhtml = ""; - $count = 1; - include_once 'modules/Calendar/addEventUI.php'; - include_once 'modules/Calendar/header.php'; - $eventlabel = $mod_strings['LBL_EVENTS']; - $todolabel = $mod_strings['LBL_TODOS']; - $div = " - -
- "; - echo $div; - $tabhtml .= ""; - $links = array ('day','week','month','year'); - //To differentiate the selected link from unselected links - foreach ($links as $link) - { - if ($header['view'] == $link) - { - $class = 'calSel'; - $anchor = $mod_strings["LBL_".$header['calendar']->getCalendarView($link)]; - } - else - { - $class = 'calUnSel'; - $anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>".$mod_strings["LBL_".$header['calendar']->getCalendarView($link)].""; - } - - if($count == 1) - $tabhtml .= ""; - else - $tabhtml .= ""; - $count++; - } - //To get Navigation(next&previous) links and display Date info - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - echo $tabhtml; - $cal_log->debug("Exiting get_cal_header_tab() method..."); -} - -/** - * Function creates HTML to display number of Events, Todos and pending list in calendar under header(Eg:Total Events : 5, 2 Pending / Total To Dos: 4, 1 Pending) - * @param array $cal_arr - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview'. if 'listview' means Events ListView.if 'hourview' means Events HourView. - */ -function get_cal_header_data(& $cal_arr,$viewBox,$subtab) -{ - global $mod_strings,$cal_log; - $cal_log->debug("Entering get_cal_header_data() method..."); - global $current_user,$app_strings; - $date_format = $current_user->date_format; - $format = $cal_arr['calendar']->hour_format; - $hour_startat = convertTime2UserSelectedFmt($format,$cal_arr['calendar']->day_start_hour,false); - $hour_endat = convertTime2UserSelectedFmt($format,($cal_arr['calendar']->day_start_hour+1),false); - $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); - $temp_ts = $cal_arr['calendar']->date_time->ts; - //To get date in user selected format - $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - $headerdata = ""; - $headerdata .=" -
- -
".$anchor."".$anchor." - - - "; - $tabhtml .= ""; - $tabhtml .= " -
".get_previous_cal($header,$viewBox,$subtab)." - ".display_date($header['view'],$header['calendar']->date_time)."".get_next_cal($header,$viewBox,$subtab)." -
-
view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."btnL3Calendar.gif' alt='".$mod_strings['LBL_OPENCAL']."...' title='".$mod_strings['LBL_OPENCAL']."...' align='absmiddle' border='0'>view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."tbarSettings.gif' alt='".$mod_strings['LBL_SETTINGS']."' title='".$mod_strings['LBL_SETTINGS']."' align='absmiddle' border='0'>".$app_strings[Calendar]."
- "; - if(isPermitted("Calendar","EditView") == "yes") - { - $headerdata .=" - "; - } - else - { - $headerdata .=""; - } - $headerdata .=" - - -
 
-
- ".$mod_strings['LBL_ADD']." - -
 "; - $headerdata .= getEventTodoInfo($cal_arr,'listcnt'); - $headerdata .= "
".$mod_strings['LBL_VIEW']." : "; - $view_options = getEventViewOption($cal_arr,$viewBox); - $headerdata .=$view_options."
-
"; - echo $headerdata; - $cal_log->debug("Exiting get_cal_header_data() method..."); -} - -/** - * Function creates HTML select statement to display View selection box - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview'. if 'listview' means get Events ListView.if 'hourview' means get Events HourView. - * return string $view - html selection box - */ -function getEventViewOption(& $cal,$viewBox) -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - if($viewBox == 'listview') - { - $list_sel = 'selected'; - $hr_sel = ''; - } - else - { - $list_sel = ''; - $hr_sel = 'selected'; - } - $cal_log->debug("Entering getEventViewOption() method..."); - $view = "view."'> - date_time->hour."'> - date_time->day."'> - date_time->week."'> - date_time->month."'> - date_time->year."'> - - - - - - - - "; - $cal_log->debug("Exiting getEventViewOption() method..."); - return $view; -} - -/** - * Function creates HTML anchor tag to get previous-day/week/month/year view - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means previous link in Events ListView.if 'hourview' means previous link in Events HourView. if empty means previous link in Todos ListView - * @param string $subtab - string 'todo' or 'event' or may be empty. if 'todo' means Todos View. if 'event' means Events View. if empty means small calendar view. - * return string $link - html tags in string format - */ -function get_previous_cal(& $cal,$viewBox='',$subtab='') -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_previous_cal() method..."); - if(isset($cal['size']) && $cal['size'] == 'small') - { - $link = "view."".$cal['calendar']->get_datechange_info('prev')."&parenttab=".$category."\")'>"; - } - else - { - $link = "view."".$cal['calendar']->get_datechange_info('prev')."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>"; - } - $cal_log->debug("Exiting get_previous_cal() method..."); - return $link; -} - -/** - * Function creates HTML anchor tag to get next-day/week/month/year view - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means next link in Events ListView.if 'hourview' means next link in Events HourView. if empty means next link in Todos ListView - * @param string $subtab - string 'todo' or 'event' or may be empty. if 'todo' means Todos View. if 'event' means Events View. if empty means small calendar view. - * return string $link - html tags in string format - */ -function get_next_cal(& $cal,$viewBox='',$subtab='') -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_next_cal() method..."); - if(isset($cal['size']) && $cal['size'] == 'small') - { - $link = "view."".$cal['calendar']->get_datechange_info('next')."&parenttab=".$category."\")' >"; - } - else - { - $link = "view."".$cal['calendar']->get_datechange_info('next')."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>"; - } - $cal_log->debug("Exiting get_next_cal() method..."); - return $link; - -} - -/** - * Function to get date info depending upon on the calendar view(Eg: 21 July 2000) - * @param string $view - calendar view(day/week/month/year) - * @param array $date_time - contains DateTime object - * return string $label - date info(Eg for dayview : 13 July 2000) - */ -function display_date($view,$date_time) -{ - global $cal_log; - $cal_log->debug("Entering display_date() method..."); - if ($view == 'day') - { - //$label = $date_time->getdayofWeek()." "; - $label = $date_time->get_Date()." "; - $label .= $date_time->getmonthName()." "; - $label .= $date_time->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - elseif ($view == 'week') - { - $week_start = $date_time->getThisweekDaysbyIndex(0); - $week_end = $date_time->getThisweekDaysbyIndex(6); - $label = $week_start->get_Date()." "; - $label .= $week_start->getmonthName()." "; - $label .= $week_start->year; - $label .= " - "; - $label .= $week_end->get_Date()." "; - $label .= $week_end->getmonthName()." "; - $label .= $week_end->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - - elseif ($view == 'month') - { - $label = $date_time->getmonthName()." "; - $label .= $date_time->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - elseif ($view == 'year') - { - $cal_log->debug("Exiting display_date() method..."); - return $date_time->year; - } - -} -/** - * Function to get css class name for date - * @param string $slice_date - date - * returns string - css class name or empty string - */ -function dateCheck($slice_date) -{ - global $cal_log; - $cal_log->debug("Entering dateCheck() method..."); - $today = date('Y-m-d'); - if($today == $slice_date) - { - $cal_log->debug("Exiting dateCheck() method..."); - //css class for day having event(s) - return 'currDay'; - } - else - { - $cal_log->debug("Exiting dateCheck() method..."); - return ''; - } -} - -/** - * Function to construct respective calendar layout depends on the calendar view - * @param array $view - collection of objects and strings - */ -function getHourView(& $view) -{ - global $cal_log; - $hourview_layout = ''; - $cal_log->debug("Entering getHourView() method..."); - $hourview_layout .= '
-
'; - - if($view['view'] == 'day') - $hourview_layout .= getDayViewLayout($view); - elseif($view['view'] == 'week') - $hourview_layout .= getWeekViewLayout($view); - elseif($view['view'] == 'month') - $hourview_layout .= getMonthViewLayout($view); - elseif($view['view'] == 'year') - $hourview_layout .= getYearViewLayout($view); - else - die("view:".$view['view']." is not defined"); - - $hourview_layout .= '
- '; - $hourview_layout .= '
- - - - - - - - -
'; - echo $hourview_layout; - $cal_log->debug("Exiting getHourView() method..."); -} - -/** - * Fuction constructs Events ListView depends on the view - * @param array $cal - collection of objects and strings - * @param string $mode - string 'listcnt' or empty. if empty means get Events ListView else get total no. of events and no. of pending events Info. - * returns string $activity_list - total no. of events and no. of pending events Info(Eg: Total Events : 2, 1 Pending). - */ -function getEventListView(& $cal,$mode='') -{ - global $cal_log; - $list_view = ""; - $cal_log->debug("Entering getEventListView() method..."); - if($cal['calendar']->view == 'day') - { - $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date(); - } - elseif($cal['calendar']->view == 'week') - { - $start_date = $cal['calendar']->slices[0]; - $end_date = $cal['calendar']->slices[6]; - } - elseif($cal['calendar']->view == 'month') - { - $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0); - $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - elseif($cal['calendar']->view == 'year') - { - $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0); - $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment'); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - else - { - die("view:".$cal['calendar']->view." is not defined"); - } - //if $mode value is empty means get Events list in array format else get the count of total events and pending events in array format. - $activity_list = getEventList($cal, $start_date, $end_date,$mode); - if($mode != '') - { - $cal_log->debug("Exiting getEventListView() method..."); - return $activity_list; - } - //To get Events listView - $list_view .="
"; - $list_view .=constructEventListView($cal,$activity_list); - $list_view .="
- "; - $list_view .="
- - - - - - - - -
"; - echo $list_view; - $cal_log->debug("Exiting getEventListView() method..."); -} - - -/** - * Fuction constructs Todos ListView depends on the view - * @param array $cal - collection of objects and strings - * @param string $check - string 'listcnt' or empty. if empty means get Todos ListView else get total no. of Todos and no. of pending todos Info. - * returns string $todo_list - total no. of todos and no. of pending todos Info(Eg: Total Todos : 2, 1 Pending). - */ -function getTodosListView($cal, $check='',$subtab='') -{ - global $cal_log; - $list_view = ""; - $cal_log->debug("Entering getTodosListView() method..."); - if($cal['calendar']->view == 'day') - { - $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date(); - } - elseif($cal['calendar']->view == 'week') - { - $start_date = $cal['calendar']->slices[0]; - $end_date = $cal['calendar']->slices[6]; - } - elseif($cal['calendar']->view == 'month') - { - $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0); - $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - elseif($cal['calendar']->view == 'year') - { - $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0); - $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment'); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - else - { - die("view:".$cal['calendar']->view." is not defined"); - } - //if $check value is empty means get Todos list in array format else get the count of total todos and pending todos in array format. - $todo_list = getTodoList($cal, $start_date, $end_date,$check); - if($check != '') - { - $cal_log->debug("Exiting getTodosListView() method..."); - return $todo_list; - } - $cal_log->debug("Exiting getTodosListView() method..."); - $list_view .="
"; - //To get Todos listView - $list_view .= constructTodoListView($todo_list,$cal,$subtab); - $list_view .="
- - - - - - - - - - "; - echo $list_view; -} - -/** - * Function creates HTML to display Calendar DayView - * @param array $cal - collections of objects and strings. - * return string $dayview_layout - html tags in string format - */ -function getDayViewLayout(& $cal) -{ - //echo '
';print_r($cal);echo '
'; - global $current_user,$app_strings,$cal_log,$adb; - $no_of_rows = 1; - $cal_log->debug("Entering getDayViewLayout() method..."); - $shared_ids = getSharedCalendarId($current_user->id); - $user_details = getAllUserName(); - $usersid = $current_user->id.','.$shared_ids; - $userid_arr = explode(",",$usersid); - $date_format = $current_user->date_format; - $day_start_hour = $cal['calendar']->day_start_hour; - $day_end_hour = $cal['calendar']->day_end_hour; - $format = $cal['calendar']->hour_format; - $dayview_layout = ''; - $dayview_layout .= ' '; - $dayview_layout .= ' -
- '; - for($j=0;$j<24;$j++) - { - $slice = $cal['calendar']->slices[$j]; - $act = $cal['calendar']->day_slice[$slice]->activities; - if(!empty($act)) - { - $temprows = count($act); - $no_of_rows = ($no_of_rows>$temprows)?$no_of_rows:$temprows; - } - } - for($i=$day_start_hour;$i<=$day_end_hour;$i++) - { - - if($cal['calendar']->hour_format == 'am/pm') - { - if($i == 12) - { - $hour = $i; - $sub_str = 'pm'; - } - elseif($i>12) - { - $hour = $i - 12; - $sub_str = 'pm'; - } - else - { - if($i == 0) - $hour = 12; - else - $hour = $i; - $sub_str = 'am'; - } - - } - else - { - $hour = $i; - if($hour <= 9 && strlen(trim($hour)) < 2) - $hour = "0".$hour; - $sub_str = ':00'; - } - $y = $i+1; - $hour_startat = convertTime2UserSelectedFmt($format,$i,false); - $hour_endat = convertTime2UserSelectedFmt($format,$y,false); - $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); - $temp_ts = $cal['calendar']->date_time->ts; - $sttemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - if($i != 23) - { - $endtemp_date = $sttemp_date; - } - else - { - $addday = $temp_ts + (1 * 24 * 60 * 60); - $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$addday)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$addday)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $addday)):('')))); - } - - $js_string = ""; - if(isPermitted("Calendar","EditView") == "yes") - $js_string = 'onClick="fnvshobj(this,\'addEvent\'); gshow(\'addEvent\',\'call\',\''.$sttemp_date.'\',\''.$endtemp_date.'\',\''.$time_arr['starthour'].'\',\''.$time_arr['startmin'].'\',\''.$time_arr['startfmt'].'\',\''.$time_arr['endhour'].'\',\''.$time_arr['endmin'].'\',\''.$time_arr['endfmt'].'\',\'hourview\',\'event\')"'; - $dayview_layout .= ' - '; - //To display events in Dayview - $dayview_layout .= getdayEventLayer($cal,$cal['calendar']->slices[$i],$no_of_rows); - $dayview_layout .= ''; - } - $dayview_layout .= '
'.$hour.''.$sub_str.'
-
'; - $cal_log->debug("Exiting getDayViewLayout() method..."); - return $dayview_layout; -} - -/** - * Function creates HTML to display Calendar WeekView - * @param array $cal - collections of objects and strings From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 02:32:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 10:32:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9830 - in /vtigercrm/branches/5.0.3/modules/Emails: DetailView.php EditView.php Message-ID: <20061114103247.89EBD787F17@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 03:32:41 2006 New Revision: 9830 Log: Language support added for header. Fixes #2584 Modified: vtigercrm/branches/5.0.3/modules/Emails/DetailView.php vtigercrm/branches/5.0.3/modules/Emails/EditView.php Modified: vtigercrm/branches/5.0.3/modules/Emails/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Emails/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Emails/DetailView.php Tue Nov 14 03:32:41 2006 @@ -132,7 +132,8 @@ $entries = getBlocks($currentModule,"detail_view",'',$focus->column_fields); $entries['Email Information']['4']['Description']['value'] = from_html($entries['Email Information']['4']['Description']['value']); -$smarty->assign("BLOCKS", $entries['Email Information']); +//changed this to view description in all langauge - bharath +$smarty->assign("BLOCKS",$entries[$mod_strings['LBL_EMAIL_INFORMATION']]); $smarty->assign("SINGLE_MOD", 'Email'); $smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); Modified: vtigercrm/branches/5.0.3/modules/Emails/EditView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Emails/EditView.php (original) +++ vtigercrm/branches/5.0.3/modules/Emails/EditView.php Tue Nov 14 03:32:41 2006 @@ -163,7 +163,8 @@ $disp_view = getView($focus->mode); $details = getBlocks($currentModule,$disp_view,$mode,$focus->column_fields); -$smarty->assign("BLOCKS",$details['Email Information']); +//changed this below line to view description in all language - bharath +$smarty->assign("BLOCKS",$details[$mod_strings['LBL_EMAIL_INFORMATION']]); $smarty->assign("MODULE",$currentModule); $smarty->assign("SINGLE_MOD",$app_strings['Email']); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 03:36:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 11:36:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9831 - /customerportal/trunk/login.php Message-ID: <20061114113644.1838A7893C2@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 04:36:40 2006 New Revision: 9831 Log: * Added form validation, now we will not face apache redirection error Modified: customerportal/trunk/login.php Modified: customerportal/trunk/login.php ============================================================================== --- customerportal/trunk/login.php (original) +++ customerportal/trunk/login.php Tue Nov 14 04:36:40 2006 @@ -21,7 +21,7 @@ if($_REQUEST['close_window'] == 'true') { ?> - Email ID : - + Password : - +   - + @@ -131,5 +131,40 @@ + + From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 04:21:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 12:21:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9832 - /vtigercrm/branches/5.0.3/include/language/en_us.lang.php Message-ID: <20061114122144.BC7A27893BB@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 05:21:25 2006 New Revision: 9832 Log: Changes done for the generic module addition --By Don Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/include/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/include/language/en_us.lang.php Tue Nov 14 05:21:25 2006 @@ -635,31 +635,9 @@ 'Expected Response' => 'Expected Response', 'LBL_ADDRESS_INF' => 'Address Information', 'yes' => 'yes', - 'don' => 'don', - 'nayanthara' => 'nayanthara', - 'LNK_NEW_DON' => 'New don', - 'patient' => 'patient', - 'medical' => 'medical', - 'LNK_NEW_PATIENT' => 'New patient', - 'cars' => 'cars', - 'automobile' => 'automobile', - 'LNK_NEW_CARS' => 'New cars', - 'king' => 'king', - 'LNK_NEW_KING' => 'New king', - 'Forests' => 'Forests', - 'Congo' => 'Congo', - 'LNK_NEW_FORESTS' => 'New Forests', - 'rock' => 'rock', - 'Solid' => 'Solid', - 'LNK_NEW_ROCK' => 'New rock', - 'lexus' => 'lexus', - 'toyota' => 'toyota', - 'LNK_NEW_LEXUS' => 'New lexus', - 'medicine' => 'medicine', - 'Indica' => 'Indica', - 'Tata' => 'Tata', - 'SINGLE_Indica' => 'Indica', -);$app_list_strings = array ( +); + +$app_list_strings = array ( 'moduleList' => array ( 'Home' => 'Home', From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 05:02:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 13:02:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9833 - /vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Message-ID: <20061114130206.526A1787FC1@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 06:01:58 2006 New Revision: 9833 Log: Made changes for module Addition -- By Jeri Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Tue Nov 14 06:01:58 2006 @@ -1070,26 +1070,29 @@ $log->debug("Exiting getBlocks method ..."); $index_count =1; $max_index =0; - foreach($getBlockInfo as $label=>$contents) - { + if(count($getBlockInfo) > 0) + { + foreach($getBlockInfo as $label=>$contents) + { $no_rows = count($contents); $index_count = $max_index+1; - foreach($contents as $block_row => $elements) - { - $max_index= $no_rows+$index_count; - - for($i=0;$i $elements) + { + $max_index= $no_rows+$index_count; + + for($i=0;$i Author: richie Date: Tue Nov 14 06:05:51 2006 New Revision: 9834 Log: Made changes for module Addition -- By Jeri Modified: vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl Tue Nov 14 06:05:51 2006 @@ -77,7 +77,7 @@   - {if $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Products'} + {if $ADVBLOCKS neq ''} {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} {$APP.LBL_MORE} {$APP.LBL_INFORMATION}   From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 05:38:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 13:38:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9835 - in /customerportal/trunk: header.html index.php js/general.js Message-ID: <20061114133838.85B247893C2@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 06:38:32 2006 New Revision: 9835 Log: * Changed the tab highlighting code to simplify the process Modified: customerportal/trunk/header.html customerportal/trunk/index.php customerportal/trunk/js/general.js Modified: customerportal/trunk/header.html ============================================================================== --- customerportal/trunk/header.html (original) +++ customerportal/trunk/header.html Tue Nov 14 06:38:32 2006 @@ -63,8 +63,8 @@   - My Tickets - FAQ + My Tickets + FAQ   Modified: customerportal/trunk/index.php ============================================================================== --- customerportal/trunk/index.php (original) +++ customerportal/trunk/index.php Tue Nov 14 06:38:32 2006 @@ -96,19 +96,22 @@ Modified: customerportal/trunk/js/general.js ============================================================================== --- customerportal/trunk/js/general.js (original) +++ customerportal/trunk/js/general.js Tue Nov 14 06:38:32 2006 @@ -1,17 +1,19 @@ // JavaScript Document -function fnLoadValues(obj1,obj2){ - - var tabName1 = document.getElementById(obj1); - var tabName2 = document.getElementById(obj2); - if(tabName1.className == "dvtUnSelectedCell") - tabName1.className = "dvtSelectedCell"; - if(tabName2.className == "dvtSelectedCell") - tabName2.className = "dvtUnSelectedCell"; - if(obj1 == 'mi') - window.location.href = "index.php?module=Faq&action=index"; - else if(obj1 == 'pi') - window.location.href = "index.php"; +function fnLoadValues(obj){ + + /* + var tabArray = Array("Tickets","Faq"); + + for(var i=0;i<2;i++) + { + if(tabArray[i].indexOf(obj) > -1) + document.getElementById(tabArray[i]).className = "dvtSelectedCell"; + else + document.getElementById(tabArray[i]).className = "dvtUnSelectedCell"; + } + */ + window.location.href = "index.php?module="+obj+"&action=index"; } function fnDown(obj){ From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 06:11:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 14:11:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9836 - in /vtigercrm/branches/5.0.3: Smarty/templates/pendingActivities.tpl Smarty/templates/upcomingActivities.tpl modules/Calendar/Save.php modules/Calendar/language/en_us.lang.php Message-ID: <20061114141117.59F357893F9@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 07:11:09 2006 New Revision: 9836 Log: language support added for invitees mail in calendar Modified: vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl vtigercrm/branches/5.0.3/Smarty/templates/upcomingActivities.tpl vtigercrm/branches/5.0.3/modules/Calendar/Save.php vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl Tue Nov 14 07:11:09 2006 @@ -9,19 +9,36 @@ * ********************************************************************************/ -->*} -{if $ACTIVITIES.1.noofactivities > 0} -{assign var=label value=$ACTIVITIES.1.Title.0} +{if $ACTIVITIES.2.noofactivities > 0 || $ACTIVITIES.3.noofactivities > 0} + + +
+{assign var=label value=$ACTIVITIES.2.Title.0} @@ -33,7 +50,47 @@ - {foreach item=entries name=entryloop from=$ACTIVITIES.1.Entries} + {if $ACTIVITIES.2.noofactivities != 0} + {foreach item=entries name=entryloop from=$ACTIVITIES.2.Entries} + + + + + + {/foreach} + {else} + + + + {/if} +
- {$APP.$label} {$APP.LBL_PENDING_EVENTS} ({$ACTIVITIES.1.noofactivities})
+ {$APP.$label} {$APP.LBL_PENDING_EVENTS} ({$ACTIVITIES.2.noofactivities})
{$APP.LBL_SHOW} - {if $ACTIVITIES.1.Title.0 eq 'today'} - {$APP.LBL_TODAY}  |  {$APP.LBL_ALL} - {else} - {$APP.LBL_TODAY}  |  {$APP.LBL_ALL} - {/if} + {$APP.LBL_TODAY}  |  {$APP.LBL_ALL}
 
{math equation="x+1" x=$smarty.foreach.entryloop.index}{$entries.IMAGE}{$entries.0}{*
{$entries.ACCOUNT_NAME*}
{$APP.LBL_NONE_SCHEDULED}
+
+ + + +
+ + + - - - - - +{**} + + +
+ + + + + +
+
+ +
+ {include file='SetMenu.tpl'} + + + + + + + + + + + + + + + + +
{$MOD.LBL_SETTINGS} > {$CMOD.LBL_ROLES} > {$CMOD.LBL_VIEWING} "{$ROLE_NAME}"
{$CMOD.LBL_VIEWING} {$CMOD.LBL_PROPERTIES} "{$ROLE_NAME}" {$MOD.LBL_LIST_CONTACT_ROLE}
+ +
+ + + + +
+ + + + + + +
{$CMOD.LBL_PROPERTIES} "{$ROLE_NAME}"
+ +
+ + + + + + + + + + + + + +
{$CMOD.LBL_ROLE_NAME}{$ROLE_NAME}
{$CMOD.LBL_REPORTS_TO}{$PARENTNAME}
{$CMOD.LBL_MEMBER} + + + + + {foreach item=elements from=$ROLEINFO.profileinfo} + + + + + + {/foreach} + + + + {if $ROLEINFO.userinfo.0 neq ''} + {foreach item=elements from=$ROLEINFO.userinfo} + + + + + + {/foreach} + {/if} +
+
{$CMOD.LBL_ASSOCIATED_PROFILES}
+
+ {$elements.1}
+
+
{$CMOD.LBL_ASSOCIATED_USERS}
+
+ {$elements.1}
+
+
+ + +
{$MOD.LBL_SCROLL}
+ + +
+ + + +
+ + + + + + + + + + + Modified: vtigercrm/branches/5.0.3/Smarty/templates/SetMenu.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/SetMenu.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/SetMenu.tpl Thu Nov 23 08:23:17 2006 @@ -30,9 +30,9 @@ {/if} {if $smarty.request.action eq 'listroles' || $smarty.request.action eq 'RoleDetailView' || $smarty.request.action eq 'saverole' || $smarty.request.action eq 'createrole' || $smarty.request.action eq 'RoleDeleteStep1'} - {$MOD.LBL_ROLES} + {$MOD.LBL_ROLES} {else} - {$MOD.LBL_ROLES} + {$MOD.LBL_ROLES} {/if} {if $smarty.request.action eq 'ListProfiles' || $smarty.request.action eq 'profilePrivileges' || $smarty.request.action eq 'CreateProfile' || $smarty.request.action eq 'SaveProfile' || $smarty.request.action eq 'UpdateProfileChanges' } Modified: vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php Thu Nov 23 08:23:17 2006 @@ -725,6 +725,20 @@ 'LBL_ENABLE'=>'Enable', 'LBL_FAQ_FIELD_ACCESS'=>'Faq Field Access', 'LBL_ADD_TAX_BUTTON'=>'Add Tax', +//Added while moving role file from User to Setting Module +'LBL_ROLES'=>'Roles', +'LBL_CREATE_NEW_ROLE'=>'Create New Role', +'LBL_PROPERTIES'=>'Properties of', +'LBL_NEW_ROLE'=>'New Role', +'LBL_ROLE_NAME'=>'Role Name', +'LBL_REPORTS_TO'=>'Reports to', +'LBL_PROFILE_M'=>'Profile', +'LBL_PROFILES_AVLBL'=>'Profiles Available', +'LBL_ASSIGN_PROFILES'=>'Assigned Profiles', +'LBL_MEMBER'=>'Members', +'LBL_DELETE_ROLE'=>'Delete Role', +'LBL_ROLE_TO_BE_DELETED'=>'Role to be Deleted', +'LBL_TRANSFER_USER_ROLE'=>'Transfer Users to Role', ); Modified: vtigercrm/branches/5.0.3/modules/Users/DeleteRole.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/DeleteRole.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/DeleteRole.php Thu Nov 23 08:23:17 2006 @@ -15,5 +15,5 @@ deleteRole($del_id,$tran_id); -header("Location: index.php?action=listroles&module=Users"); +header("Location: index.php?action=listroles&module=Settings"); ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 23 07:28:14 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 23 Nov 2006 15:28:14 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9902 - /vtigercrm/branches/5.0.3/index.php Message-ID: <20061123152815.176AD7895FC@vtiger.fosslabs.com> Author: richie Date: Thu Nov 23 08:28:11 2006 New Revision: 9902 Log: version changed to 5.0.3 Modified: vtigercrm/branches/5.0.3/index.php Modified: vtigercrm/branches/5.0.3/index.php ============================================================================== --- vtigercrm/branches/5.0.3/index.php (original) +++ vtigercrm/branches/5.0.3/index.php Thu Nov 23 08:28:11 2006 @@ -643,7 +643,7 @@ echo ""; echo ''; echo "


"; - echo ""; + echo ""; echo "
vtiger CRM 5.0.2 | Visit www.vtiger.com for more information
vtiger CRM 5.0.3 | Visit www.vtiger.com for more information © Copyright Details
"; // echo "'; + $listview_entries[$num][] = ''; else - $listview_entries[$num][] = ''; + $listview_entries[$num][] = ''; return $listview_entries[$num]; } Modified: vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php Thu Nov 23 08:32:31 2006 @@ -114,7 +114,7 @@ } function downloadAttachments() { - return $this->dl_attachments($this->mailid,$this->mbox); + return $this->dl_attachments(); } function load_headers() { @@ -146,7 +146,7 @@ } private function get_attachments() { - $struct = imap_fetchstructure($this->mbox, $this->mailid); + $struct = @imap_fetchstructure($this->mbox, $this->mailid); $parts = $struct->parts; $done="false"; @@ -217,177 +217,361 @@ return 0; } - private function dl_inline() { - $struct = imap_fetchstructure($this->mbox, $this->mailid); - $parts = $struct->parts; - - $i = 0; - if (!$parts) - return; - else { - - $stack = array(); - $inline = array(); - - $endwhile = false; - - while (!$endwhile) { - if (!$parts[$i]) { - if (count($stack) > 0) { - $parts = $stack[count($stack)-1]["p"]; - $i = $stack[count($stack)-1]["i"] + 1; - array_pop($stack); - } else { - $endwhile = true; - } - } - if (!$endwhile) { - - $partstring = ""; - foreach ($stack as $s) { - $partstring .= ($s["i"]+1) . "."; - } - $partstring .= ($i+1); - - if (strtoupper($parts[$i]->disposition) == "INLINE") - $inline[] = array("filename" => $parts[$i]->dparameters[0]->value,"filedata"=>imap_fetchbody($this->mbox, $this->mailid, $partstring),"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); - } - if ($parts[$i]->parts) { - $stack[] = array("p" => $parts, "i" => $i); - $parts = $parts[$i]->parts; - $i = 0; - } else { - $i++; - } - } - } - return $inline; - } - - private function dl_attachments() { - $struct = imap_fetchstructure($this->mbox, $this->mailid); - $parts = $struct->parts; - - $content = array(); - $i = 0; - if (!$parts) - return; - else { - - $stack = array(); - $attachment = array(); - - $endwhile = false; - - while (!$endwhile) { - if (!$parts[$i]) { - if (count($stack) > 0) { - $parts = $stack[count($stack)-1]["p"]; - $i = $stack[count($stack)-1]["i"] + 1; - array_pop($stack); - } else { - $endwhile = true; - } - } - if (!$endwhile) { - - $partstring = ""; - foreach ($stack as $s) { - $partstring .= ($s["i"]+1) . "."; - } - $partstring .= ($i+1); - - if (strtoupper($parts[$i]->disposition) == "ATTACHMENT") - $attachment[] = array("filename" => $parts[$i]->dparameters[0]->value,"filedata"=>imap_fetchbody($this->mbox, $this->mailid, $partstring),"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); - } - if ($parts[$i]->parts) { - $stack[] = array("p" => $parts, "i" => $i); - $parts = $parts[$i]->parts; - $i = 0; - } else { - $i++; - } - } - } - return $attachment; - } - private function load_mail() { - // parse the message - $struct = imap_fetchstructure($this->mbox, $this->mailid); - $parts = $struct->parts; - - $content = array(); - $i = 0; - if (!$parts) { /* Simple message, only 1 piece */ - $attachment = array(); /* No vtiger_attachments */ - $bod=imap_body($this->mbox, $this->mailid); - if(preg_match("/\/",$bod)) - $content['body'] = $bod; - else - $content['body'] = nl2br($bod); - } else { - - $stack = array(); - $attachment = array(); - - $endwhile = false; - - while (!$endwhile) { - if (!$parts[$i]) { - if (count($stack) > 0) { - $parts = $stack[count($stack)-1]["p"]; - $i = $stack[count($stack)-1]["i"] + 1; - array_pop($stack); - } else { - $endwhile = true; - } - } - $search = array("/=20=/","/=20/","/=\r\n/","/=3D/","@&(disposition) == "INLINE" && strtoupper($parts[$i]->subtype) != "PLAIN") { - $inline[] = array("filename" => $parts[$i]->dparameters[0]->value,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); - } elseif (strtoupper($parts[$i]->disposition) == "ATTACHMENT") { - $attachment[] = array("filename" => $parts[$i]->dparameters[0]->value,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); - - } elseif (strtoupper($parts[$i]->subtype) == "HTML") { - $content['body'] = preg_replace($search,$replace,imap_fetchbody($this->mbox, $this->mailid, $partstring)); - $stat="done"; - } elseif (strtoupper($parts[$i]->subtype) == "TEXT" && !$stat == "done") { - $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); - $stat="done"; - } elseif (strtoupper($parts[$i]->subtype) == "PLAIN" && !$stat == "done") { - $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); - $stat="done"; - } elseif (!$stat == "done") { - $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); - } - } - - if ($parts[$i]->parts) { - $stack[] = array("p" => $parts, "i" => $i); - $parts = $parts[$i]->parts; - $i = 0; - } else { - $i++; - } - } - } - if($struct->encoding==3) - $content['body'] = base64_decode($content['body']); - if($struct->encoding==4) - $content['body'] = quoted_printable_decode($content['body']); - - $ret = Array("content" => $content,"attachments"=>$attachment,"inline"=>$inline); - return $ret; - } + + private function dl_inline() + { + $struct = imap_fetchstructure($this->mbox, $this->mailid); + $parts = $struct->parts; + + $i = 0; + if (!$parts) + return; + else + { + $stack = array(); + $inline = array(); + + $endwhile = false; + + while (!$endwhile) + { + if (!$parts[$i]) + { + if (count($stack) > 0) + { + $parts = $stack[count($stack)-1]["p"]; + $i = $stack[count($stack)-1]["i"] + 1; + array_pop($stack); + } + else + { + $endwhile = true; + } + } + if (!$endwhile) + { + $partstring = ""; + foreach ($stack as $s) + { + $partstring .= ($s["i"]+1) . "."; + } + $partstring .= ($i+1); + + if (strtoupper($parts[$i]->disposition) == "INLINE") + { + //if the type is JPEG or GIF then call mail_fetchpart else fetchbody + if($parts[$i]->subtype == "JPEG" || $parts[$i]->subtype == "GIF") + $filedata = $this->mail_fetchpart($partstring); + else + $filedata = imap_fetchbody($this->mbox, $this->mailid, $partstring); + + $inline[] = array("filename" => $parts[$i]->dparameters[0]->value,"filedata"=>$filedata,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); + } + } + if ($parts[$i]->parts) + { + $stack[] = array("p" => $parts, "i" => $i); + $parts = $parts[$i]->parts; + $i = 0; + } + else + { + $i++; + } + } + } + return $inline; + } + + private function dl_attachments() + { + + $struct = imap_fetchstructure($this->mbox, $this->mailid); + $parts = $struct->parts; + + $i = 0; + if (!$parts) + return; + else + { + $stack = array(); + $attachment = array(); + + $endwhile = false; + + while (!$endwhile) + { + if (!$parts[$i]) + { + if (count($stack) > 0) + { + $parts = $stack[count($stack)-1]["p"]; + $i = $stack[count($stack)-1]["i"] + 1; + array_pop($stack); + } + else + { + $endwhile = true; + } + } + if (!$endwhile) + { + $partstring = ""; + foreach ($stack as $s) + { + $partstring .= ($s["i"]+1) . "."; + } + $partstring .= ($i+1); + + if (strtoupper($parts[$i]->disposition) == "ATTACHMENT") + { + $filedata = $this->mail_fetchpart($partstring); + $attachment[] = array("filename" => $parts[$i]->dparameters[0]->value,"filedata"=>$filedata,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); + } + } + if ($parts[$i]->parts) + { + $stack[] = array("p" => $parts, "i" => $i); + $parts = $parts[$i]->parts; + $i = 0; + } + else + { + $i++; + } + } + } + return $attachment; + } + + + private function load_mail() + { + // parse the message + $struct = imap_fetchstructure($this->mbox, $this->mailid); + $parts = $struct->parts; + + $content = array(); + $i = 0; + if (!$parts) + { + /* Simple message, only 1 piece */ + $attachment = array(); /* No vtiger_attachments */ + $bod=imap_body($this->mbox, $this->mailid); + if(preg_match("/\/",$bod)) + $content['body'] = $bod; + else + $content['body'] = nl2br($bod); + } + else + { + + $stack = array(); + $attachment = array(); + + $endwhile = false; + + while (!$endwhile) + { + if (!$parts[$i]) + { + if (count($stack) > 0) + { + $parts = $stack[count($stack)-1]["p"]; + $i = $stack[count($stack)-1]["i"] + 1; + array_pop($stack); + } + else + { + $endwhile = true; + } + } + $search = array("/=20=/","/=20/","/=\r\n/","/=3D/","@&(disposition) == "INLINE" && strtoupper($parts[$i]->subtype) != "PLAIN") + { + $inline[] = array("filename" => $parts[$i]->dparameters[0]->value,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); + } + elseif (strtoupper($parts[$i]->disposition) == "ATTACHMENT") + { + $attachment[] = array("filename" => $parts[$i]->dparameters[0]->value,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); + + } + elseif (strtoupper($parts[$i]->subtype) == "HTML") + { + $content['body'] = preg_replace($search,$replace,imap_fetchbody($this->mbox, $this->mailid, $partstring)); + $stat="done"; + } + elseif (strtoupper($parts[$i]->subtype) == "TEXT" && !$stat == "done") + { + $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); + $stat="done"; + } + elseif (strtoupper($parts[$i]->subtype) == "PLAIN" && !$stat == "done") + { + $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); + $stat="done"; + } + elseif (!$stat == "done") + { + $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); + } + } + + if ($parts[$i]->parts) + { + $stack[] = array("p" => $parts, "i" => $i); + $parts = $parts[$i]->parts; + $i = 0; + } + else + { + $i++; + } + } + } + if($struct->encoding==3) + $content['body'] = base64_decode($content['body']); + if($struct->encoding==4) + $content['body'] = quoted_printable_decode($content['body']); + + $ret = Array("content" => $content,"attachments"=>$attachment,"inline"=>$inline); + return $ret; + } + + + + + + + + // get the body of a part of a message according to the + // string in $part + function mail_fetchpart($part) + { + $parts = $this->mail_fetchparts(); + + $partNos = explode(".", $part); + + $currentPart = $parts; + while(list ($key, $val) = each($partNos)) + { + $currentPart = $currentPart[$val]; + } + + if ($currentPart != "") return $currentPart; + else return false; + } + + // splits a message given in the body if it is + // a mulitpart mime message and returns the parts, + // if no parts are found, returns false + function mail_mimesplit($header, $body) + { + $parts = array(); + + $PN_EREG_BOUNDARY = "Content-Type:(.*)boundary=\"([^\"]+)\""; + + if (eregi ($PN_EREG_BOUNDARY, $header, $regs)) + { + $boundary = $regs[2]; + + $delimiterReg = "([^\r\n]*)$boundary([^\r\n]*)"; + if (eregi ($delimiterReg, $body, $results)) + { + $delimiter = $results[0]; + $parts = explode($delimiter, $body); + $parts = array_slice ($parts, 1, -1); + } + + return $parts; + } + else + { + return false; + } + } + + // returns an array with all parts that are + // subparts of the given part + // if no subparts are found, return the body of + // the current part + function mail_mimesub($part) + { + $i = 1; + $headDelimiter = "\r\n\r\n"; + $delLength = strlen($headDelimiter); + + // get head & body of the current part + $endOfHead = strpos( $part, $headDelimiter); + $head = substr($part, 0, $endOfHead); + $body = substr($part, $endOfHead + $delLength, strlen($part)); + + // check whether it is a message according to rfc822 + if (stristr($head, "Content-Type: message/rfc822")) + { + $part = substr($part, $endOfHead + $delLength, strlen($part)); + $returnParts[1] = $this->mail_mimesub($part); + return $returnParts; + // if no message, get subparts and call function recursively + } + elseif ($subParts = $this->mail_mimesplit($head, $body)) + { + // got more subparts + while (list ($key, $val) = each($subParts)) + { + $returnParts[$i] = $this->mail_mimesub($val); + $i++; + } + return $returnParts; + } + else + { + return $body; + } + } + + // get an array with the bodies all parts of an email + // the structure of the array corresponds to the + // structure that is available with imap_fetchstructure + function mail_fetchparts() + { + $parts = array(); + $header = imap_fetchheader($this->mbox, $this->mailid); + $body = imap_body($this->mbox, $this->mailid, FT_INTERNAL); + + $i = 1; + + if ($newParts = $this->mail_mimesplit($header, $body)) + { + while (list ($key, $val) = each($newParts)) + { + $parts[$i] = $this->mail_mimesub($val); + $i++; + } + } + else + { + $parts[$i] = $body; + } + return $parts; + } + + + + + + } ?> Modified: vtigercrm/branches/5.0.3/modules/Webmails/body.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/body.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/body.php Thu Nov 23 08:32:31 2006 @@ -31,40 +31,54 @@ el.style.display='block'; } -loadMail(); - echo $email->body; - echo "

"; - if(is_array($email->inline)) { - $inline = $email->downloadInlineAttachments(); - $num=sizeof($inline); - echo "

Inline Attachments:

"; - for($i=0;$i<$num;$i++) { - //var_dump($inline[$i]); - // PLAIN TEXT - if($inline[$i]["subtype"] == "RFC822") { - echo ($i+1).") ".$inline[$i]["filename"].""; - } elseif($inline[$i]["subtype"] == "JPEG" || $inline[$i]["subtype"] == "GIF") { - echo ($i+1).") ".$inline[$i]["filename"]."

'; } + else + echo "
".($i+1).") ".$inline[$i]["filename"]."
"; } +} imap_close($MailBox->mbox); + + ?> Modified: vtigercrm/branches/5.0.3/modules/Webmails/dlAttachments.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/dlAttachments.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/dlAttachments.php Thu Nov 23 08:32:31 2006 @@ -1,4 +1,4 @@ -downloadAttachments(); $inline=$email->downloadInlineAttachments(); -if($num == "" || !isset($num) && count($attachments) >0 ) { - echo "
"; From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 23 07:32:40 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 23 Nov 2006 15:32:40 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9903 - in /vtigercrm/branches/5.0.3: index.php modules/Webmails/MailParse.php modules/Webmails/Webmail.php modules/Webmails/body.php modules/Webmails/dlAttachments.php modules/Webmails/webmails.js Message-ID: <20061123153240.13FEF78962F@vtiger.fosslabs.com> Author: richie Date: Thu Nov 23 08:32:31 2006 New Revision: 9903 Log: * Modified to fix some issues include attachment issues - Mickie Modified: vtigercrm/branches/5.0.3/index.php vtigercrm/branches/5.0.3/modules/Webmails/MailParse.php vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php vtigercrm/branches/5.0.3/modules/Webmails/body.php vtigercrm/branches/5.0.3/modules/Webmails/dlAttachments.php vtigercrm/branches/5.0.3/modules/Webmails/webmails.js Modified: vtigercrm/branches/5.0.3/index.php ============================================================================== --- vtigercrm/branches/5.0.3/index.php (original) +++ vtigercrm/branches/5.0.3/index.php Thu Nov 23 08:32:31 2006 @@ -278,10 +278,9 @@ ereg("^HeadLines",$action) || ereg("^TodoSave",$action) || ereg("^RecalculateSharingRules",$action) || - (ereg("^body",$action) && - ereg("^Webmails",$module)) || - (ereg("^DetailView",$action) && - ereg("^Webmails",$module) )) + (ereg("^body",$action) && ereg("^Webmails",$module)) || + (ereg("^dlAttachments",$action) && ereg("^Webmails",$module)) || + (ereg("^DetailView",$action) && ereg("^Webmails",$module) )) { $skipHeaders=true; //skip headers for all these invocations as they are mostly popups Modified: vtigercrm/branches/5.0.3/modules/Webmails/MailParse.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/MailParse.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/MailParse.php Thu Nov 23 08:32:31 2006 @@ -87,9 +87,9 @@ } if($mails[$start_message]->deleted) - $listview_entries[$num][] = 'del
del
del
del
"; +if($num == "" || !isset($num) && count($attachments) >0 ) +{ + echo "
There are ".count($attachments)." attachment(s) to choose from:
"; - for($i=0;$i"; + for($i=0;$i"; } echo "
 There are ".count($attachments)." attachment(s) to choose from:
".count($attachments).")   ".$attachments[$i]["filename"]."
    ".($i+1).")   ".$attachments[$i]["filename"]."

"; - echo ""; + echo "
There are ".count($inline)." inline attachment(s) to choose from:
"; - for($i=0;$i"; + for($i=0;$i"; } echo "
 There are ".count($inline)." inline attachment(s) to choose from:
".count($inline).")   ".$inline[$i]["filename"]."
    ".($i+1).")   ".$inline[$i]["filename"]."


"; -} elseif (count(attachments) == 0 && count($inline) == 0) { +} +elseif (count($attachments) == 0 && count($inline) == 0) +{ echo "
No vtiger_attachments for this email


"; -} else { +} +else +{ -global $root_directory; -$save_path=$root_directory.'/modules/Webmails/tmp'; -if(!is_dir($save_path)) - mkdir($save_path); + global $root_directory; + $save_path=$root_directory.'/modules/Webmails/tmp'; + if(!is_dir($save_path)) + mkdir($save_path); -$user_dir=$save_path."/".$_SESSION["authenticated_user_id"]; -if(!is_dir($user_dir)) - mkdir($user_dir); + $user_dir=$save_path."/".$_SESSION["authenticated_user_id"]; + if(!is_dir($user_dir)) + mkdir($user_dir); -if(isset($_REQUEST["inline"]) && $_REQUEST["inline"] == "true") { - $fp = fopen($user_dir.'/'.$inline[$num]["filename"], "w") or die("Can't open file"); - fputs($fp, base64_decode($inline[$num]["filedata"])); - $filename = 'modules/Webmails/tmp/'.$_SESSION['authenticated_user_id'].'/'.$inline[$num]['filename']; -} else { - $fp = fopen($user_dir.'/'.$attachments[$num]["filename"], "w") or die("Can't open file"); - fputs($fp, base64_decode($attachments[$num]["filedata"])); - $filename = 'modules/Webmails/tmp/'.$_SESSION['authenticated_user_id'].'/'.$attachments[$num]['filename']; + if(isset($_REQUEST["inline"]) && $_REQUEST["inline"] == "true") + { + $fp = fopen($user_dir.'/'.$inline[$num]["filename"], "w") or die("Can't open file"); + fputs($fp, base64_decode($inline[$num]["filedata"])); + $filename = 'modules/Webmails/tmp/'.$_SESSION['authenticated_user_id'].'/'.$inline[$num]['filename']; + } + else + { + $fp = fopen($user_dir.'/'.$attachments[$num]["filename"], "w") or die("Can't open file"); + fputs($fp, base64_decode($attachments[$num]["filedata"])); + $filename = 'modules/Webmails/tmp/'.$_SESSION['authenticated_user_id'].'/'.$attachments[$num]['filename']; + } + fclose($fp); + imap_close($MailBox->mbox); + + ?> +

File Download

+ mbox); + ?> -

File Download

- Modified: vtigercrm/branches/5.0.3/modules/Webmails/webmails.js ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/webmails.js (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/webmails.js Thu Nov 23 08:32:31 2006 @@ -336,6 +336,10 @@ if(els[i].type === "checkbox" && els[i].name.indexOf("_")) { if(els[i].checked) { var nid = els[i].name.substr((els[i].name.indexOf("_")+1),els[i].name.length); + + //change the selected rows as red when they deleted + $("row_"+nid).className = "delete_email"; + if(typeof nid == 'undefined' || nid == "checkbox") nids += ''; else From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 03:30:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:30:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9904 - /vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Message-ID: <20061127113037.E21997888F4@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:30:22 2006 New Revision: 9904 Log: added field ownedby in vtiger_tab table Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml ============================================================================== --- vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml (original) +++ vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Mon Nov 27 04:30:22 2006 @@ -179,7 +179,8 @@ - + + name From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 03:35:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:35:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9905 - /vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Message-ID: <20061127113535.9841878964E@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:35:26 2006 New Revision: 9905 Log: made changes in vtiger_tab table Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Mon Nov 27 04:35:26 2006 @@ -52,31 +52,31 @@ $this->db->query("insert into vtiger_role values('H".$role5_id."','Sales Man','H".$role1_id."::H".$role2_id."::H".$role3_id."::H".$role4_id."::H".$role5_id."',4)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (3,'Home',0,1,'Home',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (7,'Leads',0,4,'Leads',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (6,'Accounts',0,5,'Accounts',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (4,'Contacts',0,6,'Contacts',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (2,'Potentials',0,7,'Potentials',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (8,'Notes',0,9,'Notes',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (9,'Calendar',0,3,'Calendar',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (10,'Emails',0,10,'Emails',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (13,'HelpDesk',0,11,'HelpDesk',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (14,'Products',0,8,'Products',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (1,'Dashboard',0,12,'Dashboards',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (15,'Faq',0,14,'Faq',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (16,'Events',2,13,'Events',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (18,'Vendors',0,15,'Vendors',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (19,'PriceBooks',0,16,'PriceBooks',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (20,'Quotes',0,17,'Quotes',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (21,'PurchaseOrder',0,18,'PurchaseOrder',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (22,'SalesOrder',0,19,'SalesOrder',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (23,'Invoice',0,20,'Invoice',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (24,'Rss',0,21,'Rss',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (25,'Reports',0,22,'Reports',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (26,'Campaigns',0,23,'Campaigns',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (27,'Portal',0,24,'Portal',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (28,'Webmails',0,25,'Webmails',null,null,1)"); - $this->db->query("insert into vtiger_tab values (29,'Users',0,26,'Users',null,null,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (3,'Home',0,1,'Home',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (7,'Leads',0,4,'Leads',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (6,'Accounts',0,5,'Accounts',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (4,'Contacts',0,6,'Contacts',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (2,'Potentials',0,7,'Potentials',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (8,'Notes',0,9,'Notes',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (9,'Calendar',0,3,'Calendar',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (10,'Emails',0,10,'Emails',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (13,'HelpDesk',0,11,'HelpDesk',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (14,'Products',0,8,'Products',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (1,'Dashboard',0,12,'Dashboards',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (15,'Faq',0,14,'Faq',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (16,'Events',2,13,'Events',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (18,'Vendors',0,15,'Vendors',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (19,'PriceBooks',0,16,'PriceBooks',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (20,'Quotes',0,17,'Quotes',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (21,'PurchaseOrder',0,18,'PurchaseOrder',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (22,'SalesOrder',0,19,'SalesOrder',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (23,'Invoice',0,20,'Invoice',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (24,'Rss',0,21,'Rss',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (25,'Reports',0,22,'Reports',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (26,'Campaigns',0,23,'Campaigns',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (27,'Portal',0,24,'Portal',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (28,'Webmails',0,25,'Webmails',null,null,0,1)"); + $this->db->query("insert into vtiger_tab values (29,'Users',0,26,'Users',null,null,0,1)"); // Populate the vtiger_blocks vtiger_table $this->db->query("insert into vtiger_blocks values (1,2,'LBL_OPPORTUNITY_INFORMATION',1,0,0,0,0,0)"); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 03:39:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:39:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9906 - /vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php Message-ID: <20061127113913.D070178964E@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:39:00 2006 New Revision: 9906 Log: Added function for group support Modified: vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php Modified: vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php (original) +++ vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php Mon Nov 27 04:39:00 2006 @@ -879,6 +879,56 @@ return $replacedString; } + +/** Function to add module group relation + * @param $module -- module name:: Type varchar + * @param $groupname -- Group Name:: Type varchar + * + */ + function insertIntoGroupRelation($module,$moduleid,$groupname) + { + global $log; + $log->debug("Entering insertIntoGroupRelation(".$module.",".$moduleid.",".$groupname.") method ..."); + global $adb; + + //Get the module grouptable name and the + require_once("modules/$module/$module.php"); + $modObj = new $module(); + + $sql = "insert into ".$modObj->groupTable[0]." values (" .$moduleid .",'".$groupname."')"; + + $adb->query($sql); + $log->debug("Exiting insert2LeadGroupRelation method ..."); + + } + +/** Function to update lead group relation + * @param $module -- module name:: Type varchar + * @param $leadid -- Lead Id:: Type integer + * @param $groupname -- Group Name:: Type varchar + * + */ +function updateModuleGroupRelation($module,$moduleid,$groupname) +{ + global $log; + $log->debug("Entering updateModuleGroupRelation(".$moduleid.",".$groupname.") method ..."); + global $adb; + + //Get the module grouptable name and the + require_once("modules/$module/$module.php"); + $modObj = new $module(); + + //Deleting the existing entry + $sqldelete = "delete from ".$modObj->groupTable[0]." where " .$modObj->groupTable[1] ."=".$moduleid; + $adb->query($sqldelete); + $sql = "insert into ".$modObj->groupTable[0]." values (".$moduleid .",'" .$groupname ."')"; + $adb->query($sql); + $log->debug("Exiting updateLeadGroupRelation method ..."); + +} + + + /** Function to add lead group relation * @param $leadid -- Lead Id:: Type integer * @param $groupname -- Group Name:: Type varchar @@ -1491,7 +1541,8 @@ //If modules is Notes,Products,Vendors,Faq,PriceBook then no sharing if($record_id != '') { - if($module == 'Notes' || $module == 'Products' || $module == 'Faq' || $module == 'Vendors' || $module == 'PriceBooks') + //if($module == 'Notes' || $module == 'Products' || $module == 'Faq' || $module == 'Vendors' || $module == 'PriceBooks') + if(getTabOwnedBy($module) == 0) { $permission = "yes"; $log->debug("Exiting isPermitted method ..."); @@ -4528,45 +4579,9 @@ } else { - - //Current User - $sec_query = " and (vtiger_crmentity.smownerid=".$current_user->id; - - //Subordinate User - $subUsersList=getSubordinateUsersList(); - if($subUsersList != '') - { - $sec_query .= " or vtiger_crmentity.smownerid in".$subUsersList; - } - - //Shared User - $sharedUsersList=getReadSharingUsersList($module); - if($sharedUsersList != '') - { - $sec_query .= " or vtiger_crmentity.smownerid in".$sharedUsersList; - } - - - //Current User Groups - if($module == 'Leads' or $module=='HelpDesk' or $module=='Calendar') - { - $userGroupsList=getCurrentUserGroupList(); - if($userGroupsList != '') - { - $sec_query .= " or (vtiger_crmentity.smownerid in(0) and vtiger_groups.groupid in".$userGroupsList.")"; - } - - //Shared User Groups - $sharedGroupsList=getReadSharingGroupsList($module); - if($sharedGroupsList != '') - { - $sec_query .= " or (vtiger_crmentity.smownerid in(0) and vtiger_groups.groupid in".$sharedGroupsList.")"; - } - - - } - - $sec_query .=") "; + $mobObj = new $module; + $sec_query = $modObj->getListViewSecurityParameter($module); + } $log->debug("Exiting getListViewSecurityParameter method ..."); return $sec_query; @@ -4667,8 +4682,20 @@ function getFieldModuleAccessArray() { global $log; + global $adb; $log->debug("Entering getFieldModuleAccessArray() method ..."); + $fldModArr=Array(); + $query = 'select distinct(name) from vtiger_profile2field inner join vtiger_tab on vtiger_tab.tabid=vtiger_profile2field.tabid'; + $result = $adb->query($query); + $num_rows=$adb->num_rows($result); + for($i=0;$i<$num_rows;$i++) + { + $fldModArr[$adb->query_result($result,$i,'name')]=$adb->query_result($result,$i,'name'); + } + + + /* $fldModArr=Array('Leads'=>'LBL_LEAD_FIELD_ACCESS', 'Accounts'=>'LBL_ACCOUNT_FIELD_ACCESS', 'Contacts'=>'LBL_CONTACT_FIELD_ACCESS', @@ -4687,6 +4714,7 @@ 'Campaigns'=>'LBL_CAMPAIGN_FIELD_ACCESS', 'Faq'=>'LBL_FAQ_FIELD_ACCESS' ); + */ $log->debug("Exiting getFieldModuleAccessArray method ..."); return $fldModArr; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 03:51:50 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:51:50 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9907 - /vtigercrm/branches/5.0.3/data/CRMEntity.php Message-ID: <20061127115150.D470D789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:51:39 2006 New Revision: 9907 Log: The grouprelation code is made generic Modified: vtigercrm/branches/5.0.3/data/CRMEntity.php Modified: vtigercrm/branches/5.0.3/data/CRMEntity.php ============================================================================== --- vtigercrm/branches/5.0.3/data/CRMEntity.php (original) +++ vtigercrm/branches/5.0.3/data/CRMEntity.php Mon Nov 27 04:51:39 2006 @@ -39,6 +39,8 @@ * Contributor(s): ______________________________________.. */ + var $ownedby; + function saveentity($module) { @@ -62,6 +64,12 @@ } } + //Inserting into the group Table + if($this->ownedby == 0) + { + $this->insertIntoGroupTable($module); + } + //Calling the Module specific save code $this->save_module($module); @@ -229,12 +237,18 @@ { $ownerid = $this->column_fields['assigned_user_id']; } - - if($module == 'Products' || $module == 'Notes' || $module =='Faq' || $module == 'Vendors' || $module == 'PriceBooks') + + $sql="select ownedby from vtiger_tab where name='".$module."'"; + $res=$adb->query($sql); + $this->ownedby = $adb->query_result($res,0,'ownedby'); + + if($this->ownedby == 1) { $log->info("module is =".$module); $ownerid = $current_user->id; - } + } + + if($module == 'Events') { $module = 'Calendar'; @@ -276,6 +290,12 @@ $sql1 = "insert into vtiger_ownernotify values(".$this->id.",".$ownerid.",null)"; $adb->query($sql1); } + + + + + + } else { @@ -288,6 +308,9 @@ $adb->query($sql); $this->id = $current_id; } + + + } @@ -510,168 +533,14 @@ $adb->query($sql1); } - //to disable the update of groupentity relation in ajax edit for the fields except assigned_user_id field - if($_REQUEST['ajxaction'] != 'DETAILVIEW' || ($_REQUEST['ajxaction'] == 'DETAILVIEW' && $_REQUEST['fldName'] == 'assigned_user_id')) - { - if($_REQUEST['assigntype'] == 'T') - { - $groupname = $_REQUEST['assigned_group_name']; - //echo 'about to update lead group relation'; - if($module == 'Leads' && $table_name == 'vtiger_leaddetails') - { - updateLeadGroupRelation($this->id,$groupname); - } - elseif($module == 'Accounts' && $table_name == 'vtiger_account') - { - updateAccountGroupRelation($this->id,$groupname); - } - elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') - { - updateContactGroupRelation($this->id,$groupname); - } - elseif($module == 'Potentials' && $table_name == 'vtiger_potential') - { - updatePotentialGroupRelation($this->id,$groupname); - } - elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') - { - updateQuoteGroupRelation($this->id,$groupname); - } - elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') - { - updateSoGroupRelation($this->id,$groupname); - } - elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') - { - updateInvoiceGroupRelation($this->id,$groupname); - } - elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') - { - updatePoGroupRelation($this->id,$groupname); - } - elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') - { - updateTicketGroupRelation($this->id,$groupname); - } - elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') - { - updateCampaignGroupRelation($this->id,$groupname); - } - elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') - { - if($table_name == 'vtiger_activity') - { - updateActivityGroupRelation($this->id,$groupname); - } - } - - - } - else - { - //echo 'about to update lead group relation again!'; - if($module == 'Leads' && $table_name == 'vtiger_leaddetails') - { - updateLeadGroupRelation($this->id,''); - } - elseif($module == 'Accounts' && $table_name == 'vtiger_account') - { - updateAccountGroupRelation($this->id,''); - } - elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') - { - updateContactGroupRelation($this->id,''); - } - elseif($module == 'Potentials' && $table_name == 'vtiger_potential') - { - updatePotentialGroupRelation($this->id,''); - } - elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') - { - updateQuoteGroupRelation($this->id,''); - } - elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') - { - updateSoGroupRelation($this->id,''); - } - elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') - { - updateInvoiceGroupRelation($this->id,''); - } - elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') - { - updatePoGroupRelation($this->id,''); - } - elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') - { - updateTicketGroupRelation($this->id,''); - } - elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') - { - updateCampaignGroupRelation($this->id,$groupname); - } - elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') - { - if($table_name == 'vtiger_activity') - { - updateActivityGroupRelation($this->id,$groupname); - } - } - - - } - } + } else - { + { $sql1 = "insert into ".$table_name." (".$column.") values(".$value.")"; $adb->query($sql1); - $groupname = $_REQUEST['assigned_group_name']; - if($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_leaddetails') - { - insert2LeadGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_account') - { - insert2AccountGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_contactdetails') - { - insert2ContactGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_potential') - { - insert2PotentialGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_quotes') - { - insert2QuoteGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_salesorder') - { - insert2SoGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_invoice') - { - insert2InvoiceGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_purchaseorder') - { - insert2PoGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_activity') - { - insert2ActivityGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_troubletickets') - { - insert2TicketGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_campaign') - { - insert2CampaignGroupRelation($this->id,$groupname); - } + } @@ -750,9 +619,10 @@ $fieldcolname = $adb->query_result($result1,$i,"columnname"); $tablename = $adb->query_result($result1,$i,"tablename"); $fieldname = $adb->query_result($result1,$i,"fieldname"); - + $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); $this->column_fields[$fieldname] = $fld_value; + } if($module == 'Users') @@ -1020,6 +890,41 @@ $tracker->track_view($user_id, $current_module, $id, ''); } + function insertIntoGroupTable($module) + { + if($this->mode=='edit') + { + + //to disable the update of groupentity relation in ajax edit for the fields except assigned_user_id field + if($_REQUEST['ajxaction'] != 'DETAILVIEW' || ($_REQUEST['ajxaction'] == 'DETAILVIEW' && $_REQUEST['fldName'] == 'assigned_user_id')) + { + if($_REQUEST['assigntype'] == 'T') + { + $groupname = $_REQUEST['assigned_group_name']; + updateModuleGroupRelation($module,$this->id,$groupname); + + } + else + { + updateModuleGroupRelation($module,$this->id,''); + + } + } + } + else + { + + + $groupname = $_REQUEST['assigned_group_name']; + if($_REQUEST['assigntype'] == 'T') + { + insertIntoGroupRelation($module,$this->id,$groupname); + } + + } + + } + } From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 03:54:42 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:54:42 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9908 - /vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Message-ID: <20061127115442.92B82789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:54:34 2006 New Revision: 9908 Log: group handling code made generic Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Mon Nov 27 04:54:34 2006 @@ -329,6 +329,42 @@ return $tabid; } + + +/** + * Function to get the ownedby value for the specified module + * Takes the input as $module - module name + * returns the tabid, integer type + */ + +function getTabOwnedBy($module) +{ + global $log; + $log->debug("Entering getTabid(".$module.") method ..."); + + $tabid=getTabid($module); + + if (file_exists('tabdata.php') && (filesize('tabdata.php') != 0)) + { + include('tabdata.php'); + $tab_ownedby= $tab_ownedby_array[$tabid]; + } + else + { + + $log->info("module is ".$module); + global $adb; + $sql = "select ownedby from vtiger_tab where name='".$module."'"; + $result = $adb->query($sql); + $tab_ownedby= $adb->query_result($result,0,"ownedby"); + } + $log->debug("Exiting getTabid method ..."); + return $tab_ownedby; + +} + + + /** * Function to get the tabid @@ -617,6 +653,14 @@ { $sql = "select vtiger_activitygrouprelation.groupname,vtiger_groups.groupid from vtiger_activitygrouprelation inner join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_activitygrouprelation.activityid=".$id; } + else + { + $modObj = new $module(); + + $sql = "select ".$modObj->groupTable[0].".groupname,vtiger_groups.groupid from ".$modObj->groupTable[0]." inner join vtiger_groups on vtiger_groups.groupname=".$modObj->groupTable[0].".groupname where ".$modObj->groupTable[0].".".$modObj->groupTable[1]."=".$id; + } + + $result = $adb->query($sql); $group_info[] = $adb->query_result($result,0,"groupname"); $group_info[] = $adb->query_result($result,0,"groupid"); @@ -1644,13 +1688,17 @@ $num_rows=$adb->num_rows($result); $result_array=Array(); $seq_array=Array(); + $ownedby_array=Array(); + for($i=0;$i<$num_rows;$i++) { $tabid=$adb->query_result($result,$i,'tabid'); $tabname=$adb->query_result($result,$i,'name'); $presence=$adb->query_result($result,$i,'presence'); + $ownedby=$adb->query_result($result,$i,'ownedby'); $result_array[$tabname]=$tabid; $seq_array[$tabid]=$presence; + $ownedby_array[$tabid]=$ownedby; } @@ -1699,6 +1747,8 @@ $newbuf .= "\$tab_info_array=".constructArray($result_array).";\n"; $newbuf .= "\n"; $newbuf .= "\$tab_seq_array=".constructArray($seq_array).";\n"; + $newbuf .= "\n"; + $newbuf .= "\$tab_ownedby_array=".constructArray($ownedby_array).";\n"; $newbuf .= "\n"; $newbuf .= "\$action_id_array=".constructSingleStringKeyAndValueArray($actionid_array).";\n"; $newbuf .= "\n"; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 04:01:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:01:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9909 - /vtigercrm/branches/5.0.3/modules/Leads/Leads.php Message-ID: <20061127120137.7D3E1789686@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:01:25 2006 New Revision: 9909 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Leads/Leads.php Modified: vtigercrm/branches/5.0.3/modules/Leads/Leads.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Leads/Leads.php (original) +++ vtigercrm/branches/5.0.3/modules/Leads/Leads.php Mon Nov 27 05:01:25 2006 @@ -1,431 +1,433 @@ -'crmid','vtiger_leaddetails'=>'leadid','vtiger_leadsubdetails'=>'leadsubscriptionid','vtiger_leadaddress'=>'leadaddressid','vtiger_leadscf'=>'leadid'); - - var $entity_table = "vtiger_crmentity"; - - //construct this from database; - var $column_fields = Array(); - var $sortby_fields = Array('lastname','firstname','email','phone','company','smownerid','website'); - - // This is used to retrieve related vtiger_fields from form posts. - var $additional_column_fields = Array('smcreatorid', 'smownerid', 'contactid','potentialid' ,'crmid'); - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Last Name'=>Array('leaddetails'=>'lastname'), - 'First Name'=>Array('leaddetails'=>'firstname'), - 'Company'=>Array('leaddetails'=>'company'), - 'Phone'=>Array('leadaddress'=>'phone'), - 'Website'=>Array('leadsubdetails'=>'website'), - 'Email'=>Array('leaddetails'=>'email'), - 'Assigned To'=>Array('crmentity'=>'smownerid') - ); - var $list_fields_name = Array( - 'Last Name'=>'lastname', - 'First Name'=>'firstname', - 'Company'=>'company', - 'Phone'=>'phone', - 'Website'=>'website', - 'Email'=>'email', - 'Assigned To'=>'assigned_user_id' - ); - var $list_link_field= 'lastname'; - - var $search_fields = Array( - 'Name'=>Array('leaddetails'=>'lastname'), - 'Company'=>Array('leaddetails'=>'company') - ); - var $search_fields_name = Array( - 'Name'=>'lastname', - 'Company'=>'company' - ); - - var $required_fields = array("lastname"=>1, 'company'=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'lastname'; - var $default_sort_order = 'ASC'; - - function Leads() { - $this->log = LoggerManager::getLogger('lead'); - $this->log->debug("Entering Leads() method ..."); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Leads'); - $this->log->debug("Exiting Lead method ..."); - } - - /** Function to handle module specific operations when saving a entity - */ - function save_module($module) - { - } - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['LEADS_SORT_ORDER'] != '')?($_SESSION['LEADS_SORT_ORDER']):($this->default_sort_order)); - - $log->debug("Exiting getSortOrder method ..."); - return $sorder; - } - - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'leadname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['LEADS_ORDER_BY'] != '')?($_SESSION['LEADS_ORDER_BY']):($this->default_order_by)); - - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - - /** Function to export the lead records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Leads Query. - */ - function create_export_query(&$order_by, &$where) - { - global $log; - global $current_user; - $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); - - include("include/utils/ExportUtils.php"); - - //To get the Permitted fields query and the permitted fields list - $sql = getPermittedFieldsQuery("Leads", "detail_view"); - $fields_list = getFieldsListFromQuery($sql); - - $query = "SELECT $fields_list, vtiger_leadgrouprelation.groupname as 'Assigned To Group' - FROM ".$this->entity_table." - INNER JOIN vtiger_leaddetails - ON vtiger_crmentity.crmid=vtiger_leaddetails.leadid - LEFT JOIN vtiger_leadsubdetails - ON vtiger_leaddetails.leadid = vtiger_leadsubdetails.leadsubscriptionid - LEFT JOIN vtiger_leadaddress - ON vtiger_leaddetails.leadid=vtiger_leadaddress.leadaddressid - LEFT JOIN vtiger_leadscf - ON vtiger_leadscf.leadid=vtiger_leaddetails.leadid - LEFT JOIN vtiger_leadgrouprelation - ON vtiger_leadscf.leadid = vtiger_leadgrouprelation.leadid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_leadgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status='Active' - "; - - - $where_auto = " vtiger_crmentity.deleted=0 AND vtiger_leaddetails.converted =0"; - - if($where != "") - $query .= "where ($where) AND ".$where_auto; - else - $query .= "where ".$where_auto; - - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - //we should add security check when the user has Private Access - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[7] == 3) - { - //Added security check to get the permitted records only - $query = $query." ".getListViewSecurityParameter("Leads"); - } - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - - $log->debug("Exiting create_export_query method ..."); - return $query; - } - - - - /** Returns a list of the associated tasks - * @param integer $id - leadid - * returns related Task or Event record in array format - */ -function get_activities($id) -{ - global $log, $singlepane_view; - $log->debug("Entering get_activities(".$id.") method ..."); - global $app_strings; - - $focus = new Activity(); - $button = ''; - - if(isPermitted("Calendar",1,"") == 'yes') - { - $button .= ' '; - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; - - - // First, get the list of IDs. - $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') and ((vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') or (vtiger_activity.eventstatus !='' && vtiger_activity.eventstatus != 'Held'))"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Leads','Calendar',$focus,$query,$button,$returnset); -} - -/** Returns a list of the associated Campaigns - * @param $id -- campaign id :: Type Integer - * @returns list of campaigns in array format - */ -function get_campaigns($id) -{ - global $log, $singlepane_view; - $log->debug("Entering get_campaigns(".$id.") method ..."); - global $mod_strings; - $focus = new Campaigns(); - $button = ''; - - if($singlepane_view == 'true') - $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; - - $log->info("Campaign Related List for Lead Displayed"); - $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaignleadrel on vtiger_campaignleadrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaignleadrel.leadid=".$id." and vtiger_crmentity.deleted=0"; - - $log->debug("Exiting get_campaigns method ..."); - return GetRelatedList('Leads','Campaigns',$focus,$query,$button,$returnset); - -} - - - /** Returns a list of the associated emails - * @param integer $id - leadid - * returns related emails record in array format - */ -function get_emails($id) -{ - global $log, $singlepane_view; - $log->debug("Entering get_emails(".$id.") method ..."); - global $mod_strings; - require_once('include/RelatedListView.php'); - - $focus = new Emails(); - - $button = ''; - - if(isPermitted("Emails",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; - - $query ="select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.semodule, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.status, vtiger_activity.priority, vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted=0 and vtiger_seactivityrel.crmid=".$id; - $log->debug("Exiting get_emails method ..."); - return GetRelatedList('Leads','Emails',$focus,$query,$button,$returnset); -} - -/** - * Function to get Lead related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - leadid - * returns related Task or Event record in array format - */ -function get_history($id) -{ - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, - vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name,vtiger_activitygrouprelation.groupname - from vtiger_activity - inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - left join vtiger_users on vtiger_crmentity.smownerid= vtiger_users.id - where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) - and vtiger_seactivityrel.crmid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - - $log->debug("Exiting get_history method ..."); - return getHistory('Leads',$query,$id); -} - -/** - * Function to get Lead related Attachments - * @param integer $id - leadid - * returns related Attachment record in array format - */ -function get_attachments($id) -{ - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, - vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_seattachmentsrel.attachmentsid attachmentsid, vtiger_notes.notesid crmid, - crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - from vtiger_notes - inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 - left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid - left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - $query .= ' union all '; - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - // Inserted order by createdtime desc - $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, - vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_attachments.attachmentsid attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, - crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - from vtiger_attachments - inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id." - order by createdtime desc"; - - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Leads',$query,$id); -} - -/** -* Function to get lead related Products -* @param integer $id - leadid -* returns related Products record in array format -*/ -function get_products($id) -{ - global $log, $singlepane_view; - $log->debug("Entering get_products(".$id.") method ..."); - require_once('modules/Products/Products.php'); - global $mod_strings; - global $app_strings; - - $focus = new Products(); - - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; - - $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_leaddetails on vtiger_leaddetails.leadid = vtiger_seproductsrel.crmid where vtiger_leaddetails.leadid = '.$id.' and vtiger_crmentity.deleted = 0'; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Leads','Products',$focus,$query,$button,$returnset); -} - - /** Function to get the Combo List Values of Leads Field - * @param string $list_option - * Returns Combo List Options - */ - function get_lead_field_options($list_option) - { - global $log; - $log->debug("Entering get_lead_field_options(".$list_option.") method ..."); - $comboFieldArray = getComboArray($this->combofieldNames); - $log->debug("Exiting get_lead_field_options method ..."); - return $comboFieldArray[$list_option]; - } - -/** Function to get the Columnnames of the Leads Record -* Used By vtigerCRM Word Plugin -* Returns the Merge Fields for Word Plugin -*/ -function getColumnNames_Lead() -{ - global $log,$current_user; - $log->debug("Entering getColumnNames_Lead() method ..."); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select fieldlabel from vtiger_field where tabid=7"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel 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 where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames_Lead method ..."); - return $mergeflds; -} -//End - -} - -?> +'crmid','vtiger_leaddetails'=>'leadid','vtiger_leadsubdetails'=>'leadsubscriptionid','vtiger_leadaddress'=>'leadaddressid','vtiger_leadscf'=>'leadid'); + + var $entity_table = "vtiger_crmentity"; + + //construct this from database; + var $column_fields = Array(); + var $sortby_fields = Array('lastname','firstname','email','phone','company','smownerid','website'); + + // This is used to retrieve related vtiger_fields from form posts. + var $additional_column_fields = Array('smcreatorid', 'smownerid', 'contactid','potentialid' ,'crmid'); + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Last Name'=>Array('leaddetails'=>'lastname'), + 'First Name'=>Array('leaddetails'=>'firstname'), + 'Company'=>Array('leaddetails'=>'company'), + 'Phone'=>Array('leadaddress'=>'phone'), + 'Website'=>Array('leadsubdetails'=>'website'), + 'Email'=>Array('leaddetails'=>'email'), + 'Assigned To'=>Array('crmentity'=>'smownerid') + ); + var $list_fields_name = Array( + 'Last Name'=>'lastname', + 'First Name'=>'firstname', + 'Company'=>'company', + 'Phone'=>'phone', + 'Website'=>'website', + 'Email'=>'email', + 'Assigned To'=>'assigned_user_id' + ); + var $list_link_field= 'lastname'; + + var $search_fields = Array( + 'Name'=>Array('leaddetails'=>'lastname'), + 'Company'=>Array('leaddetails'=>'company') + ); + var $search_fields_name = Array( + 'Name'=>'lastname', + 'Company'=>'company' + ); + + var $required_fields = array("lastname"=>1, 'company'=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'lastname'; + var $default_sort_order = 'ASC'; + + var $groupTable = Array('vtiger_leadgrouprelation','leadid'); + + function Leads() { + $this->log = LoggerManager::getLogger('lead'); + $this->log->debug("Entering Leads() method ..."); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Leads'); + $this->log->debug("Exiting Lead method ..."); + } + + /** Function to handle module specific operations when saving a entity + */ + function save_module($module) + { + } + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['LEADS_SORT_ORDER'] != '')?($_SESSION['LEADS_SORT_ORDER']):($this->default_sort_order)); + + $log->debug("Exiting getSortOrder method ..."); + return $sorder; + } + + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'leadname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['LEADS_ORDER_BY'] != '')?($_SESSION['LEADS_ORDER_BY']):($this->default_order_by)); + + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + + /** Function to export the lead records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Leads Query. + */ + function create_export_query(&$order_by, &$where) + { + global $log; + global $current_user; + $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); + + include("include/utils/ExportUtils.php"); + + //To get the Permitted fields query and the permitted fields list + $sql = getPermittedFieldsQuery("Leads", "detail_view"); + $fields_list = getFieldsListFromQuery($sql); + + $query = "SELECT $fields_list, vtiger_leadgrouprelation.groupname as 'Assigned To Group' + FROM ".$this->entity_table." + INNER JOIN vtiger_leaddetails + ON vtiger_crmentity.crmid=vtiger_leaddetails.leadid + LEFT JOIN vtiger_leadsubdetails + ON vtiger_leaddetails.leadid = vtiger_leadsubdetails.leadsubscriptionid + LEFT JOIN vtiger_leadaddress + ON vtiger_leaddetails.leadid=vtiger_leadaddress.leadaddressid + LEFT JOIN vtiger_leadscf + ON vtiger_leadscf.leadid=vtiger_leaddetails.leadid + LEFT JOIN vtiger_leadgrouprelation + ON vtiger_leadscf.leadid = vtiger_leadgrouprelation.leadid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_leadgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status='Active' + "; + + + $where_auto = " vtiger_crmentity.deleted=0 AND vtiger_leaddetails.converted =0"; + + if($where != "") + $query .= "where ($where) AND ".$where_auto; + else + $query .= "where ".$where_auto; + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + //we should add security check when the user has Private Access + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[7] == 3) + { + //Added security check to get the permitted records only + $query = $query." ".getListViewSecurityParameter("Leads"); + } + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + + $log->debug("Exiting create_export_query method ..."); + return $query; + } + + + + /** Returns a list of the associated tasks + * @param integer $id - leadid + * returns related Task or Event record in array format + */ +function get_activities($id) +{ + global $log, $singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $app_strings; + + $focus = new Activity(); + $button = ''; + + if(isPermitted("Calendar",1,"") == 'yes') + { + $button .= ' '; + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + + + // First, get the list of IDs. + $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') and ((vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') or (vtiger_activity.eventstatus !='' && vtiger_activity.eventstatus != 'Held'))"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Leads','Calendar',$focus,$query,$button,$returnset); +} + +/** Returns a list of the associated Campaigns + * @param $id -- campaign id :: Type Integer + * @returns list of campaigns in array format + */ +function get_campaigns($id) +{ + global $log, $singlepane_view; + $log->debug("Entering get_campaigns(".$id.") method ..."); + global $mod_strings; + $focus = new Campaigns(); + $button = ''; + + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + + $log->info("Campaign Related List for Lead Displayed"); + $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaignleadrel on vtiger_campaignleadrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaignleadrel.leadid=".$id." and vtiger_crmentity.deleted=0"; + + $log->debug("Exiting get_campaigns method ..."); + return GetRelatedList('Leads','Campaigns',$focus,$query,$button,$returnset); + +} + + + /** Returns a list of the associated emails + * @param integer $id - leadid + * returns related emails record in array format + */ +function get_emails($id) +{ + global $log, $singlepane_view; + $log->debug("Entering get_emails(".$id.") method ..."); + global $mod_strings; + require_once('include/RelatedListView.php'); + + $focus = new Emails(); + + $button = ''; + + if(isPermitted("Emails",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + + $query ="select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.semodule, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.status, vtiger_activity.priority, vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted=0 and vtiger_seactivityrel.crmid=".$id; + $log->debug("Exiting get_emails method ..."); + return GetRelatedList('Leads','Emails',$focus,$query,$button,$returnset); +} + +/** + * Function to get Lead related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id - leadid + * returns related Task or Event record in array format + */ +function get_history($id) +{ + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, + vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name,vtiger_activitygrouprelation.groupname + from vtiger_activity + inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + left join vtiger_users on vtiger_crmentity.smownerid= vtiger_users.id + where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) + and vtiger_seactivityrel.crmid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + + $log->debug("Exiting get_history method ..."); + return getHistory('Leads',$query,$id); +} + +/** + * Function to get Lead related Attachments + * @param integer $id - leadid + * returns related Attachment record in array format + */ +function get_attachments($id) +{ + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, + vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_seattachmentsrel.attachmentsid attachmentsid, vtiger_notes.notesid crmid, + crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + from vtiger_notes + inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 + left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid + left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + $query .= ' union all '; + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + // Inserted order by createdtime desc + $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, + vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_attachments.attachmentsid attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, + crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + from vtiger_attachments + inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id." + order by createdtime desc"; + + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Leads',$query,$id); +} + +/** +* Function to get lead related Products +* @param integer $id - leadid +* returns related Products record in array format +*/ +function get_products($id) +{ + global $log, $singlepane_view; + $log->debug("Entering get_products(".$id.") method ..."); + require_once('modules/Products/Products.php'); + global $mod_strings; + global $app_strings; + + $focus = new Products(); + + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + + $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_leaddetails on vtiger_leaddetails.leadid = vtiger_seproductsrel.crmid where vtiger_leaddetails.leadid = '.$id.' and vtiger_crmentity.deleted = 0'; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Leads','Products',$focus,$query,$button,$returnset); +} + + /** Function to get the Combo List Values of Leads Field + * @param string $list_option + * Returns Combo List Options + */ + function get_lead_field_options($list_option) + { + global $log; + $log->debug("Entering get_lead_field_options(".$list_option.") method ..."); + $comboFieldArray = getComboArray($this->combofieldNames); + $log->debug("Exiting get_lead_field_options method ..."); + return $comboFieldArray[$list_option]; + } + +/** Function to get the Columnnames of the Leads Record +* Used By vtigerCRM Word Plugin +* Returns the Merge Fields for Word Plugin +*/ +function getColumnNames_Lead() +{ + global $log,$current_user; + $log->debug("Entering getColumnNames_Lead() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=7"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel 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 where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames_Lead method ..."); + return $mergeflds; +} +//End + +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 04:06:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:06:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9910 - /vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php Message-ID: <20061127120609.7FEF5789686@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:05:56 2006 New Revision: 9910 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php Modified: vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php (original) +++ vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php Mon Nov 27 05:05:56 2006 @@ -1,869 +1,871 @@ -'crmid','vtiger_contactdetails'=>'contactid','vtiger_contactaddress'=>'contactaddressid','vtiger_contactsubdetails'=>'contactsubscriptionid','vtiger_contactscf'=>'contactid','vtiger_customerdetails'=>'customerid','vtiger_attachments'=>'attachmentsid'); - - - - var $column_fields = Array(); - - var $sortby_fields = Array('lastname','firstname','title','email','phone','smownerid','accountid'); - - var $list_link_field= 'lastname'; - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Last Name' => Array('contactdetails'=>'lastname'), - 'First Name' => Array('contactdetails'=>'firstname'), - 'Title' => Array('contactdetails'=>'title'), - 'Account Name' => Array('account'=>'accountname'), - 'Email' => Array('contactdetails'=>'email'), - 'Phone' => Array('contactdetails'=>'phone'), - 'Assigned To' => Array('crmentity'=>'smownerid') - ); - - var $range_fields = Array( - 'first_name', - 'last_name', - 'primary_address_city', - 'account_name', - 'account_id', - 'id', - 'email1', - 'salutation', - 'title', - 'phone_mobile', - 'reports_to_name', - 'primary_address_street', - 'primary_address_city', - 'primary_address_state', - 'primary_address_postalcode', - 'primary_address_country', - 'alt_address_city', - 'alt_address_street', - 'alt_address_city', - 'alt_address_state', - 'alt_address_postalcode', - 'alt_address_country', - 'office_phone', - 'home_phone', - 'other_phone', - 'fax', - 'department', - 'birthdate', - 'assistant_name', - 'assistant_phone'); - - - var $list_fields_name = Array( - 'Last Name' => 'lastname', - 'First Name' => 'firstname', - 'Title' => 'title', - 'Account Name' => 'accountid', - 'Email' => 'email', - 'Phone' => 'phone', - 'Assigned To' => 'assigned_user_id' - ); - - var $search_fields = Array( - 'Name' => Array('contactdetails'=>'lastname'), - 'Title' => Array('contactdetails'=>'title') - ); - - var $search_fields_name = Array( - 'Name' => 'lastname', - 'Title' => 'title' - ); - - // This is the list of vtiger_fields that are required - var $required_fields = array("lastname"=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'lastname'; - var $default_sort_order = 'ASC'; - - function Contacts() { - $this->log = LoggerManager::getLogger('contact'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Contacts'); - } - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['CONTACTS_SORT_ORDER'] != '')?($_SESSION['CONTACTS_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder method ..."); - return $sorder; - } - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'Contactname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['CONTACTS_ORDER_BY'] != '')?($_SESSION['CONTACTS_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - /** Function to get the number of Contacts assigned to a particular User. - * @param varchar $user name - Assigned to User - * Returns the count of contacts assigned to user. - */ - function getCount($user_name) - { - global $log; - $log->debug("Entering getCount(".$user_name.") method ..."); - $query = "select count(*) from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - - - $log->debug("Exiting getCount method ..."); - return $row["count(*)"]; - } - /** Function to get the Contact Details assigned to a given User ID which has a valid Email Address. - * @param varchar $user_name - User Name (eg. Admin) - * @param varchar $email_address - Email Addr of each contact record. - * Returns the query. - */ - function get_contacts1($user_name,$email_address) - { - global $log; - $log->debug("Entering get_contacts1(".$user_name.",".$email_address.") method ..."); - $query = "select vtiger_users.user_name, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name,vtiger_account.accountid as account_id from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%" .$email_address ."%' limit 50"; - - $log->debug("Exiting get_contacts1 method ..."); - return $this->process_list_query1($query); - } - /** Function to get the Contact Details assigned to a particular User based on the starting count and the number of subsequent records. - * @param varchar $user_name - Assigned User - * @param integer $from_index - Initial record number to be displayed - * @param integer $offset - Count of the subsequent records to be displayed. - * Returns Query. - */ - function get_contacts($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_contacts(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.department department, vtiger_contactdetails.phone office_phone, vtiger_contactdetails.fax fax, vtiger_contactsubdetails.assistant assistant_name, vtiger_contactsubdetails.otherphone other_phone, vtiger_contactsubdetails.homephone home_phone,vtiger_contactsubdetails.birthday birthdate, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name,vtiger_account.accountid as account_id, vtiger_contactaddress.mailingcity as primary_address_city,vtiger_contactaddress.mailingstreet as primary_address_street, vtiger_contactaddress.mailingcountry as primary_address_country,vtiger_contactaddress.mailingstate as primary_address_state, vtiger_contactaddress.mailingzip as primary_address_postalcode, vtiger_contactaddress.othercity as alt_address_city,vtiger_contactaddress.otherstreet as alt_address_street, vtiger_contactaddress.othercountry as alt_address_country,vtiger_contactaddress.otherstate as alt_address_state, vtiger_contactaddress.otherzip as alt_address_postalcode from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 limit " .$from_index ."," .$offset; - - $log->debug("Exiting get_contacts method ..."); - return $this->process_list_query1($query); - } - - - /** Function to process list query for a given query - * @param $query - * Returns the results of query in array format - */ - function process_list_query1($query) - { - global $log; - $log->debug("Entering process_list_query1(".$query.") method ..."); - - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - $contact = Array(); - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - - { - foreach($this->range_fields as $columnName) - { - if (isset($row[$columnName])) { - - $contact[$columnName] = $row[$columnName]; - } - else - { - $contact[$columnName] = ""; - } - } -// TODO OPTIMIZE THE QUERY ACCOUNT NAME AND ID are set separetly for every vtiger_contactdetails and hence -// vtiger_account query goes for ecery single vtiger_account row - - $list[] = $contact; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - - $log->debug("Exiting process_list_query1 method ..."); - return $response; - } - - - /** Function to process list query for Plugin with Security Parameters for a given query - * @param $query - * Returns the results of query in array format - */ - function plugin_process_list_query($query) - { - global $log,$adb,$current_user; - $log->debug("Entering process_list_query1(".$query.") method ..."); - $permitted_field_lists = Array(); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select columnname from vtiger_field where tabid=4 and block <> 75"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select columnname 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 where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result1 = $this->db->query($sql1); - for($i=0;$i < $adb->num_rows($result1);$i++) - { - $permitted_field_lists[] = $adb->query_result($result1,$i,'columnname'); - } - - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - { - $contact = Array(); - foreach($permitted_field_lists as $columnName) - { - if ($columnName == "lastname" || $columnName == "firstname" || $columnName == "email") - { - $contact[$columnName] = $row[$columnName]; - } - else - { - $contact[$columnName] = ""; - } - } - if(in_array("accountid",$permitted_field_lists)) - { - $contact[accountname] = $row[accountname]; - $contact[account_id] = $row[accountid]; - } - $contact[contactid] = $row[contactid]; - $list[] = $contact; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - $log->debug("Exiting process_list_query1 method ..."); - return $response; - } - - - /** Returns a list of the associated opportunities - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_opportunities($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_opportunities(".$id.") method ..."); - global $mod_strings; - - $focus = new Potentials(); - $button = ''; - - if(isPermitted("Potentials",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $log->info("Potential Related List for Contact Displayed"); - - // First, get the list of IDs. - $query = 'select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.accountid, vtiger_contactdetails.contactid , vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.potentialtype, vtiger_potential.sales_stage, vtiger_potential.amount, vtiger_potential.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_contactdetails inner join vtiger_potential on vtiger_contactdetails.accountid = vtiger_potential.accountid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid left join vtiger_potentialgrouprelation on vtiger_potential.potentialid=vtiger_potentialgrouprelation.potentialid left join vtiger_groups on vtiger_groups.groupname=vtiger_potentialgrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted=0'; - if($this->column_fields['account_id'] != 0) - $log->debug("Exiting get_opportunities method ..."); - return GetRelatedList('Contacts','Potentials',$focus,$query,$button,$returnset); - } - - - /** Returns a list of the associated tasks - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_activities($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - - $focus = new Activity(); - - $button = ''; - - if(isPermitted("Calendar",1,"") == 'yes') - { - $button .= ' '; - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $log->info("Activity Related List for Contact Displayed"); - - $query = "SELECT vtiger_users.user_name,vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.activityid , vtiger_activity.subject, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.due_date, vtiger_cntactivityrel.contactid, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_recurringevents.recurringtype from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid = vtiger_contactdetails.contactid inner join vtiger_activity on vtiger_cntactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_cntactivityrel.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_contactdetails.contactid=".$id." and vtiger_crmentity.deleted = 0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') "; //recurring type is added in Query -Jaguar - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Contacts','Calendar',$focus,$query,$button,$returnset); - - } - /** - * Function to get Contact related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - contactid - * returns related Task or Event record in array format - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus, - vtiger_activity.activitytype, vtiger_contactdetails.contactid, vtiger_contactdetails.firstname, - vtiger_contactdetails.lastname, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name - from vtiger_activity - inner join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid - inner join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id - where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) - and vtiger_cntactivityrel.contactid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - $log->debug("Entering get_history method ..."); - return getHistory('Contacts',$query,$id); - } - /** - * Function to get Contact related Tickets. - * @param integer $id - contactid - * returns related Ticket records in array format - */ - function get_tickets($id) - { - global $log, $singlepane_view; - global $app_strings; - $log->debug("Entering get_tickets(".$id.") method ..."); - $focus = new HelpDesk(); - - $button = ' '; - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $query = "select vtiger_users.user_name,vtiger_crmentity.crmid, vtiger_troubletickets.title, vtiger_contactdetails.contactid, vtiger_troubletickets.parent_id, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_troubletickets.status, vtiger_troubletickets.priority, vtiger_crmentity.smownerid from vtiger_troubletickets inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_ticketgrouprelation on vtiger_troubletickets.ticketid=vtiger_ticketgrouprelation.ticketid left join vtiger_groups on vtiger_groups.groupname=vtiger_ticketgrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; - $log->info("Ticket Related List for Contact Displayed"); - $log->debug("Exiting get_tickets method ..."); - return GetRelatedList('Contacts','HelpDesk',$focus,$query,$button,$returnset); - } - /** - * Function to get Contact related Attachments - * @param integer $id - contactid - * returns related Attachment record in array format - */ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - $query = "select vtiger_notes.title,'Notes ' AS ActivityType, - vtiger_notes.filename, vtiger_attachments.type AS FileType,crm2.modifiedtime AS lastmodified, - vtiger_seattachmentsrel.attachmentsid AS attachmentsid, vtiger_notes.notesid AS crmid, - crm2.createdtime, vtiger_notes.notecontent AS description, vtiger_users.user_name - from vtiger_notes - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_notes.contact_id - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 - left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid - left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - $query .= " union all "; - $query .= "select vtiger_attachments.description AS title,'Attachments' AS ActivityType, - vtiger_attachments.name AS filename, vtiger_attachments.type AS FileType,crm2.modifiedtime AS lastmodified, - vtiger_attachments.attachmentsid AS attachmentsid, vtiger_seattachmentsrel.attachmentsid AS crmid, - crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - from vtiger_attachments - inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id." - order by createdtime desc"; - $log->info("Notes&Attachmenmts for Contact Displayed"); - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Contacts',$query,$id); - } - /** - * Function to get Contact related Quotes - * @param integer $id - contactid - * returns related Quotes record in array format - */ - function get_quotes($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_quotes(".$id.") method ..."); - global $app_strings; - require_once('modules/Quotes/Quotes.php'); - $focus = new Quotes(); - - $button = ''; - if(isPermitted("Quotes",1,"") == 'yes') - { - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_quotes.*,vtiger_potential.potentialname,vtiger_contactdetails.lastname from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_quotes.contactid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; - $log->debug("Exiting get_quotes method ..."); - return GetRelatedList('Contacts','Quotes',$focus,$query,$button,$returnset); - } - /** - * Function to get Contact related SalesOrder - * @param integer $id - contactid - * returns related SalesOrder record in array format - */ - function get_salesorder($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - global $app_strings; - $focus = new SalesOrder(); - $button = ''; - - if(isPermitted("SalesOrder",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_contactdetails.lastname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_salesorder.contactid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.contactid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Contacts','SalesOrder',$focus,$query,$button,$returnset); - } - /** - * Function to get Contact related Products - * @param integer $id - contactid - * returns related Products record in array format - */ - function get_products($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_products(".$id.") method ..."); - global $app_strings; - require_once('modules/Products/Products.php'); - $focus = new Products(); - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_contactdetails.lastname from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_products.contactid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted = 0'; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Contacts','Products',$focus,$query,$button,$returnset); - } - - /** - * Function to get Contact related PurchaseOrder - * @param integer $id - contactid - * returns related PurchaseOrder record in array format - */ - function get_purchase_orders($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_purchase_orders(".$id.") method ..."); - global $app_strings; - require_once('modules/PurchaseOrder/PurchaseOrder.php'); - $focus = new PurchaseOrder(); - - $button = ''; - - if(isPermitted("PurchaseOrder",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_purchaseorder.*,vtiger_vendor.vendorname,vtiger_contactdetails.lastname from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left outer join vtiger_vendor on vtiger_purchaseorder.vendorid=vtiger_vendor.vendorid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_purchaseorder.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_pogrouprelation on vtiger_purchaseorder.purchaseorderid=vtiger_pogrouprelation.purchaseorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_pogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_purchaseorder.contactid=".$id; - $log->debug("Exiting get_purchase_orders method ..."); - return GetRelatedList('Contacts','PurchaseOrder',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated emails - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_emails($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_emails(".$id.") method ..."); - global $mod_strings; - - $focus = new Emails(); - - $button = ''; - - if(isPermitted("Emails",1,"") == 'yes') - { - $button .= ''; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $log->info("Email Related List for Contact Displayed"); - - $query = "select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_users.user_name, vtiger_crmentity.modifiedtime, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_activity.date_start from vtiger_activity, vtiger_seactivityrel, vtiger_contactdetails, vtiger_users, vtiger_crmentity left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.activityid = vtiger_activity.activityid and vtiger_contactdetails.contactid = vtiger_seactivityrel.crmid and vtiger_users.id=vtiger_crmentity.smownerid and vtiger_crmentity.crmid = vtiger_activity.activityid and vtiger_contactdetails.contactid = ".$id." and vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted = 0"; - $log->debug("Exiting get_emails method ..."); - return GetRelatedList('Contacts','Emails',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated Campaigns - * @param $id -- campaign id :: Type Integer - * @returns list of campaigns in array format - */ - - function get_campaigns($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_campaigns(".$id.") method ..."); - global $mod_strings; - - $focus = new Campaigns(); - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - $button = ''; - - $log->info("Campaign Related List for Contact Displayed"); - $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaigncontrel on vtiger_campaigncontrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaigncontrel.contactid=".$id." and vtiger_crmentity.deleted=0"; - - $log->debug("Exiting get_campaigns method ..."); - return GetRelatedList('Contacts','Campaigns',$focus,$query,$button,$returnset); - - } - /** Function to export the contact records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Contacts Query. - */ - function create_export_query(&$order_by, &$where) - { - global $log; - global $current_user; - $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); - - include("include/utils/ExportUtils.php"); - - //To get the Permitted fields query and the permitted fields list - $sql = getPermittedFieldsQuery("Contacts", "detail_view"); - $fields_list = getFieldsListFromQuery($sql); - - $query = "SELECT $fields_list, vtiger_contactgrouprelation.groupname as 'Assigned To Group' - FROM vtiger_contactdetails - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid - LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id and vtiger_users.status='Active' - LEFT JOIN vtiger_account on vtiger_contactdetails.accountid=vtiger_account.accountid - left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid=vtiger_contactdetails.contactid - left join vtiger_contactscf on vtiger_contactscf.contactid=vtiger_contactdetails.contactid - left join vtiger_customerdetails on vtiger_customerdetails.customerid=vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactscf.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_contactdetails vtiger_contactdetails2 - ON vtiger_contactdetails2.contactid = vtiger_contactdetails.reportsto - where vtiger_crmentity.deleted=0"; - //vtiger_contactdetails2 is added to get the Reports To of Contact - - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - //we should add security check when the user has Private Access - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[4] == 3) - { - //Added security check to get the permitted records only - $query = $query." ".getListViewSecurityParameter("Contacts"); - } - - $log->info("Export Query Constructed Successfully"); - $log->debug("Exiting create_export_query method ..."); - return $query; - } - - -/** Function to get the Columnnames of the Contacts -* Used By vtigerCRM Word Plugin -* Returns the Merge Fields for Word Plugin -*/ -function getColumnNames() -{ - global $log, $current_user; - $log->debug("Entering getColumnNames() method ..."); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel 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 where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames method ..."); - return $mergeflds; -} -//End -/** Function to get the Contacts assigned to a user with a valid email address. -* @param varchar $username - User Name -* @param varchar $emailaddress - Email Addr for each contact. -* Used By vtigerCRM Outlook Plugin -* Returns the Query -*/ -function get_searchbyemailid($username,$emailaddress) -{ - global $log; - global $current_user; - require_once("modules/Users/Users.php"); - $seed_user=new Users(); - $user_id=$seed_user->retrieve_user_id($username); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $log->debug("Entering get_searchbyemailid(".$username.",".$emailaddress.") method ..."); - $query = "select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname, - vtiger_contactdetails.contactid, vtiger_contactdetails.salutation, - vtiger_contactdetails.email,vtiger_contactdetails.title, - vtiger_contactdetails.mobile,vtiger_account.accountname, - vtiger_account.accountid as accountid from vtiger_contactdetails - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid - inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid - left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid - left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%".$emailaddress."%'"; - $tab_id = getTabid("Contacts"); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter("Contacts"); - $query .= $sec_parameter; - - } - $log->debug("Exiting get_searchbyemailid method ..."); - return $this->plugin_process_list_query($query); -} - -/** Function to get the Contacts associated with the particular User Name. -* @param varchar $user_name - User Name -* Returns query -*/ - -function get_contactsforol($user_name) -{ - global $log,$adb; - global $current_user; - require_once("modules/Users/Users.php"); - $seed_user=new Users(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select tablename,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and vtiger_field.block <> 5"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result1 = $adb->query($sql1); - for($i=0;$i < $adb->num_rows($result1);$i++) - { - $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); - $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); - if($adb->query_result($result1,$i,'columnname') == "accountid") - { - $permitted_lists[] = 'vtiger_account'; - $permitted_lists[] = 'accountname'; - } - } - $permitted_lists = array_chunk($permitted_lists,2); - $column_table_lists = array(); - for($i=0;$i < count($permitted_lists);$i++) - { - $column_table_lists[] = implode(".",$permitted_lists[$i]); - } - - $log->debug("Entering get_contactsforol(".$user_name.") method ..."); - $query = "select vtiger_contactdetails.contactid as id, ".implode(',',$column_table_lists)." from vtiger_contactdetails - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid - inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid - left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid - left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - where vtiger_crmentity.deleted=0 and vtiger_users.user_name='".$user_name."'"; - $log->debug("Exiting get_contactsforol method ..."); - return $query; -} - - - /** Function to handle module specific operations when saving a entity - */ - function save_module($module) - { - $this->insertIntoAttachment($this->id,$module); - } - - /** - * This function is used to add the vtiger_attachments. This will call the function uploadAndSaveFile which will upload the attachment into the server and save that attachment information in the database. - * @param int $id - entity id to which the vtiger_files to be uploaded - * @param string $module - the current module name - */ - function insertIntoAttachment($id,$module) - { - global $log, $adb; - $log->debug("Entering into insertIntoAttachment($id,$module) method."); - - $file_saved = false; - - //This is to added to store the existing attachment id of the contact where we should delete this when we give new image - $old_attachmentid = $adb->query_result($adb->query("select * from vtiger_seattachmentsrel where crmid=$id"),0,'attachmentsid'); - - foreach($_FILES as $fileindex => $files) - { - if($files['name'] != '' && $files['size'] > 0) - { - $file_saved = $this->uploadAndSaveFile($id,$module,$files); - } - } - - //This is to handle the delete image for contacts - if($module == 'Contacts' && $file_saved) - { - $del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$old_attachmentid"); - $del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$old_attachmentid"); - } - - $log->debug("Exiting from insertIntoAttachment($id,$module) method."); - } - - -//End - -} - -?> +'crmid','vtiger_contactdetails'=>'contactid','vtiger_contactaddress'=>'contactaddressid','vtiger_contactsubdetails'=>'contactsubscriptionid','vtiger_contactscf'=>'contactid','vtiger_customerdetails'=>'customerid','vtiger_attachments'=>'attachmentsid'); + + + + var $column_fields = Array(); + + var $sortby_fields = Array('lastname','firstname','title','email','phone','smownerid','accountid'); + + var $list_link_field= 'lastname'; + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Last Name' => Array('contactdetails'=>'lastname'), + 'First Name' => Array('contactdetails'=>'firstname'), + 'Title' => Array('contactdetails'=>'title'), + 'Account Name' => Array('account'=>'accountname'), + 'Email' => Array('contactdetails'=>'email'), + 'Phone' => Array('contactdetails'=>'phone'), + 'Assigned To' => Array('crmentity'=>'smownerid') + ); + + var $range_fields = Array( + 'first_name', + 'last_name', + 'primary_address_city', + 'account_name', + 'account_id', + 'id', + 'email1', + 'salutation', + 'title', + 'phone_mobile', + 'reports_to_name', + 'primary_address_street', + 'primary_address_city', + 'primary_address_state', + 'primary_address_postalcode', + 'primary_address_country', + 'alt_address_city', + 'alt_address_street', + 'alt_address_city', + 'alt_address_state', + 'alt_address_postalcode', + 'alt_address_country', + 'office_phone', + 'home_phone', + 'other_phone', + 'fax', + 'department', + 'birthdate', + 'assistant_name', + 'assistant_phone'); + + + var $list_fields_name = Array( + 'Last Name' => 'lastname', + 'First Name' => 'firstname', + 'Title' => 'title', + 'Account Name' => 'accountid', + 'Email' => 'email', + 'Phone' => 'phone', + 'Assigned To' => 'assigned_user_id' + ); + + var $search_fields = Array( + 'Name' => Array('contactdetails'=>'lastname'), + 'Title' => Array('contactdetails'=>'title') + ); + + var $search_fields_name = Array( + 'Name' => 'lastname', + 'Title' => 'title' + ); + + // This is the list of vtiger_fields that are required + var $required_fields = array("lastname"=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'lastname'; + var $default_sort_order = 'ASC'; + + var $groupTable = Array('vtiger_contactgrouprelation','contactid'); + + function Contacts() { + $this->log = LoggerManager::getLogger('contact'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Contacts'); + } + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['CONTACTS_SORT_ORDER'] != '')?($_SESSION['CONTACTS_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder method ..."); + return $sorder; + } + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'Contactname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['CONTACTS_ORDER_BY'] != '')?($_SESSION['CONTACTS_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + /** Function to get the number of Contacts assigned to a particular User. + * @param varchar $user name - Assigned to User + * Returns the count of contacts assigned to user. + */ + function getCount($user_name) + { + global $log; + $log->debug("Entering getCount(".$user_name.") method ..."); + $query = "select count(*) from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + + + $log->debug("Exiting getCount method ..."); + return $row["count(*)"]; + } + /** Function to get the Contact Details assigned to a given User ID which has a valid Email Address. + * @param varchar $user_name - User Name (eg. Admin) + * @param varchar $email_address - Email Addr of each contact record. + * Returns the query. + */ + function get_contacts1($user_name,$email_address) + { + global $log; + $log->debug("Entering get_contacts1(".$user_name.",".$email_address.") method ..."); + $query = "select vtiger_users.user_name, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name,vtiger_account.accountid as account_id from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%" .$email_address ."%' limit 50"; + + $log->debug("Exiting get_contacts1 method ..."); + return $this->process_list_query1($query); + } + /** Function to get the Contact Details assigned to a particular User based on the starting count and the number of subsequent records. + * @param varchar $user_name - Assigned User + * @param integer $from_index - Initial record number to be displayed + * @param integer $offset - Count of the subsequent records to be displayed. + * Returns Query. + */ + function get_contacts($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_contacts(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.department department, vtiger_contactdetails.phone office_phone, vtiger_contactdetails.fax fax, vtiger_contactsubdetails.assistant assistant_name, vtiger_contactsubdetails.otherphone other_phone, vtiger_contactsubdetails.homephone home_phone,vtiger_contactsubdetails.birthday birthdate, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name,vtiger_account.accountid as account_id, vtiger_contactaddress.mailingcity as primary_address_city,vtiger_contactaddress.mailingstreet as primary_address_street, vtiger_contactaddress.mailingcountry as primary_address_country,vtiger_contactaddress.mailingstate as primary_address_state, vtiger_contactaddress.mailingzip as primary_address_postalcode, vtiger_contactaddress.othercity as alt_address_city,vtiger_contactaddress.otherstreet as alt_address_street, vtiger_contactaddress.othercountry as alt_address_country,vtiger_contactaddress.otherstate as alt_address_state, vtiger_contactaddress.otherzip as alt_address_postalcode from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 limit " .$from_index ."," .$offset; + + $log->debug("Exiting get_contacts method ..."); + return $this->process_list_query1($query); + } + + + /** Function to process list query for a given query + * @param $query + * Returns the results of query in array format + */ + function process_list_query1($query) + { + global $log; + $log->debug("Entering process_list_query1(".$query.") method ..."); + + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + $contact = Array(); + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + + { + foreach($this->range_fields as $columnName) + { + if (isset($row[$columnName])) { + + $contact[$columnName] = $row[$columnName]; + } + else + { + $contact[$columnName] = ""; + } + } +// TODO OPTIMIZE THE QUERY ACCOUNT NAME AND ID are set separetly for every vtiger_contactdetails and hence +// vtiger_account query goes for ecery single vtiger_account row + + $list[] = $contact; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + + $log->debug("Exiting process_list_query1 method ..."); + return $response; + } + + + /** Function to process list query for Plugin with Security Parameters for a given query + * @param $query + * Returns the results of query in array format + */ + function plugin_process_list_query($query) + { + global $log,$adb,$current_user; + $log->debug("Entering process_list_query1(".$query.") method ..."); + $permitted_field_lists = Array(); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select columnname from vtiger_field where tabid=4 and block <> 75"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select columnname 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 where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $this->db->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_field_lists[] = $adb->query_result($result1,$i,'columnname'); + } + + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + { + $contact = Array(); + foreach($permitted_field_lists as $columnName) + { + if ($columnName == "lastname" || $columnName == "firstname" || $columnName == "email") + { + $contact[$columnName] = $row[$columnName]; + } + else + { + $contact[$columnName] = ""; + } + } + if(in_array("accountid",$permitted_field_lists)) + { + $contact[accountname] = $row[accountname]; + $contact[account_id] = $row[accountid]; + } + $contact[contactid] = $row[contactid]; + $list[] = $contact; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + $log->debug("Exiting process_list_query1 method ..."); + return $response; + } + + + /** Returns a list of the associated opportunities + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_opportunities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_opportunities(".$id.") method ..."); + global $mod_strings; + + $focus = new Potentials(); + $button = ''; + + if(isPermitted("Potentials",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $log->info("Potential Related List for Contact Displayed"); + + // First, get the list of IDs. + $query = 'select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.accountid, vtiger_contactdetails.contactid , vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.potentialtype, vtiger_potential.sales_stage, vtiger_potential.amount, vtiger_potential.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_contactdetails inner join vtiger_potential on vtiger_contactdetails.accountid = vtiger_potential.accountid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid left join vtiger_potentialgrouprelation on vtiger_potential.potentialid=vtiger_potentialgrouprelation.potentialid left join vtiger_groups on vtiger_groups.groupname=vtiger_potentialgrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted=0'; + if($this->column_fields['account_id'] != 0) + $log->debug("Exiting get_opportunities method ..."); + return GetRelatedList('Contacts','Potentials',$focus,$query,$button,$returnset); + } + + + /** Returns a list of the associated tasks + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_activities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + + $focus = new Activity(); + + $button = ''; + + if(isPermitted("Calendar",1,"") == 'yes') + { + $button .= ' '; + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $log->info("Activity Related List for Contact Displayed"); + + $query = "SELECT vtiger_users.user_name,vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.activityid , vtiger_activity.subject, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.due_date, vtiger_cntactivityrel.contactid, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_recurringevents.recurringtype from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid = vtiger_contactdetails.contactid inner join vtiger_activity on vtiger_cntactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_cntactivityrel.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_contactdetails.contactid=".$id." and vtiger_crmentity.deleted = 0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') "; //recurring type is added in Query -Jaguar + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Contacts','Calendar',$focus,$query,$button,$returnset); + + } + /** + * Function to get Contact related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id - contactid + * returns related Task or Event record in array format + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus, + vtiger_activity.activitytype, vtiger_contactdetails.contactid, vtiger_contactdetails.firstname, + vtiger_contactdetails.lastname, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name + from vtiger_activity + inner join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid + inner join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id + where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) + and vtiger_cntactivityrel.contactid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + $log->debug("Entering get_history method ..."); + return getHistory('Contacts',$query,$id); + } + /** + * Function to get Contact related Tickets. + * @param integer $id - contactid + * returns related Ticket records in array format + */ + function get_tickets($id) + { + global $log, $singlepane_view; + global $app_strings; + $log->debug("Entering get_tickets(".$id.") method ..."); + $focus = new HelpDesk(); + + $button = ' '; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $query = "select vtiger_users.user_name,vtiger_crmentity.crmid, vtiger_troubletickets.title, vtiger_contactdetails.contactid, vtiger_troubletickets.parent_id, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_troubletickets.status, vtiger_troubletickets.priority, vtiger_crmentity.smownerid from vtiger_troubletickets inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_ticketgrouprelation on vtiger_troubletickets.ticketid=vtiger_ticketgrouprelation.ticketid left join vtiger_groups on vtiger_groups.groupname=vtiger_ticketgrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; + $log->info("Ticket Related List for Contact Displayed"); + $log->debug("Exiting get_tickets method ..."); + return GetRelatedList('Contacts','HelpDesk',$focus,$query,$button,$returnset); + } + /** + * Function to get Contact related Attachments + * @param integer $id - contactid + * returns related Attachment record in array format + */ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + $query = "select vtiger_notes.title,'Notes ' AS ActivityType, + vtiger_notes.filename, vtiger_attachments.type AS FileType,crm2.modifiedtime AS lastmodified, + vtiger_seattachmentsrel.attachmentsid AS attachmentsid, vtiger_notes.notesid AS crmid, + crm2.createdtime, vtiger_notes.notecontent AS description, vtiger_users.user_name + from vtiger_notes + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_notes.contact_id + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 + left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid + left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + $query .= " union all "; + $query .= "select vtiger_attachments.description AS title,'Attachments' AS ActivityType, + vtiger_attachments.name AS filename, vtiger_attachments.type AS FileType,crm2.modifiedtime AS lastmodified, + vtiger_attachments.attachmentsid AS attachmentsid, vtiger_seattachmentsrel.attachmentsid AS crmid, + crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + from vtiger_attachments + inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id." + order by createdtime desc"; + $log->info("Notes&Attachmenmts for Contact Displayed"); + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Contacts',$query,$id); + } + /** + * Function to get Contact related Quotes + * @param integer $id - contactid + * returns related Quotes record in array format + */ + function get_quotes($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_quotes(".$id.") method ..."); + global $app_strings; + require_once('modules/Quotes/Quotes.php'); + $focus = new Quotes(); + + $button = ''; + if(isPermitted("Quotes",1,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_quotes.*,vtiger_potential.potentialname,vtiger_contactdetails.lastname from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_quotes.contactid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; + $log->debug("Exiting get_quotes method ..."); + return GetRelatedList('Contacts','Quotes',$focus,$query,$button,$returnset); + } + /** + * Function to get Contact related SalesOrder + * @param integer $id - contactid + * returns related SalesOrder record in array format + */ + function get_salesorder($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + global $app_strings; + $focus = new SalesOrder(); + $button = ''; + + if(isPermitted("SalesOrder",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_contactdetails.lastname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_salesorder.contactid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.contactid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Contacts','SalesOrder',$focus,$query,$button,$returnset); + } + /** + * Function to get Contact related Products + * @param integer $id - contactid + * returns related Products record in array format + */ + function get_products($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_products(".$id.") method ..."); + global $app_strings; + require_once('modules/Products/Products.php'); + $focus = new Products(); + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_contactdetails.lastname from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_products.contactid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted = 0'; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Contacts','Products',$focus,$query,$button,$returnset); + } + + /** + * Function to get Contact related PurchaseOrder + * @param integer $id - contactid + * returns related PurchaseOrder record in array format + */ + function get_purchase_orders($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_purchase_orders(".$id.") method ..."); + global $app_strings; + require_once('modules/PurchaseOrder/PurchaseOrder.php'); + $focus = new PurchaseOrder(); + + $button = ''; + + if(isPermitted("PurchaseOrder",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_purchaseorder.*,vtiger_vendor.vendorname,vtiger_contactdetails.lastname from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left outer join vtiger_vendor on vtiger_purchaseorder.vendorid=vtiger_vendor.vendorid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_purchaseorder.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_pogrouprelation on vtiger_purchaseorder.purchaseorderid=vtiger_pogrouprelation.purchaseorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_pogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_purchaseorder.contactid=".$id; + $log->debug("Exiting get_purchase_orders method ..."); + return GetRelatedList('Contacts','PurchaseOrder',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated emails + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_emails($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_emails(".$id.") method ..."); + global $mod_strings; + + $focus = new Emails(); + + $button = ''; + + if(isPermitted("Emails",1,"") == 'yes') + { + $button .= ''; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $log->info("Email Related List for Contact Displayed"); + + $query = "select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_users.user_name, vtiger_crmentity.modifiedtime, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_activity.date_start from vtiger_activity, vtiger_seactivityrel, vtiger_contactdetails, vtiger_users, vtiger_crmentity left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.activityid = vtiger_activity.activityid and vtiger_contactdetails.contactid = vtiger_seactivityrel.crmid and vtiger_users.id=vtiger_crmentity.smownerid and vtiger_crmentity.crmid = vtiger_activity.activityid and vtiger_contactdetails.contactid = ".$id." and vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted = 0"; + $log->debug("Exiting get_emails method ..."); + return GetRelatedList('Contacts','Emails',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated Campaigns + * @param $id -- campaign id :: Type Integer + * @returns list of campaigns in array format + */ + + function get_campaigns($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_campaigns(".$id.") method ..."); + global $mod_strings; + + $focus = new Campaigns(); + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + $button = ''; + + $log->info("Campaign Related List for Contact Displayed"); + $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaigncontrel on vtiger_campaigncontrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaigncontrel.contactid=".$id." and vtiger_crmentity.deleted=0"; + + $log->debug("Exiting get_campaigns method ..."); + return GetRelatedList('Contacts','Campaigns',$focus,$query,$button,$returnset); + + } + /** Function to export the contact records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Contacts Query. + */ + function create_export_query(&$order_by, &$where) + { + global $log; + global $current_user; + $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); + + include("include/utils/ExportUtils.php"); + + //To get the Permitted fields query and the permitted fields list + $sql = getPermittedFieldsQuery("Contacts", "detail_view"); + $fields_list = getFieldsListFromQuery($sql); + + $query = "SELECT $fields_list, vtiger_contactgrouprelation.groupname as 'Assigned To Group' + FROM vtiger_contactdetails + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid + LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id and vtiger_users.status='Active' + LEFT JOIN vtiger_account on vtiger_contactdetails.accountid=vtiger_account.accountid + left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid + left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid=vtiger_contactdetails.contactid + left join vtiger_contactscf on vtiger_contactscf.contactid=vtiger_contactdetails.contactid + left join vtiger_customerdetails on vtiger_customerdetails.customerid=vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactscf.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_contactdetails vtiger_contactdetails2 + ON vtiger_contactdetails2.contactid = vtiger_contactdetails.reportsto + where vtiger_crmentity.deleted=0"; + //vtiger_contactdetails2 is added to get the Reports To of Contact + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + //we should add security check when the user has Private Access + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[4] == 3) + { + //Added security check to get the permitted records only + $query = $query." ".getListViewSecurityParameter("Contacts"); + } + + $log->info("Export Query Constructed Successfully"); + $log->debug("Exiting create_export_query method ..."); + return $query; + } + + +/** Function to get the Columnnames of the Contacts +* Used By vtigerCRM Word Plugin +* Returns the Merge Fields for Word Plugin +*/ +function getColumnNames() +{ + global $log, $current_user; + $log->debug("Entering getColumnNames() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel 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 where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames method ..."); + return $mergeflds; +} +//End +/** Function to get the Contacts assigned to a user with a valid email address. +* @param varchar $username - User Name +* @param varchar $emailaddress - Email Addr for each contact. +* Used By vtigerCRM Outlook Plugin +* Returns the Query +*/ +function get_searchbyemailid($username,$emailaddress) +{ + global $log; + global $current_user; + require_once("modules/Users/Users.php"); + $seed_user=new Users(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $log->debug("Entering get_searchbyemailid(".$username.",".$emailaddress.") method ..."); + $query = "select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname, + vtiger_contactdetails.contactid, vtiger_contactdetails.salutation, + vtiger_contactdetails.email,vtiger_contactdetails.title, + vtiger_contactdetails.mobile,vtiger_account.accountname, + vtiger_account.accountid as accountid from vtiger_contactdetails + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid + inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid + left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid + left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%".$emailaddress."%'"; + $tab_id = getTabid("Contacts"); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter("Contacts"); + $query .= $sec_parameter; + + } + $log->debug("Exiting get_searchbyemailid method ..."); + return $this->plugin_process_list_query($query); +} + +/** Function to get the Contacts associated with the particular User Name. +* @param varchar $user_name - User Name +* Returns query +*/ + +function get_contactsforol($user_name) +{ + global $log,$adb; + global $current_user; + require_once("modules/Users/Users.php"); + $seed_user=new Users(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and vtiger_field.block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + if($adb->query_result($result1,$i,'columnname') == "accountid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + } + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $log->debug("Entering get_contactsforol(".$user_name.") method ..."); + $query = "select vtiger_contactdetails.contactid as id, ".implode(',',$column_table_lists)." from vtiger_contactdetails + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid + inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid + left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid + left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid + left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + where vtiger_crmentity.deleted=0 and vtiger_users.user_name='".$user_name."'"; + $log->debug("Exiting get_contactsforol method ..."); + return $query; +} + + + /** Function to handle module specific operations when saving a entity + */ + function save_module($module) + { + $this->insertIntoAttachment($this->id,$module); + } + + /** + * This function is used to add the vtiger_attachments. This will call the function uploadAndSaveFile which will upload the attachment into the server and save that attachment information in the database. + * @param int $id - entity id to which the vtiger_files to be uploaded + * @param string $module - the current module name + */ + function insertIntoAttachment($id,$module) + { + global $log, $adb; + $log->debug("Entering into insertIntoAttachment($id,$module) method."); + + $file_saved = false; + + //This is to added to store the existing attachment id of the contact where we should delete this when we give new image + $old_attachmentid = $adb->query_result($adb->query("select * from vtiger_seattachmentsrel where crmid=$id"),0,'attachmentsid'); + + foreach($_FILES as $fileindex => $files) + { + if($files['name'] != '' && $files['size'] > 0) + { + $file_saved = $this->uploadAndSaveFile($id,$module,$files); + } + } + + //This is to handle the delete image for contacts + if($module == 'Contacts' && $file_saved) + { + $del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$old_attachmentid"); + $del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$old_attachmentid"); + } + + $log->debug("Exiting from insertIntoAttachment($id,$module) method."); + } + + +//End + +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 04:07:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:07:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9911 - /vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php Message-ID: <20061127120728.E4B22789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:07:17 2006 New Revision: 9911 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php Modified: vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php (original) +++ vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php Mon Nov 27 05:07:17 2006 @@ -55,6 +55,8 @@ //Added these variables which are used as default order by and sortorder in ListView var $default_order_by = 'crmid'; var $default_sort_order = 'DESC'; + + var $groupTable = Array('vtiger_campaigngrouprelation','campaignid'); var $search_fields = Array( 'Campaign Name'=>Array('vtiger_campaign'=>'campaignname'), From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 04:08:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:08:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9912 - /vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php Message-ID: <20061127120854.EBC48789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:08:44 2006 New Revision: 9912 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php Modified: vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php (original) +++ vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php Mon Nov 27 05:08:44 2006 @@ -48,7 +48,8 @@ var $sortby_fields = Array('accountname','city','website','phone','smownerid'); - + var $groupTable = Array('vtiger_accountgrouprelation','accountid'); + // This is the list of vtiger_fields that are in the lists. var $list_fields = Array( 'Account Name'=>Array('vtiger_account'=>'accountname'), From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 04:12:01 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:12:01 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9913 - /vtigercrm/branches/5.0.3/modules/Calendar/Activity.php Message-ID: <20061127121201.91E8478969B@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:11:53 2006 New Revision: 9913 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Calendar/Activity.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/Activity.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/Activity.php Mon Nov 27 05:11:53 2006 @@ -86,6 +86,8 @@ //Added these variables which are used as default order by and sortorder in ListView var $default_order_by = 'due_date'; var $default_sort_order = 'ASC'; + + var $groupTable = Array('vtiger_activitygrouprelation','activityid'); function Activity() { $this->log = LoggerManager::getLogger('Calendar'); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 07:36:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 15:36:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9914 - /vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Message-ID: <20061127153607.B484678969B@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 08:36:02 2006 New Revision: 9914 Log: changes made fix empty combo list in quick create Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Mon Nov 27 08:36:02 2006 @@ -69,7 +69,7 @@ From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 09:33:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:33:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9915 - /vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php Message-ID: <20061127173327.472A0789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:33:17 2006 New Revision: 9915 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php (original) +++ vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php Mon Nov 27 10:33:17 2006 @@ -80,6 +80,8 @@ var $default_order_by = 'crmid'; var $default_sort_order = 'DESC'; + var $groupTable = Array('vtiger_ticketgrouprelation','ticketid'); + /** Constructor which will set the column_fields in this object */ function HelpDesk() From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 09:36:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:36:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9916 - /vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php Message-ID: <20061127173630.E6280788A36@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:36:24 2006 New Revision: 9916 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php Modified: vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php (original) +++ vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php Mon Nov 27 10:36:24 2006 @@ -83,6 +83,8 @@ var $default_order_by = 'crmid'; var $default_sort_order = 'ASC'; + var $groupTable = Array('vtiger_invoicegrouprelation','invoiceid'); + /** Constructor which will set the column_fields in this object */ function Invoice() { From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 09:38:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:38:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9917 - /vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php Message-ID: <20061127173808.8560D789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:37:58 2006 New Revision: 9917 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php (original) +++ vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php Mon Nov 27 10:37:58 2006 @@ -86,6 +86,8 @@ var $default_order_by = 'subject'; var $default_sort_order = 'ASC'; + var $groupTable = Array('vtiger_pogrouprelation','purchaseorderid'); + /** Constructor Function for Order class * This function creates an instance of LoggerManager class using getLogger method * creates an instance for PearDatabase class and get values for column_fields array of Order class. From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 09:39:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:39:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9918 - /vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php Message-ID: <20061127173956.A202C788A36@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:39:46 2006 New Revision: 9918 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php Modified: vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php (original) +++ vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php Mon Nov 27 10:39:46 2006 @@ -1,272 +1,275 @@ -'crmid','vtiger_quotes'=>'quoteid','vtiger_quotesbillads'=>'quotebilladdressid','vtiger_quotesshipads'=>'quoteshipaddressid','vtiger_quotescf'=>'quoteid'); - - var $entity_table = "vtiger_crmentity"; - - var $billadr_table = "vtiger_quotesbillads"; - - var $object_name = "Quote"; - - var $new_schema = true; - - var $module_id = "quoteid"; - - var $column_fields = Array(); - - var $sortby_fields = Array('subject','crmid','smownerid'); - - // This is used to retrieve related vtiger_fields from form posts. - var $additional_column_fields = Array('assigned_user_name', 'smownerid', 'opportunity_id', 'case_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id', 'parent_name', 'member_id' ); - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Quote Id'=>Array('crmentity'=>'crmid'), - 'Subject'=>Array('quotes'=>'subject'), - 'Quote Stage'=>Array('quotes'=>'quotestage'), - 'Potential Name'=>Array('quotes'=>'potentialid'), - 'Account Name'=>Array('account'=> 'accountid'), - 'Total'=>Array('quotes'=> 'total'), - 'Assigned To'=>Array('crmentity'=>'smownerid') - ); - - var $list_fields_name = Array( - 'Quote Id'=>'', - 'Subject'=>'subject', - 'Quote Stage'=>'quotestage', - 'Potential Name'=>'potential_id', - 'Account Name'=>'account_id', - 'Total'=>'hdnGrandTotal', - 'Assigned To'=>'assigned_user_id' - ); - var $list_link_field= 'subject'; - - var $search_fields = Array( - 'Quote Id'=>Array('crmentity'=>'crmid'), - 'Subject'=>Array('quotes'=>'subject'), - 'Account Name'=>Array('quotes'=>'accountid'), - 'Quote Stage'=>Array('quotes'=>'quotestage'), - ); - - var $search_fields_name = Array( - 'Quote Id'=>'', - 'Subject'=>'subject', - 'Account Name'=>'account_id', - 'Quote Stage'=>'quotestage', - ); - - // This is the list of vtiger_fields that are required. - var $required_fields = array("accountname"=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'crmid'; - var $default_sort_order = 'ASC'; - - /** Constructor which will set the column_fields in this object - */ - function Quotes() { - $this->log =LoggerManager::getLogger('quote'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Quotes'); - } - - function save_module() - { - //in ajax save we should not call this function, because this will delete all the existing product values - if($_REQUEST['action'] != 'QuotesAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW') - { - //Based on the total Number of rows we will save the product relationship with this entity - saveInventoryProductDetails(&$this, 'Quotes'); - } - } - - /** Function used to get the sort order for Quote listview - * @return string $sorder - first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['QUOTES_SORT_ORDER'] if this session value is empty then default sort order will be returned. - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['QUOTES_SORT_ORDER'] != '')?($_SESSION['QUOTES_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - - /** Function used to get the order by value for Quotes listview - * @return string $order_by - first check the $_REQUEST['order_by'] if request value is empty then check in the $_SESSION['QUOTES_ORDER_BY'] if this session value is empty then default order by will be returned. - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['QUOTES_ORDER_BY'] != '')?($_SESSION['QUOTES_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - - /** function used to get the list of sales orders which are related to the Quotes - * @param int $id - quote id - * @return array - return an array which will be returned from the function GetRelatedList - */ - function get_salesorder($id) - { - global $log,$singlepane_view; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - $focus = new SalesOrder(); - - $button = ''; - - if($singlepane_view == 'true') - $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; - - $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.quoteid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Quotes','SalesOrder',$focus,$query,$button,$returnset); - } - - /** function used to get the list of activities which are related to the Quotes - * @param int $id - quote id - * @return array - return an array which will be returned from the function GetRelatedList - */ - function get_activities($id) - { - global $log,$singlepane_view; - $log->debug("Entering get_activities(".$id.") method ..."); - global $app_strings; - require_once('modules/Calendar/Activity.php'); - $focus = new Activity(); - - $button = ''; - - if($singlepane_view == 'true') - $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred')"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Quotes','Calendar',$focus,$query,$button,$returnset); - } - - /** function used to get the the activity history related to the quote - * @param int $id - quote id - * @return array - return an array which will be returned from the function GetHistory - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, - vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_contactdetails.contactid, - vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name - from vtiger_activity - inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid - inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - where vtiger_activity.activitytype='Task' - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred') - and vtiger_seactivityrel.crmid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - - $log->debug("Exiting get_history method ..."); - return getHistory('Quotes',$query,$id); - } - - - /** Function used to get the Quote Stage history of the Quotes - * @param $id - quote id - * @return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are arrays which contains header values and all column values of all entries - */ - function get_quotestagehistory($id) - { - global $log; - $log->debug("Entering get_quotestagehistory(".$id.") method ..."); - - global $adb; - global $mod_strings; - global $app_strings; - - $query = 'select vtiger_quotestagehistory.*, vtiger_quotes.subject from vtiger_quotestagehistory inner join vtiger_quotes on vtiger_quotes.quoteid = vtiger_quotestagehistory.quoteid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_quotes.quoteid where vtiger_crmentity.deleted = 0 and vtiger_quotes.quoteid = '.$id; - $result=$adb->query($query); - $noofrows = $adb->num_rows($result); - - $header[] = $app_strings['Quote Id']; - $header[] = $app_strings['LBL_ACCOUNT_NAME']; - $header[] = $app_strings['LBL_AMOUNT']; - $header[] = $app_strings['Quote Stage']; - $header[] = $app_strings['LBL_LAST_MODIFIED']; - - while($row = $adb->fetch_array($result)) - { - $entries = Array(); - - $entries[] = $row['quoteid']; - $entries[] = $row['accountname']; - $entries[] = $row['total']; - $entries[] = $row['quotestage']; - $entries[] = getDisplayDate($row['lastmodified']); - - $entries_list[] = $entries; - } - - $return_data = Array('header'=>$header,'entries'=>$entries_list); - - $log->debug("Exiting get_quotestagehistory method ..."); - - return $return_data; - } - -} - -?> +'crmid','vtiger_quotes'=>'quoteid','vtiger_quotesbillads'=>'quotebilladdressid','vtiger_quotesshipads'=>'quoteshipaddressid','vtiger_quotescf'=>'quoteid'); + + var $entity_table = "vtiger_crmentity"; + + var $billadr_table = "vtiger_quotesbillads"; + + var $object_name = "Quote"; + + var $new_schema = true; + + var $module_id = "quoteid"; + + var $column_fields = Array(); + + var $sortby_fields = Array('subject','crmid','smownerid'); + + // This is used to retrieve related vtiger_fields from form posts. + var $additional_column_fields = Array('assigned_user_name', 'smownerid', 'opportunity_id', 'case_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id', 'parent_name', 'member_id' ); + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Quote Id'=>Array('crmentity'=>'crmid'), + 'Subject'=>Array('quotes'=>'subject'), + 'Quote Stage'=>Array('quotes'=>'quotestage'), + 'Potential Name'=>Array('quotes'=>'potentialid'), + 'Account Name'=>Array('account'=> 'accountid'), + 'Total'=>Array('quotes'=> 'total'), + 'Assigned To'=>Array('crmentity'=>'smownerid') + ); + + var $list_fields_name = Array( + 'Quote Id'=>'', + 'Subject'=>'subject', + 'Quote Stage'=>'quotestage', + 'Potential Name'=>'potential_id', + 'Account Name'=>'account_id', + 'Total'=>'hdnGrandTotal', + 'Assigned To'=>'assigned_user_id' + ); + var $list_link_field= 'subject'; + + var $search_fields = Array( + 'Quote Id'=>Array('crmentity'=>'crmid'), + 'Subject'=>Array('quotes'=>'subject'), + 'Account Name'=>Array('quotes'=>'accountid'), + 'Quote Stage'=>Array('quotes'=>'quotestage'), + ); + + var $search_fields_name = Array( + 'Quote Id'=>'', + 'Subject'=>'subject', + 'Account Name'=>'account_id', + 'Quote Stage'=>'quotestage', + ); + + // This is the list of vtiger_fields that are required. + var $required_fields = array("accountname"=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'crmid'; + var $default_sort_order = 'ASC'; + var $groupTable = Array('vtiger_quotegrouprelation','quoteid'); + + + + /** Constructor which will set the column_fields in this object + */ + function Quotes() { + $this->log =LoggerManager::getLogger('quote'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Quotes'); + } + + function save_module() + { + //in ajax save we should not call this function, because this will delete all the existing product values + if($_REQUEST['action'] != 'QuotesAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW') + { + //Based on the total Number of rows we will save the product relationship with this entity + saveInventoryProductDetails(&$this, 'Quotes'); + } + } + + /** Function used to get the sort order for Quote listview + * @return string $sorder - first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['QUOTES_SORT_ORDER'] if this session value is empty then default sort order will be returned. + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['QUOTES_SORT_ORDER'] != '')?($_SESSION['QUOTES_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + + /** Function used to get the order by value for Quotes listview + * @return string $order_by - first check the $_REQUEST['order_by'] if request value is empty then check in the $_SESSION['QUOTES_ORDER_BY'] if this session value is empty then default order by will be returned. + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['QUOTES_ORDER_BY'] != '')?($_SESSION['QUOTES_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + + /** function used to get the list of sales orders which are related to the Quotes + * @param int $id - quote id + * @return array - return an array which will be returned from the function GetRelatedList + */ + function get_salesorder($id) + { + global $log,$singlepane_view; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + $focus = new SalesOrder(); + + $button = ''; + + if($singlepane_view == 'true') + $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; + + $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.quoteid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Quotes','SalesOrder',$focus,$query,$button,$returnset); + } + + /** function used to get the list of activities which are related to the Quotes + * @param int $id - quote id + * @return array - return an array which will be returned from the function GetRelatedList + */ + function get_activities($id) + { + global $log,$singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $app_strings; + require_once('modules/Calendar/Activity.php'); + $focus = new Activity(); + + $button = ''; + + if($singlepane_view == 'true') + $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred')"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Quotes','Calendar',$focus,$query,$button,$returnset); + } + + /** function used to get the the activity history related to the quote + * @param int $id - quote id + * @return array - return an array which will be returned from the function GetHistory + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, + vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_contactdetails.contactid, + vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name + from vtiger_activity + inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid + inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + where vtiger_activity.activitytype='Task' + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred') + and vtiger_seactivityrel.crmid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + + $log->debug("Exiting get_history method ..."); + return getHistory('Quotes',$query,$id); + } + + + /** Function used to get the Quote Stage history of the Quotes + * @param $id - quote id + * @return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are arrays which contains header values and all column values of all entries + */ + function get_quotestagehistory($id) + { + global $log; + $log->debug("Entering get_quotestagehistory(".$id.") method ..."); + + global $adb; + global $mod_strings; + global $app_strings; + + $query = 'select vtiger_quotestagehistory.*, vtiger_quotes.subject from vtiger_quotestagehistory inner join vtiger_quotes on vtiger_quotes.quoteid = vtiger_quotestagehistory.quoteid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_quotes.quoteid where vtiger_crmentity.deleted = 0 and vtiger_quotes.quoteid = '.$id; + $result=$adb->query($query); + $noofrows = $adb->num_rows($result); + + $header[] = $app_strings['Quote Id']; + $header[] = $app_strings['LBL_ACCOUNT_NAME']; + $header[] = $app_strings['LBL_AMOUNT']; + $header[] = $app_strings['Quote Stage']; + $header[] = $app_strings['LBL_LAST_MODIFIED']; + + while($row = $adb->fetch_array($result)) + { + $entries = Array(); + + $entries[] = $row['quoteid']; + $entries[] = $row['accountname']; + $entries[] = $row['total']; + $entries[] = $row['quotestage']; + $entries[] = getDisplayDate($row['lastmodified']); + + $entries_list[] = $entries; + } + + $return_data = Array('header'=>$header,'entries'=>$entries_list); + + $log->debug("Exiting get_quotestagehistory method ..."); + + return $return_data; + } + +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 09:41:19 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:41:19 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9919 - /vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php Message-ID: <20061127174120.1AD55788A36@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:41:11 2006 New Revision: 9919 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php (original) +++ vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php Mon Nov 27 10:41:11 2006 @@ -95,6 +95,7 @@ //Added these variables which are used as default order by and sortorder in ListView var $default_order_by = 'subject'; var $default_sort_order = 'ASC'; + var $groupTable = Array('vtiger_sogrouprelation','salesorderid'); /** Constructor Function for SalesOrder class From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 09:43:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:43:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9920 - /vtigercrm/branches/5.0.3/include/utils/utils.php Message-ID: <20061127174323.46B9E789668@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:43:10 2006 New Revision: 9920 Log: group handling code made generic Modified: vtigercrm/branches/5.0.3/include/utils/utils.php Modified: vtigercrm/branches/5.0.3/include/utils/utils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/utils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/utils.php Mon Nov 27 10:43:10 2006 @@ -1181,6 +1181,12 @@ elseif($module == 'Campaigns') { $query1="select vtiger_groups.groupid from vtiger_campaigngrouprelation inner join vtiger_groups on vtiger_groups.groupname = vtiger_campaigngrouprelation.groupname where campaignid=".$record; + } + else + { + require_once("modules/$module/$module.php"); + $modObj = new $module(); + $query1="select vtiger_groups.groupid from vtiger_".$module."grouprelation inner join vtiger_groups on vtiger_groups.groupname = vtiger_".$module."grouprelation.groupname where ".$modObj->groupTable[1]."=".$record; } $result1=$adb->query($query1); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 09:47:40 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:47:40 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9921 - /vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php Message-ID: <20061127174740.C8C0F789668@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:47:34 2006 New Revision: 9921 Log: made the code generic for module addition -- field level security support Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php Mon Nov 27 10:47:34 2006 @@ -31,9 +31,10 @@ $image_path=$theme_path."images/"; require_once($theme_path.'layout_utils.php'); -$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq'); +//$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq'); +$field_module=getFieldModuleAccessArray(); $allfields=Array(); -foreach($field_module as $fld_module) +foreach($field_module as $fld_module=>$mod_name) { $fieldListResult = getDefOrgFieldList($fld_module); $noofrows = $adb->num_rows($fieldListResult); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 09:48:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:48:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9922 - /vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php Message-ID: <20061127174834.EFFD0789668@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:48:26 2006 New Revision: 9922 Log: made the code generic for module addition -- field level security support Modified: vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php Modified: vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php Mon Nov 27 10:48:26 2006 @@ -14,8 +14,11 @@ require_once('include/utils/utils.php'); global $adb; -$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Emails','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq'); -foreach($field_module as $fld_module) +//$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Emails','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq'); + +$field_module=getFieldModuleAccessArray(); + +foreach($field_module as $fld_module=>$fld_name) { $fieldListResult = getDefOrgFieldList($fld_module); $noofrows = $adb->num_rows($fieldListResult); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 22:07:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 28 Nov 2006 06:07:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9923 - in /vtigercrm/branches/5.0.3/modules/Calendar: CalendarCommon.php Save.php TodoSave.php Message-ID: <20061128060739.55C707888FD@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 23:07:32 2006 New Revision: 9923 Log: Problem in send notification in ToDo - fixed Modified: vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php vtigercrm/branches/5.0.3/modules/Calendar/Save.php vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php Mon Nov 27 23:07:32 2006 @@ -359,4 +359,42 @@ } //Code Added by Minnie -Ends +/** + * Function to get the vtiger_activity details for mail body + * @param string $description - activity description + * return string $list - HTML in string format + */ +function getActivityDetails($description,$inviteeid='') +{ + global $log,$current_user; + global $adb,$mod_strings; + $log->debug("Entering getActivityDetails(".$description.") method ..."); + + $reply = (($_REQUEST['mode'] == 'edit')?'Replied':'Created'); + if($inviteeid=='') + $name = getUserName($_REQUEST['assigned_user_id']); + else + $name = getUserName($inviteeid); + + $current_username = getUserName($current_user->id); + $status = (($_REQUEST['activity_mode']=='Task')?($_REQUEST['taskstatus']):($_REQUEST['eventstatus'])); + + $list = $mod_strings['LBL_DEAR'].' ' .$name.','; + $list .= '

'.$mod_strings['LBL_ACTIVITY_STRING'].' '.$reply.'. '.$mod_strings['LBL_DETAILS_STRING'].':'; + $list .= '
'.$mod_strings["LBL_SUBJECT"].' '.$_REQUEST['subject']; + $list .= '
'.$mod_strings["LBL_STATUS"].': '.$status; + $list .= '
'.$mod_strings["Priority"].': '.$_REQUEST['taskpriority']; + $list .= '
'.$mod_strings["Related To"].' : '.$_REQUEST['parent_name']; + if($_REQUEST['activity_mode']!= 'Events') + { + $list .= '
'.$mod_strings["LBL_CONTACT"].' '.$_REQUEST['contactlist']; + } + $list .= '
'.$mod_strings["LBL_APP_DESCRIPTION"].': '.$description; + $list .= '

'.$mod_strings["LBL_REGARDS_STRING"].' ,'; + $list .= '
'.$current_username.'.'; + + $log->debug("Exiting getActivityDetails method ..."); + return $list; +} + ?> Modified: vtigercrm/branches/5.0.3/modules/Calendar/Save.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/Save.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/Save.php Mon Nov 27 23:07:32 2006 @@ -26,6 +26,7 @@ //require("modules/Emails/class.phpmailer.php"); require_once("config.php"); require_once('include/database/PearDatabase.php'); +require_once('modules/Calendar/CalendarCommon.php'); global $adb; $local_log =& LoggerManager::getLogger('index'); $focus = new Activity(); @@ -194,38 +195,4 @@ else header("Location: index.php?action=$return_action&module=$return_module$view$hour$day$month$year&record=$return_id$activemode&viewname=$return_viewname$page&parenttab=$parenttab"); -/** - * Function to get the vtiger_activity details for mail body - * @param string $description - activity description - * return string $list - HTML in string format - */ -function getActivityDetails($description,$inviteeid='') -{ - global $log,$current_user; - global $adb,$mod_strings; - $log->debug("Entering getActivityDetails(".$description.") method ..."); - - $reply = (($_REQUEST['mode'] == 'edit')?'Replied':'Created'); - if($inviteeid=='') - $name = getUserName($_REQUEST['assigned_user_id']); - else - $name = getUserName($inviteeid); - - $current_username = getUserName($current_user->id); - $status = (($_REQUEST['activity_mode']=='Task')?($_REQUEST['taskstatus']):($_REQUEST['eventstatus'])); - - $list = $mod_strings['LBL_DEAR'].' ' .$name.','; - $list .= '

'.$mod_strings['LBL_ACTIVITY_STRING'].' '.$reply.'. '.$mod_strings['LBL_DETAILS_STRING'].':'; - $list .= '
'.$mod_strings["LBL_SUBJECT"].' '.$_REQUEST['subject']; - $list .= '
'.$mod_strings["LBL_STATUS"].': '.$status; - $list .= '
'.$mod_strings["Priority"].': '.$_REQUEST['taskpriority']; - $list .= '
'.$mod_strings["Related To"].' : '.$_REQUEST['parent_name']; - $list .= '
'.$mod_strings["LBL_CONTACT"].' '.$_REQUEST['contact_name']; - $list .= '
'.$mod_strings["LBL_APP_DESCRIPTION"].': '.$description; - $list .= '

'.$mod_strings["LBL_REGARDS_STRING"].' ,'; - $list .= '
'.$current_username.'.'; - - $log->debug("Exiting getActivityDetails method ..."); - return $list; -} ?> Modified: vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php Mon Nov 27 23:07:32 2006 @@ -9,6 +9,7 @@ * ********************************************************************************/ require_once('modules/Calendar/Activity.php'); +require_once('modules/Calendar/CalendarCommon.php'); require_once('include/logging.php'); require_once("config.php"); require_once('include/database/PearDatabase.php'); @@ -46,6 +47,23 @@ if(isset($_REQUEST['task_sendnotification']) && $_REQUEST['task_sendnotification'] != null) $focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"]; - $focus->save($tab_type); + $focus->save($tab_type); + if($_REQUEST["task_sendnotification"]=='on' && $_REQUEST['task_assigntype'] == 'U') + { + + global $current_user; + $local_log->info("send notification is on"); + require_once("modules/Emails/mail.php"); + $to_email = getUserEmailId('id',$_REQUEST['task_assigned_user_id']); + $subject = $_REQUEST['activity_mode'].' : '.$_REQUEST['task_subject']; + $_REQUEST["assigned_user_id"]= $_REQUEST["task_assigned_user_id"]; + $_REQUEST["subject"]=$subject; + $_REQUEST["parent_name"]=$_REQUEST["task_parent_name"]; + $_REQUEST['contactlist']=$_REQUEST['task_contact_name']; + $description = getActivityDetails($_REQUEST['task_description']); + $mail_status = send_mail('Calendar',$to_email,$current_user->user_name,'',$subject,$description); + + } + header("Location: index.php?action=index&module=Calendar&view=".$_REQUEST['view']."&hour=".$_REQUEST['hour']."&day=".$_REQUEST['day']."&month=".$_REQUEST['month']."&year=".$_REQUEST['year']."&viewOption=".$_REQUEST['viewOption']."&subtab=".$_REQUEST['subtab']."&parenttab=".$_REQUEST['parenttab']); ?> From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 28 02:11:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 28 Nov 2006 10:11:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9924 - /vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Message-ID: <20061128101123.670AD7896D5@vtiger.fosslabs.com> Author: richie Date: Tue Nov 28 03:11:17 2006 New Revision: 9924 Log: Error when custom field filter is set to no filter. Fixes #2453 Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php (original) +++ vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Tue Nov 28 03:11:17 2006 @@ -86,7 +86,7 @@ $querycolumns = $this->getEscapedColumns($selectedfields); - if(sizeof($permitted_fields) != 0 && !in_array($colname,$permitted_fields)) + if(sizeof($permitted_fields) != 0 && !in_array($fieldname,$permitted_fields)) { continue; } @@ -94,14 +94,7 @@ { if($querycolumns == "") { - if($selectedfields[0] == 'vtiger_activity' && $selectedfields[1] == 'status') - { - $columnslist[$fieldcolname] = " case when (vtiger_activity.status not like '') then vtiger_activity.status else vtiger_activity.eventstatus end as Calendar_Status"; - } - else - { - $columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1].' AS "'.$selectedfields[2].'"'; - } + $columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1].' AS "'.$selectedfields[2].'"'; } else { @@ -1322,6 +1315,7 @@ { $selectlist = $columnlist; } + //columns list if(isset($selectlist)) { @@ -1362,7 +1356,7 @@ } $reportquery = $this->getReportsQuery($this->primarymodule); - $log->DEBUG("ReportRun test now this :: Successfully returned sGetSQLforReport".$reportquery."or and or".$selectedcolumns); + if($type == 'COLUMNSTOTOTAL') { if(trim($groupsquery) != "") @@ -1388,7 +1382,6 @@ $reportquery = "select ".$selectedcolumns." ".$reportquery." ".$wheresql; } } - $log->DEBUG("ReportRun :: Successfully returned sGetSQLforReport".$reportquery); $log->info("ReportRun :: Successfully returned sGetSQLforReport".$reportid); return $reportquery; @@ -1415,10 +1408,9 @@ { $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); - $y=$adb->num_fields($result); - if($result) { + $y=$adb->num_fields($result); for ($x=0; $x<$y; $x++) { $fld = $adb->field_name($result, $x); @@ -1530,10 +1522,10 @@ $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); - $y=$adb->num_fields($result); if($result) { + $y=$adb->num_fields($result); $noofrows = $adb->num_rows($result); $custom_field_values = $adb->fetch_array($result); @@ -1636,10 +1628,10 @@ { $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); - $y=$adb->num_fields($result); - if($result) { + + $y=$adb->num_fields($result); for ($x=0; $x<$y; $x++) { $fld = $adb->field_name($result, $x); @@ -1647,6 +1639,7 @@ } $noofrows = $adb->num_rows($result); + $custom_field_values = $adb->fetch_array($result); $groupslist = $this->getGroupingList($this->reportid); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 28 02:27:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Tue, 28 Nov 2006 10:27:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9925 - /vtigercrm/branches/5.0.3/include/language/en_us.lang.php Message-ID: <20061128102721.EBAED788B2C@vtiger.fosslabs.com> Author: richie Date: Tue Nov 28 03:27:18 2006 New Revision: 9925 Log: label added for mail merge Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/include/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/include/language/en_us.lang.php Tue Nov 28 03:27:18 2006 @@ -626,7 +626,10 @@ 'LBL_PROFILE_NAME'=>'Profile Name', 'LBL_START_DATE'=>'Start Date', 'LBL_END_DATE'=>'End Date', -);$app_list_strings = array ( +'LBL_CREATE_MERGE_TEMPLATE'=>'Create Mail Merge templates ', +); + +$app_list_strings = array ( 'moduleList' => array ( 'Home' => 'Home', From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 29 06:41:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 29 Nov 2006 14:41:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9926 - in /vtigercrm/branches/5.0.3: Smarty/templates/ActivityListView.tpl modules/Calendar/ListView.php modules/Calendar/addEventUI.php modules/Calendar/calendarLayout.php modules/Calendar/script.js Message-ID: <20061129144106.55F037889BD@vtiger.fosslabs.com> Author: richie Date: Wed Nov 29 07:40:53 2006 New Revision: 9926 Log: Related to and Action Security added in calendar listview Modified: vtigercrm/branches/5.0.3/Smarty/templates/ActivityListView.tpl vtigercrm/branches/5.0.3/modules/Calendar/ListView.php vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php vtigercrm/branches/5.0.3/modules/Calendar/script.js Modified: vtigercrm/branches/5.0.3/Smarty/templates/ActivityListView.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/ActivityListView.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/ActivityListView.tpl Wed Nov 29 07:40:53 2006 @@ -1,518 +1,527 @@ -{**} - -{**} - - - - - - - {include file='Buttons_List.tpl'} - - - - - - - - -{**} -
- - - - - - - -
- - - - - -{**} - - -
- - - - - -
- - - - - - - - -
 {$APP.Calendar} {$MOD.LBL_ALL_EVENTS_TODOS} 
-
- - -
- - - -
- - -
-
- - - - - - - - - -
- - - - - - - -
- {foreach key=button_check item=button_label from=$BUTTONS} - {if $button_check eq 'del'} - - {elseif $button_check eq 's_mail'} - - {elseif $button_check eq 's_cmail'} - - {elseif $button_check eq 'c_status'} - - {elseif $button_check eq 'c_owner'} - {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} - - {/if} - {/if} - - {/foreach} - {$RECORD_COUNTS} - - {$NAVIGATION} -
-
- - - - - {if $ALL eq 'All'} - - {else} - - {/if} - -
{$APP.LBL_VIEW} - {$APP.LNK_CV_CREATEVIEW} - | - {$APP.LNK_CV_EDIT} - | - {$APP.LNK_CV_DELETE}{$APP.LNK_CV_CREATEVIEW} - | - {$APP.LNK_CV_EDIT} - | - {$APP.LNK_CV_DELETE}
-
-
- - - - {foreach name="listviewforeach" item=header from=$LISTHEADER} - - {/foreach} - - {foreach item=entity key=entity_id from=$LISTENTITY} - - - {foreach item=data from=$entity} - - {/foreach} - - {foreachelse} - - {/foreach} -
{$header}
{$data}
-
- {assign var=vowel_conf value='LBL_A'} - {assign var=MODULE_CREATE value=$SINGLE_MOD} - - {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} - - - - - - - - - -
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_CAN_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE} {$APP.LBL_NOW}. {$APP.LBL_CLICK_THE_LINK}:
- {if $MODULE neq 'Calendar'} -   -{$APP.LBL_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
- {else} -   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Meeting}
-   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Call}
-   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Todo} - {/if} -
- {else} - - - - - - - - -
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
-
- {/if} -
-
-
- - - - - - - -
- {foreach key=button_check item=button_label from=$BUTTONS} - {if $button_check eq 'del'} - - {elseif $button_check eq 's_mail'} - - {elseif $button_check eq 's_cmail'} - - {elseif $button_check eq 'c_status'} - - {elseif $button_check eq 'c_owner'} - {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} - - {/if} - {/if} - - {/foreach} - {$RECORD_COUNTS} - - {$NAVIGATION} -
-
- - - {$WORDTEMPLATEOPTIONS}{$MERGEBUTTON} - -
-
-
- -
-{$SELECT_SCRIPT} -
-
-
-
-
- -
- - -
- - - - - - - - - - - - - - - - - - -
{$APP.LBL_CHANGE_OWNER} {$APP.LBL_CLOSE}
 
{$APP.LBL_TRANSFER_OWNERSHIP}: -
- {$APP.LBL_USER}  - {$APP.LBL_GROUP}
- - -
-
 
-    - - -
-
- - - -{/literal} - +{**} + +{**} + + + + + + + {include file='Buttons_List.tpl'} + + + + + + + + +{**} +
+ + + + + + + +
+ + + + + +{**} + + +
+ + + + + +
+ + + + + + + + +
 {$APP.Calendar} {$MOD.LBL_ALL_EVENTS_TODOS} 
+
+ + +
+ + + +
+ + +
+
+ + + + + + + + + +
+ + + + + + + +
+ {foreach key=button_check item=button_label from=$BUTTONS} + {if $button_check eq 'del'} + + {elseif $button_check eq 's_mail'} + + {elseif $button_check eq 's_cmail'} + + {elseif $button_check eq 'c_status'} + + {elseif $button_check eq 'c_owner'} + {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} + + {/if} + {/if} + + {/foreach} + {$RECORD_COUNTS} + + {$NAVIGATION} +
+
+ + + + + {if $ALL eq 'All'} + + {else} + + {/if} + +
{$APP.LBL_VIEW} + {$APP.LNK_CV_CREATEVIEW} + | + {$APP.LNK_CV_EDIT} + | + {$APP.LNK_CV_DELETE}{$APP.LNK_CV_CREATEVIEW} + | + {$APP.LNK_CV_EDIT} + | + {$APP.LNK_CV_DELETE}
+
+
+ + + + {foreach name="listviewforeach" item=header from=$LISTHEADER} + + {/foreach} + + {foreach item=entity key=entity_id from=$LISTENTITY} + + + {foreach item=data from=$entity} + + {/foreach} + + {foreachelse} + + {/foreach} +
{$header}
{$data}
+
+ {assign var=vowel_conf value='LBL_A'} + {assign var=MODULE_CREATE value=$SINGLE_MOD} + + {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} + + + + + + + + + +
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_CAN_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE} {$APP.LBL_NOW}. {$APP.LBL_CLICK_THE_LINK}:
+ {if $MODULE neq 'Calendar'} +   -{$APP.LBL_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
+ {else} +   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Meeting}
+   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Call}
+   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Todo} + {/if} +
+ {else} + + + + + + + + +
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
+
+ {/if} +
+
+
+ + + + + + + +
+ {foreach key=button_check item=button_label from=$BUTTONS} + {if $button_check eq 'del'} + + {elseif $button_check eq 's_mail'} + + {elseif $button_check eq 's_cmail'} + + {elseif $button_check eq 'c_status'} + + {elseif $button_check eq 'c_owner'} + {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} + + {/if} + {/if} + + {/foreach} + {$RECORD_COUNTS} + + {$NAVIGATION} +
+
+ + + {$WORDTEMPLATEOPTIONS}{$MERGEBUTTON} + +
+
+
+ +
+{$SELECT_SCRIPT} +
+
+
+
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + +
{$APP.LBL_CHANGE_OWNER} {$APP.LBL_CLOSE}
 
{$APP.LBL_TRANSFER_OWNERSHIP}: +
+ {$APP.LBL_USER}  + {$APP.LBL_GROUP}
+ + +
+
 
+    + + +
+
+ + + +{/literal} + Modified: vtigercrm/branches/5.0.3/modules/Calendar/ListView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/ListView.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/ListView.php Wed Nov 29 07:40:53 2006 @@ -28,6 +28,7 @@ require_once('include/ListView/ListView.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('modules/Calendar/CalendarCommon.php'); require_once('include/database/PearDatabase.php'); global $app_strings; @@ -75,6 +76,13 @@ $customviewcombo_html = $oCustomView->getCustomViewCombo($viewid); $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid); //<<<<>>>> +$changeOwner = getAssignedTo(16); +$userList = $changeOwner[0]; +$groupList = $changeOwner[1]; +//echo '
';print_r($changeOwner); echo '
'; + +$smarty->assign("CHANGE_USER",$userList); +$smarty->assign("CHANGE_GROUP",$groupList); $smarty->assign("CHANGE_OWNER",getUserslist()); $smarty->assign("CHANGE_GROUP_OWNER",getGroupslist()); $where = ""; Modified: vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php Wed Nov 29 07:40:53 2006 @@ -26,6 +26,8 @@ $date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']); $taskassignedto = getAssignedTo(9); $eventassignedto = getAssignedTo(16); + $userList = $eventassignedto[0]; + $groupList = $eventassignedto[1]; $mysel= $_GET['view']; $calendar_arr = Array(); $calendar_arr['IMAGE_PATH'] = $image_path; @@ -630,12 +632,24 @@
- - - - + + - + - - - - - + - + - + - +
@@ -873,10 +887,30 @@  
@@ -897,12 +931,25 @@
+ - - - - + - + +
Modified: vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php Wed Nov 29 07:40:53 2006 @@ -1,1961 +1,2000 @@ -debug("Entering calendar_layout() method"); - $cal_header = array (); - if (isset($param_arr['size']) && $param_arr['size'] == 'small') - $param_arr['calendar']->show_events = false; - - $cal_header['view'] = $param_arr['view']; - $cal_header['IMAGE_PATH'] = $param_arr['IMAGE_PATH']; - $cal_header['calendar'] = $param_arr['calendar']; - $eventlabel = $mod_strings['LBL_EVENTS']; - $todolabel = $mod_strings['LBL_TODOS']; - //if $param_arr['size'] is set to 'small', get small(mini) calendar - if(isset($param_arr['size']) && $param_arr['size'] == 'small') - { - get_mini_calendar($param_arr); - } - else - { - //To differentiate selected subtab from unselected one - Starts - if($subtab == 'event') - { - $eventtab_class = 'dvtSelectedCell'; - $todotab_class = 'dvtUnSelectedCell'; - $event_anchor = $eventlabel; - $todo_anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=todo&parenttab=".$category."'>".$todolabel.""; - - } - elseif($subtab == 'todo') - { - $eventtab_class = 'dvtUnSelectedCell'; - $todotab_class = 'dvtSelectedCell'; - $event_anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=event&parenttab=".$category."'>".$eventlabel.""; - $todo_anchor = $todolabel; - } - //Ends - //To get calendar header and its links(like Day,Week,Month,Year and etc.) - get_cal_header_tab($cal_header,$viewBox,$subtab); - $subheader = ""; - $subheader .=<< - - - - - - -
- - - - - - - - - -
 $event_anchor $todo_anchor 
-
-EOQ; - echo $subheader; - if($viewBox == 'hourview' && $subtab == 'event') - { - get_cal_header_data($param_arr,$viewBox,$subtab); - getHourView($param_arr); - } - elseif($viewBox == 'listview' && $subtab == 'event') - { - get_cal_header_data($param_arr,$viewBox,$subtab); - getEventListView($param_arr); - } - elseif($subtab == 'todo') - { - $todo_list = ""; - $todo_list .= getTodosListView($param_arr,'',$subtab); - $todo_list .= '

'; - echo $todo_list; - } - } - - $cal_log->debug("Exiting calendar_layout() method"); - -} - -/** - * Function creates HTML to display small(mini) Calendar - * @param array $cal - collection of objects and strings - */ -function get_mini_calendar(& $cal) -{ - global $current_user,$adb,$cal_log; - $category = getParentTab(); - $cal_log->debug('Entering get_mini_calendar() method...'); - $count = 0; - //To decide number of rows(weeks) in a month - if ($cal['calendar']->month_array[$cal['calendar']->slices[35]]->start_time->month != $cal['calendar']->date_time->month) { - $rows = 5; - } else { - $rows = 6; - } - $minical = ""; - $minical .= " - - - "; - $minical .= ""; - $minical .= ""; - //To display days in week - $minical .= ''; - for ($i = 0; $i < 7; $i ++) - { - $weekdays_row = $cal['calendar']->month_array[$cal['calendar']->slices[$i]]; - $weekday = $weekdays_row->start_time->getdayofWeek_inshort(); - $minical .= ''; - } - $minical .= ""; - $event_class = ''; - $class = ''; - for ($i = 0; $i < $rows; $i ++) - { - $minical .= ""; - for ($j = 0; $j < 7; $j ++) - { - $cal['slice'] = $cal['calendar']->month_array[$cal['calendar']->slices[$count]]; - $class = dateCheck($cal['slice']->start_time->get_formatted_date()); - if($count%7 == 0) - $minical .= ""; - //To differentiate day having events from other days - if(count($cal['slice']->activities) != 0 && ($cal['slice']->start_time->get_formatted_date() == $cal['slice']->activities[0]->start_time->get_formatted_date())) - { - $event_class = 'class="eventDay"'; - } - else - { - $event_class = ''; - } - //To differentiate current day from other days - if($class != '' ) - $class = 'class="'.$class.'"'; - else - $class = $event_class; - - //To display month dates - if ($cal['slice']->start_time->getMonth() == $cal['calendar']->date_time->getMonth()) - { - $minical .= ""; - } - else - { - $minical .= ""; - } - $count++; - } - $minical .= ''; - } - - $minical .= "
 ".get_previous_cal($cal)." "; - $minical .= "date_time->get_date_str()."&parenttab=".$category."'>".display_date($cal['view'],$cal['calendar']->date_time)." ".get_next_cal($cal)." -
Week'.$weekday.'
start_time->get_date_str()."&parenttab=".$category."'>".$cal['slice']->start_time->week.""; - $minical .= "getView()."".$cal['slice']->start_time->get_date_str()."&parenttab=".$category."'>"; - $minical .= $cal['slice']->start_time->get_Date()."
"; - echo $minical; - $cal_log->debug("Exiting get_mini_calendar() method..."); -} - -/** - * Function creates HTML to display Calendar Header and its Links - * @param array $header - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means Events ListView.if 'hourview' means Events HourView. if empty means get Todos ListView - * @param string $subtab - string 'todo' or 'event'. if 'todo' means Todos View else Events View - */ -function get_cal_header_tab(& $header,$viewBox,$subtab) -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_cal_header_tab() method..."); - $tabhtml = ""; - $count = 1; - include_once 'modules/Calendar/addEventUI.php'; - include_once 'modules/Calendar/header.php'; - $eventlabel = $mod_strings['LBL_EVENTS']; - $todolabel = $mod_strings['LBL_TODOS']; - $div = " - -
- "; - echo $div; - $tabhtml .= ""; - $links = array ('day','week','month','year'); - //To differentiate the selected link from unselected links - foreach ($links as $link) - { - if ($header['view'] == $link) - { - $class = 'calSel'; - $anchor = $mod_strings["LBL_".$header['calendar']->getCalendarView($link)]; - } - else - { - $class = 'calUnSel'; - $anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>".$mod_strings["LBL_".$header['calendar']->getCalendarView($link)].""; - } - - if($count == 1) - $tabhtml .= ""; - else - $tabhtml .= ""; - $count++; - } - //To get Navigation(next&previous) links and display Date info - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - echo $tabhtml; - $cal_log->debug("Exiting get_cal_header_tab() method..."); -} - -/** - * Function creates HTML to display number of Events, Todos and pending list in calendar under header(Eg:Total Events : 5, 2 Pending / Total To Dos: 4, 1 Pending) - * @param array $cal_arr - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview'. if 'listview' means Events ListView.if 'hourview' means Events HourView. - */ -function get_cal_header_data(& $cal_arr,$viewBox,$subtab) -{ - global $mod_strings,$cal_log; - $cal_log->debug("Entering get_cal_header_data() method..."); - global $current_user,$app_strings; - $date_format = $current_user->date_format; - $format = $cal_arr['calendar']->hour_format; - $hour_startat = convertTime2UserSelectedFmt($format,$cal_arr['calendar']->day_start_hour,false); - $hour_endat = convertTime2UserSelectedFmt($format,($cal_arr['calendar']->day_start_hour+1),false); - $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); - $temp_ts = $cal_arr['calendar']->date_time->ts; - //To get date in user selected format - $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - $headerdata = ""; - $headerdata .=" -
-
-
".$anchor."".$anchor." - - - "; - $tabhtml .= ""; - $tabhtml .= " -
".get_previous_cal($header,$viewBox,$subtab)." - ".display_date($header['view'],$header['calendar']->date_time)."".get_next_cal($header,$viewBox,$subtab)." -
-
view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."btnL3Calendar.gif' alt='".$mod_strings['LBL_OPENCAL']."...' title='".$mod_strings['LBL_OPENCAL']."...' align='absmiddle' border='0'>view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."tbarSettings.gif' alt='".$mod_strings['LBL_SETTINGS']."' title='".$mod_strings['LBL_SETTINGS']."' align='absmiddle' border='0'>".$app_strings['Calendar']."
- "; - if(isPermitted("Calendar","EditView") == "yes") - { - $headerdata .=" - "; - } - else - { - $headerdata .=""; - } - $headerdata .=" - - -
 
-
- ".$mod_strings['LBL_ADD']." - -
 "; - $headerdata .= getEventTodoInfo($cal_arr,'listcnt'); - $headerdata .= "
".$mod_strings['LBL_VIEW']." : "; - $view_options = getEventViewOption($cal_arr,$viewBox); - $headerdata .=$view_options."
-
"; - echo $headerdata; - $cal_log->debug("Exiting get_cal_header_data() method..."); -} - -/** - * Function creates HTML select statement to display View selection box - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview'. if 'listview' means get Events ListView.if 'hourview' means get Events HourView. - * return string $view - html selection box - */ -function getEventViewOption(& $cal,$viewBox) -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - if($viewBox == 'listview') - { - $list_sel = 'selected'; - $hr_sel = ''; - } - else - { - $list_sel = ''; - $hr_sel = 'selected'; - } - $cal_log->debug("Entering getEventViewOption() method..."); - $view = "view."'> - date_time->hour."'> - date_time->day."'> - date_time->week."'> - date_time->month."'> - date_time->year."'> - - - - - - - - "; - $cal_log->debug("Exiting getEventViewOption() method..."); - return $view; -} - -/** - * Function creates HTML anchor tag to get previous-day/week/month/year view - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means previous link in Events ListView.if 'hourview' means previous link in Events HourView. if empty means previous link in Todos ListView - * @param string $subtab - string 'todo' or 'event' or may be empty. if 'todo' means Todos View. if 'event' means Events View. if empty means small calendar view. - * return string $link - html tags in string format - */ -function get_previous_cal(& $cal,$viewBox='',$subtab='') -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_previous_cal() method..."); - if(isset($cal['size']) && $cal['size'] == 'small') - { - $link = "view."".$cal['calendar']->get_datechange_info('prev')."&parenttab=".$category."\")'>"; - } - else - { - $link = "view."".$cal['calendar']->get_datechange_info('prev')."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>"; - } - $cal_log->debug("Exiting get_previous_cal() method..."); - return $link; -} - -/** - * Function creates HTML anchor tag to get next-day/week/month/year view - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means next link in Events ListView.if 'hourview' means next link in Events HourView. if empty means next link in Todos ListView - * @param string $subtab - string 'todo' or 'event' or may be empty. if 'todo' means Todos View. if 'event' means Events View. if empty means small calendar view. - * return string $link - html tags in string format - */ -function get_next_cal(& $cal,$viewBox='',$subtab='') -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_next_cal() method..."); - if(isset($cal['size']) && $cal['size'] == 'small') - { - $link = "view."".$cal['calendar']->get_datechange_info('next')."&parenttab=".$category."\")' >"; - } - else - { - $link = "view."".$cal['calendar']->get_datechange_info('next')."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>"; - } - $cal_log->debug("Exiting get_next_cal() method..."); - return $link; - -} - -/** - * Function to get date info depending upon on the calendar view(Eg: 21 July 2000) - * @param string $view - calendar view(day/week/month/year) - * @param array $date_time - contains DateTime object - * return string $label - date info(Eg for dayview : 13 July 2000) - */ -function display_date($view,$date_time) -{ - global $cal_log; - $cal_log->debug("Entering display_date() method..."); - if ($view == 'day') - { - //$label = $date_time->getdayofWeek()." "; - $label = $date_time->get_Date()." "; - $label .= $date_time->getmonthName()." "; - $label .= $date_time->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - elseif ($view == 'week') - { - $week_start = $date_time->getThisweekDaysbyIndex(0); - $week_end = $date_time->getThisweekDaysbyIndex(6); - $label = $week_start->get_Date()." "; - $label .= $week_start->getmonthName()." "; - $label .= $week_start->year; - $label .= " - "; - $label .= $week_end->get_Date()." "; - $label .= $week_end->getmonthName()." "; - $label .= $week_end->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - - elseif ($view == 'month') - { - $label = $date_time->getmonthName()." "; - $label .= $date_time->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - elseif ($view == 'year') - { - $cal_log->debug("Exiting display_date() method..."); - return $date_time->year; - } - -} -/** - * Function to get css class name for date - * @param string $slice_date - date - * returns string - css class name or empty string - */ -function dateCheck($slice_date) -{ - global $cal_log; - $cal_log->debug("Entering dateCheck() method..."); - $today = date('Y-m-d'); - if($today == $slice_date) - { - $cal_log->debug("Exiting dateCheck() method..."); - //css class for day having event(s) - return 'currDay'; - } - else - { - $cal_log->debug("Exiting dateCheck() method..."); - return ''; - } -} - -/** - * Function to construct respective calendar layout depends on the calendar view - * @param array $view - collection of objects and strings - */ -function getHourView(& $view) -{ - global $cal_log; - $hourview_layout = ''; - $cal_log->debug("Entering getHourView() method..."); - $hourview_layout .= '
-
'; - - if($view['view'] == 'day') - $hourview_layout .= getDayViewLayout($view); - elseif($view['view'] == 'week') - $hourview_layout .= getWeekViewLayout($view); - elseif($view['view'] == 'month') - $hourview_layout .= getMonthViewLayout($view); - elseif($view['view'] == 'year') - $hourview_layout .= getYearViewLayout($view); - else - die("view:".$view['view']." is not defined"); - - $hourview_layout .= '
- '; - $hourview_layout .= '
- - - - - - - - -
'; - echo $hourview_layout; - $cal_log->debug("Exiting getHourView() method..."); -} - -/** - * Fuction constructs Events ListView depends on the view - * @param array $cal - collection of objects and strings - * @param string $mode - string 'listcnt' or empty. if empty means get Events ListView else get total no. of events and no. of pending events Info. - * returns string $activity_list - total no. of events and no. of pending events Info(Eg: Total Events : 2, 1 Pending). - */ -function getEventListView(& $cal,$mode='') -{ - global $cal_log; - $list_view = ""; - $cal_log->debug("Entering getEventListView() method..."); - if($cal['calendar']->view == 'day') - { - $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date(); - } - elseif($cal['calendar']->view == 'week') - { - $start_date = $cal['calendar']->slices[0]; - $end_date = $cal['calendar']->slices[6]; - } - elseif($cal['calendar']->view == 'month') - { - $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0); - $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - elseif($cal['calendar']->view == 'year') - { - $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0); - $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment'); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - else - { - die("view:".$cal['calendar']->view." is not defined"); - } - //if $mode value is empty means get Events list in array format else get the count of total events and pending events in array format. - $activity_list = getEventList($cal, $start_date, $end_date,$mode); - if($mode != '') - { - $cal_log->debug("Exiting getEventListView() method..."); - return $activity_list; - } - //To get Events listView - $list_view .="
"; - $list_view .=constructEventListView($cal,$activity_list); - $list_view .="
- "; - $list_view .="
- - - - - - - - -
"; - echo $list_view; - $cal_log->debug("Exiting getEventListView() method..."); -} - - -/** - * Fuction constructs Todos ListView depends on the view - * @param array $cal - collection of objects and strings - * @param string $check - string 'listcnt' or empty. if empty means get Todos ListView else get total no. of Todos and no. of pending todos Info. - * returns string $todo_list - total no. of todos and no. of pending todos Info(Eg: Total Todos : 2, 1 Pending). - */ -function getTodosListView($cal, $check='',$subtab='') -{ - global $cal_log; - $list_view = ""; - $cal_log->debug("Entering getTodosListView() method..."); - if($cal['calendar']->view == 'day') - { - $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date(); - } - elseif($cal['calendar']->view == 'week') - { - $start_date = $cal['calendar']->slices[0]; - $end_date = $cal['calendar']->slices[6]; - } - elseif($cal['calendar']->view == 'month') - { - $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0); - $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - elseif($cal['calendar']->view == 'year') - { - $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0); - $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment'); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - else - { - die("view:".$cal['calendar']->view." is not defined"); - } - //if $check value is empty means get Todos list in array format else get the count of total todos and pending todos in array format. - $todo_list = getTodoList($cal, $start_date, $end_date,$check); - if($check != '') - { - $cal_log->debug("Exiting getTodosListView() method..."); - return $todo_list; - } - $cal_log->debug("Exiting getTodosListView() method..."); - $list_view .="
"; - //To get Todos listView - $list_view .= constructTodoListView($todo_list,$cal,$subtab); - $list_view .="
- - - - - - - - - - "; - echo $list_view; -} - -/** - * Function creates HTML to display Calendar DayView - * @param array $cal - collections of objects and strings. - * return string $dayview_layout - html tags in string format - */ -function getDayViewLayout(& $cal) -{ - //echo '
';print_r($cal);echo '
'; - global $current_user,$app_strings,$cal_log,$adb; - $no_of_rows = 1; - $cal_log->debug("Entering getDayViewLayout() method..."); - $shared_ids = getSharedCalendarId($current_user->id); - $user_details = getAllUserName(); - $usersid = $current_user->id.','.$shared_ids; - $userid_arr = explode(",",$usersid); - $date_format = $current_user->date_format; - $day_start_hour = $cal['calendar']->day_start_hour; - $day_end_hour = $cal['calendar']->day_end_hour; - $format = $cal['calendar']->hour_format; - $dayview_layout = ''; - $dayview_layout .= ' '; - $dayview_layout .= ' -
- '; - for($j=0;$j<24;$j++) - { - $slice = $cal['calendar']->slices[$j]; - $act = $cal['calendar']->day_slice[$slice]->activities; - if(!empty($act)) - { - $temprows = count($act); - $no_of_rows = ($no_of_rows>$temprows)?$no_of_rows:$temprows; - } - } - for($i=$day_start_hour;$i<=$day_end_hour;$i++) - { - - if($cal['calendar']->hour_format == 'am/pm') - { - if($i == 12) - { - $hour = $i; - $sub_str = 'pm'; - } - elseif($i>12) - { - $hour = $i - 12; - $sub_str = 'pm'; - } - else - { - if($i == 0) - $hour = 12; - else - $hour = $i; - $sub_str = 'am'; - } - - } - else - { - $hour = $i; - if($hour <= 9 && strlen(trim($hour)) < 2) - $hour = "0".$hour; - $sub_str = ':00'; - } - $y = $i+1; - $hour_startat = convertTime2UserSelectedFmt($format,$i,false); - $hour_endat = convertTime2UserSelectedFmt($format,$y,false); - $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); - $temp_ts = $cal['calendar']->date_time->ts; - $sttemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - if($i != 23) - { - $endtemp_date = $sttemp_date; - } - else - { - $addday = $temp_ts + (1 * 24 * 60 * 60); - $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$addday)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$addday)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $addday)):('')))); - } - - $js_string = ""; - if(isPermitted("Calendar","EditView") == "yes") - $js_string = 'onClick="fnvshobj(this,\'addEvent\'); gshow(\'addEvent\',\'call\',\''.$sttemp_date.'\',\''.$endtemp_date.'\',\''.$time_arr['starthour'].'\',\''.$time_arr['startmin'].'\',\''.$time_arr['startfmt'].'\',\''.$time_arr['endhour'].'\',\''.$time_arr['endmin'].'\',\''.$time_arr['endfmt'].'\',\'hourview\',\'event\')"'; - $dayview_layout .= ' - '; - //To display events in Dayview - $dayview_layout .= getdayEventLayer($cal,$cal['calendar']->slices[$i],$no_of_rows); - $dayview_layout .= ''; - } - $dayview_layout .= '
'.$hour.''.$sub_str.'
-
'; - $cal_log->debug("Exiting getDayViewLayout() method..."); - return $dayview_layout; -} - -/** - * Function creates HTML to display Calendar WeekView - * @param array $cal - collections of objects and strings From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 29 08:10:14 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 29 Nov 2006 16:10:14 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9927 - in /vtigercrm/branches/5.0.3: Smarty/templates/HomePage.tpl modules/Home/index.php Message-ID: <20061129161014.6C692788A28@vtiger.fosslabs.com> Author: richie Date: Wed Nov 29 09:09:54 2006 New Revision: 9927 Log: Changes made that the More link in home page shows only the user record Modified: vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl vtigercrm/branches/5.0.3/modules/Home/index.php Modified: vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl Wed Nov 29 09:09:54 2006 @@ -147,7 +147,7 @@ {if $modulename neq 'CustomView' && $modulename neq 'GroupAllocation'} - {$APP.LBL_MORE}.. + {$APP.LBL_MORE}.. {else}   {/if} Modified: vtigercrm/branches/5.0.3/modules/Home/index.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Home/index.php (original) +++ vtigercrm/branches/5.0.3/modules/Home/index.php Wed Nov 29 09:09:54 2006 @@ -175,10 +175,13 @@ } global $current_language; + +global $current_user; +$user_name = $current_user->column_fields[user_name]; $current_module_strings = return_module_language($current_language, 'Calendar'); $t=Date("Ymd"); -//echo '
';print_r($activities); echo '
'; +//echo '
';print_r($home_values); echo '
'; $buttoncheck['Calendar'] = isPermitted('Calendar','index'); $smarty->assign("CHECK",$buttoncheck); $smarty->assign("IMAGE_PATH",$image_path); @@ -189,6 +192,7 @@ $smarty->assign("HOMEDETAILS",$home_values); $smarty->assign("HOMEDEFAULTVIEW",DefHomeView()); $smarty->assign("ACTIVITIES",$activities); +$smarty->assign("CURRENTUSER",$user_name); $freetag = new freetag(); $smarty->assign("ALL_TAG",$freetag->get_tag_cloud_html("",$current_user->id)); $smarty->display("HomePage.tpl"); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 29 09:05:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Wed, 29 Nov 2006 17:05:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9928 - /vtigercrm/tags/vtigercrm-5.0.3-val/ Message-ID: <20061129170536.0433C7896EC@vtiger.fosslabs.com> Author: richie Date: Wed Nov 29 10:05:31 2006 New Revision: 9928 Log: 5.0.3 version tagged for Webmail fix Added: vtigercrm/tags/vtigercrm-5.0.3-val/ - copied from r9927, vtigercrm/branches/5.0.3/ From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 30 02:58:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits@vtiger.fosslabs.com) Date: Thu, 30 Nov 2006 10:58:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9929 - /vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Message-ID: <20061130105822.74234789436@vtiger.fosslabs.com> Author: richie Date: Thu Nov 30 03:58:16 2006 New Revision: 9929 Log: Status missing in activity report - fixed Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php (original) +++ vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Thu Nov 30 03:58:16 2006 @@ -86,7 +86,7 @@ $querycolumns = $this->getEscapedColumns($selectedfields); - if(sizeof($permitted_fields) != 0 && !in_array($fieldname,$permitted_fields)) + if(sizeof($permitted_fields) != 0 && !in_array($colname,$permitted_fields)) { continue; } @@ -94,7 +94,14 @@ { if($querycolumns == "") { - $columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1].' AS "'.$selectedfields[2].'"'; + if($selectedfields[0] == 'vtiger_activity' && $selectedfields[1] == 'status') + { + $columnslist[$fieldcolname] = " case when (vtiger_activity.status not like '') then vtiger_activity.status else vtiger_activity.eventstatus end as Calendar_Status"; + } + else + { + $columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1].' AS "'.$selectedfields[2].'"'; + } } else { @@ -1315,7 +1322,6 @@ { $selectlist = $columnlist; } - //columns list if(isset($selectlist)) { @@ -1356,7 +1362,6 @@ } $reportquery = $this->getReportsQuery($this->primarymodule); - if($type == 'COLUMNSTOTOTAL') { if(trim($groupsquery) != "") @@ -1408,6 +1413,7 @@ { $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); + if($result) { $y=$adb->num_fields($result); @@ -1628,9 +1634,9 @@ { $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); + if($result) { - $y=$adb->num_fields($result); for ($x=0; $x<$y; $x++) { @@ -1639,7 +1645,6 @@ } $noofrows = $adb->num_rows($result); - $custom_field_values = $adb->fetch_array($result); $groupslist = $this->getGroupingList($this->reportid); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 1 04:48:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 01 Nov 2006 09:48:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9767 - /vtigercrm/tags/vtigercrm-5.0.2/ Message-ID: <20061101094805.35FD3788CBB@vtiger.fosslabs.com> Author: richie Date: Wed Nov 1 02:47:59 2006 New Revision: 9767 Log: 5.0.2 version tagged Added: vtigercrm/tags/vtigercrm-5.0.2/ - copied from r9766, vtigercrm/trunk/ From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 1 04:57:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 01 Nov 2006 09:57:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9768 - /vtigercrm/branches/5.0.3/ Message-ID: <20061101095721.EE09B788CBB@vtiger.fosslabs.com> Author: richie Date: Wed Nov 1 02:57:16 2006 New Revision: 9768 Log: branch created for 5.0.3 release Added: vtigercrm/branches/5.0.3/ - copied from r9767, vtigercrm/trunk/ From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 1 07:21:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 01 Nov 2006 12:21:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9769 - in /vtigercrm/branches/5.0.3/modules: Accounts/Accounts.php Leads/Leads.php Message-ID: <20061101122113.A495C787DD6@vtiger.fosslabs.com> Author: richie Date: Wed Nov 1 05:21:08 2006 New Revision: 9769 Log: * Added variable entity_table which is used in export function Modified: vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php vtigercrm/branches/5.0.3/modules/Leads/Leads.php Modified: vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php (original) +++ vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php Wed Nov 1 05:21:08 2006 @@ -42,6 +42,7 @@ var $tab_name = Array('vtiger_crmentity','vtiger_account','vtiger_accountbillads','vtiger_accountshipads','vtiger_accountscf'); var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid'); + var $entity_table = "vtiger_crmentity"; var $column_fields = Array(); Modified: vtigercrm/branches/5.0.3/modules/Leads/Leads.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Leads/Leads.php (original) +++ vtigercrm/branches/5.0.3/modules/Leads/Leads.php Wed Nov 1 05:21:08 2006 @@ -35,7 +35,7 @@ var $tab_name = Array('vtiger_crmentity','vtiger_leaddetails','vtiger_leadsubdetails','vtiger_leadaddress','vtiger_leadscf'); var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_leaddetails'=>'leadid','vtiger_leadsubdetails'=>'leadsubscriptionid','vtiger_leadaddress'=>'leadaddressid','vtiger_leadscf'=>'leadid'); - + var $entity_table = "vtiger_crmentity"; //construct this from database; var $column_fields = Array(); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 03:13:40 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 08:13:40 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9770 - /vtigercrm/branches/5.0.3/include/CustomFieldUtil.php Message-ID: <20061106081340.75F56788A33@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 01:13:36 2006 New Revision: 9770 Log: i18n issue in listview custom fields fixed Modified: vtigercrm/branches/5.0.3/include/CustomFieldUtil.php Modified: vtigercrm/branches/5.0.3/include/CustomFieldUtil.php ============================================================================== --- vtigercrm/branches/5.0.3/include/CustomFieldUtil.php (original) +++ vtigercrm/branches/5.0.3/include/CustomFieldUtil.php Mon Nov 6 01:13:36 2006 @@ -19,6 +19,8 @@ */ function getCustomFieldTypeName($uitype) { + + global $mod_strings,$app_strings; global $log; $log->debug("Entering getCustomFieldTypeName(".$uitype.") method ..."); global $log; @@ -27,55 +29,55 @@ if($uitype == 1) { - $fldname = 'Text'; + $fldname = $mod_strings['Text']; } elseif($uitype == 7) { - $fldname = 'Number'; + $fldname = $mod_strings['Number']; } elseif($uitype == 9) { - $fldname = 'Percent'; + $fldname = $mod_strings['Percent']; } elseif($uitype == 5) { - $fldname = 'Date'; + $fldname = $mod_strings['Date']; } elseif($uitype == 13) { - $fldname = 'Email'; + $fldname = $mod_strings['Email']; } elseif($uitype == 11) { - $fldname = 'Phone'; + $fldname = $mod_strings['Phone']; } elseif($uitype == 15) { - $fldname = 'PickList'; + $fldname = $mod_strings['PickList']; } elseif($uitype == 17) { - $fldname = 'Url'; + $fldname = $mod_strings['LBL_URL']; } elseif($uitype == 56) { - $fldname = 'Checkbox'; + $fldname = $mod_strings['LBL_CHECK_BOX']; } elseif($uitype == 71) { - $fldname = 'Currency'; + $fldname = $mod_strings['Currency']; } elseif($uitype == 21) { - $fldname = 'Text Area'; + $fldname = $mod_strings['LBL_TEXT_AREA']; } elseif($uitype == 33) { - $fldname = 'Multi-Select Combo Box'; + $fldname = $mod_strings['LBL_MULTISELECT_COMBO']; } elseif($uitype == 85) { - $fldname = 'Skype'; + $fldname = $mod_strings['Skype']; } $log->debug("Exiting getCustomFieldTypeName method ..."); return $fldname; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 04:25:53 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 09:25:53 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9771 - /vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php Message-ID: <20061106092553.AE959787F32@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 02:25:50 2006 New Revision: 9771 Log: duplicate label removed Modified: vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php Mon Nov 6 02:25:50 2006 @@ -362,7 +362,6 @@ 'LBL_INVITE'=>'Invite', 'LBL_REPEAT'=>'Repeat', 'LBL_REMINDER'=>'Reminder', -'LBL_ENABLE_REPEAT'=>'Enable Repeat', 'LBL_SENDREMINDER'=>'Send Reminder', 'LBL_NOTIFICATION'=>'Notification', 'LBL_SENDNOTIFICATION'=>'Send Notification', From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 04:41:49 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 09:41:49 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9772 - in /vtigercrm/branches/5.0.3: Smarty/templates/ProfileDetailView.tpl include/utils/UserInfoUtil.php modules/Users/profilePrivileges.php Message-ID: <20061106094150.C293D787F32@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 02:41:42 2006 New Revision: 9772 Log: error during profile creation - fixed. Fixes #2529 Modified: vtigercrm/branches/5.0.3/Smarty/templates/ProfileDetailView.tpl vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php vtigercrm/branches/5.0.3/modules/Users/profilePrivileges.php Modified: vtigercrm/branches/5.0.3/Smarty/templates/ProfileDetailView.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/ProfileDetailView.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/ProfileDetailView.tpl Mon Nov 6 02:41:42 2006 @@ -139,11 +139,11 @@ - + - +
{$APP.LBL_PROFILE_NAME} :
{$APP.LBL_DESCRIPTION} :
Modified: vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php (original) +++ vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php Mon Nov 6 02:41:42 2006 @@ -1359,7 +1359,7 @@ $sql1 = "select description from vtiger_profile where profileid=".$profileid; $result = $adb->query($sql1); $profileDescription = $adb->query_result($result,0,"description"); - $log->debug("Exiting getProfileName method ..."); + $log->debug("Exiting getProfileDescription method ..."); return $profileDescription; } Modified: vtigercrm/branches/5.0.3/modules/Users/profilePrivileges.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/profilePrivileges.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/profilePrivileges.php Mon Nov 6 02:41:42 2006 @@ -21,6 +21,8 @@ $image_path=$theme_path."images/"; $profileId=$_REQUEST['profileid']; $profileName=''; +$profileDescription=''; + $parentProfileId=$_REQUEST['parentprofile']; if($_REQUEST['mode'] =='create' && $_REQUEST['radiobutton'] != 'baseprofile') $parentProfileId = ''; @@ -66,14 +68,16 @@ if(isset($_REQUEST['profile_description']) && $_REQUEST['profile_description'] != '' && $_REQUEST['mode'] == 'create') - $smarty->assign("PROFILE_DESCRIPTION",$_REQUEST['profile_description']); + $profileDescription = $_REQUEST['profile_description']; else { - $profileDescription = getProfileDescription($profileId); -} - -$smarty->assign("Profile_Name", $profileName); -$smarty->assign("Profile_Description", $profileDescription); + if($profileId != null) + { + $profileDescription = getProfileDescription($profileId); + } +} + +$smarty->assign("PROFILE_DESCRIPTION", $profileDescription); if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != '') $smarty->assign("MODE",$_REQUEST['mode']); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 05:55:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 10:55:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9773 - /vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Message-ID: <20061106105517.C3EDE787E57@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 03:55:14 2006 New Revision: 9773 Log: fixes made to show emails even the values are empty Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php (original) +++ vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Mon Nov 6 03:55:14 2006 @@ -1112,6 +1112,9 @@ }elseif(trim($value) == "" && $datatype == "V") { $rtvalue = " = ".$adb->quote($value); + }elseif(trim($value) == "" && $datatype == "E") + { + $rtvalue = " = ".$adb->quote($value); }else { $rtvalue = " is NULL"; @@ -1126,6 +1129,9 @@ { $rtvalue = " <> ".$adb->quote($value); }elseif(trim($value) == "" && $datatype == "V") + { + $rtvalue = " <> ".$adb->quote($value); + }elseif(trim($value) == "" && $datatype == "E") { $rtvalue = " <> ".$adb->quote($value); }else From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 6 08:05:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 06 Nov 2006 13:05:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9774 - /vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Message-ID: <20061106130547.71C91788DF8@vtiger.fosslabs.com> Author: richie Date: Mon Nov 6 06:05:43 2006 New Revision: 9774 Log: i18n support for advance and basic search fields Modified: vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/SearchUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/SearchUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Mon Nov 6 06:05:43 2006 @@ -182,12 +182,12 @@ if($fieldname!='parent_id') { $fld_name=$fieldname; - $search_header[$fld_name]=$name; + $search_header[$fld_name]=$mod_strings[$name]; } } } } - $log->debug("Exiting getSearchListHeaderValues method ..."); + $log->debug("Exiting getSearchListHeaderValues method ..."); return $search_header; } @@ -451,7 +451,7 @@ $block = $adb->query_result($result,$i,"block"); $fieldtype = explode("~",$fieldtype); $fieldtypeofdata = $fieldtype[0]; - $fieldlabel = $adb->query_result($result,$i,"fieldlabel"); + $fieldlabel = $mod_strings[$adb->query_result($result,$i,"fieldlabel")]; if($fieldlabel == "Related To") { $fieldlabel = "Related to"; From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 02:40:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 07:40:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9775 - /vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Message-ID: <20061107074039.792AC788FB2@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 00:40:34 2006 New Revision: 9775 Log: alphabet case issue fixed. Fixes #1811 Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js ============================================================================== --- vtigercrm/branches/5.0.3/include/js/dtlviewajax.js (original) +++ vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Tue Nov 7 00:40:34 2006 @@ -349,7 +349,7 @@ 'index.php', {queue: {position: 'end', scope: 'command'}, method: 'post', - postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +tagValue, + postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +escape(tagValue), onComplete: function(response) { getObj('tagfields').innerHTML = response.responseText; $("vtbusy_info").style.display="none"; From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 02:46:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 07:46:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9776 - /vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php Message-ID: <20061107074624.970EF788FB2@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 00:46:20 2006 New Revision: 9776 Log: Home Page Quote Status is inconsistent. Fixes #1857 Modified: vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php Modified: vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php (original) +++ vtigercrm/branches/5.0.3/modules/Quotes/ListTopQuotes.php Tue Nov 7 00:46:20 2006 @@ -60,7 +60,10 @@ //<<<<<<<<>>>>>>>> $date_var = date('Y-m-d'); - $where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and vtiger_quotes.validtill >= \''.$date_var.'\''; + $where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and vtiger_quotes.quotestage != "Rejected" and vtiger_quotes.validtill >= \''.$date_var.'\''; + //$where = ' and vtiger_crmentity.smownerid='.$current_user->id.' and vtiger_quotes.validtill >= \''.$date_var.'\''; + + $query = getListQuery("Quotes",$where); $query .=" ORDER BY total DESC"; //<<<<<<<>>>>>>>> From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 03:01:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 08:01:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9777 - in /vtigercrm/branches/5.0.3/Smarty/templates: DetailViewHidden.tpl EditViewHidden.tpl Message-ID: <20061107080143.99D91788FAB@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 01:01:34 2006 New Revision: 9777 Log: Made changes for module addition tool Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailViewHidden.tpl vtigercrm/branches/5.0.3/Smarty/templates/EditViewHidden.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailViewHidden.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/DetailViewHidden.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/DetailViewHidden.tpl Tue Nov 7 01:01:34 2006 @@ -192,6 +192,14 @@ +{else} + + + + + + + {/if} Modified: vtigercrm/branches/5.0.3/Smarty/templates/EditViewHidden.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/EditViewHidden.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/EditViewHidden.tpl Tue Nov 7 01:01:34 2006 @@ -76,6 +76,9 @@
+{else} + {$ERROR_MESSAGE} + {/if} From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 08:21:53 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 13:21:53 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9778 - /vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl Message-ID: <20061107132153.87DF0788FC0@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 06:21:46 2006 New Revision: 9778 Log: multiple select option issue in customfield fixed . Fixes #2392 Modified: vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/DisplayFields.tpl Tue Nov 7 06:21:46 2006 @@ -101,10 +101,11 @@ From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 10:46:58 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 15:46:58 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9779 - /vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php Message-ID: <20061107154658.2D7CF788FCF@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 08:46:52 2006 New Revision: 9779 Log: Date fields are filled automatically - resolved . Fixes #1577 Modified: vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/EditViewUtils.php Tue Nov 7 08:46:52 2006 @@ -68,7 +68,7 @@ if($value=='') { //modified to fix the issue in trac(http://vtiger.fosslabs.com/cgi-bin/trac.cgi/ticket/1469) - if($fieldname != 'birthday' && $generatedtype != 2)// && $fieldname != 'due_date')//due date is today's date by default + if($fieldname != 'birthday' && $generatedtype != 2 && getTabid($module_name) !=14)// && $fieldname != 'due_date')//due date is today's date by default $disp_value=getNewDisplayDate(); //Added to display the Contact - Support End Date as one year future instead of today's date -- 30-11-2005 From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 7 10:52:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 07 Nov 2006 15:52:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9780 - /vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php Message-ID: <20061107155222.00CAE788FCF@vtiger.fosslabs.com> Author: richie Date: Tue Nov 7 08:52:17 2006 New Revision: 9780 Log: solution to escape sql injection. Fixes #2369 Modified: vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php Modified: vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php (original) +++ vtigercrm/branches/5.0.3/modules/Settings/UpdateComboValues.php Tue Nov 7 08:52:17 2006 @@ -38,7 +38,7 @@ if($tabname[1]!='') $custom=true; -for($i = 0; $i < $count; $i++) +/*for($i = 0; $i < $count; $i++) { $pickArray[$i] = trim($pickArray[$i]); if($pickArray[$i] != '') @@ -50,6 +50,17 @@ $adb->query($query); } -} +}*/ +/* ticket2369 fixed*/ +$columnName = $tableName; +foreach ($pickArray as $index => $data) { + $data = trim($data); + if(!empty($data)){ + $data = $adb->formatString("vtiger_$tableName",$columnName,$data); + $query = "insert into vtiger_$tableName values('',$data,$index,1)"; + $adb->query($query); + } +} + header("Location:index.php?action=SettingsAjax&module=Settings&directmode=ajax&file=PickList&fld_module=".$fld_module); ?> From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:20:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:20:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9781 - /vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Message-ID: <20061108072047.DBDDF789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:20:39 2006 New Revision: 9781 Log: Updated foreign key constraints for tabid in various tables Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml ============================================================================== --- vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml (original) +++ vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Wed Nov 8 00:20:39 2006 @@ -229,6 +229,13 @@ + + ADD CONSTRAINT fk_1_vtiger_blocks FOREIGN KEY (tabid) REFERENCES vtiger_tab(tabid) ON DELETE CASCADE + Type=InnoDB + + +
+ @@ -4123,11 +4130,21 @@ - - - - - Type=InnoDB + + + + + entitytype + + + Type=InnoDB +
+ + + ADD CONSTRAINT fk_1_vtiger_customview FOREIGN KEY (entitytype) REFERENCES vtiger_tab (name) ON DELETE CASCADE + Type=InnoDB + +
@@ -4152,12 +4169,12 @@ Type=InnoDB
- -ADD CONSTRAINT fk_1_vtiger_cvcolumnlist FOREIGN KEY (cvid) REFERENCES vtiger_customview (cvid) ON DELETE CASCADE -Type=InnoDB - - -
+ + ADD CONSTRAINT fk_1_vtiger_cvcolumnlist FOREIGN KEY (cvid) REFERENCES vtiger_customview (cvid) ON DELETE CASCADE + Type=InnoDB + + +
@@ -5417,10 +5434,10 @@
- - - - + + + + @@ -5432,6 +5449,20 @@ parenttabidType=InnoDB +
+ + + ADD CONSTRAINT fk_1_vtiger_parenttabrel FOREIGN KEY (tabid) REFERENCES vtiger_tab(tabid) ON DELETE CASCADE + Type=InnoDB + + +
+ + + ADD CONSTRAINT fk_2_vtiger_parenttabrel FOREIGN KEY (parenttabid) REFERENCES vtiger_parenttab(parenttabid) ON DELETE CASCADE + Type=InnoDB + +
@@ -6105,6 +6136,13 @@ Type=InnoDB
+ + ADD CONSTRAINT fk_1_vtiger_entityname FOREIGN KEY (tabid) REFERENCES vtiger_tab(tabid) ON DELETE CASCADE + Type=InnoDB + + +
+ From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:28:52 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:28:52 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9782 - /vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php Message-ID: <20061108072852.37599788FE3@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:28:44 2006 New Revision: 9782 Log: Added function isPresentRelatedLists Modified: vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/DetailViewUtils.php Wed Nov 8 00:28:44 2006 @@ -1327,6 +1327,30 @@ return $focus_list; } +/** This function returns whether related lists is present for this particular module or not +* Param $module - module name +* Param $activity_mode - mode of activity +* Return type true or false +*/ + + +function isPresentRelatedLists($module,$activity_mode='') +{ + global $adb; + $retval='true'; + $tab_id=getTabid($module); + $query= "select count(*) as count from vtiger_relatedlists where tabid=".$tab_id; + $result=$adb->query($query); + $count=$adb->query_result($result,0,'count'); + if($count < 1 || ($module =='Calendar' && $activity_mode=='task')) + { + $retval='false'; + } + return $retval; + + +} + /** This function returns the detailed block information of a record in a module. * Param $module - module name * Param $block - block id From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:32:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:32:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9783 - /vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl Message-ID: <20061108073256.44B72789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:32:28 2006 New Revision: 9783 Log: Hard Coding of Related Lists Removed Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/DetailView.tpl Wed Nov 8 00:32:28 2006 @@ -128,7 +128,7 @@ - {if $MODULE eq 'Notes' || $MODULE eq 'Faq' || $MODULE eq 'Webmails' || ($MODULE eq 'Calendar' && $ACTIVITY_MODE eq 'Task')} + {if $IS_REL_LIST eq 'false'} {else} @@ -380,7 +380,7 @@ {/if} - {if $SinglePane_View eq 'true'} + {if $SinglePane_View eq 'true' && $IS_REL_LIST eq 'true'} {include file= 'RelatedListNew.tpl'} {/if}
 {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  
From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:37:19 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:37:19 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9784 - /vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php Message-ID: <20061108073719.6B1F8789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:37:11 2006 New Revision: 9784 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Accounts/DetailView.php Wed Nov 8 00:37:11 2006 @@ -110,6 +110,7 @@ $smarty->assign("MODULE",$currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:38:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:38:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9785 - /vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php Message-ID: <20061108073844.F18BD789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:38:36 2006 New Revision: 9785 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Campaigns/DetailView.php Wed Nov 8 00:38:36 2006 @@ -70,6 +70,7 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:40:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:40:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9786 - /vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php Message-ID: <20061108074021.1E79A789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:40:14 2006 New Revision: 9786 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Contacts/DetailView.php Wed Nov 8 00:40:14 2006 @@ -121,6 +121,7 @@ $smarty->assign("MODULE",$currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:41:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:41:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9787 - /vtigercrm/branches/5.0.3/modules/Faq/DetailView.php Message-ID: <20061108074130.ACD42789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:41:23 2006 New Revision: 9787 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Faq/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Faq/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Faq/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Faq/DetailView.php Wed Nov 8 00:41:23 2006 @@ -76,6 +76,8 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + $tabid = getTabid("Faq"); $validationData = getDBValidationData($focus->tab_name,$tabid); $data = split_validationdataArray($validationData); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:42:25 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:42:25 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9788 - /vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php Message-ID: <20061108074225.AD145789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:42:18 2006 New Revision: 9788 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/HelpDesk/DetailView.php Wed Nov 8 00:42:18 2006 @@ -104,6 +104,7 @@ $smarty->assign("MODULE",$currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:43:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:43:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9789 - /vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php Message-ID: <20061108074344.9FCD5789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:43:37 2006 New Revision: 9789 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Invoice/DetailView.php Wed Nov 8 00:43:37 2006 @@ -90,6 +90,7 @@ $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:44:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:44:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9790 - /vtigercrm/branches/5.0.3/modules/Leads/DetailView.php Message-ID: <20061108074428.59E2A789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:44:19 2006 New Revision: 9790 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Leads/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Leads/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Leads/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Leads/DetailView.php Wed Nov 8 00:44:19 2006 @@ -125,6 +125,8 @@ $smarty->assign("MODULE", $currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:45:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:45:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9791 - /vtigercrm/branches/5.0.3/modules/Notes/DetailView.php Message-ID: <20061108074503.B4CCA789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:44:55 2006 New Revision: 9791 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Notes/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Notes/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Notes/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Notes/DetailView.php Wed Nov 8 00:44:55 2006 @@ -104,6 +104,9 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); + +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + $tabid = getTabid("Notes"); $validationData = getDBValidationData($focus->tab_name,$tabid); $data = split_validationdataArray($validationData); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:45:51 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:45:51 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9792 - /vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php Message-ID: <20061108074551.61032789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:45:44 2006 New Revision: 9792 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Potentials/DetailView.php Wed Nov 8 00:45:44 2006 @@ -100,6 +100,8 @@ $smarty->assign("RELATEDLISTS", $related_array); } +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + $smarty->assign("SinglePane_View", $singlepane_view); $smarty->display("DetailView.tpl"); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:46:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:46:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9793 - /vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php Message-ID: <20061108074628.58278789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:46:20 2006 New Revision: 9793 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/PriceBooks/DetailView.php Wed Nov 8 00:46:20 2006 @@ -80,6 +80,7 @@ $related_array = getRelatedLists($currentModule,$focus); $smarty->assign("RELATEDLISTS", $related_array); } +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); $smarty->assign("SinglePane_View", $singlepane_view); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:47:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:47:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9794 - /vtigercrm/branches/5.0.3/modules/Products/DetailView.php Message-ID: <20061108074747.C3414789034@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:47:38 2006 New Revision: 9794 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Products/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Products/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Products/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Products/DetailView.php Wed Nov 8 00:47:38 2006 @@ -91,6 +91,8 @@ $smarty->assign("MODULE", $currentModule); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:51:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:51:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9795 - /vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php Message-ID: <20061108075106.CE512789051@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:50:57 2006 New Revision: 9795 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/PurchaseOrder/DetailView.php Wed Nov 8 00:50:57 2006 @@ -92,6 +92,8 @@ $smarty->assign("CHECK", $check_button); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:51:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:51:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9796 - /vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php Message-ID: <20061108075159.E292D789051@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:51:52 2006 New Revision: 9796 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Quotes/DetailView.php Wed Nov 8 00:51:52 2006 @@ -101,6 +101,8 @@ $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:52:52 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:52:52 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9797 - /vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php Message-ID: <20061108075253.0E1B9789037@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:52:43 2006 New Revision: 9797 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/SalesOrder/DetailView.php Wed Nov 8 00:52:43 2006 @@ -98,6 +98,8 @@ $smarty->assign("CHECK", $check_button); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 02:54:02 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 07:54:02 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9798 - /vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php Message-ID: <20061108075402.B8DA4789051@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 00:53:54 2006 New Revision: 9798 Log: Hard Coded check for releated lists removed Modified: vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php Modified: vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php Wed Nov 8 00:53:54 2006 @@ -71,6 +71,8 @@ $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']); $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule)); + if($singlepane_view == 'true') { $related_array = getRelatedLists($currentModule,$focus); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 05:13:53 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 10:13:53 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9799 - in /vtigercrm/branches/5.0.3: data/CRMEntity.php include/utils/ExportUtils.php modules/Reports/AdvancedFilter.php Message-ID: <20061108101353.88944788FE3@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 03:13:46 2006 New Revision: 9799 Log: typo error fixed Modified: vtigercrm/branches/5.0.3/data/CRMEntity.php vtigercrm/branches/5.0.3/include/utils/ExportUtils.php vtigercrm/branches/5.0.3/modules/Reports/AdvancedFilter.php Modified: vtigercrm/branches/5.0.3/data/CRMEntity.php ============================================================================== --- vtigercrm/branches/5.0.3/data/CRMEntity.php (original) +++ vtigercrm/branches/5.0.3/data/CRMEntity.php Wed Nov 8 03:13:46 2006 @@ -972,15 +972,15 @@ for($i=0; $i < $numRows;$i++) { $columnName = $adb->query_result($result,$i,"columnname"); - $fieldlable = $adb->query_result($result,$i,"fieldlabel"); + $fieldlabel = $adb->query_result($result,$i,"fieldlabel"); //construct query as below if($i == 0) { - $sql3 .= $tablename.".".$columnName. " '" .$fieldlable."'"; + $sql3 .= $tablename.".".$columnName. " '" .$fieldlabel."'"; } else { - $sql3 .= ", ".$tablename.".".$columnName. " '" .$fieldlable."'"; + $sql3 .= ", ".$tablename.".".$columnName. " '" .$fieldlabel."'"; } } Modified: vtigercrm/branches/5.0.3/include/utils/ExportUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/ExportUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/ExportUtils.php Wed Nov 8 03:13:46 2006 @@ -87,21 +87,21 @@ for($i=0; $i < $num_rows;$i++) { $columnName = $adb->query_result($result,$i,"columnname"); - $fieldlable = $adb->query_result($result,$i,"fieldlabel"); + $fieldlabel = $adb->query_result($result,$i,"fieldlabel"); $tablename = $adb->query_result($result,$i,"tablename"); //HANDLE HERE - Mismatch fieldname-tablename in field table, in future we have to avoid these if elses if($columnName == 'smownerid')//for all assigned to user name { - $fields .= "vtiger_users.user_name as '".$fieldlable."', "; + $fields .= "vtiger_users.user_name as '".$fieldlabel."', "; } elseif($tablename == 'vtiger_account' && $columnName == 'parentid')//Account - Member Of { - $fields .= "vtiger_account2.accountname as '".$fieldlable."', "; + $fields .= "vtiger_account2.accountname as '".$fieldlabel."', "; } elseif($tablename == 'vtiger_contactdetails' && $columnName == 'accountid')//Contact - Account Name { - $fields .= "vtiger_account.accountname as '".$fieldlable."', "; + $fields .= "vtiger_account.accountname as '".$fieldlabel."', "; } elseif($tablename == 'vtiger_contactdetails' && $columnName == 'reportsto')//Contact - Reports To { @@ -109,11 +109,11 @@ } elseif($tablename == 'vtiger_potential' && $columnName == 'accountid')//Potential - Account Name { - $fields .= "vtiger_account.accountname as '".$fieldlable."',"; + $fields .= "vtiger_account.accountname as '".$fieldlabel."',"; } elseif($tablename == 'vtiger_potential' && $columnName == 'campaignid')//Potential - Campaign Source { - $fields .= "vtiger_campaign.campaignname as '".$fieldlable."',"; + $fields .= "vtiger_campaign.campaignname as '".$fieldlabel."',"; } elseif($tablename == 'vtiger_seproductsrel' && $columnName == 'crmid')//Product - Related To { @@ -131,7 +131,7 @@ } elseif($tablename == 'vtiger_products' && $columnName == 'vendor_id')//Product - Vendor Name { - $fields .= "vtiger_vendor.vendorname as '".$fieldlable."',"; + $fields .= "vtiger_vendor.vendorname as '".$fieldlabel."',"; } elseif($tablename == 'vtiger_producttaxrel' && $columnName == 'taxclass')//avoid product - taxclass { @@ -155,11 +155,11 @@ } elseif($tablename == 'vtiger_attachments' && $columnName == 'filename')//Emails filename { - $fields .= $tablename.".name '".$fieldlable."',"; + $fields .= $tablename.".name '".$fieldlabel."',"; } else { - $fields .= $tablename.".".$columnName. " '" .$fieldlable."',"; + $fields .= $tablename.".".$columnName. " '" .$fieldlabel."',"; } } $fields = trim($fields,","); Modified: vtigercrm/branches/5.0.3/modules/Reports/AdvancedFilter.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Reports/AdvancedFilter.php (original) +++ vtigercrm/branches/5.0.3/modules/Reports/AdvancedFilter.php Wed Nov 8 03:13:46 2006 @@ -140,7 +140,7 @@ { foreach($ogReport->sec_module_columnslist[$secmodule[$i]][$key] as $field=>$fieldlabel) { - if(isset($mod_strings[$fieldlable])) + if(isset($mod_strings[$fieldlabel])) { if($selected == $field) { From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 06:09:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 11:09:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9800 - /vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php Message-ID: <20061108110923.D21C9789062@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 04:09:19 2006 New Revision: 9800 Log: error message color changed Modified: vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php Modified: vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php (original) +++ vtigercrm/branches/5.0.3/modules/Settings/ProxyServerConfig.php Wed Nov 8 04:09:19 2006 @@ -21,7 +21,7 @@ $smarty = new vtigerCRM_Smarty; if($_REQUEST['error'] != '') { - $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); + $smarty->assign("ERROR_MSG",''.$_REQUEST["error"].''); } $sql="select * from vtiger_systems where server_type = 'proxy'"; $result = $adb->query($sql); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 06:15:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 11:15:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9801 - /vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Message-ID: <20061108111538.E0D2F789062@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 04:15:30 2006 New Revision: 9801 Log: Fixed the issue in Custom View if the module name and field label is same --By Jeri Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Modified: vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php (original) +++ vtigercrm/branches/5.0.3/modules/CustomView/CustomView.php Wed Nov 8 04:15:30 2006 @@ -764,7 +764,12 @@ //Ends $tablefield[$list[0]] = $list[1]; - $fieldlabel = trim(str_replace($this->escapemodule," ",$list[3])); + + //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); + $this->list_fields[$fieldlabel] = $tablefield; $this->list_fields_name[$fieldlabel] = $list[2]; } From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 06:18:48 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 11:18:48 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9802 - /vtigercrm/branches/5.0.3/include/js/Mail.js Message-ID: <20061108111848.99A3B789061@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 04:18:43 2006 New Revision: 9802 Log: Spelling error fixed. Fixes #2204 Modified: vtigercrm/branches/5.0.3/include/js/Mail.js Modified: vtigercrm/branches/5.0.3/include/js/Mail.js ============================================================================== --- vtigercrm/branches/5.0.3/include/js/Mail.js (original) +++ vtigercrm/branches/5.0.3/include/js/Mail.js Wed Nov 8 04:18:43 2006 @@ -79,7 +79,7 @@ window.close(); }else { - alert('The Record '+parentname+' does\'t have email id' ); + alert('The user "'+parentname+'" doesn\'t have an email id' ); return false; } } From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 06:39:04 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 11:39:04 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9803 - /vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Message-ID: <20061108113904.0F2F8788CE8@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 04:39:01 2006 New Revision: 9803 Log: unable to add tag could in IE - fixed Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Modified: vtigercrm/branches/5.0.3/include/js/dtlviewajax.js ============================================================================== --- vtigercrm/branches/5.0.3/include/js/dtlviewajax.js (original) +++ vtigercrm/branches/5.0.3/include/js/dtlviewajax.js Wed Nov 8 04:39:01 2006 @@ -316,7 +316,7 @@ { /* Wordwrap a long list of multi-select combo box items at the * item separator string */ - const DETAILVIEW_WORDWRAP_WIDTH = "70"; // must match value in DetailViewUI.tpl. + var DETAILVIEW_WORDWRAP_WIDTH = "70"; // must match value in DetailViewUI.tpl. var lineLength = 0; for(var i=0; i < r.length; i++) { @@ -339,11 +339,9 @@ showHide(dtlView,editArea); //show,hide itsonview=false; } - -function SaveTag(txtBox,crmId,module) -{ - var tagValue = document.getElementById(txtBox).value; - document.getElementById(txtBox).value =''; +function SaveTag(tagfield,crmId,module) +{ + var tagValue = $(tagfield).value; $("vtbusy_info").style.display="inline"; new Ajax.Request( 'index.php', @@ -353,6 +351,7 @@ onComplete: function(response) { getObj('tagfields').innerHTML = response.responseText; $("vtbusy_info").style.display="none"; + $(tagfield).value = ''; } } ); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 07:17:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 12:17:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9804 - /vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php Message-ID: <20061108121730.AD921789061@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 05:17:26 2006 New Revision: 9804 Log: ordering activities by due date . Fixes #1889 Modified: vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php Wed Nov 8 05:17:26 2006 @@ -76,7 +76,7 @@ //for pending activities $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$pending_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; } - + $list_query.= " ORDER BY due_date ASC"; $res = $adb->query($list_query); $noofrecords = $adb->num_rows($res); $open_activity_list = array(); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 08:10:19 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 13:10:19 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9805 - /vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php Message-ID: <20061108131019.33FC778905F@vtiger.fosslabs.com> Author: richie Date: Wed Nov 8 06:10:15 2006 New Revision: 9805 Log: dashboard homepage doesn't display potential stats - fixed Modified: vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php Modified: vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php (original) +++ vtigercrm/branches/5.0.3/modules/Potentials/Potentials.php Wed Nov 8 06:10:15 2006 @@ -37,6 +37,8 @@ var $log; var $db; + var $module_name="Potentials"; + var $module_id = "potentialid"; var $tab_name = Array('vtiger_crmentity','vtiger_potential','vtiger_potentialscf'); var $tab_name_index = Array('vtiger_crmentity'=>'crmid','vtiger_potential'=>'potentialid','vtiger_potentialscf'=>'potentialid'); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 8 08:20:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 08 Nov 2006 13:20:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9806 - in /vtigercrm/branches/5.0.3: modules/Users/DefaultDataPopulator.php schema/DatabaseSchema.xml Message-ID: <20061108132009.28C7C78906F@vtiger.fosslabs.com> Author: jerrydgeorge Date: Wed Nov 8 06:19:54 2006 New Revision: 9806 Log: columnname for the corresponding field as we have in the fieldtable for the related field has been added --Jeri Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Wed Nov 8 06:19:54 2006 @@ -913,25 +913,24 @@ //The Entity Name for the modules are maintained in this table -$this->db->query("insert into vtiger_entityname values(7,'Leads','vtiger_leaddetails','lastname,firstname','leadid')"); -$this->db->query("insert into vtiger_entityname values(6,'Accounts','vtiger_account','accountname','accountid')"); -$this->db->query("insert into vtiger_entityname values(4,'Contacts','vtiger_contactdetails','lastname,firstname','contactid')"); -$this->db->query("insert into vtiger_entityname values(2,'Potentials','vtiger_potential','potentialname','potentialid')"); -$this->db->query("insert into vtiger_entityname values(8,'Notes','vtiger_notes','title','notesid')"); -$this->db->query("insert into vtiger_entityname values(13,'HelpDesk','vtiger_troubletickets','title','ticketid')"); -$this->db->query("insert into vtiger_entityname values(9,'Calendar','vtiger_activity','subject','activityid')"); -$this->db->query("insert into vtiger_entityname values(10,'Emails','vtiger_activity','subject','activityid')"); -$this->db->query("insert into vtiger_entityname values(14,'Products','vtiger_products','productname','productid')"); -$this->db->query("insert into vtiger_entityname values(29,'Users','vtiger_users','last_name,first_name','id')"); -$this->db->query("insert into vtiger_entityname values(23,'Invoice','vtiger_invoice','subject','invoiceid')"); -$this->db->query("insert into vtiger_entityname values(20,'Quotes','vtiger_quotes','subject','quoteid')"); -$this->db->query("insert into vtiger_entityname values(21,'PurchaseOrder','vtiger_purchaseorder','subject','purchaseorderid')"); -$this->db->query("insert into vtiger_entityname values(22,'SalesOrder','vtiger_salesorder','subject','salesorderid')"); -$this->db->query("insert into vtiger_entityname values(18,'Vendors','vtiger_vendor','vendorname','vendorid')"); -$this->db->query("insert into vtiger_entityname values(19,'PriceBooks','vtiger_pricebook','bookname','pricebookid')"); -$this->db->query("insert into vtiger_entityname values(26,'Campaigns','vtiger_campaign','campaignname','campaignid')"); -$this->db->query("insert into vtiger_entityname values(15,'Faq','vtiger_faq','question','id')"); - +$this->db->query("insert into vtiger_entityname values(7,'Leads','vtiger_leaddetails','lastname,firstname','leadid','leadid')"); +$this->db->query("insert into vtiger_entityname values(6,'Accounts','vtiger_account','accountname','accountid','account_id')"); +$this->db->query("insert into vtiger_entityname values(4,'Contacts','vtiger_contactdetails','lastname,firstname','contactid','contact_id')"); +$this->db->query("insert into vtiger_entityname values(2,'Potentials','vtiger_potential','potentialname','potentialid','potential_id')"); +$this->db->query("insert into vtiger_entityname values(8,'Notes','vtiger_notes','title','notesid','notesid')"); +$this->db->query("insert into vtiger_entityname values(13,'HelpDesk','vtiger_troubletickets','title','ticketid','ticketid')"); +$this->db->query("insert into vtiger_entityname values(9,'Calendar','vtiger_activity','subject','activityid','activityid')"); +$this->db->query("insert into vtiger_entityname values(10,'Emails','vtiger_activity','subject','activityid','activityid')"); +$this->db->query("insert into vtiger_entityname values(14,'Products','vtiger_products','productname','productid','product_id')"); +$this->db->query("insert into vtiger_entityname values(29,'Users','vtiger_users','lastname,firstname','id','id')"); +$this->db->query("insert into vtiger_entityname values(23,'Invoice','vtiger_invoice','subject','invoiceid','invoiceid')"); +$this->db->query("insert into vtiger_entityname values(20,'Quotes','vtiger_quotes','subject','quoteid','quote_id')"); +$this->db->query("insert into vtiger_entityname values(21,'PurchaseOrder','vtiger_purchaseorder','subject','purchaseorderid','purchaseorderid')"); +$this->db->query("insert into vtiger_entityname values(22,'SalesOrder','vtiger_salesorder','subject','salesorderid','salesorder_id')"); +$this->db->query("insert into vtiger_entityname values(18,'Vendors','vtiger_vendor','vendorname','vendorid','vendor_id')"); +$this->db->query("insert into vtiger_entityname values(19,'PriceBooks','vtiger_pricebook','bookname','pricebookid','pricebookid')"); +$this->db->query("insert into vtiger_entityname values(26,'Campaigns','vtiger_campaign','campaignname','campaignid','campaignid')"); +$this->db->query("insert into vtiger_entityname values(15,'Faq','vtiger_faq','question','id','id')"); // Insert End //Inserting into vtiger_groups table Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml ============================================================================== --- vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml (original) +++ vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Wed Nov 8 06:19:54 2006 @@ -6130,6 +6130,9 @@ + + + tabid From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 9 03:20:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 09 Nov 2006 08:20:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9807 - /vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Message-ID: <20061109082009.3AA20789080@vtiger.fosslabs.com> Author: richie Date: Thu Nov 9 01:20:05 2006 New Revision: 9807 Log: * Removed the unwanted code to get the translation, now get the translated string in a single line in the function getSearchListHeaderValues which is used to get the search fields Modified: vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/SearchUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/SearchUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/SearchUtils.php Thu Nov 9 01:20:05 2006 @@ -126,68 +126,16 @@ if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0 || in_array($fieldname,$field)) { - if(isset($focus->sortby_fields) && $focus->sortby_fields !='') - { - //Added on 14-12-2005 to avoid if and else check for every list vtiger_field for arrow image and change order - - foreach($focus->list_fields[$name] as $tab=>$col) - { - if(in_array($col,$focus->sortby_fields)) - { - if($relatedlist !='') - { - if($app_strings[$name]) - { - $name = $app_strings[$name]; - } - else - { - $name = $mod_strings[$name]; - } - } - else - { - if($app_strings[$name]) - { - $lbl_name = $app_strings[$name]; - } - else - { - $lbl_name = $mod_strings[$name]; - } - $name = $lbl_name; - } - } - else - { if($app_strings[$name]) - { - $name = $app_strings[$name]; - } - elseif($mod_strings[$name]) - { - $name = $mod_strings[$name]; - } - } - } - } - //Added condition to hide the close column in Related Lists - //if($name == 'Close' && $relatedlist != '') - if($name == 'Close') - { - //$list_header .= ''; - // $list_header[] = ''; - } - else - { - if($fieldname!='parent_id') - { - $fld_name=$fieldname; - $search_header[$fld_name]=$mod_strings[$name]; - } - } + if($fieldname!='parent_id') + { + $fld_name=$fieldname; + + //assign the translated string + $search_header[$fld_name] = getTranslatedString($name); + } } } - $log->debug("Exiting getSearchListHeaderValues method ..."); + $log->debug("Exiting getSearchListHeaderValues method ..."); return $search_header; } From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 9 03:27:24 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 09 Nov 2006 08:27:24 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9808 - /vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Message-ID: <20061109082724.CF746788FAB@vtiger.fosslabs.com> Author: richie Date: Thu Nov 9 01:27:20 2006 New Revision: 9808 Log: * Function added to get the translated string - Mickie Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Thu Nov 9 01:27:20 2006 @@ -2528,4 +2528,17 @@ } } + +/** Function used to get the translated string to the input string + * @param string $str - input string which we want to translate + * @return string $str - translated string, if the translated string is available then the translated string other wise original string will be returned + */ +function getTranslatedString($str) +{ + global $app_strings, $mod_strings, $log; + $str = ($app_strings[$str] != '')?$app_strings[$str]:(($mod_strings[$str] != '')?$mod_strings[$str]:$str); + $log->debug("function getTranslatedString($str) - translated to ($str)"); + return $str; +} + ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 9 03:31:00 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 09 Nov 2006 08:31:00 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9809 - /vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php Message-ID: <20061109083100.4DB4B788FAB@vtiger.fosslabs.com> Author: richie Date: Thu Nov 9 01:30:56 2006 New Revision: 9809 Log: * Changed the customerportal ticket detail link in the notification mail -- Mickie Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php (original) +++ vtigercrm/branches/5.0.3/modules/HelpDesk/Save.php Thu Nov 9 01:30:56 2006 @@ -124,7 +124,7 @@ $bodydetails .= 'There is a reply to '.$_REQUEST['ticket_title'].' in the "Customer Portal" at VTiger.'; $bodydetails .= "You can use the following link to view the replies made:
"; - $bodydetails .= "Ticket Details"; + $bodydetails .= "Ticket Details"; $bodydetails .= "

Thanks,

Vtiger Support Team "; $email_body = $bodysubject.'

'.$bodydetails; From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 02:24:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 10 Nov 2006 07:24:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9810 - in /vtigercrmoutlook/trunk/vtigercrmoladdin/source: frmSyncStatus.frm vtigeroladdin.vbp vtigeroladdin.vbw Message-ID: <20061110072435.4D8D2788903@vtiger.fosslabs.com> Author: richie Date: Fri Nov 10 00:23:48 2006 New Revision: 9810 Log: String updation changed to updating in the sync status messages--Bharath Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmSyncStatus.frm vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbp vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbw Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/frmSyncStatus.frm ============================================================================== Binary files - no diff available. Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbp ============================================================================== Binary files - no diff available. Modified: vtigercrmoutlook/trunk/vtigercrmoladdin/source/vtigeroladdin.vbw ============================================================================== Binary files - no diff available. From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 06:09:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 10 Nov 2006 11:09:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9811 - /vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl Message-ID: <20061110110938.479BF78914D@vtiger.fosslabs.com> Author: richie Date: Fri Nov 10 04:09:33 2006 New Revision: 9811 Log: Moved 'More..' links inside the tables in homepage - mozilla issue fixed Modified: vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl Fri Nov 10 04:09:33 2006 @@ -126,7 +126,7 @@ -
+
{foreach item=elements from=$tabledetail.Entries} @@ -141,18 +141,16 @@ {/foreach}
-
- - - - -
- {if $modulename neq 'CustomView' && $modulename neq 'GroupAllocation'} - {$APP.LBL_MORE}.. - {else} -   - {/if} -
+
+ + + + + {if $modulename neq 'CustomView' && $modulename neq 'GroupAllocation'} + {$APP.LBL_MORE}.. + {else} +   + {/if} From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 06:17:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 10 Nov 2006 11:17:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9812 - /vtigercrm/branches/5.0.3/modules/Emails/Emails.php Message-ID: <20061110111708.3051278914F@vtiger.fosslabs.com> Author: richie Date: Fri Nov 10 04:17:04 2006 New Revision: 9812 Log: Error during sync between OL and vtiger fixed Modified: vtigercrm/branches/5.0.3/modules/Emails/Emails.php Modified: vtigercrm/branches/5.0.3/modules/Emails/Emails.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Emails/Emails.php (original) +++ vtigercrm/branches/5.0.3/modules/Emails/Emails.php Fri Nov 10 04:17:04 2006 @@ -36,8 +36,13 @@ var $db; // Stored vtiger_fields - // added to check email save from plugin or not - var $plugin_save = false; + // added to check email save from plugin or not + var $plugin_save = false; + +var $rel_users_table = "vtiger_salesmanactivityrel"; +var $rel_contacts_table = "vtiger_cntactivityrel"; +var $rel_serel_table = "vtiger_seactivityrel"; + var $tab_name = Array('vtiger_crmentity','vtiger_activity'); From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 06:20:59 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Fri, 10 Nov 2006 11:20:59 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9813 - /vtigercrm/branches/5.0.3/soap/vtigerolservice.php Message-ID: <20061110112059.4FD4B78914F@vtiger.fosslabs.com> Author: richie Date: Fri Nov 10 04:20:55 2006 New Revision: 9813 Log: Salutation missing during sync from OL to vtiger- fixed Modified: vtigercrm/branches/5.0.3/soap/vtigerolservice.php Modified: vtigercrm/branches/5.0.3/soap/vtigerolservice.php ============================================================================== --- vtigercrm/branches/5.0.3/soap/vtigerolservice.php (original) +++ vtigercrm/branches/5.0.3/soap/vtigerolservice.php Fri Nov 10 04:20:55 2006 @@ -595,7 +595,7 @@ { if(isset($cntrow)) { - $contact->column_fields[salutation]=in_array('salutation',$permitted_lists) ? $cntrow["title"] : ""; + $contact->column_fields[salutationtype]=in_array('salutationtype',$permitted_lists) ? $cntrow["title"] : ""; $contact->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $cntrow["firstname"] : ""; if($cntrow["middlename"] != "") @@ -677,7 +677,7 @@ if(isset($cntrow)) { $contact->retrieve_entity_info($cntrow["id"],"Contacts"); - $contact->column_fields[salutation]=in_array('salutation',$permitted_lists) ? $cntrow["title"] : ""; + $contact->column_fields[salutationtype]=in_array('salutationtype',$permitted_lists) ? $cntrow["title"] : ""; $contact->column_fields[firstname]=in_array('firstname',$permitted_lists) ? $cntrow["firstname"] : ""; if($cntrow["middlename"] != "") { From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 20:37:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Sat, 11 Nov 2006 01:37:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9814 - in /vtigercrm/branches/4.2/modules/squirrelmail-1.4.4: redirect.php webmail.php Message-ID: <20061111013717.3294F788A22@vtiger.fosslabs.com> Author: allanbush Date: Fri Nov 10 18:37:13 2006 New Revision: 9814 Log: Fixed php 5 issue with global variable $theme being reused in squirrelmail. Refs #1287. Modified: vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/redirect.php vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/webmail.php Modified: vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/redirect.php ============================================================================== --- vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/redirect.php (original) +++ vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/redirect.php Fri Nov 10 18:37:13 2006 @@ -17,6 +17,11 @@ * Path for SquirrelMail required files. * @ignore */ + +// store this value as squirrelmail uses this variable in the global scope as well +$vtiger_theme = $theme; +unset($theme); + define('SM_PATH','modules/squirrelmail-1.4.4/'); //define('SM_PATH','../'); @@ -165,6 +170,7 @@ } */ +$theme = $vtiger_theme; /* Write session data and send them off to the appropriate page. */ //session_write_close(); @header("Location: $redirect_url"); Modified: vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/webmail.php ============================================================================== --- vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/webmail.php (original) +++ vtigercrm/branches/4.2/modules/squirrelmail-1.4.4/webmail.php Fri Nov 10 18:37:13 2006 @@ -26,6 +26,8 @@ require_once ($theme_path."layout_utils.php"); */ +$vtiger_theme = $theme; +unset($theme); define('SM_PATH','modules/squirrelmail-1.4.4/'); @@ -172,6 +174,7 @@ } */ +$theme = $vtiger_theme; $smodule = $_REQUEST['smodule']; header("Location: index.php?module=squirrelmail-1.4.4&action=right_main&smodule=$smodule"); From vtigercrm-commits at vtiger.fosslabs.com Fri Nov 10 20:51:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Sat, 11 Nov 2006 01:51:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9815 - in /vtigercrm/branches/4.2: config.template.php install/2setConfig.php Message-ID: <20061111015105.9FD64787F04@vtiger.fosslabs.com> Author: allanbush Date: Fri Nov 10 18:51:02 2006 New Revision: 9815 Log: Removed $disable_persistent_connections config option as it was unused and a duplicate of $dbconfigoption['persistent']. Closes #2551. Modified: vtigercrm/branches/4.2/config.template.php vtigercrm/branches/4.2/install/2setConfig.php Modified: vtigercrm/branches/4.2/config.template.php ============================================================================== --- vtigercrm/branches/4.2/config.template.php (original) +++ vtigercrm/branches/4.2/config.template.php Fri Nov 10 18:51:02 2006 @@ -156,10 +156,6 @@ // default_user_is_admin default value = false $default_user_is_admin = false; -// if your MySQL/PHP configuration does not support persistent connections set this to true to avoid a large performance slowdown -// disable_persistent_connections default value = false -$disable_persistent_connections = false; - // defined languages available. the key must be the language file prefix. (Example 'en_us' is the prefix for every 'en_us.lang.php' file) // languages default value = en_us=>US English $languages = Array('en_us'=>'US English',); Modified: vtigercrm/branches/4.2/install/2setConfig.php ============================================================================== --- vtigercrm/branches/4.2/install/2setConfig.php (original) +++ vtigercrm/branches/4.2/install/2setConfig.php Fri Nov 10 18:51:02 2006 @@ -48,9 +48,6 @@ if(isset($allow_exports)) $_SESSION['allow_exports'] = $allow_exports; - - if(isset($disable_persistent_connections)) - $_SESSION['disable_persistent_connections'] = $disable_persistent_connections; if(isset($default_language)) $_SESSION['default_language'] = $default_language; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 03:36:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 08:36:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9816 - in /vtigercrm/branches/5.0.3: index.php modules/Webmails/ListView.php modules/Webmails/MailBox.php Message-ID: <20061113083634.80A1278893A@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 01:36:28 2006 New Revision: 9816 Log: * Fixed some issues with connection string and Full Email View page error - Mickie Modified: vtigercrm/branches/5.0.3/index.php vtigercrm/branches/5.0.3/modules/Webmails/ListView.php vtigercrm/branches/5.0.3/modules/Webmails/MailBox.php Modified: vtigercrm/branches/5.0.3/index.php ============================================================================== --- vtigercrm/branches/5.0.3/index.php (original) +++ vtigercrm/branches/5.0.3/index.php Mon Nov 13 01:36:28 2006 @@ -438,6 +438,9 @@ require_once("modules/$currentModule/Activity.php"); $focus = new Activity(); break; + case 'Webmails': + //No need to create a webmail object here + break; default: require_once("modules/$currentModule/$currentModule.php"); $focus = new $currentModule(); Modified: vtigercrm/branches/5.0.3/modules/Webmails/ListView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/ListView.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/ListView.php Mon Nov 13 01:36:28 2006 @@ -177,6 +177,8 @@ $numEmails = $elist["count"]; $headers = $elist["headers"]; +$mails_per_page = $MailBox->mails_per_page; + if($start == 1 || $start == "") { $start_message=$numEmails; } else { Modified: vtigercrm/branches/5.0.3/modules/Webmails/MailBox.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/MailBox.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/MailBox.php Mon Nov 13 01:36:28 2006 @@ -56,12 +56,12 @@ $this->mail_protocol=$this->boxinfo["mail_protocol"]; $this->ssltype=$this->boxinfo["ssltype"]; $this->sslmeth=$this->boxinfo["sslmeth"]; + $this->box_refresh=trim($this->boxinfo["box_refresh"]); - $this->mails_per_page=trim($this->boxinf["mails_per_page"]); + $this->mails_per_page=trim($this->boxinfo["mails_per_page"]); if($this->mails_per_page < 1) $this->mails_per_page=20; - $this->mail_protocol=$this->boxinfo["mail_protocol"]; $this->account_name=$this->boxinfo["account_name"]; $this->display_name=$this->boxinfo["display_name"]; //$this->imapServerAddress=$this->boxinfo["mail_servername"]; @@ -105,46 +105,73 @@ if($this->mail_protocol == "pop3") $port = "110"; - else { - if($mods["imap"]["SSL Support"] == "enabled" && $this->ssltype == "ssl") + else + { + if($mods["imap"]["SSL Support"] == "enabled" && $this->ssltype == "tls") $port = "993"; else $port = "143"; } $this->db->println("Building connection string"); - if(preg_match("/@/",$this->login_username)) { + if(preg_match("/@/",$this->login_username)) + { $mailparts = split("@",$this->login_username); $user="".trim($mailparts[0]).""; $domain="".trim($mailparts[1]).""; // This section added to fix a bug when connecting as user at domain.com - if($this->readonly == "true") { - if($mods["imap"]["SSL Support"] == "enabled") - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/".$this->ssltype."/".$this->sslmeth."/user={$user}@{$domain}/readonly}".$this->mailbox; + if($this->readonly == "true") + { + if($mods["imap"]["SSL Support"] == "enabled") + $connectString = "/".$this->ssltype."/".$this->sslmeth."/user={$user}@{$domain}/readonly"; else - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/notls/novalidate-cert/user={$user}@{$domain}/readonly}".$this->mailbox; - } else { - if($mods["imap"]["SSL Support"] == "enabled") - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/".$this->ssltype."/".$this->sslmeth."/user={$user}@{$domain}}".$this->mailbox; + $connectString = "/notls/novalidate-cert/user={$user}@{$domain}/readonly"; + } + else + { + if($mods["imap"]["SSL Support"] == "enabled") + $connectString = "/".$this->ssltype."/".$this->sslmeth."/user={$user}@{$domain}"; else - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/notls/novalidate-cert/user={$user}@{$domain}}".$this->mailbox; - } - } else { - if($this->readonly == "true") { - if($mods["imap"]["SSL Support"] == "enabled") - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/".$this->ssltype."/".$this->sslmeth."/readonly}".$this->mailbox; + $connectString = "/notls/novalidate-cert/user={$user}@{$domain}"; + } + } + else + { + if($this->readonly == "true") + { + if($mods["imap"]["SSL Support"] == "enabled") + $connectString = "/".$this->ssltype."/".$this->sslmeth."/readonly"; else - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/notls/novalidate-cert/readonly}".$this->mailbox; - } else { - if($mods["imap"]["SSL Support"] == "enabled") - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/".$this->ssltype."/".$this->sslmeth."}".$this->mailbox; + $connectString = "/notls/novalidate-cert/readonly"; + } + else + { + if($mods["imap"]["SSL Support"] == "enabled") + $connectString = "/".$this->ssltype."/".$this->sslmeth; else - $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."/notls/novalidate-cert}".$this->mailbox; - } - } + $connectString = "/notls/novalidate-cert"; + } + } + + $connectString = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port.$connectString."}".$this->mailbox; + //Reference - http://forums.vtiger.com/viewtopic.php?p=33478#33478 - which has no tls or validate-cert + $connectString1 = "{".$this->imapServerAddress."/".$this->mail_protocol.":".$port."}".$this->mailbox; + $this->db->println("Done Building Connection String.. Connecting to box"); - $this->mbox = imap_open($connectString, $this->login_username, $this->secretkey); + + if(!$this->mbox = @imap_open($connectString, $this->login_username, $this->secretkey)) + { + //try second string which has no tls or validate-cert + if(!$this->mbox = @imap_open($connectString1, $this->login_username, $this->secretkey)) + { + global $current_user; + $this->db->println("CONNECTION ERROR - Could not be connected to the server using imap_open function through the connection strings $connectString and $connectString1"); + echo "
 Could not connect to the server. Please check the server details Here "; + exit; + } + } + $this->db->println("Done connecting to box"); } } // END CLASS From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 04:34:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 09:34:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9817 - /vtigercrm/branches/5.0.3/include/utils/RecurringType.php Message-ID: <20061113093433.AFC0F78907B@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 02:34:28 2006 New Revision: 9817 Log: Calendar weekly event not shown properly - fixed. Fixes #2341 Modified: vtigercrm/branches/5.0.3/include/utils/RecurringType.php Modified: vtigercrm/branches/5.0.3/include/utils/RecurringType.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/RecurringType.php (original) +++ vtigercrm/branches/5.0.3/include/utils/RecurringType.php Mon Nov 13 02:34:28 2006 @@ -91,6 +91,8 @@ $startdate = $this->startdate->get_formatted_date(); $tempdate = $startdate; $enddate = $this->enddate->get_formatted_date(); + + $recurringDates[]=$startdate; while($tempdate <= $enddate) { if($this->recur_type == 'Daily') @@ -113,6 +115,7 @@ 'year' => $st_date[0] ); $tempdateObj = new DateTime($date_arr,true); + if(isset($this->dayofweek_to_rpt) && $this->dayofweek_to_rpt != null) { $weekstartObj = $tempdateObj->getThisweekDaysbyIndex(0); @@ -120,10 +123,12 @@ { for($i=0;$idayofweek_to_rpt);$i++) { + $repeatdateObj = $weekstartObj->getThisweekDaysbyIndex($this->dayofweek_to_rpt[$i]); if($repeatdateObj->get_formatted_date() <= $enddate) $recurringDates[] = $repeatdateObj->get_formatted_date(); } + if(isset($this->recur_freq)) $index = $this->recur_freq * 7; else @@ -134,9 +139,31 @@ 'year' => $st_date[0] ); $tempdateObj = new DateTime($date_arr,true); - } + + //echo '
';print_r($recurringDates); echo '
'; + + } + else { + + $eventStart = $this->startdate->get_formatted_date(); + for($i=0;$idayofweek_to_rpt);$i++) + { + + $repeatDay = $weekstartObj->getThisweekDaysbyIndex($this->dayofweek_to_rpt[$i]); + $repeatDate= $repeatDay->get_formatted_date(); + + if($repeatDate >= $eventStart) + { + + if($repeatDate <= $enddate) + $recurringDates[] = $repeatDate; + + } + + } + if(isset($this->recur_freq)) $index = $this->recur_freq * 7; else From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 05:05:12 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 10:05:12 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9818 - /vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php Message-ID: <20061113100512.97EA278907B@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 03:05:08 2006 New Revision: 9818 Log: Issue in change owner in calender - fixed. Fixes #2213 Modified: vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php Modified: vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/updateLeadDBStatus.php Mon Nov 13 03:05:08 2006 @@ -79,7 +79,9 @@ //First we have to delete the group relationship $delete_query = "delete from ". $deletegroup_array[$return_module] ." where " . $tableId_array[$return_module] . "='".$id."'"; $result = $adb->query($delete_query); - + //Inserting changed owner information to salesmanactivityrel table + $insert = "insert into vtiger_salesmanactivityrel values(".$idval.",".$id.")"; + $result = $adb->query($insert); //Now we have to update the smownerid $sql = "update vtiger_crmentity set modifiedby=".$current_user->id.",smownerid='" .$idval ."', modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid='" .$id."'"; $result = $adb->query($sql); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 05:29:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 10:29:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9819 - /vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php Message-ID: <20061113102913.9B903787FBF@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 03:29:08 2006 New Revision: 9819 Log: Export report to excel - fields truncated : fixed. Fixes #2449 Modified: vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php Modified: vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php ============================================================================== --- vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php (original) +++ vtigercrm/branches/5.0.3/include/php_writeexcel/class.writeexcel_worksheet.inc.php Mon Nov 13 03:29:08 2006 @@ -110,7 +110,7 @@ $rowmax = 65536; // 16384 in Excel 5 $colmax = 256; - $strmax = 255; + $strmax = 20000; $this->_name = $name; $this->_index = $index; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 06:48:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 11:48:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9820 - /vtigercrm/branches/5.0.3/include/language/en_us.lang.php Message-ID: <20061113114856.484F9787FBF@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 04:48:44 2006 New Revision: 9820 Log: Modified the Quick Create Labels for Module Addition Tools Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/include/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/include/language/en_us.lang.php Mon Nov 13 04:48:44 2006 @@ -1,1255 +1,762 @@ -'ISO-8859-1', - -'LBL_BROWSER_TITLE'=>'vtiger CRM 5 - Commercial Open Source CRM', - -'LBL_MY_ACCOUNT'=>'My Account', - -'LBL_MY_PREFERENCES'=>'My Preferences', - -'LBL_ADMIN'=>'Admin', - -'LBL_LOGOUT'=>'Sign out', - -'LBL_SEARCH'=>'Search', - -'LBL_LAST_VIEWED'=>'Last Viewed', - -'LBL_TODAY'=>'Today', - -'LBL_ALL'=>'All', - -'LBL_SHOW'=>'Show :', - -'today'=>"Today's", - -'all'=>'All', - -'LBL_UPCOMING_EVENTS'=>'Upcoming Activities', - -'LBL_PENDING_EVENTS'=>'Pending Activities', - -'NTC_WELCOME_MESSAGE'=>"Welcome to vtiger CRM!", - -'NTC_DESCRIPTION'=>"Use a valid username and password to login to the vtiger CRM.", - -'NTC_WELCOME'=>'Welcome', - -'NTC_NO_ITEMS_DISPLAY'=>'none', - -'LBL_OR'=>'or', - -'LBL_ALT_HOT_KEY'=>'Alt+', -//added for 4.2 -'LBL_SAVE_LABEL'=>'Save', - -'LBL_SEND_MAIL_BUTTON'=>'Send Mail', - - -'LBL_SAVE_BUTTON_TITLE'=>'Save [Alt+S]', - -'LBL_EDIT_BUTTON_TITLE'=>'Edit [Alt+E]', - -'LBL_CONVERTSO_BUTTON_TITLE'=>'Create SalesOrder', -'LBL_CONVERTINVOICE_BUTTON_TITLE'=>'Create Invoice', - -'LBL_EDIT_BUTTON'=>'Edit', - -'LBL_DUPLICATE_BUTTON_TITLE'=>'Duplicate [Alt+U]', - -'LBL_DUPLICATE_BUTTON'=>'Duplicate', - -'LBL_TABCUSTOMISE_BUTTON_TITLE'=>'Customise [Alt+C]', - -'LBL_FORUM_HIDE_BUTTON_TITLE'=>'Hide Forum [Alt+I]', - -'LBL_FORUM_HIDE_BUTTON_KEY'=>'H', - -'LBL_FORUM_SHOW_BUTTON_TITLE'=>'Show Forum [Alt+W]', - -'LBL_FORUM_SHOW_BUTTON_KEY'=>'W', - -'LBL_TABCUSTOMISE_BUTTON'=>'Customise', - -'LBL_DELETE_BUTTON_TITLE'=>'Delete [Alt+D]', - -'LBL_DELETE_BUTTON'=>'Delete', - -'LBL_FIND_BUTTON'=>'Find', - -'LBL_CONVERT_BUTTON_TITLE'=>'Convert [Alt+C]', - -'LBL_CONVERT_BUTTON_KEY'=>'C', - -'LBL_CONVERT_BUTTON_LABEL'=>'Convert Lead', - -'LBL_TABCUSTOMISE_BUTTON_KEY'=>'C', - -'LBL_TABCUSTOMISE_BUTTON_LABEL'=>'Customize Tab', - -'LBL_ROLES_BUTTON_LABEL'=>'Show Roles', - -'LBL_LISTROLES_BUTTON_LABEL'=>'List Roles', - -'LBL_FORUM_HIDE_BUTTON_LABEL'=>'Hide Forums', - -'LBL_FORUM_SHOW_BUTTON_LABEL'=>'Show Forums', - -'LBL_NEW_BUTTON_TITLE'=>'New [Alt+N]', - -'LBL_CHANGE_BUTTON_TITLE'=>'Change [Alt+G]', - -'LBL_CANCEL_BUTTON_TITLE'=>'Cancel [Alt+X]', - -'LBL_SEARCH_BUTTON_TITLE'=>'Search [Alt+Q]', - -'LBL_CLEAR_BUTTON_TITLE'=>'Clear [Alt+C]', - -'LBL_SELECT_BUTTON_TITLE'=>'Select [Alt+T]', - -'LBL_CREATE_BUTTON_LABEL' =>'Create', - -'LBL_GENERATE'=>'Generate', - -'LBL_SAVE_BUTTON_KEY'=>'S', - -'LBL_EDIT_BUTTON_KEY'=>'E', -'LBL_CONVERTSO_BUTTON_KEY'=>'S', -'LBL_CONVERTINVOICE_BUTTON_KEY'=>'I', - -'LBL_DUPLICATE_BUTTON_KEY'=>'U', - -'LBL_DELETE_BUTTON_KEY'=>'D', - -'LBL_NEW_BUTTON_KEY'=>'N', - -'LBL_CHANGE_BUTTON_KEY'=>'G', - -'LBL_CANCEL_BUTTON_KEY'=>'X', - -'LBL_SEARCH_BUTTON_KEY'=>'Q', - -'LBL_CLEAR_BUTTON_KEY'=>'C', - -'LBL_SELECT_BUTTON_KEY'=>'T', - -'LBL_SAVE_BUTTON_LABEL'=>'Save', - -'LBL_EDIT_BUTTON_LABEL'=>'Edit', -'LBL_CONVERTSO_BUTTON_LABEL'=>'Create SalesOrder', -'LBL_CONVERTINVOICE_BUTTON_LABEL'=>'Create Invoice', - -'LBL_DUPLICATE_BUTTON_LABEL'=>'Duplicate', - -'LBL_DELETE_BUTTON_LABEL'=>'Delete', - -'LBL_NEW_BUTTON_LABEL'=>'New', - -'LBL_CHANGE_BUTTON_LABEL'=>'Change', - -'LBL_CANCEL_BUTTON_LABEL'=>'Cancel', - -'LBL_SEARCH_BUTTON_LABEL'=>'Search', - -'LBL_CLEAR_BUTTON_LABEL'=>'Clear', - -'LBL_SELECT_BUTTON_LABEL'=>'Select', - -'LBL_SELECT_CONTACT_BUTTON_TITLE'=>'Select Contact [Alt+T]', - -'LBL_SELECT_CONTACT_BUTTON_KEY'=>'T', - -'LBL_SELECT_CONTACT_BUTTON_LABEL'=>'Select Contact', - -'LBL_SELECT_CAMPAIGN_BUTTON_LABEL'=>'Select Campaign', - -'LBL_SELECT_USER_BUTTON_TITLE'=>'Select User [Alt+U]', - -'LBL_SELECT_USER_BUTTON_KEY'=>'U', - -'LBL_SELECT_USER_BUTTON_LABEL'=>'Select User', - -'LBL_SETTINGS'=>'Settings', - -'LBL_LIST_USERIP'=>'User IP', - -'LBL_LIST_SIGNIN'=>'Sign in Time', - -'LBL_LIST_SIGNOUT'=>'Sign out Time', - -'LBL_LIST_STATUS'=>'Status', - - - -'LBL_LIST_NAME'=>'Name', - -'LBL_LIST_USER_NAME'=>'User Name', - -'LBL_LIST_EMAIL'=>'Email', - -'LBL_LIST_PHONE'=>'Phone', - -'LBL_LIST_CONTACT_NAME'=>'Contact Name', - -'LBL_LIST_ACCOUNT_NAME'=>'Account Name', - -'LBL_USER_LIST'=>'User List', - -'LBL_CONTACT_LIST'=>'Contact List', - -'LBL_LNK_SETTINGS'=> 'Settings', - -'LNK_IMPORT_LEADS'=>'Import Leads', - -'LBL_LOCATE_MAP'=>'Locate Map', - -'LBL_ADDRESS'=>'Address', - -'LBL_ADD_TAG'=>'Add Tag', - -'LBL_TAG_IT'=>'Tag it', - -'LBL_CLOSE'=>'Close', - -'LNK_ADVANCED_SEARCH'=>'Advanced Search', - -'LNK_BASIC_SEARCH'=>'Basic Search', - -'LNK_EDIT'=>'edit', - -'LNK_REMOVE'=>'rem', - -'LNK_DELETE'=>'del', - -'LNK_LIST_START'=>'Start', - -'LNK_LIST_NEXT'=>'Next', - -'LNK_LIST_PREVIOUS'=>'Previous', - -'LNK_LIST_END'=>'End', - -'LBL_LIST_OF'=>'of', - -'LNK_PRINT'=>'Print', - -'LNK_HELP'=>'Help', - -'LNK_VTDOCS'=>'vtiger Docs', - -'LNK_ABOUT'=>'About', - -'LNK_OUTLOOK'=>'./include/images/outlook_download.gif', - -'LNK_NEW_HDESK'=>'New Ticket', - -'LNK_NEW_PRODUCT'=>'New Product', - -'LNK_NEW_CONTACT'=>'New Contact', - -'LNK_NEW_CAMPAIGN'=>'New Campaign', - -'LNK_NEW_LEAD'=>'New Lead', - -'LNK_NEW_ACCOUNT'=>'New Account', - -'LNK_NEW_OPPORTUNITY'=>'New Potential', - -'LNK_NEW_NOTE'=>'New Note', - -'LNK_NEW_EMAIL'=>'New Email', - -'LNK_NEW_TASK'=>'New Task', - -'LNK_NEW_EVENT'=>'New Event', -'LNK_NEW_QUOTE'=>'New Quote', -'LNK_NEW_PO'=>'New Purchase Order', -'LNK_NEW_SO'=>'New Sales Order', -'LNK_NEW_INVOICE'=>'New Invoice', -'LNK_NEW_VENDOR'=>'New Vendor', -'LNK_NEW_PRICEBOOK'=>'New PriceBook', - - -'NTC_REQUIRED'=>'Indicates required field', - -'LBL_REQUIRED_SYMBOL'=>'*', - -'LBL_CURRENCY_SYMBOL'=>'$', - -'LBL_THOUSANDS_SYMBOL'=>'K', - -'NTC_DATE_FORMAT'=>'(yyyy-mm-dd)', - -'NTC_TIME_FORMAT'=>'(24:00)', - -'NTC_DATE_TIME_FORMAT'=>'(yyyy-mm-dd 24:00)', - -'NTC_DELETE_CONFIRMATION'=>'Are you sure you want to delete this record?', - -'ERR_DELETE_RECORD'=>'A record number must be specified to delete the contact.', - -'ERR_CREATING_TABLE'=>'Error creating table: ', - -'ERR_CREATING_FIELDS'=>'Error filling in additional detail fields: ', - -'ERR_MISSING_REQUIRED_FIELDS'=>'Missing required fields:', - -'ERR_INVALID_EMAIL_ADDRESS'=>'not a valid email address.', - -'ERR_INVALID_DATE_FORMAT'=>'The date format must be: yyyy-mm-dd', - -'ERR_INVALID_MONTH'=>'Please enter a valid month.', - -'ERR_INVALID_DAY'=>'Please enter a valid day.', - -'ERR_INVALID_YEAR'=>'Please enter a valid 4 digit year.', - -'ERR_INVALID_DATE'=>'Please enter a valid date.', - -'ERR_INVALID_HOUR'=>'Please enter a valid hour.', - -'ERR_INVALID_TIME'=>'Please enter a valid time.', - -'NTC_CLICK_BACK'=>'Please click the browser back button and fix the error.', - -'LBL_LIST_ASSIGNED_USER'=>'Assigned To', - -'LBL_ASSIGNED_TO'=>'Assigned To:', - -'LBL_DATE_MODIFIED'=>'Last Modified:', - -'LBL_DATE_ENTERED'=>'Created:', - -'LBL_CURRENT_USER_FILTER'=>'Only my items:', - -'NTC_LOGIN_MESSAGE'=>"Login", - -'LBL_NONE'=>'--None--', - -'LBL_BACK'=>'Back', - -'LBL_IMPORT'=>'Import', - -'LBL_EXPORT'=>'Export', - -'LBL_EXPORT_ALL'=>'Export All', - -'LBL_QUICK_CREATE'=>'Quick Create', - -'Export'=>'Export', -'Import'=>'Import', -'Merge'=>'Merge', -'ConvertLead'=>'ConvertLead', - - -'LBL_SHOW_RESULTS'=>'Show Results in', -'LBL_TOTAL_RECORDS_FOUND'=>'Total Records found :', -'LBL_SEARCH_RESULTS_FOR'=>' -- Search results for ', -'LBL_TAG_SEARCH'=>' -- Tag search for ', -'LBL_NO_DATA'=>'No Data Found', - - -//3.2 release - -'NTC_MERGE_CONFIRMATION'=>'Are you sure you want to merge this record?', - -'LBL_MERGE_BUTTON_TITLE'=>'Merge', - -'LBL_MERGE_BUTTON_KEY'=> 'Merge', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE'=>'Select Email Template', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_KEY'=>'Select Email Template', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL'=>'Select Email Template', - -'LBL_MERGE_BUTTON_LABEL'=>'Merge', - -'LBL_SENDMAIL_BUTTON_TITLE'=>'SendMail', - -'LBL_SENDMAIL_BUTTON_KEY'=> 'SendMail', - -'LBL_SENDMAIL_BUTTON_LABEL'=>'Send Mail', - - - -//Added fields for upload file as attachment -- 4 Beta - -'LBL_UPD_DESC'=>'Description', - -'LBL_FILENAME'=>'File Name', - -'LBL_FILE'=>'File', - -'LBL_TYPE'=>'File Type', - -'LBL_DOWNLOAD'=>'Download Now', - -'LBL_OPERATION'=>'Operation', - -'LBL_GROUP_ALLOCATION_TITLE'=>'My Group Allocation ', - -'LBL_ENTITY_NAME'=>'Entity Name', - -'LBL_GROUP_NAME'=>'Group', - -'LBL_ENTITY_TYPE'=>'Type', - - - -//Added fields for Ticket Attachment in RelatedTicketListUtil - -'LBL_NEW_TICKET'=>'New Ticket', - -'LBL_TITLE'=>'Title', - -'LBL_PRIORITY'=>'Priority', - -'LBL_STATUS'=>'Status', - - - -//Added fields for Change Owner and Change Status in all modules -- after 4 Beta - -'LBL_CHANGE_OWNER'=>'Change Owner', - -'LBL_CHANGE_STATUS'=>'Change Status', - -'LBL_MASS_DELETE'=>'Delete', -//added by raju - -'LBL_ADD_ITEM'=>'Add', - -'LBL_ADD_NEW'=>'Add', - -'LBL_DEDUCT'=>'Deduct', -//Added for version 5 - -'LBL_CALENDAR_TITLE'=>'Open Calendar...', -'LBL_CALENDAR_ALT'=>'Open Calendar...', - -'LBL_CALCULATOR_TITLE'=>'Open Calculator...', -'LBL_CALCULATOR_ALT'=>'Open Calculator...', - -'LBL_CLOCK_TITLE'=>'Show World Clock...', -'LBL_CLOCK_ALT'=>'Show World Clock...', - -'LBL_ALL_MENU_TITLE'=>'Open All Menu...', -'LBL_ALL_MENU_ALT'=>'Open All Menu...', - -'LBL_CHAT_TITLE'=>'Chat...', -'LBL_CHAT_ALT'=>'Chat...', - -'LBL_SEARCH_TITLE'=>'Search in ', -'LBL_SEARCH_ALT'=>'Search in ', - -'LBL_SEARCH_STRING'=>'Search...', - -'LBL_SEARCH_FOR'=>'Search for', -'LBL_SEARCH_NOW_BUTTON'=>'Search Now', -'LBL_GO_TO'=>'Go to', -'LBL_FEWER_BUTTON'=>'Fewer', -'LBL_IN'=>'In', - -'LBL_ADV_SEARCH_MSG_ANY'=>'Match Any of the Following', -'LBL_ADV_SEARCH_MSG_ALL'=>'Match All of the Following', - -'COMBO_ALL'=>'All', - -// Added fields for Related Field Display Informations in Detail View of All Modules - -'LBL_OPEN_ACTIVITIES'=>'Open Activities', - -'LBL_HISTORY'=>'History', - -'LBL_ACTIVITY_HISTORY'=>'Activity History', - -'LBL_ATTACHMENTS'=>'Attachments', - -'LBL_ATTACHMENT'=>'Attachment', - -'LBL_TYPE'=>'Type', - -'LBL_ASSIGNED_TO'=>'Assigned To', - -'LBL_TIME'=>'Time', - -'LBL_ACTION'=>'Action', - -'LBL_SUBJECT'=>'Subject', - -'LBL_RELATED_TO'=>'Related To', - -//added by raju for emails - -'LBL_MULTIPLE'=>'Multiple', - -'LBL_DUE_DATE'=>'Due Date', - -'LBL_LAST_MODIFIED'=>'Last Modified', - -'LBL_CREATED'=>'Created', // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Added - -'LBL_DESCRIPTION'=>'Description', - - - -'LBL_NEW_TASK'=>'New Task', - -'LBL_NEW_EVENT'=>'New Event', - -'LBL_ATTACHMENT_AND_NOTES'=>'Attachments & Notes', - -'LBL_POTENTIAL_NAME'=>'Potential Name', - -'LBL_CONTACT_NAME'=>'Contact Name', - -'LBL_DEPARTMENT'=>'Department', - -'LBL_ROLE'=>'Role', - -'LBL_EMAIL'=>'Email', - -'LBL_PHONE'=>'Phone', - -'LBL_PRODUCT'=>'Product', - -'LBL_AMOUNT'=>'Amount', - -'LBL_CLOSE_DATE'=>'Close Date', - -'LBL_NEW_ATTACHMENT'=>'New Attachment', - -'LBL_NEW_NOTE'=>'New Note', - - - -'LBL_PRODUCT_TITLE'=>'Products', - -'LBL_NEW_PRODUCT'=>'New Product', - -'LBL_PRODUCT_NAME'=>'Product Name', - -'LBL_QUANTITY'=>'Quantity', - -'LBL_SALES_PRICE'=>'Sale Price', - -'LBL_PURCHASE_DATE'=>'Purchase Date', - -'LBL_TICKET_ID'=>'Ticket Id', - -'LBL_NEW_TICKET'=>'New Ticket', - -'LBL_TICKETS'=>'Tickets', - - - -'LBL_POTENTIAL_TITLE'=>'Potentials', - -'LBL_NEW_POTENTIAL'=>'New Potential', - -'LBL_LEAD_NAME'=>'Lead Name', - -'LBL_ACCOUNT_NAME'=>'Account Name', - -'LBL_ACCOUNT_TYPE'=>'Account Type', - -'LBL_USER_TITLE'=>'Users', - -'LBL_CONTACT_TITLE'=>'Contacts', - - - -// 4 GA - -'LBL_SHOWING' => 'Showing', - -// - - - -//Added fields after RC1 - Release - -'LBL_SELECT_PRODUCT_BUTTON_LABEL'=>'Select Product', - -'LBL_VIEW'=>'Filters :', -// Mike Crowe Mod --------------------------------------------------------Added for group sort -'LBL_GROUP_VIEW'=>'Group', - - -'LBL_SALES_STAGE'=>'Sales Stage', - -'LBL_PROBABILITY'=>'Probability', - -'LBL_BULK_MAILS'=>'Bulk Mails', - - - -'LBL_WORLD_CLOCK'=>'World Clock', - -'LBL_CALCULATOR'=>'Calculator', - -'LBL_CLOSE_WON' =>'Closed Won', # 'Closed Won' -'LBL_CLOSE_LOST'=>'Closed Lost', # 'Closed Lost' - -'LBL_USER'=>'User', - -'LBL_TEAM'=>'Team', - -'LBL_GROUP'=>'Group', - -'LBL_NONE_NO_LINE'=>'none', - -'LBL_SELECT_GROUP'=>'Select a group', - -'LBL_HOUR_AND_MINUTE'=>'(hours/minutes)', - -'YEAR_MONTH_DATE'=>'24:00', - - - -'COMBO_LEADS'=>'Leads', - -'COMBO_ACCOUNTS'=>'Accounts', - -'COMBO_CONTACTS'=>'Contacts', - -'COMBO_POTENTIALS'=>'Potentials', - -'COMBO_PRODUCTS'=>'Products', - -'COMBO_HELPDESK'=>'Trouble Tickets', - -'COMBO_USERS'=>'Users', - -'COMBO_CAMPAIGNS'=>'Campaigns', - - -'LBL_SELECT'=>'Select', - -'LBL_EDIT'=>'Edit', - -'LBL_DELETE'=>'Delete', - - - -//List Fields - -'Name'=>'Name', - -'Company'=>'Company', - -'Phone'=>'Phone', - -'Website'=>'Website', - -'Email'=>'Email', - -'Assigned To'=>'Assigned To', - -'Account Name'=>'Account Name', - -'City'=>'City', - -'Title'=>'Title', - -'Potential'=>'Potential', - -'Sales Stage'=>'Sales Stage', - -'Amount'=>'Amount', - -'Expected Close'=>'Expected Close', - -'Subject'=>'Subject', - -'Contact Name'=>'Contact Name', - -'Related to'=>'Related To', - -'File'=>'File', - -'Last Modified'=>'Last Modified', - -'Close'=>'Close', - -'Type'=>'Type', - -'Start Date/Due Date'=>'Start Date/Due Date', - -'Date Sent'=>'Date Sent', - -'Ticket ID'=>'Ticket ID', - -'Status'=>'Status', - -'Priority'=>'Priority', - -'Product Name'=>'Product Name', - -'Product Code'=>'Part Number', - -'Commission Rate'=>'Commission Rate', - -'Qty/Unit'=>'Qty/Unit', - -'Unit Price'=>'Unit Price', - -'Question'=>'Question', - -'Category'=>'Category', - -'Price Book Name'=>'Price Book Name', -'LBL_EVENT_ENDDATE'=>'End Date & Time', - -//Added after 4 GA -'LBL_CUSTOM_INFORMATION'=>'Custom Information', - -//Added fields to display the related lists titles and None Scheduled -'LBL_NONE_SCHEDULED'=>'None Scheduled', - -'Leads'=>'Leads', -'Accounts'=>'Accounts', -'Accounts & Contacts'=>'Accounts & Contacts', -'Contacts'=>'Contacts', -'Potentials'=>'Potentials', -'Products'=>'Products', -'Emails'=>'Emails', -'HelpDesk'=>'Trouble Tickets', -'Activities'=>'Activities', -'Events'=>'Events', -'Tasks'=>'Tasks', -'Todo'=>'To Do', -'Call'=>'Call', -'Meeting'=>'Meeting', -'Quotes'=>'Quotes', -'PriceBook'=>'Price Books', -'PurchaseOrder'=>'Purchase Order', -'SalesOrder'=>'Sales Order', -'Invoice'=>'Invoices', -'Calendar'=>'Calendar', -'Home'=>'Home', -'Campaigns'=>'Campaigns', -'PriceBooks'=>'Price Books', -'Notes'=>'Notes', -'Faq'=>'FAQ', -'Dashboards'=>'Dashboard', -'Reports'=>'Reports', -'Vendors'=>'Vendors', -'Rss'=>'RSS', -'Portal'=>'My Sites', -'Webmails'=>'Webmails', -'Attachments'=>'Attachments', -'Activity History'=>'Activity History', -'Ticket History'=>'Ticket History', -'Purchase Order'=>'Purchase Order', -'Sales Stage History'=>'Sales Stage History', -'Users'=>'Users', -'Admin'=>'Admin', -'PurchaseOrder Status History'=>'PurchaseOrder Status History', -'SalesOrder Status History'=>'SalesOrder Status History', -'Quote Stage History'=>'Quote Stage History', -'Invoice Status History'=>'Invoice Status History', -'LBL_TROUBLE_TICKET'=>'Trouble Ticket', - -//Added language for Parent Tab - -'My Home Page'=>'My Home Page', -'Marketing'=>'Marketing', -'Sales'=>'Sales', -'Support'=>'Support', -'Analytics'=>'Analytics', -'Inventory'=>'Inventory', -'Tools'=>'Tools', -'Settings'=>'Settings', - -'LBL_INFORMATION'=>'Information', -'LBL_MORE'=>'More', -'LBL_BASIC'=>'Basic', -'LBL_CREATING'=>'Creating', -'LBL_EDITING'=>'Editing', -'LBL_NEW'=>'New', - -//Added for Detail/Edit/Related List of all modules - -'Lead'=>'Lead', -'Account'=>'Account', -'Contact'=>'Contact', -'Potential'=>'Potential', -'Opportunity'=>'Potential', -'Product'=>'Product', -'Email'=>'Email', -'Activity'=>'Activity', -'Event'=>'Event', -'Task'=>'Task', -'Quote'=>'Quote', -'PriceBook'=>'PriceBook', -'PurchaseOrder'=>'Purchase Order', -'Ticket'=>'Ticket', -'SalesOrder'=>'Sales Orders', -'Campaign'=>'Campaign', -'Note'=>'Note', -'Dashboard'=>'Dashboards', -'Report'=>'Report', -'Vendor'=>'Vendor', -'Webmail'=>'Webmail', - -'LBL_NONE_INCLUDED'=>'None Included', -'LBL_ADD_TO'=>'Add to', - -'LBL_SELECT_TEMPLATE_TO_MAIL_MERGE'=>'Select template to Mail Merge:', -'LBL_TITLE_OR_DESCRIPTION'=>'Title / Description', - -//Added for RSS Module -'LBL_RSS_FEEDS'=>'RSS Feeds', -'LBL_ADD_RSS_FEEDS'=>'Add New RSS Feed', - -//Added fields after 4.2 alpha -'COMBO_ACCOUNTS'=>'Accounts', -'LNK_NEW_FAQ'=>'New FAQ', -'Vendor Name'=>'Vendor Name', -'LNK_WEARE'=>'About us', -'LBL_ABOUTUS_TITLE'=>'vtiger CRM - About Us', -'LBL_DISCUSS'=>'Discuss with other users', -'Quote Stage'=>'Quote Stage', -'Potential Name'=>'Potential Name', -'Total'=>'Total Amount', -'First Name'=>'First Name', -'Last Name'=>'Last Name', -'User Name'=>'User Name', - /* For purchase order related list in vendor */ -'LBL_PORDER_BUTTON_TITLE'=>'New Purchase Order [Alt+O]', -'LBL_PORDER_BUTTON'=>'New Purchase Order', -'LBL_PORDER_BUTTON_KEY'=>'O', -'Tracking Number'=>'Tracking Number', -'Order Id'=>'Order Id', -'Quote Name'=>'Quote Name', -'Invoice Id'=>'Invoice Id', -'Quote Id'=>'Quote Id', -'Sales Order'=>'Sales Order', - // Added Quote in activity parent type selection / Related list -'COMBO_QUOTES'=>'Quotes', -'End Date'=>'End Date', -'Start Date'=>'Start Date', -'Related to'=>'Related To', -'Recurring Type'=> 'Recurring Type', -'SalesOrders'=> 'Sales Order', -'PurchaseOrder'=> 'Purchase Orders', -'LBL_QUOTE_NAME'=>'Quote Name', - //Added Orders in activity parent type selection / Related list -'LBL_NEW_QUOTE_BUTTON_TITLE'=>'New Quote [Alt+Q]', -'LBL_NEW_QUOTE_BUTTON_KEY'=>'Q', -'LBL_NEW_QUOTE_BUTTON'=>'New Quote', -'COMBO_PORDER'=>'Purchase Order', -'COMBO_SORDER'=>'Sales Order', -'LBL_PORDER_NAME'=>'Purchase Order', -'LBL_SORDER_NAME'=>'Sales Order', - // Added Invoice in activity parent type selection / Related list -'COMBO_INVOICES'=>'Invoice', -'LBL_INVOICE_NAME'=>'Invoice', -'LBL_HELPDESK_NAME'=>'Trouble Ticket', -'LBL_CAMPAIGN_NAME'=>'Campaign Name', - -'LBL_NEW_INVOICE_BUTTON_TITLE'=>'New Invoice [Alt+I]', -'LBL_NEW_INVOICE_BUTTON_KEY'=>'I', -'LBL_NEW_INVOICE_BUTTON'=>'New Invoice', -'LBL_NEW_SORDER_BUTTON_TITLE'=>'New Sales Order [Alt+E]', -'LBL_NEW_SORDER_BUTTON_KEY'=>'E', -'LBL_NEW_SORDER_BUTTON'=>'New Sales Order', - -'LBL_PRODUCT_DETAILS'=>'Product Details', -'LBL_PRODUCT'=>'Product', -'LBL_QTY_IN_STOCK'=>'Qty In Stock', -'LBL_QTY'=>'Qty', -'LBL_UNIT_PRICE'=>'Unit Price', -'LBL_LIST_PRICE'=>'List Price', -'LBL_TOTAL'=>'Total', -'LBL_ADD_PRODUCT'=>'Add Product', -'LBL_SUB_TOTAL'=>'Sub Total', -'LBL_TAX'=>'Tax', -'LBL_ADJUSTMENT'=>'Adjustment', -'LBL_GRAND_TOTAL'=>'Grand Total', -'LBL_QUOTE_ID'=>'Quote Id', -'LBL_SALES_ORDER_ID'=>'Sales Order Id', -'LBL_PURCHASE_ORDER_ID'=>'Purchase Order Id', -'LBL_EXPORT_TO_PDF'=>'Export To PDF', - -//Added for 4.2 Patch I -'LBL_HOME_KEY_METRICS'=>'Key Metrics', -'LBL_HOME_METRICS'=>'Metrics', -'LBL_HOME_COUNT'=>'Count', - -//Added for 4.2 patch 2 -'LBL_JSCALENDAR_LANG'=>'en', -'LNK_CV_EDIT'=>'Edit', -'LNK_CV_DELETE'=>'Delete', -'LNK_CV_CREATEVIEW'=>'New', -//Added for 5.0 -'LBL_UPD_FIELD_ORD'=>'Update Field Order', -'LBL_SEND_CUSTOM_MAIL_BUTTON'=>'Send Custom Mail', -'LBL_UPDATED_TODAY'=>'Updated today', -'LBL_UPDATED'=>'Updated', -'LBL_DAY_AGO'=>'day ago', -'LBL_DAYS_AGO'=>'days ago', - -//Added to convert Month string in update info - ahmed - -'Jan'=>'Jan', -'Feb'=>'Feb', -'Mar'=>'Mar', -'Apr'=>'Apr', -'May'=>'May', -'Jun'=>'Jun', -'Jul'=>'Jul', -'Aug'=>'Aug', -'Sep'=>'Sep', -'Oct'=>'Oct', -'Nov'=>'Nov', -'Dec'=>'Dec', - -//Added after 5.0 Alpha5 -'Campaign Name'=>'Campaign Name', -'Campaign Type'=>'Campaign Type', -'Campaign Status'=>'Campaign Status', -'Expected Revenue'=>'Expected Revenue', -'Expected Close Date'=>'Expected Close Date', -'LBL_ACTIONS'=>'Actions', -'LBL_SEND'=>'Send', -'LBL_VAT'=>'VAT', -'LBL_SALES'=>'Sales', -'LBL_SERVICE'=>'Service', -'LBL_TAX_DETAILS'=>'Tax Details', -'LBL_TAX_CALCULATION'=>'Tax Calculation', -'COVERED_PERCENTAGE'=>'(%)', - -'LBL_TAG_CLOUD'=>'Tag Cloud', -'LBL_FOR'=>'for', -'LBL_PO_STATUS'=>'PurchaseOrder Status', -'LBL_SO_STATUS'=>'SalesOrder Status', -'LBL_INVOICE_STATUS'=>'Invoice Status', -'LBL_NOTE'=>'Note', -'LBL_MODULE'=>'Module', -'Active'=>'Active', -'Inactive'=>'Inactive', -'Today'=>'Today', -'Last 2 Days'=>'Last 2 Days', -'Last Week'=>'Last Week', -'This Week'=>'This Week', -'This Month'=>'This Month', -'This Year'=>'This Year', -'LBL_PLEASE_CLICK'=>'Please Click', -'LBL_TO_CONFIGURE'=>'to Configure', -'LBL_HERE'=>'here', -'LBL_RECORDS'=>'Records', -'LBL_SCROLL'=>'[Scroll to Top]', -'LBL_EXPAND_COLLAPSE'=>'Expand/Collapse', -'LBL_RCPY_ADDRESS'=>'Copy Shipping address', -'LBL_LCPY_ADDRESS'=>'Copy Billing address', -'LBL_RECORD_ID'=>'Record ID', -'LBL_ACTION_DATE'=>'Action Date', -'LBL_HOMEPAGE_DASHBOARD'=>'HomePage Dashboard', -'LBL_NO'=>'No', -'LBL_FOUND'=>'Found', -'LBL_YOU_CAN_CREATE'=>'You can Create', -'LBL_NOW'=>'now', -'LBL_CLICK_THE_LINK'=>'Click the link below', -'LBL_CREATE'=>'Create', -'LBL_A'=>'a', -'LBL_AN'=>'an', -'LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE'=>'You are not allowed to create', -'LBL_TRANSFER_OWNERSHIP'=>'Transfer Ownership to', -'LBL_SELECT_STATUS'=>'Select New Status', -'LBL_UPDATE_OWNER'=>'Update Owner', -'LBL_UPDATE_STATUS'=>'Update Status', - -//added for tax calculations - after 5beta2 -'LBL_NET_PRICE'=>'Net Price', -'LBL_TOOLS'=>'Tools', -'LBL_DISCOUNT'=>'Discount', -'LBL_TOTAL_AFTER_DISCOUNT'=>'Total After Discount', -'LBL_NET_TOTAL'=>'Net Total', -'LBL_SHIPPING_AND_HANDLING_CHARGES'=>'Shipping & Handling Charges', -'LBL_TAX_FOR_SHIPPING_AND_HANDLING'=>'Taxes For Shipping and Handling', -'LBL_FINISH'=>'Finish', -'LBL_IMAGE_DELETED'=>'Image Deleted', -'LBL_TAX_MODE'=>'Tax Mode', -'LBL_CLEAR_COMMENT'=>'Clear Comment', -'LBL_ZERO_DISCOUNT'=>'Zero Discount', -'LBL_OF_PRICE'=>'of Price', -'LBL_DIRECT_PRICE_REDUCTION'=>'Direct Price Reduction', -'LBL_INDIVIDUAL'=>'Individual', - -//Added the address strings for Contacts Module -'LBL_CPY_MAILING_ADDRESS'=>'Copy Mailing Address', -'LBL_CPY_OTHER_ADDRESS'=>'Copy Other Address', - -'LBL_PERMISSION'=>'You are not permitted to execute this Operation', -'VTIGER'=>'vtiger', - -//Added for Inventory Tax details -'LBL_DIRECT_AMOUNT_DISCOUNT'=>'Direct Amount Discount', -'LBL_NO_DISCOUNT_FOR_THIS_PRODUCT'=>'No Discount for this Product', -'LBL_TOTAL_TAX_AMOUNT'=>'Total Tax Amount', -'LBL_FINAL_DISCOUNT_AMOUNT'=>'Final Discount Amount', -'LBL_SHIPPING_AND_HANDLING_CHARGE'=>'Shipping & Handling Charge', -'LBL_GO_BACK'=>'Go Back', - -//Record deleted message -'LBL_RECORD_DELETE'=>'The record you are trying to view has been deleted.', -'Part Number'=>'Part Number', - -//Added after 5.0.1 -'Salutation'=>'Salutation ', -'Rating'=>'Rating', -'industry'=>'Industry', -'Severity'=>'Severity', -'Product Category'=>'Product Category', -'GL Account'=>'GL Account', -'Usage Unit'=>'Usage Unit', -'Carrier'=>'Carrier', -'Expected Response'=>'Expected Response', -'LBL_ADDRESS_INF'=>'Address Information', - -'yes'=>'yes', -'LBL_RENAMEPROFILE_BUTTON_LABEL'=>'Rename', -'LBL_RENAME_PROFILE'=>'Rename Profile', -'LBL_PROFILE_NAME'=>'Profile Name', -'LBL_START_DATE'=>'Start Date', -'LBL_END_DATE'=>'End Date', - -); - - - -//the left value is the key stored in the db and the right value is the display value - -//to translate, only modify the right value in each key/value pair - -$app_list_strings = Array( - -//e.g. auf Deutsch 'Contacts'=>'Contakten', - -'moduleList' => Array('Home'=>'Home' - - , 'Dashboard'=>'Dashboard' - - , 'Leads'=>'Leads' - - , 'Contacts'=>'Contacts' - - , 'Accounts'=>'Accounts' - - , 'Potentials'=>'Potentials' - - , 'Campaigns'=>'Campaigns' - - , 'Notes'=>'Notes' - - , 'Emails'=>'Emails' - - , 'Activities'=>'Activities' - - , 'Products'=>'Products' - - , 'HelpDesk'=>'Trouble Tickets' - - , 'Faq'=>'FAQ' - - , 'Calendar'=>'Calendar' - - , 'Quotes'=>'Quotes' - - , 'PurchaseOrder'=>'PurchaseOrder' - - , 'Invoice'=>'Invoice' - - , 'Rss'=>'RSS' - - , 'Reports'=>'Reports' - - , 'Vendors'=>'Vendors' - - , 'PriceBooks'=>'PriceBooks' - - , 'SalesOrder'=>'SalesOrder' - - , 'Portal'=>'My Sites' - - ), - - - -//Note: do not translate opportunity_relationship_type_default_key - -// it is the key for the default opportunity_relationship_type_dom value - -'opportunity_relationship_type_default_key' => 'Primary Decision Maker', - -'opportunity_relationship_type_dom' => Array(''=>'' - - , 'Primary Decision Maker'=>'Primary Decision Maker' - - , 'Business Decision Maker'=>'Business Decision Maker' - - , 'Business Evaluator'=>'Business Evaluator' - - , 'Technical Decision Maker'=>'Technical Decision Maker' - - , 'Technical Evaluator'=>'Technical Evaluator' - - , 'Executive Sponsor'=>'Executive Sponsor' - - , 'Influencer'=>'Influencer' - - , 'Other'=>'Other' - - ), - - - -//Note: do not translate case_relationship_type_default_key - -// it is the key for the default case_relationship_type_dom value - -'case_relationship_type_default_key' => 'Primary Contact', - -'case_relationship_type_dom' => Array(''=>'' - - , 'Primary Contact'=>'Primary Contact' - - , 'Alternate Contact'=>'Alternate Contact' - - ), - - - -'task_priority_dom' => Array('High'=>'High' - - , 'Medium'=>'Medium' - - , 'Low'=>'Low' - - ), - - - -'task_status_dom' => Array('Planned'=>'Planned' - - , 'Completed'=>'Completed' - - , 'Deferred'=>'Deferred' - - ), - - - -'meeting_status_dom' => Array('Planned'=>'Planned' - - , 'Held'=>'Held' - - , 'Not Held'=>'Not Held' - - ), - - - -'call_status_dom' => Array('Planned'=>'Planned' - - , 'Held'=>'Held' - - , 'Not Held'=>'Not Held' - - ), - - - -//Note: do not translate case_status_default_key - -// it is the key for the default case_status_dom value - -'case_status_default_key' => 'New', - -'case_status_dom' => Array('New'=>'New' - - , 'Assigned'=>'Assigned' - - , 'Closed'=>'Closed' - - , 'Pending Input'=>'Pending Input' - - , 'Rejected'=>'Rejected' - - ), - - - -'user_status_dom' => Array('Active'=>'Active' - - , 'Inactive'=>'Inactive' - - ), - - - -//Note: do not translate record_type_default_key - -// it is the key for the default record_type_module value - -'record_type_default_key' => 'Accounts', - -'record_type_display' => array('Accounts' => 'Account', - - 'Leads' => 'Lead', - - 'Opportunities' => 'Opportunity'), - -); - - - -?> + 'ISO-8859-1', + 'LBL_BROWSER_TITLE' => 'vtiger CRM 5 - Commercial Open Source CRM', + 'LBL_MY_ACCOUNT' => 'My Account', + 'LBL_MY_PREFERENCES' => 'My Preferences', + 'LBL_ADMIN' => 'Admin', + 'LBL_LOGOUT' => 'Sign out', + 'LBL_SEARCH' => 'Search', + 'LBL_LAST_VIEWED' => 'Last Viewed', + 'NTC_WELCOME_MESSAGE' => 'Welcome to vtiger CRM!', + 'NTC_DESCRIPTION' => 'Use a valid username and password to login to the vtiger CRM.', + 'NTC_WELCOME' => 'Welcome', + 'NTC_NO_ITEMS_DISPLAY' => 'none', + 'LBL_OR' => 'or', + 'LBL_ALT_HOT_KEY' => 'Alt+', + 'LBL_SAVE_LABEL' => 'Save', + 'LBL_SEND_MAIL_BUTTON' => 'Send Mail', + 'LBL_SAVE_BUTTON_TITLE' => 'Save [Alt+S]', + 'LBL_EDIT_BUTTON_TITLE' => 'Edit [Alt+E]', + 'LBL_CONVERTSO_BUTTON_TITLE' => 'Create SalesOrder', + 'LBL_CONVERTINVOICE_BUTTON_TITLE' => 'Create Invoice', + 'LBL_EDIT_BUTTON' => 'Edit', + 'LBL_DUPLICATE_BUTTON_TITLE' => 'Duplicate [Alt+U]', + 'LBL_DUPLICATE_BUTTON' => 'Duplicate', + 'LBL_TABCUSTOMISE_BUTTON_TITLE' => 'Customise [Alt+C]', + 'LBL_FORUM_HIDE_BUTTON_TITLE' => 'Hide Forum [Alt+I]', + 'LBL_FORUM_HIDE_BUTTON_KEY' => 'H', + 'LBL_FORUM_SHOW_BUTTON_TITLE' => 'Show Forum [Alt+W]', + 'LBL_FORUM_SHOW_BUTTON_KEY' => 'W', + 'LBL_TABCUSTOMISE_BUTTON' => 'Customise', + 'LBL_DELETE_BUTTON_TITLE' => 'Delete [Alt+D]', + 'LBL_DELETE_BUTTON' => 'Delete', + 'LBL_FIND_BUTTON' => 'Find', + 'LBL_CONVERT_BUTTON_TITLE' => 'Convert [Alt+C]', + 'LBL_CONVERT_BUTTON_KEY' => 'C', + 'LBL_CONVERT_BUTTON_LABEL' => 'Convert Lead', + 'LBL_TABCUSTOMISE_BUTTON_KEY' => 'C', + 'LBL_TABCUSTOMISE_BUTTON_LABEL' => 'Customize Tab', + 'LBL_ROLES_BUTTON_LABEL' => 'Show Roles', + 'LBL_LISTROLES_BUTTON_LABEL' => 'List Roles', + 'LBL_FORUM_HIDE_BUTTON_LABEL' => 'Hide Forums', + 'LBL_FORUM_SHOW_BUTTON_LABEL' => 'Show Forums', + 'LBL_NEW_BUTTON_TITLE' => 'New [Alt+N]', + 'LBL_CHANGE_BUTTON_TITLE' => 'Change [Alt+G]', + 'LBL_CANCEL_BUTTON_TITLE' => 'Cancel [Alt+X]', + 'LBL_SEARCH_BUTTON_TITLE' => 'Search [Alt+Q]', + 'LBL_CLEAR_BUTTON_TITLE' => 'Clear [Alt+C]', + 'LBL_SELECT_BUTTON_TITLE' => 'Select [Alt+T]', + 'LBL_CREATE_BUTTON_LABEL' => 'Create', + 'LBL_GENERATE' => 'Generate', + 'LBL_SAVE_BUTTON_KEY' => 'S', + 'LBL_EDIT_BUTTON_KEY' => 'E', + 'LBL_CONVERTSO_BUTTON_KEY' => 'S', + 'LBL_CONVERTINVOICE_BUTTON_KEY' => 'I', + 'LBL_DUPLICATE_BUTTON_KEY' => 'U', + 'LBL_DELETE_BUTTON_KEY' => 'D', + 'LBL_NEW_BUTTON_KEY' => 'N', + 'LBL_CHANGE_BUTTON_KEY' => 'G', + 'LBL_CANCEL_BUTTON_KEY' => 'X', + 'LBL_SEARCH_BUTTON_KEY' => 'Q', + 'LBL_CLEAR_BUTTON_KEY' => 'C', + 'LBL_SELECT_BUTTON_KEY' => 'T', + 'LBL_SAVE_BUTTON_LABEL' => 'Save', + 'LBL_EDIT_BUTTON_LABEL' => 'Edit', + 'LBL_CONVERTSO_BUTTON_LABEL' => 'Create SalesOrder', + 'LBL_CONVERTINVOICE_BUTTON_LABEL' => 'Create Invoice', + 'LBL_DUPLICATE_BUTTON_LABEL' => 'Duplicate', + 'LBL_DELETE_BUTTON_LABEL' => 'Delete', + 'LBL_NEW_BUTTON_LABEL' => 'New', + 'LBL_CHANGE_BUTTON_LABEL' => 'Change', + 'LBL_CANCEL_BUTTON_LABEL' => 'Cancel', + 'LBL_SEARCH_BUTTON_LABEL' => 'Search', + 'LBL_CLEAR_BUTTON_LABEL' => 'Clear', + 'LBL_SELECT_BUTTON_LABEL' => 'Select', + 'LBL_SELECT_CONTACT_BUTTON_TITLE' => 'Select Contact [Alt+T]', + 'LBL_SELECT_CONTACT_BUTTON_KEY' => 'T', + 'LBL_SELECT_CONTACT_BUTTON_LABEL' => 'Select Contact', + 'LBL_SELECT_CAMPAIGN_BUTTON_LABEL' => 'Select Campaign', + 'LBL_SELECT_USER_BUTTON_TITLE' => 'Select User [Alt+U]', + 'LBL_SELECT_USER_BUTTON_KEY' => 'U', + 'LBL_SELECT_USER_BUTTON_LABEL' => 'Select User', + 'LBL_SETTINGS' => 'Settings', + 'LBL_LIST_USERIP' => 'User IP', + 'LBL_LIST_SIGNIN' => 'Sign in Time', + 'LBL_LIST_SIGNOUT' => 'Sign out Time', + 'LBL_LIST_STATUS' => 'Status', + 'LBL_LIST_NAME' => 'Name', + 'LBL_LIST_USER_NAME' => 'User Name', + 'LBL_LIST_EMAIL' => 'Email', + 'LBL_LIST_PHONE' => 'Phone', + 'LBL_LIST_CONTACT_NAME' => 'Contact Name', + 'LBL_LIST_ACCOUNT_NAME' => 'Account Name', + 'LBL_USER_LIST' => 'User List', + 'LBL_CONTACT_LIST' => 'Contact List', + 'LBL_LNK_SETTINGS' => 'Settings', + 'LNK_IMPORT_LEADS' => 'Import Leads', + 'LBL_LOCATE_MAP' => 'Locate Map', + 'LBL_ADDRESS' => 'Address', + 'LBL_ADD_TAG' => 'Add Tag', + 'LBL_TAG_IT' => 'Tag it', + 'LBL_CLOSE' => 'Close', + 'LNK_ADVANCED_SEARCH' => 'Advanced Search', + 'LNK_BASIC_SEARCH' => 'Basic Search', + 'LNK_EDIT' => 'edit', + 'LNK_REMOVE' => 'rem', + 'LNK_DELETE' => 'del', + 'LNK_LIST_START' => 'Start', + 'LNK_LIST_NEXT' => 'Next', + 'LNK_LIST_PREVIOUS' => 'Previous', + 'LNK_LIST_END' => 'End', + 'LBL_LIST_OF' => 'of', + 'LNK_PRINT' => 'Print', + 'LNK_HELP' => 'Help', + 'LNK_VTDOCS' => 'vtiger Docs', + 'LNK_ABOUT' => 'About', + 'LNK_OUTLOOK' => './include/images/outlook_download.gif', + 'SINGLE_Accounts' => 'Account', + 'SINGLE_Contacts' => 'Contact', + 'SINGLE_Campaigns' => 'Campaign', + 'SINGLE_HelpDesk' => 'Ticket', + 'SINGLE_Leads' => 'Lead', + 'SINGLE_Events' => 'Event', + 'SINGLE_Calendar' => 'Task', + 'SINGLE_Dashboard' => 'Dashboard', + 'SINGLE_Emails' => 'Email', + 'SINGLE_Faq' => 'Faq', + 'SINGLE_Home' => 'Home', + 'SINGLE_Invoice' => 'Invoice', + 'SINGLE_Potentials' => 'Potential', + 'SINGLE_Notes' => 'Note', + 'SINGLE_Products' => 'Product', + 'SINGLE_Vendors' => 'Vendor', + 'SINGLE_PriceBooks' => 'PriceBook', + 'SINGLE_Quotes' => 'Quote', + 'SINGLE_PurchaseOrder' => 'PurchaseOrder', + 'SINGLE_SalesOrder' => 'SalesOrder', + 'SINGLE_Rss' => 'Rss', + 'SINGLE_Reports' => 'Report', + 'SINGLE_Portal' => 'Portal', + 'SINGLE_Webmails' => 'Webmail', + 'SINGLE_Users' => 'User', + 'NEW' => 'New', + 'NTC_REQUIRED' => 'Indicates required field', + 'LBL_REQUIRED_SYMBOL' => '*', + 'LBL_CURRENCY_SYMBOL' => '$', + 'LBL_THOUSANDS_SYMBOL' => 'K', + 'NTC_DATE_FORMAT' => '(yyyy-mm-dd)', + 'NTC_TIME_FORMAT' => '(24:00)', + 'NTC_DATE_TIME_FORMAT' => '(yyyy-mm-dd 24:00)', + 'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to delete this record?', + 'ERR_DELETE_RECORD' => 'A record number must be specified to delete the contact.', + 'ERR_CREATING_TABLE' => 'Error creating table: ', + 'ERR_CREATING_FIELDS' => 'Error filling in additional detail fields: ', + 'ERR_MISSING_REQUIRED_FIELDS' => 'Missing required fields:', + 'ERR_INVALID_EMAIL_ADDRESS' => 'not a valid email address.', + 'ERR_INVALID_DATE_FORMAT' => 'The date format must be: yyyy-mm-dd', + 'ERR_INVALID_MONTH' => 'Please enter a valid month.', + 'ERR_INVALID_DAY' => 'Please enter a valid day.', + 'ERR_INVALID_YEAR' => 'Please enter a valid 4 digit year.', + 'ERR_INVALID_DATE' => 'Please enter a valid date.', + 'ERR_INVALID_HOUR' => 'Please enter a valid hour.', + 'ERR_INVALID_TIME' => 'Please enter a valid time.', + 'NTC_CLICK_BACK' => 'Please click the browser back button and fix the error.', + 'LBL_LIST_ASSIGNED_USER' => 'Assigned To', + 'LBL_ASSIGNED_TO' => 'Assigned To', + 'LBL_DATE_MODIFIED' => 'Last Modified:', + 'LBL_DATE_ENTERED' => 'Created:', + 'LBL_CURRENT_USER_FILTER' => 'Only my items:', + 'NTC_LOGIN_MESSAGE' => 'Login', + 'LBL_NONE' => '--None--', + 'LBL_BACK' => 'Back', + 'LBL_IMPORT' => 'Import', + 'LBL_EXPORT' => 'Export', + 'LBL_EXPORT_ALL' => 'Export All', + 'LBL_QUICK_CREATE' => 'Quick Create', + 'Export' => 'Export', + 'Import' => 'Import', + 'Merge' => 'Merge', + 'ConvertLead' => 'ConvertLead', + 'LBL_SHOW_RESULTS' => 'Show Results in', + 'LBL_TOTAL_RECORDS_FOUND' => 'Total Records found :', + 'LBL_SEARCH_RESULTS_FOR' => ' -- Search results for ', + 'LBL_TAG_SEARCH' => ' -- Tag search for ', + 'LBL_NO_DATA' => 'No Data Found', + 'NTC_MERGE_CONFIRMATION' => 'Are you sure you want to merge this record?', + 'LBL_MERGE_BUTTON_TITLE' => 'Merge', + 'LBL_MERGE_BUTTON_KEY' => 'Merge', + 'LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE' => 'Select Email Template', + 'LBL_SELECTEMAILTEMPLATE_BUTTON_KEY' => 'Select Email Template', + 'LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL' => 'Select Email Template', + 'LBL_MERGE_BUTTON_LABEL' => 'Merge', + 'LBL_SENDMAIL_BUTTON_TITLE' => 'SendMail', + 'LBL_SENDMAIL_BUTTON_KEY' => 'SendMail', + 'LBL_SENDMAIL_BUTTON_LABEL' => 'Send Mail', + 'LBL_UPD_DESC' => 'Description', + 'LBL_FILENAME' => 'File Name', + 'LBL_FILE' => 'File', + 'LBL_TYPE' => 'Type', + 'LBL_DOWNLOAD' => 'Download Now', + 'LBL_OPERATION' => 'Operation', + 'LBL_GROUP_ALLOCATION_TITLE' => 'My Group Allocation ', + 'LBL_ENTITY_NAME' => 'Entity Name', + 'LBL_GROUP_NAME' => 'Group', + 'LBL_ENTITY_TYPE' => 'Type', + 'LBL_NEW_TICKET' => 'New Ticket', + 'LBL_TITLE' => 'Title', + 'LBL_PRIORITY' => 'Priority', + 'LBL_STATUS' => 'Status', + 'LBL_CHANGE_OWNER' => 'Change Owner', + 'LBL_CHANGE_STATUS' => 'Change Status', + 'LBL_MASS_DELETE' => 'Delete', + 'LBL_ADD_ITEM' => 'Add', + 'LBL_ADD_NEW' => 'Add', + 'LBL_DEDUCT' => 'Deduct', + 'LBL_CALENDAR_TITLE' => 'Open Calendar...', + 'LBL_CALENDAR_ALT' => 'Open Calendar...', + 'LBL_CALCULATOR_TITLE' => 'Open Calculator...', + 'LBL_CALCULATOR_ALT' => 'Open Calculator...', + 'LBL_CLOCK_TITLE' => 'Show World Clock...', + 'LBL_CLOCK_ALT' => 'Show World Clock...', + 'LBL_ALL_MENU_TITLE' => 'Open All Menu...', + 'LBL_ALL_MENU_ALT' => 'Open All Menu...', + 'LBL_CHAT_TITLE' => 'Chat...', + 'LBL_CHAT_ALT' => 'Chat...', + 'LBL_SEARCH_TITLE' => 'Search in ', + 'LBL_SEARCH_ALT' => 'Search in ', + 'LBL_SEARCH_STRING' => 'Search...', + 'LBL_SEARCH_FOR' => 'Search for', + 'LBL_SEARCH_NOW_BUTTON' => 'Search Now', + 'LBL_GO_TO' => 'Go to', + 'LBL_FEWER_BUTTON' => 'Fewer', + 'LBL_IN' => 'In', + 'LBL_ADV_SEARCH_MSG_ANY' => 'Match Any of the Following', + 'LBL_ADV_SEARCH_MSG_ALL' => 'Match All of the Following', + 'COMBO_ALL' => 'All', + 'LBL_OPEN_ACTIVITIES' => 'Open Activities', + 'LBL_HISTORY' => 'History', + 'LBL_ACTIVITY_HISTORY' => 'Activity History', + 'LBL_ATTACHMENTS' => 'Attachments', + 'LBL_ATTACHMENT' => 'Attachment', + 'LBL_TIME' => 'Time', + 'LBL_ACTION' => 'Action', + 'LBL_SUBJECT' => 'Subject', + 'LBL_RELATED_TO' => 'Related To', + 'LBL_MULTIPLE' => 'Multiple', + 'LBL_DUE_DATE' => 'Due Date', + 'LBL_LAST_MODIFIED' => 'Last Modified', + 'LBL_CREATED' => 'Created', + 'LBL_DESCRIPTION' => 'Description', + 'LBL_NEW_TASK' => 'New Task', + 'LBL_NEW_EVENT' => 'New Event', + 'LBL_ATTACHMENT_AND_NOTES' => 'Attachments & Notes', + 'LBL_POTENTIAL_NAME' => 'Potential Name', + 'LBL_CONTACT_NAME' => 'Contact Name', + 'LBL_DEPARTMENT' => 'Department', + 'LBL_ROLE' => 'Role', + 'LBL_EMAIL' => 'Email', + 'LBL_PHONE' => 'Phone', + 'LBL_PRODUCT' => 'Product', + 'LBL_AMOUNT' => 'Amount', + 'LBL_CLOSE_DATE' => 'Close Date', + 'LBL_NEW_ATTACHMENT' => 'New Attachment', + 'LBL_NEW_NOTE' => 'New Note', + 'LBL_PRODUCT_TITLE' => 'Products', + 'LBL_NEW_PRODUCT' => 'New Product', + 'LBL_PRODUCT_NAME' => 'Product Name', + 'LBL_QUANTITY' => 'Quantity', + 'LBL_SALES_PRICE' => 'Sale Price', + 'LBL_PURCHASE_DATE' => 'Purchase Date', + 'LBL_TICKET_ID' => 'Ticket Id', + 'LBL_TICKETS' => 'Tickets', + 'LBL_POTENTIAL_TITLE' => 'Potentials', + 'LBL_NEW_POTENTIAL' => 'New Potential', + 'LBL_LEAD_NAME' => 'Lead Name', + 'LBL_ACCOUNT_NAME' => 'Account Name', + 'LBL_ACCOUNT_TYPE' => 'Account Type', + 'LBL_USER_TITLE' => 'Users', + 'LBL_CONTACT_TITLE' => 'Contacts', + 'LBL_SHOWING' => 'Showing', + 'LBL_SELECT_PRODUCT_BUTTON_LABEL' => 'Select Product', + 'LBL_VIEW' => 'Filters :', + 'LBL_GROUP_VIEW' => 'Group', + 'LBL_SALES_STAGE' => 'Sales Stage', + 'LBL_PROBABILITY' => 'Probability', + 'LBL_BULK_MAILS' => 'Bulk Mails', + 'LBL_WORLD_CLOCK' => 'World Clock', + 'LBL_CALCULATOR' => 'Calculator', + 'LBL_CLOSE_WON' => 'Closed Won', + 'LBL_CLOSE_LOST' => 'Closed Lost', + 'LBL_USER' => 'User', + 'LBL_TEAM' => 'Team', + 'LBL_GROUP' => 'Group', + 'LBL_NONE_NO_LINE' => 'none', + 'LBL_SELECT_GROUP' => 'Select a group', + 'LBL_HOUR_AND_MINUTE' => '(hours/minutes)', + 'YEAR_MONTH_DATE' => '24:00', + 'COMBO_LEADS' => 'Leads', + 'COMBO_ACCOUNTS' => 'Accounts', + 'COMBO_CONTACTS' => 'Contacts', + 'COMBO_POTENTIALS' => 'Potentials', + 'COMBO_PRODUCTS' => 'Products', + 'COMBO_HELPDESK' => 'Trouble Tickets', + 'COMBO_USERS' => 'Users', + 'COMBO_CAMPAIGNS' => 'Campaigns', + 'LBL_SELECT' => 'Select', + 'LBL_EDIT' => 'Edit', + 'LBL_DELETE' => 'Delete', + 'Name' => 'Name', + 'Company' => 'Company', + 'Phone' => 'Phone', + 'Website' => 'Website', + 'Email' => 'Email', + 'Assigned To' => 'Assigned To', + 'Account Name' => 'Account Name', + 'City' => 'City', + 'Title' => 'Title', + 'Potential' => 'Potential', + 'Sales Stage' => 'Sales Stage', + 'Amount' => 'Amount', + 'Expected Close' => 'Expected Close', + 'Subject' => 'Subject', + 'Contact Name' => 'Contact Name', + 'Related to' => 'Related To', + 'File' => 'File', + 'Last Modified' => 'Last Modified', + 'Close' => 'Close', + 'Type' => 'Type', + 'Start Date/Due Date' => 'Start Date/Due Date', + 'Date Sent' => 'Date Sent', + 'Ticket ID' => 'Ticket ID', + 'Status' => 'Status', + 'Priority' => 'Priority', + 'Product Name' => 'Product Name', + 'Product Code' => 'Part Number', + 'Commission Rate' => 'Commission Rate', + 'Qty/Unit' => 'Qty/Unit', + 'Unit Price' => 'Unit Price', + 'Question' => 'Question', + 'Category' => 'Category', + 'Price Book Name' => 'Price Book Name', + 'LBL_EVENT_ENDDATE' => 'End Date & Time', + 'LBL_CUSTOM_INFORMATION' => 'Custom Information', + 'LBL_NONE_SCHEDULED' => 'None Scheduled', + 'Leads' => 'Leads', + 'Accounts' => 'Accounts', + 'Accounts & Contacts' => 'Accounts & Contacts', + 'Contacts' => 'Contacts', + 'Potentials' => 'Potentials', + 'Products' => 'Products', + 'Emails' => 'Emails', + 'HelpDesk' => 'Trouble Tickets', + 'Activities' => 'Activities', + 'Events' => 'Events', + 'Tasks' => 'Tasks', + 'Todo' => 'To Do', + 'Call' => 'Call', + 'Meeting' => 'Meeting', + 'Quotes' => 'Quotes', + 'PriceBook' => 'PriceBook', + 'PurchaseOrder' => 'Purchase Orders', + 'SalesOrder' => 'Sales Orders', + 'Invoice' => 'Invoices', + 'Calendar' => 'Calendar', + 'Home' => 'Home', + 'Campaigns' => 'Campaigns', + 'PriceBooks' => 'Price Books', + 'Notes' => 'Notes', + 'Faq' => 'FAQ', + 'Dashboards' => 'Dashboard', + 'Reports' => 'Reports', + 'Vendors' => 'Vendors', + 'Rss' => 'RSS', + 'Portal' => 'My Sites', + 'Webmails' => 'Webmails', + 'Attachments' => 'Attachments', + 'Activity History' => 'Activity History', + 'Ticket History' => 'Ticket History', + 'Purchase Order' => 'Purchase Order', + 'Sales Stage History' => 'Sales Stage History', + 'Users' => 'Users', + 'Admin' => 'Admin', + 'PurchaseOrder Status History' => 'PurchaseOrder Status History', + 'SalesOrder Status History' => 'SalesOrder Status History', + 'Quote Stage History' => 'Quote Stage History', + 'Invoice Status History' => 'Invoice Status History', + 'LBL_TROUBLE_TICKET' => 'Trouble Ticket', + 'My Home Page' => 'My Home Page', + 'Marketing' => 'Marketing', + 'Sales' => 'Sales', + 'Support' => 'Support', + 'Analytics' => 'Analytics', + 'Inventory' => 'Inventory', + 'Tools' => 'Tools', + 'Settings' => 'Settings', + 'LBL_INFORMATION' => 'Information', + 'LBL_MORE' => 'More', + 'LBL_BASIC' => 'Basic', + 'LBL_CREATING' => 'Creating', + 'LBL_EDITING' => 'Editing', + 'LBL_NEW' => 'New', + 'Lead' => 'Lead', + 'Account' => 'Account', + 'Contact' => 'Contact', + 'Opportunity' => 'Potential', + 'Product' => 'Product', + 'Activity' => 'Activity', + 'Event' => 'Event', + 'Task' => 'Task', + 'Quote' => 'Quote', + 'Ticket' => 'Ticket', + 'Campaign' => 'Campaign', + 'Note' => 'Note', + 'Dashboard' => 'Dashboards', + 'Report' => 'Report', + 'Vendor' => 'Vendor', + 'Webmail' => 'Webmail', + 'LBL_NONE_INCLUDED' => 'None Included', + 'LBL_ADD_TO' => 'Add to', + 'LBL_SELECT_TEMPLATE_TO_MAIL_MERGE' => 'Select template to Mail Merge:', + 'LBL_TITLE_OR_DESCRIPTION' => 'Title / Description', + 'LBL_RSS_FEEDS' => 'RSS Feeds', + 'LBL_ADD_RSS_FEEDS' => 'Add New RSS Feed', + 'LNK_NEW_FAQ' => 'New FAQ', + 'Vendor Name' => 'Vendor Name', + 'LNK_WEARE' => 'About us', + 'LBL_ABOUTUS_TITLE' => 'vtiger CRM - About Us', + 'LBL_DISCUSS' => 'Discuss with other users', + 'Quote Stage' => 'Quote Stage', + 'Potential Name' => 'Potential Name', + 'Total' => 'Total Amount', + 'First Name' => 'First Name', + 'Last Name' => 'Last Name', + 'User Name' => 'User Name', + 'LBL_PORDER_BUTTON_TITLE' => 'New Purchase Order [Alt+O]', + 'LBL_PORDER_BUTTON' => 'New Purchase Order', + 'LBL_PORDER_BUTTON_KEY' => 'O', + 'Tracking Number' => 'Tracking Number', + 'Order Id' => 'Order Id', + 'Quote Name' => 'Quote Name', + 'Invoice Id' => 'Invoice Id', + 'Quote Id' => 'Quote Id', + 'Sales Order' => 'Sales Order', + 'COMBO_QUOTES' => 'Quotes', + 'End Date' => 'End Date', + 'Start Date' => 'Start Date', + 'Recurring Type' => 'Recurring Type', + 'SalesOrders' => 'Sales Order', + 'LBL_QUOTE_NAME' => 'Quote Name', + 'LBL_NEW_QUOTE_BUTTON_TITLE' => 'New Quote [Alt+Q]', + 'LBL_NEW_QUOTE_BUTTON_KEY' => 'Q', + 'LBL_NEW_QUOTE_BUTTON' => 'New Quote', + 'COMBO_PORDER' => 'Purchase Order', + 'COMBO_SORDER' => 'Sales Order', + 'LBL_PORDER_NAME' => 'Purchase Order', + 'LBL_SORDER_NAME' => 'Sales Order', + 'COMBO_INVOICES' => 'Invoice', + 'LBL_INVOICE_NAME' => 'Invoice', + 'LBL_HELPDESK_NAME' => 'Trouble Ticket', + 'LBL_CAMPAIGN_NAME' => 'Campaign Name', + 'LBL_NEW_INVOICE_BUTTON_TITLE' => 'New Invoice [Alt+I]', + 'LBL_NEW_INVOICE_BUTTON_KEY' => 'I', + 'LBL_NEW_INVOICE_BUTTON' => 'New Invoice', + 'LBL_NEW_SORDER_BUTTON_TITLE' => 'New Sales Order [Alt+E]', + 'LBL_NEW_SORDER_BUTTON_KEY' => 'E', + 'LBL_NEW_SORDER_BUTTON' => 'New Sales Order', + 'LBL_PRODUCT_DETAILS' => 'Product Details', + 'LBL_QTY_IN_STOCK' => 'Qty In Stock', + 'LBL_QTY' => 'Qty', + 'LBL_UNIT_PRICE' => 'Unit Price', + 'LBL_LIST_PRICE' => 'List Price', + 'LBL_TOTAL' => 'Total', + 'LBL_ADD_PRODUCT' => 'Add Product', + 'LBL_SUB_TOTAL' => 'Sub Total', + 'LBL_TAX' => 'Tax', + 'LBL_ADJUSTMENT' => 'Adjustment', + 'LBL_GRAND_TOTAL' => 'Grand Total', + 'LBL_QUOTE_ID' => 'Quote Id', + 'LBL_SALES_ORDER_ID' => 'Sales Order Id', + 'LBL_PURCHASE_ORDER_ID' => 'Purchase Order Id', + 'LBL_EXPORT_TO_PDF' => 'Export To PDF', + 'LBL_HOME_KEY_METRICS' => 'Key Metrics', + 'LBL_HOME_METRICS' => 'Metrics', + 'LBL_HOME_COUNT' => 'Count', + 'LBL_JSCALENDAR_LANG' => 'en', + 'LNK_CV_EDIT' => 'Edit', + 'LNK_CV_DELETE' => 'Delete', + 'LNK_CV_CREATEVIEW' => 'New', + 'LBL_UPD_FIELD_ORD' => 'Update Field Order', + 'LBL_SEND_CUSTOM_MAIL_BUTTON' => 'Send Custom Mail', + 'LBL_UPDATED_TODAY' => 'Updated today', + 'LBL_UPDATED' => 'Updated', + 'LBL_DAY_AGO' => 'day ago', + 'LBL_DAYS_AGO' => 'days ago', + 'Jan' => 'Jan', + 'Feb' => 'Feb', + 'Mar' => 'Mar', + 'Apr' => 'Apr', + 'May' => 'May', + 'Jun' => 'Jun', + 'Jul' => 'Jul', + 'Aug' => 'Aug', + 'Sep' => 'Sep', + 'Oct' => 'Oct', + 'Nov' => 'Nov', + 'Dec' => 'Dec', + 'Campaign Name' => 'Campaign Name', + 'Campaign Type' => 'Campaign Type', + 'Campaign Status' => 'Campaign Status', + 'Expected Revenue' => 'Expected Revenue', + 'Expected Close Date' => 'Expected Close Date', + 'LBL_ACTIONS' => 'Actions', + 'LBL_SEND' => 'Send', + 'LBL_VAT' => 'VAT', + 'LBL_SALES' => 'Sales', + 'LBL_SERVICE' => 'Service', + 'LBL_TAX_DETAILS' => 'Tax Details', + 'LBL_TAX_CALCULATION' => 'Tax Calculation', + 'COVERED_PERCENTAGE' => '(%)', + 'LBL_TAG_CLOUD' => 'Tag Cloud', + 'LBL_FOR' => 'for', + 'LBL_PO_STATUS' => 'PurchaseOrder Status', + 'LBL_SO_STATUS' => 'SalesOrder Status', + 'LBL_INVOICE_STATUS' => 'Invoice Status', + 'LBL_NOTE' => 'Note', + 'LBL_MODULE' => 'Module', + 'Active' => 'Active', + 'Inactive' => 'Inactive', + 'Today' => 'Today', + 'Last 2 Days' => 'Last 2 Days', + 'Last Week' => 'Last Week', + 'This Week' => 'This Week', + 'This Month' => 'This Month', + 'This Year' => 'This Year', + 'LBL_PLEASE_CLICK' => 'Please Click', + 'LBL_TO_CONFIGURE' => 'to Configure', + 'LBL_HERE' => 'here', + 'LBL_RECORDS' => 'Records', + 'LBL_SCROLL' => '[Scroll to Top]', + 'LBL_EXPAND_COLLAPSE' => 'Expand/Collapse', + 'LBL_RCPY_ADDRESS' => 'Copy Shipping address', + 'LBL_LCPY_ADDRESS' => 'Copy Billing address', + 'LBL_RECORD_ID' => 'Record ID', + 'LBL_ACTION_DATE' => 'Action Date', + 'LBL_HOMEPAGE_DASHBOARD' => 'HomePage Dashboard', + 'LBL_NO' => 'No', + 'LBL_FOUND' => 'Found', + 'LBL_YOU_CAN_CREATE' => 'You can Create', + 'LBL_NOW' => 'now', + 'LBL_CLICK_THE_LINK' => 'Click the link below', + 'LBL_CREATE' => 'Create', + 'LBL_A' => 'a', + 'LBL_AN' => 'an', + 'LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE' => 'You are not allowed to create', + 'LBL_TRANSFER_OWNERSHIP' => 'Transfer Ownership to', + 'LBL_SELECT_STATUS' => 'Select New Status', + 'LBL_UPDATE_OWNER' => 'Update Owner', + 'LBL_UPDATE_STATUS' => 'Update Status', + 'LBL_NET_PRICE' => 'Net Price', + 'LBL_TOOLS' => 'Tools', + 'LBL_DISCOUNT' => 'Discount', + 'LBL_TOTAL_AFTER_DISCOUNT' => 'Total After Discount', + 'LBL_NET_TOTAL' => 'Net Total', + 'LBL_SHIPPING_AND_HANDLING_CHARGES' => 'Shipping & Handling Charges', + 'LBL_TAX_FOR_SHIPPING_AND_HANDLING' => 'Taxes For Shipping and Handling', + 'LBL_FINISH' => 'Finish', + 'LBL_IMAGE_DELETED' => 'Image Deleted', + 'LBL_TAX_MODE' => 'Tax Mode', + 'LBL_CLEAR_COMMENT' => 'Clear Comment', + 'LBL_ZERO_DISCOUNT' => 'Zero Discount', + 'LBL_OF_PRICE' => 'of Price', + 'LBL_DIRECT_PRICE_REDUCTION' => 'Direct Price Reduction', + 'LBL_INDIVIDUAL' => 'Individual', + 'LBL_CPY_MAILING_ADDRESS' => 'Copy Mailing Address', + 'LBL_CPY_OTHER_ADDRESS' => 'Copy Other Address', + 'LBL_PERMISSION' => 'You are not permitted to execute this Operation', + 'VTIGER' => 'vtiger', + 'LBL_DIRECT_AMOUNT_DISCOUNT' => 'Direct Amount Discount', + 'LBL_NO_DISCOUNT_FOR_THIS_PRODUCT' => 'No Discount for this Product', + 'LBL_TOTAL_TAX_AMOUNT' => 'Total Tax Amount', + 'LBL_FINAL_DISCOUNT_AMOUNT' => 'Final Discount Amount', + 'LBL_SHIPPING_AND_HANDLING_CHARGE' => 'Shipping & Handling Charge', + 'LBL_GO_BACK' => 'Go Back', + 'LBL_RECORD_DELETE' => 'The record you are trying to view has been deleted.', + 'Part Number' => 'Part Number', + 'Salutation' => 'Salutation ', + 'Rating' => 'Rating', + 'industry' => 'Industry', + 'Severity' => 'Severity', + 'Product Category' => 'Product Category', + 'GL Account' => 'GL Account', + 'Usage Unit' => 'Usage Unit', + 'Carrier' => 'Carrier', + 'Expected Response' => 'Expected Response', + 'LBL_ADDRESS_INF' => 'Address Information', + 'yes' => 'yes', + 'don' => 'don', + 'nayanthara' => 'nayanthara', + 'LNK_NEW_DON' => 'New don', + 'patient' => 'patient', + 'medical' => 'medical', + 'LNK_NEW_PATIENT' => 'New patient', + 'cars' => 'cars', + 'automobile' => 'automobile', + 'LNK_NEW_CARS' => 'New cars', + 'king' => 'king', + 'LNK_NEW_KING' => 'New king', + 'Forests' => 'Forests', + 'Congo' => 'Congo', + 'LNK_NEW_FORESTS' => 'New Forests', + 'rock' => 'rock', + 'Solid' => 'Solid', + 'LNK_NEW_ROCK' => 'New rock', + 'lexus' => 'lexus', + 'toyota' => 'toyota', + 'LNK_NEW_LEXUS' => 'New lexus', + 'medicine' => 'medicine', + 'Indica' => 'Indica', + 'Tata' => 'Tata', + 'SINGLE_Indica' => 'Indica', +);$app_list_strings = array ( + 'moduleList' => + array ( + 'Home' => 'Home', + 'Dashboard' => 'Dashboard', + 'Leads' => 'Leads', + 'Contacts' => 'Contacts', + 'Accounts' => 'Accounts', + 'Potentials' => 'Potentials', + 'Campaigns' => 'Campaigns', + 'Notes' => 'Notes', + 'Emails' => 'Emails', + 'Activities' => 'Activities', + 'Products' => 'Products', + 'HelpDesk' => 'Trouble Tickets', + 'Faq' => 'FAQ', + 'Calendar' => 'Calendar', + 'Quotes' => 'Quotes', + 'PurchaseOrder' => 'PurchaseOrder', + 'Invoice' => 'Invoice', + 'Rss' => 'RSS', + 'Reports' => 'Reports', + 'Vendors' => 'Vendors', + 'PriceBooks' => 'PriceBooks', + 'SalesOrder' => 'SalesOrder', + 'Portal' => 'My Sites', + 'don' => 'don', + 'patient' => 'patient', + 'cars' => 'cars', + 'king' => 'king', + 'Forests' => 'Forests', + 'rock' => 'rock', + 'lexus' => 'lexus', + 'Indica' => 'Indica', + ), + 'opportunity_relationship_type_default_key' => 'Primary Decision Maker', + 'opportunity_relationship_type_dom' => + array ( + '' => '', + 'Primary Decision Maker' => 'Primary Decision Maker', + 'Business Decision Maker' => 'Business Decision Maker', + 'Business Evaluator' => 'Business Evaluator', + 'Technical Decision Maker' => 'Technical Decision Maker', + 'Technical Evaluator' => 'Technical Evaluator', + 'Executive Sponsor' => 'Executive Sponsor', + 'Influencer' => 'Influencer', + 'Other' => 'Other', + ), + 'case_relationship_type_default_key' => 'Primary Contact', + 'case_relationship_type_dom' => + array ( + '' => '', + 'Primary Contact' => 'Primary Contact', + 'Alternate Contact' => 'Alternate Contact', + ), + 'task_priority_dom' => + array ( + 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', + ), + 'task_status_dom' => + array ( + 'Planned' => 'Planned', + 'Completed' => 'Completed', + 'Deferred' => 'Deferred', + ), + 'meeting_status_dom' => + array ( + 'Planned' => 'Planned', + 'Held' => 'Held', + 'Not Held' => 'Not Held', + ), + 'call_status_dom' => + array ( + 'Planned' => 'Planned', + 'Held' => 'Held', + 'Not Held' => 'Not Held', + ), + 'case_status_default_key' => 'New', + 'case_status_dom' => + array ( + 'New' => 'New', + 'Assigned' => 'Assigned', + 'Closed' => 'Closed', + 'Pending Input' => 'Pending Input', + 'Rejected' => 'Rejected', + ), + 'user_status_dom' => + array ( + 'Active' => 'Active', + 'Inactive' => 'Inactive', + ), + 'record_type_default_key' => 'Accounts', + 'record_type_display' => + array ( + 'Accounts' => 'Account', + 'Leads' => 'Lead', + 'Opportunities' => 'Opportunity', + ), +); ?> From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 06:53:33 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 11:53:33 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9821 - /vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Message-ID: <20061113115334.29446788CB8@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 04:53:20 2006 New Revision: 9821 Log: Removed the Hardcoding in Quick Create labels Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Mon Nov 13 04:53:20 2006 @@ -1821,20 +1821,6 @@ global $mod_strings; - $new_label=Array('Leads'=>'LNK_NEW_LEAD', - 'Accounts'=>'LNK_NEW_ACCOUNT', - 'Calendar'=>'LNK_NEW_TASK', - 'Campaigns'=>'LNK_NEW_CAMPAIGN', - 'Emails'=>'LNK_NEW_EMAIL', - 'Events'=>'LNK_NEW_EVENT', - 'HelpDesk'=>'LNK_NEW_HDESK', - 'Notes'=>'LNK_NEW_NOTE', - 'Potentials'=>'LNK_NEW_OPPORTUNITY', - 'PriceBooks'=>'LNK_NEW_PRICEBOOK', - 'Products'=>'LNK_NEW_PRODUCT', - 'Contacts'=>'LNK_NEW_CONTACT', - 'Vendors'=>'LNK_NEW_VENDOR'); - $qc_query = "select distinct vtiger_tab.tablabel,vtiger_tab.name from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid where quickcreate=0 order by vtiger_tab.tablabel"; $result = $adb->query($qc_query); $noofrows = $adb->num_rows($result); @@ -1844,7 +1830,7 @@ $tablabel = $adb->query_result($result,$i,'tablabel'); $tabname = $adb->query_result($result,$i,'name'); - $tablabel = $new_label[$tabname]; + $tablabel = "SINGLE_$tabname"; if(isPermitted($tabname,'EditView','') == 'yes') { $return_qcmodule[] = $tablabel; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 07:00:03 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 12:00:03 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9822 - /vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl Message-ID: <20061113120003.7AE35788CB8@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 04:59:54 2006 New Revision: 9822 Log: Changes are done for Quick Create Label Modified: vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/Header.tpl Mon Nov 13 04:59:54 2006 @@ -78,14 +78,14 @@ {else} From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 07:03:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 12:03:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9823 - /vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl Message-ID: <20061113120327.D05E4787F27@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 05:03:19 2006 New Revision: 9823 Log: Changes are done for supporting Quick Create for generic module additioon API's Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/QuickCreateHidden.tpl Mon Nov 13 05:03:19 2006 @@ -17,71 +17,12 @@
{/if} -{if $MODULE eq 'Accounts'} +{if $MODULE eq 'Calendar'} + +{elseif $MODULE eq 'Events'} + +{/if} + + - - - - -{elseif $MODULE eq 'Leads'} - - - - - -{elseif $MODULE eq 'Contacts'} - - - - - -{elseif $MODULE eq 'Calendar'} - - - - - -{elseif $MODULE eq 'Events'} - - - - - -{elseif $MODULE eq 'HelpDesk'} - - - - - - - -{elseif $MODULE eq 'Notes'} - - - - -{elseif $MODULE eq 'Potentials'} - - - - -{elseif $MODULE eq 'Campaigns'} - - - - -{elseif $MODULE eq 'PriceBooks'} - - - - -{elseif $MODULE eq 'Vendors'} - - - - - -{/if} - - From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 07:06:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 12:06:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9824 - /vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Message-ID: <20061113120647.68540787FBF@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 05:06:33 2006 New Revision: 9824 Log: Code Changes are done for module addition tool Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/ListViewUtils.php Mon Nov 13 05:06:33 2006 @@ -1594,8 +1594,9 @@ require('user_privileges/user_privileges_'.$current_user->id.'.php'); require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); $tab_id = getTabid($module); - if($module == "HelpDesk") - { + switch($module) + { + Case "HelpDesk": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_troubletickets.title, vtiger_troubletickets.status, vtiger_troubletickets.priority, vtiger_troubletickets.parent_id, @@ -1627,10 +1628,9 @@ $query .= $sec_parameter; } - - } - if($module == "Accounts") - { + break; + + Case "Accounts": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_account.accountname, vtiger_account.email1, @@ -1689,10 +1689,9 @@ WHERE userid=".$current_user->id." AND tabid=".$tab_id.")))) "; } - - } - if ($module == "Potentials") - { + break; + + Case "Potentials": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_account.accountname, @@ -1722,10 +1721,9 @@ $query .= $sec_parameter; } - - } - if($module == "Leads") - { + break; + + Case "Leads": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_leaddetails.firstname, vtiger_leaddetails.lastname, vtiger_leaddetails.company, vtiger_leadaddress.phone, @@ -1753,9 +1751,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Products") - { + break; + Case "Products": $query = "SELECT vtiger_crmentity.crmid, vtiger_products.*, vtiger_productcf.* FROM vtiger_products INNER JOIN vtiger_crmentity @@ -1772,9 +1769,8 @@ OR vtiger_seproductsrel.crmid IN (".getReadEntityIds('Accounts').") OR vtiger_seproductsrel.crmid IN (".getReadEntityIds('Potentials').") OR vtiger_products.contactid IN (".getReadEntityIds('Contacts').")) "; - } - if($module == "Notes") - { + break; + Case "Notes": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.modifiedtime, vtiger_notes.title, vtiger_notes.contact_id, vtiger_notes.filename, vtiger_senotesrel.crmid AS relatedto, @@ -1799,9 +1795,8 @@ OR vtiger_senotesrel.crmid IN (".getReadEntityIds('PurchaseOrder').") OR vtiger_senotesrel.crmid IN (".getReadEntityIds('SalesOrder').") OR vtiger_notes.contact_id IN (".getReadEntityIds('Contacts').")) "; - } - if($module == "Contacts") - { + break; + Case "Contacts": //Query modified to sort by assigned to $query = "SELECT vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_contactdetails.title, vtiger_contactdetails.accountid, @@ -1831,9 +1826,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Calendar") - { + break; + Case "Calendar": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, @@ -1871,9 +1865,8 @@ } //$query .=" group by vtiger_activity.activityid "; //included by Jaguar - } - if($module == "Emails") - { + break; + Case "Emails": $query = "SELECT DISTINCT vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.date_start, @@ -1906,10 +1899,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - - if($module == "Faq") - { + break; + Case "Faq": $query = "SELECT vtiger_crmentity.crmid, vtiger_crmentity.createdtime, vtiger_crmentity.modifiedtime, vtiger_faq.* FROM vtiger_faq @@ -1923,27 +1914,23 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - - } - - if($module == "Vendors") - { + break; + + Case "Vendors": $query = "SELECT vtiger_crmentity.crmid, vtiger_vendor.* FROM vtiger_vendor INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_vendor.vendorid WHERE vtiger_crmentity.deleted = 0"; - } - if($module == "PriceBooks") - { + break; + Case "PriceBooks": $query = "SELECT vtiger_crmentity.crmid, vtiger_pricebook.* FROM vtiger_pricebook INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_pricebook.pricebookid WHERE vtiger_crmentity.deleted = 0"; - } - if($module == "Quotes") - { + break; + Case "Quotes": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.*, vtiger_quotes.*, @@ -1976,9 +1963,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "PurchaseOrder") - { + break; + Case "PurchaseOrder": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.*, vtiger_purchaseorder.*, @@ -2008,9 +1994,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "SalesOrder") - { + break; + Case "SalesOrder": //Query modified to sort by assigned to $query = "SELECT vtiger_crmentity.*, vtiger_salesorder.*, @@ -2043,9 +2028,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Invoice") - { + break; + Case "Invoice": //Query modified to sort by assigned to //query modified -Code contribute by Geoff(http://forums.vtiger.com/viewtopic.php?t=3376) $query = "SELECT vtiger_crmentity.*, @@ -2079,9 +2063,8 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Campaigns") - { + break; + Case "Campaigns": //Query modified to sort by assigned to //query modified -Code contribute by Geoff(http://forums.vtiger.com/viewtopic.php?t=3376) $query = "SELECT vtiger_crmentity.*, @@ -2103,12 +2086,14 @@ $sec_parameter=getListViewSecurityParameter($module); $query .= $sec_parameter; } - } - if($module == "Users") - { + break; + Case "Users": $query = "select id,user_name,roleid,first_name,last_name,email1,phone_mobile,phone_work,is_admin,status from vtiger_users inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where deleted=0 ".$where ; - } - + break; + default: + $focus = new $module(); + $query = $focus->getListQuery($module); + } $log->debug("Exiting getListQuery method ..."); return $query; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 07:23:46 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 12:23:46 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9825 - /vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php Message-ID: <20061113122346.91D2E7893A1@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 05:23:32 2006 New Revision: 9825 Log: Changes done for the generic module addition --By Don Modified: vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php Modified: vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php (original) +++ vtigercrm/branches/5.0.3/modules/Home/UnifiedSearch.php Mon Nov 13 05:23:32 2006 @@ -76,7 +76,9 @@ $oCustomView = ''; $oCustomView = new CustomView($module); - + $viewid = $oCustomView->getViewId($module); + $oCustomView->getCvColumnListSQL($viewid); + if($search_module != '')//This is for Tag search { @@ -93,7 +95,7 @@ if($where != '') $listquery .= ' and ('.$where.')'; - + $list_result = $adb->query($listquery); $noofrows = $adb->num_rows($list_result); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 08:02:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 13:02:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9826 - in /vtigercrm/branches/5.0.3/modules: Calendar/OpenListView.php Home/index.php Message-ID: <20061113130230.EDE87787F27@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 06:02:24 2006 New Revision: 9826 Log: Mail content problem for invitees in calendar module - Fixes #2450 Modified: vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php vtigercrm/branches/5.0.3/modules/Home/index.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/OpenListView.php Mon Nov 13 06:02:24 2006 @@ -25,15 +25,18 @@ * @param integer $mode - number to differentiate upcoming and pending activities * return array $values - activities record in array format */ -function getPendingActivities($mode) +function getPendingActivities($mode,$view='') { global $log; $log->debug("Entering getPendingActivities() method ..."); require_once("data/Tracker.php"); require_once("include/utils/utils.php"); + require_once('include/utils/CommonUtils.php'); //new + require_once('user_privileges/default_module_view.php'); + global $currentModule; - + global $singlepane_view; global $theme; global $focus; global $action; @@ -46,6 +49,8 @@ $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; require_once($theme_path.'layout_utils.php'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); //code added to customize upcomming and pending activities if($_REQUEST['activity_view']=='') { @@ -56,12 +61,12 @@ $today = date("Y-m-d", time()); - if($activity_view == 'today') + if($view == 'today') { $upcoming_condition = " AND (date_start = '$today' OR vtiger_recurringevents.recurringdate = '$today')"; $pending_condition = " AND (due_date = '$today' OR vtiger_recurringevents.recurringdate = '$today')"; } - else if($activity_view == 'all') + else if($view == 'all') { $upcoming_condition = " AND (date_start >= '$today' OR vtiger_recurringevents.recurringdate >= '$today')"; $pending_condition = " AND (due_date <= '$today' OR vtiger_recurringevents.recurringdate <= '$today')"; @@ -69,13 +74,26 @@ if($mode != 1) { //for upcoming avtivities - $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$upcoming_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid LEFT JOIN vtiger_activitygrouprelation ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$upcoming_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[9] == 3) + { + $sec_parameter=getListViewSecurityParameter('Calendar'); + $list_query .= $sec_parameter; + + } + } else { //for pending activities - $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$pending_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; - } + $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid LEFT JOIN vtiger_activitygrouprelation ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$pending_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[9] == 3) + { + $sec_parameter=getListViewSecurityParameter('Calendar'); + $list_query .= $sec_parameter; + } + } + $list_query.= " ORDER BY due_date ASC"; $res = $adb->query($list_query); $noofrecords = $adb->num_rows($res); @@ -106,7 +124,7 @@ } $title=array(); - $title[]=$activity_view; + $title[]=$view; $title[]='myUpcoPendAct.gif'; $title[]='home_myact'; //$title[]=getActivityView($activity_view); Modified: vtigercrm/branches/5.0.3/modules/Home/index.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Home/index.php (original) +++ vtigercrm/branches/5.0.3/modules/Home/index.php Mon Nov 13 06:02:24 2006 @@ -67,8 +67,10 @@ { $activities = Array(); include("modules/Calendar/OpenListView.php") ; - $activities[] = getPendingActivities(0); - $activities[] = getPendingActivities(1); + $activities[] = getPendingActivities(0,"today"); + $activities[] = getPendingActivities(0,"all"); + $activities[] = getPendingActivities(1,"today"); + $activities[] = getPendingActivities(1,"all"); } break; case 'ALVT': @@ -176,6 +178,7 @@ $current_module_strings = return_module_language($current_language, 'Calendar'); $t=Date("Ymd"); +//echo '
';print_r($activities); echo '
'; $buttoncheck['Calendar'] = isPermitted('Calendar','index'); $smarty->assign("CHECK",$buttoncheck); $smarty->assign("IMAGE_PATH",$image_path); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 10:22:11 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 15:22:11 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9827 - /vtigercrm/branches/5.0.3/themes/bluelagoon/style.css Message-ID: <20061113152211.2C7DC7893B5@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 08:22:06 2006 New Revision: 9827 Log: * Changed the height for the mail - Mickie Modified: vtigercrm/branches/5.0.3/themes/bluelagoon/style.css Modified: vtigercrm/branches/5.0.3/themes/bluelagoon/style.css ============================================================================== --- vtigercrm/branches/5.0.3/themes/bluelagoon/style.css (original) +++ vtigercrm/branches/5.0.3/themes/bluelagoon/style.css Mon Nov 13 08:22:06 2006 @@ -817,7 +817,7 @@ font-size:12px; background-color:#FFFFFF; width:100%; - height:130px; + height:200px; overflow:auto; border:0px solid #000000; } From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 13 10:24:45 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 13 Nov 2006 15:24:45 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9828 - in /vtigercrm/branches/5.0.3: Smarty/templates/Webmails.tpl modules/Webmails/Webmail.php Message-ID: <20061113152445.B54BD7893B5@vtiger.fosslabs.com> Author: richie Date: Mon Nov 13 08:24:22 2006 New Revision: 9828 Log: Formatted Modified: vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php Modified: vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/Webmails.tpl Mon Nov 13 08:24:22 2006 @@ -12,178 +12,208 @@ {include file='Buttons_List1.tpl'} - - - - - - + + + + + + + + + + + + +
  -  
- +
  
+ + + + + + + + + + - - + + +   + +
+ + + + + + + + + + + + + - - - - - - - -
+ + + + + + + + + +
+ +  {$MOD.LBL_CHK_MAIL} + + +  {$MOD.LBL_COMPOSE} + + +  {$MOD.LBL_SETTINGS} + + +  {$MOD.LBL_SHOW_HIDDEN} + + +  {$MOD.LBL_EXPUNGE_MAILBOX} +
+
{$MOD.LBL_EMAIL_FOLDERS}  {$ACCOUNT} > {$MAILBOX} {$NAVIGATION}
+  {$MOD.LBL_MY_MAILS}   + +
    + + {foreach item=row from=$BOXLIST} + {foreach item=row_values from=$row} + {$row_values} + {/foreach} + {/foreach} +

+ +  {$MOD.LBL_SENT_MAILS} +
+  {$MOD.LBL_TRASH} + + +
  + + - - - - - - - - + + + + - - - - - - - - - - - + + + + + + + - - - - + + + + - -
- - - - - - - - - - - - - - - - + + {if $DEGRADED_SERVICE eq 'false'} + + + {/if} + +
- - - - - - - - - -
- -  {$MOD.LBL_CHK_MAIL} - - -  {$MOD.LBL_COMPOSE} - - -  {$MOD.LBL_SETTINGS} - - -  {$MOD.LBL_SHOW_HIDDEN} - - -  {$MOD.LBL_EXPUNGE_MAILBOX} -
-
{$MOD.LBL_EMAIL_FOLDERS}  {$ACCOUNT} > {$MAILBOX} {$NAVIGATION}
-  {$MOD.LBL_MY_MAILS}   - -
    - - {foreach item=row from=$BOXLIST} - {foreach item=row_values from=$row} - {$row_values} - {/foreach} - {/foreach} -

- -  {$MOD.LBL_SENT_MAILS} -
-  {$MOD.LBL_TRASH} - - -
  - - - {if $DEGRADED_SERVICE eq 'false'} - - {/if} - -
- - {$FOLDER_SELECT} - - {$APP.LBL_SEARCH}   -   - -
  +
+ + {$FOLDER_SELECT} + + {$APP.LBL_SEARCH}  +   +   + + +
+ + +
 
- - - - {foreach item=element from=$LISTHEADER} - {$element} - {/foreach} - - {foreach item=row from=$LISTENTITY} - {foreach item=row_values from=$row} - {$row_values} - {/foreach} - {/foreach} -
-
-
 
 
-

-
 
+
+
+ +   + + - - - - - - - - - - -
  - - {include file='DetailViewHidden.tpl'} -
- - - - - - - - -
- - - - -
- [ {$ID} ] {$NAME} - {$SINGLE_MOD} {$APP.LBL_INFORMATION}    -
{$UPDATEINFO}
-
- - - - -
- - - - - -
- - - - - - - - - - -
- - - - - - -
- {if $EDIT_DUPLICATE eq 'permitted'} -   - {/if} - - {if $EDIT_DUPLICATE eq 'permitted'} -   - {/if} - {if $DELETE eq 'permitted'} -   - {/if} - -
- {foreach key=header item=detail from=$BLOCKS} - - {strip} - {/strip} - -
- {$header} -
- {/foreach} - {if $ACTIVITYDATA.activitytype neq 'Task'} - - - - {if $LABEL.activitytype neq ''} - - - {/if} - {if $LABEL.visibility neq ''} - - - {/if} - - - - - - {if $LABEL.description neq ''} - - - - - {/if} - - {if $LABEL.eventstatus neq ''} - - - {/if} - {if $LABEL.assigned_user_id neq ''} - - - {/if} - - - {if $LABEL.taskpriority neq ''} - - - {/if} - {if $LABEL.sendnotification neq ''} - - - {/if} - - - - - - - -
{$MOD.LBL_EVENTTYPE}{$ACTIVITYDATA.activitytype}{$LABEL.visibility}{$ACTIVITYDATA.visibility}
{$MOD.LBL_EVENTNAME}{$ACTIVITYDATA.subject}
{$LABEL.description}{$ACTIVITYDATA.description}
{$LABEL.eventstatus}{$ACTIVITYDATA.eventstatus}{$LABEL.assigned_user_id}{$ACTIVITYDATA.assigned_user_id}
{$LABEL.taskpriority}{$ACTIVITYDATA.taskpriority}{$LABEL.sendnotification}{$ACTIVITYDATA.sendnotification}
{if $LABEL.createdtime neq ''}{$LABEL.createdtime}{/if}{if $LABEL.createdtime neq ''}{$ACTIVITYDATA.createdtime}{/if}{if $LABEL.modifiedtime neq ''}{$LABEL.modifiedtime}{/if}{if $LABEL.modifiedtime neq ''}{$ACTIVITYDATA.modifiedtime}{/if}
- - - -
- - - - -
{$MOD.LBL_EVENTSTAT}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
- - - - -
{$MOD.LBL_EVENTEDAT}
{$ACTIVITYDATA.endhr}:{$ACTIVITYDATA.endmin}{$ACTIVITYDATA.endfmt}
{$ACTIVITYDATA.due_date}
-
-
- - - - - - - - -
- - - - - - - - - - - - -
 {$MOD.LBL_INVITE} {$MOD.LBL_REMINDER} {$MOD.LBL_REPEAT} {$MOD.LBL_LIST_RELATED_TO} 
-
- -
- - - - - -
{$MOD.LBL_USERS} - {foreach item=username key=userid from=$INVITEDUSERS} - {$username.3}
- {/foreach} -
-
- - - - - - -
- {else} - - - - - - - {if $LABEL.description neq ''} - - - - - {/if} - - - -
{$MOD.LBL_TODO}{$ACTIVITYDATA.subject}
{$LABEL.description}{$ACTIVITYDATA.description}
- - - - - - - - - - - -
{if $LABEL.taskstatus neq ''}{$LABEL.taskstatus}{/if}{if $LABEL.taskpriority neq ''}{$LABEL.taskpriority}{/if}{if $LABEL.assigned_user_id neq ''}{$LABEL.assigned_user_id}{/if}
{if $LABEL.taskstatus neq ''}{$ACTIVITYDATA.taskstatus}{/if}{if $LABEL.taskpriority neq ''}{$ACTIVITYDATA.taskpriority}{/if}{if $LABEL.taskpriority neq ''}{$ACTIVITYDATA.assigned_user_id}{/if}
-
- - - -
- - - - -
{$MOD.LBL_TIMEDATE}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
-
- - - - -
{$LABEL.due_date}
{$ACTIVITYDATA.due_date}
 
-
- - - - - - - -
{if $LABEL.createdtime neq ''}{$LABEL.createdtime}{/if}{if $LABEL.createdtime neq ''}{$ACTIVITYDATA.createdtime}{/if}{if $LABEL.modifiedtime neq ''}{$LABEL.modifiedtime}{/if}{if $LABEL.modifiedtime neq ''}{$ACTIVITYDATA.modifiedtime}{/if}
-
- - - - - - - -
- - - - - - - - -
 {$MOD.LBL_NOTIFICATION}  - {$MOD.LBL_RELATEDTO} 
-
- -
- {if $LABEL.sendnotification neq ''} - - - - - -
{$MOD.LBL_SENDNOTIFICATION}{$ACTIVITYDATA.sendnotification}
- {/if} -
- -
- {/if} - -
- - {strip} - - - {/strip} -
- {if $EDIT_DUPLICATE eq 'permitted'} -   - {/if} - - {if $EDIT_DUPLICATE eq 'permitted'} -   - {/if} - {if $DELETE eq 'permitted'} -   - {/if} - -
-
-
- - - - - - - -
-
- - - - - - - - - -
{$ALL_TAG}
- - -
- {if $MERGEBUTTON eq 'permitted'} - - - - - - - -
{$WORDTEMPLATEOPTIONS}
- - -
- {/if} -
- - - - - - -
- -{if $MODULE eq 'Products'} - - -{/if} - - - - -
-
- - - - - - - - - - - +{**} + + + + + + + + + + + +
  + + {include file='DetailViewHidden.tpl'} +
+ + + + + + + + +
+ + + + +
+ [ {$ID} ] {$NAME} - {$SINGLE_MOD} {$APP.LBL_INFORMATION}    +
{$UPDATEINFO}
+
+ + + + +
+ + + + + +
+ + + + + + + + + + +
+ + + + + + +
+ {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + + {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + {if $DELETE eq 'permitted'} +   + {/if} + +
+ {foreach key=header item=detail from=$BLOCKS} + + {strip} + {/strip} + +
+ {$header} +
+ {/foreach} + {if $ACTIVITYDATA.activitytype neq 'Task'} + + + + {if $LABEL.activitytype neq ''} + + + {/if} + {if $LABEL.visibility neq ''} + + + {/if} + + + + + + {if $LABEL.description neq ''} + + + + + {/if} + + {if $LABEL.eventstatus neq ''} + + + {/if} + {if $LABEL.assigned_user_id neq ''} + + + {/if} + + + {if $LABEL.taskpriority neq ''} + + + {/if} + {if $LABEL.sendnotification neq ''} + + + {/if} + + + + + + + +
{$MOD.LBL_EVENTTYPE}{$ACTIVITYDATA.activitytype}{$LABEL.visibility}{$ACTIVITYDATA.visibility}
{$MOD.LBL_EVENTNAME}{$ACTIVITYDATA.subject}
{$LABEL.description}{$ACTIVITYDATA.description}
{$LABEL.eventstatus}{$ACTIVITYDATA.eventstatus}{$LABEL.assigned_user_id}{$ACTIVITYDATA.assigned_user_id}
{$LABEL.taskpriority}{$ACTIVITYDATA.taskpriority}{$LABEL.sendnotification}{$ACTIVITYDATA.sendnotification}
{if $LABEL.createdtime neq ''}{$LABEL.createdtime}{/if}{if $LABEL.createdtime neq ''}{$ACTIVITYDATA.createdtime}{/if}{if $LABEL.modifiedtime neq ''}{$LABEL.modifiedtime}{/if}{if $LABEL.modifiedtime neq ''}{$ACTIVITYDATA.modifiedtime}{/if}
+ + + +
+ + + + +
{$MOD.LBL_EVENTSTAT}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
+ + + + +
{$MOD.LBL_EVENTEDAT}
{$ACTIVITYDATA.endhr}:{$ACTIVITYDATA.endmin}{$ACTIVITYDATA.endfmt}
{$ACTIVITYDATA.due_date}
+
+
+ + + + + + + + +
+ + + + + + + + + + + + +
 {$MOD.LBL_INVITE} {$MOD.LBL_REMINDER} {$MOD.LBL_REPEAT} {$MOD.LBL_LIST_RELATED_TO} 
+
+ +
+ + + + + +
{$MOD.LBL_USERS} + {foreach item=username key=userid from=$INVITEDUSERS} + {$username.3}
+ {/foreach} +
+
+ + + + + + +
+ {else} + + + + + + + {if $LABEL.description neq ''} + + + + + {/if} + + + +
{$MOD.LBL_TODO}{$ACTIVITYDATA.subject}
{$LABEL.description}{$ACTIVITYDATA.description}
+ + + + + + + + + + + +
{if $LABEL.taskstatus neq ''}{$LABEL.taskstatus}{/if}{if $LABEL.taskpriority neq ''}{$LABEL.taskpriority}{/if}{if $LABEL.assigned_user_id neq ''}{$LABEL.assigned_user_id}{/if}
{if $LABEL.taskstatus neq ''}{$ACTIVITYDATA.taskstatus}{/if}{if $LABEL.taskpriority neq ''}{$ACTIVITYDATA.taskpriority}{/if}{if $LABEL.taskpriority neq ''}{$ACTIVITYDATA.assigned_user_id}{/if}
+
+ + + +
+ + + + +
{$MOD.LBL_TIMEDATE}
{$ACTIVITYDATA.starthr}:{$ACTIVITYDATA.startmin}{$ACTIVITYDATA.startfmt}
{$ACTIVITYDATA.date_start}
+
+ + + + +
{$LABEL.due_date}
{$ACTIVITYDATA.due_date}
 
+
+ + + + + + + +
{if $LABEL.createdtime neq ''}{$LABEL.createdtime}{/if}{if $LABEL.createdtime neq ''}{$ACTIVITYDATA.createdtime}{/if}{if $LABEL.modifiedtime neq ''}{$LABEL.modifiedtime}{/if}{if $LABEL.modifiedtime neq ''}{$ACTIVITYDATA.modifiedtime}{/if}
+
+ + + + + + + +
+ + + + + + + + +
 {$MOD.LBL_NOTIFICATION}  + {$MOD.LBL_RELATEDTO} 
+
+ +
+ {if $LABEL.sendnotification neq ''} + + + + + +
{$MOD.LBL_SENDNOTIFICATION}{$ACTIVITYDATA.sendnotification}
+ {/if} +
+ +
+ {/if} + +
+ + {strip} + + + {/strip} +
+ {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + + {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + {if $DELETE eq 'permitted'} +   + {/if} + +
+
+
+ + + + + + + + + + + + + +
  
{$ALL_TAG}
+ + +
+ {if $MERGEBUTTON eq 'permitted'} + + + + + + + +
{$WORDTEMPLATEOPTIONS}
+ + +
+ {/if} +
+ + + + + + +
+ +{if $MODULE eq 'Products'} + + +{/if} + + + + +
+
+ + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ActivityEditView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ActivityEditView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ActivityEditView.tpl Tue Nov 14 03:16:10 2006 @@ -1,868 +1,868 @@ -{**} - -{**} - - - - - - - - -{**} - - - - -
- - {include file='EditViewHidden.tpl'} -
- - - - - -
- - - -
- - {if $OP_MODE eq 'edit_view'} - [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$SINGLE_MOD} {$APP.LBL_INFORMATION}
- {$UPDATEINFO} - {/if} - {if $OP_MODE eq 'create_view'} - {$APP.LBL_CREATING} {$SINGLE_MOD}
- {/if} -
-
- - -
- - -
- - - - - - - -
- - - - - -
-
- - -
-
- - {foreach key=header item=data from=$BLOCKS} - - - - -
- {$header} -
- {/foreach} - {if $ACTIVITY_MODE neq 'Task'} - - - - - - {if $LABEL.activitytype neq ''} - - - - - {/if} - - - - - {if $LABEL.description neq ''} - - - - - {/if} - - -
{$MOD.LBL_EVENTTYPE} - - - {foreach key=tyeparrkey item=typearr from=$ACTIVITYDATA.activitytype} - {foreach key=sel_value item=value from=$typearr} - {if $value eq 'selected' && $sel_value eq 'Meeting'} - {assign var='meetcheck' value='checked'} - {assign var='callcheck' value=''} - {else} - {assign var='meetcheck' value=''} - {assign var='callcheck' value='checked'} - {/if} - {/foreach} - {/foreach} - -
{$APP.Call} - {$APP.Meeting} -
-
{$MOD.LBL_EVENTNAME}    - {if $LABEL.visibility neq ''} - {foreach key=key_one item=arr from=$ACTIVITYDATA.visibility} - {foreach key=sel_value item=value from=$arr} - {if $value eq 'selected' && $sel_value eq 'Public'} - {assign var="visiblecheck" value="checked"} - {else} - {assign var="visiblecheck" value=""} - {/if} - {/foreach} - {/foreach} - {$MOD.LBL_PUBLIC} - {/if} -
{$LABEL.description}
- - - - - - - - - - {if $LABEL.taskpriority neq ''} - - - - - {/if} -
{if $LABEL.eventstatus neq ''}{$LABEL.eventstatus}{/if}{if $LABEL.assigned_user_id != ''} - {$LABEL.assigned_user_id} - {/if}
- {if $LABEL.eventstatus neq ''} - - {/if} - - {if $ACTIVITYDATA.assigned_user_id != ''} - {assign var=check value=1} - {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} - {foreach key=sel_value item=value from=$arr} - {if $value ne ''} - {assign var=check value=$check*0} - {else} - {assign var=check value=$check*1} - {/if} - {/foreach} - {/foreach} - - {if $check eq 0} - {assign var=select_user value='checked'} - {assign var=style_user value='display:block'} - {assign var=style_group value='display:none'} - {else} - {assign var=select_group value='checked'} - {assign var=style_user value='display:none'} - {assign var=style_group value='display:block'} - {/if} -  {$APP.LBL_USER} - {if $secondvalue.assigned_user_id neq ''} -  {$APP.LBL_GROUP} - {/if} - - - - - {if $secondvalue.assigned_user_id neq ''} - - - - {/if} - {else} - - {/if} -
{if $LABEL.sendnotification neq ''} {$LABEL.sendnotification}{/if} -
{$LABEL.taskpriority} -
- -
-
-
- - - - -
- - - - -
- - - - -
{$MOD.LBL_EVENTSTAT}
{$STARTHOUR}
- {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.date_start} - {assign var=date_vl value="$date_fmt"} - {/foreach} - -
- - - - -
{$MOD.LBL_EVENTEDAT}
{$ENDHOUR} -
- {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.due_date} - {assign var=date_vl value="$date_fmt"} - {/foreach} - -
-
-
- - - - - -
- - - - - - - - - - - - -
 {$MOD.LBL_INVITE} {$MOD.LBL_REMINDER} {$MOD.LBL_REPEAT} {$MOD.LBL_RELATEDTO} 
-
- -
- - - - -
- - - - - - - - - - - - -
-
    -
  • {$MOD.LBL_INVITE_INST1} -
  • {$MOD.LBL_INVITE_INST2} -
-
{$MOD.LBL_AVL_USERS} {$MOD.LBL_SEL_USERS}
- - -
- -
- -
{$MOD.LBL_SELUSR_INFO} -
-
-
-
- - - - - -
- - {else} - - - - - - - - {if $LABEL.description != ''} - - - - - -
{$MOD.LBL_TODO}
{$LABEL.description} - {/if} - -
- - - {if $LABEL.taskstatus != ''} - - {/if} - {if $LABEL.taskpriority != ''} - - {/if} - {if $LABEL.assigned_user_id != ''} - - {/if} - - - {if $LABEL.taskstatus != ''} - - {/if} - {if $LABEL.taskpriority != ''} - - {/if} - {if $LABEL.assigned_user_id != ''} - - {else} - - {/if} - -
{$LABEL.taskstatus}{$LABEL.taskpriority}{$LABEL.assigned_user_id}
- - - - - {assign var=check value=1} - {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} - {foreach key=sel_value item=value from=$arr} - {if $value ne ''} - {assign var=check value=$check*0} - {else} - {assign var=check value=$check*1} - {/if} - {/foreach} - {/foreach} - {if $check eq 0} - {assign var=select_user value='checked'} - {assign var=style_user value='display:block'} - {assign var=style_group value='display:none'} - {else} - {assign var=select_group value='checked'} - {assign var=style_user value='display:none'} - {assign var=style_group value='display:block'} - {/if} -  User - {if $secondvalue.assigned_user_id neq ''} -  Group - {/if} - - - - {if $secondvalue.assigned_user_id neq ''} - - - - {/if} -
-
- - - - -
- - - - -
{$MOD.LBL_TODODATETIME}
{$STARTHOUR}
- {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.date_start} - {assign var=date_vl value="$date_fmt"} - {/foreach} - -
- - - -
{$LABEL.due_date}
- {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - Set date.. - {foreach key=date_fmt item=date_str from=$secondvalue.due_date} - {assign var=date_vl value="$date_fmt"} - {/foreach} - -
-

- - - - - -
- - - - - - - -
 {$MOD.LBL_NOTIFICATION}  - {$MOD.LBL_RELATEDTO} -
-
- -
- {if $LABEL.sendnotification != ''} - - - {if $ACTIVITYDATA.sendnotification eq 1} - - {else} - - {/if} - -
{$LABEL.sendnotification} - - - -
- {/if} -
- -
- - {/if} -
-
- - -
-
-
-
-
-
- - - - - - - - - - - - - - - - +{**} + +{**} + + + + + + + + +{**} + + + + +
+ + {include file='EditViewHidden.tpl'} +
+ + + + + +
+ + + +
+ + {if $OP_MODE eq 'edit_view'} + [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$SINGLE_MOD} {$APP.LBL_INFORMATION}
+ {$UPDATEINFO} + {/if} + {if $OP_MODE eq 'create_view'} + {$APP.LBL_CREATING} {$SINGLE_MOD}
+ {/if} +
+
+ + +
+ + +
+ + + + + + + +
+ + + + + +
+
+ + +
+
+ + {foreach key=header item=data from=$BLOCKS} + + + + +
+ {$header} +
+ {/foreach} + {if $ACTIVITY_MODE neq 'Task'} + + + + + + {if $LABEL.activitytype neq ''} + + + + + {/if} + + + + + {if $LABEL.description neq ''} + + + + + {/if} + + +
{$MOD.LBL_EVENTTYPE} + + + {foreach key=tyeparrkey item=typearr from=$ACTIVITYDATA.activitytype} + {foreach key=sel_value item=value from=$typearr} + {if $value eq 'selected' && $sel_value eq 'Meeting'} + {assign var='meetcheck' value='checked'} + {assign var='callcheck' value=''} + {else} + {assign var='meetcheck' value=''} + {assign var='callcheck' value='checked'} + {/if} + {/foreach} + {/foreach} + +
{$APP.Call} + {$APP.Meeting} +
+
{$MOD.LBL_EVENTNAME}    + {if $LABEL.visibility neq ''} + {foreach key=key_one item=arr from=$ACTIVITYDATA.visibility} + {foreach key=sel_value item=value from=$arr} + {if $value eq 'selected' && $sel_value eq 'Public'} + {assign var="visiblecheck" value="checked"} + {else} + {assign var="visiblecheck" value=""} + {/if} + {/foreach} + {/foreach} + {$MOD.LBL_PUBLIC} + {/if} +
{$LABEL.description}
+ + + + + + + + + + {if $LABEL.taskpriority neq ''} + + + + + {/if} +
{if $LABEL.eventstatus neq ''}{$LABEL.eventstatus}{/if}{if $LABEL.assigned_user_id != ''} + {$LABEL.assigned_user_id} + {/if}
+ {if $LABEL.eventstatus neq ''} + + {/if} + + {if $ACTIVITYDATA.assigned_user_id != ''} + {assign var=check value=1} + {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} +  {$APP.LBL_USER} + {if $secondvalue.assigned_user_id neq ''} +  {$APP.LBL_GROUP} + {/if} + + + + + {if $secondvalue.assigned_user_id neq ''} + + + + {/if} + {else} + + {/if} +
{if $LABEL.sendnotification neq ''} {$LABEL.sendnotification}{/if} +
{$LABEL.taskpriority} +
+ +
+
+
+ + + + +
+ + + + +
+ + + + +
{$MOD.LBL_EVENTSTAT}
{$STARTHOUR}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.date_start} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+ + + + +
{$MOD.LBL_EVENTEDAT}
{$ENDHOUR} +
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.due_date} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+
+
+ + + + + +
+ + + + + + + + + + + + +
 {$MOD.LBL_INVITE} {$MOD.LBL_REMINDER} {$MOD.LBL_REPEAT} {$MOD.LBL_RELATEDTO} 
+
+ +
+ + + + +
+ + + + + + + + + + + + +
+
    +
  • {$MOD.LBL_INVITE_INST1} +
  • {$MOD.LBL_INVITE_INST2} +
+
{$MOD.LBL_AVL_USERS} {$MOD.LBL_SEL_USERS}
+ + +
+ +
+ +
{$MOD.LBL_SELUSR_INFO} +
+
+
+
+ + + + + +
+ + {else} + + + + + + + + {if $LABEL.description != ''} + + + + + +
{$MOD.LBL_TODO}
{$LABEL.description} + {/if} + +
+ + + {if $LABEL.taskstatus != ''} + + {/if} + {if $LABEL.taskpriority != ''} + + {/if} + {if $LABEL.assigned_user_id != ''} + + {/if} + + + {if $LABEL.taskstatus != ''} + + {/if} + {if $LABEL.taskpriority != ''} + + {/if} + {if $LABEL.assigned_user_id != ''} + + {else} + + {/if} + +
{$LABEL.taskstatus}{$LABEL.taskpriority}{$LABEL.assigned_user_id}
+ + + + + {assign var=check value=1} + {foreach key=key_one item=arr from=$ACTIVITYDATA.assigned_user_id} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} +  {$APP.LBL_USER} + {if $secondvalue.assigned_user_id neq ''} +  {$APP.LBL_GROUP} + {/if} + + + + {if $secondvalue.assigned_user_id neq ''} + + + + {/if} +
+
+ + + + +
+ + + + +
{$MOD.LBL_TODODATETIME}
{$STARTHOUR}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.date_start} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.date_start} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+ + + +
{$LABEL.due_date}
+ {foreach key=date_value item=time_value from=$ACTIVITYDATA.due_date} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + Set date.. + {foreach key=date_fmt item=date_str from=$secondvalue.due_date} + {assign var=date_vl value="$date_fmt"} + {/foreach} + +
+

+ + + + + +
+ + + + + + + + + +
 {$MOD.LBL_NOTIFICATION} {$MOD.LBL_RELATEDTO} 
+
+ +
+ {if $LABEL.sendnotification != ''} + + + {if $ACTIVITYDATA.sendnotification eq 1} + + {else} + + {/if} + +
{$LABEL.sendnotification} + + + +
+ {/if} +
+ +
+ + {/if} +
+
+ + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ActivityListView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ActivityListView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ActivityListView.tpl Tue Nov 14 03:16:10 2006 @@ -1,486 +1,518 @@ -{**} - -{**} - - - - - - - {include file='Buttons_List.tpl'} - - - - - - - - -{**} -
- - - - - - - -
- - - - - -{**} - - -
- - - - - -
- - - - - - - - -
 {$APP.Calendar} {$MOD.LBL_ALL_EVENTS_TODOS} 
-
- - -
- - - -
- - -
-
- - - - - - - - - -
- - - - - - - -
- {foreach key=button_check item=button_label from=$BUTTONS} - {if $button_check eq 'del'} - - {elseif $button_check eq 's_mail'} - - {elseif $button_check eq 's_cmail'} - - {elseif $button_check eq 'c_status'} - - {elseif $button_check eq 'c_owner'} - {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} - - {/if} - {/if} - - {/foreach} - {$RECORD_COUNTS} - - {$NAVIGATION} -
-
- - - - - {if $ALL eq 'All'} - - {else} - - {/if} - -
{$APP.LBL_VIEW} - {$APP.LNK_CV_CREATEVIEW} - | - {$APP.LNK_CV_EDIT} - | - {$APP.LNK_CV_DELETE}{$APP.LNK_CV_CREATEVIEW} - | - {$APP.LNK_CV_EDIT} - | - {$APP.LNK_CV_DELETE}
-
-
- - - - {foreach name="listviewforeach" item=header from=$LISTHEADER} - - {/foreach} - - {foreach item=entity key=entity_id from=$LISTENTITY} - - - {foreach item=data from=$entity} - - {/foreach} - - {foreachelse} - - {/foreach} -
{$header}
{$data}
-
- {assign var=vowel_conf value='LBL_A'} - {assign var=MODULE_CREATE value=$SINGLE_MOD} - - {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} - - - - - - - - - -
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_CAN_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE} {$APP.LBL_NOW}. {$APP.LBL_CLICK_THE_LINK}:
- {if $MODULE neq 'Calendar'} -   -{$APP.LBL_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
- {else} -   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Meeting}
-   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Call}
-   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Todo} - {/if} -
- {else} - - - - - - - - -
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
-
- {/if} -
-
-
- - - - - - - -
- {foreach key=button_check item=button_label from=$BUTTONS} - {if $button_check eq 'del'} - - {elseif $button_check eq 's_mail'} - - {elseif $button_check eq 's_cmail'} - - {elseif $button_check eq 'c_status'} - - {elseif $button_check eq 'c_owner'} - {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} - - {/if} - {/if} - - {/foreach} - {$RECORD_COUNTS} - - {$NAVIGATION} -
-
- - - {$WORDTEMPLATEOPTIONS}{$MERGEBUTTON} - -
-
-
- -
-{$SELECT_SCRIPT} -
-
-
-
-
- -
- - -
- - - - - - - - - - - - - - - - - - -
{$APP.LBL_CHANGE_OWNER} {$APP.LBL_CLOSE}
 
{$APP.LBL_TRANSFER_OWNERSHIP}: - -
 
-    - - -
-
- - - -{/literal} - +{**} + +{**} + + + + + + + {include file='Buttons_List.tpl'} + + + + + + + + +{**} +
+ + + + + + + +
+ + + + + +{**} + + +
+ + + + + +
+ + + + + + + + +
 {$APP.Calendar} {$MOD.LBL_ALL_EVENTS_TODOS} 
+
+ + +
+ + + +
+ + +
+
+ + + + + + + + + +
+ + + + + + + +
+ {foreach key=button_check item=button_label from=$BUTTONS} + {if $button_check eq 'del'} + + {elseif $button_check eq 's_mail'} + + {elseif $button_check eq 's_cmail'} + + {elseif $button_check eq 'c_status'} + + {elseif $button_check eq 'c_owner'} + {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} + + {/if} + {/if} + + {/foreach} + {$RECORD_COUNTS} + + {$NAVIGATION} +
+
+ + + + + {if $ALL eq 'All'} + + {else} + + {/if} + +
{$APP.LBL_VIEW} + {$APP.LNK_CV_CREATEVIEW} + | + {$APP.LNK_CV_EDIT} + | + {$APP.LNK_CV_DELETE}{$APP.LNK_CV_CREATEVIEW} + | + {$APP.LNK_CV_EDIT} + | + {$APP.LNK_CV_DELETE}
+
+
+ + + + {foreach name="listviewforeach" item=header from=$LISTHEADER} + + {/foreach} + + {foreach item=entity key=entity_id from=$LISTENTITY} + + + {foreach item=data from=$entity} + + {/foreach} + + {foreachelse} + + {/foreach} +
{$header}
{$data}
+
+ {assign var=vowel_conf value='LBL_A'} + {assign var=MODULE_CREATE value=$SINGLE_MOD} + + {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} + + + + + + + + + +
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_CAN_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE} {$APP.LBL_NOW}. {$APP.LBL_CLICK_THE_LINK}:
+ {if $MODULE neq 'Calendar'} +   -{$APP.LBL_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
+ {else} +   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Meeting}
+   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Call}
+   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Todo} + {/if} +
+ {else} + + + + + + + + +
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
+
+ {/if} +
+
+
+ + + + + + + +
+ {foreach key=button_check item=button_label from=$BUTTONS} + {if $button_check eq 'del'} + + {elseif $button_check eq 's_mail'} + + {elseif $button_check eq 's_cmail'} + + {elseif $button_check eq 'c_status'} + + {elseif $button_check eq 'c_owner'} + {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} + + {/if} + {/if} + + {/foreach} + {$RECORD_COUNTS} + + {$NAVIGATION} +
+
+ + + {$WORDTEMPLATEOPTIONS}{$MERGEBUTTON} + +
+
+
+ +
+{$SELECT_SCRIPT} +
+
+
+
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + +
{$APP.LBL_CHANGE_OWNER} {$APP.LBL_CLOSE}
 
{$APP.LBL_TRANSFER_OWNERSHIP}: +
+ {$APP.LBL_USER}  + {$APP.LBL_GROUP}
+ + +
+
 
+    + + +
+
+ + + +{/literal} + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/AddMailAccount.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/AddMailAccount.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/AddMailAccount.tpl Tue Nov 14 03:16:10 2006 @@ -1,168 +1,168 @@ -{**} - - - - - - - - -
-
- {$MOD.LBL_MY_MAIL_SERVER_DET}
-

- -
- - - - - - - -
- - - - - - + +
- - - - - - - -
 {$MOD.LBL_MY_MAIL_SERVER_DET}  
-
- - - - - - + + +
- - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$MOD.LBL_EMAIL_ID}
{$MOD.LBL_DISPLAY_NAME}{$MOD.LBL_NAME_EXAMPLE}
{$APP.LBL_REQUIRED_SYMBOL} {$MOD.LBL_EMAIL_ADDRESS} {$MOD.LBL_EMAIL_EXAMPLE}
 
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$APP.LBL_REQUIRED_SYMBOL}{$MOD.LBL_MAIL_SERVER_NAME} 
{$APP.LBL_REQUIRED_SYMBOL}{$APP.LBL_LIST_USER_NAME} 
{$APP.LBL_REQUIRED_SYMBOL}{$MOD.LBL_LIST_PASSWORD} 
 
{$MOD.LBL_MAIL_PROTOCOL} +{**} + + + + + + + + +
+
+ {$MOD.LBL_MY_MAIL_SERVER_DET}
+

+ + + + + + + + + +
+ + + + + + -
+ + + + + + + +
 {$MOD.LBL_MY_MAIL_SERVER_DET}  
+
+ + + + + + - -
+ + + - - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$MOD.LBL_EMAIL_ID}
{$MOD.LBL_DISPLAY_NAME}{$MOD.LBL_NAME_EXAMPLE}
{$APP.LBL_REQUIRED_SYMBOL} {$MOD.LBL_EMAIL_ADDRESS} {$MOD.LBL_EMAIL_EXAMPLE}
 
{$MOD.LBL_INCOME_SERVER_SETTINGS}
{$APP.LBL_REQUIRED_SYMBOL}{$MOD.LBL_MAIL_SERVER_NAME} 
{$APP.LBL_REQUIRED_SYMBOL}{$APP.LBL_LIST_USER_NAME} 
{$APP.LBL_REQUIRED_SYMBOL}{$MOD.LBL_LIST_PASSWORD} 
 
{$MOD.LBL_MAIL_PROTOCOL} -  {$MOD.LBL_IMAP2} -  {$MOD.LBL_IMAP4} -  
{$MOD.LBL_SSL_OPTIONS} -  {$MOD.LBL_NO_TLS} -   {$MOD.LBL_TLS}  
{$MOD.LBL_CERT_VAL} -  {$MOD.LBL_VAL_SSL_CERT} -  {$MOD.LBL_DONOT_VAL_SSL_CERT} -  
{$MOD.LBL_INT_MAILER} -  {$MOD.LBL_INT_MAILER_USE} -  {$MOD.LBL_INT_MAILER_NOUSE} -  
{$MOD.LBL_REFRESH_TIMEOUT} - -  
{$MOD.LBL_EMAILS_PER_PAGE} 
{$MOD.LBL_MAIL_DISCLAIM}
 
- -    -
 
-
-
- -
- -{$JAVASCRIPT} +  {$MOD.LBL_IMAP2} +  {$MOD.LBL_IMAP4} +
 
{$MOD.LBL_SSL_OPTIONS} +  {$MOD.LBL_NO_TLS} +   {$MOD.LBL_TLS}  
{$MOD.LBL_CERT_VAL} +  {$MOD.LBL_VAL_SSL_CERT} +  {$MOD.LBL_DONOT_VAL_SSL_CERT} +  
{$MOD.LBL_INT_MAILER} +  {$MOD.LBL_INT_MAILER_USE} +  {$MOD.LBL_INT_MAILER_NOUSE} +  
{$MOD.LBL_REFRESH_TIMEOUT} + +  
{$MOD.LBL_EMAILS_PER_PAGE} 
{$MOD.LBL_MAIL_DISCLAIM}
 
+ +    +
 
+
+ + + + + + +{$JAVASCRIPT} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/AddProductToPriceBooks.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/AddProductToPriceBooks.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/AddProductToPriceBooks.tpl Tue Nov 14 03:16:10 2006 @@ -1,157 +1,164 @@ - -{literal} - - - - - - -
 
  -{$PRICEBOOKLISTHEADER} - - - - - - - - - -
- - {$LISTHEADER} - {$LISTENTITY} -
-
 
- - -
- -  - - - - + +{literal} + + + + + + +
 
  +{$PRICEBOOKLISTHEADER} + + + + + + + + + +
+ + {$LISTHEADER} + {$LISTENTITY} +
+
 
+ + +
+ +  + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/AddProductsToPriceBook.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/AddProductsToPriceBook.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/AddProductsToPriceBook.tpl Tue Nov 14 03:16:10 2006 @@ -1,57 +1,65 @@ - - - -
-
-{$PRODUCTLISTHEADER} - - - - - - - -
- - - - {$NAVIGATION} - -
 {$RECORD_COUNTS}
-
- - {$LISTHEADER} - {$LISTENTITY} -
-
 
- - - - - + + + +
+
+{$PRODUCTLISTHEADER} + + + + + + + +
+ + + + {$NAVIGATION} + +
 {$RECORD_COUNTS}
+
+ + {$LISTHEADER} + {$LISTENTITY} +
+
 
+ + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List.tpl Tue Nov 14 03:16:10 2006 @@ -1,140 +1,140 @@ -{**} - - -{if $MODULE eq 'Calendar'} - -{/if} - - - - - - - - - - -
{$APP.$CATEGORY} > {$APP.$MODULE} - - - - - - - - - - - -
- - - - - -
- - - {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} - {if $MODULE eq 'Calendar'} - - {else} - - {/if} - {else} - - {/if} - - {if $CHECK.index eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} - - {else} - - {/if} - - -
{$APP.LBL_CREATE_BUTTON_LABEL} {$APP.$MODULE}...{$APP.LBL_SEARCH_ALT}{$APP.$MODULE}...
-
-
  - - - - {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Tools' || $CATEGORY eq 'Analytics'} - {if $CHECK.Calendar eq 'yes'} - - {else} - - {/if} - {else} - {if $CHECK.Calendar eq 'yes'} - - {else} - - {/if} - {/if} - - - - - -
{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CLOCK_ALT}{$APP.LBL_CALCULATOR_ALT}{$APP.LBL_CHAT_ALT} - {$APP.LBL_LAST_VIEWED} -
-
  - - - - {if $MODULE eq 'Contacts' || $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Potentials' || $MODULE eq 'Products' } - {if $CHECK.Import eq 'yes'} - - {else} - - {/if} - {if $CHECK.Export eq 'yes'} - - {else} - - {/if} - {elseif $MODULE eq 'Notes' || $MODULE eq 'Emails'} - - {if $CHECK.Export eq 'yes'} - - - {else} - - - {/if} - {else} - - - {/if} - -
{$APP.LBL_IMPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}
-
  - - - - - -
{$APP.LBL_ALL_MENU_ALT}
-
-
+{**} + + +{if $MODULE eq 'Calendar'} + +{/if} + + + + + + + + + + +
{$APP.$CATEGORY} > {$APP.$MODULE} + + + + + + + + + + + +
+ + + + + +
+ + + {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} + {if $MODULE eq 'Calendar'} + + {else} + + {/if} + {else} + + {/if} + + {if $CHECK.index eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} + + {else} + + {/if} + + +
{$APP.LBL_CREATE_BUTTON_LABEL} {$APP.$SINGLE_MOD}...{$APP.LBL_SEARCH_ALT}{$APP.$MODULE}...
+
+
  + + + + {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Tools' || $CATEGORY eq 'Analytics'} + {if $CHECK.Calendar eq 'yes'} + + {else} + + {/if} + {else} + {if $CHECK.Calendar eq 'yes'} + + {else} + + {/if} + {/if} + + + + + +
{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CLOCK_ALT}{$APP.LBL_CALCULATOR_ALT}{$APP.LBL_CHAT_ALT} + {$APP.LBL_LAST_VIEWED} +
+
  + + + + {if $MODULE eq 'Contacts' || $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Potentials' || $MODULE eq 'Products' } + {if $CHECK.Import eq 'yes'} + + {else} + + {/if} + {if $CHECK.Export eq 'yes'} + + {else} + + {/if} + {elseif $MODULE eq 'Notes' || $MODULE eq 'Emails'} + + {if $CHECK.Export eq 'yes'} + + + {else} + + + {/if} + {else} + + + {/if} + +
{$APP.LBL_IMPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}
+
  + + + + + +
{$APP.LBL_ALL_MENU_ALT}
+
+
Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List1.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List1.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Buttons_List1.tpl Tue Nov 14 03:16:10 2006 @@ -1,140 +1,142 @@ -{**} - - -{if $MODULE eq 'Calendar'} - -{/if} - - - - - - - {if $CATEGORY eq 'Settings'} - - - {else} - - {/if} - - -
{$APP.$MODULE}{$APP.$CATEGORY} > {$APP.$MODULE} - - - - - - - - - - - -
- - - - - -
- - - {if $CHECK.EditView eq 'yes'} - {if $MODULE eq 'Calendar'} - - {else} - - {/if} - {else} - - {/if} - - - - -
{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}...{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}...
-
-
  - - - - {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Tools' || $CATEGORY eq 'Analytics'} - {if $CHECK.Calendar eq 'yes'} - - {else} - - {/if} - {else} - {if $CHECK.Calendar eq 'yes'} - - {else} - - {/if} - {/if} - - - - - -
{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CLOCK_ALT}{$APP.LBL_CALCULATOR_ALT}{$APP.LBL_CHAT_ALT} - {$APP.LBL_LAST_VIEWED} -
-
  - - - - {if $MODULE eq 'Contacts' || $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Potentials' || $MODULE eq 'Products' } - {if $CHECK.Import eq 'yes'} - - {else} - - {/if} - {if $CHECK.Export eq 'yes'} - - {else} - - {/if} - {elseif $MODULE eq 'Notes' || $MODULE eq 'Emails'} - - {if $CHECK.Export eq 'yes'} - - - {else} - - - {/if} - {else} - - - {/if} - -
{$APP.LBL_IMPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}
-
  - - - - - -
{$APP.LBL_ALL_MENU_ALT}
-
-
+{**} + + +{if $MODULE eq 'Calendar'} + +{/if} + + + + + + + {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Organization' } + + + {else} + + {/if} + + +
{$APP.$MODULE}{$APP.$CATEGORY} > {$APP.$MODULE} + + + + + + + + + + + +
+ + + + + +
+ + + {if $CHECK.EditView eq 'yes'} + {if $MODULE eq 'Calendar'} + + {elseif $MODULE eq 'OrgUnit'} + + {else} + + {/if} + {else} + + {/if} + + + + +
{$APP.LBL_CREATE_BUTTON_LABEL} {$SINGLE_MOD}...{$APP.LBL_CREATE_BUTTON_LABEL} {$MODULE}...{$APP.LBL_CREATE_BUTTON_LABEL} {$SINGLE_MOD}...
+
+
  + + + + {if $CATEGORY eq 'Settings' || $CATEGORY eq 'Tools' || $CATEGORY eq 'Analytics'} + {if $CHECK.Calendar eq 'yes'} + + {else} + + {/if} + {else} + {if $CHECK.Calendar eq 'yes'} + + {else} + + {/if} + {/if} + + + + + +
{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CALENDAR_ALT}{$APP.LBL_CLOCK_ALT}{$APP.LBL_CALCULATOR_ALT}{$APP.LBL_CHAT_ALT} + {$APP.LBL_LAST_VIEWED} +
+
  + + + + {if $MODULE eq 'Contacts' || $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Potentials' || $MODULE eq 'Products' } + {if $CHECK.Import eq 'yes'} + + {else} + + {/if} + {if $CHECK.Export eq 'yes'} + + {else} + + {/if} + {elseif $MODULE eq 'Notes' || $MODULE eq 'Emails'} + + {if $CHECK.Export eq 'yes'} + + + {else} + + + {/if} + {else} + + + {/if} + +
{$APP.LBL_IMPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}{$APP.LBL_EXPORT} {$APP.$MODULE}
+
  + + + + + +
{$APP.LBL_ALL_MENU_ALT}
+
+
Modified: vtigercrm/branches/5.1_jens/Smarty/templates/CreateEmailTemplate.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/CreateEmailTemplate.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/CreateEmailTemplate.tpl Tue Nov 14 03:16:10 2006 @@ -1,324 +1,324 @@ -{**} - - - - - -
- - - - - -
-
-
- - {include file='SetMenu.tpl'} - - - - - - - - - - - {if $EMODE eq 'edit'} - - {else} - - {/if} - - - - - -
Users{$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES} > {$MOD.LBL_EDIT} "{$TEMPLATENAME}" {$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES} > {$MOD.LBL_CREATE_EMAIL_TEMPLATES}
{$UMOD.LBL_EMAIL_TEMPLATE_DESC}
- -
- - - - -
- - - - {if $EMODE eq 'edit'} - - {else} - - {/if} - - -
{$UMOD.LBL_PROPERTIES} "{$TEMPLATENAME}" {$MOD.LBL_CREATE_EMAIL_TEMPLATES} -    - {if $EMODE eq 'edit'} - - {else} - - {/if} -
- - - - - - - - - - - - - - - - - - - -
*{$UMOD.LBL_NAME} 
{$UMOD.LBL_DESCRIPTION} - -
{$UMOD.LBL_FOLDER} - {if $EMODE eq 'edit'} - - {else} - - {/if} - -
- - - - -
- - - - - - - - - - - - -
{$UMOD.LBL_EMAIL_TEMPLATE}
*{$UMOD.LBL_SUBJECT} - -
{$UMOD.LBL_MESSAGE}

-
- - - - - - - - - - - - - - - -
{$UMOD.LBL_MERGE_FIELDS}
-
{$UMOD.LBL_USE_MERGE_FIELDS_TO_EMAIL_CONTENT}
{$UMOD.LBL_STEP} 1. {$UMOD.LBL_SELECT_FIELD_TYPE}
{$UMOD.LBL_STEP} 2. {$UMOD.LBL_SELECT_FIELD}
{$UMOD.LBL_STEP} 3. {$UMOD.LBL_COPY_PASTE}
-
- - - - -
{$MOD.LBL_SCROLL}
-
- - - -
- - - - - - - - - - - - - +{**} + + + + + +
+ + + + + +
+
+
+ + {include file='SetMenu.tpl'} + + + + + + + + + + + {if $EMODE eq 'edit'} + + {else} + + {/if} + + + + + +
Users{$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES} > {$MOD.LBL_EDIT} "{$TEMPLATENAME}" {$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES} > {$MOD.LBL_CREATE_EMAIL_TEMPLATES}
{$UMOD.LBL_EMAIL_TEMPLATE_DESC}
+ +
+ + + + +
+ + + + {if $EMODE eq 'edit'} + + {else} + + {/if} + + +
{$UMOD.LBL_PROPERTIES} "{$TEMPLATENAME}" {$MOD.LBL_CREATE_EMAIL_TEMPLATES} +    + {if $EMODE eq 'edit'} + + {else} + + {/if} +
+ + + + + + + + + + + + + + + + + + + +
*{$UMOD.LBL_NAME} 
{$UMOD.LBL_DESCRIPTION} + +
{$UMOD.LBL_FOLDER} + {if $EMODE eq 'edit'} + + {else} + + {/if} + +
+ + + + +
+ + + + + + + + + + + + +
{$UMOD.LBL_EMAIL_TEMPLATE}
*{$UMOD.LBL_SUBJECT} + +
{$UMOD.LBL_MESSAGE}

+
+ + + + + + + + + + + + + + + +
{$UMOD.LBL_MERGE_FIELDS}
+
{$UMOD.LBL_USE_MERGE_FIELDS_TO_EMAIL_CONTENT}
{$UMOD.LBL_STEP} 1. {$UMOD.LBL_SELECT_FIELD_TYPE}
{$UMOD.LBL_STEP} 2. {$UMOD.LBL_SELECT_FIELD}
{$UMOD.LBL_STEP} 3. {$UMOD.LBL_COPY_PASTE}
+
+ + + + +
{$MOD.LBL_SCROLL}
+
+ + + +
+ + + + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/CreateView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/CreateView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/CreateView.tpl Tue Nov 14 03:16:10 2006 @@ -1,276 +1,285 @@ -{**} - -{**} - - - - - - - - - - {include file='Buttons_List1.tpl'} - -{**} - - - - - - - -
- - - {**} -
- - {if $OP_MODE eq 'edit_view'} - [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
- {$UPDATEINFO} - {/if} - {if $OP_MODE eq 'create_view'} - {$APP.LBL_CREATING} {$APP.LBL_NEW} {$APP[$SINGLE_MOD]}
- {/if} - -
-
- - {include file='EditViewHidden.tpl'} - - {**} - - - - - - - -
- - - - - {if $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Products'} - - - - {else} - - - {/if} - -
 {$APP.LBL_BASIC} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION}  {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} 
-
- - -
- - - - - -
- - - - - - - - - -
- - - - - - - {foreach key=header item=data from=$BASBLOCKS} - - {if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} - - - - - {elseif $header== 'Address Information' && $MODULE == 'Contacts'} - - - - {else} - - - - - {include file="DisplayFields.tpl"} - - {/foreach} - - - - -
-
- - -
-
- {$header} - {$APP.LBL_RCPY_ADDRESS} - {$APP.LBL_LCPY_ADDRESS} - {$header} - {$APP.LBL_CPY_OTHER_ADDRESS} - {$APP.LBL_CPY_MAILING_ADDRESS} - {$header} - {/if} -
 
-
- {if $MODULE eq 'Emails'} - - - {/if} - - -
-
-
-
- -
- - - -
- - - - -
- {**} - - - - - - - - -
- - - - - - - {foreach key=header item=data from=$ADVBLOCKS} - - - - - - {include file="DisplayFields.tpl"} - - - {/foreach} - - - - -
-
- - -
-
- {$header} -
 
-
- {if $MODULE eq 'Emails'} - - - {/if} - - - -
-
-
-
-
- -
-
-
- - -{if ($MODULE eq 'Emails' || 'Notes') and ($FCKEDITOR_DISPLAY eq 'true')} - - -{/if} -{if $MODULE eq 'Accounts'} - -{/if} - - - - +{**} + +{**} + + + + + + + + + + {include file='Buttons_List1.tpl'} + +{**} + + + + + + + +
+ + + {**} +
+ + {if $OP_MODE eq 'edit_view'} + [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$APP[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
+ {$UPDATEINFO} + {/if} + {if $OP_MODE eq 'create_view'} + {$APP.LBL_CREATING} {$APP.LBL_NEW} {$APP[$SINGLE_MOD]}
+ {/if} + +
+
+ + {include file='EditViewHidden.tpl'} + + {**} + + + + + + + +
+ + + + + {if $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Products'} + + + + {else} + + + {/if} + +
 {$APP.LBL_BASIC} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION}  {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} 
+
+ + +
+ + + + + +
+ + + + + + + + + +
+ + + + + + + {foreach key=header item=data from=$BASBLOCKS} + + {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} + + + + + {elseif $header== $MOD.LBL_ADDRESS_INFORMATION && $MODULE == 'Contacts'} + + + + {else} + + + + + {include file="DisplayFields.tpl"} + + {/foreach} + + + {if $MODULE eq "Organization"} + + + + {/if} + + + + +
+
+ + +
+
+ {$header} + {$APP.LBL_RCPY_ADDRESS} + {$APP.LBL_LCPY_ADDRESS} + {$header} + {$APP.LBL_CPY_OTHER_ADDRESS} + {$APP.LBL_CPY_MAILING_ADDRESS} + {$header} + {/if} +
 
+ {include file="DetailsViewOrgUnit.tpl"} +
+
+ {if $MODULE eq 'Emails'} + + + {/if} + + +
+
+
+
+ +
+ + + +
+ + + + +
+ {**} + + + + + + + + +
+ + + + + + + {foreach key=header item=data from=$ADVBLOCKS} + + + + + + {include file="DisplayFields.tpl"} + + + {/foreach} + + + + +
+
+ + +
+
+ {$header} +
 
+
+ {if $MODULE eq 'Emails'} + + + {/if} + + + +
+
+
+
+
+ +
+
+
+ + +{if ($MODULE eq 'Emails' || 'Notes') and ($FCKEDITOR_DISPLAY eq 'true')} + + +{/if} +{if $MODULE eq 'Accounts'} + +{/if} + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/CreateWordTemplate.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/CreateWordTemplate.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/CreateWordTemplate.tpl Tue Nov 14 03:16:10 2006 @@ -1,100 +1,100 @@ -{**} - -
- - - - - -
-
-
- - {include file='SetMenu.tpl'} - - - - - - - - - - - - - - - -
Users{$MOD.LBL_SETTINGS} > {$UMOD.LBL_WORD_TEMPLATES} > {$UMOD.LBL_NEW_TEMPLATE}
{$MOD.LBL_MAIL_MERGE_DESC}
- -
- - - - -
- - - - - - -
{$UMOD.LBL_NEW_TEMPLATE}
{$ERRORFLAG}
-   -   -
- - - - - - - - - - - - - - -
*{$UMOD.LBL_NEW} {$UMOD.LBL_TEMPLATE_FILE} - -
{$UMOD.LBL_DESCRIPTION}
{$UMOD.LBL_MODULENAMES} - -
- - - - -
[Scroll to Top]
-
- - - -
- - - - - - - - - - +{**} + +
+ + + + + +
+
+
+ + {include file='SetMenu.tpl'} + + + + + + + + + + + + + + + +
Users{$MOD.LBL_SETTINGS} > {$UMOD.LBL_WORD_TEMPLATES} > {$UMOD.LBL_NEW_TEMPLATE}
{$MOD.LBL_MAIL_MERGE_DESC}
+ +
+ + + + +
+ + + + + + +
{$UMOD.LBL_NEW_TEMPLATE}
{$ERRORFLAG}
+   +   +
+ + + + + + + + + + + + + + +
*{$UMOD.LBL_NEW} {$UMOD.LBL_TEMPLATE_FILE} + +
{$UMOD.LBL_DESCRIPTION}
{$UMOD.LBL_MODULENAMES} + +
+ + + + +
[Scroll to Top]
+
+ + + +
+ + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DetailView.tpl Tue Nov 14 03:16:10 2006 @@ -73,20 +73,28 @@ {if $MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Leads'} {if $MODULE eq 'Accounts'} - {assign var=address1 value='Billing'} - {assign var=address2 value='Shipping'} + {assign var=address1 value='$MOD.LBL_BILLING_ADDRESS'} + {assign var=address2 value='$MOD.LBL_SHIPPING_ADDRESS'} {/if} {if $MODULE eq 'Contacts'} - {assign var=address1 value='Mailing'} - {assign var=address2 value='Other'} + {assign var=address1 value='$MOD.LBL_PRIMARY_ADDRESS'} + {assign var=address2 value='$MOD.LBL_ALTERNATE_ADDRESS'} {/if} @@ -221,7 +229,7 @@     - {if $header eq 'Address Information' && ($MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Leads') } + {if $header eq $MOD.LBL_ADDRESS_INFORMATION && ($MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Leads') } {if $MODULE eq 'Leads'} {else} @@ -239,15 +247,10 @@ - {$COMMENT_BLOCK} + {$COMMENT_BLOCK}   {/if} - - - - - {strip} @@ -255,46 +258,54 @@ {/strip} - {foreach item=detail from=$detail} - - {foreach key=label item=data from=$detail} - {assign var=keyid value=$data.ui} - {assign var=keyval value=$data.value} - {assign var=keytblname value=$data.tablename} - {assign var=keyfldname value=$data.fldname} - {assign var=keyoptions value=$data.options} - {assign var=keysecid value=$data.secid} - {assign var=keyseclink value=$data.link} - {assign var=keycursymb value=$data.cursymb} - {assign var=keysalut value=$data.salut} - {assign var=keycntimage value=$data.cntimage} - {assign var=keyadmin value=$data.isadmin} - - - - {if $label ne ''} - {if $keycntimage ne ''} - {$keycntimage} - {elseif $keyid eq '71' || $keyid eq '72'} - {$label} ({$keycursymb}) - {else} - {$label} - {/if} -{if $EDIT_PERMISSION eq 'yes'} {include file="DetailViewUI.tpl"} -{else} {include file="DetailViewFields.tpl"} -{/if} - {else} -   -   - {/if} - {/foreach} - - {/foreach} + {foreach item=detail from=$detail} + + {foreach key=label item=data from=$detail} + {assign var=keyid value=$data.ui} + {assign var=keyval value=$data.value} + {assign var=keyinherit value=$data.inherit} + {assign var=keytblname value=$data.tablename} + {assign var=keyfldname value=$data.fldname} + {assign var=keyoptions value=$data.options} + {assign var=keysecid value=$data.secid} + {assign var=keyseclink value=$data.link} + {assign var=keycursymb value=$data.cursymb} + {assign var=keysalut value=$data.salut} + {assign var=keycntimage value=$data.cntimage} + {assign var=keyadmin value=$data.isadmin} + + {if $label ne ''} + {if $keycntimage ne ''} + {$keycntimage} + {elseif $keyid eq '71' || $keyid eq '72'} + {$label} ({$keycursymb}) + {else} + {$label} + {/if} + {if $EDIT_PERMISSION eq 'yes'} + {include file="DetailViewUI.tpl"} + {else} + {include file="DetailViewFields.tpl"} + {/if} + {else} +   +   + {/if} + {/foreach} + + {/foreach} {/foreach} + {if $MODULE eq "Organization"} + + + {include file="DetailsViewOrgUnit.tpl"} + + + {/if} {*-- End of Blocks--*} @@ -380,19 +391,14 @@ - - - - - -
-
- + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewFields.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewFields.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewFields.tpl Tue Nov 14 03:16:10 2006 @@ -1,91 +1,115 @@ -{**} - - - {if $keyid eq '1' || $keyid eq 2 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72'} - - {elseif $keyid eq '13'} - - {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} - - {elseif $keyid eq '17'} - - {elseif $keyid eq '19' || $keyid eq '20'} - - {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} - - {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51' || $keyid eq '57' || $keyid eq '59' || $keyid eq '75' || $keyid eq '81' || $keyid eq '76' || $keyid eq '78' || $keyid eq '80'} - - {elseif $keyid eq 82} - - {elseif $keyid eq '53'} - - {elseif $keyid eq '56'} - - {elseif $keyid eq 83} - - - - - - - - - - - - - - - {elseif $keyid eq 69} - - {else} - - {/if} +{**} + + + {if $keyid eq '1' || $keyid eq 2 ||$keyid eq 8 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72'} + + {elseif $keyid eq '13'} + + {elseif $keyid eq '14'} + + {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} + + {elseif $keyid eq '17'} + + {elseif $keyid eq '19' || $keyid eq '20'} + + {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} + + {elseif $keyid eq '12'} + + {elseif $keyid eq '3' || $keyid eq '4' || $keyid eq '32' || $keyid eq '31'} + + {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51' || $keyid eq '57' || $keyid eq '59' || $keyid eq '75' || $keyid eq '81' || $keyid eq '76' || $keyid eq '78' || $keyid eq '80'} + + {elseif $keyid eq 82} + + {elseif $keyid eq '53'} + + {elseif $keyid eq '56'} + + {elseif $keyid eq 83} + + + + + + + + + + + + + + + {elseif $keyid eq 69} + + {elseif $keyid eq 107} + + {else} + + {/if} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewHidden.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewHidden.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewHidden.tpl Tue Nov 14 03:16:10 2006 @@ -192,6 +192,17 @@ +{elseif $MODULE eq 'Organization' || $MODULE eq 'OrgUnit'} + + + + + + + + {if $MODULE eq 'OrgUnit'} + + {/if} {/if} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewUI.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewUI.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DetailViewUI.tpl Tue Nov 14 03:16:10 2006 @@ -1,277 +1,430 @@ -{**} - - - {if $keyid eq '1' || $keyid eq 2 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72' || $keyid eq '103'} - - {elseif $keyid eq '13' || $keyid eq '104'} - - - {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} - - {elseif $keyid eq '33'} - - {assign var="MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING" value=", "} {* Separates Multi-Select Combo Box items *} - {assign var="DETAILVIEW_WORDWRAP_WIDTH" value="70"} {* No. of chars for word wrapping long lines of Multi-Select Combo Box items *} - - {elseif $keyid eq '115'} - {if $keyadmin eq 1} - - {elseif $keyid eq '116'} - {if $keyadmin eq 1} - - {elseif $keyid eq '17'} - - {elseif $keyid eq '19' || $keyid eq '20'} - - {if $label eq $MOD.LBL_ADD_COMMENT} - {assign var=keyval value=''} - {/if} - {assign var="DESCRIPTION_SEPARATOR_STRING" value=" "} {* Separates Description *} - {assign var="DESCRIPTION_WORDWRAP_WIDTH" value="70"} {* No. of chars for word wrapping long lines of Description *} - - {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} - - {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51'} - - {elseif $keyid eq '57'} - - {elseif $keyid eq '59'} - - {elseif $keyid eq '75' || $keyid eq '81'} - - {elseif $keyid eq 76} - - {elseif $keyid eq 78} - - {elseif $keyid eq 82} - - {elseif $keyid eq 80} - - {elseif $keyid eq '53'} - - {elseif $keyid eq '99'} - - {elseif $keyid eq '56'} - - {elseif $keyid eq '156'} - {if $smarty.request.record neq $CURRENT_USERID && $keyadmin eq 1} - - - {elseif $keyid eq 83} - {foreach item=tax key=count from=$TAX_DETAILS} - - - - - {/foreach} - - - {elseif $keyid eq 69} - - {else} - - {/if} +{**} + + + {if $keyid eq '1' || $keyid eq 2 || $keyid eq '11' || $keyid eq '7' || $keyid eq '9' || $keyid eq '55' || $keyid eq '71' || $keyid eq '72' || $keyid eq '103'} + + {elseif $keyid eq '8'} + + {elseif $keyid eq '13' || $keyid eq '104'} + + + {elseif $keyid eq '15' || $keyid eq '16' || $keyid eq '111'} + + {elseif $keyid eq '12'} + + {elseif $keyid eq '14'} + + {elseif $keyid eq '3' || $keyid eq '4' || $keyid eq '32' || $keyid eq '31'} + + {elseif $keyid eq '33'} + + {assign var="MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING" value=", "} {* Separates Multi-Select Combo Box items *} + {assign var="DETAILVIEW_WORDWRAP_WIDTH" value="70"} {* No. of chars for word wrapping long lines of Multi-Select Combo Box items *} + + {elseif $keyid eq '115'} + {if $keyadmin eq 1} + + {elseif $keyid eq '116'} + {if $keyadmin eq 1} + + {elseif $keyid eq '17'} + + {elseif $keyid eq '85'} + + {elseif $keyid eq '18'} + + {elseif $keyid eq '19' || $keyid eq '20'} + + {if $label eq $MOD.LBL_ADD_COMMENT} + {assign var=keyval value=''} + {/if} + + + + {elseif $keyid eq '21' || $keyid eq '24' || $keyid eq '22'} + + {elseif $keyid eq '50' || $keyid eq '73' || $keyid eq '51'} + + {elseif $keyid eq '57'} + + {elseif $keyid eq '59'} + + {elseif $keyid eq '75' || $keyid eq '81'} + + {elseif $keyid eq 76} + + {elseif $keyid eq 78} + + {elseif $keyid eq 82} + + {elseif $keyid eq 80} + + {elseif $keyid eq '53'} + + {elseif $keyid eq '99'} + + {elseif $keyid eq '56'} + + {elseif $keyid eq '156'} + {if $smarty.request.record neq $CURRENT_USERID && $keyadmin eq 1} + + + {elseif $keyid eq 83} + {foreach item=tax key=count from=$TAX_DETAILS} + + + + + {/foreach} + + + {elseif $keyid eq 69} + + {elseif $keyid eq 107} + + {else} + + {/if} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/DisplayFields.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/DisplayFields.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/DisplayFields.tpl Tue Nov 14 03:16:10 2006 @@ -1,687 +1,826 @@ -{**} - - -{foreach key=label item=subdata from=$data} - {if $header eq 'Product Details'} - - {else} - - {/if} - {foreach key=mainlabel item=maindata from=$subdata} - {assign var="uitype" value="$maindata[0][0]"} - {assign var="fldlabel" value="$maindata[1][0]"} - {assign var="fldlabel_sel" value="$maindata[1][1]"} - {assign var="fldlabel_combo" value="$maindata[1][2]"} - {assign var="fldname" value="$maindata[2][0]"} - {assign var="fldvalue" value="$maindata[3][0]"} - {assign var="secondvalue" value="$maindata[3][1]"} - {assign var="thirdvalue" value="$maindata[3][2]"} - {assign var="vt_tab" value="$maindata[4][0]"} - - {if $uitype eq 2} - - - {elseif $uitype eq 11 || $uitype eq 1 || $uitype eq 13 || $uitype eq 7 || $uitype eq 9} - - - {if $fldname eq 'tickersymbol' && $MODULE eq 'Accounts'} - - {else} - - {/if} - {elseif $uitype eq 19 || $uitype eq 20} - - {if $fldlabel eq 'Add Comment'} - {assign var=fldvalue value=""} - {/if} - - - {elseif $uitype eq 21 || $uitype eq 24} - - - {elseif $uitype eq 15 || $uitype eq 16 || $uitype eq 111} - - - {elseif $uitype eq 33} - - - - {elseif $uitype eq 53} - - - {elseif $uitype eq 52 || $uitype eq 77} - - - {elseif $uitype eq 51} - {if $MODULE eq 'Accounts'} - {assign var='popuptype' value = 'specific_account_address'} - {else} - {assign var='popuptype' value = 'specific_contact_account_address'} - {/if} - - - - {elseif $uitype eq 50} - - - {elseif $uitype eq 73} - - - - {elseif $uitype eq 75 || $uitype eq 81} - - - {elseif $uitype eq 57} - - - - {elseif $uitype eq 58} - - - - {elseif $uitype eq 80} - - - - {elseif $uitype eq 78} - - - - {elseif $uitype eq 76} - - - - {elseif $uitype eq 17} - - - - {elseif $uitype eq 71 || $uitype eq 72} - - - - {elseif $uitype eq 56} - - {if $fldname eq 'notime' && $ACTIVITY_MODE eq 'Events'} - {if $fldvalue eq 1} - - {else} - - {/if} - {else} - {if $fldvalue eq 1} - - {else} - - {/if} - {/if} - {elseif $uitype eq 23 || $uitype eq 5 || $uitype eq 6} - - - - {elseif $uitype eq 63} - - - - - {elseif $uitype eq 357} - - - - - - - - - - {elseif $uitype eq 59} - - - - {elseif $uitype eq 55} - - - - {elseif $uitype eq 22} - - - - {elseif $uitype eq 69} - - - - {elseif $uitype eq 61} - - - {elseif $uitype eq 156} - - {if $fldvalue eq 'on'} - - {else} - - {/if} - {elseif $uitype eq 98} - - - {elseif $uitype eq 104} - - - {elseif $uitype eq 115} - - - {elseif $uitype eq 105} - - - {elseif $uitype eq 103} - - - {elseif $uitype eq 101} - - - {elseif $uitype eq 116} - - - {elseif $uitype eq 106} - - - {elseif $uitype eq 99} - {if $MODE eq 'create'} - - - {/if} - {elseif $uitype eq 30} - - - {elseif $uitype eq 83} - {foreach item=tax key=count from=$TAX_DETAILS} - {if $tax.check_value eq 1} - {assign var=check_value value="checked"} - {assign var=show_value value="visible"} - {else} - {assign var=check_value value=""} - {assign var=show_value value="hidden"} - {/if} - - - - {/foreach} - - - {/if} - {/foreach} - -{/foreach} - - +{**} + + +{foreach key=label item=subdata from=$data} + {if $header eq 'Product Details'} + + {else} + + {/if} + {foreach key=mainlabel item=maindata from=$subdata} + {assign var="uitype" value="$maindata[0][0]"} + {assign var="fldlabel" value="$maindata[1][0]"} + {assign var="fldlabel_sel" value="$maindata[1][1]"} + {assign var="fldlabel_combo" value="$maindata[1][2]"} + {assign var="fldname" value="$maindata[2][0]"} + {assign var="fldvalue" value="$maindata[3][0]"} + {assign var="secondvalue" value="$maindata[3][1]"} + {assign var="thirdvalue" value="$maindata[3][2]"} + {assign var="vt_tab" value="$maindata[4][0]"} + + {if $uitype eq 2} + + + {elseif $uitype eq 8} + + + + {elseif $uitype eq 11 || $uitype eq 1 || $uitype eq 13 || $uitype eq 7 || $uitype eq 9} + + + {if $fldname eq 'tickersymbol' && $MODULE eq 'Accounts'} + + {else} + + {/if} + {elseif $uitype eq '14'} + + + {elseif $uitype eq 19 || $uitype eq 20} + + {if $fldlabel eq $MOD.LBL_ADD_COMMENT} + {assign var=fldvalue value=""} + {/if} + + + {elseif $uitype eq 21 || $uitype eq 24} + + + {elseif $uitype eq 15 || $uitype eq 16 || $uitype eq 111} + + + {elseif $uitype eq '12'} + + + {elseif $uitype eq 3 || $uitype eq 4 || $uitype eq 31 || $uitype eq 32} + {if $uitype eq 4 || $uitype eq 32} + + {else} + + {/if} + + {elseif $uitype eq 33} + + + + {elseif $uitype eq 53} + + + {elseif $uitype eq 52 || $uitype eq 77} + + + {elseif $uitype eq 51} + {if $MODULE eq 'Accounts'} + {assign var='popuptype' value = 'specific_account_address'} + {else} + {assign var='popuptype' value = 'specific_contact_account_address'} + {/if} + + + + {elseif $uitype eq 50} + + + {elseif $uitype eq 73} + + + + {elseif $uitype eq 74} + + + + {elseif $uitype eq 75 || $uitype eq 81} + + + {elseif $uitype eq 57} + + + + {elseif $uitype eq 58} + + + + {elseif $uitype eq 80} + + + + {elseif $uitype eq 78} + + + + {elseif $uitype eq 76} + + + + {elseif $uitype eq 17} + + + + {elseif $uitype eq 85} + + + + {elseif $uitype eq 18} + + + + {elseif $uitype eq 71 || $uitype eq 72} + + + + {elseif $uitype eq 56} + + {if $fldname eq 'notime' && $ACTIVITY_MODE eq 'Events'} + {if $fldvalue eq 1} + + {else} + + {/if} + {else} + {if $fldvalue eq 1} + + {else} + + {/if} + {/if} + {elseif $uitype eq 23 || $uitype eq 5 || $uitype eq 6} + + + + {elseif $uitype eq 63} + + + + + {elseif $uitype eq 357} + + + + + + + + + + {elseif $uitype eq 59} + + + + {elseif $uitype eq 55} + + + + {elseif $uitype eq 22} + + + + {elseif $uitype eq 69} + + + + {elseif $uitype eq 61} + + + {elseif $uitype eq 156} + + {if $fldvalue eq 'on'} + + {else} + + {/if} + {elseif $uitype eq 98} + + + {elseif $uitype eq 104} + + + {elseif $uitype eq 115} + + + {elseif $uitype eq 105} + + + {elseif $uitype eq 107} + + + {elseif $uitype eq 103} + + + {elseif $uitype eq 101} + + + {elseif $uitype eq 116} + + + {elseif $uitype eq 106} + + + {elseif $uitype eq 99} + {if $MODE eq 'create'} + + + {/if} + {elseif $uitype eq 30} + + + {elseif $uitype eq 83} + {foreach item=tax key=count from=$TAX_DETAILS} + {if $tax.check_value eq 1} + {assign var=check_value value="checked"} + {assign var=show_value value="visible"} + {else} + {assign var=check_value value=""} + {assign var=show_value value="hidden"} + {/if} + + + + {/foreach} + + + {/if} + {/foreach} + +{/foreach} + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/EditViewHidden.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/EditViewHidden.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/EditViewHidden.tpl Tue Nov 14 03:16:10 2006 @@ -58,8 +58,11 @@ -{elseif $MODULE eq 'Accounts' || $MODULE eq 'Faq' || $MODULE eq 'PriceBooks' || $MODULE eq 'Vendors'} +{elseif $MODULE eq 'Accounts' || $MODULE eq 'Faq' || $MODULE eq 'PriceBooks' || $MODULE eq 'Vendors' || $MODULE eq 'OrgUnit'} + +{elseif $MODULE eq 'Organization'} + {elseif $MODULE eq 'Notes'} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetailView.tpl Tue Nov 14 03:16:10 2006 @@ -61,7 +61,7 @@ {elseif $elements.fldname eq 'description'} - + {elseif $elements.fldname eq 'filename'} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetails.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetails.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/EmailDetails.tpl Tue Nov 14 03:16:10 2006 @@ -1,84 +1,84 @@ -{**} -
  
{$ALL_TAG}
  - {if $keyid eq '55'} - {$keysalut} - {*elseif $keyid eq '71' || $keyid eq '72'} - {$keycursymb*} - {/if} - {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -  {$keyval} -   - {if $keyseclink eq ''} - {$keyval} - {else} - {$keyval} - {/if} -   - - {$keyval}  - - {$APP.LBL_VAT} {$APP.COVERED_PERCENTAGE} - -   - {$VAT_TAX} -  
- {$APP.LBL_SALES} {$APP.LBL_TAX} {$APP.COVERED_PERCENTAGE} -   - {$SALES_TAX} -  
- {$APP.LBL_SERVICE} {$APP.LBL_TAX} {$APP.COVERED_PERCENTAGE} -   - {$SERVICE_TAX} -  {$keyval} {$keyval}  + {if $keyid eq '55'} + {$keysalut} + {*elseif $keyid eq '71' || $keyid eq '72'} + {$keycursymb*} + {/if} + {$keyval} +  {$keyval} +  {$keyval} +  {$keyval} +  {$keyval} +  {$keyval} +  {$keyval} +  {$ASSIGN_ORGUNIT_LIST.$keyval.name} +   + {if $keyinherit == 1} + {if $keyid eq '32' || $keyid eq '31'} + {$keyval}  EXT + {else} + {$MOD.LBL_INHERIT_PARENT} + {/if} + {else} + {$keyval} + {/if} +  {$keyval} +  {$keyval} +   + {if $keyseclink eq ''} + {$keyval} + {else} + {$keyval} + {/if} +   + + {$keyval}  + + {$APP.LBL_VAT} {$APP.COVERED_PERCENTAGE} + +   + {$VAT_TAX} +  
+ {$APP.LBL_SALES} {$APP.LBL_TAX} {$APP.COVERED_PERCENTAGE} +   + {$SALES_TAX} +  
+ {$APP.LBL_SERVICE} {$APP.LBL_TAX} {$APP.COVERED_PERCENTAGE} +   + {$SERVICE_TAX} +  {$keyval} + {if $keyval ne ""} + {$keyval} + {/if} +  {$keyval} - {if $keyid eq '55'} - {$keysalut} - {*elseif $keyid eq '71' || $keyid eq '72'} - {$keycursymb*} - {/if} -   {$keyval} - -  {$keyval} - -  {$keyval} - -   - {$keyval|replace:$MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING:"\x1"|replace:" ":"\x0"|replace:"\x1":$MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING|wordwrap:$DETAILVIEW_WORDWRAP_WIDTH:"
 "|replace:"\x0":" "} -
- - -
 {$keyval} - - {else} - {$keyval} - {/if} - -  {$keyval} - - {else} - {$keyval} - {/if} - - -  {$keyval} - -   - {$keyval|replace:$DESCRIPTION_SEPARATOR_STRING:"\x1"|replace:" ":"\x0"|replace:"\x1":$DESCRIPTION_SEPARATOR_STRING|wordwrap:$DESCRIPTION_WORDWRAP_WIDTH:"
 "|replace:"\x0":" "} -
- -
 {$keyval} - -  {$keyval} -  {$keyval} - -  {$keyval} - -  {$keyval} -  {$keyval} -  {$keyval} -
{$keyval}
-
 {$keyval} -   - {if $keyoptions.0 eq 'User' && $keyadmin eq 1} - {$keyval} - {elseif $keyoptions.0 eq 'Group' && $keyadmin eq 1} - {$keyval} - {else} - {$keyval} - {/if} -   - - {$CHANGE_PW_BUTTON} {$keyval}  - -  {$keyval}  - - {else} - {$keyval} - {/if} - - {$tax.taxlabel} {$APP.COVERED_PERCENTAGE} - - - {$tax.percentage} -  
 {$keyval} {$keyval} + {if $keyid eq '55'} + {$keysalut} + {*elseif $keyid eq '71' || $keyid eq '72'} + {$keycursymb*} + {/if} +   {$keyval} + +   {$keyval} {$keyval} + +  {$keyval} + +  {$ASSIGN_ORGUNIT_LIST.$keyval.name} + + + + {foreach key=org item=sel from=$keyval} {$org}{if $sel eq 1} (*){/if}
{/foreach}
+ {if $keyval.$CURRENT_ORGANIZATION eq 1} + + + {/if} +
+ + + {if $keyinherit == 1} + {if $keyid eq '32' || $keyid eq '31'} + {$keyval}  EXT + {else} + {$MOD.LBL_INHERIT_PARENT} + {/if} + {else} + {$keyval} + {/if} + + + +   + {$keyval|replace:$MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING:"\x1"|replace:" ":"\x0"|replace:"\x1":$MULTISELECT_COMBO_BOX_ITEM_SEPARATOR_STRING|wordwrap:$DETAILVIEW_WORDWRAP_WIDTH:"
 "|replace:"\x0":" "} +
+ + +
 {$keyval} + + {else} + {$keyval} + {/if} + +  {$keyval} + + {else} + {$keyval} + {/if} + + +  {$keyval} + +  Skype{$keyval} + + + +  {$keyval} + + +   + {$keyval} + + +  {$keyval} + +  {$keyval} +  {$keyval} + +  {$keyval} + +  {$keyval} +  {$keyval} +  {$keyval} +
{$keyval}
+
 {$keyval} +   + {if $keyoptions.0 eq 'User' && $keyadmin eq 1} + {$keyval} + {elseif $keyoptions.0 eq 'Group' && $keyadmin eq 1} + {$keyval} + {else} + {$keyval} + {/if} +   + + {$CHANGE_PW_BUTTON} {$keyval}  + +  {$keyval}  + + {else} + {$keyval} + {/if} + + {$tax.taxlabel} {$APP.COVERED_PERCENTAGE} + + + {$tax.percentage} +  
 {$keyval} + {if $keyval ne ""} + {$keyval} + {/if} +  {$keyval}
- *{$fldlabel} - - - {$fldlabel} - - - - {if $uitype eq 20} - * - {/if} - {$fldlabel} - - - - {if $uitype eq 24} - * - {/if} - {$fldlabel} - - - - {if $uitype eq 16} - * - {/if} - {$fldlabel} - - - - {$fldlabel} - - - - {$fldlabel} - - {assign var=check value=1} - {foreach key=key_one item=arr from=$fldvalue} - {foreach key=sel_value item=value from=$arr} - {if $value ne ''} - {assign var=check value=$check*0} - {else} - {assign var=check value=$check*1} - {/if} - {/foreach} - {/foreach} - - {if $check eq 0} - {assign var=select_user value='checked'} - {assign var=style_user value='display:block'} - {assign var=style_group value='display:none'} - {else} - {assign var=select_group value='checked'} - {assign var=style_user value='display:none'} - {assign var=style_group value='display:block'} - {/if} - -  User - - {if $secondvalue neq ''} -  Group - {/if} - - - - - {if $secondvalue neq ''} - - - - {/if} - - {$fldlabel} - - {if $uitype eq 52} - - {else} - - - {$fldlabel} - -  Select  - - *{$fldlabel} - -  Select - - *{$fldlabel} - -  Select - - {if $uitype eq 81} - * - {assign var="pop_type" value="specific_vendor_address"} - {else}{assign var="pop_type" value="specific"} - {/if} - {$fldlabel} - -  Select - {if $uitype eq 75} -   - {/if} - - {$fldlabel} - -  Select  - - {$fldlabel} - -  Select  - - {$fldlabel} - -  Select  - - {$fldlabel} - -  Select  - - {$fldlabel} - -  Select  - - {$fldlabel} - -   http://  - - - {if $uitype eq 72} - * - {/if} - {$fldlabel} - - - - {$fldlabel} - - - - - - - - - - {$fldlabel} - - {foreach key=date_value item=time_value from=$fldvalue} - {assign var=date_val value="$date_value"} - {assign var=time_val value="$time_value"} - {/foreach} - - - - - {if $uitype eq 6} - - {/if} - - {foreach key=date_format item=date_str from=$secondvalue} - {assign var=dateFormat value="$date_format"} - {assign var=dateStr value="$date_str"} - {/foreach} - - {if $uitype eq 5 || $uitype eq 23} -
({$dateStr}) - {else} -
({$dateStr}) - {/if} - - - - -
- {$fldlabel} - -   - - - {elseif $uitype eq 68 || $uitype eq 66 || $uitype eq 62} - - - - - -  Select  - To:  - -   - -  Select  -
CC:  - - BCC:  - -
- {$fldlabel} - - -  Select  - {$fldlabel} - - - - *{$fldlabel} - - - - {$fldlabel} - - {if $MODULE eq 'Products'} - -
Files Maximum 6 - - {assign var=image_count value=0} - {if $maindata[3].0.name neq ''} - {foreach name=image_loop key=num item=image_details from=$maindata[3]} -
-   [{$image_details.name}] -
- {assign var=image_count value=$smarty.foreach.image_loop.iteration} - {/foreach} - {/if} -
- - - {else} - - - { if $maindata[3].0.name != "" } - -
[{$maindata[3].0.name}] Del
- {/if} - - {/if} -
- {$fldlabel} - - - {$fldvalue} - - {$fldlabel} - - {if ($secondvalue eq 1 && $CURRENT_USERID != $smarty.request.record) || ($MODE == 'create')} - - {else} - - - {/if} - - {if ($secondvalue eq 1 && $CURRENT_USERID != $smarty.request.record) || ($MODE == 'create')} - - {else} - - {/if} - - * - {$fldlabel} - - {if $thirdvalue eq 1} -   - - {else} -   - {/if} - - - * - {$fldlabel} - - {$fldlabel} - - {if $secondvalue eq 1} - - {/if} - {foreach item=arr from=$fldvalue} - {foreach key=sel_value item=value from=$arr} - - {/foreach} - {/foreach} - - - {$fldlabel} - - - - {$maindata[3].0.name} - - {$fldlabel} - - - - {$fldlabel} - -   - - {$fldlabel} - - {if $secondvalue eq 1} - - {/if} - - {foreach item=arr key=uivalueid from=$fldvalue} - {foreach key=sel_value item=value from=$arr} - - {/foreach} - {/foreach} - - - *{$fldlabel} - - {if $MODE eq 'edit'} - - {else} - - {/if} - - *{$fldlabel} - - - - {$fldlabel} - - {assign var=check value=$secondvalue[0]} - {assign var=yes_val value=$secondvalue[1]} - {assign var=no_val value=$secondvalue[2]} - -  {$yes_val}  -  {$no_val}  - - {foreach item=val_arr from=$fldvalue} - {assign var=start value="$val_arr[0]"} - {assign var=end value="$val_arr[1]"} - {assign var=sendname value="$val_arr[2]"} - {assign var=disp_text value="$val_arr[3]"} - {assign var=sel_val value="$val_arr[4]"} - -  {$disp_text} - {/foreach} - - {$tax.taxlabel} {$APP.COVERED_PERCENTAGE} - - - -
 
+ *{$fldlabel} + + + {$fldlabel}  {$fldvalue}{$fldlabel} + + + {$fldlabel} + {if $fldvalue.$CURRENT_ORGANIZATION eq 1} + + {else} + {foreach key=org item=sel from=$fldvalue}{$org}
{/foreach} + {/if} +
+ {if $uitype eq 20} + * + {/if} + {$fldlabel} + + + + {if $uitype eq 24} + * + {/if} + {$fldlabel} + + + + {if $uitype eq 16} + * + {/if} + {$fldlabel} + + + {$fldlabel} + + + *{$fldlabel} + {$fldlabel} + {if $uitype eq '32' || $uitype eq '31'} + {if $secondvalue == 1} + + {else} + + {/if} + {$MOD.LBL_EXTEND_PARENT} +
+ + {else} + {if $secondvalue == 1} + + {$MOD.LBL_INHERIT_PARENT} +
+ + {else} + + {$MOD.LBL_INHERIT_PARENT} +
+ + {/if} + {/if} +
+ {$fldlabel} + + + + {$fldlabel} + + {assign var=check value=1} + {foreach key=key_one item=arr from=$fldvalue} + {foreach key=sel_value item=value from=$arr} + {if $value ne ''} + {assign var=check value=$check*0} + {else} + {assign var=check value=$check*1} + {/if} + {/foreach} + {/foreach} + + {if $check eq 0} + {assign var=select_user value='checked'} + {assign var=style_user value='display:block'} + {assign var=style_group value='display:none'} + {else} + {assign var=select_group value='checked'} + {assign var=style_user value='display:none'} + {assign var=style_group value='display:block'} + {/if} + +  {$APP.LBL_USER} + + {if $secondvalue neq ''} +  {$APP.LBL_GROUP} + {/if} + + + + + {if $secondvalue neq ''} + + + + {/if} + + {$fldlabel} + + {if $uitype eq 52} + + {else} + + + {$fldlabel} + +  Select  + + *{$fldlabel} + +  Select + + *{$fldlabel} + +  Select + + {$fldlabel} + +  Select  + + {if $uitype eq 81} + * + {assign var="pop_type" value="specific_vendor_address"} + {else}{assign var="pop_type" value="specific"} + {/if} + {$fldlabel} + +  Select + {if $uitype eq 75} +   + {/if} + + {$fldlabel} + +  Select  + + {$fldlabel} + +  Select  + + {$fldlabel} + +  Select  + + {$fldlabel} + +  Select  + + {$fldlabel} + +  Select  + + {$fldlabel} + +   http://  + + + {$fldlabel} + + Skype + + {$fldlabel} + + {if $secondvalue == 1} + + {$MOD.LBL_INHERIT_PARENT} +
+   http://  + + {else} + + {$MOD.LBL_INHERIT_PARENT} +
+   http://  + + {/if} +
+ {if $uitype eq 72} + * + {/if} + {$fldlabel} + + + + {$fldlabel} + + + + + + + + + + {$fldlabel} + + {foreach key=date_value item=time_value from=$fldvalue} + {assign var=date_val value="$date_value"} + {assign var=time_val value="$time_value"} + {/foreach} + + + + + {if $uitype eq 6} + + {/if} + + {foreach key=date_format item=date_str from=$secondvalue} + {assign var=dateFormat value="$date_format"} + {assign var=dateStr value="$date_str"} + {/foreach} + + {if $uitype eq 5 || $uitype eq 23} +
({$dateStr}) + {else} +
({$dateStr}) + {/if} + + + + +
+ {$fldlabel} + +   + + + {elseif $uitype eq 68 || $uitype eq 66 || $uitype eq 62} + + + + + +  Select  + To:  + +   + +  Select  +
CC:  + + BCC:  + +
+ {$fldlabel} + + +  Select  + {$fldlabel} + + + + *{$fldlabel} + + + + {$fldlabel} + + {if $MODULE eq 'Products'} + +
Files Maximum 6 + + {assign var=image_count value=0} + {if $maindata[3].0.name neq ''} + {foreach name=image_loop key=num item=image_details from=$maindata[3]} +
+   [{$image_details.name}] +
+ {assign var=image_count value=$smarty.foreach.image_loop.iteration} + {/foreach} + {/if} +
+ + + {else} + + + { if $maindata[3].0.name != "" } + +
[{$maindata[3].0.name}] Del
+ {/if} + + {/if} +
+ {$fldlabel} + + + {$fldvalue} + + {$fldlabel} + + {if ($secondvalue eq 1 && $CURRENT_USERID != $smarty.request.record) || ($MODE == 'create')} + + {else} + + + {/if} + + {if ($secondvalue eq 1 && $CURRENT_USERID != $smarty.request.record) || ($MODE == 'create')} + + {else} + + {/if} + + * + {$fldlabel} + + {if $thirdvalue eq 1} +   + + {else} +   + {/if} + + + * + {$fldlabel} + + {$fldlabel} + + {if $secondvalue eq 1} + + {/if} + {foreach item=arr from=$fldvalue} + {foreach key=sel_value item=value from=$arr} + + {/foreach} + {/foreach} + + + {$fldlabel} + + + + {$maindata[3].0.name} + + {$fldlabel} +   + {if $fldvalue ne ""} + {$fldvalue} +
+ {/if} + + + +
+ {$fldlabel} + + + + {$fldlabel} + +   + + {$fldlabel} + + {if $secondvalue eq 1} + + {/if} + + {foreach item=arr key=uivalueid from=$fldvalue} + {foreach key=sel_value item=value from=$arr} + + {/foreach} + {/foreach} + + + *{$fldlabel} + + {if $MODE eq 'edit'} + + {else} + + {/if} + + *{$fldlabel} + + + + {$fldlabel} + + {assign var=check value=$secondvalue[0]} + {assign var=yes_val value=$secondvalue[1]} + {assign var=no_val value=$secondvalue[2]} + +  {$yes_val}  +  {$no_val}  + + {foreach item=val_arr from=$fldvalue} + {assign var=start value="$val_arr[0]"} + {assign var=end value="$val_arr[1]"} + {assign var=sendname value="$val_arr[2]"} + {assign var=disp_text value="$val_arr[3]"} + {assign var=sel_val value="$val_arr[4]"} + +  {$disp_text} + {/foreach} + + {$tax.taxlabel} {$APP.COVERED_PERCENTAGE} + + + +
 
{$BLOCKS.4.Description.value}
{$elements.value}
- - - - - - -
- - - {if $BLOCKS neq ''} - - - {else} - - {/if} - -
-   - {if $EMAIL_FLAG neq 'WEBMAIL'} -   - {else} -   - {/if} - {foreach item=row from=$BLOCKS} - {foreach item=elements key=title from=$row} - {if $elements.fldname eq 'filename' && $elements.value != ''} - - {/if} - {/foreach} - {/foreach} -  
-
- {foreach item=row from=$BLOCKS} - {foreach item=elements from=$row} - {if $elements.fldname eq 'subject'} - - {if $EMAIL_FLAG neq 'WEBMAIL'} - - - - {else} - - {/if} - - -
{$MOD.LBL_TO} {$TO_MAIL} 
{$MOD.LBL_CC} {$CC_MAIL} 
{$MOD.LBL_BCC} {$BCC_MAIL} 
{$MOD.LBL_FROM} {$TO_MAIL} 
{$MOD.LBL_SUBJECT} {$elements.value} 
 
- {elseif $elements.fldname eq 'description'} -
- {$BLOCKS.4.Description.value} -
- {/if} - {/foreach} - {/foreach} -
-{foreach item=row from=$BLOCKS} - {foreach item=elements key=title from=$row} - {if $elements.fldname eq 'filename'} -
- - {foreach item=attachments from=$elements.options} - - - - {/foreach} -
- {$attachments} -
-
- {/if} - {/foreach} -{/foreach} - +{**} + + + + + + + +
+ + + {if $BLOCKS neq ''} + + + {else} + + {/if} + +
+   + {if $EMAIL_FLAG neq 'WEBMAIL'} +   + {else} +   + {/if} + {foreach item=row from=$BLOCKS} + {foreach item=elements key=title from=$row} + {if $elements.fldname eq 'filename' && $elements.value != ''} + + {/if} + {/foreach} + {/foreach} +  
+
+ {foreach item=row from=$BLOCKS} + {foreach item=elements from=$row} + {if $elements.fldname eq 'subject'} + + {if $EMAIL_FLAG neq 'WEBMAIL'} + + + + {else} + + {/if} + + +
{$MOD.LBL_TO} {$TO_MAIL} 
{$MOD.LBL_CC} {$CC_MAIL} 
{$MOD.LBL_BCC} {$BCC_MAIL} 
{$MOD.LBL_FROM} {$TO_MAIL} 
{$MOD.LBL_SUBJECT} {$elements.value} 
 
+ {elseif $elements.fldname eq 'description'} +
+ {$elements.value} +
+ {/if} + {/foreach} + {/foreach} +
+{foreach item=row from=$BLOCKS} + {foreach item=elements key=title from=$row} + {if $elements.fldname eq 'filename'} +
+ + {foreach item=attachments from=$elements.options} + + + + {/foreach} +
+ {$attachments} +
+
+ {/if} + {/foreach} +{/foreach} + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Header.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Header.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Header.tpl Tue Nov 14 03:16:10 2006 @@ -36,6 +36,21 @@ + {if $USER_ORGANIZATIONS_COUNT gt 1} + + {else} + + {/if} @@ -145,6 +160,26 @@
- + {**} @@ -141,7 +160,7 @@ {/if} {else}
-
vtiger CRM + + {$CURRENT_ORGANIZATION}  {$ANNOUNCEMENT}
+
@@ -169,75 +188,12 @@ - -
{$APP.LBL_HOMEPAGE_DASHBOARD} - {if $ACTIVITIES.0.Entries.noofactivities > 0} - - - - - - - - - - - - -
{$MOD.LBL_UPCOMING_EVENTS}
- - {if $ACTIVITIES.0.Entries.noofactivities eq 1} - {$ACTIVITIES.0.Entries.noofactivities} {$APP.Event} {$APP.LBL_FOR} {$MOD[$ACTIVITIES.0.Title.0]} - {else} - {$ACTIVITIES.0.Entries.noofactivities} {$APP.Events} {$APP.LBL_FOR} {$MOD[$ACTIVITIES.0.Title.0]} - {/if} -
- - - - {foreach item=entries from=$ACTIVITIES.0.Entries} - - - - - {/foreach} -
{$entries.IMAGE}{$entries.0}
{$entries.ACCOUNT_NAME}
-
-
- {/if} - - -{if $ACTIVITIES.1.Entries.noofactivities > 0} - - - - - - - - - - -
- {$MOD.LBL_PENDING_EVENTS}
- - {if $ACTIVITIES.1.Entries.noofactivities eq 1} - {$ACTIVITIES.1.Entries.noofactivities} {$MOD.LBL_SINGLE_PENDING_EVENT} - {else} - {$ACTIVITIES.1.Entries.noofactivities} {$MOD.LBL_MULTIPLE_PENDING_EVENTS} - {/if} -
- - {foreach item=entries from=$ACTIVITIES.1.Entries} - - - - - {/foreach} -
{$entries.IMAGE}{$entries.0}
{$entries.ACCOUNT_NAME}
-
- -
-{/if} - +
+ {include file="upcomingActivities.tpl"} +

+
+ {include file="pendingActivities.tpl"} +

Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ImportStep2.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ImportStep2.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ImportStep2.tpl Tue Nov 14 03:16:10 2006 @@ -1,160 +1,188 @@ -{**} - - - - - - -{include file='Buttons_List1.tpl'} - -
- - - - - -
- - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$MOD.LBL_MODULE_NAME} {$MODULE}
 
- {$MOD.LBL_STEP_2_3}   - {$MODULE} {$MOD.LBL_LIST_MAPPING} -
- {$MOD.LBL_STEP_2_MSG} {$MODULE} {$MOD.LBL_STEP_2_MSG1} - {$MOD.LBL_STEP_2_TXT} {$MODULE}. -
 
-    - {$MOD.LBL_USE_SAVED_MAPPING}   {$SAVED_MAP_LISTS} -
- - - - {if $HASHEADER eq 1} - - - - {else} - - - - {/if} - -
{$MOD.LBL_MAPPING}{$MOD.LBL_HEADERS}{$MOD.LBL_ROW} 1{$MOD.LBL_ROW} 2{$MOD.LBL_ROW} 1{$MOD.LBL_ROW} 2{$MOD.LBL_ROW} 3
- {assign var="Firstrow" value=$FIRSTROW} - {assign var="Secondrow" value=$SECONDROW} - {assign var="Thirdrow" value=$THIRDROW} - - - - - -
-
- {include file="ImportMap.tpl"} -
-
- - {foreach name=iter item=row1 from=$Firstrow} - {assign var="counter" value=$smarty.foreach.iter.iteration} - {math assign="num" equation="x - y" x=$counter y=1} - - {if $HASHEADER eq 1} - - - - {else} - - - - {/if} - - {/foreach} -
 {$row1} {$Secondrow[$num]} {$Thirdrow[$num]} {$row1} {$Secondrow[$num]} {$Thirdrow[$num]}
-
-
-    - {$MOD.LBL_SAVE_AS_CUSTOM}     - -
- -    - -
- - -
-
- +{**} + + + + + + +{include file='Buttons_List1.tpl'} + + + + + + + +
+ + + + +
+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{$MOD.LBL_MODULE_NAME} {$MODULE}
 
+ {$MOD.LBL_STEP_2_3}   + {$MODULE} {$MOD.LBL_LIST_MAPPING} +
+ {$MOD.LBL_STEP_2_MSG} {$MODULE} {$MOD.LBL_STEP_2_MSG1} + {$MOD.LBL_STEP_2_TXT} {$MODULE}. +
 
+    + {$MOD.LBL_USE_SAVED_MAPPING}   {$SAVED_MAP_LISTS} +
+ + + + {if $HASHEADER eq 1} + + + + {else} + + + + {/if} + +
{$MOD.LBL_MAPPING}{$MOD.LBL_HEADERS}{$MOD.LBL_ROW} 1{$MOD.LBL_ROW} 2{$MOD.LBL_ROW} 1{$MOD.LBL_ROW} 2{$MOD.LBL_ROW} 3
+ {assign var="Firstrow" value=$FIRSTROW} + {assign var="Secondrow" value=$SECONDROW} + {assign var="Thirdrow" value=$THIRDROW} + + + + + +
+
+ {include file="ImportMap.tpl"} +
+
+ + {foreach name=iter item=row1 from=$Firstrow} + {assign var="counter" value=$smarty.foreach.iter.iteration} + {math assign="num" equation="x - y" x=$counter y=1} + + {if $HASHEADER eq 1} + + + + {else} + + + + {/if} + + {/foreach} +
 {$row1} {$Secondrow[$num]} {$Thirdrow[$num]} {$row1} {$Secondrow[$num]} {$Thirdrow[$num]}
+
+
+    + {$MOD.LBL_SAVE_AS_CUSTOM}     + +
+ +    + +
+
+ +
+
+ Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryCreateView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryCreateView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryCreateView.tpl Tue Nov 14 03:16:10 2006 @@ -1,205 +1,205 @@ -{**} - -{**} - - - - - - - - - - -{include file='Buttons_List1.tpl'} - -{**} - - - - - - - -
- - - {**} - {include file='EditViewHidden.tpl'} -
- - {if $OP_MODE eq 'edit_view'} - [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
- {$UPDATEINFO} - {/if} - {if $OP_MODE eq 'create_view'} - {$APP.LBL_CREATING} {$APP.LBL_NEW} {$MOD[$SINGLE_MOD]}
- {/if} - -
-
- - - - {**} - - - - - - - -
- - - - - {if $BLOCKS_COUNT eq 2} - - - - {else} - - - {/if} - -
 {$APP.LBL_BASIC} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION}  {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} 
-
- - {foreach item=blockInfo key=divName from=$BLOCKS} - -
- - - - - - -
- - - - - - - - - -
- - - - - - - {foreach key=header item=data from=$blockInfo} - - {if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} - - - - {else} - - - - - {include file="DisplayFields.tpl"} - - - {/foreach} - - - {if $divName eq 'basicTab'} - {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} - - - {if $AVAILABLE_PRODUCTS eq true} - {include file="Inventory/ProductDetailsEditView.tpl"} - {else} - {include file="Inventory/ProductDetails.tpl"} - {/if} - - {/if} - {/if} - - - - -
-
- - -
-
- {$header} - {$APP.LBL_RCPY_ADDRESS} - {$APP.LBL_LCPY_ADDRESS} - {$header} - {/if} -
 
-
- - -
-
- -
-
- -
- {/foreach} -
-
-
- - - - - - +{**} + +{**} + + + + + + + + + + +{include file='Buttons_List1.tpl'} + +{**} + + + + + + + +
+ + + {**} + {include file='EditViewHidden.tpl'} +
+ + {if $OP_MODE eq 'edit_view'} + [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
+ {$UPDATEINFO} + {/if} + {if $OP_MODE eq 'create_view'} + {$APP.LBL_CREATING} {$APP.LBL_NEW} {$MOD[$SINGLE_MOD]}
+ {/if} + +
+
+ + + + {**} + + + + + + + +
+ + + + + {if $BLOCKS_COUNT eq 2} + + + + {else} + + + {/if} + +
 {$APP.LBL_BASIC} {$APP.LBL_INFORMATION}{$APP.LBL_MORE} {$APP.LBL_INFORMATION}  {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} 
+
+ + {foreach item=blockInfo key=divName from=$BLOCKS} + +
+ + + + + + +
+ + + + + + + + + +
+ + + + + + + {foreach key=header item=data from=$blockInfo} + + {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} + + + + {else} + + + + + {include file="DisplayFields.tpl"} + + + {/foreach} + + + {if $divName eq 'basicTab'} + {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} + + + {if $AVAILABLE_PRODUCTS eq true} + {include file="Inventory/ProductDetailsEditView.tpl"} + {else} + {include file="Inventory/ProductDetails.tpl"} + {/if} + + {/if} + {/if} + + + + +
+
+ + +
+
+ {$header} + {$APP.LBL_RCPY_ADDRESS} + {$APP.LBL_LCPY_ADDRESS} + {$header} + {/if} +
 
+
+ + +
+
+ +
+
+ +
+ {/foreach} +
+
+
+ + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryDetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryDetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryDetailView.tpl Tue Nov 14 03:16:10 2006 @@ -1,326 +1,339 @@ -{**} - - - -
- - - - - - - -
- {include file='Buttons_List1.tpl'} - - - - - - - - -
- -
- - - - - - - - - -
- [ {$ID} ] {$NAME} - {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}   -  
{$UPDATEINFO}
- -
- - - - - - - - - -
- - - - - - {if $SinglePane_View eq 'false'} - - {/if} - - -
 {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION} {$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
-
- - - - - -
- - - - - - -
- - - - -
- {include file='DetailViewHidden.tpl'} - - {strip} - - - - {/strip} -
- {if $EDIT_DUPLICATE eq 'permitted'} -   -   - {/if} - {if $DELETE eq 'permitted'} -   - {/if} - -
- - - -{foreach key=header item=detail from=$BLOCKS} - - - - - - - - - {strip} - - {/strip} - - - {foreach item=detail from=$detail} - - {foreach key=label item=data from=$detail} - {assign var=keyid value=$data.ui} - {assign var=keyval value=$data.value} - {assign var=keytblname value=$data.tablename} - {assign var=keyfldname value=$data.fldname} - {assign var=keyoptions value=$data.options} - {assign var=keysecid value=$data.secid} - {assign var=keyseclink value=$data.link} - {assign var=keycursymb value=$data.cursymb} - {assign var=keysalut value=$data.salut} - {assign var=keycntimage value=$data.cntimage} - {assign var=keyadmin value=$data.isadmin} - - - {if $label ne ''} - {if $keycntimage ne ''} - - {elseif $label neq 'Tax Class'} - {if $keyid eq '71' || $keyid eq '72'} - - {else} - - {/if} - {/if} - {if $EDIT_PERMISSION eq 'yes'} - {include file="DetailViewUI.tpl"} - {else} - {include file="DetailViewFields.tpl"} - {/if} - {else} - - - {/if} - {/foreach} - - {/foreach} -
    -
- - {$header} - -
{$keycntimage}{$label} ({$keycursymb}){$label}  
-{/foreach} -{*-- End of Blocks--*} - - -
- - - {$ASSOCIATED_PRODUCTS} - -
- -
- {if $SinglePane_View eq 'false'} - - {strip} - - - - {/strip} -
- {if $EDIT_DUPLICATE eq 'permitted'} -   -   - {/if} - {if $DELETE eq 'permitted'} -   - {/if} - -
-{/if} - - - -
- {if $SinglePane_View eq 'true'} - {include file= 'RelatedListNew.tpl'} - {/if} -
-
- - -
- - {include file="Inventory/InventoryActions.tpl"} - -
- - - - - -
- -
- -
- {include file="TagCloudDisplay.tpl"} -
-
-
- -
- -
- -
- - - - -
- - +{**} + + + +
+ + + + + + + +
+ {include file='Buttons_List1.tpl'} + + + + + + + + +
+ +
+ + + + + + + + + +
+ [ {$ID} ] {$NAME} - {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}   +  
{$UPDATEINFO}
+ +
+ + + + + + + + + +
+ + + + + + {if $SinglePane_View eq 'false'} + + {/if} + + +
 {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION} {$APP.LBL_MORE} {$APP.LBL_INFORMATION} 
+
+ + + + + +
+ + + + + + +
+ + + + +
+ {include file='DetailViewHidden.tpl'} + + {strip} + + + + {/strip} +
+ + + + + +
+ {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + + {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + {if $DELETE eq 'permitted'} +   + {/if} +
+ +
+ + + +{foreach key=header item=detail from=$BLOCKS} + + + + + + + + + {strip} + + {/strip} + + + {foreach item=detail from=$detail} + + {foreach key=label item=data from=$detail} + {assign var=keyid value=$data.ui} + {assign var=keyval value=$data.value} + {assign var=keytblname value=$data.tablename} + {assign var=keyfldname value=$data.fldname} + {assign var=keyoptions value=$data.options} + {assign var=keysecid value=$data.secid} + {assign var=keyseclink value=$data.link} + {assign var=keycursymb value=$data.cursymb} + {assign var=keysalut value=$data.salut} + {assign var=keycntimage value=$data.cntimage} + {assign var=keyadmin value=$data.isadmin} + + + {if $label ne ''} + {if $keycntimage ne ''} + + {elseif $label neq 'Tax Class'} + {if $keyid eq '71' || $keyid eq '72'} + + {else} + + {/if} + {/if} + {if $EDIT_PERMISSION eq 'yes'} + {include file="DetailViewUI.tpl"} + {else} + {include file="DetailViewFields.tpl"} + {/if} + {else} + + + {/if} + {/foreach} + + {/foreach} +
    +
+ + {$header} + +
{$keycntimage}{$label} ({$keycursymb}){$label}  
+{/foreach} +{*-- End of Blocks--*} + + +
+ + + {$ASSOCIATED_PRODUCTS} + +
+ +
+ {if $SinglePane_View eq 'false'} + + {strip} + + + + {/strip} +
+ + + + + +
+ {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + + {if $EDIT_DUPLICATE eq 'permitted'} +   + {/if} + {if $DELETE eq 'permitted'} +   + {/if} +
+ + +
+{/if} + + + +
+ {if $SinglePane_View eq 'true'} + {include file= 'RelatedListNew.tpl'} + {/if} +
+
+ + +
+ + {include file="Inventory/InventoryActions.tpl"} + +
+ +
+ {include file="TagCloudDisplay.tpl"} +
+
+
+ +
+ +
+ +
+ + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryEditView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryEditView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Inventory/InventoryEditView.tpl Tue Nov 14 03:16:10 2006 @@ -1,197 +1,197 @@ -{**} - -{**} - - - - - - - - - - {include file='Buttons_List1.tpl'} - -{**} - - - - - - -
- {**} -
- - {if $OP_MODE eq 'edit_view'} - [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
- {$UPDATEINFO} - {/if} - {if $OP_MODE eq 'create_view'} - {$APP.LBL_CREATING} {$MOD[$SINGLE_MOD]}
- {/if} - -
-
- - {include file='EditViewHidden.tpl'} - - {**} - - - - - - - -
- - - - - - - -
 {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  
-
- - - - - - - -
- {**} - - - - - - - - -
- - - - - - - - {foreach key=header item=data from=$BLOCKS} - - {if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} - - - - {else} - - - - - {include file="DisplayFields.tpl"} - - - - {/foreach} - - - - {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} - - - - {/if} - - - - -
-
- - -
-
- {$header} - {$APP.LBL_RCPY_ADDRESS} - {$APP.LBL_LCPY_ADDRESS} - {$header} - {/if} -
 
- {include file="Inventory/ProductDetailsEditView.tpl"} -
-
- - -
-
-
-
- - {include file="Inventory/InventoryActions.tpl"} -
-
-
-
- - - - - - +{**} + +{**} + + + + + + + + + + {include file='Buttons_List1.tpl'} + +{**} + + + + + + +
+ {**} +
+ + {if $OP_MODE eq 'edit_view'} + [ {$ID} ] {$NAME} - {$APP.LBL_EDITING} {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}
+ {$UPDATEINFO} + {/if} + {if $OP_MODE eq 'create_view'} + {$APP.LBL_CREATING} {$MOD[$SINGLE_MOD]}
+ {/if} + +
+
+ + {include file='EditViewHidden.tpl'} + + {**} + + + + + + + +
+ + + + + + + +
 {$MOD[$SINGLE_MOD]} {$APP.LBL_INFORMATION}  
+
+ + + + + + + +
+ {**} + + + + + + + + +
+ + + + + + + + {foreach key=header item=data from=$BLOCKS} + + {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Contacts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} + + + + {else} + + + + + {include file="DisplayFields.tpl"} + + + + {/foreach} + + + + {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} + + + + {/if} + + + + +
+
+ + +
+
+ {$header} + {$APP.LBL_RCPY_ADDRESS} + {$APP.LBL_LCPY_ADDRESS} + {$header} + {/if} +
 
+ {include file="Inventory/ProductDetailsEditView.tpl"} +
+
+ + +
+
+
+
+ + {include file="Inventory/InventoryActions.tpl"} +
+
+
+
+ + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ListEmailTemplates.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ListEmailTemplates.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ListEmailTemplates.tpl Tue Nov 14 03:16:10 2006 @@ -1,155 +1,192 @@ -{**} - - -
- - - - - -
-
-
- - {include file='SetMenu.tpl'} - - - - - - - - - - - - - - -
{$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES}
{$UMOD.LBL_EMAIL_TEMPLATE_DESC}
- -
- - - - -
- - - - - - -
{$UMOD.LBL_EMAIL_TEMPLATES}  -
- - - - - - -
- - - - - - - - - {foreach name=emailtemplate item=template from=$TEMPLATES} - - - - - - - - {/foreach} -
#{$UMOD.LBL_LIST_SELECT}{$UMOD.LBL_EMAIL_TEMPLATE}{$UMOD.LBL_DESCRIPTION}{$UMOD.LBL_TEMPLATE_TOOLS}
{$smarty.foreach.emailtemplate.iteration} - {$template.templatename} - {$template.description}  - {$UMOD.LNK_SAMPLE_EMAIL} -
- - - - -
{$MOD.LBL_SCROLL}
-
- - - -
- - - - - - - - - - - +{**} + + + +
+ + + + + +
+
+
+ + {include file='SetMenu.tpl'} + + + + + + + + + + + + + + +
{$MOD.LBL_SETTINGS} > {$UMOD.LBL_EMAIL_TEMPLATES}
{$UMOD.LBL_EMAIL_TEMPLATE_DESC}
+ +
+ + + + +
+ + + + + + +
{$UMOD.LBL_EMAIL_TEMPLATES}  +
+ + + + + + +
+ + + + + + + + + {foreach name=emailtemplate item=template from=$TEMPLATES} + + + + + + + + {/foreach} +
#{$UMOD.LBL_LIST_SELECT}{$UMOD.LBL_EMAIL_TEMPLATE}{$UMOD.LBL_DESCRIPTION}{$UMOD.LBL_TEMPLATE_TOOLS}
{$smarty.foreach.emailtemplate.iteration} + {$template.templatename} + {$template.description}  + {$UMOD.LNK_SAMPLE_EMAIL} +
+ + + + +
{$MOD.LBL_SCROLL}
+
+ + + +
+ + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ListRoles.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ListRoles.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ListRoles.tpl Tue Nov 14 03:16:10 2006 @@ -1,270 +1,270 @@ -{**} - - - - - -
- - - - - -
-
-
- - {include file="SetMenu.tpl"} - - - - - - - - - -
Roles{$MOD.LBL_SETTINGS} > {$MOD.LBL_ROLES}
{$MOD.LBL_ROLE_DESCRIPTION}
- -
- - - - -
- - - - - - -
{$MOD.LBL_ROLE_HIERARCHY_TREE} 
- -
- {include file='RoleTree.tpl'} -
- -{* - - - -
- -
 Organization
-
Administrator
-
CEO
-
Manager - Sales
-
Asst Manager - Sales
-
Manager - Products
-
Asst Manager - Products
-
Manager - Office
-
Asst Manager - Office
-
CFO
-
*} - - - - - - -
{$MOD.LBL_SCROLL}
-
- - - -
- - - - - - - - - - - -
 
- - +{**} + + + + + +
+ + + + + +
+
+
+ + {include file="SetMenu.tpl"} + + + + + + + + + +
Roles{$MOD.LBL_SETTINGS} > {$MOD.LBL_ROLES}
{$MOD.LBL_ROLE_DESCRIPTION}
+ +
+ + + + +
+ + + + + + +
{$MOD.LBL_ROLE_HIERARCHY_TREE} 
+ +
+ {include file='RoleTree.tpl'} +
+ +{* + + + +
+ +
 Organization
+
Administrator
+
CEO
+
Manager - Sales
+
Asst Manager - Sales
+
Manager - Products
+
Asst Manager - Products
+
Manager - Office
+
Asst Manager - Office
+
CFO
+
*} + + + + + + +
{$MOD.LBL_SCROLL}
+
+ + + +
+ + + + + + + + + + + +
 
+ + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ListView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ListView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ListView.tpl Tue Nov 14 03:16:10 2006 @@ -21,7 +21,20 @@ {/if} - - -
- - - - - - - - - - - - - - - -

- {$MOD.LBL_SETTINGS} > {$MOD.LBL_UPGRADE_VTIGER} -
-
 
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {if $GET_MYSQL_PATH eq 1} - - - - - {/if} - - - -
- {$MOD.LBL_UPGRADE_VTIGER}
- ({$MOD.LBL_UPGRADE_FROM_VTIGER_423}) -
- {$MOD.LBL_STEP} 1 : - {$MOD.LBL_SELECT_SOURCE}
- {$MOD.LBL_STEP1_DESC}

-
- - - {$MOD.LBL_RADIO_BUTTON1_TEXT}

- {$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON1_DESC} -
- - - {$MOD.LBL_RADIO_BUTTON2_TEXT}

- {$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON2_DESC} -
- - - {$MOD.LBL_RADIO_BUTTON3_TEXT}

{$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON3_DESC} -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- {$MOD.LBL_STEP} 2 : - {$MOD.LBL_HOST_DB_ACCESS_DETAILS}

-
{$MOD.LBL_SOURCE_HOST_NAME}
{$MOD.LBL_SOURCE_MYSQL_PORT_NO}
{$MOD.LBL_SOURCE_MYSQL_USER_NAME}
{$MOD.LBL_SOURCE_MYSQL_PASSWORD}
{$MOD.LBL_SOURCE_DB_NAME}
-
- - -
- - - - - - - - - - - - - -
- {$MOD.LBL_STEP} 2 : - {$MOD.LBL_LOCATE_DB_DUMP_FILE}

-
  - {$MOD.LBL_DUMP_FILE_LOCATION} - -
{$MOD.LBL_NOTE_TITLE}{$MOD.LBL_NOTES_DUMP_PROCESS}
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- {$MOD.LBL_STEP} 2 : - {$MOD.LBL_HOST_DB_ACCESS_DETAILS}

-
 {$MOD.LBL_MYSQL_HOST_NAME_IP}
 {$MOD.LBL_MYSQL_PORT}
 {$MOD.LBL_MYSQL_USER_NAME}
 {$MOD.LBL_MYSQL_PASSWORD}
 {$MOD.LBL_DB_NAME}
{$MOD.LBL_NOTE_TITLE} - - {$MOD.LBL_RADIO_BUTTON3_PROCESS} -
-
- - -
- -
- - - - - - - - -
- {$MOD.LBL_STEP} 3 : - {$MOD.LBL_ENTER_MYSQL_SERVER_PATH}
{$MOD.LBL_SERVER_PATH_DESC}

-
{$MOD.LBL_MYSQL_SERVER_PATH} - -
-
- - -
- -   -
-
-
-
 
- -
- - - +{**} + + + + + +
+ + + + + + + + + + + + + + + +

+ {$MOD.LBL_SETTINGS} > {$MOD.LBL_UPGRADE_VTIGER} + +               + {if $502_PATCH eq 'apply'} + Click here to apply the 5.0.2 Database changes from 5.0.0/5.0.1 + {/if} + +
+
 
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {if $GET_MYSQL_PATH eq 1} + + + + + {/if} + + + +
+ {$MOD.LBL_UPGRADE_VTIGER}
+ ({$MOD.LBL_UPGRADE_FROM_VTIGER_423}) +
+ {$MOD.LBL_STEP} 1 : + {$MOD.LBL_SELECT_SOURCE}
+ {$MOD.LBL_STEP1_DESC}

+
+ + + {$MOD.LBL_RADIO_BUTTON1_TEXT}

+ {$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON1_DESC} +
+ + + {$MOD.LBL_RADIO_BUTTON2_TEXT}

+ {$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON2_DESC} +
+ + + {$MOD.LBL_RADIO_BUTTON3_TEXT}

{$MOD.LBL_NOTE_TITLE} {$MOD.LBL_RADIO_BUTTON3_DESC} +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ {$MOD.LBL_STEP} 2 : + {$MOD.LBL_HOST_DB_ACCESS_DETAILS}

+
{$MOD.LBL_SOURCE_HOST_NAME}
{$MOD.LBL_SOURCE_MYSQL_PORT_NO}
{$MOD.LBL_SOURCE_MYSQL_USER_NAME}
{$MOD.LBL_SOURCE_MYSQL_PASSWORD}
{$MOD.LBL_SOURCE_DB_NAME}
+
+ + +
+ + + + + + + + + + + + + +
+ {$MOD.LBL_STEP} 2 : + {$MOD.LBL_LOCATE_DB_DUMP_FILE}

+
  + {$MOD.LBL_DUMP_FILE_LOCATION} + +
{$MOD.LBL_NOTE_TITLE}{$MOD.LBL_NOTES_DUMP_PROCESS}
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ {$MOD.LBL_STEP} 2 : + {$MOD.LBL_HOST_DB_ACCESS_DETAILS}

+
 {$MOD.LBL_MYSQL_HOST_NAME_IP}
 {$MOD.LBL_MYSQL_PORT}
 {$MOD.LBL_MYSQL_USER_NAME}
 {$MOD.LBL_MYSQL_PASSWORD}
 {$MOD.LBL_DB_NAME}
{$MOD.LBL_NOTE_TITLE} + + {$MOD.LBL_RADIO_BUTTON3_PROCESS} +
+
+ + +
+ +
+ + + + + + + + +
+ {$MOD.LBL_STEP} 3 : + {$MOD.LBL_ENTER_MYSQL_SERVER_PATH}
{$MOD.LBL_SERVER_PATH_DESC}

+
{$MOD.LBL_MYSQL_SERVER_PATH} + +
+
+ + +
+ +   +
+
+
+
 
+ +
+ + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Popup.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Popup.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Popup.tpl Tue Nov 14 03:16:10 2006 @@ -18,7 +18,7 @@ Modified: vtigercrm/branches/5.1_jens/Smarty/templates/ProfileDetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/ProfileDetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/ProfileDetailView.tpl Tue Nov 14 03:16:10 2006 @@ -1,312 +1,398 @@ -{**} -{literal} - -{/literal} - - -
- - - - - -
-
-
- {include file='SetMenu.tpl'} -
- - - - - - - - - - - - - - - -
{$MOD.LBL_PROFILES}{$MOD.LBL_SETTINGS} > {$CMOD.LBL_PROFILE_PRIVILEGES} > {$CMOD.LBL_VIEWING} "{$PROFILE_NAME}"
{$CMOD.LBL_PROFILE_MESG} "{$PROFILE_NAME}"
- - - - - - -
- - - - -
- - - - - -
- - - - - -
- - - - - - - - -
- - - - -
- - - - - - - -
{$CMOD.LBL_DEFINE_PRIV_FOR} <{$PROFILE_NAME}>
- {$CMOD.LBL_USE_OPTION_TO_SET_PRIV}
 
- - - - - -
- - - - -
- - - - - - -
{$CMOD.LBL_SUPER_USER_PRIV}
- - - - - -
  - - - - - - - - - - - - - - - - - - - - - -
{$GLOBAL_PRIV.0}{$CMOD.LBL_VIEW_ALL}
{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_VIEW}
 
{$GLOBAL_PRIV.1}{$CMOD.LBL_EDIT_ALL}
{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_EDIT}
-
-
- - - - - -
{$CMOD.LBL_SET_PRIV_FOR_EACH_MODULE}
- - - - - - -
  - - - - - - - - - - - - - - - {foreach key=tabid item=elements from=$TAB_PRIV} - - {assign var=modulename value=$TAB_PRIV[$tabid][0]} - - - - - - - - - - - {/foreach} - -
{$CMOD.LBL_TAB_MESG_OPTION}
{$CMOD.LBL_EDIT_PERMISSIONS}
{$CMOD.LBL_FIELDS_AND_TOOLS_SETTINGS}
{$CMOD.LBL_CREATE_EDIT} -
{$CMOD.LBL_VIEW}
{$CMOD.LBL_DELETE}
- {$TAB_PRIV[$tabid][1]} -

{$APP[$modulename]}

 
- {$STANDARD_PRIV[$tabid][1]} -
 
- {$STANDARD_PRIV[$tabid][3]} -
 
- {$STANDARD_PRIV[$tabid][2]} -
 
- {if $FIELD_PRIVILEGES[$tabid] neq NULL || $modulename eq 'Emails'} - {$APP.LBL_EXPAND_COLLAPSE} - {/if} -
- - - {if $FIELD_PRIVILEGES[$tabid] neq ''} - - {if $modulename eq 'Calendar'} - - {else} - - {/if} - - {/if} - {foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]} - - {foreach item=element from=$row_values} - - - {/foreach} - - {/foreach} - {if $modulename eq 'Calendar'} - - - - {foreach item=row_values from=$FIELD_PRIVILEGES[16]} - - {foreach item=element from=$row_values} - - - {/foreach} - - {/foreach} - {/if} - {if $UTILITIES_PRIV[$tabid] neq ''} - - - - {/if} - {foreach item=util_value from=$UTILITIES_PRIV[$tabid]} - - {foreach item=util_elements from=$util_value} - - - {/foreach} - - {/foreach} - -
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Tasks}){$CMOD.LBL_FIELDS_SELECT_DESELECT}
{$element.1}{$element.0}
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Events})
{$element.1}{$element.0}
{$CMOD.LBL_TOOLS_TO_BE_SHOWN}
{$util_elements.1}{$APP[$util_elements.0]}
-
-
-
- - - - - - -
*{$CMOD.LBL_MANDATORY_MSG}
*{$CMOD.LBL_DISABLE_FIELD_MSG}
-
- - - - - - - - - -
 
-
-
-
- - - - - - - -
-

 

- - -
{$MOD.LBL_SCROLL}
- -
- - - - - - - - - - - - - - - - +{**} +{literal} + +{/literal} + + + +{/literal} + +
+ + + + + +
+
+
+ {include file='SetMenu.tpl'} + +
+ + + + + + + + + + + + + + + + +
{$MOD.LBL_PROFILES}{$MOD.LBL_SETTINGS} > {$CMOD.LBL_PROFILE_PRIVILEGES} > {$CMOD.LBL_VIEWING} "{$PROFILE_NAME}"
{$CMOD.LBL_PROFILE_MESG} "{$PROFILE_NAME}"
+ + + + + + +
+ + + + +
+ + + + + +
+ + + + + +
+ + + + + + + + +
+ + + + +
+ + + + + + + +
{$CMOD.LBL_DEFINE_PRIV_FOR} <{$PROFILE_NAME}>
+ {$CMOD.LBL_USE_OPTION_TO_SET_PRIV}
   +
+ + + + + + + + + + +
+ + + + +
+ + + + + + +
{$CMOD.LBL_SUPER_USER_PRIV}
+ + + + + +
  + + + + + + + + + + + + + + + + + + + + + +
{$GLOBAL_PRIV.0}{$CMOD.LBL_VIEW_ALL}
{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_VIEW}
 
{$GLOBAL_PRIV.1}{$CMOD.LBL_EDIT_ALL}
{$CMOD.LBL_ALLOW} "{$PROFILE_NAME}" {$CMOD.LBL_MESG_EDIT}
+
+
+ + + + + +
{$CMOD.LBL_SET_PRIV_FOR_EACH_MODULE}
+ + + + + + +
  + + + + + + + + + + + + + + + {foreach key=tabid item=elements from=$TAB_PRIV} + + {assign var=modulename value=$TAB_PRIV[$tabid][0]} + + + + + + + + + + + {/foreach} + +
{$CMOD.LBL_TAB_MESG_OPTION}
{$CMOD.LBL_EDIT_PERMISSIONS}
{$CMOD.LBL_FIELDS_AND_TOOLS_SETTINGS}
{$CMOD.LBL_CREATE_EDIT} +
{$CMOD.LBL_VIEW}
{$CMOD.LBL_DELETE}
+ {$TAB_PRIV[$tabid][1]} +

{$APP[$modulename]}

 
+ {$STANDARD_PRIV[$tabid][1]} +
 
+ {$STANDARD_PRIV[$tabid][3]} +
 
+ {$STANDARD_PRIV[$tabid][2]} +
 
+ {if $FIELD_PRIVILEGES[$tabid] neq NULL || $modulename eq 'Emails'} + {$APP.LBL_EXPAND_COLLAPSE} + {/if} +
+ + + {if $FIELD_PRIVILEGES[$tabid] neq ''} + + {if $modulename eq 'Calendar'} + + {else} + + {/if} + + {/if} + {foreach item=row_values from=$FIELD_PRIVILEGES[$tabid]} + + {foreach item=element from=$row_values} + + + {/foreach} + + {/foreach} + {if $modulename eq 'Calendar'} + + + + {foreach item=row_values from=$FIELD_PRIVILEGES[16]} + + {foreach item=element from=$row_values} + + + {/foreach} + + {/foreach} + {/if} + {if $UTILITIES_PRIV[$tabid] neq ''} + + + + {/if} + {foreach item=util_value from=$UTILITIES_PRIV[$tabid]} + + {foreach item=util_elements from=$util_value} + + + {/foreach} + + {/foreach} + +
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Tasks}){$CMOD.LBL_FIELDS_SELECT_DESELECT}
{$element.1}{$element.0}
{$CMOD.LBL_FIELDS_SELECT_DESELECT} ({$APP.Events})
{$element.1}{$element.0}
{$CMOD.LBL_TOOLS_TO_BE_SHOWN}
{$util_elements.1}{$APP[$util_elements.0]}
+
+
+
+ + + + + + +
*{$CMOD.LBL_MANDATORY_MSG}
*{$CMOD.LBL_DISABLE_FIELD_MSG}
+
+ + + + + + + + + +
 
+
+
+
+ + + + + + + +
+

 

+ + +
{$MOD.LBL_SCROLL}
+ +
+ + + + + + + + + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/QuickCreate.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/QuickCreate.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/QuickCreate.tpl Tue Nov 14 03:16:10 2006 @@ -68,10 +68,9 @@ Modified: vtigercrm/branches/5.1_jens/Smarty/templates/RelatedListContents.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/RelatedListContents.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/RelatedListContents.tpl Tue Nov 14 03:16:10 2006 @@ -1,146 +1,147 @@ -{**} - -{if $SinglePane_View eq 'true'} - {assign var = return_modname value='DetailView'} -{else} - {assign var = return_modname value='CallRelatedList'} -{/if} - -{foreach key=header item=detail from=$RELATEDLISTS} - - - - - {if $detail ne ''} - - {$detail.navigation.1} - {/if} - - {elseif $header eq 'PriceBooks'} - {if $MODULE eq 'Products'} - - {/if} - {elseif $header eq 'Products'} - {if $MODULE eq 'PriceBooks'} - - {elseif $MODULE eq 'Potentials'} -   - - - {elseif $MODULE eq 'Vendors'} - - {else} - - {/if} - {elseif $header eq 'Leads'} - {if $MODULE eq 'Campaigns'} - {$LEADCVCOMBO} - - {/if} - - {elseif $header eq 'Contacts' } - {if $MODULE eq 'Calendar' || $MODULE eq 'Potentials' || $MODULE eq 'Vendors'} - - {elseif $MODULE eq 'Emails'} -   - - {elseif $MODULE eq 'Campaigns'} - {$CONTCVCOMBO} - - - {else} - - {/if} - {elseif $header eq 'Activities'} - {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'Invoice' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Campaigns'} - - - {else} - -   - - {/if} - {elseif $header eq 'HelpDesk'} - - {elseif $header eq 'Campaigns'} - - {elseif $header eq 'Attachments'} -   - - - {elseif $header eq 'Quotes'} - - {elseif $header eq 'Invoice'} - {if $MODULE eq 'SalesOrder'} - - {else} - - {/if} - {elseif $header eq 'Sales Order'} - {if $MODULE eq 'Quotes'} - - {else} - - {/if} - {elseif $header eq 'Purchase Order'} - - {elseif $header eq 'Emails'} - - - - {elseif $header eq 'Users'} - {if $MODULE eq 'Calendar'} - - {elseif $MODULE eq 'Emails'} -   -   - {/if} - {elseif $header eq 'Activity History'} -   - {/if} - -
{$APP.$header}{$detail.navigation.0} - {if $header eq 'Potentials'} - -
-{if $detail ne ''} - {foreach key=header item=detail from=$detail} - {if $header eq 'header'} - - - {foreach key=header item=headerfields from=$detail} - - {/foreach} - - {elseif $header eq 'entries'} - {foreach key=header item=detail from=$detail} - - {foreach key=header item=listfields from=$detail} - - {/foreach} - - {/foreach} -
{$headerfields}
{$listfields}
- {/if} - {/foreach} -{else} - - - - -
{$APP.LBL_NONE_INCLUDED}
-{/if} -

-{/foreach} +{**} + +{if $SinglePane_View eq 'true'} + {assign var = return_modname value='DetailView'} +{else} + {assign var = return_modname value='CallRelatedList'} +{/if} + +{foreach key=header item=detail from=$RELATEDLISTS} + + + + + {if $detail ne ''} + + {$detail.navigation.1} + {/if} + + {elseif $header eq 'PriceBooks'} + {if $MODULE eq 'Products'} + + {/if} + {elseif $header eq 'Products'} + {if $MODULE eq 'PriceBooks'} + + {elseif $MODULE eq 'Potentials'} +   + + + {elseif $MODULE eq 'Vendors'} + + + {else} + + {/if} + {elseif $header eq 'Leads'} + {if $MODULE eq 'Campaigns'} + {$LEADCVCOMBO} + + {/if} + + {elseif $header eq 'Contacts' } + {if $MODULE eq 'Calendar' || $MODULE eq 'Potentials' || $MODULE eq 'Vendors'} + + {elseif $MODULE eq 'Emails'} +   + + {elseif $MODULE eq 'Campaigns'} + {$CONTCVCOMBO} + + + {else} + + {/if} + {elseif $header eq 'Activities'} + {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'Invoice' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Campaigns'} + + + {else} + +   + + {/if} + {elseif $header eq 'HelpDesk'} + + {elseif $header eq 'Campaigns'} + + {elseif $header eq 'Attachments'} +   + + + {elseif $header eq 'Quotes'} + + {elseif $header eq 'Invoice'} + {if $MODULE eq 'SalesOrder'} + + {else} + + {/if} + {elseif $header eq 'Sales Order'} + {if $MODULE eq 'Quotes'} + + {else} + + {/if} + {elseif $header eq 'Purchase Order'} + + {elseif $header eq 'Emails'} + + + + {elseif $header eq 'Users'} + {if $MODULE eq 'Calendar'} + + {elseif $MODULE eq 'Emails'} +   +   + {/if} + {elseif $header eq 'Activity History'} +   + {/if} + +
{$APP.$header}{$detail.navigation.0} + {if $header eq 'Potentials'} + +
+{if $detail ne ''} + {foreach key=header item=detail from=$detail} + {if $header eq 'header'} + + + {foreach key=header item=headerfields from=$detail} + + {/foreach} + + {elseif $header eq 'entries'} + {foreach key=header item=detail from=$detail} + + {foreach key=header item=listfields from=$detail} + + {/foreach} + + {/foreach} +
{$headerfields}
{$listfields}
+ {/if} + {/foreach} +{else} + + + + +
{$APP.LBL_NONE_INCLUDED}
+{/if} +

+{/foreach} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/SetMenu.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/SetMenu.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/SetMenu.tpl Tue Nov 14 03:16:10 2006 @@ -1,190 +1,192 @@ -{**} - - - + + + +
- - - - + +
- - - - - - - {if $smarty.request.action eq 'index' || $smarty.request.action eq 'DetailView' || $smarty.request.action eq 'EditView' || $smarty.request.action eq 'ListView' } - - {else} - - {/if} - - {if $smarty.request.action eq 'listroles' || $smarty.request.action eq 'RoleDetailView' || $smarty.request.action eq 'saverole' || $smarty.request.action eq 'createrole' || $smarty.request.action eq 'RoleDeleteStep1'} - - {else} - - {/if} - - {if $smarty.request.action eq 'ListProfiles' || $smarty.request.action eq 'profilePrivileges' || $smarty.request.action eq 'CreateProfile' || $smarty.request.action eq 'SaveProfile' || $smarty.request.action eq 'UpdateProfileChanges' } - - {else} - - {/if} - - {if $smarty.request.action eq 'listgroups' || $smarty.request.action eq 'GroupDetailView' || $smarty.request.action eq 'createnewgroup' || $smarty.request.action eq 'SaveGroup'} - - {else} - - {/if} - - {if $smarty.request.action eq 'OrgSharingEditView' || $smarty.request.action eq 'OrgSharingDetailView' || $smarty.request.action eq 'SaveOrgSharing'} - - {else} - - {/if} - - {if $smarty.request.action eq 'DefaultFieldPermissions' || $smarty.request.action eq 'UpdateDefaultFieldLevelAccess' || $smarty.request.action eq 'EditDefOrgFieldLevelAccess' } - - {else} - - {/if} - - {if $smarty.request.action eq 'AuditTrailList'} - - {else} - - {/if} - - {if $smarty.request.action eq 'ListLoginHistory'} - - {else} - - {/if} - - - - {if $smarty.request.action eq 'CustomFieldList' || $smarty.request.action eq 'LeadCustomFieldMapping'} - - {else} - - {/if} - - {if $smarty.request.action eq 'PickList' || $smarty.request.action eq 'SettingsAjax'} - {else} - - {/if} - - - - {if $smarty.request.action eq 'listemailtemplates' || $smarty.request.action eq 'detailviewemailtemplate' || $smarty.request.action eq 'editemailtemplate' || $smarty.request.action eq 'saveemailtemplate' || $smarty.request.action eq 'deleteemailtemplate' || $smarty.request.action eq 'createemailtemplate'} - - {else} - - {/if} - - {if $smarty.request.action eq 'listwordtemplates' || $smarty.request.action eq 'add2db' || $smarty.request.action eq 'deletewordtemplate' || $smarty.request.action eq 'upload'} - - {else} - - {/if} - - {if $smarty.request.action eq 'listnotificationschedulers' || $smarty.request.action eq 'UsersAjax'} - - {else} - - {/if} - - {if $smarty.request.action eq 'listinventorynotifications' || $smarty.request.action eq 'UsersAjax'} - - {else} - - {/if} - - {if $smarty.request.action eq 'OrganizationTermsandConditions' || $smarty.request.action eq 'savetermsandconditions'} - - {else} - - {/if} - - - - {if $smarty.request.action eq 'OrganizationConfig' || $smarty.request.action eq 'EditCompanyDetails' || $smarty.request.action eq 'add2db'} - - {else} - - {/if} - - {if $smarty.request.action eq 'EmailConfig' || $smarty.request.action eq 'Save' } - - {else} - - {/if} - - {if $smarty.request.action eq 'BackupServerConfig' || $smarty.request.action eq 'Save'} - - {else} - - {/if} - - {if $smarty.request.action eq 'ListModuleOwners' || $smarty.request.action eq 'SettingsAjax'} - - {else} - - {/if} - - {if $smarty.request.action eq 'CurrencyListView' || $smarty.request.action eq 'CurrencyEditView' || $smarty.request.action eq 'SaveCurrencyInfo'} - - {else} - - {/if} - - {if $smarty.request.action eq 'TaxConfig'} - - {else} - - {/if} - - {if $smarty.request.action eq 'listsysconfig'} - - {else} - - {/if} - - {if $smarty.request.action eq 'ProxyServerConfig'} - - {else} - - {/if} - - {if $smarty.request.action eq 'Announcements' || $smarty.request.action eq 'UsersAjax' } - - {else} - - {/if} - - {if $smarty.request.action eq 'DefModuleView'} - - {else} - - {/if} - - -
{$MOD.LBL_USER_MANAGEMENT}
{$MOD.LBL_USERS}
{$MOD.LBL_USERS}
{$MOD.LBL_ROLES}
{$MOD.LBL_ROLES}
{$MOD.LBL_PROFILES}
{$MOD.LBL_PROFILES}
{$MOD.USERGROUPLIST}
{$MOD.USERGROUPLIST}
{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_STUDIO}
{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_COMMUNICATION_TEMPLATES}
{$MOD.EMAILTEMPLATES}
{$MOD.EMAILTEMPLATES}
{$MOD.WORDINTEGRATION}
{$MOD.WORDINTEGRATION}
{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.INVENTORYNOTIFICATION}
{$MOD.INVENTORYNOTIFICATION}
{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_OTHER_SETTINGS}
{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_MIGRATION}
- - -
- - - - +{**} + + + - - - -
+ + + + - -
+ + + + + + + {if $smarty.request.action eq 'index' || $smarty.request.action eq 'DetailView' || $smarty.request.action eq 'EditView' || $smarty.request.action eq 'ListView' } + + {else} + + {/if} + + {if $smarty.request.action eq 'listroles' || $smarty.request.action eq 'RoleDetailView' || $smarty.request.action eq 'saverole' || $smarty.request.action eq 'createrole' || $smarty.request.action eq 'RoleDeleteStep1'} + + {else} + + {/if} + + {if $smarty.request.action eq 'ListProfiles' || $smarty.request.action eq 'profilePrivileges' || $smarty.request.action eq 'CreateProfile' || $smarty.request.action eq 'SaveProfile' || $smarty.request.action eq 'UpdateProfileChanges' } + + {else} + + {/if} + + {if $smarty.request.action eq 'listgroups' || $smarty.request.action eq 'GroupDetailView' || $smarty.request.action eq 'createnewgroup' || $smarty.request.action eq 'SaveGroup'} + + {else} + + {/if} + + {if $smarty.request.action eq 'OrgSharingEditView' || $smarty.request.action eq 'OrgSharingDetailView' || $smarty.request.action eq 'SaveOrgSharing'} + + {else} + + {/if} + + {if $smarty.request.action eq 'DefaultFieldPermissions' || $smarty.request.action eq 'UpdateDefaultFieldLevelAccess' || $smarty.request.action eq 'EditDefOrgFieldLevelAccess' } + + {else} + + {/if} + + {if $smarty.request.action eq 'AuditTrailList'} + + {else} + + {/if} + + {if $smarty.request.action eq 'ListLoginHistory'} + + {else} + + {/if} + + + + {if $smarty.request.action eq 'CustomFieldList' || $smarty.request.action eq 'LeadCustomFieldMapping'} + + {else} + + {/if} + + {if $smarty.request.action eq 'PickList' || $smarty.request.action eq 'SettingsAjax'} + {else} + + {/if} + + + + {if $smarty.request.action eq 'listemailtemplates' || $smarty.request.action eq 'detailviewemailtemplate' || $smarty.request.action eq 'editemailtemplate' || $smarty.request.action eq 'saveemailtemplate' || $smarty.request.action eq 'deleteemailtemplate' || $smarty.request.action eq 'createemailtemplate'} + + {else} + + {/if} + + {if $smarty.request.action eq 'listwordtemplates' || $smarty.request.action eq 'add2db' || $smarty.request.action eq 'deletewordtemplate' || $smarty.request.action eq 'upload'} + + {else} + + {/if} + + {if $smarty.request.action eq 'listnotificationschedulers' || $smarty.request.action eq 'UsersAjax'} + + {else} + + {/if} + + {if $smarty.request.action eq 'listinventorynotifications' || $smarty.request.action eq 'UsersAjax'} + + {else} + + {/if} + + + + + {if $smarty.request.action eq 'OrganizationConfig' || $smarty.request.action eq 'EditCompanyDetails' || $smarty.request.action eq 'add2db'} + + {else} + + {/if} + + {if $smarty.request.action eq 'EmailConfig' || $smarty.request.action eq 'Save' } + + {else} + + {/if} + + {if $smarty.request.action eq 'BackupServerConfig' || $smarty.request.action eq 'Save'} + + {else} + + {/if} + + {if $smarty.request.action eq 'ListModuleOwners' || $smarty.request.action eq 'SettingsAjax'} + + {else} + + {/if} + + {if $smarty.request.action eq 'CurrencyListView' || $smarty.request.action eq 'CurrencyEditView' || $smarty.request.action eq 'SaveCurrencyInfo'} + + {else} + + {/if} + + {if $smarty.request.action eq 'TaxConfig'} + + {else} + + {/if} + + {if $smarty.request.action eq 'listsysconfig'} + + {else} + + {/if} + + {if $smarty.request.action eq 'ProxyServerConfig'} + + {else} + + {/if} + + {if $smarty.request.action eq 'Announcements' || $smarty.request.action eq 'UsersAjax' } + + {else} + + {/if} + + {if $smarty.request.action eq 'DefModuleView'} + + {else} + + {/if} + + + + {if $smarty.request.action eq 'OrganizationTermsandConditions' || $smarty.request.action eq 'savetermsandconditions'} + + {else} + + {/if} + +
{$MOD.LBL_USER_MANAGEMENT}
{$MOD.LBL_USERS}
{$MOD.LBL_USERS}
{$MOD.LBL_ROLES}
{$MOD.LBL_ROLES}
{$MOD.LBL_PROFILES}
{$MOD.LBL_PROFILES}
{$MOD.USERGROUPLIST}
{$MOD.USERGROUPLIST}
{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_STUDIO}
{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_COMMUNICATION_TEMPLATES}
{$MOD.EMAILTEMPLATES}
{$MOD.EMAILTEMPLATES}
{$MOD.WORDINTEGRATION}
{$MOD.WORDINTEGRATION}
{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.INVENTORYNOTIFICATION}
{$MOD.INVENTORYNOTIFICATION}
{$MOD.LBL_OTHER_SETTINGS}
{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_MIGRATION}
{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_INVENTORY_TANDC}
+ + +
+ + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Settings.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Settings.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Settings.tpl Tue Nov 14 03:16:10 2006 @@ -1,566 +1,507 @@ -{**} - - {include file="Buttons_List1.tpl"} - - - - - - -
-
-
- - - - - - - -
- - - {$MOD.LBL_SETTINGS} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - {$MOD.LBL_USER_MANAGEMENT} -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
{$MOD.LBL_USERS}{$MOD.LBL_USERS}
{$MOD.LBL_USER_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_ROLES}{$MOD.LBL_ROLES}
{$MOD.LBL_ROLE_DESCRIPTION}
- -
- - - - - - - - - - -
{$MOD.LBL_PROFILES}{$MOD.LBL_PROFILES}
{$MOD.LBL_PROFILE_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.USERGROUPLIST}{$MOD.USERGROUPLIST}
{$MOD.LBL_GROUP_DESCRIPTION}
- -
- - - - - - - - - - -
{$MOD.LBL_SHARING_ACCESS}{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_SHARING_ACCESS_DESCRIPTION}
-
- - - - - - - - - - - -
Fields to be shown{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_SHARING_FIELDS_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_AUDIT_TRAIL}{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_AUDIT_DESCRIPTION}
- - -
- - - - - - - - - - -
{$MOD.LBL_LOGIN_HISTORY_DETAILS}{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_LOGIN_HISTORY_DESCRIPTION}
-
- - -
- - - {$MOD.LBL_STUDIO} -
- - - - - - - - - - - -
- - - - - - - - - - -
{$MOD.LBL_CUSTOM_FIELDS}{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_CUSTOM_FIELDS_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_PICKLIST_EDITOR}{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_DESCRIPTION}
-
- - - - - - - - - - -
  
 
-
- - - - - - - - - - -
  
 
-
- - -
- - {$MOD.LBL_COMMUNICATION_TEMPLATES} -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
{$MOD.EMAILTEMPLATES}{$MOD.EMAILTEMPLATES}
{$MOD.LBL_EMAIL_TEMPLATE_DESCRIPTION}
-
- - - - - - - - - - - -
{$MOD.LBL_MAIL_MERGE}{$MOD.WORDINTEGRATION}
{$MOD.LBL_MAIL_MERGE_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.NOTIFICATIONSCHEDULERS}{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.LBL_NOTIF_SCHED_DESCRIPTION}
-
- - - - - - - - - - - -
{$MOD.INVENTORYNOTIFICATION}{$MOD.INVENTORYNOTIFICATION}
{$MOD.LBL_INV_NOTIF_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.INVENTORYTERMSANDCONDITIONS}{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_INV_TANDC_DESCRIPTION}
- -
- - - - - - - - - - -
  
 
-
- - - - - - - - - - -
  
 
-
- - - - - - - - - - -
  
 
- -
- - -
- - {$MOD.LBL_OTHER_SETTINGS} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
{$MOD.LBL_COMPANY_DETAILS}{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_COMPANY_DESCRIPTION}
- -
- - - - - - - - - - -
{$MOD.LBL_MAIL_SERVER_SETTINGS}{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_MAIL_SERVER_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_BACKUP_SERVER_SETTINGS}{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_DESCRIPTION}
- -
- - - - - - - - - - -
{$MOD.LBL_ASSIGN_MODULE_OWNERS}{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_MODULE_OWNERS_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_CURRENCY_SETTINGS}{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_CURRENCY_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_TAX_SETTINGS}{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_TAX_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_SYSTEM_INFO}{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_SYSTEM_DESCRIPTION}
-
- - - - - - - - - - - -
{$MOD.LBL_PROXY_SETTINGS}{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_PROXY_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_ANNOUNCEMENT}{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_ANNOUNCEMENT_DESCRIPTION}
-
- - - - - - - - - - -
{$MOD.LBL_DEFAULT_MODULE_VIEW}{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_DEFAULT_MODULE_VIEW_DESC}
-
- - - - - - - -
{$MOD.LBL_MIGRATION}{$MOD.LBL_MIGRATION}
{$MOD.LBL_MIGRATION_INFO}
  - -    
- - -
- -
- -
- -
- - - +{**} + + {include file="Buttons_List1.tpl"} + + + + + + + +
+
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + {$MOD.LBL_USER_MANAGEMENT} +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
{$MOD.LBL_USERS}{$MOD.LBL_USERS}
{$MOD.LBL_USER_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_ROLES}{$MOD.LBL_ROLES}
{$MOD.LBL_ROLE_DESCRIPTION}
+ +
+ + + + + + + + + + +
{$MOD.LBL_PROFILES}{$MOD.LBL_PROFILES}
{$MOD.LBL_PROFILE_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.USERGROUPLIST}{$MOD.USERGROUPLIST}
{$MOD.LBL_GROUP_DESCRIPTION}
+ +
+ + + + + + + + + + +
{$MOD.LBL_SHARING_ACCESS}{$MOD.LBL_SHARING_ACCESS}
{$MOD.LBL_SHARING_ACCESS_DESCRIPTION}
+
+ + + + + + + + + + + +
Fields to be shown{$MOD.LBL_FIELDS_ACCESS}
{$MOD.LBL_SHARING_FIELDS_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_AUDIT_TRAIL}{$MOD.LBL_AUDIT_TRAIL}
{$MOD.LBL_AUDIT_DESCRIPTION}
+ + +
+ + + + + + + + + + +
{$MOD.LBL_LOGIN_HISTORY_DETAILS}{$MOD.LBL_LOGIN_HISTORY_DETAILS}
{$MOD.LBL_LOGIN_HISTORY_DESCRIPTION}
+
+ + +
+ + + {$MOD.LBL_STUDIO} +
+ + + + + + + + + + + +
+ + + + + + + + + + +
{$MOD.LBL_CUSTOM_FIELDS}{$MOD.LBL_CUSTOM_FIELDS}
{$MOD.LBL_CUSTOM_FIELDS_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_PICKLIST_EDITOR}{$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_DESCRIPTION}
+
+ + + + + + + + + + +
  
 
+
+ + + + + + + + + + +
  
 
+
+ + +
+ + {$MOD.LBL_COMMUNICATION_TEMPLATES} +
+ + + + + + + + + + +
+ + + + + + + + + + +
{$MOD.EMAILTEMPLATES}{$MOD.EMAILTEMPLATES}
{$MOD.LBL_EMAIL_TEMPLATE_DESCRIPTION}
+
+ + + + + + + + + + + +
{$MOD.LBL_MAIL_MERGE}{$MOD.WORDINTEGRATION}
{$MOD.LBL_MAIL_MERGE_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.NOTIFICATIONSCHEDULERS}{$MOD.NOTIFICATIONSCHEDULERS}
{$MOD.LBL_NOTIF_SCHED_DESCRIPTION}
+
+ + + + + + + + + + + +
{$MOD.INVENTORYNOTIFICATION}{$MOD.INVENTORYNOTIFICATION}
{$MOD.LBL_INV_NOTIF_DESCRIPTION}
+
+ + +
+ + {$MOD.LBL_OTHER_SETTINGS} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
{$MOD.LBL_COMPANY_DETAILS}{$MOD.LBL_COMPANY_DETAILS}
{$MOD.LBL_COMPANY_DESCRIPTION}
+ +
+ + + + + + + + + + +
{$MOD.LBL_MAIL_SERVER_SETTINGS}{$MOD.LBL_MAIL_SERVER_SETTINGS}
{$MOD.LBL_MAIL_SERVER_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_BACKUP_SERVER_SETTINGS}{$MOD.LBL_BACKUP_SERVER_SETTINGS}
{$MOD.LBL_BACKUP_SERVER_DESCRIPTION}
+ +
+ + + + + + + + + + +
{$MOD.LBL_ASSIGN_MODULE_OWNERS}{$MOD.LBL_MODULE_OWNERS}
{$MOD.LBL_MODULE_OWNERS_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_CURRENCY_SETTINGS}{$MOD.LBL_CURRENCY_SETTINGS}
{$MOD.LBL_CURRENCY_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_TAX_SETTINGS}{$MOD.LBL_TAX_SETTINGS}
{$MOD.LBL_TAX_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_SYSTEM_INFO}{$MOD.LBL_SYSTEM_INFO}
{$MOD.LBL_SYSTEM_DESCRIPTION}
+
+ + + + + + + + + + + +
{$MOD.LBL_PROXY_SETTINGS}{$MOD.LBL_PROXY_SETTINGS}
{$MOD.LBL_PROXY_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_ANNOUNCEMENT}{$MOD.LBL_ANNOUNCEMENT}
{$MOD.LBL_ANNOUNCEMENT_DESCRIPTION}
+
+ + + + + + + + + + +
{$MOD.LBL_DEFAULT_MODULE_VIEW}{$MOD.LBL_DEFAULT_MODULE_VIEW}
{$MOD.LBL_DEFAULT_MODULE_VIEW_DESC}
+
+ + + + + + + +
{$MOD.LBL_MIGRATION}{$MOD.LBL_MIGRATION}
{$MOD.LBL_MIGRATION_INFO}
+ + + + + + + + + + +
{$MOD.INVENTORYTERMSANDCONDITIONS}{$MOD.LBL_INVENTORY_TANDC}
{$MOD.LBL_INV_TANDC_DESCRIPTION}
+ +
+ +
+
+
+ +
+ + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Settings/PickList.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Settings/PickList.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Settings/PickList.tpl Tue Nov 14 03:16:10 2006 @@ -1,234 +1,259 @@ -{**} - - - - - -
- - - - - -
-
-
- - {include file='SetMenu.tpl'} - - - - - - - - - -
{$MOD.LBL_SETTINGS} > {$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_DESCRIPTION}
- - - - - - -
- - - - - - -
1. {$MOD.LBL_SELECT_MODULE} 
- - - - - -
{$MOD.LBL_SELECT_CRM_MODULE} - -
-
- - - - - -
-
- {include file='Settings/PickListContents.tpl'} -
-
- - -
{$MOD.LBL_SCROLL}
- -
- - - -
-
- - - -
-
-{literal} - -{/literal} +{**} + + + + + +
+ + + + + +
+
+
+ + {include file='SetMenu.tpl'} + + + + + + + + + +
{$MOD.LBL_SETTINGS} > {$MOD.LBL_PICKLIST_EDITOR}
{$MOD.LBL_PICKLIST_DESCRIPTION}
+ + + + + + +
+ + + + + + +
1. {$MOD.LBL_SELECT_MODULE} 
+ + + + + +
{$MOD.LBL_SELECT_CRM_MODULE} + +
+
+ + + + + +
+
+ {include file='Settings/PickListContents.tpl'} +
+
+ + +
{$MOD.LBL_SCROLL}
+ +
+ + + +
+
+ + + +
+
+{literal} + +{/literal} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/Settings/TaxConfig.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/Settings/TaxConfig.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/Settings/TaxConfig.tpl Tue Nov 14 03:16:10 2006 @@ -1,244 +1,262 @@ -{**} - - - - -{literal} - -{/literal} -
- - - - - - -
-
-
- - {include file='SetMenu.tpl'} - -{if $EDIT_MODE eq 'true'} - {assign var=formname value='EditTax'} - {assign var=shformname value='SHEditTax'} -{else} - {assign var=formname value='ListTax'} - {assign var=shformname value='SHListTax'} -{/if} - - - - - - - - - - - -
Users{$MOD.LBL_SETTINGS} > - {if $EDIT_MODE eq 'true'} - {$MOD.LBL_EDIT} {$MOD.LBL_TAX_SETTINGS} - {else} - {$MOD.LBL_TAX_SETTINGS} - {/if} - -
{$MOD.LBL_TAX_DESC}
- -
- - - - - - - - -
- -
- - - - - - - - - - - - - - - - - -
{$MOD.LBL_PRODUCT_TAX_SETTINGS}
  - {if $EDIT_MODE neq 'true'} - - {/if} - - {if $EDIT_MODE eq 'true'} -   - - {elseif $TAX_COUNT > 0} - - {/if} -
- - - - - {if $TAX_COUNT eq 0} - - {else} - {foreach item=tax key=count from=$TAX_VALUES} - - - {if $tax.deleted eq 0} - - {else} - - {/if} - - - - - - {/foreach} - {if $EDIT_MODE eq 'true'} - - {/if} - {/if} -
No taxes available. Please Add Tax.
{$tax.taxlabel} - {if $EDIT_MODE eq 'true'} -  % - {else} - {$tax.percentage} % - {/if} - - {if $tax.deleted eq 0} - Enable me - {else} - Enable me - {/if} -
- -
-
-
- - - - - - - - - - - - - - - - - -
{$MOD.LBL_SHIPPING_HANDLING_TAX_SETTINGS}
  - {if $SH_EDIT_MODE neq 'true'} - - {/if} - - {if $SH_EDIT_MODE eq 'true'} - -   - - {elseif $SH_TAX_COUNT > 0} - - {/if} -
- - - - - {if $SH_TAX_COUNT eq 0} - - {else} - {foreach item=tax key=count from=$SH_TAX_VALUES} - - - {if $tax.deleted eq 0} - - {else} - - {/if} - - - - - - {/foreach} - {if $SH_EDIT_MODE eq 'true'} - - {/if} - {/if} -
No taxes available. Please Add Tax.
{$tax.taxlabel} - {if $SH_EDIT_MODE eq 'true'} - -  % - {else} - {$tax.percentage} % - {/if} - - {if $tax.deleted eq 0} - Enable me - {else} - Enable me - {/if} -
- -
-
- - - - - -
{$MOD.LBL_SCROLL}
- - - - -
- - - - - - - - - - +{**} + + + + + +{literal} + +{/literal} +
+ + + + + + +
+
+
+ + {include file='SetMenu.tpl'} + +{if $EDIT_MODE eq 'true'} + {assign var=formname value='EditTax'} + {assign var=shformname value='SHEditTax'} +{else} + {assign var=formname value='ListTax'} + {assign var=shformname value='SHListTax'} +{/if} + + + + + + + + + + + +
Users{$MOD.LBL_SETTINGS} > + {if $EDIT_MODE eq 'true'} + {$MOD.LBL_EDIT} {$MOD.LBL_TAX_SETTINGS} + {else} + {$MOD.LBL_TAX_SETTINGS} + {/if} + +
{$MOD.LBL_TAX_DESC}
+ +
+ + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
{$MOD.LBL_PRODUCT_TAX_SETTINGS}
  + {if $EDIT_MODE neq 'true'} + + {/if} + + {if $EDIT_MODE eq 'true'} +   + + {elseif $TAX_COUNT > 0} + + {/if} +
+ + + + + {if $TAX_COUNT eq 0} + + {else} + {foreach item=tax key=count from=$TAX_VALUES} + + + {if $tax.deleted eq 0} + + {else} + + {/if} + + + {assign var=tax_label value="taxlabel_"|cat:$tax.taxname} + + + + + + {/foreach} + {if $EDIT_MODE eq 'true'} + + {/if} + {/if} +
No taxes available. Please Add Tax.
+ {if $EDIT_MODE eq 'true'} + + {else} + {$tax.taxlabel} + {/if} + + {if $EDIT_MODE eq 'true'} +  % + {else} + {$tax.percentage} % + {/if} + + {if $tax.deleted eq 0} + Enable me + {else} + Enable me + {/if} +
+ +
+
+
+ + + + + + + + + + + + + + + + + +
{$MOD.LBL_SHIPPING_HANDLING_TAX_SETTINGS}
  + {if $SH_EDIT_MODE neq 'true'} + + {/if} + + {if $SH_EDIT_MODE eq 'true'} + +   + + {elseif $SH_TAX_COUNT > 0} + + {/if} +
+ + + + + {if $SH_TAX_COUNT eq 0} + + {else} + {foreach item=tax key=count from=$SH_TAX_VALUES} + + + {if $tax.deleted eq 0} + + {else} + + {/if} + + {assign var=tax_label value="taxlabel_"|cat:$tax.taxname} + + + + + {/foreach} + {if $SH_EDIT_MODE eq 'true'} + + {/if} + {/if} +
No taxes available. Please Add Tax.
+ {if $SH_EDIT_MODE eq 'true'} + + + {else} + {$tax.taxlabel} + {/if} + + {if $SH_EDIT_MODE eq 'true'} + +  % + {else} + {$tax.percentage} % + {/if} + + {if $tax.deleted eq 0} + Enable me + {else} + Enable me + {/if} +
+ +
+
+ + + + + +
{$MOD.LBL_SCROLL}
+ + + + +
+ + + + + + + + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/TagCloudDisplay.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/TagCloudDisplay.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/TagCloudDisplay.tpl Tue Nov 14 03:16:10 2006 @@ -19,6 +19,9 @@ +
  
+ + {$ALL_TAG} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/UserDetailView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/UserDetailView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/UserDetailView.tpl Tue Nov 14 03:16:10 2006 @@ -1,357 +1,359 @@ -{**} - - - - - - - - -
- - - - - - - -
-
-
- {if $CATEGORY eq 'Settings'} - {include file='SetMenu.tpl'} - {/if} - - - - -
-
- - - - - - {if $CATEGORY neq 'Settings'} - - {/if} - - - - - - - {if $CATEGORY eq 'Settings'} - - {/if} - - - - - - - - - - - - - - -
- - - - - - - - - - -
- {if $CATEGORY eq 'Settings'} - - {$MOD.LBL_SETTINGS} > {$MOD.LBL_USERS} >"{$USERNAME}" - {else} - - {$APP.LBL_MY_PREFERENCES} - - {/if} - -
{$UMOD.LBL_USERDETAIL_INFO} "{$USERNAME}"
-
 
- {if $IS_ADMIN eq 'true'} - - {/if} - {if $CATEGORY eq 'Settings'} - {$DUPLICATE_BUTTON} - {/if} - {$EDIT_BUTTON} - {if $CATEGORY eq 'Settings' && $ID neq 1 && $ID neq 2 & $ID neq $CURRENT_USERID} - - {/if} -
- - - - - -
- {foreach key=header name=blockforeach item=detail from=$BLOCKS} -
- - - {strip} - - - {/strip} - -
- {$smarty.foreach.blockforeach.iteration}. {$header} -  
- - - {foreach item=detail from=$detail} - - {foreach key=label item=data from=$detail} - {assign var=keyid value=$data.ui} - {assign var=keyval value=$data.value} - {assign var=keytblname value=$data.tablename} - {assign var=keyfldname value=$data.fldname} - {assign var=keyoptions value=$data.options} - {assign var=keysecid value=$data.secid} - {assign var=keyseclink value=$data.link} - {assign var=keycursymb value=$data.cursymb} - {assign var=keysalut value=$data.salut} - {assign var=keycntimage value=$data.cntimage} - {assign var=keyadmin value=$data.isadmin} - - {if $label ne ''} - - {include file="DetailViewUI.tpl"} - {else} - - - {/if} - {/foreach} - - {/foreach} -
{$label}  
- {/foreach} - -
- - - - - - -
- 5. {$UMOD.LBL_HOME_PAGE_COMP} - {$APP.LBL_EXPAND_COLLAPSE}
- - - -
- - - - - - -
- 6. {$UMOD.LBL_MY_GROUPS} - - {if $GROUP_COUNT > 0} - {$APP.LBL_EXPAND_COLLAPSE} - {else} -   - {/if} -
- - - -
-
- - {if $IS_ADMIN eq 'true'} - - - - - -
- 7. {$UMOD.LBL_LOGIN_HISTORY} - {$APP.LBL_EXPAND_COLLAPSE}
- - - -
-
- {/if} -
- - -
- -
- -
- - -
-
- - - - - - - - - - - - - -
-{$JAVASCRIPT} -
- - - - +{**} + + + + + + + + +
+ + + + + + + +
+
+
+ {if $CATEGORY eq 'Settings'} + {include file='SetMenu.tpl'} + {/if} + + + + +
+
+ + + + + + {if $CATEGORY neq 'Settings'} + + {/if} + + + + + + + {if $CATEGORY eq 'Settings'} + + {/if} + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ {if $CATEGORY eq 'Settings'} + + {$MOD.LBL_SETTINGS} > {$MOD.LBL_USERS} >"{$USERNAME}" + {else} + + {$APP.LBL_MY_PREFERENCES} + + {/if} + +
{$UMOD.LBL_USERDETAIL_INFO} "{$USERNAME}"
+
 
+ {if $IS_ADMIN eq 'true'} + + {/if} + {if $CATEGORY eq 'Settings'} + {$DUPLICATE_BUTTON} + {/if} + {$EDIT_BUTTON} + {if $CATEGORY eq 'Settings' && $ID neq 1 && $ID neq 2 & $ID neq $CURRENT_USERID} + + {/if} +
+ + + + + +
+ {foreach key=header name=blockforeach item=detail from=$BLOCKS} +
+ + + {strip} + + + {/strip} + +
+ {$smarty.foreach.blockforeach.iteration}. {$header} +  
+ + + {foreach item=detail from=$detail} + + {foreach key=label item=data from=$detail} + {assign var=keyid value=$data.ui} + {assign var=keyval value=$data.value} + {assign var=keytblname value=$data.tablename} + {assign var=keyfldname value=$data.fldname} + {assign var=keyoptions value=$data.options} + {assign var=keysecid value=$data.secid} + {assign var=keyseclink value=$data.link} + {assign var=keycursymb value=$data.cursymb} + {assign var=keysalut value=$data.salut} + {assign var=keycntimage value=$data.cntimage} + {assign var=keyadmin value=$data.isadmin} + + {if $label ne ''} + + {include file="DetailViewUI.tpl"} + {else} + + + {/if} + {/foreach} + + {/foreach} +
{$label}  
+ {/foreach} + + {include file="UserDetailOrg.tpl"} + +
+ + + + + + +
+ 6. {$UMOD.LBL_HOME_PAGE_COMP} + {$APP.LBL_EXPAND_COLLAPSE}
+ + + +
+ + + + + + +
+ 7. {$UMOD.LBL_MY_GROUPS} + + {if $GROUP_COUNT > 0} + {$APP.LBL_EXPAND_COLLAPSE} + {else} +   + {/if} +
+ + + +
+
+ + {if $IS_ADMIN eq 'true'} + + + + + +
+ 8. {$UMOD.LBL_LOGIN_HISTORY} + {$APP.LBL_EXPAND_COLLAPSE}
+ + + +
+
+ {/if} +
+ + +
+ +
+ +
+ + +
+
+ + + + + + + + + + + + + +
+{$JAVASCRIPT} +
+ + + + Modified: vtigercrm/branches/5.1_jens/Smarty/templates/UserEditView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/UserEditView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/UserEditView.tpl Tue Nov 14 03:16:10 2006 @@ -1,203 +1,206 @@ -{**} - - - - - - - - - - - - - - -
-
- -
- {if $PARENTTAB eq 'Settings'} - {include file='SetMenu.tpl'} - {/if} - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - {if $MODE eq 'edit'} - - -
- - {if $PARENTTAB neq ''} - {$MOD.LBL_SETTINGS} > {$MOD.LBL_USERS} > - {if $MODE eq 'edit'} - {$UMOD.LBL_EDITING} "{$USERNAME}" - {else} - {$UMOD.LBL_CREATE_NEW_USER} - {/if} - - {else} - - {$APP.LBL_MY_PREFERENCES} - - {/if} -   -
{$UMOD.LBL_EDIT_VIEW} "{$USERNAME}" - {else} - {$UMOD.LBL_CREATE_NEW_USER} - {/if} -
-
 
- - - -
- - - -
- - - -
- - - - - - -
- {foreach key=header name=blockforeach item=data from=$BLOCKS} -
- - - {strip} - - - {/strip} - -
- {$smarty.foreach.blockforeach.iteration}. {$header} -  
- - - {include file="DisplayFields.tpl"} -
- {/foreach} -
- - - - - -
- 5. {$UMOD.LBL_HOME_PAGE_COMP} -  
- - {foreach item=homeitems key=values from=$HOMEORDER} - - {if $homeitems neq ''} - - - {else} - - - {/if} - - {/foreach} -
{$UMOD.$values} - {$UMOD.LBL_SHOW} - {$UMOD.LBL_HIDE} - {$UMOD.LBL_SHOW} - {$UMOD.LBL_HIDE}
-
-
 
- - -
-
-
-
-
-
- - - - - -
-{$JAVASCRIPT} +{**} + + + + + + + + + + + + + + +
+
+ +
+ {if $PARENTTAB eq 'Settings'} + {include file='SetMenu.tpl'} + {/if} + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + {if $MODE eq 'edit'} + + +
+ + {if $PARENTTAB neq ''} + {$MOD.LBL_SETTINGS} > {$MOD.LBL_USERS} > + {if $MODE eq 'edit'} + {$UMOD.LBL_EDITING} "{$USERNAME}" + {else} + {$UMOD.LBL_CREATE_NEW_USER} + {/if} + + {else} + + {$APP.LBL_MY_PREFERENCES} + + {/if} +   +
{$UMOD.LBL_EDIT_VIEW} "{$USERNAME}" + {else} + {$UMOD.LBL_CREATE_NEW_USER} + {/if} +
+
 
+ + + +
+ + + +
+ + + +
+ + + + + + +
+ {foreach key=header name=blockforeach item=data from=$BLOCKS} +
+ + + {strip} + + + {/strip} + +
+ {$smarty.foreach.blockforeach.iteration}. {$header} +  
+ + + {include file="DisplayFields.tpl"} +
+ {/foreach} + + {include file="UserEditOrg.tpl"} + +
+ + + + + +
+ 6. {$UMOD.LBL_HOME_PAGE_COMP} +  
+ + {foreach item=homeitems key=values from=$HOMEORDER} + + {if $homeitems neq ''} + + + {else} + + + {/if} + + {/foreach} +
{$UMOD.$values} + {$UMOD.LBL_SHOW} + {$UMOD.LBL_HIDE} + {$UMOD.LBL_SHOW} + {$UMOD.LBL_HIDE}
+
+
 
+ + +
+
+
+
+
+
+ + + + + +
+{$JAVASCRIPT} Modified: vtigercrm/branches/5.1_jens/Smarty/templates/salesEditView.tpl ============================================================================== --- vtigercrm/branches/5.1_jens/Smarty/templates/salesEditView.tpl (original) +++ vtigercrm/branches/5.1_jens/Smarty/templates/salesEditView.tpl Tue Nov 14 03:16:10 2006 @@ -115,7 +115,7 @@ - {if $header eq 'Comments' || $header eq 'Comment Information'} + {if $header eq $MOD.LBL_COMMENTS || $header eq $MOD.LBL_COMMENT_INFORMATION}   @@ -131,14 +131,14 @@ - {if $header== 'Address Information' && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} + {if $header== $MOD.LBL_ADDRESS_INFORMATION && ($MODULE == 'Accounts' || $MODULE == 'Quotes' || $MODULE == 'PurchaseOrder' || $MODULE == 'SalesOrder'|| $MODULE == 'Invoice')} {$header} {$APP.LBL_RCPY_ADDRESS} {$APP.LBL_LCPY_ADDRESS} - {elseif $header== 'Address Information' && $MODULE == 'Contacts'} + {elseif $header== $MOD.LBL_ADDRESS_INFORMATION && $MODULE == 'Contacts'} {$header} @@ -154,15 +154,25 @@ {include file="DisplayFields.tpl"} + +

{/foreach} - {if $MODULE eq 'PurchaseOrder' || $MODULE eq 'SalesOrder' || $MODULE eq 'Quotes' || $MODULE eq 'Invoice'} {include file="ProductDetailsEditView.tpl"} + + + {/if} + + + {if $MODULE eq "Organization"} + + + {include file="DetailsViewOrgUnit.tpl"} {/if} Modified: vtigercrm/branches/5.1_jens/connection.php ============================================================================== --- vtigercrm/branches/5.1_jens/connection.php (original) +++ vtigercrm/branches/5.1_jens/connection.php Tue Nov 14 03:16:10 2006 @@ -1,4 +1,4 @@ -mode; - - $this->db->println("TRANS saveentity starts $module"); - $this->db->startTransaction(); - - // Code included by Jaguar - starts - if(isset($this->column_fields['recurringtype']) && $this->column_fields['recurringtype']!='') - $recur_type = trim($this->column_fields['recurringtype']); - else - $recur_type=''; - // Code included by Jaguar - Ends - - //Code included by Minnie - Starts - if(isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid']!='') - { - $selected_users_string = $_REQUEST['inviteesid']; - $invitees_array = explode(';',$selected_users_string); - - } - else - $invitees_array=''; - //Code included by Minnie - Ends - - foreach($this->tab_name as $table_name) - { - if($table_name == "vtiger_crmentity") - { - $this->insertIntoCrmEntity($module); - } - elseif($table_name == "vtiger_salesmanactivityrel") - { - $this->insertIntoSmActivityRel($module); - } - //added by raju - elseif($table_name=="vtiger_seactivityrel" ) - { - //modified by Richie as raju's implementation broke the feature for addition of webmail to vtiger_crmentity.need to be more careful in future while integrating code - if($module=="Emails" && $_REQUEST['smodule']!='webmails' && (!$this->plugin_save)) - { - if($_REQUEST['currentid']!='') - { - $actid=$_REQUEST['currentid']; - } - else - { - $actid=$_REQUEST['record']; - } - $parentid=$_REQUEST['parent_id']; - if($_REQUEST['module'] != 'Emails' && $_REQUEST['module'] != 'Webmails') - { - if(!$parentid) { - $parentid = $adb->getUniqueID('vtiger_seactivityrel'); - } - $mysql='insert into vtiger_seactivityrel values('.$parentid.','.$actid.')'; - $adb->query($mysql); - } - else - { - $myids=explode("|",$parentid); //2 at 71| - for ($i=0;$i<(count($myids)-1);$i++) - { - $realid=explode("@",$myids[$i]); - $mycrmid=$realid[0]; - //added to handle the relationship of emails with vtiger_users - if($realid[1] == -1) - $mysql='insert into vtiger_salesmanactivityrel values('.$mycrmid.','.$actid.')'; - else - $mysql='insert into vtiger_seactivityrel values('.$mycrmid.','.$actid.')'; - $adb->query($mysql); - } - } - } - else - { - if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '') - { - $this->insertIntoEntityTable($table_name, $module); - } - elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit") - { - $this->deleteRelation($table_name); - } - } - } - elseif($table_name == "vtiger_seticketsrel" || $table_name == "vtiger_seproductsrel" || $table_name == "vtiger_senotesrel") - { - if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '')//raju - mass mailing ends - { - $this->insertIntoEntityTable($table_name, $module); - } - elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit") - { - $this->deleteRelation($table_name); - } - } - elseif($table_name == "vtiger_cntactivityrel") - { - if(isset($this->column_fields['contact_id']) && $this->column_fields['contact_id'] != '') - { - $this->insertIntoEntityTable($table_name, $module); - } - elseif($this->column_fields['contact_id'] =='' && $insertion_mode=="edit") - { - $this->deleteRelation($table_name); - } - - } - elseif($table_name == "vtiger_ticketcomments") - { - $this->insertIntoTicketCommentTable($table_name, $module); - } - elseif($table_name == "vtiger_faqcomments") - { - $this->insertIntoFAQCommentTable($table_name, $module); - } - elseif($table_name == "vtiger_activity_reminder") - { - if($recur_type == "--None--") - { - $this->insertIntoReminderTable($table_name,$module,""); - } - } - elseif($table_name == "vtiger_recurringevents") // Code included by Jaguar - starts - { - $recur_type = trim($this->column_fields['recurringtype']); - if($recur_type != "--None--" && $recur_type != '') - { - //Modified by Minnie - $recur_data = getrecurringObjValue(); - if(is_object($recur_data)) - $this->insertIntoRecurringTable($recur_data); - } - }// Code included by Jaguar - Ends - // Code included by Minnie - starts - elseif($table_name == "vtiger_invitees") - { - if($invitees_array != '') - { - $this->insertIntoInviteeTable($table_name,$module,$invitees_array); - } - } - // Code included by Minnie - Ends - elseif($table_name == 'vtiger_producttaxrel') - { - //avoid call this function when we use ajax edit -> save - if($_REQUEST['ajxaction'] != 'DETAILVIEW') - $this->insertTaxInformation($table_name, $module); - } - elseif($table_name == 'vtiger_attachments') - { - $this->insertIntoAttachment($this->id,$module); - } - else - { - $this->insertIntoEntityTable($table_name, $module); - } - } - - $this->db->completeTransaction(); - $this->db->println("TRANS saveentity ends"); - } - - - function insertIntoAttachment1($id,$module,$filedata,$filename,$filesize,$filetype,$user_id) - { - $date_var = date('YmdHis'); - global $current_user; - global $adb; - //global $root_directory; - global $log; - - $ownerid = $user_id; - - if($filesize != 0) - { - $data = base64_encode(fread(fopen($filedata, "r"), $filesize)); - } - - $current_id = $adb->getUniqueID("vtiger_crmentity"); - - if($module=='Emails') - { - $log->info("module is ".$module); - $idname='emailid'; $tablename='emails'; $descname='description'; - } - else - { - $idname='notesid'; $tablename='notes'; $descname='notecontent'; - } - - $sql="update ".$tablename." set filename='".$filename."' where ".$idname."=".$id; - $adb->query($sql); - - $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','"."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; - $adb->query($sql1); - - $sql2="insert into vtiger_attachments(attachmentsid, name, description, type) values(".$current_id.",'".$filename."','"."','".$filetype."')"; - $result=$adb->query($sql2); - - //TODO -- instead of put contents in db now we should store the file in harddisk - - $sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')'; - $adb->query($sql3); - } - - - /** - * This function is used to add the vtiger_attachments. This will call the function uploadAndSaveFile which will upload the attachment into the server and save that attachment information in the database. - * @param int $id - entity id to which the vtiger_files to be uploaded - * @param string $module - the current module name - */ - function insertIntoAttachment($id,$module) - { - global $log, $adb; - $log->debug("Entering into insertIntoAttachment($id,$module) method."); - - $file_saved = false; - - //This is to added to store the existing attachment id of the contact where we should delete this when we give new image - if($module == 'Contacts') - $old_attachmentid = $adb->query_result($adb->query("select * from vtiger_seattachmentsrel where crmid=$id"),0,'attachmentsid'); - - foreach($_FILES as $fileindex => $files) - { - if($files['name'] != '' && $files['size'] > 0) - { - $file_saved = $this->uploadAndSaveFile($id,$module,$files); - } - } - - //This is to handle the delete image for contacts - if($module == 'Contacts' && $file_saved) - { - $del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$old_attachmentid"); - $del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$old_attachmentid"); - } - - - //Remove the deleted vtiger_attachments from db - Products - if($module == 'Products' && $_REQUEST['del_file_list'] != '') - { - $del_file_list = explode("###",trim($_REQUEST['del_file_list'],"###")); - foreach($del_file_list as $del_file_name) - { - $attach_res = $adb->query("select vtiger_attachments.attachmentsid from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where crmid=$id and name=\"$del_file_name\""); - $attachments_id = $adb->query_result($attach_res,0,'attachmentsid'); - - $del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$attachments_id"); - $del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$attachments_id"); - } - } - - $log->debug("Exiting from insertIntoAttachment($id,$module) method."); - } - - /** - * This function is used to upload the attachment in the server and save that attachment information in db. - * @param int $id - entity id to which the file to be uploaded - * @param string $module - the current module name - * @param array $file_details - array which contains the file information(name, type, size, tmp_name and error) - * return void - */ - function uploadAndSaveFile($id,$module,$file_details) - { - global $log; - $log->debug("Entering into uploadAndSaveFile($id,$module,$file_details) method."); - - global $adb, $current_user; - global $upload_badext; - - $date_var = date('YmdHis'); - - //to get the owner id - $ownerid = $this->column_fields['assigned_user_id']; - if(!isset($ownerid) || $ownerid=='') - $ownerid = $current_user->id; - - - // Arbitrary File Upload Vulnerability fix - Philip - $binFile = $file_details['name']; - $ext_pos = strrpos($binFile, "."); - - $ext = substr($binFile, $ext_pos + 1); - - if (in_array($ext, $upload_badext)) - { - $binFile .= ".txt"; - } - // Vulnerability fix ends - - $current_id = $adb->getUniqueID("vtiger_crmentity"); - - $filename = basename($binFile); - $filetype= $file_details['type']; - $filesize = $file_details['size']; - $filetmp_name = $file_details['tmp_name']; - - //get the file path inwhich folder we want to upload the file - $upload_file_path = decideFilePath(); - - //upload the file in server - $upload_status = move_uploaded_file($filetmp_name,$upload_file_path.$current_id."_".$binFile); - - $save_file = 'true'; - //only images are allowed for these modules - if($module == 'Contacts' || $module == 'Products') - { - $save_file = validateImageFile(&$file_details); - } - - if($save_file == 'true' && $upload_status == 'true') - { - //This is only to update the attached filename in the vtiger_notes vtiger_table for the Notes module - if($module=='Notes') - { - $sql="update vtiger_notes set filename='".$filename."' where notesid = ".$id; - $adb->query($sql); - } - - $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','".$this->column_fields['description']."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; - $adb->query($sql1); - - $sql2="insert into vtiger_attachments(attachmentsid, name, description, type, path) values(".$current_id.",'".$filename."','".$this->column_fields['description']."','".$filetype."','".$upload_file_path."')"; - $result=$adb->query($sql2); - - if($_REQUEST['mode'] == 'edit') - { - if($id != '' && $_REQUEST['fileid'] != '') - { - $delquery = 'delete from vtiger_seattachmentsrel where crmid = '.$id.' and attachmentsid = '.$_REQUEST['fileid']; - $adb->query($delquery); - } - } - if($module == 'Notes') - { - $query = "delete from vtiger_seattachmentsrel where crmid = ".$id; - $adb->query($query); - } - $sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')'; - $adb->query($sql3); - - return true; - } - else - { - $log->debug("Skip the save attachment process."); - return false; - } - } - - /** Function to insert values in the vtiger_crmentity for the specified module - * @param $module -- module:: Type varchar - */ - - function insertIntoCrmEntity($module) - { - global $adb; - global $current_user; - global $log; - - $date_var = date('YmdHis'); - if($_REQUEST['assigntype'] == 'T') - { - $ownerid= 0; - } - else - { - $ownerid = $this->column_fields['assigned_user_id']; - } - - if($module == 'Products' || $module == 'Notes' || $module =='Faq' || $module == 'Vendors' || $module == 'PriceBooks') - { - $log->info("module is =".$module); - $ownerid = $current_user->id; - } - if($module == 'Events') - { - $module = 'Calendar'; - } - if($this->mode == 'edit') - { - $description_val = from_html($adb->formatString("vtiger_crmentity","description",$this->column_fields['description']),($insertion_mode == 'edit')?true:false); - - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - $tabid = getTabid($module); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0) - { - $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.",description=".$description_val.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; - } - else - { - $profileList = getCurrentUserProfileList(); - $perm_qry = "SELECT columnname 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 WHERE vtiger_field.tabid = ".$tabid." AND vtiger_profile2field.visible = 0 AND vtiger_profile2field.profileid IN ".$profileList." AND vtiger_def_org_field.visible = 0 and vtiger_field.tablename='vtiger_crmentity' and vtiger_field.displaytype in (1,3);"; - $perm_result = $adb->query($perm_qry); - $perm_rows = $adb->num_rows($perm_result); - for($i=0; $i<$perm_rows; $i++) - { - $columname[]=$adb->query_result($perm_result,$i,"columnname"); - } - if(is_array($columname) && in_array("description",$columname)) - { - $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.",description=".$description_val.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; - } - else - { - $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; - } - } - $adb->query($sql); - $sql1 ="delete from vtiger_ownernotify where crmid=".$this->id; - $adb->query($sql1); - if($ownerid != $current_user->id) - { - $sql1 = "insert into vtiger_ownernotify values(".$this->id.",".$ownerid.",null)"; - $adb->query($sql1); - } - } - else - { - //if this is the create mode and the group allocation is chosen, then do the following - $current_id = $adb->getUniqueID("vtiger_crmentity"); - $_REQUEST['currentid']=$current_id; - - $description_val = from_html($adb->formatString("vtiger_crmentity","description",$this->column_fields['description']),($insertion_mode == 'edit')?true:false); - $sql = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values('".$current_id."','".$current_user->id."','".$ownerid."','".$module."',".$description_val.",".$adb->formatDate($date_var).",".$adb->formatDate($date_var).")"; - $adb->query($sql); - $this->id = $current_id; - } - - } - - - /** Function to insert values in vtiger_salesmanactivityrel table for the specified module - * @param $module -- module:: Type varchar - */ - - function insertIntoSmActivityRel($module) - { - global $adb; - global $current_user; - if($this->mode == 'edit') - { - - $sql = "delete from vtiger_salesmanactivityrel where activityid=".$this->id." and smid = ".$this->column_fields['assigned_user_id'].""; - $adb->query($sql); - - } - $sql_qry = "insert into vtiger_salesmanactivityrel (smid,activityid) values(".$this->column_fields['assigned_user_id'].",".$this->id.")"; - $adb->query($sql_qry); - - } - - /** Function to insert values in the specifed table for the specified module - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - */ - function insertIntoEntityTable($table_name, $module) - { - global $log; - global $current_user; - $log->info("function insertIntoEntityTable ".$module.' vtiger_table name ' .$table_name); - global $adb; - $insertion_mode = $this->mode; - - //Checkin whether an entry is already is present in the vtiger_table to update - if($insertion_mode == 'edit') - { - $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; - $check_result=$adb->query($check_query); - - $num_rows = $adb->num_rows($check_result); - - if($num_rows <= 0) - { - $insertion_mode = ''; - } - } - - if($insertion_mode == 'edit') - { - $update = ''; - $tabid= getTabid($module); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0) - { - - $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3)"; - } - else - { - $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 - WHERE vtiger_field.tabid = ".$tabid." - AND vtiger_profile2field.visible = 0 - AND vtiger_profile2field.profileid IN ".$profileList." - AND vtiger_def_org_field.visible = 0 and vtiger_field.tablename='".$table_name."' and vtiger_field.displaytype in (1,3)"; - } - - } - else - { - $column = $this->tab_name_index[$table_name]; - if($column == 'id' && $table_name == 'vtiger_users') - { - $currentuser_id = $adb->getUniqueID("vtiger_users"); - $this->id = $currentuser_id; - } - $value = $this->id; - $tabid= getTabid($module); - $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3,4)"; - } - - $result = $adb->query($sql); - $noofrows = $adb->num_rows($result); - for($i=0; $i<$noofrows; $i++) - { - $fieldname=$adb->query_result($result,$i,"fieldname"); - $columname=$adb->query_result($result,$i,"columnname"); - $uitype=$adb->query_result($result,$i,"uitype"); - if(isset($this->column_fields[$fieldname])) - { - if($uitype == 56) - { - if($this->column_fields[$fieldname] == 'on' || $this->column_fields[$fieldname] == 1) - { - $fldvalue = 1; - } - else - { - $fldvalue = 0; - } - - } - elseif($uitype == 33) - { - if(is_array($this->column_fields[$fieldname])) - { - $field_list = implode(' |##| ',$this->column_fields[$fieldname]); - }else - { - $field_list = $this->column_fields[$fieldname]; - } - $fldvalue = $field_list; - } - elseif($uitype == 5 || $uitype == 6 || $uitype ==23) - { - if($_REQUEST['action'] == 'Import') - { - $fldvalue = $this->column_fields[$fieldname]; - } - else - { - $fldvalue = getDBInsertDateValue($this->column_fields[$fieldname]); - } - } - elseif($uitype == 7) - { - //strip out the spaces and commas in numbers if given ie., in amounts there may be , - $fldvalue = str_replace(",","",$this->column_fields[$fieldname]);//trim($this->column_fields[$fieldname],","); - - } - else - { - $fldvalue = $this->column_fields[$fieldname]; - $fldvalue = stripslashes($fldvalue); - } - $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); - - - - } - else - { - $fldvalue = ''; - } - if($fldvalue=='') $fldvalue ="NULL"; - if($insertion_mode == 'edit') - { - if($table_name == 'vtiger_notes' && $columname == 'filename' && $_FILES['filename']['name'] == '') - { - $fldvalue = $this->getOldFileName($this->id); - } - if($table_name == 'vtiger_products' && $columname == 'imagename') - { - - - } - if($table_name != 'vtiger_ticketcomments') - { - if($i == 0) - { - $update = $columname."=".$fldvalue.""; - } - else - { - $update .= ', '.$columname."=".$fldvalue.""; - } - } - } - else - { - $column .= ", ".$columname; - $value .= ", ".$fldvalue.""; - } - - } - - - - - - if($insertion_mode == 'edit') - { - if($_REQUEST['module'] == 'Potentials') - { - $dbquery = 'select sales_stage from vtiger_potential where potentialid = '.$this->id; - $sales_stage = $adb->query_result($adb->query($dbquery),0,'sales_stage'); - if($sales_stage != $_REQUEST['sales_stage'] && $_REQUEST['sales_stage'] != '') - { - $date_var = date('YmdHis'); - $closingdate = getDBInsertDateValue($this->column_fields['closingdate']); - $sql = "insert into vtiger_potstagehistory values('',".$this->id.",'".$this->column_fields['amount']."','".$sales_stage."','".$this->column_fields['probability']."',0,".$adb->formatString("vtiger_potstagehistory","closedate",$closingdate).",".$adb->formatString("vtiger_potstagehistory","lastmodified",$date_var).")"; - $adb->query($sql); - } - } - elseif($_REQUEST['module'] == 'PurchaseOrder' || $_REQUEST['module'] == 'SalesOrder' || $_REQUEST['module'] == 'Quotes' || $_REQUEST['module'] == 'Invoice') - { - //added to update the history for PO, SO, Quotes and Invoice - $history_field_array = Array( - "PurchaseOrder"=>"postatus", - "SalesOrder"=>"sostatus", - "Quotes"=>"quotestage", - "Invoice"=>"invoicestatus" - ); - - $inventory_module = $_REQUEST['module']; - - if($_REQUEST['ajxaction'] == 'DETAILVIEW')//if we use ajax edit - { - if($inventory_module == "PurchaseOrder") - $relatedname = getVendorName($this->column_fields['vendor_id']); - else - $relatedname = getAccountName($this->column_fields['account_id']); - - $total = $this->column_fields['hdnGrandTotal']; - } - else//using edit button and save - { - if($inventory_module == "PurchaseOrder") - $relatedname = $_REQUEST["vendor_name"]; - else - $relatedname = $_REQUEST["account_name"]; - - $total = $_REQUEST['total']; - } - - $oldvalue = getSingleFieldValue($this->table_name,$history_field_array[$inventory_module],$this->module_id,$this->id); - if($oldvalue != $this->column_fields["$history_field_array[$inventory_module]"]) - { - addInventoryHistory($inventory_module, $this->id,$relatedname,$total,$this->column_fields["$history_field_array[$inventory_module]"]); - } - } - - //Check done by Don. If update is empty the the query fails - if(trim($update) != '') - { - $sql1 = "update ".$table_name." set ".$update." where ".$this->tab_name_index[$table_name]."=".$this->id; - - $adb->query($sql1); - } - //to disable the update of groupentity relation in ajax edit for the fields except assigned_user_id field - if($_REQUEST['ajxaction'] != 'DETAILVIEW' || ($_REQUEST['ajxaction'] == 'DETAILVIEW' && $_REQUEST['fldName'] == 'assigned_user_id')) - { - if($_REQUEST['assigntype'] == 'T') - { - $groupname = $_REQUEST['assigned_group_name']; - //echo 'about to update lead group relation'; - if($module == 'Leads' && $table_name == 'vtiger_leaddetails') - { - updateLeadGroupRelation($this->id,$groupname); - } - elseif($module == 'Accounts' && $table_name == 'vtiger_account') - { - updateAccountGroupRelation($this->id,$groupname); - } - elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') - { - updateContactGroupRelation($this->id,$groupname); - } - elseif($module == 'Potentials' && $table_name == 'vtiger_potential') - { - updatePotentialGroupRelation($this->id,$groupname); - } - elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') - { - updateQuoteGroupRelation($this->id,$groupname); - } - elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') - { - updateSoGroupRelation($this->id,$groupname); - } - elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') - { - updateInvoiceGroupRelation($this->id,$groupname); - } - elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') - { - updatePoGroupRelation($this->id,$groupname); - } - elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') - { - updateTicketGroupRelation($this->id,$groupname); - } - elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') - { - updateCampaignGroupRelation($this->id,$groupname); - } - elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') - { - if($table_name == 'vtiger_activity') - { - updateActivityGroupRelation($this->id,$groupname); - } - } - - - } - else - { - //echo 'about to update lead group relation again!'; - if($module == 'Leads' && $table_name == 'vtiger_leaddetails') - { - updateLeadGroupRelation($this->id,''); - } - elseif($module == 'Accounts' && $table_name == 'vtiger_account') - { - updateAccountGroupRelation($this->id,''); - } - elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') - { - updateContactGroupRelation($this->id,''); - } - elseif($module == 'Potentials' && $table_name == 'vtiger_potential') - { - updatePotentialGroupRelation($this->id,''); - } - elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') - { - updateQuoteGroupRelation($this->id,''); - } - elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') - { - updateSoGroupRelation($this->id,''); - } - elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') - { - updateInvoiceGroupRelation($this->id,''); - } - elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') - { - updatePoGroupRelation($this->id,''); - } - elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') - { - updateTicketGroupRelation($this->id,''); - } - elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') - { - updateCampaignGroupRelation($this->id,$groupname); - } - elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') - { - if($table_name == 'vtiger_activity') - { - updateActivityGroupRelation($this->id,$groupname); - } - } - - - } - } - - } - else - { - $sql1 = "insert into ".$table_name." (".$column.") values(".$value.")"; - $adb->query($sql1); - $groupname = $_REQUEST['assigned_group_name']; - if($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_leaddetails') - { - insert2LeadGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_account') - { - insert2AccountGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_contactdetails') - { - insert2ContactGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_potential') - { - insert2PotentialGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_quotes') - { - insert2QuoteGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_salesorder') - { - insert2SoGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_invoice') - { - insert2InvoiceGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_purchaseorder') - { - insert2PoGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_activity') - { - insert2ActivityGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_troubletickets') - { - insert2TicketGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_campaign') - { - insert2CampaignGroupRelation($this->id,$groupname); - } - - } - - } - /** Function to delete a record in the specifed table - * @param $table_name -- table name:: Type varchar - * The function will delete a record .The id is obtained from the class variable $this->id and the columnname got from $this->tab_name_index[$table_name] - */ -function deleteRelation($table_name) -{ - global $adb; - $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; - $check_result=$adb->query($check_query); - $num_rows = $adb->num_rows($check_result); - - if($num_rows == 1) - { - $del_query = "DELETE from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; - $adb->query($del_query); - } - -} - /** Function to attachment filename of the given entity - * @param $notesid -- crmid:: Type Integer - * The function will get the attachmentsid for the given entityid from vtiger_seattachmentsrel table and get the attachmentsname from vtiger_attachments table - * returns the 'filename' - */ -function getOldFileName($notesid) -{ - global $log; -$log->info("in getOldFileName ".$notesid); - global $adb; - $query1 = "select * from vtiger_seattachmentsrel where crmid=".$notesid; - $result = $adb->query($query1); - $noofrows = $adb->num_rows($result); - if($noofrows != 0) - $attachmentid = $adb->query_result($result,0,'attachmentsid'); - if($attachmentid != '') - { - $query2 = "select * from vtiger_attachments where attachmentsid=".$attachmentid; - $filename = $adb->query_result($adb->query($query2),0,'name'); - } - return "'".$filename."'"; -} - /** Function to insert values in vtiger_ticketcomments for the specified tablename and module - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - */ -function insertIntoTicketCommentTable($table_name, $module) -{ - global $log; - $log->info("in insertIntoTicketCommentTable ".$table_name." module is ".$module); - global $adb; - global $current_user; - - $current_time = $adb->formatDate(date('YmdHis')); - if($this->column_fields['assigned_user_id'] != '') - $ownertype = 'user'; - else - $ownertype = 'customer'; - - if($this->column_fields['comments'] != '') - $comment = $this->column_fields['comments']; - else - $comment = $_REQUEST['comments']; - - if($comment != '') - { - $comment = addslashes($comment); - $sql = "insert into vtiger_ticketcomments values('',".$this->id.",'".$comment."','".$current_user->id."','".$ownertype."',".$current_time.")"; - $adb->query($sql); - } -} - /** Function to insert values in vtiger_faqcomments table for the specified module, - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - */ -function insertIntoFAQCommentTable($table_name, $module) -{ - global $log; - $log->info("in insertIntoFAQCommentTable ".$table_name." module is ".$module); - global $adb; - - $current_time = $adb->formatDate(date('YmdHis')); - - if($this->column_fields['comments'] != '') - $comment = $this->column_fields['comments']; - else - $comment = $_REQUEST['comments']; - - if($comment != '') - { - $comment = addslashes($comment); - $sql = "insert into vtiger_faqcomments values('',".$this->id.",'".$comment."',".$current_time.")"; - $adb->query($sql); - } -} - /** Function to insert values in vtiger_faqcomments table for the specified module, - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - */ -function insertIntoReminderTable($table_name,$module,$recurid) -{ - global $log; -$log->info("in insertIntoReminderTable ".$table_name." module is ".$module); - if($_REQUEST['set_reminder'] == 'Yes') - { -$log->debug("set reminder is set"); - $rem_days = $_REQUEST['remdays']; -$log->debug("rem_days is ".$rem_days); - $rem_hrs = $_REQUEST['remhrs']; -$log->debug("rem_hrs is ".$rem_hrs); - $rem_min = $_REQUEST['remmin']; -$log->debug("rem_minutes is ".$rem_min); - $reminder_time = $rem_days * 24 * 60 + $rem_hrs * 60 + $rem_min; -$log->debug("reminder_time is ".$reminder_time); - if ($recurid == "") - { - if($_REQUEST['mode'] == 'edit') - { - $this->activity_reminder($this->id,$reminder_time,0,$recurid,'edit'); - } - else - { - $this->activity_reminder($this->id,$reminder_time,0,$recurid,''); - } - } - else - { - $this->activity_reminder($this->id,$reminder_time,0,$recurid,''); - } - } - elseif($_REQUEST['set_reminder'] == 'No') - { - $this->activity_reminder($this->id,'0',0,$recurid,'delete'); - } -} - -// Code included by Minnie - starts - /** Function to insert values in vtiger_invitees table for the specified module,tablename ,invitees_array - * @param $table_name -- table name:: Type varchar - * @param $module -- module:: Type varchar - * @param $invitees_array Array - */ -function insertIntoInviteeTable($table_name,$module,$invitees_array) -{ - global $log,$adb; - $log->debug("Entering insertIntoInviteeTable(".$table_name.",".$module.",".$invitees_array.") method ..."); - foreach($invitees_array as $inviteeid) - { - if($inviteeid != '') - { - $query="insert into vtiger_invitees values(".$this->id.",".$inviteeid.")"; - $adb->query($query); - } - } - $log->debug("Exiting insertIntoInviteeTable method ..."); - -} -// Code included by Minnie - Ends - -// Code included by Jaguar - starts - /** Function to insert values in vtiger_recurringevents table for the specified tablename,module - * @param $recurObj -- Recurring Object:: Type varchar - */ -function insertIntoRecurringTable(& $recurObj) -{ - global $log,$adb; - $log->info("in insertIntoRecurringTable "); - $st_date = $recurObj->startdate->get_formatted_date(); - $log->debug("st_date ".$st_date); - $end_date = $recurObj->enddate->get_formatted_date(); - $log->debug("end_date is set ".$end_date); - $type = $recurObj->recur_type; - $log->debug("type is ".$type); - $flag="true"; - - if($_REQUEST['mode'] == 'edit') - { - $activity_id=$this->id; - - $sql='select min(recurringdate) AS min_date,max(recurringdate) AS max_date, recurringtype, activityid from vtiger_recurringevents where activityid='. $activity_id.' group by activityid, recurringtype'; - - $result = $adb->query($sql); - $noofrows = $adb->num_rows($result); - for($i=0; $i<$noofrows; $i++) - { - $recur_type_b4_edit = $adb->query_result($result,$i,"recurringtype"); - $date_start_b4edit = $adb->query_result($result,$i,"min_date"); - $end_date_b4edit = $adb->query_result($result,$i,"max_date"); - } - if(($st_date == $date_start_b4edit) && ($end_date==$end_date_b4edit) && ($type == $recur_type_b4_edit)) - { - if($_REQUEST['set_reminder'] == 'Yes') - { - $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; - $adb->query($sql); - $sql = 'delete from vtiger_recurringevents where activityid='.$activity_id; - $adb->query($sql); - $flag="true"; - } - elseif($_REQUEST['set_reminder'] == 'No') - { - $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; - $adb->query($sql); - $flag="false"; - } - else - $flag="false"; - } - else - { - $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; - $adb->query($sql); - $sql = 'delete from vtiger_recurringevents where activityid='.$activity_id; - $adb->query($sql); - } - } - $date_array = $recurObj->recurringdates; - if(isset($recurObj->recur_freq) && $recurObj->recur_freq != null) - $recur_freq = $recurObj->recur_freq; - else - $recur_freq = 1; - if($recurObj->recur_type == 'Daily' || $recurObj->recur_type == 'Yearly') - $recurringinfo = $recurObj->recur_type; - elseif($recurObj->recur_type == 'Weekly') - { - $recurringinfo = $recurObj->recur_type; - if($recurObj->dayofweek_to_rpt != null) - $recurringinfo = $recurringinfo.'::'.implode('::',$recurObj->dayofweek_to_rpt); - } - elseif($recurObj->recur_type == 'Monthly') - { - $recurringinfo = $recurObj->recur_type.'::'.$recurObj->repeat_monthby; - if($recurObj->repeat_monthby == 'date') - $recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_datevalue; - else - $recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_daytype.'::'.$recurObj->dayofweek_to_rpt[0]; - } - else - { - $recurringinfo = ''; - } - if($flag=="true") - { - for($k=0; $k< count($date_array); $k++) - { - $tdate=$date_array[$k]; - if($tdate <= $end_date) - { - $max_recurid_qry = 'select max(recurringid) AS recurid from vtiger_recurringevents;'; - $result = $adb->query($max_recurid_qry); - $noofrows = $adb->num_rows($result); - for($i=0; $i<$noofrows; $i++) - { - $recur_id = $adb->query_result($result,$i,"recurid"); - } - $current_id =$recur_id+1; - $recurring_insert = "insert into vtiger_recurringevents values ('".$current_id."','".$this->id."','".$tdate."','".$type."','".$recur_freq."','".$recurringinfo."')"; - $adb->query($recurring_insert); - if($_REQUEST['set_reminder'] == 'Yes') - { - $this->insertIntoReminderTable("activity_reminder",$module,$current_id,''); - } - } - } - } -} - -// Code included by Jaguar - Ends - - /** Function to retrive the information of the given recordid ,module - * @param $record -- Id:: Type Integer - * @param $module -- module:: Type varchar - * This function retrives the information from the database and sets the value in the class columnfields array - */ - function retrieve_entity_info($record, $module) - { - global $adb,$log,$app_strings; - $result = Array(); - foreach($this->tab_name_index as $table_name=>$index) - { - $result[$table_name] = $adb->query("select * from ".$table_name." where ".$index."=".$record); - if($adb->query_result($result["vtiger_crmentity"],0,"deleted") == 1) - die("

".$app_strings['LBL_RECORD_DELETE']." ".$app_strings['LBL_GO_BACK'].".
"); - } - $tabid = getTabid($module); - $sql1 = "select * from vtiger_field where tabid=".$tabid; - $result1 = $adb->query($sql1); - $noofrows = $adb->num_rows($result1); - for($i=0; $i<$noofrows; $i++) - { - $fieldcolname = $adb->query_result($result1,$i,"columnname"); - $tablename = $adb->query_result($result1,$i,"tablename"); - $fieldname = $adb->query_result($result1,$i,"fieldname"); - - $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); - $this->column_fields[$fieldname] = $fld_value; - - } - if($module == 'Users') - { - for($i=0; $i<$noofrows; $i++) - { - $fieldcolname = $adb->query_result($result1,$i,"columnname"); - $tablename = $adb->query_result($result1,$i,"tablename"); - $fieldname = $adb->query_result($result1,$i,"fieldname"); - $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); - $this->$fieldname = $fld_value; - - } - } - - $this->column_fields["record_id"] = $record; - $this->column_fields["record_module"] = $module; - } - - /** Function to saves the values in all the tables mentioned in the class variable $tab_name for the specified module - * @param $module -- module:: Type varchar - */ - function save($module_name) - { - global $log; - $log->debug("module name is ".$module_name); - //GS Save entity being called with the modulename as parameter - $this->saveentity($module_name); - } - - function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1) - { - global $list_max_entries_per_page; - $this->log->debug("process_list_query: ".$query); - if(!empty($limit) && $limit != -1){ - $result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: "); - }else{ - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - } - - $list = Array(); - if($max_per_page == -1){ - $max_per_page = $list_max_entries_per_page; - } - $rows_found = $this->db->getRowCount($result); - - $this->log->debug("Found $rows_found ".$this->object_name."s"); - - $previous_offset = $row_offset - $max_per_page; - $next_offset = $row_offset + $max_per_page; - - if($rows_found != 0) - { - - // We have some data. - - for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){ - - - foreach($this->list_fields as $entry) - { - - foreach($entry as $key=>$field) // this will be cycled only once - { - if (isset($row[$field])) { - $this->column_fields[$this->list_fields_names[$key]] = $row[$field]; - - - $this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field); - } - else - { - $this->column_fields[$this->list_fields_names[$key]] = ""; - } - } - } - - - //$this->db->println("here is the bug"); - - - $list[] = clone($this);//added by Richie to support PHP5 - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - return $response; - } - - function process_full_list_query($query) - { - $this->log->debug("CRMEntity:process_full_list_query"); - $result =& $this->db->query($query, false); - $this->log->debug("CRMEntity:process_full_list_query: result is ".$result); - - - if($this->db->getRowCount($result) > 0){ - - // $this->db->println("process_full mid=".$this->module_id." mname=".$this->module_name); - // We have some data. - while ($row = $this->db->fetchByAssoc($result)) { - $rowid=$row[$this->module_id]; - - if(isset($rowid)) - $this->retrieve_entity_info($rowid,$this->module_name); - else - $this->db->println("rowid not set unable to retrieve"); - - - - //clone function added to resolvoe PHP5 compatibility issue in Dashboards - //If we do not use clone, while using PHP5, the memory address remains fixed but the - //data gets overridden hence all the rows that come in bear the same value. This in turn -//provides a wrong display of the Dashboard graphs. The data is erroneously shown for a specific month alone -//Added by Richie - $list[] = clone($this);//added by Richie to support PHP5 - } - } - - if (isset($list)) return $list; - else return null; - } - - /** This function should be overridden in each module. It marks an item as deleted. - * If it is not overridden, then marking this type of item is not allowed - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function mark_deleted($id) - { - $query = "UPDATE vtiger_crmentity set deleted=1 where crmid='$id'"; - $this->db->query($query, true,"Error marking record deleted: "); - - - } - - - function retrieve_by_string_fields($fields_array, $encode=true) - { - $where_clause = $this->get_where($fields_array); - - $query = "SELECT * FROM $this->table_name $where_clause"; - $this->log->debug("Retrieve $this->object_name: ".$query); - $result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:"); - if( empty($result)) - { - return null; - } - - $row = $this->db->fetchByAssoc($result,-1, $encode); - - foreach($this->column_fields as $field) - { - if(isset($row[$field])) - { - $this->$field = $row[$field]; - } - } - return $this; - } - - // this method is called during an import before inserting a bean - // define an associative array called $special_fields - // the keys are user defined, and don't directly map to the bean's vtiger_fields - // the value is the method name within that bean that will do extra - // processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name' - - function process_special_fields() - { - foreach ($this->special_functions as $func_name) - { - if ( method_exists($this,$func_name) ) - { - $this->$func_name(); - } - } - } - - /** - * Function to check if the custom vtiger_field vtiger_table exists - * return true or false - */ - function checkIfCustomTableExists($tablename) - { - $query = "select * from ".$tablename; - $result = $this->db->query($query); - $testrow = $this->db->num_fields($result); - if($testrow > 1) - { - $exists=true; - } - else - { - $exists=false; - } - return $exists; - } - - /** - * function to construct the query to fetch the custom vtiger_fields - * return the query to fetch the custom vtiger_fields - */ - function constructCustomQueryAddendum($tablename,$module) - { - global $adb; - $tabid=getTabid($module); - $sql1 = "select columnname,fieldlabel from vtiger_field where generatedtype=2 and tabid=".$tabid; - $result = $adb->query($sql1); - $numRows = $adb->num_rows($result); - $sql3 = "select "; - for($i=0; $i < $numRows;$i++) - { - $columnName = $adb->query_result($result,$i,"columnname"); - $fieldlable = $adb->query_result($result,$i,"fieldlabel"); - //construct query as below - if($i == 0) - { - $sql3 .= $tablename.".".$columnName. " '" .$fieldlable."'"; - } - else - { - $sql3 .= ", ".$tablename.".".$columnName. " '" .$fieldlable."'"; - } - - } - if($numRows>0) - { - $sql3=$sql3.','; - } - return $sql3; - - } - - - /** function to save the product tax information in producttarel vtiger_table - * @param string $tablename - vtiger_tablename to save the product tax relationship (producttaxrel) - * @param string $module - current module name - * $return void - */ - function insertTaxInformation($tablename, $module) - { - global $adb, $log; - $log->debug("Entering into insertTaxInformation($tablename, $module) method ..."); - $tax_details = getAllTaxes(); - - $tax_per = ''; - //Save the Product - tax relationship if corresponding tax check box is enabled - //Delete the existing tax if any - if($this->mode == 'edit') - { - for($i=0;$iquery($sql); - } - } - for($i=0;$idebug("Tax selected but value not given so default value will be saved."); - $tax_per = getTaxPercentage($tax_name); - } - - $log->debug("Going to save the Product - $tax_name tax relationship"); - - $query = "insert into vtiger_producttaxrel values($this->id,$taxid,$tax_per)"; - $adb->query($query); - } - } - - $log->debug("Exiting from insertTaxInformation($tablename, $module) method ..."); - } - - /** - * This function returns a full (ie non-paged) list of the current object type. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_full_list($order_by = "", $where = "") { - $this->log->debug("get_full_list: order_by = '$order_by' and where = '$where'"); - $query = $this->create_list_query($order_by, $where); - return $this->process_full_list_query($query); - } - - /** - * Track the viewing of a detail record. This leverages get_summary_text() which is object specific - * params $user_id - The user that is viewing the record. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function track_view($user_id, $current_module,$id='') - { - $this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)"); - - $tracker = new Tracker(); - $tracker->track_view($user_id, $current_module, $id, ''); - } - -} -?> +mode; + + $this->db->println("TRANS saveentity starts $module"); + $this->db->startTransaction(); + + + foreach($this->tab_name as $table_name) + { + + if($table_name == "vtiger_crmentity") + { + $this->insertIntoCrmEntity($module); + } + elseif($table_name == 'vtiger_entity2org') + { + $this->insertIntoEntity2Org($this->id,$module); + } + else + { + $this->insertIntoEntityTable($table_name, $module); + } + } + + //Calling the Module specific save code + $this->save_module($module); + + $this->db->completeTransaction(); + $this->db->println("TRANS saveentity ends"); + } + + + + function insertIntoAttachment1($id,$module,$filedata,$filename,$filesize,$filetype,$user_id) + { + $date_var = date('YmdHis'); + global $current_user; + global $adb; + //global $root_directory; + global $log; + + $ownerid = $user_id; + + if($filesize != 0) + { + $data = base64_encode(fread(fopen($filedata, "r"), $filesize)); + } + + $current_id = $adb->getUniqueID("vtiger_crmentity"); + + if($module=='Emails') + { + $log->info("module is ".$module); + $idname='emailid'; $tablename='emails'; $descname='description'; + } + else + { + $idname='notesid'; $tablename='notes'; $descname='notecontent'; + } + + $sql="update ".$tablename." set filename='".$filename."' where ".$idname."=".$id; + $adb->query($sql); + + $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','"."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; + $adb->query($sql1); + + $sql2="insert into vtiger_attachments(attachmentsid, name, description, type) values(".$current_id.",'".$filename."','"."','".$filetype."')"; + $result=$adb->query($sql2); + + //TODO -- instead of put contents in db now we should store the file in harddisk + + $sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')'; + $adb->query($sql3); + } + + + + /** + * This function is used to upload the attachment in the server and save that attachment information in db. + * @param int $id - entity id to which the file to be uploaded + * @param string $module - the current module name + * @param array $file_details - array which contains the file information(name, type, size, tmp_name and error) + * return void + */ + function uploadAndSaveFile($id,$module,$file_details) + { + global $log; + $log->debug("Entering into uploadAndSaveFile($id,$module,$file_details) method."); + + global $adb, $current_user; + global $upload_badext; + + $date_var = date('YmdHis'); + + //to get the owner id + $ownerid = $this->column_fields['assigned_user_id']; + if(!isset($ownerid) || $ownerid=='') + $ownerid = $current_user->id; + + + // Arbitrary File Upload Vulnerability fix - Philip + $binFile = $file_details['name']; + $ext_pos = strrpos($binFile, "."); + + $ext = substr($binFile, $ext_pos + 1); + + if (in_array($ext, $upload_badext)) + { + $binFile .= ".txt"; + } + // Vulnerability fix ends + + $current_id = $adb->getUniqueID("vtiger_crmentity"); + + $filename = basename($binFile); + $filetype= $file_details['type']; + $filesize = $file_details['size']; + $filetmp_name = $file_details['tmp_name']; + + //get the file path inwhich folder we want to upload the file + $upload_file_path = decideFilePath(); + + //upload the file in server + $upload_status = move_uploaded_file($filetmp_name,$upload_file_path.$current_id."_".$binFile); + + $save_file = 'true'; + //only images are allowed for these modules + if($module == 'Contacts' || $module == 'Products') + { + $save_file = validateImageFile(&$file_details); + } + + if($save_file == 'true' && $upload_status == 'true') + { + //This is only to update the attached filename in the vtiger_notes vtiger_table for the Notes module + if($module=='Notes') + { + $sql="update vtiger_notes set filename='".$filename."' where notesid = ".$id; + $adb->query($sql); + } + + $sql1 = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values(".$current_id.",".$current_user->id.",".$ownerid.",'".$module." Attachment','".$this->column_fields['description']."',".$adb->formatString("vtiger_crmentity","createdtime",$date_var).",".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var).")"; + $adb->query($sql1); + + $sql2="insert into vtiger_attachments(attachmentsid, name, description, type, path) values(".$current_id.",'".$filename."','".$this->column_fields['description']."','".$filetype."','".$upload_file_path."')"; + $result=$adb->query($sql2); + + if($_REQUEST['mode'] == 'edit') + { + if($id != '' && $_REQUEST['fileid'] != '') + { + $delquery = 'delete from vtiger_seattachmentsrel where crmid = '.$id.' and attachmentsid = '.$_REQUEST['fileid']; + $adb->query($delquery); + } + } + if($module == 'Notes') + { + $query = "delete from vtiger_seattachmentsrel where crmid = ".$id; + $adb->query($query); + } + $sql3='insert into vtiger_seattachmentsrel values('.$id.','.$current_id.')'; + $adb->query($sql3); + + return true; + } + else + { + $log->debug("Skip the save attachment process."); + return false; + } + } + + /** Function to insert values in the vtiger_crmentity for the specified module + * @param $module -- module:: Type varchar + */ + + function insertIntoCrmEntity($module) + { + global $adb; + global $current_user; + global $log; + + $date_var = date('YmdHis'); + if($_REQUEST['assigntype'] == 'T') + { + $ownerid= 0; + } + else + { + $ownerid = $this->column_fields['assigned_user_id']; + } + + if($module == 'Products' || $module == 'Notes' || $module =='Faq' || $module == 'Vendors' || $module == 'PriceBooks') + { + $log->info("module is =".$module); + $ownerid = $current_user->id; + } + if($module == 'Events') + { + $module = 'Calendar'; + } + if($this->mode == 'edit') + { + $description_val = from_html($adb->formatString("vtiger_crmentity","description",$this->column_fields['description']),($insertion_mode == 'edit')?true:false); + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + $tabid = getTabid($module); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0) + { + $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.",description=".$description_val.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; + } + else + { + $profileList = getCurrentUserProfileList(); + $perm_qry = "SELECT columnname 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 WHERE vtiger_field.tabid = ".$tabid." AND vtiger_profile2field.visible = 0 AND vtiger_profile2field.profileid IN ".$profileList." AND vtiger_def_org_field.visible = 0 and vtiger_field.tablename='vtiger_crmentity' and vtiger_field.displaytype in (1,3);"; + $perm_result = $adb->query($perm_qry); + $perm_rows = $adb->num_rows($perm_result); + for($i=0; $i<$perm_rows; $i++) + { + $columname[]=$adb->query_result($perm_result,$i,"columnname"); + } + if(is_array($columname) && in_array("description",$columname)) + { + $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.",description=".$description_val.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; + } + else + { + $sql = "update vtiger_crmentity set smownerid=".$ownerid.",modifiedby=".$current_user->id.", modifiedtime=".$adb->formatString("vtiger_crmentity","modifiedtime",$date_var)." where crmid=".$this->id; + } + } + $adb->query($sql); + $sql1 ="delete from vtiger_ownernotify where crmid=".$this->id; + $adb->query($sql1); + if($ownerid != $current_user->id) + { + $sql1 = "insert into vtiger_ownernotify values(".$this->id.",".$ownerid.",null)"; + $adb->query($sql1); + } + } + else + { + //if this is the create mode and the group allocation is chosen, then do the following + $current_id = $adb->getUniqueID("vtiger_crmentity"); + $_REQUEST['currentid']=$current_id; + + $description_val = from_html($adb->formatString("vtiger_crmentity","description",$this->column_fields['description']),($insertion_mode == 'edit')?true:false); + $sql = "insert into vtiger_crmentity (crmid,smcreatorid,smownerid,setype,description,createdtime,modifiedtime) values('".$current_id."','".$current_user->id."','".$ownerid."','".$module."',".$description_val.",".$adb->formatDate($date_var).",".$adb->formatDate($date_var).")"; + $adb->query($sql); + $this->id = $current_id; + + //set the organization relation for this entity + //default value: The current selected organization + $orglist = array(); + if( isset($_SESSION['authenticated_user_current_organization']) && $_SESSION['authenticated_user_current_organization'] != '') { + $orglist[0] = $_SESSION['authenticated_user_current_organization']; + } else { + global $current_organization; + $orglist[0] = $current_organization; + } + + //if we still have not got some organization + if( count( $orglist) < 0) { + $log->info("crmid ".$this->id." is not explizitely related to any organization"); + $sql = "select organizationname from vtiger_organizationdetails where deleted=0"; + $result = $adb->query($sql); + $orglist[0]=$adb->query_result($result,$i,"organizationname"); + } + if( count( $orglist) < 0) { + $log->fatal("crmid ".$this->id." is not related to any organization"); + } + + //set up the relations in the database + foreach($orglist as $org) { + $sql = "insert into vtiger_entity2org (crmid,organizationname,primarytag) values (".$this->id.",'".$org."',1)"; + $adb->query($sql); + } + } + + } + + /** Function to insert values in the vtiger_entity2org relation + * @param $crmid -- CRM id + * @param $module -- module object + */ + function insertIntoEntity2Org($crmid,$module) + { + global $current_organization; + global $log; + + $log->debug( "Entering insertIntoEntity2Org for crmid=".$crmid." module=".$module); + + // parameters + if( isset( $crmid) && $crmid != '' && + isset( $this->column_fields["otherorgs"]) && $this->column_fields["otherorgs"] != '') { + + // the organization list is the current users organization plus + // the other organizations stored in the modules parameters + if( is_array( $this->column_fields["otherorgs"])) { + // As array when enetered in EditView + $orglist = array(); + foreach( array_keys( $this->column_fields["otherorgs"]) as $key) + $orglist[] = $this->column_fields["otherorgs"][$key]; + } else { + // As string when entered in DetailView + $orglist = explode( ' |##| ', $this->column_fields["otherorgs"]); + } + $orglist[] = $current_organization; + + // get the current list of assignments + $sql = "SELECT organizationname,primarytag FROM vtiger_entity2org WHERE crmid='".$crmid."'"; + $result = $this->db->query($sql); + $delete = array(); + $noofrows = $this->db->num_rows($result); + + for( $i=0; $i<$noofrows; $i++) { + $organizationname = $this->db->query_result($result,$i,"organizationname"); + // If this organization is part of the $orglist array we'll + // just keept it. + for( $j=0; $jdb->query_result($result,$i,"primarytag"); + if( $primary == 0) + $delete[] = $organizationname; + } + + // Now we have two arrays $delete and $orglist defining the + // required database modification + $delstr = ""; + foreach( $delete as $org) { + if( $delstr == "") + $delstr = "'".$org."'"; + else + $delstr .= ",'".$org."'"; + } + if( $delstr != '') { + $sql = "DELETE from vtiger_entity2org WHERE crmid='".$crmid."' + AND organizationname IN (".$delstr.")"; + $result = $this->db->query($sql); + } + + foreach( $orglist as $org) { + $sql = "INSERT INTO vtiger_entity2org (crmid,organizationname,primarytag) + VALUES ('".$crmid."','".$org."',0)"; + $result = $this->db->query($sql); + } + } + + $log->debug( "Exit from insertIntoEntity2Org for crmid=".$crmid." module=".$module); + } + + + /** Function to insert values in the specifed table for the specified module + * @param $table_name -- table name:: Type varchar + * @param $module -- module:: Type varchar + */ + function insertIntoEntityTable($table_name, $module) + { + global $log; + global $current_user; + $log->info("function insertIntoEntityTable ".$module.' vtiger_table name ' .$table_name); + global $adb; + $insertion_mode = $this->mode; + + //Checkin whether an entry is already is present in the vtiger_table to update + if($insertion_mode == 'edit') + { + $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; + $check_result=$adb->query($check_query); + + $num_rows = $adb->num_rows($check_result); + + if($num_rows <= 0) + { + $insertion_mode = ''; + } + } + + if($insertion_mode == 'edit') + { + $update = ''; + $tabid= getTabid($module); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0) + { + + $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3)"; + } + else + { + $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 + WHERE vtiger_field.tabid = ".$tabid." + AND vtiger_profile2field.visible = 0 + AND vtiger_profile2field.profileid IN ".$profileList." + AND vtiger_def_org_field.visible = 0 and vtiger_field.tablename='".$table_name."' and vtiger_field.displaytype in (1,3)"; + } + + } + else + { + $column = $this->tab_name_index[$table_name]; + if($column == 'id' && $table_name == 'vtiger_users') + { + $currentuser_id = $adb->getUniqueID("vtiger_users"); + $this->id = $currentuser_id; + } elseif( $column == 'orgunitid' && $table_name == 'vtiger_orgunit') { + $this->id = $adb->getUniqueID("vtiger_orgunit"); + } + $value = $this->id; + $tabid= getTabid($module); + $sql = "select * from vtiger_field where tabid=".$tabid." and tablename='".$table_name."' and displaytype in (1,3,4)"; + } + + $result = $adb->query($sql); + $noofrows = $adb->num_rows($result); + for($i=0; $i<$noofrows; $i++) + { + $fieldname=$adb->query_result($result,$i,"fieldname"); + $columname=$adb->query_result($result,$i,"columnname"); + $uitype=$adb->query_result($result,$i,"uitype"); + + if(isset($this->column_fields[$fieldname])) + { + if($uitype == 56) + { + if($this->column_fields[$fieldname] == 'on' || $this->column_fields[$fieldname] == 1) + { + $fldvalue = 1; + } + else + { + $fldvalue = 0; + } + + } + // Added for inheritance and extensions fields + elseif( $uitype == '3' || $uitype == '4' || $uitype == '18' || + $uitype == '31' || $uitype == '32') { + $fldvalue = $this->column_fields[$fieldname]; + if( isset( $this->column_fields[$fieldname."@##@"]) && + $this->column_fields[$fieldname."@##@"] == 1) + $fldvalue = "@##@".$fldvalue; + } + elseif($uitype == 33) + { + if(is_array($this->column_fields[$fieldname])) + { + $field_list = implode(' |##| ',$this->column_fields[$fieldname]); + }else + { + $field_list = $this->column_fields[$fieldname]; + } + $fldvalue = $field_list; + } + elseif($uitype == 5 || $uitype == 6 || $uitype ==23) + { + if($_REQUEST['action'] == 'Import' || + ereg("^".$module."Ajax",$_REQUEST['action'])) + { + $fldvalue = $this->column_fields[$fieldname]; + } + else + { + $fldvalue = getDBInsertDateValue($this->column_fields[$fieldname]); + } + } + elseif($uitype == 7) + { + //strip out the spaces and commas in numbers if given ie., in amounts there may be , + $fldvalue = str_replace(",","",$this->column_fields[$fieldname]);//trim($this->column_fields[$fieldname],","); + + } + else + { + $fldvalue = $this->column_fields[$fieldname]; + $fldvalue = stripslashes($fldvalue); + } + $fldvalue = from_html($adb->formatString($table_name,$columname,$fldvalue),($insertion_mode == 'edit')?true:false); + } + else + { + $fldvalue = ''; + } + if($fldvalue=='') $fldvalue ="NULL"; + if($insertion_mode == 'edit') + { + if($table_name == 'vtiger_notes' && $columname == 'filename' && $_FILES['filename']['name'] == '') + { + $fldvalue = $this->getOldFileName($this->id); + } + if($table_name != 'vtiger_ticketcomments') + { + if($i == 0) + { + $update = $columname."=".$fldvalue.""; + } + else + { + $update .= ', '.$columname."=".$fldvalue.""; + } + } + } + else + { + $column .= ", ".$columname; + $value .= ", ".$fldvalue.""; + } + + } + + + + + + if($insertion_mode == 'edit') + { + if($_REQUEST['module'] == 'Potentials') + { + $dbquery = 'select sales_stage from vtiger_potential where potentialid = '.$this->id; + $sales_stage = $adb->query_result($adb->query($dbquery),0,'sales_stage'); + if($sales_stage != $_REQUEST['sales_stage'] && $_REQUEST['sales_stage'] != '') + { + $date_var = date('YmdHis'); + $closingdate = getDBInsertDateValue($this->column_fields['closingdate']); + $sql = "insert into vtiger_potstagehistory values('',".$this->id.",'".$this->column_fields['amount']."','".$sales_stage."','".$this->column_fields['probability']."',0,".$adb->formatString("vtiger_potstagehistory","closedate",$closingdate).",".$adb->formatString("vtiger_potstagehistory","lastmodified",$date_var).")"; + $adb->query($sql); + } + } + elseif($_REQUEST['module'] == 'PurchaseOrder' || $_REQUEST['module'] == 'SalesOrder' || $_REQUEST['module'] == 'Quotes' || $_REQUEST['module'] == 'Invoice') + { + //added to update the history for PO, SO, Quotes and Invoice + $history_field_array = Array( + "PurchaseOrder"=>"postatus", + "SalesOrder"=>"sostatus", + "Quotes"=>"quotestage", + "Invoice"=>"invoicestatus" + ); + + $inventory_module = $_REQUEST['module']; + + if($_REQUEST['ajxaction'] == 'DETAILVIEW')//if we use ajax edit + { + if($inventory_module == "PurchaseOrder") + $relatedname = getVendorName($this->column_fields['vendor_id']); + else + $relatedname = getAccountName($this->column_fields['account_id']); + + $total = $this->column_fields['hdnGrandTotal']; + } + else//using edit button and save + { + if($inventory_module == "PurchaseOrder") + $relatedname = $_REQUEST["vendor_name"]; + else + $relatedname = $_REQUEST["account_name"]; + + $total = $_REQUEST['total']; + } + + $oldvalue = getSingleFieldValue($this->table_name,$history_field_array[$inventory_module],$this->module_id,$this->id); + if($oldvalue != $this->column_fields["$history_field_array[$inventory_module]"]) + { + addInventoryHistory($inventory_module, $this->id,$relatedname,$total,$this->column_fields["$history_field_array[$inventory_module]"]); + } + } + + //Check done by Don. If update is empty the the query fails + if(trim($update) != '') + { + $sql1 = "update ".$table_name." set ".$update." where ".$this->tab_name_index[$table_name]."=".$this->id; + + $adb->query($sql1); + } + //to disable the update of groupentity relation in ajax edit for the fields except assigned_user_id field + if($_REQUEST['ajxaction'] != 'DETAILVIEW' || ($_REQUEST['ajxaction'] == 'DETAILVIEW' && $_REQUEST['fldName'] == 'assigned_user_id')) + { + if($_REQUEST['assigntype'] == 'T') + { + $groupname = $_REQUEST['assigned_group_name']; + //echo 'about to update lead group relation'; + if($module == 'Leads' && $table_name == 'vtiger_leaddetails') + { + updateLeadGroupRelation($this->id,$groupname); + } + elseif($module == 'Accounts' && $table_name == 'vtiger_account') + { + updateAccountGroupRelation($this->id,$groupname); + } + elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') + { + updateContactGroupRelation($this->id,$groupname); + } + elseif($module == 'Potentials' && $table_name == 'vtiger_potential') + { + updatePotentialGroupRelation($this->id,$groupname); + } + elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') + { + updateQuoteGroupRelation($this->id,$groupname); + } + elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') + { + updateSoGroupRelation($this->id,$groupname); + } + elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') + { + updateInvoiceGroupRelation($this->id,$groupname); + } + elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') + { + updatePoGroupRelation($this->id,$groupname); + } + elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') + { + updateTicketGroupRelation($this->id,$groupname); + } + elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') + { + updateCampaignGroupRelation($this->id,$groupname); + } + elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') + { + if($table_name == 'vtiger_activity') + { + updateActivityGroupRelation($this->id,$groupname); + } + } + + + } + else + { + //echo 'about to update lead group relation again!'; + if($module == 'Leads' && $table_name == 'vtiger_leaddetails') + { + updateLeadGroupRelation($this->id,''); + } + elseif($module == 'Accounts' && $table_name == 'vtiger_account') + { + updateAccountGroupRelation($this->id,''); + } + elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') + { + updateContactGroupRelation($this->id,''); + } + elseif($module == 'Potentials' && $table_name == 'vtiger_potential') + { + updatePotentialGroupRelation($this->id,''); + } + elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') + { + updateQuoteGroupRelation($this->id,''); + } + elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') + { + updateSoGroupRelation($this->id,''); + } + elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') + { + updateInvoiceGroupRelation($this->id,''); + } + elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') + { + updatePoGroupRelation($this->id,''); + } + elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') + { + updateTicketGroupRelation($this->id,''); + } + elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') + { + updateCampaignGroupRelation($this->id,$groupname); + } + elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') + { + if($table_name == 'vtiger_activity') + { + updateActivityGroupRelation($this->id,$groupname); + } + } + + + } + } + + } + else + { + $sql1 = "insert into ".$table_name." (".$column.") values(".$value.")"; + $adb->query($sql1); + $groupname = $_REQUEST['assigned_group_name']; + if($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_leaddetails') + { + insert2LeadGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_account') + { + insert2AccountGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_contactdetails') + { + insert2ContactGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_potential') + { + insert2PotentialGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_quotes') + { + insert2QuoteGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_salesorder') + { + insert2SoGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_invoice') + { + insert2InvoiceGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_purchaseorder') + { + insert2PoGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_activity') + { + insert2ActivityGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_troubletickets') + { + insert2TicketGroupRelation($this->id,$groupname); + } + elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_campaign') + { + insert2CampaignGroupRelation($this->id,$groupname); + } + + } + + } + /** Function to delete a record in the specifed table + * @param $table_name -- table name:: Type varchar + * The function will delete a record .The id is obtained from the class variable $this->id and the columnname got from $this->tab_name_index[$table_name] + */ +function deleteRelation($table_name) +{ + global $adb; + $check_query = "select * from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; + $check_result=$adb->query($check_query); + $num_rows = $adb->num_rows($check_result); + + if($num_rows == 1) + { + $del_query = "DELETE from ".$table_name." where ".$this->tab_name_index[$table_name]."=".$this->id; + $adb->query($del_query); + } + +} + /** Function to attachment filename of the given entity + * @param $notesid -- crmid:: Type Integer + * The function will get the attachmentsid for the given entityid from vtiger_seattachmentsrel table and get the attachmentsname from vtiger_attachments table + * returns the 'filename' + */ +function getOldFileName($notesid) +{ + global $log; +$log->info("in getOldFileName ".$notesid); + global $adb; + $query1 = "select * from vtiger_seattachmentsrel where crmid=".$notesid; + $result = $adb->query($query1); + $noofrows = $adb->num_rows($result); + if($noofrows != 0) + $attachmentid = $adb->query_result($result,0,'attachmentsid'); + if($attachmentid != '') + { + $query2 = "select * from vtiger_attachments where attachmentsid=".$attachmentid; + $filename = $adb->query_result($adb->query($query2),0,'name'); + } + return "'".$filename."'"; +} + + + + + + + + +// Code included by Jaguar - Ends + + /** Function to retrive the information of the given recordid ,module + * @param $record -- Id:: Type Integer + * @param $module -- module:: Type varchar + * This function retrives the information from the database and sets the value in the class columnfields array + */ + function retrieve_entity_info($record, $module) + { + global $adb,$log,$app_strings; + $result = Array(); + foreach($this->tab_name_index as $table_name=>$index) + { + if( $module == 'Organization') { + $result[$table_name] = $adb->query("select * from ".$table_name." where ".$index."='".$record."'"); + } elseif( $module == 'OrgUnit' ) { + $result[$table_name] = $adb->query("select * from ".$table_name." where ".$index."=".$record); + } else { + $result[$table_name] = $adb->query("select * from ".$table_name." where ".$index."=".$record); + if($adb->query_result($result["vtiger_crmentity"],0,"deleted") == 1) + die("

".$app_strings['LBL_RECORD_DELETE']." ".$app_strings['LBL_GO_BACK'].".
"); + } + } + $tabid = getTabid($module); + $sql1 = "select * from vtiger_field where tabid=".$tabid; + $result1 = $adb->query($sql1); + $noofrows = $adb->num_rows($result1); + for($i=0; $i<$noofrows; $i++) + { + $fieldcolname = $adb->query_result($result1,$i,"columnname"); + $tablename = $adb->query_result($result1,$i,"tablename"); + $fieldname = $adb->query_result($result1,$i,"fieldname"); + $uitype = $adb->query_result($result1,$i,"uitype"); + + // vtiger_entity2org results in a list value + if( $tablename == 'vtiger_entity2org') { + $fld_value = array(); + $nooforgs = $adb->num_rows( $result[$tablename]); + for($o=0; $o<$nooforgs; $o++) { + $fld_value[$adb->query_result($result[$tablename],$o,'organizationname')] = + $adb->query_result($result[$tablename],$o,'primarytag'); + } + } else { + $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); + } + + // Added for inheritance and extensions fields + if( $uitype == '3' || $uitype == '4' || $uitype == '18' || + $uitype == '31' || $uitype == '32') { + if( substr( $fld_value, 0, 4) == "@##@") { + $this->column_fields[$fieldname."@##@"] = 1; + $fld_value = substr( $fld_value, 4, strlen( $fld_value)-4); + } else { + $this->column_fields[$fieldname."@##@"] = 0; + } + } + $this->column_fields[$fieldname] = $fld_value; + + } + if($module == 'Users') + { + for($i=0; $i<$noofrows; $i++) + { + $fieldcolname = $adb->query_result($result1,$i,"columnname"); + $tablename = $adb->query_result($result1,$i,"tablename"); + $fieldname = $adb->query_result($result1,$i,"fieldname"); + $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); + $this->$fieldname = $fld_value; + + } + } + + $this->column_fields["record_id"] = $record; + $this->column_fields["record_module"] = $module; + } + + /** Function to saves the values in all the tables mentioned in the class variable $tab_name for the specified module + * @param $module -- module:: Type varchar + */ + function save($module_name) + { + global $log; + $log->debug("module name is ".$module_name); + //GS Save entity being called with the modulename as parameter + $this->saveentity($module_name); + } + + function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1) + { + global $list_max_entries_per_page; + $this->log->debug("process_list_query: ".$query); + if(!empty($limit) && $limit != -1){ + $result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: "); + }else{ + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + } + + $list = Array(); + if($max_per_page == -1){ + $max_per_page = $list_max_entries_per_page; + } + $rows_found = $this->db->getRowCount($result); + + $this->log->debug("Found $rows_found ".$this->object_name."s"); + + $previous_offset = $row_offset - $max_per_page; + $next_offset = $row_offset + $max_per_page; + + if($rows_found != 0) + { + + // We have some data. + + for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){ + + + foreach($this->list_fields as $entry) + { + + foreach($entry as $key=>$field) // this will be cycled only once + { + if (isset($row[$field])) { + $this->column_fields[$this->list_fields_names[$key]] = $row[$field]; + + + $this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field); + } + else + { + $this->column_fields[$this->list_fields_names[$key]] = ""; + } + } + } + + + //$this->db->println("here is the bug"); + + + $list[] = clone($this);//added by Richie to support PHP5 + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + return $response; + } + + function process_full_list_query($query) + { + $this->log->debug("CRMEntity:process_full_list_query"); + $result =& $this->db->query($query, false); + $this->log->debug("CRMEntity:process_full_list_query: result is ".$result); + + + if($this->db->getRowCount($result) > 0){ + + // $this->db->println("process_full mid=".$this->module_id." mname=".$this->module_name); + // We have some data. + while ($row = $this->db->fetchByAssoc($result)) { + $rowid=$row[$this->module_id]; + + if(isset($rowid)) + $this->retrieve_entity_info($rowid,$this->module_name); + else + $this->db->println("rowid not set unable to retrieve"); + + + + //clone function added to resolvoe PHP5 compatibility issue in Dashboards + //If we do not use clone, while using PHP5, the memory address remains fixed but the + //data gets overridden hence all the rows that come in bear the same value. This in turn +//provides a wrong display of the Dashboard graphs. The data is erroneously shown for a specific month alone +//Added by Richie + $list[] = clone($this);//added by Richie to support PHP5 + } + } + + if (isset($list)) return $list; + else return null; + } + + /** This function should be overridden in each module. It marks an item as deleted. + * If it is not overridden, then marking this type of item is not allowed + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function mark_deleted($id) + { + $query = "UPDATE vtiger_crmentity set deleted=1 where crmid='$id'"; + $this->db->query($query, true,"Error marking record deleted: "); + + + } + + + function retrieve_by_string_fields($fields_array, $encode=true) + { + $where_clause = $this->get_where($fields_array); + + $query = "SELECT * FROM $this->table_name $where_clause"; + $this->log->debug("Retrieve $this->object_name: ".$query); + $result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:"); + if( empty($result)) + { + return null; + } + + $row = $this->db->fetchByAssoc($result,-1, $encode); + + foreach($this->column_fields as $field) + { + if(isset($row[$field])) + { + $this->$field = $row[$field]; + } + } + return $this; + } + + // this method is called during an import before inserting a bean + // define an associative array called $special_fields + // the keys are user defined, and don't directly map to the bean's vtiger_fields + // the value is the method name within that bean that will do extra + // processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name' + + function process_special_fields() + { + foreach ($this->special_functions as $func_name) + { + if ( method_exists($this,$func_name) ) + { + $this->$func_name(); + } + } + } + + /** + * Function to check if the custom vtiger_field vtiger_table exists + * return true or false + */ + function checkIfCustomTableExists($tablename) + { + $query = "select * from ".$tablename; + $result = $this->db->query($query); + $testrow = $this->db->num_fields($result); + if($testrow > 1) + { + $exists=true; + } + else + { + $exists=false; + } + return $exists; + } + + /** + * function to construct the query to fetch the custom vtiger_fields + * return the query to fetch the custom vtiger_fields + */ + function constructCustomQueryAddendum($tablename,$module) + { + global $adb; + $tabid=getTabid($module); + $sql1 = "select columnname,fieldlabel from vtiger_field where generatedtype=2 and tabid=".$tabid; + $result = $adb->query($sql1); + $numRows = $adb->num_rows($result); + $sql3 = "select "; + for($i=0; $i < $numRows;$i++) + { + $columnName = $adb->query_result($result,$i,"columnname"); + $fieldlable = $adb->query_result($result,$i,"fieldlabel"); + //construct query as below + if($i == 0) + { + $sql3 .= $tablename.".".$columnName. " '" .$fieldlable."'"; + } + else + { + $sql3 .= ", ".$tablename.".".$columnName. " '" .$fieldlable."'"; + } + + } + if($numRows>0) + { + $sql3=$sql3.','; + } + return $sql3; + + } + + + /** + * This function returns a full (ie non-paged) list of the current object type. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_full_list($order_by = "", $where = "") { + $this->log->debug("get_full_list: order_by = '$order_by' and where = '$where'"); + $query = $this->create_list_query($order_by, $where); + return $this->process_full_list_query($query); + } + + /** + * Track the viewing of a detail record. This leverages get_summary_text() which is object specific + * params $user_id - The user that is viewing the record. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function track_view($user_id, $current_module,$id='') + { + $this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)"); + + $tracker = new Tracker(); + $tracker->track_view($user_id, $current_module, $id, ''); + } + + + +} +?> Modified: vtigercrm/branches/5.1_jens/data/SugarBean.php ============================================================================== --- vtigercrm/branches/5.1_jens/data/SugarBean.php (original) +++ vtigercrm/branches/5.1_jens/data/SugarBean.php Tue Nov 14 03:16:10 2006 @@ -1,451 +1,451 @@ -id) || $this->id == "") - { - $isUpdate = false; - } - - if ( $this->new_with_id == true ) - { - $isUpdate = false; - } - - //$this->date_modified = $this->db->formatDate(date('YmdHis')); - $this->date_modified = $this->db->formatDate(date('YmdHis')); - if (isset($current_user)) $this->modified_user_id = $current_user->id; - - if($isUpdate) - { - $query = "Update ".$this->table_name." set "; - } - else - { - //$this->date_entered = $this->db->formatDate(date('YmdHis')); - $this->date_entered = $this->db->formatDate(date('YmdHis')); - - if($this->new_schema && - $this->new_with_id == false) - { - $this->id = $this->db->getUniqueID("vtiger_users"); - } - - $query = "INSERT into ".$this->table_name; - } - // todo - add date modified to the list. - - // write out the SQL statement. - //$query .= $this->table_name." set "; - - $firstPass = 0; - $insKeys = '('; - $insValues = '('; - $updKeyValues=''; - foreach($this->column_fields as $field) - { - // Do not write out the id vtiger_field on the update statement. - // We are not allowed to change ids. - if($isUpdate && ('id' == $field)) - continue; - - // Only assign variables that have been set. - if(isset($this->$field)) - { - // Try comparing this element with the head element. - if(0 == $firstPass) - { - $firstPass = 1; - } - else - { - if($isUpdate) - { - $updKeyValues = $updKeyValues.", "; - } - else - { - $insKeys = $insKeys.", "; - $insValues = $insValues.", "; - } - } - /*else - $query = $query.", "; - - $query = $query.$field."='".$adb->quote(from_html($this->$field,$isUpdate))."'"; - */ - if($isUpdate) - { - $updKeyValues = $updKeyValues.$field."=".$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate)); - } - else - { - $insKeys = $insKeys.$field; - $insValues = $insValues.$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate)); - } - } - } - - if($isUpdate) - { - $query = $query.$updKeyValues." WHERE ID = '$this->id'"; - $this->log->info("Update $this->object_name: ".$query); - } - else - { - $query = $query.$insKeys.") VALUES ".$insValues.")"; - $this->log->info("Insert: ".$query); - } - - $this->db->query($query, true); - - // If this is not an update then store the id for later. - if(!$isUpdate && !$this->new_schema && !$this->new_with_id) - { - $this->db->println("Illegal Access - SugarBean"); - //this is mysql specific - $this->id = $this->db->getOne("SELECT LAST_INSERT_ID()" ); - } - - return $this->id; - } - - - /** - * This function retrieves a record of the appropriate type from the DB. - * It fills in all of the vtiger_fields from the DB into the object it was called on. - * param $id - If ID is specified, it overrides the current value of $this->id. If not specified the current value of $this->id will be used. - * returns this - The object that it was called apon or null if exactly 1 record was not found. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. - * All Rights Reserved. - * Contributor(s): ______________________________________.. - function retrieve($id = -1, $encodeThis=true) { - if ($id == -1) { - $id = $this->id; - } - if($id == '') { - return null; - } -// GS porting vtiger_crmentity -$query = "SELECT * FROM $this->table_name WHERE $this->module_id = '$id'"; -// $query = "SELECT * FROM $this->table_name WHERE ID = '$id'"; - $this->log->debug("Retrieve $this->object_name: ".$query); - - $result =& $this->db->requireSingleResult($query, true, "Retrieving record by id $this->table_name:$id found "); - - if(empty($result)) - { - return null; - } - - $row = $this->db->fetchByAssoc($result, -1, $encodeThis); - - foreach($this->column_fields as $field) - { - if(isset($row[$field])) - { - $this->$field = $row[$field]; - } - } - return $this; - } - */ - - function get_list($order_by = "", $where = "", $row_offset = 0, $limit=-1, $max=-1) { - $this->log->debug("get_list: order_by = '$order_by' and where = '$where' and limit = '$limit'"); - - $query = $this->create_list_query($order_by, $where); - - return $this->process_list_query($query, $row_offset, $limit, $max); - } - - /** - * This function returns a full (ie non-paged) list of the current object type. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_full_list($order_by = "", $where = "") { - $this->log->debug("get_full_list: order_by = '$order_by' and where = '$where'"); - $query = "SELECT * FROM $this->table_name "; - - if($where != "") - $query .= "where ($where) AND deleted=0"; - else - $query .= "where deleted=0"; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - - $result =& $this->db->query($query, false); - - if($this->db->getRowCount($result) > 0){ - - // We have some data. - while ($row = $this->db->fetchByAssoc($result)) { - foreach($this->list_fields as $field) - { - if (isset($row[$field])) { - $this->$field = $row[$field]; - - $this->log->debug("process_full_list: $this->object_name({$row['id']}): ".$field." = ".$this->$field); - } - else { - $this->$field = ''; - } - } - - - $list[] = clone($this); //added clone tosupport PHP5 - } - } - - if (isset($list)) return $list; - else return null; - - } - - function create_list_query($order_by, $where) - { - $query = "SELECT * FROM $this->table_name "; - - if($where != "") - $query .= "where ($where) AND deleted=0"; - else - $query .= "where deleted=0"; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - - return $query; - } - - - function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1) - { - global $list_max_entries_per_page; - $this->log->debug("process_list_query: ".$query); - if(!empty($limit) && $limit != -1){ - $result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: "); - }else{ - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - } - - $list = Array(); - if($max_per_page == -1){ - $max_per_page = $list_max_entries_per_page; - } - $rows_found = $this->db->getRowCount($result); - - $this->log->debug("Found $rows_found ".$this->object_name."s"); - - $previous_offset = $row_offset - $max_per_page; - $next_offset = $row_offset + $max_per_page; - - if($rows_found != 0) - { - - // We have some data. - - for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){ - foreach($this->list_fields as $field) - { - if (isset($row[$field])) { - $this->$field = $row[$field]; - - - $this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field); - } - else - { - $this->$field = ""; - } - } - - - $list[] = clone($this); //added clone to support PHP5 - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - return $response; - } - - - /** - * Track the viewing of a detail record. This leverages get_summary_text() which is object specific - * params $user_id - The user that is viewing the record. - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function track_view($user_id, $current_module,$id='') - { - $this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)"); - - $tracker = new Tracker(); - $tracker->track_view($user_id, $current_module, $id, ''); - } - - - /** This function should be overridden in each module. It marks an item as deleted. - * If it is not overridden, then marking this type of item is not allowed - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function mark_deleted($id) - { - $query = "UPDATE $this->table_name set deleted=1 where id='$id'"; - $this->db->query($query, true,"Error marking record deleted: "); - - $this->mark_relationships_deleted($id); - - // Take the item off of the recently viewed lists. - $tracker = new Tracker(); - $tracker->delete_item_history($id); - - } - - - /* This is to allow subclasses to fill in row specific columns of a list view form - function list_view_parse_additional_sections(&$list_form) - { - } - */ - /* This function assigns all of the values into the template for the list view - function get_list_view_array(){ - $return_array = Array(); - - foreach($this->list_fields as $field) - { - $return_array[strtoupper($field)] = $this->$field; - } - - return $return_array; - } - function get_list_view_data() - { - - return $this->get_list_view_array(); - } - - function get_where(&$fields_array) - { - $where_clause = "WHERE "; - $first = 1; - foreach ($fields_array as $name=>$value) - { - if ($first) - { - $first = 0; - } - else - { - $where_clause .= " AND "; - } - - $where_clause .= "$name = ".$adb->quote($value).""; - } - - $where_clause .= " AND deleted=0"; - return $where_clause; - } - - - function retrieve_by_string_fields($fields_array, $encode=true) - { - $where_clause = $this->get_where($fields_array); - - $query = "SELECT * FROM $this->table_name $where_clause"; - $this->log->debug("Retrieve $this->object_name: ".$query); - $result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:"); - if( empty($result)) - { - return null; - } - - $row = $this->db->fetchByAssoc($result,-1, $encode); - - foreach($this->column_fields as $field) - { - if(isset($row[$field])) - { - $this->$field = $row[$field]; - } - } - return $this; - } - - // this method is called during an import before inserting a bean - // define an associative array called $special_fields - // the keys are user defined, and don't directly map to the bean's vtiger_fields - // the value is the method name within that bean that will do extra - // processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name' - - function process_special_fields() - { - foreach ($this->special_functions as $func_name) - { - if ( method_exists($this,$func_name) ) - { - $this->$func_name(); - } - } - } - - */ -} - - -?> +id) || $this->id == "") + { + $isUpdate = false; + } + + if ( $this->new_with_id == true ) + { + $isUpdate = false; + } + + //$this->date_modified = $this->db->formatDate(date('YmdHis')); + $this->date_modified = date('YmdHis'); + if (isset($current_user)) $this->modified_user_id = $current_user->id; + + if($isUpdate) + { + $query = "Update ".$this->table_name." set "; + } + else + { + //$this->date_entered = $this->db->formatDate(date('YmdHis')); + $this->date_entered = date('YmdHis'); + + if($this->new_schema && + $this->new_with_id == false) + { + $this->id = $this->db->getUniqueID("vtiger_users"); + } + + $query = "INSERT into ".$this->table_name; + } + // todo - add date modified to the list. + + // write out the SQL statement. + //$query .= $this->table_name." set "; + + $firstPass = 0; + $insKeys = '('; + $insValues = '('; + $updKeyValues=''; + foreach($this->column_fields as $field) + { + // Do not write out the id vtiger_field on the update statement. + // We are not allowed to change ids. + if($isUpdate && ('id' == $field)) + continue; + + // Only assign variables that have been set. + if(isset($this->$field)) + { + // Try comparing this element with the head element. + if(0 == $firstPass) + { + $firstPass = 1; + } + else + { + if($isUpdate) + { + $updKeyValues = $updKeyValues.", "; + } + else + { + $insKeys = $insKeys.", "; + $insValues = $insValues.", "; + } + } + /*else + $query = $query.", "; + + $query = $query.$field."='".$adb->quote(from_html($this->$field,$isUpdate))."'"; + */ + if($isUpdate) + { + $updKeyValues = $updKeyValues.$field."=".$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate)); + } + else + { + $insKeys = $insKeys.$field; + $insValues = $insValues.$this->db->formatString($this->table_name,$field,from_html($this->$field,$isUpdate)); + } + } + } + + if($isUpdate) + { + $query = $query.$updKeyValues." WHERE ID = '$this->id'"; + $this->log->info("Update $this->object_name: ".$query); + } + else + { + $query = $query.$insKeys.") VALUES ".$insValues.")"; + $this->log->info("Insert: ".$query); + } + + $this->db->query($query, true); + + // If this is not an update then store the id for later. + if(!$isUpdate && !$this->new_schema && !$this->new_with_id) + { + $this->db->println("Illegal Access - SugarBean"); + //this is mysql specific + $this->id = $this->db->getOne("SELECT LAST_INSERT_ID()" ); + } + + return $this->id; + } + + + /** + * This function retrieves a record of the appropriate type from the DB. + * It fills in all of the vtiger_fields from the DB into the object it was called on. + * param $id - If ID is specified, it overrides the current value of $this->id. If not specified the current value of $this->id will be used. + * returns this - The object that it was called apon or null if exactly 1 record was not found. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. + * All Rights Reserved. + * Contributor(s): ______________________________________.. + function retrieve($id = -1, $encodeThis=true) { + if ($id == -1) { + $id = $this->id; + } + if($id == '') { + return null; + } +// GS porting vtiger_crmentity +$query = "SELECT * FROM $this->table_name WHERE $this->module_id = '$id'"; +// $query = "SELECT * FROM $this->table_name WHERE ID = '$id'"; + $this->log->debug("Retrieve $this->object_name: ".$query); + + $result =& $this->db->requireSingleResult($query, true, "Retrieving record by id $this->table_name:$id found "); + + if(empty($result)) + { + return null; + } + + $row = $this->db->fetchByAssoc($result, -1, $encodeThis); + + foreach($this->column_fields as $field) + { + if(isset($row[$field])) + { + $this->$field = $row[$field]; + } + } + return $this; + } + */ + + function get_list($order_by = "", $where = "", $row_offset = 0, $limit=-1, $max=-1) { + $this->log->debug("get_list: order_by = '$order_by' and where = '$where' and limit = '$limit'"); + + $query = $this->create_list_query($order_by, $where); + + return $this->process_list_query($query, $row_offset, $limit, $max); + } + + /** + * This function returns a full (ie non-paged) list of the current object type. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_full_list($order_by = "", $where = "") { + $this->log->debug("get_full_list: order_by = '$order_by' and where = '$where'"); + $query = "SELECT * FROM $this->table_name "; + + if($where != "") + $query .= "where ($where) AND deleted=0"; + else + $query .= "where deleted=0"; + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + + $result =& $this->db->query($query, false); + + if($this->db->getRowCount($result) > 0){ + + // We have some data. + while ($row = $this->db->fetchByAssoc($result)) { + foreach($this->list_fields as $field) + { + if (isset($row[$field])) { + $this->$field = $row[$field]; + + $this->log->debug("process_full_list: $this->object_name({$row['id']}): ".$field." = ".$this->$field); + } + else { + $this->$field = ''; + } + } + + + $list[] = clone($this); //added clone tosupport PHP5 + } + } + + if (isset($list)) return $list; + else return null; + + } + + function create_list_query($order_by, $where) + { + $query = "SELECT * FROM $this->table_name "; + + if($where != "") + $query .= "where ($where) AND deleted=0"; + else + $query .= "where deleted=0"; + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + + return $query; + } + + + function process_list_query($query, $row_offset, $limit= -1, $max_per_page = -1) + { + global $list_max_entries_per_page; + $this->log->debug("process_list_query: ".$query); + if(!empty($limit) && $limit != -1){ + $result =& $this->db->limitQuery($query, $row_offset + 0, $limit,true,"Error retrieving $this->object_name list: "); + }else{ + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + } + + $list = Array(); + if($max_per_page == -1){ + $max_per_page = $list_max_entries_per_page; + } + $rows_found = $this->db->getRowCount($result); + + $this->log->debug("Found $rows_found ".$this->object_name."s"); + + $previous_offset = $row_offset - $max_per_page; + $next_offset = $row_offset + $max_per_page; + + if($rows_found != 0) + { + + // We have some data. + + for($index = $row_offset , $row = $this->db->fetchByAssoc($result, $index); $row && ($index < $row_offset + $max_per_page || $max_per_page == -99) ;$index++, $row = $this->db->fetchByAssoc($result, $index)){ + foreach($this->list_fields as $field) + { + if (isset($row[$field])) { + $this->$field = $row[$field]; + + + $this->log->debug("$this->object_name({$row['id']}): ".$field." = ".$this->$field); + } + else + { + $this->$field = ""; + } + } + + + $list[] = clone($this); //added clone to support PHP5 + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + return $response; + } + + + /** + * Track the viewing of a detail record. This leverages get_summary_text() which is object specific + * params $user_id - The user that is viewing the record. + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function track_view($user_id, $current_module,$id='') + { + $this->log->debug("About to call vtiger_tracker (user_id, module_name, item_id)($user_id, $current_module, $this->id)"); + + $tracker = new Tracker(); + $tracker->track_view($user_id, $current_module, $id, ''); + } + + + /** This function should be overridden in each module. It marks an item as deleted. + * If it is not overridden, then marking this type of item is not allowed + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function mark_deleted($id) + { + $query = "UPDATE $this->table_name set deleted=1 where id='$id'"; + $this->db->query($query, true,"Error marking record deleted: "); + + $this->mark_relationships_deleted($id); + + // Take the item off of the recently viewed lists. + $tracker = new Tracker(); + $tracker->delete_item_history($id); + + } + + + /* This is to allow subclasses to fill in row specific columns of a list view form + function list_view_parse_additional_sections(&$list_form) + { + } + */ + /* This function assigns all of the values into the template for the list view + function get_list_view_array(){ + $return_array = Array(); + + foreach($this->list_fields as $field) + { + $return_array[strtoupper($field)] = $this->$field; + } + + return $return_array; + } + function get_list_view_data() + { + + return $this->get_list_view_array(); + } + + function get_where(&$fields_array) + { + $where_clause = "WHERE "; + $first = 1; + foreach ($fields_array as $name=>$value) + { + if ($first) + { + $first = 0; + } + else + { + $where_clause .= " AND "; + } + + $where_clause .= "$name = ".$adb->quote($value).""; + } + + $where_clause .= " AND deleted=0"; + return $where_clause; + } + + + function retrieve_by_string_fields($fields_array, $encode=true) + { + $where_clause = $this->get_where($fields_array); + + $query = "SELECT * FROM $this->table_name $where_clause"; + $this->log->debug("Retrieve $this->object_name: ".$query); + $result =& $this->db->requireSingleResult($query, true, "Retrieving record $where_clause:"); + if( empty($result)) + { + return null; + } + + $row = $this->db->fetchByAssoc($result,-1, $encode); + + foreach($this->column_fields as $field) + { + if(isset($row[$field])) + { + $this->$field = $row[$field]; + } + } + return $this; + } + + // this method is called during an import before inserting a bean + // define an associative array called $special_fields + // the keys are user defined, and don't directly map to the bean's vtiger_fields + // the value is the method name within that bean that will do extra + // processing for that vtiger_field. example: 'full_name'=>'get_names_from_full_name' + + function process_special_fields() + { + foreach ($this->special_functions as $func_name) + { + if ( method_exists($this,$func_name) ) + { + $this->$func_name(); + } + } + } + + */ +} + + +?> Modified: vtigercrm/branches/5.1_jens/data/Tracker.php ============================================================================== --- vtigercrm/branches/5.1_jens/data/Tracker.php (original) +++ vtigercrm/branches/5.1_jens/data/Tracker.php Tue Nov 14 03:16:10 2006 @@ -66,151 +66,39 @@ global $adb; $this->delete_history($user_id, $item_id); global $log; -$log->info("in track view method ".$current_module); + $log->info("in track view method ".$current_module); // Add a new item to the user's list $esc_item_id = addslashes($item_id); //No genius required. Just add an if case and change the query so that it puts the tracker entry whenever you touch on the DetailView of the required entity //get the first name and last name from the respective modules - if($current_module =='Leads') - { - $query = 'select firstname,lastname from vtiger_leaddetails where leadid=' .$item_id; - $result = $this->db->query($query); - $firstname = $adb->query_result($result,0,'firstname'); - $lastname = $adb->query_result($result,0,'lastname'); - $item_summary = $lastname.' '.$firstname; - } - elseif ($current_module =='Accounts') - { - $query = 'select accountname from vtiger_account where accountid=' .$item_id; - $result = $this->db->query($query); - $accountname = $adb->query_result($result,0,'accountname'); - $item_summary = $accountname; - - } - elseif($current_module =='Contacts') - { - $query = 'select firstname,lastname from vtiger_contactdetails where contactid=' .$item_id; - $result = $this->db->query($query); - $firstname = $adb->query_result($result,0,'firstname'); - $lastname = $adb->query_result($result,0,'lastname'); - $item_summary = $lastname.' '.$firstname; - - } - elseif($current_module =='Potentials') - { - $query = 'select potentialname from vtiger_potential where potentialid=' .$item_id; - $result = $this->db->query($query); - $potentialname = $adb->query_result($result,0,'potentialname'); - $item_summary = $potentialname; - } - elseif($current_module =='Notes') - { - $query = 'select title from vtiger_notes where notesid=' .$item_id; - $result = $this->db->query($query); - $title = $adb->query_result($result,0,'title'); - $item_summary = $title; - - } - elseif($current_module =='HelpDesk') - { - $query = 'select title from vtiger_troubletickets where ticketid=' .$item_id; - $result = $this->db->query($query); - $title = $adb->query_result($result,0,'title'); - $item_summary = $title; - } - elseif($current_module =='Calendar') - { - //$query = 'select name from calls where callid=' .$item_id; - $query = 'select subject from vtiger_activity where activityid=' .$item_id; - $result = $this->db->query($query); - $name = $adb->query_result($result,0,'subject'); - $item_summary = $name; - } - elseif($current_module =='Emails') - { - //$query = 'select name from emails where emailid=' .$item_id; - $query = 'select subject from vtiger_activity where activityid=' .$item_id; - $result = $this->db->query($query); - $name = $adb->query_result($result,0,'subject'); - $item_summary = $name; - } - elseif($current_module =='Products') - { - $query = 'select productname from vtiger_products where productid=' .$item_id; - $result = $this->db->query($query); - $productname = $adb->query_result($result,0,'productname'); - $item_summary = $productname; - } - elseif($current_module =='Users') - { - $query = 'select first_name,last_name from vtiger_users where id=' .$item_id; - $result = $this->db->query($query); - $firstname = $adb->query_result($result,0,'first_name'); - $lastname = $adb->query_result($result,0,'last_name'); - $item_summary = $lastname.' '.$firstname; - } - elseif($current_module =='Invoice') - { - $query = 'select subject from vtiger_invoice where invoiceid=' .$item_id; - $result = $this->db->query($query); - $invoice = $adb->query_result($result,0,'subject'); - $item_summary = $invoice; - } - elseif($current_module =='Quotes') - { - $query = 'select subject from vtiger_quotes where quoteid=' .$item_id; - $result = $this->db->query($query); - $quote = $adb->query_result($result,0,'subject'); - $item_summary = $quote; - } - elseif($current_module =='PurchaseOrder') - { - $query = 'select subject from vtiger_purchaseorder where purchaseorderid=' .$item_id; - $result = $this->db->query($query); - $po = $adb->query_result($result,0,'subject'); - $item_summary = $po; - } - elseif($current_module =='SalesOrder') - { - $query = 'select subject from vtiger_salesorder where salesorderid=' .$item_id; - $result = $this->db->query($query); - $so = $adb->query_result($result,0,'subject'); - $item_summary = $so; - } - elseif($current_module =='Vendors') - { - $query = 'select vendorname from vtiger_vendor where vendorid=' .$item_id; - $result = $this->db->query($query); - $vendor = $adb->query_result($result,0,'vendorname'); - $item_summary = $vendor; - } - elseif($current_module =='PriceBooks') - { - $query = 'select bookname from vtiger_pricebook where pricebookid=' .$item_id; - $result = $this->db->query($query); - $pb = $adb->query_result($result,0,'bookname'); - $item_summary = $pb; - } - elseif($current_module =='Campaigns') - { - $query = 'select campaignname from vtiger_campaign where campaignid=' .$item_id; - $result = $this->db->query($query); - $pb = $adb->query_result($result,0,'campaignname'); - $item_summary = $pb; - } - elseif($current_module =='Faq') - { - $query = 'select question from vtiger_faq where id=' .$item_id; - $result = $this->db->query($query); - $pb = $adb->query_result($result,0,'question'); - if(strlen($pb) > 30) - { - $pb=substr($pb,0,30).'...'; - } - $item_summary = $pb; - } + if($current_module != '') + { + $query = "select fieldname,tablename,entityidfield from vtiger_entityname where modulename = '$current_module'"; + $result = $adb->query($query); + $fieldsname = $adb->query_result($result,0,'fieldname'); + $tablename = $adb->query_result($result,0,'tablename'); + $entityidfield = $adb->query_result($result,0,'entityidfield'); + if(!(strpos($fieldsname,',') === false)) + { + $fieldlists = explode(',',$fieldsname); + $fieldsname = "concat("; + $fieldsname = $fieldsname.implode(",' ',",$fieldlists); + $fieldsname = $fieldsname.")"; + } + if($current_module =='Organization') { + $query1 = "select $fieldsname as entityname from $tablename where $entityidfield='".$item_id."'"; + } else { + $query1 = "select $fieldsname as entityname from $tablename where $entityidfield=" .$item_id; + } + $result = $adb->query($query1); + $item_summary = $adb->query_result($result,0,'entityname'); + if(strlen($item_summary) > 30) + { + $item_summary=substr($item_summary,0,30).'...'; + } + } #if condition added to skip vtiger_faq in last viewed history $query = "INSERT into $this->table_name (user_id, module_name, item_id, item_summary) values ('$user_id', '$current_module', '$esc_item_id', ".$this->db->formatString($this->table_name,'item_summary',$item_summary).")"; @@ -238,7 +126,13 @@ } // $query = "SELECT * from $this->table_name WHERE user_id='$user_id' ORDER BY id DESC"; - $query = "SELECT * from $this->table_name inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_tracker.item_id WHERE user_id='$user_id' and vtiger_crmentity.deleted=0 ORDER BY id DESC"; + $query = "SELECT * from $this->table_name"; + if( $module_name != 'Organization') { + $query .= " inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_tracker.item_id WHERE vtiger_crmentity.deleted=0 AND "; + } else { + $query .= " WHERE "; + } + $query .= "user_id='$user_id' ORDER BY id DESC"; $this->log->debug("About to retrieve list: $query"); $result = $this->db->query($query, true); $list = Array(); Modified: vtigercrm/branches/5.1_jens/include/CustomFieldUtil.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/CustomFieldUtil.php (original) +++ vtigercrm/branches/5.1_jens/include/CustomFieldUtil.php Tue Nov 14 03:16:10 2006 @@ -73,6 +73,10 @@ { $fldname = 'Multi-Select Combo Box'; } + elseif($uitype == 85) + { + $fldname = 'Skype'; + } $log->debug("Exiting getCustomFieldTypeName method ..."); return $fldname; } @@ -216,6 +220,10 @@ { $fieldtype = '11'; } + elseif($label == 'Skype') + { + $fieldtype = '12'; + } $log->debug("Exiting getFldTypeandLengthValue method ..."); return $fieldtype; } Modified: vtigercrm/branches/5.1_jens/include/RelatedListView.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/RelatedListView.php (original) +++ vtigercrm/branches/5.1_jens/include/RelatedListView.php Tue Nov 14 03:16:10 2006 @@ -1,646 +1,518 @@ -debug("Entering GetRelatedList(".$module.",".$relatedmodule.",".$focus.",".$query.",".$button.",".$returnset.",".$edit_val.",".$del_val.") method ..."); - - require_once('Smarty_setup.php'); - require_once("data/Tracker.php"); - require_once('include/database/PearDatabase.php'); - - global $adb; - global $app_strings; - global $current_language; - - $current_module_strings = return_module_language($current_language, $module); - - global $list_max_entries_per_page; - global $urlPrefix; - - - global $currentModule; - global $theme; - global $theme_path; - global $theme_path; - global $mod_strings; - // focus_list is the means of passing data to a ListView. - global $focus_list; - $smarty = new vtigerCRM_Smarty; - if (!isset($where)) $where = ""; - - - $button = '
'.$button.'
'; - - // Added to have Purchase Order as form Title - if($relatedmodule == 'Orders') - { - $smarty->assign('ADDBUTTON',get_form_header($app_strings['PurchaseOrder'],$button, false)); - } - else - { - $smarty->assign('ADDBUTTON',get_form_header($app_strings[$relatedmodule],$button, false)); - } - - require_once('themes/'.$theme.'/layout_utils.php'); - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - $smarty->assign("MOD", $mod_strings); - $smarty->assign("APP", $app_strings); - $smarty->assign("IMAGE_PATH",$image_path); - $smarty->assign("MODULE",$relatedmodule); - - - //Retreive the list from Database - //$query = getListQuery("Accounts"); - - //echo '
*****************'.$relatedmodule.' ***************'; - //Appending the security parameter - if($relatedmodule != 'Notes' && $relatedmodule != 'Products' && $relatedmodule != 'Faq' && $relatedmodule != 'PriceBook' && $relatedmodule != 'Vendors') //Security fix by Don - { - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $tab_id=getTabid($relatedmodule); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter($relatedmodule); - $query .= ' '.$sec_parameter; - - } - } - - - if(isset($where) && $where != '') - { - $query .= ' and '.$where; - } - - if(!$_SESSION['rlvs'][$module][$relatedmodule]) - { - $modObj = new ListViewSession(); - $modObj->sortby = $focus->default_order_by; - $modObj->sorder = $focus->default_sort_order; - $_SESSION['rlvs'][$module][$relatedmodule] = get_object_vars($modObj); - } - if(isset($_REQUEST['relmodule']) && ($_REQUEST['relmodule'] == $relatedmodule)) - { - if(method_exists($focus,getSortOrder)) - $sorder = $focus->getSortOrder(); - if(method_exists($focus,getOrderBy)) - $order_by = $focus->getOrderBy(); - - if(isset($order_by) && $order_by != '') - { - $_SESSION['rlvs'][$module][$relatedmodule]['sorder'] = $sorder; - $_SESSION['rlvs'][$module][$relatedmodule]['sortby'] = $order_by; - } - - } - elseif($_SESSION['rlvs'][$module][$relatedmodule]) - { - $sorder = $_SESSION['rlvs'][$module][$relatedmodule]['sorder']; - $order_by = $_SESSION['rlvs'][$module][$relatedmodule]['sortby']; - } - else - { - $order_by = $focus->default_order_by; - $sorder = $focus->default_sort_order; - } - - $query .= ' ORDER BY '.$order_by.' '.$sorder; - $url_qry .="&order_by=".$order_by; - //Added for PHP version less than 5 - if (!function_exists("stripos")) - { - function stripos($query,$needle) - { - return strpos(strtolower($query),strtolower($needle)); - } - } - - //Retreiving the no of rows - $count_query = "select count(*) as count ".substr($query, stripos($query,'from'),strlen($query)); - $count_result = $adb->query(substr($count_query, stripos($count_query,'select'),stripos($count_query,'ORDER BY'))); - $noofrows = $adb->query_result($count_result,0,"count"); - - //Setting Listview session object while sorting/pagination - if(isset($_REQUEST['relmodule']) && $_REQUEST['relmodule']!='' && $_REQUEST['relmodule'] == $relatedmodule) - { - $relmodule = $_REQUEST['relmodule']; - if($_SESSION['rlvs'][$module][$relmodule]) - { - setSessionVar($_SESSION['rlvs'][$module][$relmodule],$noofrows,$list_max_entries_per_page,$module,$relmodule); - } - } - $start = $_SESSION['rlvs'][$module][$relatedmodule]['start']; - - $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); - - $start_rec = $navigation_array['start']; - $end_rec = $navigation_array['end_val']; - - //limiting the query - if ($start_rec ==0) - $limit_start_rec = 0; - else - $limit_start_rec = $start_rec -1; - - if( $adb->dbType == "pgsql") - $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); - else - $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); - - //Retreive the List View Table Header - if($noofrows == 0) - { - $smarty->assign('NOENTRIES',$app_strings['LBL_NONE_SCHEDULED']); - } - else - { - $id = $_REQUEST['record']; - $listview_header = getListViewHeader($focus,$relatedmodule,'',$sorder,$order_by,$id,'',$module);//"Accounts"); - if ($noofrows > 15) - { - $smarty->assign('SCROLLSTART','
'); - $smarty->assign('SCROLLSTOP','
'); - } - $smarty->assign("LISTHEADER", $listview_header); - - if($module == 'PriceBook' && $relatedmodule == 'Products') - { - $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,$edit_val,$del_val); - } - if($module == 'Products' && $relatedmodule == 'PriceBook') - { - $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'EditListPrice','DeletePriceBookProductRel'); - } - elseif($relatedmodule == 'SalesOrder') - { - $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'SalesOrderEditView','DeleteSalesOrder'); - }else - { - $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset); - } - - $navigationOutput = Array(); - $navigationOutput[] = $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; - $module_rel = $module.'&relmodule='.$relatedmodule.'&record='.$id; - $navigationOutput[] = getRelatedTableHeaderNavigation($navigation_array, $url_qry,$module_rel); - $related_entries = array('header'=>$listview_header,'entries'=>$listview_entries,'navigation'=>$navigationOutput); - $log->debug("Exiting GetRelatedList method ..."); - return $related_entries; - } -} - -/** Function to get related list entries in detailed array format - * @param $parentmodule -- parentmodulename:: Type string - * @param $query -- query:: Type string - * @param $id -- id:: Type string - * @returns $entries_list -- entries list:: Type string array - * - */ - -function getAttachmentsAndNotes($parentmodule,$query,$id,$sid='') -{ - global $log; - $log->debug("Entering getAttachmentsAndNotes(".$parentmodule.",".$query.",".$id.",".$sid.") method ..."); - global $theme; - - $list = ''; - echo $list; - - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - require_once ($theme_path."layout_utils.php"); - - global $adb; - global $mod_strings; - global $app_strings; - - $result=$adb->query($query); - $noofrows = $adb->num_rows($result); - - $header[] = $app_strings['LBL_CREATED']; - $header[] = $app_strings['LBL_SUBJECT']; - $header[] = $app_strings['LBL_DESCRIPTION']; - $header[] = $app_strings['LBL_ATTACHMENTS']; - $header[] = $app_strings['LBL_TYPE']; - $header[] = $app_strings['LBL_ACTION']; - - while($row = $adb->fetch_array($result)) - { - $entries = Array(); - if(trim($row['activitytype']) == 'Notes') - { - $module = 'Notes'; - $editaction = 'EditView'; - $deleteaction = 'Delete'; - } - elseif($row['activitytype'] == 'Attachments') - { - $module = 'uploads'; - $editaction = 'upload'; - $deleteaction = 'deleteattachments'; - } - if($row['createdtime'] != '0000-00-00 00:00:00') - { - $created_arr = explode(" ",getDisplayDate($row['createdtime'])); - $created_date = $created_arr[0]; - $created_time = substr($created_arr[1],0,5); - } - else - { - $created_date = ''; - $created_time = ''; - } - - $entries[] = $created_date; - if($module == 'Notes') - { - $entries[] = ''.$row['title'].''; - } - elseif($module == 'uploads') - { - $entries[] = ""; - } - - if(strlen($row['description']) > 40) - { - $row['description'] = substr($row['description'],0,40).'...'; - } - $entries[] = nl2br($row['description']); - $attachmentname = ltrim($row['filename'],$row['attachmentsid'].'_');//explode('_',$row['filename'],2); - - $entries[] = ''.$attachmentname.''; - - $entries[] = $row['activitytype']; - - $del_param = 'index.php?module='.$module.'&action='.$deleteaction.'&return_module='.$parentmodule.'&return_action='.$_REQUEST['action'].'&record='.$row["crmid"].'&return_id='.$_REQUEST["record"]; - - if($module == 'Notes') - { - $edit_param = 'index.php?module='.$module.'&action='.$editaction.'&return_module='.$parentmodule.'&return_action='.$_REQUEST['action'].'&record='.$row["crmid"].'&filename='.$row['filename'].'&fileid='.$row['attachmentsid'].'&return_id='.$_REQUEST["record"]; - - $entries[] .= ''.$app_strings['LNK_EDIT'].' | '.$app_strings['LNK_DELETE'].''; - } - else - { - $entries[] = ''.$app_strings['LNK_DELETE'].''; - } - $entries_list[] = $entries; - } - - if($entries_list !='') - $return_data = array('header'=>$header,'entries'=>$entries_list); - $log->debug("Exiting getAttachmentsAndNotes method ..."); - return $return_data; - -} - -/** Function to get related list entries in detailed array format - * @param $parentmodule -- parentmodulename:: Type string - * @param $query -- query:: Type string - * @param $id -- id:: Type string - * @returns $return_data -- return data:: Type string array - * - */ - -function getHistory($parentmodule,$query,$id) -{ - global $log; - $log->debug("Entering getHistory(".$parentmodule.",".$query.",".$id.") method ..."); - $parentaction = $_REQUEST['action']; - global $theme; - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - require_once ($theme_path."layout_utils.php"); - - global $adb; - global $mod_strings; - global $app_strings; - - //Appending the security parameter - global $current_user; - $rel_tab_id = getTabid("Calendar"); - - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $tab_id=getTabid('Calendar'); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter('Calendar'); - $query .= ' '.$sec_parameter; - - } - $result=$adb->query($query); - $noofrows = $adb->num_rows($result); - - $button .= '
'; - $button .= '
'; - - if($noofrows == 0) - { - } - else - { - $list .= ''; - $list .= ''; - -// Armando L?scher 15.07.2005 -> ?scrollableTables -// Desc: class="blackLine" deleted because of vertical line in title - - $class_black=""; - if($noofrows<=15) - { - $class_black='class="blackLine"'; - $colspan = 'colspan=2'; - } - - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed LBL_SUBJECT to LBL_CREATED - $header[] = $app_strings['LBL_CREATED']; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed LBL_STATUS to LBL_SUBJECT - $header[] = $app_strings['LBL_SUBJECT']; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed LBL_LIST_CONTACT_NAME to LBL_DESCRIPTION - $header[] = $app_strings['LBL_DESCRIPTION']; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed LBL_RELATED_TO to LBL_ACTION - $header[] = $app_strings['LBL_TIME']; - $header[] = $app_strings['LBL_ACTION']; - $header[] = $app_strings['LBL_RELATED_TO']; - $header[] = $app_strings['LBL_ASSIGNED_TO']; - $list .= ''; -/* // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Commented out because this is not used for the title row -*/ - $list .= ''; - $colspan = 9; - if($noofrows>15) - { - $list .= ''; - $colspan = 11; - } - $list .= ''; - - $list .= ''; - -// begin: Armando L?scher 14.07.2005 -> ?scrollableTables -// Desc: 'X' -// Insert new vtiger_table with 1 cell where all entries are in a new vtiger_table. -// This cell will be scrollable when too many entries exist - $list .= ($noofrows>15) ? '':''; -// end: Armando L?scher 14.07.2005 -> ?scrollableTables - - $list .= ''; - - $list .= '
'; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 25% to 90, inserted noWrap - - $colspan = ($noofrows<=15)?'colspan="3"':''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Inserted - $list .= $app_strings['LBL_CREATED'].''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 10% to 30%, inserted '.$colspan.' noWrap - - $list .= $app_strings['LBL_SUBJECT'].''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 18% to 70%, inserted noWrap - - $list .= $app_strings['LBL_DESCRIPTION'].''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 18% to 80, inserted noWrap - - $list .= $app_strings['LBL_ACTION'].'    
':''; -// end: Armando L?scher 14.07.2005 -> ?scrollableTables - - $i=1; - while($row = $adb->fetch_array($result)) - { - $entries = Array(); - if($row['activitytype'] == 'Task') - { - $activitymode = 'Task'; - $icon = 'Tasks.gif'; - $status = $row['status']; - } - elseif($row['activitytype'] == 'Call' || $row['activitytype'] == 'Meeting') - { - $activitymode = 'Events'; - $icon = 'Activities.gif'; - $status = $row['eventstatus']; - } - if ($i%2==0) - $trowclass = 'evenListRow'; - else - $trowclass = 'oddListRow'; - - $created_arr = explode(" ",getDisplayDate($row['createdtime'])); - $created_date = $created_arr[0]; - $created_time = substr($created_arr[1],0,5); - - $list .= ''; - $entries[] = $created_date; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 4% to 90, inserted colspan="2" align="right" valign="top" class="visibleDescriptionLink" style="padding:0px 3px 0px 3px;" noWrap, replaced with $created_date - - $list .= ''; - $list .= ''; - $entries[] = $activity; - $list .= ''; - - $list .= ''; - $list .= ''; - - if($row['firstname'] != 'NULL') - $contactname = $row['firstname'].' '; - if($ros['lastname'] != 'NULL') - $contactname .= $row['lastname']; - - $list .= ''; - - // begin: Armando L?scher 26.09.2005 -> ?visibleDescription - // Desc: Inserted because entries are displayed on 2 rows - $list .= ''; - // end: Armando L?scher 26.09.2005 -> ?visibleDescription - - $parentname = getRelatedTo('Calendar',$result,$i-1); - - $list .= ''; - - // begin: Armando L?scher 26.09.2005 -> ?visibleDescription - // Desc: Added - $list .= ''; - // end: Armando L?scher 26.09.2005 -> ?visibleDescription - - $list .= ''; - $entries[] = $created_time; - - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Inserted - -// $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Inserted - - // begin: Armando L?scher 26.09.2005 -> ?visibleDescription - // Desc: Added - $list .= ''; - $list .= ''; - - // the description is in this space - - $list .= ''; - $list .= ''; - - $list .= ''; - - $list .= ''; - - $i++; - $entries_list[] = $entries; - } - -// begin: Armando L?scher 14.07.2005 -> ?scrollableTables -// Desc: Close vtiger_table from - $list .= ($noofrows>15) ? '
'; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 10% to 70%, inserted rowspan="2" valign="top" class="visibleDescription" - $entries[] = nl2br($row['description']); - $list .= nl2br($row['description']); // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Replaced $status with nl2br($row['description']) - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 18% to 80, inserted valign="top" noWrap - // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: This if-statement replaces the line above - if(isPermitted("Calendar",1,$row["activityid"]) == 'yes') - { - $list .= ''.$app_strings['LNK_EDIT'].''; - - } - $list .= '
'; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 18% to 70, inserted align="right" valign="top" - $list .= $created_time; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Replaced $parentname with $created_time - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 15% to 8%, inserted valign="top" - $list .= $status; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Replaced $modifiedtime with $status - $entries[] = $status; - $list .= ''; - $list .= ''; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Changed width from 10% to 18%, inserted valign="top" - $entries[] = $parentname; - $list .= $parentname; // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Inserted - $list .= ''; - if($row['user_name']==NULL && $row['groupname']!=NULL) - { - $list .= $row['groupname']; - $entries[] = $row['groupname']; - } - else - { - $list .= $row['user_name']; - $entries[] = $row['user_name']; - - } - $list .= ''; - if(isPermitted("Calendar",2,$row["activityid"]) == 'yes') - { - $list .= ''.$app_strings['LNK_DELETE'].''; - } - $list .= ''; - - $list .= '
'; - $return_data = array('header'=>$header,'entries'=>$entries_list); - $log->debug("Exiting getHistory method ..."); - return $return_data; - } -} - -/** Function to display the Products which are related to the PriceBook - * @param string $query - query to get the list of products which are related to the current PriceBook - * @param object $focus - PriceBook object which contains all the information of the current PriceBook - * @param string $returnset - return_module, return_action and return_id which are sequenced with & to pass to the URL which is optional - * return array $return_data which will be formed like array('header'=>$header,'entries'=>$entries_list) where as $header contains all the header columns and $entries_list will contain all the Product entries - */ -function getPriceBookRelatedProducts($query,$focus,$returnset='') -{ - global $log; - $log->debug("Entering getPriceBookRelatedProducts(".$query.",".$focus.",".$returnset.") method ..."); - - global $adb; - global $app_strings; - global $mod_strings; - global $current_language; - $current_module_strings = return_module_language($current_language, 'PriceBook'); - - global $list_max_entries_per_page; - global $urlPrefix; - - global $theme; - $pricebook_id = $_REQUEST['record']; - $theme_path="themes/".$theme."/"; - $image_path=$theme_path."images/"; - require_once($theme_path.'layout_utils.php'); - - //Retreive the list from Database - $list_result = $adb->query($query); - $num_rows = $adb->num_rows($list_result); - - $header=array(); - $header[]=$mod_strings['LBL_LIST_PRODUCT_NAME']; - $header[]=$mod_strings['LBL_PRODUCT_CODE']; - $header[]=$mod_strings['LBL_PRODUCT_UNIT_PRICE']; - $header[]=$mod_strings['LBL_PB_LIST_PRICE']; - $header[]=$mod_strings['LBL_ACTION']; - - for($i=0; $i<$num_rows; $i++) - { - $entity_id = $adb->query_result($list_result,$i,"crmid"); - - $unit_price = $adb->query_result($list_result,$i,"unit_price"); - $listprice = $adb->query_result($list_result,$i,"listprice"); - $field_name=$entity_id."_listprice"; - - $entries = Array(); - $entries[] = $adb->query_result($list_result,$i,"productname"); - $entries[] = $adb->query_result($list_result,$i,"productcode"); - $entries[] = $unit_price; - $entries[] = $listprice; - $entries[] = ''.$app_strings[ | '.$app_strings['; - - $entries_list[] = $entries; - } - if($num_rows>0) - { - $return_data = array('header'=>$header,'entries'=>$entries_list); - - $log->debug("Exiting getPriceBookRelatedProducts method ..."); - return $return_data; - } -} - -?> +debug("Entering GetRelatedList(".$module.",".$relatedmodule.",".$focus.",".$query.",".$button.",".$returnset.",".$edit_val.",".$del_val.") method ..."); + + require_once('Smarty_setup.php'); + require_once("data/Tracker.php"); + require_once('include/database/PearDatabase.php'); + + global $adb; + global $app_strings; + global $current_language; + + $current_module_strings = return_module_language($current_language, $module); + + global $list_max_entries_per_page; + global $urlPrefix; + + + global $currentModule; + global $theme; + global $theme_path; + global $theme_path; + global $mod_strings; + // focus_list is the means of passing data to a ListView. + global $focus_list; + $smarty = new vtigerCRM_Smarty; + if (!isset($where)) $where = ""; + + + $button = '
'.$button.'
'; + + // Added to have Purchase Order as form Title + if($relatedmodule == 'Orders') + { + $smarty->assign('ADDBUTTON',get_form_header($app_strings['PurchaseOrder'],$button, false)); + } + else + { + $smarty->assign('ADDBUTTON',get_form_header($app_strings[$relatedmodule],$button, false)); + } + + require_once('themes/'.$theme.'/layout_utils.php'); + $theme_path="themes/".$theme."/"; + $image_path=$theme_path."images/"; + $smarty->assign("MOD", $mod_strings); + $smarty->assign("APP", $app_strings); + $smarty->assign("IMAGE_PATH",$image_path); + $smarty->assign("MODULE",$relatedmodule); + + + //Retreive the list from Database + //$query = getListQuery("Accounts"); + + //echo '
*****************'.$relatedmodule.' ***************'; + //Appending the security parameter + if($relatedmodule != 'Notes' && $relatedmodule != 'Products' && $relatedmodule != 'Faq' && $relatedmodule != 'PriceBook' && $relatedmodule != 'Vendors') //Security fix by Don + { + global $current_user; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $tab_id=getTabid($relatedmodule); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter($relatedmodule); + $query .= ' '.$sec_parameter; + + } + } + + + if(isset($where) && $where != '') + { + $query .= ' and '.$where; + } + + if(!$_SESSION['rlvs'][$module][$relatedmodule]) + { + $modObj = new ListViewSession(); + $modObj->sortby = $focus->default_order_by; + $modObj->sorder = $focus->default_sort_order; + $_SESSION['rlvs'][$module][$relatedmodule] = get_object_vars($modObj); + } + if(isset($_REQUEST['relmodule']) && ($_REQUEST['relmodule'] == $relatedmodule)) + { + if(method_exists($focus,getSortOrder)) + $sorder = $focus->getSortOrder(); + if(method_exists($focus,getOrderBy)) + $order_by = $focus->getOrderBy(); + + if(isset($order_by) && $order_by != '') + { + $_SESSION['rlvs'][$module][$relatedmodule]['sorder'] = $sorder; + $_SESSION['rlvs'][$module][$relatedmodule]['sortby'] = $order_by; + } + + } + elseif($_SESSION['rlvs'][$module][$relatedmodule]) + { + $sorder = $_SESSION['rlvs'][$module][$relatedmodule]['sorder']; + $order_by = $_SESSION['rlvs'][$module][$relatedmodule]['sortby']; + } + else + { + $order_by = $focus->default_order_by; + $sorder = $focus->default_sort_order; + } + + $query .= ' ORDER BY '.$order_by.' '.$sorder; + $url_qry .="&order_by=".$order_by; + //Added for PHP version less than 5 + if (!function_exists("stripos")) + { + function stripos($query,$needle) + { + return strpos(strtolower($query),strtolower($needle)); + } + } + + //Retreiving the no of rows + $count_query = "select count(*) as count ".substr($query, stripos($query,'from'),strlen($query)); + $count_result = $adb->query(substr($count_query, stripos($count_query,'select'),stripos($count_query,'ORDER BY'))); + $noofrows = $adb->query_result($count_result,0,"count"); + + //Setting Listview session object while sorting/pagination + if(isset($_REQUEST['relmodule']) && $_REQUEST['relmodule']!='' && $_REQUEST['relmodule'] == $relatedmodule) + { + $relmodule = $_REQUEST['relmodule']; + if($_SESSION['rlvs'][$module][$relmodule]) + { + setSessionVar($_SESSION['rlvs'][$module][$relmodule],$noofrows,$list_max_entries_per_page,$module,$relmodule); + } + } + $start = $_SESSION['rlvs'][$module][$relatedmodule]['start']; + + $navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page); + + $start_rec = $navigation_array['start']; + $end_rec = $navigation_array['end_val']; + + //limiting the query + if ($start_rec ==0) + $limit_start_rec = 0; + else + $limit_start_rec = $start_rec -1; + + if( $adb->dbType == "pgsql") + $list_result = $adb->query($query. " OFFSET ".$limit_start_rec." LIMIT ".$list_max_entries_per_page); + else + $list_result = $adb->query($query. " LIMIT ".$limit_start_rec.",".$list_max_entries_per_page); + + //Retreive the List View Table Header + if($noofrows == 0) + { + $smarty->assign('NOENTRIES',$app_strings['LBL_NONE_SCHEDULED']); + } + else + { + $id = $_REQUEST['record']; + $listview_header = getListViewHeader($focus,$relatedmodule,'',$sorder,$order_by,$id,'',$module);//"Accounts"); + if ($noofrows > 15) + { + $smarty->assign('SCROLLSTART','
'); + $smarty->assign('SCROLLSTOP','
'); + } + $smarty->assign("LISTHEADER", $listview_header); + + if($module == 'PriceBook' && $relatedmodule == 'Products') + { + $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,$edit_val,$del_val); + } + if($module == 'Products' && $relatedmodule == 'PriceBook') + { + $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'EditListPrice','DeletePriceBookProductRel'); + } + elseif($relatedmodule == 'SalesOrder') + { + $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset,'SalesOrderEditView','DeleteSalesOrder'); + }else + { + $listview_entries = getListViewEntries($focus,$relatedmodule,$list_result,$navigation_array,'relatedlist',$returnset); + } + + $navigationOutput = Array(); + $navigationOutput[] = $app_strings[LBL_SHOWING]." " .$start_rec." - ".$end_rec." " .$app_strings[LBL_LIST_OF] ." ".$noofrows; + $module_rel = $module.'&relmodule='.$relatedmodule.'&record='.$id; + $navigationOutput[] = getRelatedTableHeaderNavigation($navigation_array, $url_qry,$module_rel); + $related_entries = array('header'=>$listview_header,'entries'=>$listview_entries,'navigation'=>$navigationOutput); + $log->debug("Exiting GetRelatedList method ..."); + return $related_entries; + } +} + +/** Function to get related list entries in detailed array format + * @param $parentmodule -- parentmodulename:: Type string + * @param $query -- query:: Type string + * @param $id -- id:: Type string + * @returns $entries_list -- entries list:: Type string array + * + */ + +function getAttachmentsAndNotes($parentmodule,$query,$id,$sid='') +{ + global $log; + $log->debug("Entering getAttachmentsAndNotes(".$parentmodule.",".$query.",".$id.",".$sid.") method ..."); + global $theme; + + $list = ''; + echo $list; + + $theme_path="themes/".$theme."/"; + $image_path=$theme_path."images/"; + require_once ($theme_path."layout_utils.php"); + + global $adb; + global $mod_strings; + global $app_strings; + + $result=$adb->query($query); + $noofrows = $adb->num_rows($result); + + $header[] = $app_strings['LBL_CREATED']; + $header[] = $app_strings['LBL_SUBJECT']; + $header[] = $app_strings['LBL_DESCRIPTION']; + $header[] = $app_strings['LBL_ATTACHMENTS']; + $header[] = $app_strings['LBL_TYPE']; + $header[] = $app_strings['LBL_ACTION']; + + while($row = $adb->fetch_array($result)) + { + $entries = Array(); + if(trim($row['activitytype']) == 'Notes') + { + $module = 'Notes'; + $editaction = 'EditView'; + $deleteaction = 'Delete'; + } + elseif($row['activitytype'] == 'Attachments') + { + $module = 'uploads'; + $editaction = 'upload'; + $deleteaction = 'deleteattachments'; + } + if($row['createdtime'] != '0000-00-00 00:00:00') + { + $created_arr = explode(" ",getDisplayDate($row['createdtime'])); + $created_date = $created_arr[0]; + $created_time = substr($created_arr[1],0,5); + } + else + { + $created_date = ''; + $created_time = ''; + } + + $entries[] = $created_date; + if($module == 'Notes') + { + $entries[] = ''.$row['title'].''; + } + elseif($module == 'uploads') + { + $entries[] = ""; + } + + if(strlen($row['description']) > 40) + { + $row['description'] = substr($row['description'],0,40).'...'; + } + $entries[] = nl2br($row['description']); + $attachmentname = ltrim($row['filename'],$row['attachmentsid'].'_');//explode('_',$row['filename'],2); + + $entries[] = ''.$attachmentname.''; + + $entries[] = $row['activitytype']; + + $del_param = 'index.php?module='.$module.'&action='.$deleteaction.'&return_module='.$parentmodule.'&return_action='.$_REQUEST['action'].'&record='.$row["crmid"].'&return_id='.$_REQUEST["record"]; + + if($module == 'Notes') + { + $edit_param = 'index.php?module='.$module.'&action='.$editaction.'&return_module='.$parentmodule.'&return_action='.$_REQUEST['action'].'&record='.$row["crmid"].'&filename='.$row['filename'].'&fileid='.$row['attachmentsid'].'&return_id='.$_REQUEST["record"]; + + $entries[] .= ''.$app_strings['LNK_EDIT'].' | '.$app_strings['LNK_DELETE'].''; + } + else + { + $entries[] = ''.$app_strings['LNK_DELETE'].''; + } + $entries_list[] = $entries; + } + + if($entries_list !='') + $return_data = array('header'=>$header,'entries'=>$entries_list); + $log->debug("Exiting getAttachmentsAndNotes method ..."); + return $return_data; + +} + +/** Function to get related list entries in detailed array format + * @param $parentmodule -- parentmodulename:: Type string + * @param $query -- query:: Type string + * @param $id -- id:: Type string + * @returns $return_data -- return data:: Type string array + * + */ + +function getHistory($parentmodule,$query,$id) +{ + global $log; + $log->debug("Entering getHistory(".$parentmodule.",".$query.",".$id.") method ..."); + $parentaction = $_REQUEST['action']; + global $theme; + $theme_path="themes/".$theme."/"; + $image_path=$theme_path."images/"; + require_once ($theme_path."layout_utils.php"); + + global $adb; + global $mod_strings; + global $app_strings; + + //Appending the security parameter + global $current_user; + $rel_tab_id = getTabid("Calendar"); + + global $current_user; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $tab_id=getTabid('Calendar'); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter('Calendar'); + $query .= ' '.$sec_parameter; + + } + $result=$adb->query($query); + $noofrows = $adb->num_rows($result); + + if($noofrows == 0) + { + //There is no entries for history + } + else + { + //Form the header columns + $header[] = $app_strings['LBL_TYPE']; + $header[] = $app_strings['LBL_SUBJECT']; + $header[] = $app_strings['LBL_RELATED_TO']; + $header[] = $app_strings['LBL_START_DATE']; + $header[] = $app_strings['LBL_END_DATE']; + //$header[] = $app_strings['LBL_DESCRIPTION']; + $header[] = $app_strings['LBL_ACTION']; + $header[] = $app_strings['LBL_ASSIGNED_TO']; + + $i=1; + while($row = $adb->fetch_array($result)) + { + $entries = Array(); + if($row['activitytype'] == 'Task') + { + $activitymode = 'Task'; + $icon = 'Tasks.gif'; + $status = $row['status']; + } + elseif($row['activitytype'] == 'Call' || $row['activitytype'] == 'Meeting') + { + $activitymode = 'Events'; + $icon = 'Activities.gif'; + $status = $row['eventstatus']; + } + + $entries[] = $row['activitytype']; + + $activity = ''.$row['subject'].''; + $entries[] = $activity; + + $parentname = getRelatedTo('Calendar',$result,$i-1); + $entries[] = $parentname; + + $entries[] = $row['date_start']; + $entries[] = $row['due_date']; + + //$entries[] = nl2br($row['description']); + + if(isPermitted("Calendar",1,$row["activityid"]) == 'yes') + { + $list .= ''.$app_strings['LNK_EDIT'].''; + + } + + $entries[] = $status; + + if($row['user_name']==NULL && $row['groupname']!=NULL) + { + $entries[] = $row['groupname']; + } + else + { + $entries[] = $row['user_name']; + + } + + if(isPermitted("Calendar",2,$row["activityid"]) == 'yes') + { + $list .= ''.$app_strings['LNK_DELETE'].''; + } + + $i++; + $entries_list[] = $entries; + } + + $return_data = array('header'=>$header,'entries'=>$entries_list); + $log->debug("Exiting getHistory method ..."); + return $return_data; + } +} + +/** Function to display the Products which are related to the PriceBook + * @param string $query - query to get the list of products which are related to the current PriceBook + * @param object $focus - PriceBook object which contains all the information of the current PriceBook + * @param string $returnset - return_module, return_action and return_id which are sequenced with & to pass to the URL which is optional + * return array $return_data which will be formed like array('header'=>$header,'entries'=>$entries_list) where as $header contains all the header columns and $entries_list will contain all the Product entries + */ +function getPriceBookRelatedProducts($query,$focus,$returnset='') +{ + global $log; + $log->debug("Entering getPriceBookRelatedProducts(".$query.",".$focus.",".$returnset.") method ..."); + + global $adb; + global $app_strings; + global $mod_strings; + global $current_language; + $current_module_strings = return_module_language($current_language, 'PriceBook'); + + global $list_max_entries_per_page; + global $urlPrefix; + + global $theme; + $pricebook_id = $_REQUEST['record']; + $theme_path="themes/".$theme."/"; + $image_path=$theme_path."images/"; + require_once($theme_path.'layout_utils.php'); + + //Retreive the list from Database + $list_result = $adb->query($query); + $num_rows = $adb->num_rows($list_result); + + $header=array(); + $header[]=$mod_strings['LBL_LIST_PRODUCT_NAME']; + $header[]=$mod_strings['LBL_PRODUCT_CODE']; + $header[]=$mod_strings['LBL_PRODUCT_UNIT_PRICE']; + $header[]=$mod_strings['LBL_PB_LIST_PRICE']; + $header[]=$mod_strings['LBL_ACTION']; + + for($i=0; $i<$num_rows; $i++) + { + $entity_id = $adb->query_result($list_result,$i,"crmid"); + + $unit_price = $adb->query_result($list_result,$i,"unit_price"); + $listprice = $adb->query_result($list_result,$i,"listprice"); + $field_name=$entity_id."_listprice"; + + $entries = Array(); + $entries[] = $adb->query_result($list_result,$i,"productname"); + $entries[] = $adb->query_result($list_result,$i,"productcode"); + $entries[] = $unit_price; + $entries[] = $listprice; + $entries[] = ''.$app_strings[ | '.$app_strings['; + + $entries_list[] = $entries; + } + if($num_rows>0) + { + $return_data = array('header'=>$header,'entries'=>$entries_list); + + $log->debug("Exiting getPriceBookRelatedProducts method ..."); + return $return_data; + } +} + +?> Modified: vtigercrm/branches/5.1_jens/include/database/PearDatabase.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/database/PearDatabase.php (original) +++ vtigercrm/branches/5.1_jens/include/database/PearDatabase.php Tue Nov 14 03:16:10 2006 @@ -930,9 +930,20 @@ function getUniqueID($seqname) { - $this->checkConnection(); + global $log; + $this->checkConnection(); + if( $this->dbType == "pgsql") { + $keytab = $this->database->MetaPrimaryKeys($seqname); + if( count( $keytab) > 0) { + $log->info("PearDatabase: Postgres getUniqueID hack: ".$seqname."_".$keytab[0]."_seq"); + return $this->database->GenID($seqname."_".$keytab[0]."_seq",1); + } else { + $log->info("PearDatabase: Problem: getUniqueID but no key for '$seqname'"); + } + } return $this->database->GenID($seqname."_seq",1); } + function get_tables() { $this->checkConnection(); Modified: vtigercrm/branches/5.1_jens/include/database/Postgres8.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/database/Postgres8.php (original) +++ vtigercrm/branches/5.1_jens/include/database/Postgres8.php Tue Nov 14 03:16:10 2006 @@ -1,176 +1,144 @@ -info( "fixPostgresQuery: ".$query); - - // If we already have an order or group cluase separate ist for later use - if( strpos($queryRecord,'GROUP') > 0) - { - $groupClause = substr($queryRecord, strpos($queryRecord,'GROUP')+strlen('GROUP BY'), strlen($queryRecord)); - if( strpos($groupClause,'ORDER') > 0) - { - $orderClause = substr($groupClause, strpos($groupClause,'ORDER'), strlen($groupClause)); - $groupClause = substr($groupClause, 0, strpos($groupClause,'ORDER')); - } - $queryRecord = substr($queryRecord, 0, strpos($queryRecord,'GROUP')); - } - - if( strpos($queryRecord,'ORDER') > 0) - { - $orderClause = substr($queryRecord, strpos($queryRecord,'ORDER'), strlen($queryRecord)); - $queryRecord = substr($queryRecord, 0, strpos($queryRecord,'ORDER')); - } - - // Construkt the privateGroupList from the filed list by separating combined - // record.field entries - $privateGroupList = array(); - $token = strtok( $queryFields, ", () "); - while( $token !== false) { - if( strpos( $token, ".") !== false) { - array_push( $privateGroupList, $token); - } - $token = strtok( ", () "); - } - sort( $privateGroupList); - $groupFields = ""; - $last = ""; - for( $i = 0; $i < count($privateGroupList); $i++) { - if( $last != $privateGroupList[$i]) { - if( $groupFields == "") - $groupFields = $privateGroupList[$i]; - else - $groupFields .= ",".$privateGroupList[$i]; - } - $last = $privateGroupList[$i]; - } - - // Rebuild the query - $query = "SELECT ".$queryFields.$queryRecord." GROUP BY "; - if( $groupClause != "" ) - $groupClause = $groupClause.",".$groupFields; - else - $groupClause = $groupFields; - $query .= expandStar($groupClause,$log)." ".$orderClause; - - if( $debug) - $log->info( "fixPostgresQuery result: ".$query); - - return( $query); -} - -// Postgres8 will not accept a "tablename.*" entry in the GROUP BY clause -function expandStar($fieldlist,$log) -{ - $expanded=""; - $field = strtok( $fieldlist, ","); - while( $field != "") - { - //remove leading and trailing spaces - $field = trim( $field); - - //still spaces in the field indicate a complex structure - if( strpos( $field, " ") == 0) - { - - //locate table- and fieldname - $pos = strpos( $field, "."); - if( $pos > 0) - { - $table = substr( $field, 0, $pos); - $subfield = substr( $field, $pos+1, strlen($field)-$pos); - - //do we need to expand? - if( $subfield == "*") - $field = expandRecord($table,$log); - } - - //add the propably expanded field to the querylist - if( $expanded == "") - $expanded = $field; - else - $expanded .= ",".$field; - } - - //next field - $field = strtok(","); - } - - //return the expanded fieldlist - return( $expanded); -} - -//return an expanded table field list -function expandRecord($table,$log) -{ - $result = ""; - $log->info( "Debug: expandRecord"); - $subfields = array(); - - //vtiger_products table - if( $table == "vtiger_products" ) - $subfields = array ( "productid", "productname", "productcode", "productcategory", "manufacturer", "product_description", "qty_per_unit", "unit_price", "weight", "pack_size", "sales_start_date", "sales_end_date", "start_date", "expiry_date", "cost_factor", "commissionrate", "commissionmethod", "discontinued", "usageunit", "handler", "contactid", "currency", "reorderlevel", "website", "taxclass", "mfr_part_no", "vendor_part_no", "serialno", "qtyinstock", "productsheet", "qtyindemand", "glacct", "vendor_id", "imagename" ); - - //vtiger_activity table - elseif( $table == "vtiger_activity") - $subfields = array ( "activityid", "subject", "semodule", "activitytype", "date_start", "due_date", "time_start", "time_end", "sendnotification", "duration_hours", "duration_minutes", "status", "eventstatus", "priority", "location", "notime", "visibility" ); - - //vtiger_notes table - elseif( $table == "vtiger_notes") - $subfields = array ( "notesid", "contact_id", "title", "filename", "notecontent"); - - //vtiger_faq table - elseif( $table == "vtiger_faq") - $subfields = array ( "id", "product_id", "question", "answer", "category", "status"); - - //vtiger_profile2field - elseif( $table == "vtiger_profile2field") - $subfields = array ( "profileid", "tabid", "fieldid", "visible", "readonly"); - - //vtiger_field - elseif( $table == "vtiger_field") - $subfields = array ( "tabid", "fieldid", "columnname", "tablename", "generatedtype", "uitype", "fieldname", "fieldlabel", "readonly", "presence", "selected", "maximumlength", "sequence", "block", "displaytype", "typeofdata", "quickcreate", "quickcreatesequence", "info_type"); - - //vtiger_activity - elseif( $table == "vtiger_activity") - $subfields = array ( "activityid", "subject", "semodule", "activitytype", "date_start", "due_date", "time_start", "sendnotification", "duration_hours", "duration_minutes", "status", "eventstatus", "priority", "location", "notime", "visibility"); - - //fields of the requested array still undefined - else - $log->info("function expandRecord: please add structural information for table '".$table."'"); - - //construct an entity string - for( $i=0; $i 0) - $result = substr( $result, 0, strlen( $result) -1); - - //return out new string - return( $result); -} -?> +info( "fixPostgresQuery: ".$query); + + // If we already have an order or group cluase separate ist for later use + if( strpos($queryRecord,'GROUP') > 0) + { + $groupClause = substr($queryRecord, strpos($queryRecord,'GROUP')+strlen('GROUP BY'), strlen($queryRecord)); + if( strpos($groupClause,'ORDER') > 0) + { + $orderClause = substr($groupClause, strpos($groupClause,'ORDER'), strlen($groupClause)); + $groupClause = substr($groupClause, 0, strpos($groupClause,'ORDER')); + } + $queryRecord = substr($queryRecord, 0, strpos($queryRecord,'GROUP')); + } + + if( strpos($queryRecord,'ORDER') > 0) + { + $orderClause = substr($queryRecord, strpos($queryRecord,'ORDER'), strlen($queryRecord)); + $queryRecord = substr($queryRecord, 0, strpos($queryRecord,'ORDER')); + } + + // Construkt the privateGroupList from the filed list by separating combined + // record.field entries + $privateGroupList = array(); + $token = strtok( $queryFields, ", () "); + while( $token !== false) { + if( strpos( $token, ".") !== false) { + array_push( $privateGroupList, $token); + } + $token = strtok( ", () "); + } + sort( $privateGroupList); + $groupFields = ""; + $last = ""; + for( $i = 0; $i < count($privateGroupList); $i++) { + if( $last != $privateGroupList[$i]) { + if( $groupFields == "") + $groupFields = $privateGroupList[$i]; + else + $groupFields .= ",".$privateGroupList[$i]; + } + $last = $privateGroupList[$i]; + } + + // Rebuild the query + $query = "SELECT ".$queryFields.$queryRecord." GROUP BY "; + if( $groupClause != "" ) + $groupClause = $groupClause.",".$groupFields; + else + $groupClause = $groupFields; + $query .= expandStar($groupClause,$log)." ".$orderClause; + + if( $debug) + $log->info( "fixPostgresQuery result: ".$query); + + return( $query); +} + +// Postgres8 will not accept a "tablename.*" entry in the GROUP BY clause +function expandStar($fieldlist,$log) +{ + $expanded=""; + $field = strtok( $fieldlist, ","); + while( $field != "") + { + //remove leading and trailing spaces + $field = trim( $field); + + //still spaces in the field indicate a complex structure + if( strpos( $field, " ") == 0) + { + + //locate table- and fieldname + $pos = strpos( $field, "."); + if( $pos > 0) + { + $table = substr( $field, 0, $pos); + $subfield = substr( $field, $pos+1, strlen($field)-$pos); + + //do we need to expand? + if( $subfield == "*") + $field = expandRecord($table,$log); + } + + //add the propably expanded field to the querylist + if( $expanded == "") + $expanded = $field; + else + $expanded .= ",".$field; + } + + //next field + $field = strtok(","); + } + + //return the expanded fieldlist + return( $expanded); +} + +//return an expanded table field list +function expandRecord($table,$log) +{ + global $adb; + $result = ""; + $subfields = $adb->getColumnNames($table); + + //construct an entity string + for( $i=0; $i 0) + $result = substr( $result, 0, strlen( $result) -1); + + //return out new string + return( $result); +} +?> Modified: vtigercrm/branches/5.1_jens/include/js/Inventory.js ============================================================================== --- vtigercrm/branches/5.1_jens/include/js/Inventory.js (original) +++ vtigercrm/branches/5.1_jens/include/js/Inventory.js Tue Nov 14 03:16:10 2006 @@ -414,13 +414,29 @@ taxcount = eval(document.getElementById(countname).value)+1; if(countname == 'tax_count') + { taxprefix = 'tax'; + taxLabelPrefix = 'taxlabel_tax'; + } else + { taxprefix = 'shtax'; + taxLabelPrefix = 'taxlabel_shtax'; + } for(var i=1;i<=taxcount;i++) { taxval = document.getElementById(taxprefix+i).value; + taxLabelVal = document.getElementById(taxLabelPrefix+i).value; + document.getElementById(taxLabelPrefix+i).value = taxLabelVal.replace(/^\s*|\s*$/g,'').replace(/\s+/g,''); + + if(document.getElementById(taxLabelPrefix+i).value.length == 0) + { + alert("The tax label name should not be empty"); + return false + } + + //Tax value - numeric validation var temp = /^(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/.test(taxval); if(!temp) { @@ -430,6 +446,7 @@ } return true; } + //Function used to add a new product row in PO, SO, Quotes and Invoice @@ -501,12 +518,18 @@ function decideTaxDiv() { var taxtype = document.getElementById("taxtype").value + + calcTotal(); + if(taxtype == 'group') + { + //if group tax selected then we have to hide the individual taxes and also calculate the group tax hideIndividualTaxes() + calcGroupTax(); + } else if(taxtype == 'individual') hideGroupTax() - calcTotal(); } function hideIndividualTaxes() Modified: vtigercrm/branches/5.1_jens/include/js/ListView.js ============================================================================== --- vtigercrm/branches/5.1_jens/include/js/ListView.js (original) +++ vtigercrm/branches/5.1_jens/include/js/ListView.js Tue Nov 14 03:16:10 2006 @@ -1,147 +1,151 @@ -/********************************************************************************* - -** 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 change(obj,divid) -{ - var select_options = document.getElementsByName('selected_id'); - var x = select_options.length; - var viewid =getviewId(); - idstring = ""; - - xx = 0; - for(i = 0; i < x ; i++) - { - if(select_options[i].checked) - { - idstring = select_options[i].value +";"+idstring - xx++ - } - } - if (xx != 0) - { - document.getElementById('idlist').value=idstring; - } - else - { - alert("Please select at least one entity"); - return false; - } - fnvshobj(obj,divid); -} -function getviewId() -{ - if(typeof(document.getElementById("viewname")) != 'undefined') - { - var oViewname = document.getElementById("viewname"); - var viewid = oViewname.options[oViewname.selectedIndex].value; - } - else - { - var viewid =''; - } - return viewid; -} -function massDelete(module) -{ - var select_options = document.getElementsByName('selected_id'); - var x = select_options.length; - var viewid =getviewId(); - idstring = ""; - - xx = 0; - for(i = 0; i < x ; i++) - { - if(select_options[i].checked) - { - idstring = select_options[i].value +";"+idstring - xx++ - } - } - if (xx != 0) - { - document.getElementById('idlist').value=idstring; - } - else - { - alert("Please select at least one entity"); - return false; - } - if(confirm("Are you sure you want to delete the selected "+xx+" records ?")) - { - - $("status").style.display="inline"; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody:"module=Users&action=massdelete&return_module="+module+"&viewname="+viewid+"&idlist="+idstring, - onComplete: function(response) { - $("status").style.display="none"; - result = response.responseText.split('&#&#&#'); - $("ListViewContents").innerHTML= result[2]; - if(result[1] != '') - alert(result[1]); - } - } - ); - } - else - { - return false; - } - -} - -function showDefaultCustomView(selectView,module) -{ - $("status").style.display="inline"; - var viewName = selectView.options[selectView.options.selectedIndex].value; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&start=1&viewname="+viewName, - onComplete: function(response) { - $("status").style.display="none"; - result = response.responseText.split('&#&#&#'); - $("ListViewContents").innerHTML= result[2]; - if(result[1] != '') - alert(result[1]); - $('basicsearchcolumns_real').innerHTML = $('basicsearchcolumns').innerHTML - $('basicsearchcolumns').innerHTML = ''; - document.basicSearch.search_text.value = ''; - } - } - ); -} - - -function getListViewEntries_js(module,url) -{ - $("status").style.display="inline"; - if($('search_url').value!='') - urlstring = $('search_url').value; - else - urlstring = ''; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&"+url+urlstring, - onComplete: function(response) { - $("status").style.display="none"; - result = response.responseText.split('&#&#&#'); - $("ListViewContents").innerHTML= result[2]; - if(result[1] != '') - alert(result[1]); - } - } - ); -} - +/********************************************************************************* + +** 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 change(obj,divid) +{ + var select_options = document.getElementsByName('selected_id'); + var x = select_options.length; + var viewid =getviewId(); + idstring = ""; + + xx = 0; + for(i = 0; i < x ; i++) + { + if(select_options[i].checked) + { + idstring = select_options[i].value +";"+idstring + xx++ + } + } + if (xx != 0) + { + document.getElementById('idlist').value=idstring; + } + else + { + alert("Please select at least one entity"); + return false; + } + fnvshobj(obj,divid); +} +function getviewId() +{ + if(typeof(document.getElementById("viewname")) != 'undefined') + { + var oViewname = document.getElementById("viewname"); + if( oViewname.selectedIndex >= 0) { + var viewid = oViewname.options[oViewname.selectedIndex].value; + } else { + var viewid =''; + } + } + else + { + var viewid =''; + } + return viewid; +} +function massDelete(module) +{ + var select_options = document.getElementsByName('selected_id'); + var x = select_options.length; + var viewid =getviewId(); + idstring = ""; + + xx = 0; + for(i = 0; i < x ; i++) + { + if(select_options[i].checked) + { + idstring = select_options[i].value +";"+idstring + xx++ + } + } + if (xx != 0) + { + document.getElementById('idlist').value=idstring; + } + else + { + alert("Please select at least one entity"); + return false; + } + if(confirm("Are you sure you want to delete the selected "+xx+" records ?")) + { + + $("status").style.display="inline"; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody:"module=Users&action=massdelete&return_module="+module+"&viewname="+viewid+"&idlist="+idstring, + onComplete: function(response) { + $("status").style.display="none"; + result = response.responseText.split('&#&#&#'); + $("ListViewContents").innerHTML= result[2]; + if(result[1] != '') + alert(result[1]); + } + } + ); + } + else + { + return false; + } + +} + +function showDefaultCustomView(selectView,module) +{ + $("status").style.display="inline"; + var viewName = selectView.options[selectView.options.selectedIndex].value; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&start=1&viewname="+viewName, + onComplete: function(response) { + $("status").style.display="none"; + result = response.responseText.split('&#&#&#'); + $("ListViewContents").innerHTML= result[2]; + if(result[1] != '') + alert(result[1]); + $('basicsearchcolumns_real').innerHTML = $('basicsearchcolumns').innerHTML + $('basicsearchcolumns').innerHTML = ''; + document.basicSearch.search_text.value = ''; + } + } + ); +} + + +function getListViewEntries_js(module,url) +{ + $("status").style.display="inline"; + if($('search_url').value!='') + urlstring = $('search_url').value; + else + urlstring = ''; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody:"module="+module+"&action="+module+"Ajax&file=ListView&ajax=true&"+url+urlstring, + onComplete: function(response) { + $("status").style.display="none"; + result = response.responseText.split('&#&#&#'); + $("ListViewContents").innerHTML= result[2]; + if(result[1] != '') + alert(result[1]); + } + } + ); +} + Modified: vtigercrm/branches/5.1_jens/include/js/customview.js ============================================================================== --- vtigercrm/branches/5.1_jens/include/js/customview.js (original) +++ vtigercrm/branches/5.1_jens/include/js/customview.js Tue Nov 14 03:16:10 2006 @@ -1,392 +1,392 @@ -/********************************************************************************* - ** The contents of this file are subject to the vtiger CRM Public License Version 1.0 - * ("License"); You may not use this file except in compliance with the License - * The Original Code is: vtiger CRM Open Source - * The Initial Developer of the Original Code is vtiger. - * Portions created by vtiger are Copyright (C) vtiger. - * All Rights Reserved. - * - ********************************************************************************/ - -function splitValues() { - var picklistObj=getObj("fldPickList") - var pickListContent=picklistObj.value - var pickListAry=new Array() - var i=0; - - //Splitting up of Values - if (pickListContent.indexOf("\n")!=-1) { - while(pickListContent.length>0) { - if(pickListContent.indexOf("\n")!=-1) { - if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) { - pickListAry[i]=pickListContent.substr(0,pickListContent.indexOf("\n")).replace(/^\s+/g, '').replace(/\s+$/g, '') - pickListContent=pickListContent.substr(pickListContent.indexOf("\n")+1,pickListContent.length) - i++ - } else break; - } else { - pickListAry[i]=pickListContent.substr(0,pickListContent.length) - break; - } - } - } else if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) { - pickListAry[0]=pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '') - } - - return pickListAry; -} - - -function validate() { - var nummaxlength = 255; - var fieldtype = document.getElementById('selectedfieldtype').value; - var mode = document.getElementById('cfedit_mode').value; - if(fieldtype == "" && mode != 'edit') - { - alert("Field Type is not selected"); - return false; - } - lengthLayer=getObj("lengthdetails") - decimalLayer=getObj("decimaldetails") - pickListLayer=getObj("picklist") - var str = getObj("fldLabel").value; - if (!emptyCheck("fldLabel","Label")) - return false - - var re1=/^[a-z\d\_ ]+$/i - if (!re1.test(str)) - { - alert("Special characters are not allowed in Label field") - return false; - } - - if (lengthLayer.style.visibility=="visible") { - if (!emptyCheck("fldLength","Length")) - return false - - if (!intValidate("fldLength","Length")) - return false - - if (!numConstComp("fldLength","Length","GT",0)) - return false - - } - - if (decimalLayer.style.visibility=="visible") { - if (getObj("fldDecimal").value.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) - if (!intValidate("fldDecimal","Decimal")) - return false - if (!numConstComp("fldDecimal","Decimal","GE",0)) - return false - - if (!numConstComp("fldDecimal","Decimal","LE",30)) - return false - } - var decimallength = document.addtodb.fldDecimal.value; - if(fieldtype == 'Percent' || fieldtype == 'Currency' || fieldtype == 'Number') - { - if(decimallength == '') - decimallength = 0; - nummaxlength = 65 - (eval(decimallength) + 1); - } - if (!numConstComp("fldLength","Length","LE",nummaxlength)) - return false -var picklistObj=getObj("fldPickList") - if (pickListLayer.style.visibility=="visible") { - if (emptyCheck("fldPickList","Picklist values")) { - var pickListAry=new Array() - pickListAry=splitValues() - - //Empty Check validation - for (i=0;i220) { - fieldLayer.document.body.scrollTop+=height-220 - } else { - fieldLayer.document.body.scrollTop-=220-height - } - - if (window.navigator.appName.toUpperCase()=="OPERA") { - var newDiv=fieldLayer.document.createElement("DIV") - newDiv.style.zIndex="-1" - newDiv.style.position="absolute" - newDiv.style.top=findPosY(selFieldType)+"px" - newDiv.style.left="25px" - - var newObj=fieldLayer.document.createElement("INPUT") - newObj.type="text" - - fieldLayer.document.body.appendChild(newDiv) - newDiv.appendChild(newObj) - newObj.focus() - - fieldLayer.document.body.removeChild(newDiv) - } - } -} - -function selFieldType(id,scrollLayer,bool) { - currFieldIdx=id - var type=fieldTypeArr[id] - var lengthLayer=getObj("lengthdetails"); - var decimalLayer=getObj("decimaldetails"); - var pickListLayer=getObj("picklist"); - if (type=='text') { - lengthLayer.style.visibility="visible" - decimalLayer.style.visibility="hidden" - pickListLayer.style.visibility="hidden" - } else if (type=='date' || type=='email' || type=='phone' || type=='url' || type=='checkbox' || type=='textarea') { - getObj("lengthdetails").style.visibility="hidden" - decimalLayer.style.visibility="hidden" - pickListLayer.style.visibility="hidden" - } else if (type=='number' || type=='percent' || type=='currency') { - lengthLayer.style.visibility="visible" - decimalLayer.style.visibility="visible" - pickListLayer.style.visibility="hidden" - } else if (type=='picklist' || type=='multiselectcombo') { - lengthLayer.style.visibility="hidden" - decimalLayer.style.visibility="hidden" - pickListLayer.style.visibility="visible" - } - - - parent.getObj("fieldType").value = fieldValueArr[id]; -} - -function srchFieldType(ev) { - if (browser_ie) { - var keyCode=window.fieldLayer.event.keyCode - var currElement=window.fieldLayer.event.srcElement - if (currElement.id.indexOf("field")>=0) var doSearch=true - else var doSearch=false - window.fieldLayer.event.cancelBubble=true - } else if (browser_nn4 || browser_nn6) { - var keyCode=ev.which - var currElement=ev.target - if (currElement.type) doSearch=false - else doSearch=true - } - - if (doSearch==true) { - switch (keyCode) { - case 9 : //Reset Field Type - resetFieldTypeHilite();break; - case 33 : //Page Up - case 36 : //Home - selFieldType(0);break; - case 34 : //Page Down - case 35 : //End - selFieldType(totFieldType);break; - case 38 : //Up - if (currFieldIdx!=0) - selFieldType(currFieldIdx-1); - else - selFieldType(totFieldType,"yes"); - break; - case 40 : //Down - if (currFieldIdx!=totFieldType) - selFieldType(currFieldIdx+1); - else - selFieldType(0,"yes"); -default : //Character Search - if (keyCode>=65 && keyCode<=90) { - var srchChar=String.fromCharCode(keyCode) - if (currFieldIdx==totFieldType) var startIdx=0 - else var startIdx=currFieldIdx+1 - - var loop=1 - for (i=startIdx;i<=totFieldType;) { - currFieldStr=fieldLayer.getObj("field"+i).innerHTML - currFieldStr=currFieldStr.replace(/^\s+/g, '').replace(/\s+$/g, '').substr(0,1) - if (currFieldStr==srchChar) { - selFieldType(i,"yes") - i++ - } else if (i==totFieldType && loop<=2) { - i=0 - loop++ - } else i++ - } - } - } - } -} -function resetFieldTypeHilite() { - fieldLayer.getObj("field"+currFieldIdx).className="fieldType sel" -} -function validateCustomFieldAccounts() - { - var obj=document.getElementsByTagName("SELECT"); - var i,j=0,k=0,l=0; - var n=obj.length; - account = new Array; - contact = new Array; - potential = new Array; - for( i = 0; i < n; i++) - { - if(obj[i].name.indexOf("_account")>0) - { - account[j]=obj[i].value; - j++; - } - if(obj[i].name.indexOf("_contact")>0) - { - contact[k]=obj[i].value; - k++; - } - if(obj[i].name.indexOf("_potential")>0) - { - potential[l]=obj[i].value; - l++; - } - } - for( i = 0; i < account.length; i++) - { - for(j=i+1; j0) - { - var lead_dec = lead_tod[2].split(","); - var dec = tod[2].split(","); - - } - else - { - var lead_dec = lead_tod[2].split("~"); - var dec = tod[2].split("~"); - } - if(lead_dec[0] <= dec[0]) - { - if(lead_dec[1] <= dec[1]) - return true; - else - { - alert(alertmessage[4]); - document.getElementById(field_name).value = 'None'; - return false; - } - } - else - { - alert(alertmessage[3]); - document.getElementById(field_name).value = 'None'; - return false; - } - break; - } - } - } - else - { - alert(alertmessage[0]+" "+leadtype+" "+alertmessage[1]+" "+type+" "+alertmessage[2]); - document.getElementById(field_name).value = 'None'; - return false; - } - } -} +/********************************************************************************* + ** The contents of this file are subject to the vtiger CRM Public License Version 1.0 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. + * + ********************************************************************************/ + +function splitValues() { + var picklistObj=getObj("fldPickList") + var pickListContent=picklistObj.value + var pickListAry=new Array() + var i=0; + + //Splitting up of Values + if (pickListContent.indexOf("\n")!=-1) { + while(pickListContent.length>0) { + if(pickListContent.indexOf("\n")!=-1) { + if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) { + pickListAry[i]=pickListContent.substr(0,pickListContent.indexOf("\n")).replace(/^\s+/g, '').replace(/\s+$/g, '') + pickListContent=pickListContent.substr(pickListContent.indexOf("\n")+1,pickListContent.length) + i++ + } else break; + } else { + pickListAry[i]=pickListContent.substr(0,pickListContent.length) + break; + } + } + } else if (pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) { + pickListAry[0]=pickListContent.replace(/^\s+/g, '').replace(/\s+$/g, '') + } + + return pickListAry; +} + + +function validate() { + var nummaxlength = 255; + var fieldtype = document.getElementById('selectedfieldtype').value; + var mode = document.getElementById('cfedit_mode').value; + if(fieldtype == "" && mode != 'edit') + { + alert("Field Type is not selected"); + return false; + } + lengthLayer=getObj("lengthdetails") + decimalLayer=getObj("decimaldetails") + pickListLayer=getObj("picklist") + var str = getObj("fldLabel").value; + if (!emptyCheck("fldLabel","Label")) + return false + + var re1=/^[a-z\d\_ ]+$/i + if (!re1.test(str)) + { + alert("Special characters are not allowed in Label field") + return false; + } + + if (lengthLayer.style.visibility=="visible") { + if (!emptyCheck("fldLength","Length")) + return false + + if (!intValidate("fldLength","Length")) + return false + + if (!numConstComp("fldLength","Length","GT",0)) + return false + + } + + if (decimalLayer.style.visibility=="visible") { + if (getObj("fldDecimal").value.replace(/^\s+/g, '').replace(/\s+$/g, '').length>0) + if (!intValidate("fldDecimal","Decimal")) + return false + if (!numConstComp("fldDecimal","Decimal","GE",0)) + return false + + if (!numConstComp("fldDecimal","Decimal","LE",30)) + return false + } + var decimallength = document.addtodb.fldDecimal.value; + if(fieldtype == 'Percent' || fieldtype == 'Currency' || fieldtype == 'Number') + { + if(decimallength == '') + decimallength = 0; + nummaxlength = 65 - (eval(decimallength) + 1); + } + if (!numConstComp("fldLength","Length","LE",nummaxlength)) + return false +var picklistObj=getObj("fldPickList") + if (pickListLayer.style.visibility=="visible") { + if (emptyCheck("fldPickList","Picklist values")) { + var pickListAry=new Array() + pickListAry=splitValues() + + //Empty Check validation + for (i=0;i220) { + fieldLayer.document.body.scrollTop+=height-220 + } else { + fieldLayer.document.body.scrollTop-=220-height + } + + if (window.navigator.appName.toUpperCase()=="OPERA") { + var newDiv=fieldLayer.document.createElement("DIV") + newDiv.style.zIndex="-1" + newDiv.style.position="absolute" + newDiv.style.top=findPosY(selFieldType)+"px" + newDiv.style.left="25px" + + var newObj=fieldLayer.document.createElement("INPUT") + newObj.type="text" + + fieldLayer.document.body.appendChild(newDiv) + newDiv.appendChild(newObj) + newObj.focus() + + fieldLayer.document.body.removeChild(newDiv) + } + } +} + +function selFieldType(id,scrollLayer,bool) { + currFieldIdx=id + var type=fieldTypeArr[id] + var lengthLayer=getObj("lengthdetails"); + var decimalLayer=getObj("decimaldetails"); + var pickListLayer=getObj("picklist"); + if (type=='text') { + lengthLayer.style.visibility="visible" + decimalLayer.style.visibility="hidden" + pickListLayer.style.visibility="hidden" + } else if (type=='date' || type=='email' || type=='phone' || type=='url' || type=='checkbox' || type=='textarea' || type=='skype') { + getObj("lengthdetails").style.visibility="hidden" + decimalLayer.style.visibility="hidden" + pickListLayer.style.visibility="hidden" + } else if (type=='number' || type=='percent' || type=='currency') { + lengthLayer.style.visibility="visible" + decimalLayer.style.visibility="visible" + pickListLayer.style.visibility="hidden" + } else if (type=='picklist' || type=='multiselectcombo') { + lengthLayer.style.visibility="hidden" + decimalLayer.style.visibility="hidden" + pickListLayer.style.visibility="visible" + } + + + parent.getObj("fieldType").value = fieldValueArr[id]; +} + +function srchFieldType(ev) { + if (browser_ie) { + var keyCode=window.fieldLayer.event.keyCode + var currElement=window.fieldLayer.event.srcElement + if (currElement.id.indexOf("field")>=0) var doSearch=true + else var doSearch=false + window.fieldLayer.event.cancelBubble=true + } else if (browser_nn4 || browser_nn6) { + var keyCode=ev.which + var currElement=ev.target + if (currElement.type) doSearch=false + else doSearch=true + } + + if (doSearch==true) { + switch (keyCode) { + case 9 : //Reset Field Type + resetFieldTypeHilite();break; + case 33 : //Page Up + case 36 : //Home + selFieldType(0);break; + case 34 : //Page Down + case 35 : //End + selFieldType(totFieldType);break; + case 38 : //Up + if (currFieldIdx!=0) + selFieldType(currFieldIdx-1); + else + selFieldType(totFieldType,"yes"); + break; + case 40 : //Down + if (currFieldIdx!=totFieldType) + selFieldType(currFieldIdx+1); + else + selFieldType(0,"yes"); +default : //Character Search + if (keyCode>=65 && keyCode<=90) { + var srchChar=String.fromCharCode(keyCode) + if (currFieldIdx==totFieldType) var startIdx=0 + else var startIdx=currFieldIdx+1 + + var loop=1 + for (i=startIdx;i<=totFieldType;) { + currFieldStr=fieldLayer.getObj("field"+i).innerHTML + currFieldStr=currFieldStr.replace(/^\s+/g, '').replace(/\s+$/g, '').substr(0,1) + if (currFieldStr==srchChar) { + selFieldType(i,"yes") + i++ + } else if (i==totFieldType && loop<=2) { + i=0 + loop++ + } else i++ + } + } + } + } +} +function resetFieldTypeHilite() { + fieldLayer.getObj("field"+currFieldIdx).className="fieldType sel" +} +function validateCustomFieldAccounts() + { + var obj=document.getElementsByTagName("SELECT"); + var i,j=0,k=0,l=0; + var n=obj.length; + account = new Array; + contact = new Array; + potential = new Array; + for( i = 0; i < n; i++) + { + if(obj[i].name.indexOf("_account")>0) + { + account[j]=obj[i].value; + j++; + } + if(obj[i].name.indexOf("_contact")>0) + { + contact[k]=obj[i].value; + k++; + } + if(obj[i].name.indexOf("_potential")>0) + { + potential[l]=obj[i].value; + l++; + } + } + for( i = 0; i < account.length; i++) + { + for(j=i+1; j0) + { + var lead_dec = lead_tod[2].split(","); + var dec = tod[2].split(","); + + } + else + { + var lead_dec = lead_tod[2].split("~"); + var dec = tod[2].split("~"); + } + if(lead_dec[0] <= dec[0]) + { + if(lead_dec[1] <= dec[1]) + return true; + else + { + alert(alertmessage[4]); + document.getElementById(field_name).value = 'None'; + return false; + } + } + else + { + alert(alertmessage[3]); + document.getElementById(field_name).value = 'None'; + return false; + } + break; + } + } + } + else + { + alert(alertmessage[0]+" "+leadtype+" "+alertmessage[1]+" "+type+" "+alertmessage[2]); + document.getElementById(field_name).value = 'None'; + return false; + } + } +} Modified: vtigercrm/branches/5.1_jens/include/js/dtlviewajax.js ============================================================================== --- vtigercrm/branches/5.1_jens/include/js/dtlviewajax.js (original) +++ vtigercrm/branches/5.1_jens/include/js/dtlviewajax.js Tue Nov 14 03:16:10 2006 @@ -1,367 +1,420 @@ -/********************************************************************************* -** The contents of this file are subject to the vtiger CRM Public License Version 1.0 - * ("License"); You may not use this file except in compliance with the License - * The Original Code is: vtiger CRM Open Source - * The Initial Developer of the Original Code is vtiger. - * Portions created by vtiger are Copyright (C) vtiger. - * All Rights Reserved. -* - ********************************************************************************/ -var globaldtlviewspanid = ""; -var globaleditareaspanid = ""; -var globaltxtboxid = ""; -var itsonview=false; -// to retain the old value if we cancel the ajax edit -var globaltempvalue = ''; -var globaluitype = ''; -function showHide(showId, hideId) -{ - show(showId); - fnhide(hideId); -} - -function hndCancel(valuespanid,textareapanid,fieldlabel) -{ - - showHide(valuespanid,textareapanid); - if(globaluitype == '56') - { - if(globaltempvalue == 1) - getObj(globaltxtboxid).checked = true; - else - getObj(globaltxtboxid).checked = false; - } - else if(globaluitype != '53') - getObj(globaltxtboxid).value = globaltempvalue; - globaltempvalue = ''; - itsonview=false; - return false; -} - -function hndMouseOver(uitype,fieldLabel) -{ - var mouseArea=""; - mouseArea="mouseArea_"+ fieldLabel; - if(itsonview) - { - return; - } - - show("crmspanid"); - globaluitype = uitype; - globaldtlviewspanid= "dtlview_"+ fieldLabel;//valuespanid; - globaleditareaspanid="editarea_"+ fieldLabel;//textareapanid; - globalfieldlabel = fieldLabel; - if(globaluitype == 53) - { - if(typeof(document.DetailView.assigntype[0]) != 'undefined') - { - var assign_type_U = document.DetailView.assigntype[0].checked; - var assign_type_G = document.DetailView.assigntype[1].checked; - if(assign_type_U == true) - globaltxtboxid= 'txtbox_U'+fieldLabel; - else if(assign_type_G == true) - globaltxtboxid= 'txtbox_G'+fieldLabel; - }else - { - globaltxtboxid= 'txtbox_U'+fieldLabel; - } - }else - { - globaltxtboxid="txtbox_"+ fieldLabel;//textboxpanid; - } - divObj = getObj('crmspanid'); - crmy = findPosY(getObj(mouseArea)); - crmx = findPosX(getObj(mouseArea)); - if(document.all) - { - divObj.onclick=handleEdit; - } - else - { - divObj.setAttribute('onclick','handleEdit();'); - } - divObj.style.left=(crmx+getObj(mouseArea).offsetWidth -divObj.offsetWidth)+"px"; - divObj.style.top=crmy+"px"; -} - -function handleEdit() -{ - show(globaleditareaspanid) ; - fnhide(globaldtlviewspanid); - if(globaluitype != 53) - { - globaltempvalue = getObj(globaltxtboxid).value; - if(getObj(globaltxtboxid).type != 'hidden') - getObj(globaltxtboxid).focus(); - } - fnhide('crmspanid'); - itsonview=true; - return false; -} - -function trim(str) -{ - return(str.replace(/\s+$/,'')); -} - -var genUiType = ""; -var genFldValue = ""; - -function dtlViewAjaxSave(fieldLabel,module,uitype,tableName,fieldName,crmId) -{ - var dtlView = "dtlview_"+ fieldLabel; - var editArea = "editarea_"+ fieldLabel; - var groupurl = ""; - - if(globaluitype == 53) - { - if(typeof(document.DetailView.assigntype[0]) != 'undefined') - { - var assign_type_U = document.DetailView.assigntype[0].checked; - var assign_type_G = document.DetailView.assigntype[1].checked; - }else - { - var assign_type_U = document.DetailView.assigntype.checked; - } - if(assign_type_U == true) - { - var txtBox= 'txtbox_U'+fieldLabel; - } - else if(assign_type_G == true) - { - var txtBox= 'txtbox_G'+fieldLabel; - var group_name = $(txtBox).options[$(txtBox).selectedIndex].text; - var groupurl = "&assigned_group_name="+group_name+"&assigntype=T" - } - - }else if(globaluitype == 33) - { - var txtBox= "txtbox_"+ fieldLabel; - var oMulSelect = $(txtBox); - var r = new Array(); - for (iter=0;iter < oMulSelect.options.length ; iter++) - { - if (oMulSelect.options[iter].selected) - r[r.length] = oMulSelect.options[iter].value; - } - }else - { - var txtBox= "txtbox_"+ fieldLabel; - } - - var popupTxt= "popuptxt_"+ fieldLabel; - var hdTxt = "hdtxt_"+ fieldLabel; - - if(formValidate() == false) - { - return false; - } - - - $("vtbusy_info").style.display="inline"; - var isAdmin = document.getElementById("hdtxt_IsAdmin").value; - - - //overriden the tagValue based on UI Type for checkbox - if(uitype == '56') - { - if(document.getElementById(txtBox).checked == true) - { - tagValue = "1"; - }else - { - tagValue = "0"; - } - }else if(uitype == '156') - { - if(document.getElementById(txtBox).checked == true) - { - tagValue = "on"; - }else - { - tagValue = "off"; - } - }else if(uitype == '33') - { - tagValue = r.join(" |##| "); - }else - { - tagValue = trim(document.getElementById(txtBox).value); - } - - - var data = "file=DetailViewAjax&module=" + module + "&action=" + module + "Ajax&record=" + crmId+"&recordid=" + crmId ; - data = data + "&fldName=" + fieldName + "&fieldValue=" + escape(tagValue) + "&ajxaction=DETAILVIEW"+groupurl; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody: data, - onComplete: function(response) { - if(response.responseText.indexOf(":#:FAILURE")>-1) - { - alert("Error while Editing"); - } - else if(response.responseText.indexOf(":#:SUCCESS")>-1) - { - $("vtbusy_info").style.display="none"; - } - } - } - ); - if(uitype == '13' || uitype == '104') - { - getObj(dtlView).innerHTML = ""+tagValue+" "; - }else if(uitype == '17') - { - getObj(dtlView).innerHTML = ""+tagValue+" "; - }else if(uitype == '53') - { - var hdObj = getObj(hdTxt); - if(typeof(document.DetailView.assigntype[0]) != 'undefined') - { - var assign_type_U = document.DetailView.assigntype[0].checked; - var assign_type_G = document.DetailView.assigntype[1].checked; - }else - { - var assign_type_U = document.DetailView.assigntype.checked; - } - if(isAdmin == "0") - { - getObj(dtlView).innerHTML = hdObj.value; - }else if(isAdmin == "1" && assign_type_U == true) - { - getObj(dtlView).innerHTML = ""+hdObj.value+" "; - }else if(isAdmin == "1" && assign_type_G == true) - { - getObj(dtlView).innerHTML = ""+hdObj.value+" "; - } - }else if(uitype == '56') - { - if(tagValue == '1') - { - getObj(dtlView).innerHTML = "yes"; - }else - { - getObj(dtlView).innerHTML = ""; - } - - }else if(uitype == 116) - { - getObj(dtlView).innerHTML = document.getElementById(txtBox).options[document.getElementById(txtBox).selectedIndex].text; - } - else if(getObj(popupTxt)) - { - var popObj = getObj(popupTxt); - if(uitype == '50' || uitype == '73' || uitype == '51') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '57') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '59') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '75' || uitype == '81' ) - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - - } - else if(uitype == '76') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '78') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '80') - { - getObj(dtlView).innerHTML = ""+popObj.value+" "; - } - else if(uitype == '53') - { - var hdObj = getObj(hdTxt); - if(isAdmin == "0") - { - getObj(dtlView).innerHTML = hdObj.value; - }else if(isAdmin == "1") - { - getObj(dtlView).innerHTML = ""+hdObj.value+" ";; - } - } - else if(uitype == '56') - { - if(tagValue == '1') - { - getObj(dtlView).innerHTML = "yes"; - }else - { - getObj(dtlView).innerHTML = ""; - } - - } - else - { - getObj(dtlView).innerHTML = popObj.value; - } - }else if(uitype == '33') - { - getObj(dtlView).innerHTML = r.join(", "); - }else - { - getObj(dtlView).innerHTML = tagValue; - } - showHide(dtlView,editArea); //show,hide - itsonview=false; -} - -function SaveTag(txtBox,crmId,module) -{ - var tagValue = document.getElementById(txtBox).value; - document.getElementById(txtBox).value =''; - $("vtbusy_info").style.display="inline"; - new Ajax.Request( - 'index.php', - {queue: {position: 'end', scope: 'command'}, - method: 'post', - postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +tagValue, - onComplete: function(response) { - getObj('tagfields').innerHTML = response.responseText; - $("vtbusy_info").style.display="none"; - } - } - ); - -} -function setSelectValue(fieldLabel) -{ - if(globaluitype == 53) - { - if(typeof(document.DetailView.assigntype[0]) != 'undefined') - { - var assign_type_U = document.DetailView.assigntype[0].checked; - var assign_type_G = document.DetailView.assigntype[1].checked; - if(assign_type_U == true) - var selCombo= 'txtbox_U'+fieldLabel; - else if(assign_type_G == true) - var selCombo= 'txtbox_G'+fieldLabel; - }else - { - var selCombo= 'txtbox_U'+fieldLabel; - } - }else - { - var selCombo= 'txtbox_'+fieldLabel; - } - var hdTxtBox = 'hdtxt_'+fieldLabel; - var oHdTxtBox = document.getElementById(hdTxtBox); - var oSelCombo = document.getElementById(selCombo); - - oHdTxtBox.value = oSelCombo.options[oSelCombo.selectedIndex].text; -} - +/********************************************************************************* +** The contents of this file are subject to the vtiger CRM Public License Version 1.0 + * ("License"); You may not use this file except in compliance with the License + * The Original Code is: vtiger CRM Open Source + * The Initial Developer of the Original Code is vtiger. + * Portions created by vtiger are Copyright (C) vtiger. + * All Rights Reserved. +* + ********************************************************************************/ +var globaldtlviewspanid = ""; +var globaleditareaspanid = ""; +var globaltxtboxid = ""; +var itsonview=false; +// to retain the old value if we cancel the ajax edit +var globaltempvalue = ''; +var globaluitype = ''; +function showHide(showId, hideId) +{ + show(showId); + fnhide(hideId); +} + +function hndCancel(valuespanid,textareapanid,fieldlabel) +{ + + showHide(valuespanid,textareapanid); + if(globaluitype == '56') + { + if(globaltempvalue == 1) + getObj(globaltxtboxid).checked = true; + else + getObj(globaltxtboxid).checked = false; + } + else if(globaluitype != '53') + getObj(globaltxtboxid).value = globaltempvalue; + globaltempvalue = ''; + itsonview=false; + return false; +} + +function hndMouseOver(uitype,fieldLabel) +{ + var mouseArea=""; + mouseArea="mouseArea_"+ fieldLabel; + if(itsonview) + { + return; + } + + show("crmspanid"); + globaluitype = uitype; + globaldtlviewspanid= "dtlview_"+ fieldLabel;//valuespanid; + globaleditareaspanid="editarea_"+ fieldLabel;//textareapanid; + globalfieldlabel = fieldLabel; + if(globaluitype == 53) + { + if(typeof(document.DetailView.assigntype[0]) != 'undefined') + { + var assign_type_U = document.DetailView.assigntype[0].checked; + var assign_type_G = document.DetailView.assigntype[1].checked; + if(assign_type_U == true) + globaltxtboxid= 'txtbox_U'+fieldLabel; + else if(assign_type_G == true) + globaltxtboxid= 'txtbox_G'+fieldLabel; + }else + { + globaltxtboxid= 'txtbox_U'+fieldLabel; + } + }else + { + globaltxtboxid="txtbox_"+ fieldLabel;//textboxpanid; + } + divObj = getObj('crmspanid'); + crmy = findPosY(getObj(mouseArea)); + crmx = findPosX(getObj(mouseArea)); + if(document.all) + { + divObj.onclick=handleEdit; + } + else + { + divObj.setAttribute('onclick','handleEdit();'); + } + divObj.style.left=(crmx+getObj(mouseArea).offsetWidth -divObj.offsetWidth)+"px"; + divObj.style.top=crmy+"px"; +} + +function handleEdit() +{ + show(globaleditareaspanid) ; + fnhide(globaldtlviewspanid); + if(globaluitype != 53) + { + globaltempvalue = getObj(globaltxtboxid).value; + if(getObj(globaltxtboxid).type != 'hidden') + getObj(globaltxtboxid).focus(); + } + fnhide('crmspanid'); + itsonview=true; + return false; +} + +function trim(str) +{ + return(str.replace(/\s+$/,'')); +} + +var genUiType = ""; +var genFldValue = ""; + +function dtlViewAjaxSave(fieldLabel,module,uitype,tableName,fieldName,crmId) +{ + var dtlView = "dtlview_"+ fieldLabel; + var editArea = "editarea_"+ fieldLabel; + var groupurl = ""; + + if(globaluitype == 53) + { + if(typeof(document.DetailView.assigntype[0]) != 'undefined') + { + var assign_type_U = document.DetailView.assigntype[0].checked; + var assign_type_G = document.DetailView.assigntype[1].checked; + }else + { + var assign_type_U = document.DetailView.assigntype.checked; + } + if(assign_type_U == true) + { + var txtBox= 'txtbox_U'+fieldLabel; + } + else if(assign_type_G == true) + { + var txtBox= 'txtbox_G'+fieldLabel; + var group_name = $(txtBox).options[$(txtBox).selectedIndex].text; + var groupurl = "&assigned_group_name="+group_name+"&assigntype=T" + } + + }else if(globaluitype == 14 || globaluitype == 33 || globaluitype == 34) + { + var txtBox= "txtbox_"+ fieldLabel; + var oMulSelect = $(txtBox); + var r = new Array(); + for (iter=0;iter < oMulSelect.options.length ; iter++) + { + if (oMulSelect.options[iter].selected) + r[r.length] = oMulSelect.options[iter].value; + } + }else + { + var txtBox= "txtbox_"+ fieldLabel; + } + + var popupTxt= "popuptxt_"+ fieldLabel; + var hdTxt = "hdtxt_"+ fieldLabel; + + if(formValidate() == false) + { + return false; + } + + + $("vtbusy_info").style.display="inline"; + var isAdmin = document.getElementById("hdtxt_IsAdmin").value; + + + //overriden the tagValue based on UI Type for checkbox + if(uitype == '56') + { + if(document.getElementById(txtBox).checked == true) + { + tagValue = "1"; + }else + { + tagValue = "0"; + } + }else if(uitype == '156') + { + if(document.getElementById(txtBox).checked == true) + { + tagValue = "on"; + }else + { + tagValue = "off"; + } + }else if(uitype == 14 || uitype == '33' || uitype == '34') + { + tagValue = r.join(" |##| "); + }else + { + tagValue = trim(document.getElementById(txtBox).value); + } + + if(uitype == '3' || uitype == '4' || uitype == '18' || uitype == '31' || uitype == '32') { + if(document.getElementById(txtBox+"_inh").checked) { + tagValue = "@##@" + tagValue; + } + } + + var data = "file=DetailViewAjax&module=" + module + "&action=" + module + "Ajax&record=" + crmId+"&recordid=" + crmId ; + data = data + "&fldName=" + fieldName + "&fieldValue=" + escape(tagValue) + "&ajxaction=DETAILVIEW"+groupurl; + data = data + "&tableName=" + tableName; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: data, + onComplete: function(response) { + if(response.responseText.indexOf(":#:FAILURE")>-1) + { + alert("Error while Editing"); + } + else if(response.responseText.indexOf(":#:SUCCESS")>-1) + { + $("vtbusy_info").style.display="none"; + } + } + } + ); + if(uitype == '13' || uitype == '104') + { + getObj(dtlView).innerHTML = ""+tagValue+" "; + }else if(uitype == '17') + { + getObj(dtlView).innerHTML = ""+tagValue+" "; + }else if(uitype == '34' || (uitype == '115' && fieldName == 'primary_org')) + { + var data = "file=UpdateUserOrg&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: data, + onComplete: function(response) { + $("dvtUserOrg").innerHTML = response.responseText; + } + } + ); + }else if(uitype == '85') + { + getObj(dtlView).innerHTML = ""+tagValue+" "; + }else if(uitype == '53') + { + var hdObj = getObj(hdTxt); + if(typeof(document.DetailView.assigntype[0]) != 'undefined') + { + var assign_type_U = document.DetailView.assigntype[0].checked; + var assign_type_G = document.DetailView.assigntype[1].checked; + }else + { + var assign_type_U = document.DetailView.assigntype.checked; + } + if(isAdmin == "0") + { + getObj(dtlView).innerHTML = hdObj.value; + }else if(isAdmin == "1" && assign_type_U == true) + { + getObj(dtlView).innerHTML = ""+hdObj.value+" "; + }else if(isAdmin == "1" && assign_type_G == true) + { + getObj(dtlView).innerHTML = ""+hdObj.value+" "; + } + }else if(uitype == '56') + { + if(tagValue == '1') + { + getObj(dtlView).innerHTML = "yes"; + }else + { + getObj(dtlView).innerHTML = ""; + } + + }else if(uitype == 116) + { + getObj(dtlView).innerHTML = document.getElementById(txtBox).options[document.getElementById(txtBox).selectedIndex].text; + } + else if(getObj(popupTxt)) + { + var popObj = getObj(popupTxt); + if(uitype == '50' || uitype == '73' || uitype == '51') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '57') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '59') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '75' || uitype == '81' ) + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + + } + else if(uitype == '76') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '78') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '80') + { + getObj(dtlView).innerHTML = ""+popObj.value+" "; + } + else if(uitype == '53') + { + var hdObj = getObj(hdTxt); + if(isAdmin == "0") + { + getObj(dtlView).innerHTML = hdObj.value; + }else if(isAdmin == "1") + { + getObj(dtlView).innerHTML = ""+hdObj.value+" ";; + } + } + else if(uitype == '56') + { + if(tagValue == '1') + { + getObj(dtlView).innerHTML = "yes"; + }else + { + getObj(dtlView).innerHTML = ""; + } + + } + else + { + getObj(dtlView).innerHTML = popObj.value; + } + }else if(uitype == '33' || uitype == '34') + { + /* Wordwrap a long list of multi-select combo box items at the + * item separator string */ + const DETAILVIEW_WORDWRAP_WIDTH = "70"; // must match value in DetailViewUI.tpl. + + var lineLength = 0; + for(var i=0; i < r.length; i++) { + lineLength += r[i].length + 2; // + 2 for item separator string + if(lineLength > DETAILVIEW_WORDWRAP_WIDTH && i > 0) { + lineLength = r[i].length + 2; // reset. + r[i] = '
 ' + r[i]; // prepend newline. + } + // Prevent a browser splitting multiword items: + r[i] = r[i].replace(/ /g, ' '); + } + /* Join items with item separator string (which must match string in DetailViewUI.tpl, + * EditViewUtils.php and CRMEntity.php)!! + */ + getObj(dtlView).innerHTML = r.join(", "); + }else if(uitype == '3' || uitype == '4' || uitype == '14' || uitype == '18' || uitype == '31' || uitype == '32') + { + var data = "file=DetailView&module=" + module + "&action=" + module + "Ajax&record=" + crmId+"&recordid=" + crmId ; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: data, + onComplete: function(response) { + result = response.responseText.split(''); + $("mouseArea_"+fieldLabel).innerHTML= result[1]; + } + } + ); + }else + { + getObj(dtlView).innerHTML = tagValue; + } + showHide(dtlView,editArea); //show,hide + itsonview=false; +} + +function SaveTag(txtBox,crmId,module) +{ + var tagValue = document.getElementById(txtBox).value; + document.getElementById(txtBox).value =''; + $("vtbusy_info").style.display="inline"; + new Ajax.Request( + 'index.php', + {queue: {position: 'end', scope: 'command'}, + method: 'post', + postBody: "file=TagCloud&module=" + module + "&action=" + module + "Ajax&recordid=" + crmId + "&ajxaction=SAVETAG&tagfields=" +tagValue, + onComplete: function(response) { + getObj('tagfields').innerHTML = response.responseText; + $("vtbusy_info").style.display="none"; + } + } + ); + +} +function setSelectValue(fieldLabel) +{ + if(globaluitype == 53) + { + if(typeof(document.DetailView.assigntype[0]) != 'undefined') + { + var assign_type_U = document.DetailView.assigntype[0].checked; + var assign_type_G = document.DetailView.assigntype[1].checked; + if(assign_type_U == true) + var selCombo= 'txtbox_U'+fieldLabel; + else if(assign_type_G == true) + var selCombo= 'txtbox_G'+fieldLabel; + }else + { + var selCombo= 'txtbox_U'+fieldLabel; + } + }else + { + var selCombo= 'txtbox_'+fieldLabel; + } + var hdTxtBox = 'hdtxt_'+fieldLabel; + var oHdTxtBox = document.getElementById(hdTxtBox); + var oSelCombo = document.getElementById(selCombo); + + oHdTxtBox.value = oSelCombo.options[oSelCombo.selectedIndex].text; +} + Modified: vtigercrm/branches/5.1_jens/include/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/language/en_us.lang.php (original) +++ vtigercrm/branches/5.1_jens/include/language/en_us.lang.php Tue Nov 14 03:16:10 2006 @@ -1,1220 +1,1258 @@ -'ISO-8859-1', - -'LBL_BROWSER_TITLE'=>'vtiger CRM 5 - Commercial Open Source CRM', - -'LBL_MY_ACCOUNT'=>'My Account', - -'LBL_MY_PREFERENCES'=>'My Preferences', - -'LBL_ADMIN'=>'Admin', - -'LBL_LOGOUT'=>'Sign out', - -'LBL_SEARCH'=>'Search', - -'LBL_LAST_VIEWED'=>'Last Viewed', - -'NTC_WELCOME_MESSAGE'=>"Welcome to vtiger CRM!", - -'NTC_DESCRIPTION'=>"Use a valid username and password to login to the vtiger CRM.", - -'NTC_WELCOME'=>'Welcome', - -'NTC_NO_ITEMS_DISPLAY'=>'none', - -'LBL_OR'=>'or', - -'LBL_ALT_HOT_KEY'=>'Alt+', -//added for 4.2 -'LBL_SAVE_LABEL'=>'Save', - -'LBL_SEND_MAIL_BUTTON'=>'Send Mail', - - -'LBL_SAVE_BUTTON_TITLE'=>'Save [Alt+S]', - -'LBL_EDIT_BUTTON_TITLE'=>'Edit [Alt+E]', - -'LBL_CONVERTSO_BUTTON_TITLE'=>'Create SalesOrder', -'LBL_CONVERTINVOICE_BUTTON_TITLE'=>'Create Invoice', - -'LBL_EDIT_BUTTON'=>'Edit', - -'LBL_DUPLICATE_BUTTON_TITLE'=>'Duplicate [Alt+U]', - -'LBL_DUPLICATE_BUTTON'=>'Duplicate', - -'LBL_TABCUSTOMISE_BUTTON_TITLE'=>'Customise [Alt+C]', - -'LBL_FORUM_HIDE_BUTTON_TITLE'=>'Hide Forum [Alt+I]', - -'LBL_FORUM_HIDE_BUTTON_KEY'=>'H', - -'LBL_FORUM_SHOW_BUTTON_TITLE'=>'Show Forum [Alt+W]', - -'LBL_FORUM_SHOW_BUTTON_KEY'=>'W', - -'LBL_TABCUSTOMISE_BUTTON'=>'Customise', - -'LBL_DELETE_BUTTON_TITLE'=>'Delete [Alt+D]', - -'LBL_DELETE_BUTTON'=>'Delete', - -'LBL_FIND_BUTTON'=>'Find', - -'LBL_CONVERT_BUTTON_TITLE'=>'Convert [Alt+C]', - -'LBL_CONVERT_BUTTON_KEY'=>'C', - -'LBL_CONVERT_BUTTON_LABEL'=>'Convert Lead', - -'LBL_TABCUSTOMISE_BUTTON_KEY'=>'C', - -'LBL_TABCUSTOMISE_BUTTON_LABEL'=>'Customize Tab', - -'LBL_ROLES_BUTTON_LABEL'=>'Show Roles', - -'LBL_LISTROLES_BUTTON_LABEL'=>'List Roles', - -'LBL_FORUM_HIDE_BUTTON_LABEL'=>'Hide Forums', - -'LBL_FORUM_SHOW_BUTTON_LABEL'=>'Show Forums', - -'LBL_NEW_BUTTON_TITLE'=>'New [Alt+N]', - -'LBL_CHANGE_BUTTON_TITLE'=>'Change [Alt+G]', - -'LBL_CANCEL_BUTTON_TITLE'=>'Cancel [Alt+X]', - -'LBL_SEARCH_BUTTON_TITLE'=>'Search [Alt+Q]', - -'LBL_CLEAR_BUTTON_TITLE'=>'Clear [Alt+C]', - -'LBL_SELECT_BUTTON_TITLE'=>'Select [Alt+T]', - -'LBL_CREATE_BUTTON_LABEL' =>'Create', - -'LBL_GENERATE'=>'Generate', - -'LBL_SAVE_BUTTON_KEY'=>'S', - -'LBL_EDIT_BUTTON_KEY'=>'E', -'LBL_CONVERTSO_BUTTON_KEY'=>'S', -'LBL_CONVERTINVOICE_BUTTON_KEY'=>'I', - -'LBL_DUPLICATE_BUTTON_KEY'=>'U', - -'LBL_DELETE_BUTTON_KEY'=>'D', - -'LBL_NEW_BUTTON_KEY'=>'N', - -'LBL_CHANGE_BUTTON_KEY'=>'G', - -'LBL_CANCEL_BUTTON_KEY'=>'X', - -'LBL_SEARCH_BUTTON_KEY'=>'Q', - -'LBL_CLEAR_BUTTON_KEY'=>'C', - -'LBL_SELECT_BUTTON_KEY'=>'T', - -'LBL_SAVE_BUTTON_LABEL'=>'Save', - -'LBL_EDIT_BUTTON_LABEL'=>'Edit', -'LBL_CONVERTSO_BUTTON_LABEL'=>'Create SalesOrder', -'LBL_CONVERTINVOICE_BUTTON_LABEL'=>'Create Invoice', - -'LBL_DUPLICATE_BUTTON_LABEL'=>'Duplicate', - -'LBL_DELETE_BUTTON_LABEL'=>'Delete', - -'LBL_NEW_BUTTON_LABEL'=>'New', - -'LBL_CHANGE_BUTTON_LABEL'=>'Change', - -'LBL_CANCEL_BUTTON_LABEL'=>'Cancel', - -'LBL_SEARCH_BUTTON_LABEL'=>'Search', - -'LBL_CLEAR_BUTTON_LABEL'=>'Clear', - -'LBL_SELECT_BUTTON_LABEL'=>'Select', - -'LBL_SELECT_CONTACT_BUTTON_TITLE'=>'Select Contact [Alt+T]', - -'LBL_SELECT_CONTACT_BUTTON_KEY'=>'T', - -'LBL_SELECT_CONTACT_BUTTON_LABEL'=>'Select Contact', - -'LBL_SELECT_CAMPAIGN_BUTTON_LABEL'=>'Select Campaign', - -'LBL_SELECT_USER_BUTTON_TITLE'=>'Select User [Alt+U]', - -'LBL_SELECT_USER_BUTTON_KEY'=>'U', - -'LBL_SELECT_USER_BUTTON_LABEL'=>'Select User', - -'LBL_SETTINGS'=>'Settings', - -'LBL_LIST_USERIP'=>'User IP', - -'LBL_LIST_SIGNIN'=>'Sign in Time', - -'LBL_LIST_SIGNOUT'=>'Sign out Time', - -'LBL_LIST_STATUS'=>'Status', - - - -'LBL_LIST_NAME'=>'Name', - -'LBL_LIST_USER_NAME'=>'User Name', - -'LBL_LIST_EMAIL'=>'Email', - -'LBL_LIST_PHONE'=>'Phone', - -'LBL_LIST_CONTACT_NAME'=>'Contact Name', - -'LBL_LIST_ACCOUNT_NAME'=>'Account Name', - -'LBL_USER_LIST'=>'User List', - -'LBL_CONTACT_LIST'=>'Contact List', - -'LBL_LNK_SETTINGS'=> 'Settings', - -'LNK_IMPORT_LEADS'=>'Import Leads', - -'LBL_LOCATE_MAP'=>'Locate Map', - -'LBL_ADDRESS'=>'Address', - -'LBL_ADD_TAG'=>'Add Tag', - -'LBL_TAG_IT'=>'Tag it', - -'LBL_CLOSE'=>'Close', - -'LNK_ADVANCED_SEARCH'=>'Advanced Search', - -'LNK_BASIC_SEARCH'=>'Basic Search', - -'LNK_EDIT'=>'edit', - -'LNK_REMOVE'=>'rem', - -'LNK_DELETE'=>'del', - -'LNK_LIST_START'=>'Start', - -'LNK_LIST_NEXT'=>'Next', - -'LNK_LIST_PREVIOUS'=>'Previous', - -'LNK_LIST_END'=>'End', - -'LBL_LIST_OF'=>'of', - -'LNK_PRINT'=>'Print', - -'LNK_HELP'=>'Help', - -'LNK_VTDOCS'=>'vtiger Docs', - -'LNK_ABOUT'=>'About', - -'LNK_OUTLOOK'=>'./include/images/outlook_download.gif', - -'LNK_NEW_HDESK'=>'New Ticket', - -'LNK_NEW_PRODUCT'=>'New Product', - -'LNK_NEW_CONTACT'=>'New Contact', - -'LNK_NEW_CAMPAIGN'=>'New Campaign', - -'LNK_NEW_LEAD'=>'New Lead', - -'LNK_NEW_ACCOUNT'=>'New Account', - -'LNK_NEW_OPPORTUNITY'=>'New Potential', - -'LNK_NEW_NOTE'=>'New Note', - -'LNK_NEW_EMAIL'=>'New Email', - -'LNK_NEW_TASK'=>'New Task', - -'LNK_NEW_EVENT'=>'New Event', -'LNK_NEW_QUOTE'=>'New Quote', -'LNK_NEW_PO'=>'New Purchase Order', -'LNK_NEW_SO'=>'New Sales Order', -'LNK_NEW_INVOICE'=>'New Invoice', -'LNK_NEW_VENDOR'=>'New Vendor', -'LNK_NEW_PRICEBOOK'=>'New PriceBook', - - -'NTC_REQUIRED'=>'Indicates required field', - -'LBL_REQUIRED_SYMBOL'=>'*', - -'LBL_CURRENCY_SYMBOL'=>'$', - -'LBL_THOUSANDS_SYMBOL'=>'K', - -'NTC_DATE_FORMAT'=>'(yyyy-mm-dd)', - -'NTC_TIME_FORMAT'=>'(24:00)', - -'NTC_DATE_TIME_FORMAT'=>'(yyyy-mm-dd 24:00)', - -'NTC_DELETE_CONFIRMATION'=>'Are you sure you want to delete this record?', - -'ERR_DELETE_RECORD'=>'A record number must be specified to delete the contact.', - -'ERR_CREATING_TABLE'=>'Error creating table: ', - -'ERR_CREATING_FIELDS'=>'Error filling in additional detail fields: ', - -'ERR_MISSING_REQUIRED_FIELDS'=>'Missing required fields:', - -'ERR_INVALID_EMAIL_ADDRESS'=>'not a valid email address.', - -'ERR_INVALID_DATE_FORMAT'=>'The date format must be: yyyy-mm-dd', - -'ERR_INVALID_MONTH'=>'Please enter a valid month.', - -'ERR_INVALID_DAY'=>'Please enter a valid day.', - -'ERR_INVALID_YEAR'=>'Please enter a valid 4 digit year.', - -'ERR_INVALID_DATE'=>'Please enter a valid date.', - -'ERR_INVALID_HOUR'=>'Please enter a valid hour.', - -'ERR_INVALID_TIME'=>'Please enter a valid time.', - -'NTC_CLICK_BACK'=>'Please click the browser back button and fix the error.', - -'LBL_LIST_ASSIGNED_USER'=>'Assigned To', - -'LBL_ASSIGNED_TO'=>'Assigned To:', - -'LBL_DATE_MODIFIED'=>'Last Modified:', - -'LBL_DATE_ENTERED'=>'Created:', - -'LBL_CURRENT_USER_FILTER'=>'Only my items:', - -'NTC_LOGIN_MESSAGE'=>"Login", - -'LBL_NONE'=>'--None--', - -'LBL_BACK'=>'Back', - -'LBL_IMPORT'=>'Import', - -'LBL_EXPORT'=>'Export', - -'LBL_EXPORT_ALL'=>'Export All', - -'LBL_QUICK_CREATE'=>'Quick Create', - -'Export'=>'Export', -'Import'=>'Import', -'Merge'=>'Merge', -'ConvertLead'=>'ConvertLead', - - -'LBL_SHOW_RESULTS'=>'Show Results in', -'LBL_TOTAL_RECORDS_FOUND'=>'Total Records found :', -'LBL_SEARCH_RESULTS_FOR'=>' -- Search results for ', -'LBL_TAG_SEARCH'=>' -- Tag search for ', -'LBL_NO_DATA'=>'No Data Found', - - -//3.2 release - -'NTC_MERGE_CONFIRMATION'=>'Are you sure you want to merge this record?', - -'LBL_MERGE_BUTTON_TITLE'=>'Merge', - -'LBL_MERGE_BUTTON_KEY'=> 'Merge', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE'=>'Select Email Template', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_KEY'=>'Select Email Template', - -'LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL'=>'Select Email Template', - -'LBL_MERGE_BUTTON_LABEL'=>'Merge', - -'LBL_SENDMAIL_BUTTON_TITLE'=>'SendMail', - -'LBL_SENDMAIL_BUTTON_KEY'=> 'SendMail', - -'LBL_SENDMAIL_BUTTON_LABEL'=>'Send Mail', - - - -//Added fields for upload file as attachment -- 4 Beta - -'LBL_UPD_DESC'=>'Description', - -'LBL_FILENAME'=>'File Name', - -'LBL_FILE'=>'File', - -'LBL_TYPE'=>'File Type', - -'LBL_DOWNLOAD'=>'Download Now', - -'LBL_OPERATION'=>'Operation', - -'LBL_GROUP_ALLOCATION_TITLE'=>'My Group Allocation ', - -'LBL_ENTITY_NAME'=>'Entity Name', - -'LBL_GROUP_NAME'=>'Group', - -'LBL_ENTITY_TYPE'=>'Type', - - - -//Added fields for Ticket Attachment in RelatedTicketListUtil - -'LBL_NEW_TICKET'=>'New Ticket', - -'LBL_TITLE'=>'Title', - -'LBL_PRIORITY'=>'Priority', - -'LBL_STATUS'=>'Status', - - - -//Added fields for Change Owner and Change Status in all modules -- after 4 Beta - -'LBL_CHANGE_OWNER'=>'Change Owner', - -'LBL_CHANGE_STATUS'=>'Change Status', - -'LBL_MASS_DELETE'=>'Delete', -//added by raju - -'LBL_ADD_ITEM'=>'Add', - -'LBL_ADD_NEW'=>'Add', - -'LBL_DEDUCT'=>'Deduct', -//Added for version 5 - -'LBL_CALENDAR_TITLE'=>'Open Calendar...', -'LBL_CALENDAR_ALT'=>'Open Calendar...', - -'LBL_CALCULATOR_TITLE'=>'Open Calculator...', -'LBL_CALCULATOR_ALT'=>'Open Calculator...', - -'LBL_CLOCK_TITLE'=>'Show World Clock...', -'LBL_CLOCK_ALT'=>'Show World Clock...', - -'LBL_ALL_MENU_TITLE'=>'Open All Menu...', -'LBL_ALL_MENU_ALT'=>'Open All Menu...', - -'LBL_CHAT_TITLE'=>'Chat...', -'LBL_CHAT_ALT'=>'Chat...', - -'LBL_SEARCH_TITLE'=>'Search in ', -'LBL_SEARCH_ALT'=>'Search in ', - -'LBL_SEARCH_STRING'=>'Search...', - -'LBL_SEARCH_FOR'=>'Search for', -'LBL_SEARCH_NOW_BUTTON'=>'Search Now', -'LBL_GO_TO'=>'Go to', -'LBL_FEWER_BUTTON'=>'Fewer', -'LBL_IN'=>'In', - -'LBL_ADV_SEARCH_MSG_ANY'=>'Match Any of the Following', -'LBL_ADV_SEARCH_MSG_ALL'=>'Match All of the Following', - -'COMBO_ALL'=>'All', - -// Added fields for Related Field Display Informations in Detail View of All Modules - -'LBL_OPEN_ACTIVITIES'=>'Open Activities', - -'LBL_HISTORY'=>'History', - -'LBL_ACTIVITY_HISTORY'=>'Activity History', - -'LBL_ATTACHMENTS'=>'Attachments', - -'LBL_ATTACHMENT'=>'Attachment', - -'LBL_TYPE'=>'Type', - -'LBL_ASSIGNED_TO'=>'Assigned To', - -'LBL_TIME'=>'Time', - -'LBL_ACTION'=>'Action', - -'LBL_SUBJECT'=>'Subject', - -'LBL_RELATED_TO'=>'Related To', - -//added by raju for emails - -'LBL_MULTIPLE'=>'Multiple', - -'LBL_DUE_DATE'=>'Due Date', - -'LBL_LAST_MODIFIED'=>'Last Modified', - -'LBL_CREATED'=>'Created', // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Added - -'LBL_DESCRIPTION'=>'Description', - - - -'LBL_NEW_TASK'=>'New Task', - -'LBL_NEW_EVENT'=>'New Event', - -'LBL_ATTACHMENT_AND_NOTES'=>'Attachments & Notes', - -'LBL_POTENTIAL_NAME'=>'Potential Name', - -'LBL_CONTACT_NAME'=>'Contact Name', - -'LBL_DEPARTMENT'=>'Department', - -'LBL_ROLE'=>'Role', - -'LBL_EMAIL'=>'Email', - -'LBL_PHONE'=>'Phone', - -'LBL_PRODUCT'=>'Product', - -'LBL_AMOUNT'=>'Amount', - -'LBL_CLOSE_DATE'=>'Close Date', - -'LBL_NEW_ATTACHMENT'=>'New Attachment', - -'LBL_NEW_NOTE'=>'New Note', - - - -'LBL_PRODUCT_TITLE'=>'Products', - -'LBL_NEW_PRODUCT'=>'New Product', - -'LBL_PRODUCT_NAME'=>'Product Name', - -'LBL_QUANTITY'=>'Quantity', - -'LBL_SALES_PRICE'=>'Sale Price', - -'LBL_PURCHASE_DATE'=>'Purchase Date', - -'LBL_TICKET_ID'=>'Ticket Id', - -'LBL_NEW_TICKET'=>'New Ticket', - -'LBL_TICKETS'=>'Tickets', - - - -'LBL_POTENTIAL_TITLE'=>'Potentials', - -'LBL_NEW_POTENTIAL'=>'New Potential', - -'LBL_LEAD_NAME'=>'Lead Name', - -'LBL_ACCOUNT_NAME'=>'Account Name', - -'LBL_ACCOUNT_TYPE'=>'Account Type', - -'LBL_USER_TITLE'=>'Users', - -'LBL_CONTACT_TITLE'=>'Contacts', - - - -// 4 GA - -'LBL_SHOWING' => 'Showing', - -// - - - -//Added fields after RC1 - Release - -'LBL_SELECT_PRODUCT_BUTTON_LABEL'=>'Select Product', - -'LBL_VIEW'=>'Filters :', -// Mike Crowe Mod --------------------------------------------------------Added for group sort -'LBL_GROUP_VIEW'=>'Group', - - -'LBL_SALES_STAGE'=>'Sales Stage', - -'LBL_PROBABILITY'=>'Probability', - -'LBL_BULK_MAILS'=>'Bulk Mails', - - - -'LBL_WORLD_CLOCK'=>'World Clock', - -'LBL_CALCULATOR'=>'Calculator', - -'LBL_CLOSE_WON' =>'Closed-Won', # 'Closed Won' -'LBL_CLOSE_LOST'=>'Closed-Lost', # 'Closed Lost' - -'LBL_USER'=>'User', - -'LBL_TEAM'=>'Team', - -'LBL_GROUP'=>'Group', - -'LBL_NONE_NO_LINE'=>'none', - -'LBL_SELECT_GROUP'=>'Select a group', - -'LBL_HOUR_AND_MINUTE'=>'(hours/minutes)', - -'YEAR_MONTH_DATE'=>'24:00', - - - -'COMBO_LEADS'=>'Leads', - -'COMBO_ACCOUNTS'=>'Accounts', - -'COMBO_CONTACTS'=>'Contacts', - -'COMBO_POTENTIALS'=>'Potentials', - -'COMBO_PRODUCTS'=>'Products', - -'COMBO_HELPDESK'=>'Trouble Tickets', - -'COMBO_USERS'=>'Users', - -'COMBO_CAMPAIGNS'=>'Campaigns', - - -'LBL_SELECT'=>'Select', - -'LBL_EDIT'=>'Edit', - -'LBL_DELETE'=>'Delete', - - - -//List Fields - -'Name'=>'Name', - -'Company'=>'Company', - -'Phone'=>'Phone', - -'Website'=>'Website', - -'Email'=>'Email', - -'Assigned To'=>'Assigned To', - -'Account Name'=>'Account Name', - -'City'=>'City', - -'Title'=>'Title', - -'Potential'=>'Potential', - -'Sales Stage'=>'Sales Stage', - -'Amount'=>'Amount', - -'Expected Close'=>'Expected Close', - -'Subject'=>'Subject', - -'Contact Name'=>'Contact Name', - -'Related to'=>'Related To', - -'File'=>'File', - -'Last Modified'=>'Last Modified', - -'Close'=>'Close', - -'Type'=>'Type', - -'Start Date/Due Date'=>'Start Date/Due Date', - -'Date Sent'=>'Date Sent', - -'Ticket ID'=>'Ticket ID', - -'Status'=>'Status', - -'Priority'=>'Priority', - -'Product Name'=>'Product Name', - -'Product Code'=>'Part Number', - -'Commission Rate'=>'Commission Rate', - -'Qty/Unit'=>'Qty/Unit', - -'Unit Price'=>'Unit Price', - -'Question'=>'Question', - -'Category'=>'Category', - -'Price Book Name'=>'Price Book Name', -'LBL_EVENT_ENDDATE'=>'End Date & Time', - -//Added after 4 GA -'LBL_CUSTOM_INFORMATION'=>'Custom Information', - -//Added fields to display the related lists titles and None Scheduled -'LBL_NONE_SCHEDULED'=>'None Scheduled', - -'Leads'=>'Leads', -'Accounts'=>'Accounts', -'Accounts & Contacts'=>'Accounts & Contacts', -'Contacts'=>'Contacts', -'Potentials'=>'Potentials', -'Products'=>'Products', -'Emails'=>'Emails', -'HelpDesk'=>'Trouble Tickets', -'Activities'=>'Activities', -'Events'=>'Events', -'Tasks'=>'Tasks', -'Todo'=>'To Do', -'Call'=>'Call', -'Meeting'=>'Meeting', -'Quotes'=>'Quotes', -'PriceBook'=>'Price Books', -'PurchaseOrder'=>'Purchase Order', -'SalesOrder'=>'Sales Order', -'Invoice'=>'Invoices', -'Calendar'=>'Calendar', -'Home'=>'Home', -'Campaigns'=>'Campaigns', -'PriceBooks'=>'Price Books', -'Notes'=>'Notes', -'Faq'=>'FAQ', -'Dashboards'=>'Dashboard', -'Reports'=>'Reports', -'Vendors'=>'Vendors', -'Rss'=>'RSS', -'Portal'=>'My Sites', -'Webmails'=>'Webmails', -'Attachments'=>'Attachments', -'Activity History'=>'Activity History', -'Ticket History'=>'Ticket History', -'Purchase Order'=>'Purchase Order', -'Sales Stage History'=>'Sales Stage History', -'Users'=>'Users', -'Admin'=>'Admin', -'PurchaseOrder Status History'=>'PurchaseOrder Status History', -'SalesOrder Status History'=>'SalesOrder Status History', -'Quote Stage History'=>'Quote Stage History', -'Invoice Status History'=>'Invoice Status History', -'LBL_TROUBLE_TICKET'=>'Trouble Ticket', - -//Added language for Parent Tab - -'My Home Page'=>'My Home Page', -'Marketing'=>'Marketing', -'Sales'=>'Sales', -'Support'=>'Support', -'Analytics'=>'Analytics', -'Inventory'=>'Inventory', -'Tools'=>'Tools', -'Settings'=>'Settings', - -'LBL_INFORMATION'=>'Information', -'LBL_MORE'=>'More', -'LBL_BASIC'=>'Basic', -'LBL_CREATING'=>'Creating', -'LBL_EDITING'=>'Editing', -'LBL_NEW'=>'New', - -//Added for Detail/Edit/Related List of all modules - -'Lead'=>'Lead', -'Account'=>'Account', -'Contact'=>'Contact', -'Potential'=>'Potential', -'Opportunity'=>'Potential', -'Product'=>'Product', -'Email'=>'Email', -'Activity'=>'Activity', -'Event'=>'Event', -'Task'=>'Task', -'Quote'=>'Quote', -'PriceBook'=>'PriceBook', -'PurchaseOrder'=>'Purchase Order', -'Ticket'=>'Ticket', -'SalesOrder'=>'Sales Orders', -'Campaign'=>'Campaign', -'Note'=>'Note', -'Dashboard'=>'Dashboards', -'Report'=>'Report', -'Vendor'=>'Vendor', -'Webmail'=>'Webmail', - -'LBL_NONE_INCLUDED'=>'None Included', -'LBL_ADD_TO'=>'Add to', - -'LBL_SELECT_TEMPLATE_TO_MAIL_MERGE'=>'Select template to Mail Merge:', -'LBL_TITLE_OR_DESCRIPTION'=>'Title / Description', - -//Added for RSS Module -'LBL_RSS_FEEDS'=>'RSS Feeds', -'LBL_ADD_RSS_FEEDS'=>'Add New RSS Feed', - -//Added fields after 4.2 alpha -'COMBO_ACCOUNTS'=>'Accounts', -'LNK_NEW_FAQ'=>'New FAQ', -'Vendor Name'=>'Vendor Name', -'LNK_WEARE'=>'About us', -'LBL_ABOUTUS_TITLE'=>'vtiger CRM - About Us', -'LBL_DISCUSS'=>'Discuss with other users', -'Quote Stage'=>'Quote Stage', -'Potential Name'=>'Potential Name', -'Total'=>'Total Amount', -'First Name'=>'First Name', -'Last Name'=>'Last Name', -'User Name'=>'User Name', - /* For purchase order related list in vendor */ -'LBL_PORDER_BUTTON_TITLE'=>'New Purchase Order [Alt+O]', -'LBL_PORDER_BUTTON'=>'New Purchase Order', -'LBL_PORDER_BUTTON_KEY'=>'O', -'Tracking Number'=>'Tracking Number', -'Order Id'=>'Order Id', -'Quote Name'=>'Quote Name', -'Invoice Id'=>'Invoice Id', -'Quote Id'=>'Quote Id', -'Sales Order'=>'Sales Order', - // Added Quote in activity parent type selection / Related list -'COMBO_QUOTES'=>'Quotes', -'End Date'=>'End Date', -'Start Date'=>'Start Date', -'Related to'=>'Related To', -'Recurring Type'=> 'Recurring Type', -'SalesOrders'=> 'Sales Order', -'PurchaseOrder'=> 'Purchase Orders', -'LBL_QUOTE_NAME'=>'Quote Name', - //Added Orders in activity parent type selection / Related list -'LBL_NEW_QUOTE_BUTTON_TITLE'=>'New Quote [Alt+Q]', -'LBL_NEW_QUOTE_BUTTON_KEY'=>'Q', -'LBL_NEW_QUOTE_BUTTON'=>'New Quote', -'COMBO_PORDER'=>'Purchase Order', -'COMBO_SORDER'=>'Sales Order', -'LBL_PORDER_NAME'=>'Purchase Order', -'LBL_SORDER_NAME'=>'Sales Order', - // Added Invoice in activity parent type selection / Related list -'COMBO_INVOICES'=>'Invoice', -'LBL_INVOICE_NAME'=>'Invoice', -'LBL_HELPDESK_NAME'=>'Trouble Ticket', -'LBL_CAMPAIGN_NAME'=>'Campaign Name', - -'LBL_NEW_INVOICE_BUTTON_TITLE'=>'New Invoice [Alt+I]', -'LBL_NEW_INVOICE_BUTTON_KEY'=>'I', -'LBL_NEW_INVOICE_BUTTON'=>'New Invoice', -'LBL_NEW_SORDER_BUTTON_TITLE'=>'New Sales Order [Alt+E]', -'LBL_NEW_SORDER_BUTTON_KEY'=>'E', -'LBL_NEW_SORDER_BUTTON'=>'New Sales Order', - -'LBL_PRODUCT_DETAILS'=>'Product Details', -'LBL_PRODUCT'=>'Product', -'LBL_QTY_IN_STOCK'=>'Qty In Stock', -'LBL_QTY'=>'Qty', -'LBL_UNIT_PRICE'=>'Unit Price', -'LBL_LIST_PRICE'=>'List Price', -'LBL_TOTAL'=>'Total', -'LBL_ADD_PRODUCT'=>'Add Product', -'LBL_SUB_TOTAL'=>'Sub Total', -'LBL_TAX'=>'Tax', -'LBL_ADJUSTMENT'=>'Adjustment', -'LBL_GRAND_TOTAL'=>'Grand Total', -'LBL_QUOTE_ID'=>'Quote Id', -'LBL_SALES_ORDER_ID'=>'Sales Order Id', -'LBL_PURCHASE_ORDER_ID'=>'Purchase Order Id', -'LBL_EXPORT_TO_PDF'=>'Export To PDF', - -//Added for 4.2 Patch I -'LBL_HOME_KEY_METRICS'=>'Key Metrics', -'LBL_HOME_METRICS'=>'Metrics', -'LBL_HOME_COUNT'=>'Count', - -//Added for 4.2 patch 2 -'LBL_JSCALENDAR_LANG'=>'en', -'LNK_CV_EDIT'=>'Edit', -'LNK_CV_DELETE'=>'Delete', -'LNK_CV_CREATEVIEW'=>'New', -//Added for 5.0 -'LBL_UPD_FIELD_ORD'=>'Update Field Order', -'LBL_SEND_CUSTOM_MAIL_BUTTON'=>'Send Custom Mail', -'LBL_UPDATED_TODAY'=>'Updated today', -'LBL_UPDATED'=>'Updated', -'LBL_DAY_AGO'=>'day ago', -'LBL_DAYS_AGO'=>'days ago', - -//Added to convert Month string in update info - ahmed - -'Jan'=>'Jan', -'Feb'=>'Feb', -'Mar'=>'Mar', -'Apr'=>'Apr', -'May'=>'May', -'Jun'=>'Jun', -'Jul'=>'Jul', -'Aug'=>'Aug', -'Sep'=>'Sep', -'Oct'=>'Oct', -'Nov'=>'Nov', -'Dec'=>'Dec', - -//Added after 5.0 Alpha5 -'Campaign Name'=>'Campaign Name', -'Campaign Type'=>'Campaign Type', -'Campaign Status'=>'Campaign Status', -'Expected Revenue'=>'Expected Revenue', -'Expected Close Date'=>'Expected Close Date', -'LBL_ACTIONS'=>'Actions', -'LBL_SEND'=>'Send', -'LBL_VAT'=>'VAT', -'LBL_SALES'=>'Sales', -'LBL_SERVICE'=>'Service', -'LBL_TAX_DETAILS'=>'Tax Details', -'LBL_TAX_CALCULATION'=>'Tax Calculation', -'COVERED_PERCENTAGE'=>'(%)', - -'LBL_TAG_CLOUD'=>'Tag Cloud', -'LBL_FOR'=>'for', -'LBL_PO_STATUS'=>'PurchaseOrder Status', -'LBL_SO_STATUS'=>'SalesOrder Status', -'LBL_INVOICE_STATUS'=>'Invoice Status', -'LBL_NOTE'=>'Note', -'LBL_MODULE'=>'Module', -'Active'=>'Active', -'Inactive'=>'Inactive', -'Today'=>'Today', -'Last 2 Days'=>'Last 2 Days', -'Last Week'=>'Last Week', -'This Week'=>'This Week', -'This Month'=>'This Month', -'This Year'=>'This Year', -'LBL_PLEASE_CLICK'=>'Please Click', -'LBL_TO_CONFIGURE'=>'to Configure', -'LBL_HERE'=>'here', -'LBL_RECORDS'=>'Records', -'LBL_SCROLL'=>'[Scroll to Top]', -'LBL_EXPAND_COLLAPSE'=>'Expand/Collapse', -'LBL_RCPY_ADDRESS'=>'Copy Shipping address', -'LBL_LCPY_ADDRESS'=>'Copy Billing address', -'LBL_RECORD_ID'=>'Record ID', -'LBL_ACTION_DATE'=>'Action Date', -'LBL_HOMEPAGE_DASHBOARD'=>'HomePage Dashboard', -'LBL_NO'=>'No', -'LBL_FOUND'=>'Found', -'LBL_YOU_CAN_CREATE'=>'You can Create', -'LBL_NOW'=>'now', -'LBL_CLICK_THE_LINK'=>'Click the link below', -'LBL_CREATE'=>'Create', -'LBL_A'=>'a', -'LBL_AN'=>'an', -'LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE'=>'You are not allowed to create', -'LBL_TRANSFER_OWNERSHIP'=>'Transfer Ownership to', -'LBL_SELECT_STATUS'=>'Select New Status', -'LBL_UPDATE_OWNER'=>'Update Owner', -'LBL_UPDATE_STATUS'=>'Update Status', - -//added for tax calculations - after 5beta2 -'LBL_NET_PRICE'=>'Net Price', -'LBL_TOOLS'=>'Tools', -'LBL_DISCOUNT'=>'Discount', -'LBL_TOTAL_AFTER_DISCOUNT'=>'Total After Discount', -'LBL_NET_TOTAL'=>'Net Total', -'LBL_SHIPPING_AND_HANDLING_CHARGES'=>'Shipping & Handling Charges', -'LBL_TAX_FOR_SHIPPING_AND_HANDLING'=>'Taxes For Shipping and Handling', -'LBL_FINISH'=>'Finish', -'LBL_IMAGE_DELETED'=>'Image Deleted', -'LBL_TAX_MODE'=>'Tax Mode', -'LBL_CLEAR_COMMENT'=>'Clear Comment', -'LBL_ZERO_DISCOUNT'=>'Zero Discount', -'LBL_OF_PRICE'=>'of Price', -'LBL_DIRECT_PRICE_REDUCTION'=>'Direct Price Reduction', -'LBL_INDIVIDUAL'=>'Individual', - -//Added the address strings for Contacts Module -'LBL_CPY_MAILING_ADDRESS'=>'Copy Mailing Address', -'LBL_CPY_OTHER_ADDRESS'=>'Copy Other Address', - -'LBL_PERMISSION'=>'You are not permitted to execute this Operation', -'VTIGER'=>'vtiger', - -//Added for Inventory Tax details -'LBL_DIRECT_AMOUNT_DISCOUNT'=>'Direct Amount Discount', -'LBL_NO_DISCOUNT_FOR_THIS_PRODUCT'=>'No Discount for this Product', -'LBL_TOTAL_TAX_AMOUNT'=>'Total Tax Amount', -'LBL_FINAL_DISCOUNT_AMOUNT'=>'Final Discount Amount', -'LBL_SHIPPING_AND_HANDLING_CHARGE'=>'Shipping & Handling Charge', -'LBL_GO_BACK'=>'Go Back', - -//Record deleted message -'LBL_RECORD_DELETE'=>'The record you are trying to view has been deleted.', -); - - - -//the left value is the key stored in the db and the right value is the display value - -//to translate, only modify the right value in each key/value pair - -$app_list_strings = Array( - -//e.g. auf Deutsch 'Contacts'=>'Contakten', - -'moduleList' => Array('Home'=>'Home' - - , 'Dashboard'=>'Dashboard' - - , 'Leads'=>'Leads' - - , 'Contacts'=>'Contacts' - - , 'Accounts'=>'Accounts' - - , 'Potentials'=>'Potentials' - - , 'Campaigns'=>'Campaigns' - - , 'Notes'=>'Notes' - - , 'Emails'=>'Emails' - - , 'Activities'=>'Activities' - - , 'Products'=>'Products' - - , 'HelpDesk'=>'Trouble Tickets' - - , 'Faq'=>'FAQ' - - , 'Calendar'=>'Calendar' - - , 'Quotes'=>'Quotes' - - , 'PurchaseOrder'=>'PurchaseOrder' - - , 'Invoice'=>'Invoice' - - , 'Rss'=>'RSS' - - , 'Reports'=>'Reports' - - , 'Vendors'=>'Vendors' - - , 'PriceBooks'=>'PriceBooks' - - , 'SalesOrder'=>'SalesOrder' - - , 'Portal'=>'My Sites' - - ), - - - -//Note: do not translate opportunity_relationship_type_default_key - -// it is the key for the default opportunity_relationship_type_dom value - -'opportunity_relationship_type_default_key' => 'Primary Decision Maker', - -'opportunity_relationship_type_dom' => Array(''=>'' - - , 'Primary Decision Maker'=>'Primary Decision Maker' - - , 'Business Decision Maker'=>'Business Decision Maker' - - , 'Business Evaluator'=>'Business Evaluator' - - , 'Technical Decision Maker'=>'Technical Decision Maker' - - , 'Technical Evaluator'=>'Technical Evaluator' - - , 'Executive Sponsor'=>'Executive Sponsor' - - , 'Influencer'=>'Influencer' - - , 'Other'=>'Other' - - ), - - - -//Note: do not translate case_relationship_type_default_key - -// it is the key for the default case_relationship_type_dom value - -'case_relationship_type_default_key' => 'Primary Contact', - -'case_relationship_type_dom' => Array(''=>'' - - , 'Primary Contact'=>'Primary Contact' - - , 'Alternate Contact'=>'Alternate Contact' - - ), - - - -'task_priority_dom' => Array('High'=>'High' - - , 'Medium'=>'Medium' - - , 'Low'=>'Low' - - ), - - - -'task_status_dom' => Array('Planned'=>'Planned' - - , 'Completed'=>'Completed' - - , 'Deferred'=>'Deferred' - - ), - - - -'meeting_status_dom' => Array('Planned'=>'Planned' - - , 'Held'=>'Held' - - , 'Not Held'=>'Not Held' - - ), - - - -'call_status_dom' => Array('Planned'=>'Planned' - - , 'Held'=>'Held' - - , 'Not Held'=>'Not Held' - - ), - - - -//Note: do not translate case_status_default_key - -// it is the key for the default case_status_dom value - -'case_status_default_key' => 'New', - -'case_status_dom' => Array('New'=>'New' - - , 'Assigned'=>'Assigned' - - , 'Closed'=>'Closed' - - , 'Pending Input'=>'Pending Input' - - , 'Rejected'=>'Rejected' - - ), - - - -'user_status_dom' => Array('Active'=>'Active' - - , 'Inactive'=>'Inactive' - - ), - - - -//Note: do not translate record_type_default_key - -// it is the key for the default record_type_module value - -'record_type_default_key' => 'Accounts', - -'record_type_display' => array('Accounts' => 'Account', - - 'Leads' => 'Lead', - - 'Opportunities' => 'Opportunity'), - -); - - - -?> +'ISO-8859-1', + +'LBL_BROWSER_TITLE'=>'vtiger CRM 5 - Commercial Open Source CRM', + +'LBL_MY_ACCOUNT'=>'My Account', + +'LBL_MY_PREFERENCES'=>'My Preferences', + +'LBL_ADMIN'=>'Admin', + +'LBL_LOGOUT'=>'Sign out', + +'LBL_SEARCH'=>'Search', + +'LBL_LAST_VIEWED'=>'Last Viewed', + +'LBL_TODAY'=>'Today', + +'LBL_ALL'=>'All', + +'LBL_SHOW'=>'Show :', + +'today'=>"Today's", + +'all'=>'All', + +'LBL_UPCOMING_EVENTS'=>'Upcoming Activities', + +'LBL_PENDING_EVENTS'=>'Pending Activities', + +'NTC_WELCOME_MESSAGE'=>"Welcome to vtiger CRM!", + +'NTC_DESCRIPTION'=>"Use a valid username and password to login to the vtiger CRM.", + +'NTC_WELCOME'=>'Welcome', + +'NTC_NO_ITEMS_DISPLAY'=>'none', + +'LBL_OR'=>'or', + +'LBL_ALT_HOT_KEY'=>'Alt+', +//added for 4.2 +'LBL_SAVE_LABEL'=>'Save', + +'LBL_SEND_MAIL_BUTTON'=>'Send Mail', + + +'LBL_SAVE_BUTTON_TITLE'=>'Save [Alt+S]', + +'LBL_EDIT_BUTTON_TITLE'=>'Edit [Alt+E]', + +'LBL_CONVERTSO_BUTTON_TITLE'=>'Create SalesOrder', +'LBL_CONVERTINVOICE_BUTTON_TITLE'=>'Create Invoice', + +'LBL_EDIT_BUTTON'=>'Edit', + +'LBL_DUPLICATE_BUTTON_TITLE'=>'Duplicate [Alt+U]', + +'LBL_DUPLICATE_BUTTON'=>'Duplicate', + +'LBL_TABCUSTOMISE_BUTTON_TITLE'=>'Customise [Alt+C]', + +'LBL_FORUM_HIDE_BUTTON_TITLE'=>'Hide Forum [Alt+I]', + +'LBL_FORUM_HIDE_BUTTON_KEY'=>'H', + +'LBL_FORUM_SHOW_BUTTON_TITLE'=>'Show Forum [Alt+W]', + +'LBL_FORUM_SHOW_BUTTON_KEY'=>'W', + +'LBL_TABCUSTOMISE_BUTTON'=>'Customise', + +'LBL_DELETE_BUTTON_TITLE'=>'Delete [Alt+D]', + +'LBL_DELETE_BUTTON'=>'Delete', + +'LBL_FIND_BUTTON'=>'Find', + +'LBL_CONVERT_BUTTON_TITLE'=>'Convert [Alt+C]', + +'LBL_CONVERT_BUTTON_KEY'=>'C', + +'LBL_CONVERT_BUTTON_LABEL'=>'Convert Lead', + +'LBL_TABCUSTOMISE_BUTTON_KEY'=>'C', + +'LBL_TABCUSTOMISE_BUTTON_LABEL'=>'Customize Tab', + +'LBL_ROLES_BUTTON_LABEL'=>'Show Roles', + +'LBL_LISTROLES_BUTTON_LABEL'=>'List Roles', + +'LBL_FORUM_HIDE_BUTTON_LABEL'=>'Hide Forums', + +'LBL_FORUM_SHOW_BUTTON_LABEL'=>'Show Forums', + +'LBL_NEW_BUTTON_TITLE'=>'New [Alt+N]', + +'LBL_CHANGE_BUTTON_TITLE'=>'Change [Alt+G]', + +'LBL_CANCEL_BUTTON_TITLE'=>'Cancel [Alt+X]', + +'LBL_SEARCH_BUTTON_TITLE'=>'Search [Alt+Q]', + +'LBL_CLEAR_BUTTON_TITLE'=>'Clear [Alt+C]', + +'LBL_SELECT_BUTTON_TITLE'=>'Select [Alt+T]', + +'LBL_CREATE_BUTTON_LABEL' =>'Create', + +'LBL_GENERATE'=>'Generate', + +'LBL_SAVE_BUTTON_KEY'=>'S', + +'LBL_EDIT_BUTTON_KEY'=>'E', +'LBL_CONVERTSO_BUTTON_KEY'=>'S', +'LBL_CONVERTINVOICE_BUTTON_KEY'=>'I', + +'LBL_DUPLICATE_BUTTON_KEY'=>'U', + +'LBL_DELETE_BUTTON_KEY'=>'D', + +'LBL_NEW_BUTTON_KEY'=>'N', + +'LBL_CHANGE_BUTTON_KEY'=>'G', + +'LBL_CANCEL_BUTTON_KEY'=>'X', + +'LBL_SEARCH_BUTTON_KEY'=>'Q', + +'LBL_CLEAR_BUTTON_KEY'=>'C', + +'LBL_SELECT_BUTTON_KEY'=>'T', + +'LBL_SAVE_BUTTON_LABEL'=>'Save', + +'LBL_EDIT_BUTTON_LABEL'=>'Edit', +'LBL_CONVERTSO_BUTTON_LABEL'=>'Create SalesOrder', +'LBL_CONVERTINVOICE_BUTTON_LABEL'=>'Create Invoice', + +'LBL_DUPLICATE_BUTTON_LABEL'=>'Duplicate', + +'LBL_DELETE_BUTTON_LABEL'=>'Delete', + +'LBL_NEW_BUTTON_LABEL'=>'New', + +'LBL_CHANGE_BUTTON_LABEL'=>'Change', + +'LBL_CANCEL_BUTTON_LABEL'=>'Cancel', + +'LBL_SEARCH_BUTTON_LABEL'=>'Search', + +'LBL_CLEAR_BUTTON_LABEL'=>'Clear', + +'LBL_SELECT_BUTTON_LABEL'=>'Select', + +'LBL_SELECT_CONTACT_BUTTON_TITLE'=>'Select Contact [Alt+T]', + +'LBL_SELECT_CONTACT_BUTTON_KEY'=>'T', + +'LBL_SELECT_CONTACT_BUTTON_LABEL'=>'Select Contact', + +'LBL_SELECT_CAMPAIGN_BUTTON_LABEL'=>'Select Campaign', + +'LBL_SELECT_USER_BUTTON_TITLE'=>'Select User [Alt+U]', + +'LBL_SELECT_USER_BUTTON_KEY'=>'U', + +'LBL_SELECT_USER_BUTTON_LABEL'=>'Select User', + +'LBL_SETTINGS'=>'Settings', + +'LBL_LIST_USERIP'=>'User IP', + +'LBL_LIST_SIGNIN'=>'Sign in Time', + +'LBL_LIST_SIGNOUT'=>'Sign out Time', + +'LBL_LIST_STATUS'=>'Status', + + + +'LBL_LIST_NAME'=>'Name', + +'LBL_LIST_USER_NAME'=>'User Name', + +'LBL_LIST_EMAIL'=>'Email', + +'LBL_LIST_PHONE'=>'Phone', + +'LBL_LIST_CONTACT_NAME'=>'Contact Name', + +'LBL_LIST_ACCOUNT_NAME'=>'Account Name', + +'LBL_USER_LIST'=>'User List', + +'LBL_CONTACT_LIST'=>'Contact List', + +'LBL_LNK_SETTINGS'=> 'Settings', + +'LNK_IMPORT_LEADS'=>'Import Leads', + +'LBL_LOCATE_MAP'=>'Locate Map', + +'LBL_ADDRESS'=>'Address', + +'LBL_ADD_TAG'=>'Add Tag', + +'LBL_TAG_IT'=>'Tag it', + +'LBL_CLOSE'=>'Close', + +'LNK_ADVANCED_SEARCH'=>'Advanced Search', + +'LNK_BASIC_SEARCH'=>'Basic Search', + +'LNK_EDIT'=>'edit', + +'LNK_REMOVE'=>'rem', + +'LNK_DELETE'=>'del', + +'LNK_LIST_START'=>'Start', + +'LNK_LIST_NEXT'=>'Next', + +'LNK_LIST_PREVIOUS'=>'Previous', + +'LNK_LIST_END'=>'End', + +'LBL_LIST_OF'=>'of', + +'LNK_PRINT'=>'Print', + +'LNK_HELP'=>'Help', + +'LNK_VTDOCS'=>'vtiger Docs', + +'LNK_ABOUT'=>'About', + +'LNK_OUTLOOK'=>'./include/images/outlook_download.gif', + +'LNK_NEW_HDESK'=>'New Ticket', + +'LNK_NEW_PRODUCT'=>'New Product', + +'LNK_NEW_CONTACT'=>'New Contact', + +'LNK_NEW_CAMPAIGN'=>'New Campaign', + +'LNK_NEW_LEAD'=>'New Lead', + +'LNK_NEW_ACCOUNT'=>'New Account', + +'LNK_NEW_OPPORTUNITY'=>'New Potential', + +'LNK_NEW_NOTE'=>'New Note', + +'LNK_NEW_EMAIL'=>'New Email', + +'LNK_NEW_TASK'=>'New Task', + +'LNK_NEW_EVENT'=>'New Event', +'LNK_NEW_QUOTE'=>'New Quote', +'LNK_NEW_PO'=>'New Purchase Order', +'LNK_NEW_SO'=>'New Sales Order', +'LNK_NEW_INVOICE'=>'New Invoice', +'LNK_NEW_VENDOR'=>'New Vendor', +'LNK_NEW_PRICEBOOK'=>'New PriceBook', + + +'NTC_REQUIRED'=>'Indicates required field', + +'LBL_REQUIRED_SYMBOL'=>'*', + +'LBL_CURRENCY_SYMBOL'=>'$', + +'LBL_THOUSANDS_SYMBOL'=>'K', + +'NTC_DATE_FORMAT'=>'(yyyy-mm-dd)', + +'NTC_TIME_FORMAT'=>'(24:00)', + +'NTC_DATE_TIME_FORMAT'=>'(yyyy-mm-dd 24:00)', + +'NTC_DELETE_CONFIRMATION'=>'Are you sure you want to delete this record?', + +'ERR_DELETE_RECORD'=>'A record number must be specified to delete the contact.', + +'ERR_CREATING_TABLE'=>'Error creating table: ', + +'ERR_CREATING_FIELDS'=>'Error filling in additional detail fields: ', + +'ERR_MISSING_REQUIRED_FIELDS'=>'Missing required fields:', + +'ERR_INVALID_EMAIL_ADDRESS'=>'not a valid email address.', + +'ERR_INVALID_DATE_FORMAT'=>'The date format must be: yyyy-mm-dd', + +'ERR_INVALID_MONTH'=>'Please enter a valid month.', + +'ERR_INVALID_DAY'=>'Please enter a valid day.', + +'ERR_INVALID_YEAR'=>'Please enter a valid 4 digit year.', + +'ERR_INVALID_DATE'=>'Please enter a valid date.', + +'ERR_INVALID_HOUR'=>'Please enter a valid hour.', + +'ERR_INVALID_TIME'=>'Please enter a valid time.', + +'NTC_CLICK_BACK'=>'Please click the browser back button and fix the error.', + +'LBL_LIST_ASSIGNED_USER'=>'Assigned To', + +'LBL_ASSIGNED_TO'=>'Assigned To:', + +'LBL_DATE_MODIFIED'=>'Last Modified:', + +'LBL_DATE_ENTERED'=>'Created:', + +'LBL_CURRENT_USER_FILTER'=>'Only my items:', + +'NTC_LOGIN_MESSAGE'=>"Login", + +'LBL_NONE'=>'--None--', + +'LBL_BACK'=>'Back', + +'LBL_IMPORT'=>'Import', + +'LBL_EXPORT'=>'Export', + +'LBL_EXPORT_ALL'=>'Export All', + +'LBL_QUICK_CREATE'=>'Quick Create', + +'Export'=>'Export', +'Import'=>'Import', +'Merge'=>'Merge', +'ConvertLead'=>'ConvertLead', + + +'LBL_SHOW_RESULTS'=>'Show Results in', +'LBL_TOTAL_RECORDS_FOUND'=>'Total Records found :', +'LBL_SEARCH_RESULTS_FOR'=>' -- Search results for ', +'LBL_TAG_SEARCH'=>' -- Tag search for ', +'LBL_NO_DATA'=>'No Data Found', + + +//3.2 release + +'NTC_MERGE_CONFIRMATION'=>'Are you sure you want to merge this record?', + +'LBL_MERGE_BUTTON_TITLE'=>'Merge', + +'LBL_MERGE_BUTTON_KEY'=> 'Merge', + +'LBL_SELECTEMAILTEMPLATE_BUTTON_TITLE'=>'Select Email Template', + +'LBL_SELECTEMAILTEMPLATE_BUTTON_KEY'=>'Select Email Template', + +'LBL_SELECTEMAILTEMPLATE_BUTTON_LABEL'=>'Select Email Template', + +'LBL_MERGE_BUTTON_LABEL'=>'Merge', + +'LBL_SENDMAIL_BUTTON_TITLE'=>'SendMail', + +'LBL_SENDMAIL_BUTTON_KEY'=> 'SendMail', + +'LBL_SENDMAIL_BUTTON_LABEL'=>'Send Mail', + + + +//Added fields for upload file as attachment -- 4 Beta + +'LBL_UPD_DESC'=>'Description', + +'LBL_FILENAME'=>'File Name', + +'LBL_FILE'=>'File', + +'LBL_TYPE'=>'File Type', + +'LBL_DOWNLOAD'=>'Download Now', + +'LBL_OPERATION'=>'Operation', + +'LBL_GROUP_ALLOCATION_TITLE'=>'My Group Allocation ', + +'LBL_ENTITY_NAME'=>'Entity Name', + +'LBL_GROUP_NAME'=>'Group', + +'LBL_ENTITY_TYPE'=>'Type', + + + +//Added fields for Ticket Attachment in RelatedTicketListUtil + +'LBL_NEW_TICKET'=>'New Ticket', + +'LBL_TITLE'=>'Title', + +'LBL_PRIORITY'=>'Priority', + +'LBL_STATUS'=>'Status', + + + +//Added fields for Change Owner and Change Status in all modules -- after 4 Beta + +'LBL_CHANGE_OWNER'=>'Change Owner', + +'LBL_CHANGE_STATUS'=>'Change Status', + +'LBL_MASS_DELETE'=>'Delete', +//added by raju + +'LBL_ADD_ITEM'=>'Add', + +'LBL_ADD_NEW'=>'Add', + +'LBL_DEDUCT'=>'Deduct', +//Added for version 5 + +'LBL_CALENDAR_TITLE'=>'Open Calendar...', +'LBL_CALENDAR_ALT'=>'Open Calendar...', + +'LBL_CALCULATOR_TITLE'=>'Open Calculator...', +'LBL_CALCULATOR_ALT'=>'Open Calculator...', + +'LBL_CLOCK_TITLE'=>'Show World Clock...', +'LBL_CLOCK_ALT'=>'Show World Clock...', + +'LBL_ALL_MENU_TITLE'=>'Open All Menu...', +'LBL_ALL_MENU_ALT'=>'Open All Menu...', + +'LBL_CHAT_TITLE'=>'Chat...', +'LBL_CHAT_ALT'=>'Chat...', + +'LBL_SEARCH_TITLE'=>'Search in ', +'LBL_SEARCH_ALT'=>'Search in ', + +'LBL_SEARCH_STRING'=>'Search...', + +'LBL_SEARCH_FOR'=>'Search for', +'LBL_SEARCH_NOW_BUTTON'=>'Search Now', +'LBL_GO_TO'=>'Go to', +'LBL_FEWER_BUTTON'=>'Fewer', +'LBL_IN'=>'In', + +'LBL_ADV_SEARCH_MSG_ANY'=>'Match Any of the Following', +'LBL_ADV_SEARCH_MSG_ALL'=>'Match All of the Following', + +'COMBO_ALL'=>'All', + +// Added fields for Related Field Display Informations in Detail View of All Modules + +'LBL_OPEN_ACTIVITIES'=>'Open Activities', + +'LBL_HISTORY'=>'History', + +'LBL_ACTIVITY_HISTORY'=>'Activity History', + +'LBL_ATTACHMENTS'=>'Attachments', + +'LBL_ATTACHMENT'=>'Attachment', + +'LBL_TYPE'=>'Type', + +'LBL_ASSIGNED_TO'=>'Assigned To', + +'LBL_TIME'=>'Time', + +'LBL_ACTION'=>'Action', + +'LBL_SUBJECT'=>'Subject', + +'LBL_RELATED_TO'=>'Related To', + +//added by raju for emails + +'LBL_MULTIPLE'=>'Multiple', + +'LBL_DUE_DATE'=>'Due Date', + +'LBL_LAST_MODIFIED'=>'Last Modified', + +'LBL_CREATED'=>'Created', // Armando L?scher 26.09.2005 -> ?visibleDescription -> Desc: Added + +'LBL_DESCRIPTION'=>'Description', + + + +'LBL_NEW_TASK'=>'New Task', + +'LBL_NEW_EVENT'=>'New Event', + +'LBL_ATTACHMENT_AND_NOTES'=>'Attachments & Notes', + +'LBL_POTENTIAL_NAME'=>'Potential Name', + +'LBL_CONTACT_NAME'=>'Contact Name', + +'LBL_DEPARTMENT'=>'Department', + +'LBL_ROLE'=>'Role', + +'LBL_EMAIL'=>'Email', + +'LBL_PHONE'=>'Phone', + +'LBL_PRODUCT'=>'Product', + +'LBL_AMOUNT'=>'Amount', + +'LBL_CLOSE_DATE'=>'Close Date', + +'LBL_NEW_ATTACHMENT'=>'New Attachment', + +'LBL_NEW_NOTE'=>'New Note', + + + +'LBL_PRODUCT_TITLE'=>'Products', + +'LBL_NEW_PRODUCT'=>'New Product', + +'LBL_PRODUCT_NAME'=>'Product Name', + +'LBL_QUANTITY'=>'Quantity', + +'LBL_SALES_PRICE'=>'Sale Price', + +'LBL_PURCHASE_DATE'=>'Purchase Date', + +'LBL_TICKET_ID'=>'Ticket Id', + +'LBL_NEW_TICKET'=>'New Ticket', + +'LBL_TICKETS'=>'Tickets', + + + +'LBL_POTENTIAL_TITLE'=>'Potentials', + +'LBL_NEW_POTENTIAL'=>'New Potential', + +'LBL_LEAD_NAME'=>'Lead Name', + +'LBL_ACCOUNT_NAME'=>'Account Name', + +'LBL_ACCOUNT_TYPE'=>'Account Type', + +'LBL_USER_TITLE'=>'Users', + +'LBL_CONTACT_TITLE'=>'Contacts', + + + +// 4 GA + +'LBL_SHOWING' => 'Showing', + +// + + + +//Added fields after RC1 - Release + +'LBL_SELECT_PRODUCT_BUTTON_LABEL'=>'Select Product', + +'LBL_VIEW'=>'Filters :', +// Mike Crowe Mod --------------------------------------------------------Added for group sort +'LBL_GROUP_VIEW'=>'Group', + + +'LBL_SALES_STAGE'=>'Sales Stage', + +'LBL_PROBABILITY'=>'Probability', + +'LBL_BULK_MAILS'=>'Bulk Mails', + + + +'LBL_WORLD_CLOCK'=>'World Clock', + +'LBL_CALCULATOR'=>'Calculator', + +'LBL_CLOSE_WON' =>'Closed Won', # 'Closed Won' +'LBL_CLOSE_LOST'=>'Closed Lost', # 'Closed Lost' + +'LBL_USER'=>'User', + +'LBL_TEAM'=>'Team', + +'LBL_GROUP'=>'Group', + +'LBL_NONE_NO_LINE'=>'none', + +'LBL_SELECT_GROUP'=>'Select a group', + +'LBL_HOUR_AND_MINUTE'=>'(hours/minutes)', + +'YEAR_MONTH_DATE'=>'24:00', + + + +'COMBO_LEADS'=>'Leads', + +'COMBO_ACCOUNTS'=>'Accounts', + +'COMBO_CONTACTS'=>'Contacts', + +'COMBO_POTENTIALS'=>'Potentials', + +'COMBO_PRODUCTS'=>'Products', + +'COMBO_HELPDESK'=>'Trouble Tickets', + +'COMBO_USERS'=>'Users', + +'COMBO_CAMPAIGNS'=>'Campaigns', + + +'LBL_SELECT'=>'Select', + +'LBL_EDIT'=>'Edit', + +'LBL_DELETE'=>'Delete', + + + +//List Fields + +'Name'=>'Name', + +'Company'=>'Company', + +'Phone'=>'Phone', + +'Website'=>'Website', + +'Email'=>'Email', + +'Assigned To'=>'Assigned To', + +'Account Name'=>'Account Name', + +'City'=>'City', + +'Title'=>'Title', + +'Potential'=>'Potential', + +'Sales Stage'=>'Sales Stage', + +'Amount'=>'Amount', + +'Expected Close'=>'Expected Close', + +'Subject'=>'Subject', + +'Contact Name'=>'Contact Name', + +'Related to'=>'Related To', + +'File'=>'File', + +'Last Modified'=>'Last Modified', + +'Close'=>'Close', + +'Type'=>'Type', + +'Start Date/Due Date'=>'Start Date/Due Date', + +'Date Sent'=>'Date Sent', + +'Ticket ID'=>'Ticket ID', + +'Status'=>'Status', + +'Priority'=>'Priority', + +'Product Name'=>'Product Name', + +'Product Code'=>'Part Number', + +'Commission Rate'=>'Commission Rate', + +'Qty/Unit'=>'Qty/Unit', + +'Unit Price'=>'Unit Price', + +'Question'=>'Question', + +'Category'=>'Category', + +'Price Book Name'=>'Price Book Name', +'LBL_EVENT_ENDDATE'=>'End Date & Time', + +//Added after 4 GA +'LBL_CUSTOM_INFORMATION'=>'Custom Information', + +//Added fields to display the related lists titles and None Scheduled +'LBL_NONE_SCHEDULED'=>'None Scheduled', + +'Leads'=>'Leads', +'Accounts'=>'Accounts', +'Accounts & Contacts'=>'Accounts & Contacts', +'Contacts'=>'Contacts', +'Potentials'=>'Potentials', +'Products'=>'Products', +'Emails'=>'Emails', +'HelpDesk'=>'Trouble Tickets', +'Activities'=>'Activities', +'Events'=>'Events', +'Tasks'=>'Tasks', +'Todo'=>'To Do', +'Call'=>'Call', +'Meeting'=>'Meeting', +'Quotes'=>'Quotes', +'PriceBook'=>'Price Books', +'PurchaseOrder'=>'Purchase Order', +'SalesOrder'=>'Sales Order', +'Invoice'=>'Invoices', +'Calendar'=>'Calendar', +'Home'=>'Home', +'Campaigns'=>'Campaigns', +'Organization'=>'Organization', +'Organization Name'=>'Organization Name', +'OrgUnit'=>'Org Unit', +'PriceBooks'=>'Price Books', +'Notes'=>'Notes', +'Faq'=>'FAQ', +'Dashboards'=>'Dashboard', +'Reports'=>'Reports', +'Vendors'=>'Vendors', +'Rss'=>'RSS', +'Portal'=>'My Sites', +'Webmails'=>'Webmails', +'Attachments'=>'Attachments', +'Activity History'=>'Activity History', +'Ticket History'=>'Ticket History', +'Purchase Order'=>'Purchase Order', +'Sales Stage History'=>'Sales Stage History', +'Users'=>'Users', +'Admin'=>'Admin', +'PurchaseOrder Status History'=>'PurchaseOrder Status History', +'SalesOrder Status History'=>'SalesOrder Status History', +'Quote Stage History'=>'Quote Stage History', +'Invoice Status History'=>'Invoice Status History', +'LBL_TROUBLE_TICKET'=>'Trouble Ticket', + +//Added language for Parent Tab + +'My Home Page'=>'My Home Page', +'Marketing'=>'Marketing', +'Sales'=>'Sales', +'Support'=>'Support', +'Analytics'=>'Analytics', +'Inventory'=>'Inventory', +'Tools'=>'Tools', +'Settings'=>'Settings', + +'LBL_INFORMATION'=>'Information', +'LBL_MORE'=>'More', +'LBL_BASIC'=>'Basic', +'LBL_CREATING'=>'Creating', +'LBL_EDITING'=>'Editing', +'LBL_NEW'=>'New', + +//Added for Detail/Edit/Related List of all modules + +'Lead'=>'Lead', +'Account'=>'Account', +'Contact'=>'Contact', +'Potential'=>'Potential', +'Opportunity'=>'Potential', +'Product'=>'Product', +'Email'=>'Email', +'Activity'=>'Activity', +'Event'=>'Event', +'Task'=>'Task', +'Quote'=>'Quote', +'PriceBook'=>'PriceBook', +'PurchaseOrder'=>'Purchase Order', +'Ticket'=>'Ticket', +'SalesOrder'=>'Sales Orders', +'Campaign'=>'Campaign', +'Note'=>'Note', +'Dashboard'=>'Dashboards', +'Report'=>'Report', +'Vendor'=>'Vendor', +'Webmail'=>'Webmail', + +'LBL_NONE_INCLUDED'=>'None Included', +'LBL_ADD_TO'=>'Add to', + +'LBL_SELECT_TEMPLATE_TO_MAIL_MERGE'=>'Select template to Mail Merge:', +'LBL_TITLE_OR_DESCRIPTION'=>'Title / Description', + +//Added for RSS Module +'LBL_RSS_FEEDS'=>'RSS Feeds', +'LBL_ADD_RSS_FEEDS'=>'Add New RSS Feed', + +//Added fields after 4.2 alpha +'COMBO_ACCOUNTS'=>'Accounts', +'LNK_NEW_FAQ'=>'New FAQ', +'Vendor Name'=>'Vendor Name', +'LNK_WEARE'=>'About us', +'LBL_ABOUTUS_TITLE'=>'vtiger CRM - About Us', +'LBL_DISCUSS'=>'Discuss with other users', +'Quote Stage'=>'Quote Stage', +'Potential Name'=>'Potential Name', +'Total'=>'Total Amount', +'First Name'=>'First Name', +'Last Name'=>'Last Name', +'User Name'=>'User Name', + /* For purchase order related list in vendor */ +'LBL_PORDER_BUTTON_TITLE'=>'New Purchase Order [Alt+O]', +'LBL_PORDER_BUTTON'=>'New Purchase Order', +'LBL_PORDER_BUTTON_KEY'=>'O', +'Tracking Number'=>'Tracking Number', +'Order Id'=>'Order Id', +'Quote Name'=>'Quote Name', +'Invoice Id'=>'Invoice Id', +'Quote Id'=>'Quote Id', +'Sales Order'=>'Sales Order', + // Added Quote in activity parent type selection / Related list +'COMBO_QUOTES'=>'Quotes', +'End Date'=>'End Date', +'Start Date'=>'Start Date', +'Related to'=>'Related To', +'Recurring Type'=> 'Recurring Type', +'SalesOrders'=> 'Sales Order', +'PurchaseOrder'=> 'Purchase Orders', +'LBL_QUOTE_NAME'=>'Quote Name', + //Added Orders in activity parent type selection / Related list +'LBL_NEW_QUOTE_BUTTON_TITLE'=>'New Quote [Alt+Q]', +'LBL_NEW_QUOTE_BUTTON_KEY'=>'Q', +'LBL_NEW_QUOTE_BUTTON'=>'New Quote', +'COMBO_PORDER'=>'Purchase Order', +'COMBO_SORDER'=>'Sales Order', +'LBL_PORDER_NAME'=>'Purchase Order', +'LBL_SORDER_NAME'=>'Sales Order', + // Added Invoice in activity parent type selection / Related list +'COMBO_INVOICES'=>'Invoice', +'LBL_INVOICE_NAME'=>'Invoice', +'LBL_HELPDESK_NAME'=>'Trouble Ticket', +'LBL_CAMPAIGN_NAME'=>'Campaign Name', + +'LBL_NEW_INVOICE_BUTTON_TITLE'=>'New Invoice [Alt+I]', +'LBL_NEW_INVOICE_BUTTON_KEY'=>'I', +'LBL_NEW_INVOICE_BUTTON'=>'New Invoice', +'LBL_NEW_SORDER_BUTTON_TITLE'=>'New Sales Order [Alt+E]', +'LBL_NEW_SORDER_BUTTON_KEY'=>'E', +'LBL_NEW_SORDER_BUTTON'=>'New Sales Order', + +'LBL_PRODUCT_DETAILS'=>'Product Details', +'LBL_PRODUCT'=>'Product', +'LBL_QTY_IN_STOCK'=>'Qty In Stock', +'LBL_QTY'=>'Qty', +'LBL_UNIT_PRICE'=>'Unit Price', +'LBL_LIST_PRICE'=>'List Price', +'LBL_TOTAL'=>'Total', +'LBL_ADD_PRODUCT'=>'Add Product', +'LBL_SUB_TOTAL'=>'Sub Total', +'LBL_TAX'=>'Tax', +'LBL_ADJUSTMENT'=>'Adjustment', +'LBL_GRAND_TOTAL'=>'Grand Total', +'LBL_QUOTE_ID'=>'Quote Id', +'LBL_SALES_ORDER_ID'=>'Sales Order Id', +'LBL_PURCHASE_ORDER_ID'=>'Purchase Order Id', +'LBL_EXPORT_TO_PDF'=>'Export To PDF', + +//Added for 4.2 Patch I +'LBL_HOME_KEY_METRICS'=>'Key Metrics', +'LBL_HOME_METRICS'=>'Metrics', +'LBL_HOME_COUNT'=>'Count', + +//Added for 4.2 patch 2 +'LBL_JSCALENDAR_LANG'=>'en', +'LNK_CV_EDIT'=>'Edit', +'LNK_CV_DELETE'=>'Delete', +'LNK_CV_CREATEVIEW'=>'New', +//Added for 5.0 +'LBL_UPD_FIELD_ORD'=>'Update Field Order', +'LBL_SEND_CUSTOM_MAIL_BUTTON'=>'Send Custom Mail', +'LBL_UPDATED_TODAY'=>'Updated today', +'LBL_UPDATED'=>'Updated', +'LBL_DAY_AGO'=>'day ago', +'LBL_DAYS_AGO'=>'days ago', + +//Added to convert Month string in update info - ahmed + +'Jan'=>'Jan', +'Feb'=>'Feb', +'Mar'=>'Mar', +'Apr'=>'Apr', +'May'=>'May', +'Jun'=>'Jun', +'Jul'=>'Jul', +'Aug'=>'Aug', +'Sep'=>'Sep', +'Oct'=>'Oct', +'Nov'=>'Nov', +'Dec'=>'Dec', + +//Added after 5.0 Alpha5 +'Campaign Name'=>'Campaign Name', +'Campaign Type'=>'Campaign Type', +'Campaign Status'=>'Campaign Status', +'Expected Revenue'=>'Expected Revenue', +'Expected Close Date'=>'Expected Close Date', +'LBL_ACTIONS'=>'Actions', +'LBL_SEND'=>'Send', +'LBL_VAT'=>'VAT', +'LBL_SALES'=>'Sales', +'LBL_SERVICE'=>'Service', +'LBL_TAX_DETAILS'=>'Tax Details', +'LBL_TAX_CALCULATION'=>'Tax Calculation', +'COVERED_PERCENTAGE'=>'(%)', + +'LBL_TAG_CLOUD'=>'Tag Cloud', +'LBL_FOR'=>'for', +'LBL_PO_STATUS'=>'PurchaseOrder Status', +'LBL_SO_STATUS'=>'SalesOrder Status', +'LBL_INVOICE_STATUS'=>'Invoice Status', +'LBL_NOTE'=>'Note', +'LBL_MODULE'=>'Module', +'Active'=>'Active', +'Inactive'=>'Inactive', +'Today'=>'Today', +'Last 2 Days'=>'Last 2 Days', +'Last Week'=>'Last Week', +'This Week'=>'This Week', +'This Month'=>'This Month', +'This Year'=>'This Year', +'LBL_PLEASE_CLICK'=>'Please Click', +'LBL_TO_CONFIGURE'=>'to Configure', +'LBL_HERE'=>'here', +'LBL_RECORDS'=>'Records', +'LBL_SCROLL'=>'[Scroll to Top]', +'LBL_EXPAND_COLLAPSE'=>'Expand/Collapse', +'LBL_RCPY_ADDRESS'=>'Copy Shipping address', +'LBL_LCPY_ADDRESS'=>'Copy Billing address', +'LBL_RECORD_ID'=>'Record ID', +'LBL_ACTION_DATE'=>'Action Date', +'LBL_HOMEPAGE_DASHBOARD'=>'HomePage Dashboard', +'LBL_NO'=>'No', +'LBL_FOUND'=>'Found', +'LBL_YOU_CAN_CREATE'=>'You can Create', +'LBL_NOW'=>'now', +'LBL_CLICK_THE_LINK'=>'Click the link below', +'LBL_CREATE'=>'Create', +'LBL_A'=>'a', +'LBL_AN'=>'an', +'LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE'=>'You are not allowed to create', +'LBL_TRANSFER_OWNERSHIP'=>'Transfer Ownership to', +'LBL_SELECT_STATUS'=>'Select New Status', +'LBL_UPDATE_OWNER'=>'Update Owner', +'LBL_UPDATE_STATUS'=>'Update Status', + +//added for tax calculations - after 5beta2 +'LBL_NET_PRICE'=>'Net Price', +'LBL_TOOLS'=>'Tools', +'LBL_DISCOUNT'=>'Discount', +'LBL_TOTAL_AFTER_DISCOUNT'=>'Total After Discount', +'LBL_NET_TOTAL'=>'Net Total', +'LBL_SHIPPING_AND_HANDLING_CHARGES'=>'Shipping & Handling Charges', +'LBL_TAX_FOR_SHIPPING_AND_HANDLING'=>'Taxes For Shipping and Handling', +'LBL_FINISH'=>'Finish', +'LBL_IMAGE_DELETED'=>'Image Deleted', +'LBL_TAX_MODE'=>'Tax Mode', +'LBL_CLEAR_COMMENT'=>'Clear Comment', +'LBL_ZERO_DISCOUNT'=>'Zero Discount', +'LBL_OF_PRICE'=>'of Price', +'LBL_DIRECT_PRICE_REDUCTION'=>'Direct Price Reduction', +'LBL_INDIVIDUAL'=>'Individual', + +//Added the address strings for Contacts Module +'LBL_CPY_MAILING_ADDRESS'=>'Copy Mailing Address', +'LBL_CPY_OTHER_ADDRESS'=>'Copy Other Address', + +'LBL_PERMISSION'=>'You are not permitted to execute this Operation', +'VTIGER'=>'vtiger', + +//Added for Inventory Tax details +'LBL_DIRECT_AMOUNT_DISCOUNT'=>'Direct Amount Discount', +'LBL_NO_DISCOUNT_FOR_THIS_PRODUCT'=>'No Discount for this Product', +'LBL_TOTAL_TAX_AMOUNT'=>'Total Tax Amount', +'LBL_FINAL_DISCOUNT_AMOUNT'=>'Final Discount Amount', +'LBL_SHIPPING_AND_HANDLING_CHARGE'=>'Shipping & Handling Charge', +'LBL_GO_BACK'=>'Go Back', + +//Record deleted message +'LBL_RECORD_DELETE'=>'The record you are trying to view has been deleted.', +'Part Number'=>'Part Number', + +//Added after 5.0.1 +'Salutation'=>'Salutation ', +'Rating'=>'Rating', +'industry'=>'Industry', +'Severity'=>'Severity', +'Product Category'=>'Product Category', +'GL Account'=>'GL Account', +'Usage Unit'=>'Usage Unit', +'Carrier'=>'Carrier', +'Expected Response'=>'Expected Response', +'LBL_ADDRESS_INF'=>'Address Information', + +'yes'=>'yes', +'LBL_RENAMEPROFILE_BUTTON_LABEL'=>'Rename', +'LBL_RENAME_PROFILE'=>'Rename Profile', +'LBL_PROFILE_NAME'=>'Profile Name', +'LBL_START_DATE'=>'Start Date', +'LBL_END_DATE'=>'End Date', + +); + + + +//the left value is the key stored in the db and the right value is the display value + +//to translate, only modify the right value in each key/value pair + +$app_list_strings = Array( + +//e.g. auf Deutsch 'Contacts'=>'Contakten', + +'moduleList' => Array('Home'=>'Home' + + , 'Dashboard'=>'Dashboard' + + , 'Leads'=>'Leads' + + , 'Contacts'=>'Contacts' + + , 'Accounts'=>'Accounts' + + , 'Potentials'=>'Potentials' + + , 'Campaigns'=>'Campaigns' + + , 'Notes'=>'Notes' + + , 'Emails'=>'Emails' + + , 'Activities'=>'Activities' + + , 'Products'=>'Products' + + , 'HelpDesk'=>'Trouble Tickets' + + , 'Faq'=>'FAQ' + + , 'Calendar'=>'Calendar' + + , 'Quotes'=>'Quotes' + + , 'PurchaseOrder'=>'PurchaseOrder' + + , 'Invoice'=>'Invoice' + + , 'Rss'=>'RSS' + + , 'Reports'=>'Reports' + + , 'Vendors'=>'Vendors' + + , 'PriceBooks'=>'PriceBooks' + + , 'SalesOrder'=>'SalesOrder' + + , 'Portal'=>'My Sites' + + ), + + + +//Note: do not translate opportunity_relationship_type_default_key + +// it is the key for the default opportunity_relationship_type_dom value + +'opportunity_relationship_type_default_key' => 'Primary Decision Maker', + +'opportunity_relationship_type_dom' => Array(''=>'' + + , 'Primary Decision Maker'=>'Primary Decision Maker' + + , 'Business Decision Maker'=>'Business Decision Maker' + + , 'Business Evaluator'=>'Business Evaluator' + + , 'Technical Decision Maker'=>'Technical Decision Maker' + + , 'Technical Evaluator'=>'Technical Evaluator' + + , 'Executive Sponsor'=>'Executive Sponsor' + + , 'Influencer'=>'Influencer' + + , 'Other'=>'Other' + + ), + + + +//Note: do not translate case_relationship_type_default_key + +// it is the key for the default case_relationship_type_dom value + +'case_relationship_type_default_key' => 'Primary Contact', + +'case_relationship_type_dom' => Array(''=>'' + + , 'Primary Contact'=>'Primary Contact' + + , 'Alternate Contact'=>'Alternate Contact' + + ), + + + +'task_priority_dom' => Array('High'=>'High' + + , 'Medium'=>'Medium' + + , 'Low'=>'Low' + + ), + + + +'task_status_dom' => Array('Planned'=>'Planned' + + , 'Completed'=>'Completed' + + , 'Deferred'=>'Deferred' + + ), + + + +'meeting_status_dom' => Array('Planned'=>'Planned' + + , 'Held'=>'Held' + + , 'Not Held'=>'Not Held' + + ), + + + +'call_status_dom' => Array('Planned'=>'Planned' + + , 'Held'=>'Held' + + , 'Not Held'=>'Not Held' + + ), + + + +//Note: do not translate case_status_default_key + +// it is the key for the default case_status_dom value + +'case_status_default_key' => 'New', + +'case_status_dom' => Array('New'=>'New' + + , 'Assigned'=>'Assigned' + + , 'Closed'=>'Closed' + + , 'Pending Input'=>'Pending Input' + + , 'Rejected'=>'Rejected' + + ), + + + +'user_status_dom' => Array('Active'=>'Active' + + , 'Inactive'=>'Inactive' + + ), + + + +//Note: do not translate record_type_default_key + +// it is the key for the default record_type_module value + +'record_type_default_key' => 'Accounts', + +'record_type_display' => array('Accounts' => 'Account', + + 'Leads' => 'Lead', + + 'Opportunities' => 'Opportunity'), + +); + + + +?> Modified: vtigercrm/branches/5.1_jens/include/nusoap/class.soap_transport_http.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/nusoap/class.soap_transport_http.php (original) +++ vtigercrm/branches/5.1_jens/include/nusoap/class.soap_transport_http.php Tue Nov 14 03:16:10 2006 @@ -1,1038 +1,1038 @@ - -* @version $Id: class.soap_transport_http.php,v 1.57 2005/07/27 19:24:42 snichol Exp $ -* @access public -*/ -class soap_transport_http extends nusoap_base { - - var $url = ''; - var $uri = ''; - var $digest_uri = ''; - var $scheme = ''; - var $host = ''; - var $port = ''; - var $path = ''; - var $request_method = 'POST'; - var $protocol_version = '1.0'; - var $encoding = ''; - var $outgoing_headers = array(); - var $incoming_headers = array(); - var $incoming_cookies = array(); - var $outgoing_payload = ''; - var $incoming_payload = ''; - var $useSOAPAction = true; - var $persistentConnection = false; - var $ch = false; // cURL handle - var $username = ''; - var $password = ''; - var $authtype = ''; - var $digestRequest = array(); - var $certRequest = array(); // keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional) - // cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem' - // sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem' - // sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem' - // passphrase: SSL key password/passphrase - // verifypeer: default is 1 - // verifyhost: default is 1 - - /** - * constructor - */ - function soap_transport_http($url){ - parent::nusoap_base(); - $this->setURL($url); - ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev); - $this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')'; - $this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']); - } - - function setURL($url) { - $this->url = $url; - - $u = parse_url($url); - foreach($u as $k => $v){ - $this->debug("$k = $v"); - $this->$k = $v; - } - - // add any GET params to path - if(isset($u['query']) && $u['query'] != ''){ - $this->path .= '?' . $u['query']; - } - - // set default port - if(!isset($u['port'])){ - if($u['scheme'] == 'https'){ - $this->port = 443; - } else { - $this->port = 80; - } - } - - $this->uri = $this->path; - $this->digest_uri = $this->uri; - - // build headers - if (!isset($u['port'])) { - $this->outgoing_headers['Host'] = $this->host; - } else { - $this->outgoing_headers['Host'] = $this->host.':'.$this->port; - } - $this->debug('set Host: ' . $this->outgoing_headers['Host']); - - if (isset($u['user']) && $u['user'] != '') { - $this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : ''); - } - } - - function connect($connection_timeout=0,$response_timeout=30){ - // For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like - // "regular" socket. - // TODO: disabled for now because OpenSSL must be *compiled* in (not just - // loaded), and until PHP5 stream_get_wrappers is not available. -// if ($this->scheme == 'https') { -// if (version_compare(phpversion(), '4.3.0') >= 0) { -// if (extension_loaded('openssl')) { -// $this->scheme = 'ssl'; -// $this->debug('Using SSL over OpenSSL'); -// } -// } -// } - $this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port"); - if ($this->scheme == 'http' || $this->scheme == 'ssl') { - // use persistent connection - if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){ - if (!feof($this->fp)) { - $this->debug('Re-use persistent connection'); - return true; - } - fclose($this->fp); - $this->debug('Closed persistent connection at EOF'); - } - - // munge host if using OpenSSL - if ($this->scheme == 'ssl') { - $host = 'ssl://' . $this->host; - } else { - $host = $this->host; - } - $this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout); - - // open socket - if($connection_timeout > 0){ - $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout); - } else { - $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str); - } - - // test pointer - if(!$this->fp) { - $msg = 'Couldn\'t open socket connection to server ' . $this->url; - if ($this->errno) { - $msg .= ', Error ('.$this->errno.'): '.$this->error_str; - } else { - $msg .= ' prior to connect(). This is often a problem looking up the host name.'; - } - $this->debug($msg); - $this->setError($msg); - return false; - } - - // set response timeout - $this->debug('set response timeout to ' . $response_timeout); - socket_set_timeout( $this->fp, $response_timeout); - - $this->debug('socket connected'); - return true; - } else if ($this->scheme == 'https') { - if (!extension_loaded('curl')) { - $this->setError('CURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS'); - return false; - } - $this->debug('connect using https'); - // init CURL - $this->ch = curl_init(); - // set url - $hostURL = ($this->port != '') ? "https://$this->host:$this->port" : "https://$this->host"; - // add path - $hostURL .= $this->path; - curl_setopt($this->ch, CURLOPT_URL, $hostURL); - // follow location headers (re-directs) - curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1); - // ask for headers in the response output - curl_setopt($this->ch, CURLOPT_HEADER, 1); - // ask for the response output as the return value - curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); - // encode - // We manage this ourselves through headers and encoding -// if(function_exists('gzuncompress')){ -// curl_setopt($this->ch, CURLOPT_ENCODING, 'deflate'); -// } - // persistent connection - if ($this->persistentConnection) { - // The way we send data, we cannot use persistent connections, since - // there will be some "junk" at the end of our request. - //curl_setopt($this->ch, CURL_HTTP_VERSION_1_1, true); - $this->persistentConnection = false; - $this->outgoing_headers['Connection'] = 'close'; - $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); - } - // set timeout - if ($connection_timeout != 0) { - curl_setopt($this->ch, CURLOPT_TIMEOUT, $connection_timeout); - } - // TODO: cURL has added a connection timeout separate from the response timeout - //if ($connection_timeout != 0) { - // curl_setopt($this->ch, CURLOPT_CONNECTIONTIMEOUT, $connection_timeout); - //} - //if ($response_timeout != 0) { - // curl_setopt($this->ch, CURLOPT_TIMEOUT, $response_timeout); - //} - - // recent versions of cURL turn on peer/host checking by default, - // while PHP binaries are not compiled with a default location for the - // CA cert bundle, so disable peer/host checking. -//curl_setopt($this->ch, CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt'); - curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0); - - // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo) - if ($this->authtype == 'certificate') { - if (isset($this->certRequest['cainfofile'])) { - curl_setopt($this->ch, CURLOPT_CAINFO, $this->certRequest['cainfofile']); - } - if (isset($this->certRequest['verifypeer'])) { - curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']); - } else { - curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 1); - } - if (isset($this->certRequest['verifyhost'])) { - curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']); - } else { - curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 1); - } - if (isset($this->certRequest['sslcertfile'])) { - curl_setopt($this->ch, CURLOPT_SSLCERT, $this->certRequest['sslcertfile']); - } - if (isset($this->certRequest['sslkeyfile'])) { - curl_setopt($this->ch, CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']); - } - if (isset($this->certRequest['passphrase'])) { - curl_setopt($this->ch, CURLOPT_SSLKEYPASSWD , $this->certRequest['passphrase']); - } - } - $this->debug('cURL connection set up'); - return true; - } else { - $this->setError('Unknown scheme ' . $this->scheme); - $this->debug('Unknown scheme ' . $this->scheme); - return false; - } - } - - /** - * send the SOAP message via HTTP - * - * @param string $data message data - * @param integer $timeout set connection timeout in seconds - * @param integer $response_timeout set response timeout in seconds - * @param array $cookies cookies to send - * @return string data - * @access public - */ - function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) { - - $this->debug('entered send() with data of length: '.strlen($data)); - - $this->tryagain = true; - $tries = 0; - while ($this->tryagain) { - $this->tryagain = false; - if ($tries++ < 2) { - // make connnection - if (!$this->connect($timeout, $response_timeout)){ - return false; - } - - // send request - if (!$this->sendRequest($data, $cookies)){ - return false; - } - - // get response - $respdata = $this->getResponse(); - } else { - $this->setError('Too many tries to get an OK response'); - } - } - $this->debug('end of send()'); - return $respdata; - } - - - /** - * send the SOAP message via HTTPS 1.0 using CURL - * - * @param string $msg message data - * @param integer $timeout set connection timeout in seconds - * @param integer $response_timeout set response timeout in seconds - * @param array $cookies cookies to send - * @return string data - * @access public - */ - function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) { - return $this->send($data, $timeout, $response_timeout, $cookies); - } - - /** - * if authenticating, set user credentials here - * - * @param string $username - * @param string $password - * @param string $authtype (basic, digest, certificate) - * @param array $digestRequest (keys must be nonce, nc, realm, qop) - * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) - * @access public - */ - function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) { - $this->debug("Set credentials for authtype $authtype"); - // cf. RFC 2617 - if ($authtype == 'basic') { - $this->outgoing_headers['Authorization'] = 'Basic '.base64_encode(str_replace(':','',$username).':'.$password); - } elseif ($authtype == 'digest') { - if (isset($digestRequest['nonce'])) { - $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1; - - // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html) - - // A1 = unq(username-value) ":" unq(realm-value) ":" passwd - $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password; - - // H(A1) = MD5(A1) - $HA1 = md5($A1); - - // A2 = Method ":" digest-uri-value - $A2 = 'POST:' . $this->digest_uri; - - // H(A2) - $HA2 = md5($A2); - - // KD(secret, data) = H(concat(secret, ":", data)) - // if qop == auth: - // request-digest = <"> < KD ( H(A1), unq(nonce-value) - // ":" nc-value - // ":" unq(cnonce-value) - // ":" unq(qop-value) - // ":" H(A2) - // ) <"> - // if qop is missing, - // request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <"> - - $unhashedDigest = ''; - $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : ''; - $cnonce = $nonce; - if ($digestRequest['qop'] != '') { - $unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2; - } else { - $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2; - } - - $hashedDigest = md5($unhashedDigest); - - $this->outgoing_headers['Authorization'] = 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"'; - } - } elseif ($authtype == 'certificate') { - $this->certRequest = $certRequest; - } - $this->username = $username; - $this->password = $password; - $this->authtype = $authtype; - $this->digestRequest = $digestRequest; - - if (isset($this->outgoing_headers['Authorization'])) { - $this->debug('set Authorization: ' . substr($this->outgoing_headers['Authorization'], 0, 12) . '...'); - } else { - $this->debug('Authorization header not set'); - } - } - - /** - * set the soapaction value - * - * @param string $soapaction - * @access public - */ - function setSOAPAction($soapaction) { - $this->outgoing_headers['SOAPAction'] = '"' . $soapaction . '"'; - $this->debug('set SOAPAction: ' . $this->outgoing_headers['SOAPAction']); - } - - /** - * use http encoding - * - * @param string $enc encoding style. supported values: gzip, deflate, or both - * @access public - */ - function setEncoding($enc='gzip, deflate') { - if (function_exists('gzdeflate')) { - $this->protocol_version = '1.1'; - $this->outgoing_headers['Accept-Encoding'] = $enc; - $this->debug('set Accept-Encoding: ' . $this->outgoing_headers['Accept-Encoding']); - if (!isset($this->outgoing_headers['Connection'])) { - $this->outgoing_headers['Connection'] = 'close'; - $this->persistentConnection = false; - $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); - } - set_magic_quotes_runtime(0); - // deprecated - $this->encoding = $enc; - } - } - - /** - * set proxy info here - * - * @param string $proxyhost - * @param string $proxyport - * @param string $proxyusername - * @param string $proxypassword - * @access public - */ - function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') { - $this->uri = $this->url; - $this->host = $proxyhost; - $this->port = $proxyport; - if ($proxyusername != '' && $proxypassword != '') { - $this->outgoing_headers['Proxy-Authorization'] = ' Basic '.base64_encode($proxyusername.':'.$proxypassword); - $this->debug('set Proxy-Authorization: ' . $this->outgoing_headers['Proxy-Authorization']); - } - } - - /** - * decode a string that is encoded w/ "chunked' transfer encoding - * as defined in RFC2068 19.4.6 - * - * @param string $buffer - * @param string $lb - * @returns string - * @access public - * @deprecated - */ - function decodeChunked($buffer, $lb){ - // length := 0 - $length = 0; - $new = ''; - - // read chunk-size, chunk-extension (if any) and CRLF - // get the position of the linebreak - $chunkend = strpos($buffer, $lb); - if ($chunkend == FALSE) { - $this->debug('no linebreak found in decodeChunked'); - return $new; - } - $temp = substr($buffer,0,$chunkend); - $chunk_size = hexdec( trim($temp) ); - $chunkstart = $chunkend + strlen($lb); - // while (chunk-size > 0) { - while ($chunk_size > 0) { - $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size"); - $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size); - - // Just in case we got a broken connection - if ($chunkend == FALSE) { - $chunk = substr($buffer,$chunkstart); - // append chunk-data to entity-body - $new .= $chunk; - $length += strlen($chunk); - break; - } - - // read chunk-data and CRLF - $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); - // append chunk-data to entity-body - $new .= $chunk; - // length := length + chunk-size - $length += strlen($chunk); - // read chunk-size and CRLF - $chunkstart = $chunkend + strlen($lb); - - $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb); - if ($chunkend == FALSE) { - break; //Just in case we got a broken connection - } - $temp = substr($buffer,$chunkstart,$chunkend-$chunkstart); - $chunk_size = hexdec( trim($temp) ); - $chunkstart = $chunkend; - } - return $new; - } - - /* - * Writes payload, including HTTP headers, to $this->outgoing_payload. - */ - function buildPayload($data, $cookie_str = '') { - // add content-length header - $this->outgoing_headers['Content-Length'] = strlen($data); - $this->debug('set Content-Length: ' . $this->outgoing_headers['Content-Length']); - - // start building outgoing payload: - $req = "$this->request_method $this->uri HTTP/$this->protocol_version"; - $this->debug("HTTP request: $req"); - $this->outgoing_payload = "$req\r\n"; - - // loop thru headers, serializing - foreach($this->outgoing_headers as $k => $v){ - $hdr = $k.': '.$v; - $this->debug("HTTP header: $hdr"); - $this->outgoing_payload .= "$hdr\r\n"; - } - - // add any cookies - if ($cookie_str != '') { - $hdr = 'Cookie: '.$cookie_str; - $this->debug("HTTP header: $hdr"); - $this->outgoing_payload .= "$hdr\r\n"; - } - - // header/body separator - $this->outgoing_payload .= "\r\n"; - - // add data - $this->outgoing_payload .= $data; - } - - function sendRequest($data, $cookies = NULL) { - // build cookie string - $cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https'))); - - // build payload - $this->buildPayload($data, $cookie_str); - - if ($this->scheme == 'http' || $this->scheme == 'ssl') { - // send payload - if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) { - $this->setError('couldn\'t write message data to socket'); - $this->debug('couldn\'t write message data to socket'); - return false; - } - $this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload)); - return true; - } else if ($this->scheme == 'https') { - // set payload - // TODO: cURL does say this should only be the verb, and in fact it - // turns out that the URI and HTTP version are appended to this, which - // some servers refuse to work with - //curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $this->outgoing_payload); - foreach($this->outgoing_headers as $k => $v){ - $curl_headers[] = "$k: $v"; - } - if ($cookie_str != '') { - $curl_headers[] = 'Cookie: ' . $cookie_str; - } - curl_setopt($this->ch, CURLOPT_HTTPHEADER, $curl_headers); - if ($this->request_method == "POST") { - curl_setopt($this->ch, CURLOPT_POST, 1); - curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data); - } else { - } - $this->debug('set cURL payload'); - return true; - } - } - - function getResponse(){ - $this->incoming_payload = ''; - - if ($this->scheme == 'http' || $this->scheme == 'ssl') { - // loop until headers have been retrieved - $data = ''; - while (!isset($lb)){ - - // We might EOF during header read. - if(feof($this->fp)) { - $this->incoming_payload = $data; - $this->debug('found no headers before EOF after length ' . strlen($data)); - $this->debug("received before EOF:\n" . $data); - $this->setError('server failed to send headers'); - return false; - } - - $tmp = fgets($this->fp, 256); - $tmplen = strlen($tmp); - $this->debug("read line of $tmplen bytes: " . trim($tmp)); - - if ($tmplen == 0) { - $this->incoming_payload = $data; - $this->debug('socket read of headers timed out after length ' . strlen($data)); - $this->debug("read before timeout: " . $data); - $this->setError('socket read of headers timed out'); - return false; - } - - $data .= $tmp; - $pos = strpos($data,"\r\n\r\n"); - if($pos > 1){ - $lb = "\r\n"; - } else { - $pos = strpos($data,"\n\n"); - if($pos > 1){ - $lb = "\n"; - } - } - // remove 100 header - if(isset($lb) && ereg('^HTTP/1.1 100',$data)){ - unset($lb); - $data = ''; - }// - } - // store header data - $this->incoming_payload .= $data; - $this->debug('found end of headers after length ' . strlen($data)); - // process headers - $header_data = trim(substr($data,0,$pos)); - $header_array = explode($lb,$header_data); - $this->incoming_headers = array(); - $this->incoming_cookies = array(); - foreach($header_array as $header_line){ - $arr = explode(':',$header_line, 2); - if(count($arr) > 1){ - $header_name = strtolower(trim($arr[0])); - $this->incoming_headers[$header_name] = trim($arr[1]); - if ($header_name == 'set-cookie') { - // TODO: allow multiple cookies from parseCookie - $cookie = $this->parseCookie(trim($arr[1])); - if ($cookie) { - $this->incoming_cookies[] = $cookie; - $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); - } else { - $this->debug('did not find cookie in ' . trim($arr[1])); - } - } - } else if (isset($header_name)) { - // append continuation line to previous header - $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; - } - } - - // loop until msg has been received - if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') { - $content_length = 2147483647; // ignore any content-length header - $chunked = true; - $this->debug("want to read chunked content"); - } elseif (isset($this->incoming_headers['content-length'])) { - $content_length = $this->incoming_headers['content-length']; - $chunked = false; - $this->debug("want to read content of length $content_length"); - } else { - $content_length = 2147483647; - $chunked = false; - $this->debug("want to read content to EOF"); - } - $data = ''; - do { - if ($chunked) { - $tmp = fgets($this->fp, 256); - $tmplen = strlen($tmp); - $this->debug("read chunk line of $tmplen bytes"); - if ($tmplen == 0) { - $this->incoming_payload = $data; - $this->debug('socket read of chunk length timed out after length ' . strlen($data)); - $this->debug("read before timeout:\n" . $data); - $this->setError('socket read of chunk length timed out'); - return false; - } - $content_length = hexdec(trim($tmp)); - $this->debug("chunk length $content_length"); - } - $strlen = 0; - while (($strlen < $content_length) && (!feof($this->fp))) { - $readlen = min(8192, $content_length - $strlen); - $tmp = fread($this->fp, $readlen); - $tmplen = strlen($tmp); - $this->debug("read buffer of $tmplen bytes"); - if (($tmplen == 0) && (!feof($this->fp))) { - $this->incoming_payload = $data; - $this->debug('socket read of body timed out after length ' . strlen($data)); - $this->debug("read before timeout:\n" . $data); - $this->setError('socket read of body timed out'); - return false; - } - $strlen += $tmplen; - $data .= $tmp; - } - if ($chunked && ($content_length > 0)) { - $tmp = fgets($this->fp, 256); - $tmplen = strlen($tmp); - $this->debug("read chunk terminator of $tmplen bytes"); - if ($tmplen == 0) { - $this->incoming_payload = $data; - $this->debug('socket read of chunk terminator timed out after length ' . strlen($data)); - $this->debug("read before timeout:\n" . $data); - $this->setError('socket read of chunk terminator timed out'); - return false; - } - } - } while ($chunked && ($content_length > 0) && (!feof($this->fp))); - if (feof($this->fp)) { - $this->debug('read to EOF'); - } - $this->debug('read body of length ' . strlen($data)); - $this->incoming_payload .= $data; - $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server'); - - // close filepointer - if( - (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || - (! $this->persistentConnection) || feof($this->fp)){ - fclose($this->fp); - $this->fp = false; - $this->debug('closed socket'); - } - - // connection was closed unexpectedly - if($this->incoming_payload == ''){ - $this->setError('no response from server'); - return false; - } - - // decode transfer-encoding -// if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){ -// if(!$data = $this->decodeChunked($data, $lb)){ -// $this->setError('Decoding of chunked data failed'); -// return false; -// } - //print "
\nde-chunked:\n---------------\n$data\n\n---------------\n
"; - // set decoded payload -// $this->incoming_payload = $header_data.$lb.$lb.$data; -// } - - } else if ($this->scheme == 'https') { - // send and receive - $this->debug('send and receive with cURL'); - $this->incoming_payload = curl_exec($this->ch); - $data = $this->incoming_payload; - - $cErr = curl_error($this->ch); - if ($cErr != '') { - $err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'
'; - // TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE - foreach(curl_getinfo($this->ch) as $k => $v){ - $err .= "$k: $v
"; - } - $this->debug($err); - $this->setError($err); - curl_close($this->ch); - return false; - } else { - //echo '
';
-			//var_dump(curl_getinfo($this->ch));
-			//echo '
'; - } - // close curl - $this->debug('No cURL error, closing cURL'); - curl_close($this->ch); - - // remove 100 header(s) - while (ereg('^HTTP/1.1 100',$data)) { - if ($pos = strpos($data,"\r\n\r\n")) { - $data = ltrim(substr($data,$pos)); - } elseif($pos = strpos($data,"\n\n") ) { - $data = ltrim(substr($data,$pos)); - } - } - - // separate content from HTTP headers - if ($pos = strpos($data,"\r\n\r\n")) { - $lb = "\r\n"; - } elseif( $pos = strpos($data,"\n\n")) { - $lb = "\n"; - } else { - $this->debug('no proper separation of headers and document'); - $this->setError('no proper separation of headers and document'); - return false; - } - $header_data = trim(substr($data,0,$pos)); - $header_array = explode($lb,$header_data); - $data = ltrim(substr($data,$pos)); - $this->debug('found proper separation of headers and document'); - $this->debug('cleaned data, stringlen: '.strlen($data)); - // clean headers - foreach ($header_array as $header_line) { - $arr = explode(':',$header_line,2); - if(count($arr) > 1){ - $header_name = strtolower(trim($arr[0])); - $this->incoming_headers[$header_name] = trim($arr[1]); - if ($header_name == 'set-cookie') { - // TODO: allow multiple cookies from parseCookie - $cookie = $this->parseCookie(trim($arr[1])); - if ($cookie) { - $this->incoming_cookies[] = $cookie; - $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); - } else { - $this->debug('did not find cookie in ' . trim($arr[1])); - } - } - } else if (isset($header_name)) { - // append continuation line to previous header - $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; - } - } - } - - $arr = explode(' ', $header_array[0], 3); - $http_version = $arr[0]; - $http_status = intval($arr[1]); - $http_reason = count($arr) > 2 ? $arr[2] : ''; - - // see if we need to resend the request with http digest authentication - if (isset($this->incoming_headers['location']) && $http_status == 301) { - $this->debug("Got 301 $http_reason with Location: " . $this->incoming_headers['location']); - $this->setURL($this->incoming_headers['location']); - $this->tryagain = true; - return false; - } - - // see if we need to resend the request with http digest authentication - if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) { - $this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']); - if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) { - $this->debug('Server wants digest authentication'); - // remove "Digest " from our elements - $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']); - - // parse elements into array - $digestElements = explode(',', $digestString); - foreach ($digestElements as $val) { - $tempElement = explode('=', trim($val), 2); - $digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]); - } - - // should have (at least) qop, realm, nonce - if (isset($digestRequest['nonce'])) { - $this->setCredentials($this->username, $this->password, 'digest', $digestRequest); - $this->tryagain = true; - return false; - } - } - $this->debug('HTTP authentication failed'); - $this->setError('HTTP authentication failed'); - return false; - } - - if ( - ($http_status >= 300 && $http_status <= 307) || - ($http_status >= 400 && $http_status <= 417) || - ($http_status >= 501 && $http_status <= 505) - ) { - $this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient2->response has contents of the response)"); - return false; - } - - // decode content-encoding - if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){ - if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){ - // if decoding works, use it. else assume data wasn't gzencoded - if(function_exists('gzinflate')){ - //$timer->setMarker('starting decoding of gzip/deflated content'); - // IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress) - // this means there are no Zlib headers, although there should be - $this->debug('The gzinflate function exists'); - $datalen = strlen($data); - if ($this->incoming_headers['content-encoding'] == 'deflate') { - if ($degzdata = @gzinflate($data)) { - $data = $degzdata; - $this->debug('The payload has been inflated to ' . strlen($data) . ' bytes'); - if (strlen($data) < $datalen) { - // test for the case that the payload has been compressed twice - $this->debug('The inflated payload is smaller than the gzipped one; try again'); - if ($degzdata = @gzinflate($data)) { - $data = $degzdata; - $this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes'); - } - } - } else { - $this->debug('Error using gzinflate to inflate the payload'); - $this->setError('Error using gzinflate to inflate the payload'); - } - } elseif ($this->incoming_headers['content-encoding'] == 'gzip') { - if ($degzdata = @gzinflate(substr($data, 10))) { // do our best - $data = $degzdata; - $this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes'); - if (strlen($data) < $datalen) { - // test for the case that the payload has been compressed twice - $this->debug('The un-gzipped payload is smaller than the gzipped one; try again'); - if ($degzdata = @gzinflate(substr($data, 10))) { - $data = $degzdata; - $this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes'); - } - } - } else { - $this->debug('Error using gzinflate to un-gzip the payload'); - $this->setError('Error using gzinflate to un-gzip the payload'); - } - } - //$timer->setMarker('finished decoding of gzip/deflated content'); - //print "\nde-inflated:\n---------------\n$data\n-------------\n"; - // set decoded payload - $this->incoming_payload = $header_data.$lb.$lb.$data; - } else { - $this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); - $this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); - } - } else { - $this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); - $this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); - } - } else { - $this->debug('No Content-Encoding header'); - } - - if(strlen($data) == 0){ - $this->debug('no data after headers!'); - $this->setError('no data present after HTTP headers'); - return false; - } - - return $data; - } - - function setContentType($type, $charset = false) { - $this->outgoing_headers['Content-Type'] = $type . ($charset ? '; charset=' . $charset : ''); - $this->debug('set Content-Type: ' . $this->outgoing_headers['Content-Type']); - } - - function usePersistentConnection(){ - if (isset($this->outgoing_headers['Accept-Encoding'])) { - return false; - } - $this->protocol_version = '1.1'; - $this->persistentConnection = true; - $this->outgoing_headers['Connection'] = 'Keep-Alive'; - $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); - return true; - } - - /** - * parse an incoming Cookie into it's parts - * - * @param string $cookie_str content of cookie - * @return array with data of that cookie - * @access private - */ - /* - * TODO: allow a Set-Cookie string to be parsed into multiple cookies - */ - function parseCookie($cookie_str) { - $cookie_str = str_replace('; ', ';', $cookie_str) . ';'; - $data = split(';', $cookie_str); - $value_str = $data[0]; - - $cookie_param = 'domain='; - $start = strpos($cookie_str, $cookie_param); - if ($start > 0) { - $domain = substr($cookie_str, $start + strlen($cookie_param)); - $domain = substr($domain, 0, strpos($domain, ';')); - } else { - $domain = ''; - } - - $cookie_param = 'expires='; - $start = strpos($cookie_str, $cookie_param); - if ($start > 0) { - $expires = substr($cookie_str, $start + strlen($cookie_param)); - $expires = substr($expires, 0, strpos($expires, ';')); - } else { - $expires = ''; - } - - $cookie_param = 'path='; - $start = strpos($cookie_str, $cookie_param); - if ( $start > 0 ) { - $path = substr($cookie_str, $start + strlen($cookie_param)); - $path = substr($path, 0, strpos($path, ';')); - } else { - $path = '/'; - } - - $cookie_param = ';secure;'; - if (strpos($cookie_str, $cookie_param) !== FALSE) { - $secure = true; - } else { - $secure = false; - } - - $sep_pos = strpos($value_str, '='); - - if ($sep_pos) { - $name = substr($value_str, 0, $sep_pos); - $value = substr($value_str, $sep_pos + 1); - $cookie= array( 'name' => $name, - 'value' => $value, - 'domain' => $domain, - 'path' => $path, - 'expires' => $expires, - 'secure' => $secure - ); - return $cookie; - } - return false; - } - - /** - * sort out cookies for the current request - * - * @param array $cookies array with all cookies - * @param boolean $secure is the send-content secure or not? - * @return string for Cookie-HTTP-Header - * @access private - */ - function getCookiesForRequest($cookies, $secure=false) { - $cookie_str = ''; - if ((! is_null($cookies)) && (is_array($cookies))) { - foreach ($cookies as $cookie) { - if (! is_array($cookie)) { - continue; - } - $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); - if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { - if (strtotime($cookie['expires']) <= time()) { - $this->debug('cookie has expired'); - continue; - } - } - if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { - $domain = preg_quote($cookie['domain']); - if (! preg_match("'.*$domain$'i", $this->host)) { - $this->debug('cookie has different domain'); - continue; - } - } - if ((isset($cookie['path'])) && (! empty($cookie['path']))) { - $path = preg_quote($cookie['path']); - if (! preg_match("'^$path.*'i", $this->path)) { - $this->debug('cookie is for a different path'); - continue; - } - } - if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) { - $this->debug('cookie is secure, transport is not'); - continue; - } - $cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; '; - $this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']); - } - } - return $cookie_str; - } -} - - + +* @version $Id: class.soap_transport_http.php,v 1.57 2005/07/27 19:24:42 snichol Exp $ +* @access public +*/ +class soap_transport_http extends nusoap_base { + + var $url = ''; + var $uri = ''; + var $digest_uri = ''; + var $scheme = ''; + var $host = ''; + var $port = ''; + var $path = ''; + var $request_method = 'POST'; + var $protocol_version = '1.0'; + var $encoding = ''; + var $outgoing_headers = array(); + var $incoming_headers = array(); + var $incoming_cookies = array(); + var $outgoing_payload = ''; + var $incoming_payload = ''; + var $useSOAPAction = true; + var $persistentConnection = false; + var $ch = false; // cURL handle + var $username = ''; + var $password = ''; + var $authtype = ''; + var $digestRequest = array(); + var $certRequest = array(); // keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional) + // cainfofile: certificate authority file, e.g. '$pathToPemFiles/rootca.pem' + // sslcertfile: SSL certificate file, e.g. '$pathToPemFiles/mycert.pem' + // sslkeyfile: SSL key file, e.g. '$pathToPemFiles/mykey.pem' + // passphrase: SSL key password/passphrase + // verifypeer: default is 1 + // verifyhost: default is 1 + + /** + * constructor + */ + function soap_transport_http($url){ + parent::nusoap_base(); + $this->setURL($url); + ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev); + $this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')'; + $this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']); + } + + function setURL($url) { + $this->url = $url; + + $u = parse_url($url); + foreach($u as $k => $v){ + $this->debug("$k = $v"); + $this->$k = $v; + } + + // add any GET params to path + if(isset($u['query']) && $u['query'] != ''){ + $this->path .= '?' . $u['query']; + } + + // set default port + if(!isset($u['port'])){ + if($u['scheme'] == 'https'){ + $this->port = 443; + } else { + $this->port = 80; + } + } + + $this->uri = $this->path; + $this->digest_uri = $this->uri; + + // build headers + if (!isset($u['port'])) { + $this->outgoing_headers['Host'] = $this->host; + } else { + $this->outgoing_headers['Host'] = $this->host.':'.$this->port; + } + $this->debug('set Host: ' . $this->outgoing_headers['Host']); + + if (isset($u['user']) && $u['user'] != '') { + $this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : ''); + } + } + + function connect($connection_timeout=0,$response_timeout=30){ + // For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like + // "regular" socket. + // TODO: disabled for now because OpenSSL must be *compiled* in (not just + // loaded), and until PHP5 stream_get_wrappers is not available. +// if ($this->scheme == 'https') { +// if (version_compare(phpversion(), '4.3.0') >= 0) { +// if (extension_loaded('openssl')) { +// $this->scheme = 'ssl'; +// $this->debug('Using SSL over OpenSSL'); +// } +// } +// } + $this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port"); + if ($this->scheme == 'http' || $this->scheme == 'ssl') { + // use persistent connection + if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){ + if (!feof($this->fp)) { + $this->debug('Re-use persistent connection'); + return true; + } + fclose($this->fp); + $this->debug('Closed persistent connection at EOF'); + } + + // munge host if using OpenSSL + if ($this->scheme == 'ssl') { + $host = 'ssl://' . $this->host; + } else { + $host = $this->host; + } + $this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout); + + // open socket + if($connection_timeout > 0){ + $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout); + } else { + $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str); + } + + // test pointer + if(!$this->fp) { + $msg = 'Couldn\'t open socket connection to server ' . $this->url; + if ($this->errno) { + $msg .= ', Error ('.$this->errno.'): '.$this->error_str; + } else { + $msg .= ' prior to connect(). This is often a problem looking up the host name.'; + } + $this->debug($msg); + $this->setError($msg); + return false; + } + + // set response timeout + $this->debug('set response timeout to ' . $response_timeout); + socket_set_timeout( $this->fp, $response_timeout); + + $this->debug('socket connected'); + return true; + } else if ($this->scheme == 'https') { + if (!extension_loaded('curl')) { + $this->setError('CURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS'); + return false; + } + $this->debug('connect using https'); + // init CURL + $this->ch = curl_init(); + // set url + $hostURL = ($this->port != '') ? "https://$this->host:$this->port" : "https://$this->host"; + // add path + $hostURL .= $this->path; + curl_setopt($this->ch, CURLOPT_URL, $hostURL); + // follow location headers (re-directs) + curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1); + // ask for headers in the response output + curl_setopt($this->ch, CURLOPT_HEADER, 1); + // ask for the response output as the return value + curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); + // encode + // We manage this ourselves through headers and encoding +// if(function_exists('gzuncompress')){ +// curl_setopt($this->ch, CURLOPT_ENCODING, 'deflate'); +// } + // persistent connection + if ($this->persistentConnection) { + // The way we send data, we cannot use persistent connections, since + // there will be some "junk" at the end of our request. + //curl_setopt($this->ch, CURL_HTTP_VERSION_1_1, true); + $this->persistentConnection = false; + $this->outgoing_headers['Connection'] = 'close'; + $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); + } + // set timeout + if ($connection_timeout != 0) { + curl_setopt($this->ch, CURLOPT_TIMEOUT, $connection_timeout); + } + // TODO: cURL has added a connection timeout separate from the response timeout + //if ($connection_timeout != 0) { + // curl_setopt($this->ch, CURLOPT_CONNECTIONTIMEOUT, $connection_timeout); + //} + //if ($response_timeout != 0) { + // curl_setopt($this->ch, CURLOPT_TIMEOUT, $response_timeout); + //} + + // recent versions of cURL turn on peer/host checking by default, + // while PHP binaries are not compiled with a default location for the + // CA cert bundle, so disable peer/host checking. +//curl_setopt($this->ch, CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt'); + curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0); + + // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo) + if ($this->authtype == 'certificate') { + if (isset($this->certRequest['cainfofile'])) { + curl_setopt($this->ch, CURLOPT_CAINFO, $this->certRequest['cainfofile']); + } + if (isset($this->certRequest['verifypeer'])) { + curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']); + } else { + curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 1); + } + if (isset($this->certRequest['verifyhost'])) { + curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']); + } else { + curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 1); + } + if (isset($this->certRequest['sslcertfile'])) { + curl_setopt($this->ch, CURLOPT_SSLCERT, $this->certRequest['sslcertfile']); + } + if (isset($this->certRequest['sslkeyfile'])) { + curl_setopt($this->ch, CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']); + } + if (isset($this->certRequest['passphrase'])) { + curl_setopt($this->ch, CURLOPT_SSLKEYPASSWD , $this->certRequest['passphrase']); + } + } + $this->debug('cURL connection set up'); + return true; + } else { + $this->setError('Unknown scheme ' . $this->scheme); + $this->debug('Unknown scheme ' . $this->scheme); + return false; + } + } + + /** + * send the SOAP message via HTTP + * + * @param string $data message data + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @param array $cookies cookies to send + * @return string data + * @access public + */ + function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) { + + $this->debug('entered send() with data of length: '.strlen($data)); + + $this->tryagain = true; + $tries = 0; + while ($this->tryagain) { + $this->tryagain = false; + if ($tries++ < 2) { + // make connnection + if (!$this->connect($timeout, $response_timeout)){ + return false; + } + + // send request + if (!$this->sendRequest($data, $cookies)){ + return false; + } + + // get response + $respdata = $this->getResponse(); + } else { + $this->setError('Too many tries to get an OK response'); + } + } + $this->debug('end of send()'); + return $respdata; + } + + + /** + * send the SOAP message via HTTPS 1.0 using CURL + * + * @param string $msg message data + * @param integer $timeout set connection timeout in seconds + * @param integer $response_timeout set response timeout in seconds + * @param array $cookies cookies to send + * @return string data + * @access public + */ + function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) { + return $this->send($data, $timeout, $response_timeout, $cookies); + } + + /** + * if authenticating, set user credentials here + * + * @param string $username + * @param string $password + * @param string $authtype (basic, digest, certificate) + * @param array $digestRequest (keys must be nonce, nc, realm, qop) + * @param array $certRequest (keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) + * @access public + */ + function setCredentials($username, $password, $authtype = 'basic', $digestRequest = array(), $certRequest = array()) { + $this->debug("Set credentials for authtype $authtype"); + // cf. RFC 2617 + if ($authtype == 'basic') { + $this->outgoing_headers['Authorization'] = 'Basic '.base64_encode(str_replace(':','',$username).':'.$password); + } elseif ($authtype == 'digest') { + if (isset($digestRequest['nonce'])) { + $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1; + + // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html) + + // A1 = unq(username-value) ":" unq(realm-value) ":" passwd + $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password; + + // H(A1) = MD5(A1) + $HA1 = md5($A1); + + // A2 = Method ":" digest-uri-value + $A2 = 'POST:' . $this->digest_uri; + + // H(A2) + $HA2 = md5($A2); + + // KD(secret, data) = H(concat(secret, ":", data)) + // if qop == auth: + // request-digest = <"> < KD ( H(A1), unq(nonce-value) + // ":" nc-value + // ":" unq(cnonce-value) + // ":" unq(qop-value) + // ":" H(A2) + // ) <"> + // if qop is missing, + // request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <"> + + $unhashedDigest = ''; + $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : ''; + $cnonce = $nonce; + if ($digestRequest['qop'] != '') { + $unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2; + } else { + $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2; + } + + $hashedDigest = md5($unhashedDigest); + + $this->outgoing_headers['Authorization'] = 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"'; + } + } elseif ($authtype == 'certificate') { + $this->certRequest = $certRequest; + } + $this->username = $username; + $this->password = $password; + $this->authtype = $authtype; + $this->digestRequest = $digestRequest; + + if (isset($this->outgoing_headers['Authorization'])) { + $this->debug('set Authorization: ' . substr($this->outgoing_headers['Authorization'], 0, 12) . '...'); + } else { + $this->debug('Authorization header not set'); + } + } + + /** + * set the soapaction value + * + * @param string $soapaction + * @access public + */ + function setSOAPAction($soapaction) { + $this->outgoing_headers['SOAPAction'] = '"' . $soapaction . '"'; + $this->debug('set SOAPAction: ' . $this->outgoing_headers['SOAPAction']); + } + + /** + * use http encoding + * + * @param string $enc encoding style. supported values: gzip, deflate, or both + * @access public + */ + function setEncoding($enc='gzip, deflate') { + if (function_exists('gzdeflate')) { + $this->protocol_version = '1.1'; + $this->outgoing_headers['Accept-Encoding'] = $enc; + $this->debug('set Accept-Encoding: ' . $this->outgoing_headers['Accept-Encoding']); + if (!isset($this->outgoing_headers['Connection'])) { + $this->outgoing_headers['Connection'] = 'close'; + $this->persistentConnection = false; + $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); + } + set_magic_quotes_runtime(0); + // deprecated + $this->encoding = $enc; + } + } + + /** + * set proxy info here + * + * @param string $proxyhost + * @param string $proxyport + * @param string $proxyusername + * @param string $proxypassword + * @access public + */ + function setProxy($proxyhost, $proxyport, $proxyusername = '', $proxypassword = '') { + $this->uri = $this->url; + $this->host = $proxyhost; + $this->port = $proxyport; + if ($proxyusername != '' && $proxypassword != '') { + $this->outgoing_headers['Proxy-Authorization'] = ' Basic '.base64_encode($proxyusername.':'.$proxypassword); + $this->debug('set Proxy-Authorization: ' . $this->outgoing_headers['Proxy-Authorization']); + } + } + + /** + * decode a string that is encoded w/ "chunked' transfer encoding + * as defined in RFC2068 19.4.6 + * + * @param string $buffer + * @param string $lb + * @returns string + * @access public + * @deprecated + */ + function decodeChunked($buffer, $lb){ + // length := 0 + $length = 0; + $new = ''; + + // read chunk-size, chunk-extension (if any) and CRLF + // get the position of the linebreak + $chunkend = strpos($buffer, $lb); + if ($chunkend == FALSE) { + $this->debug('no linebreak found in decodeChunked'); + return $new; + } + $temp = substr($buffer,0,$chunkend); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend + strlen($lb); + // while (chunk-size > 0) { + while ($chunk_size > 0) { + $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size"); + $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size); + + // Just in case we got a broken connection + if ($chunkend == FALSE) { + $chunk = substr($buffer,$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + $length += strlen($chunk); + break; + } + + // read chunk-data and CRLF + $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); + // append chunk-data to entity-body + $new .= $chunk; + // length := length + chunk-size + $length += strlen($chunk); + // read chunk-size and CRLF + $chunkstart = $chunkend + strlen($lb); + + $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb); + if ($chunkend == FALSE) { + break; //Just in case we got a broken connection + } + $temp = substr($buffer,$chunkstart,$chunkend-$chunkstart); + $chunk_size = hexdec( trim($temp) ); + $chunkstart = $chunkend; + } + return $new; + } + + /* + * Writes payload, including HTTP headers, to $this->outgoing_payload. + */ + function buildPayload($data, $cookie_str = '') { + // add content-length header + $this->outgoing_headers['Content-Length'] = strlen($data); + $this->debug('set Content-Length: ' . $this->outgoing_headers['Content-Length']); + + // start building outgoing payload: + $req = "$this->request_method $this->uri HTTP/$this->protocol_version"; + $this->debug("HTTP request: $req"); + $this->outgoing_payload = "$req\r\n"; + + // loop thru headers, serializing + foreach($this->outgoing_headers as $k => $v){ + $hdr = $k.': '.$v; + $this->debug("HTTP header: $hdr"); + $this->outgoing_payload .= "$hdr\r\n"; + } + + // add any cookies + if ($cookie_str != '') { + $hdr = 'Cookie: '.$cookie_str; + $this->debug("HTTP header: $hdr"); + $this->outgoing_payload .= "$hdr\r\n"; + } + + // header/body separator + $this->outgoing_payload .= "\r\n"; + + // add data + $this->outgoing_payload .= $data; + } + + function sendRequest($data, $cookies = NULL) { + // build cookie string + $cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https'))); + + // build payload + $this->buildPayload($data, $cookie_str); + + if ($this->scheme == 'http' || $this->scheme == 'ssl') { + // send payload + if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) { + $this->setError('couldn\'t write message data to socket'); + $this->debug('couldn\'t write message data to socket'); + return false; + } + $this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload)); + return true; + } else if ($this->scheme == 'https') { + // set payload + // TODO: cURL does say this should only be the verb, and in fact it + // turns out that the URI and HTTP version are appended to this, which + // some servers refuse to work with + //curl_setopt($this->ch, CURLOPT_CUSTOMREQUEST, $this->outgoing_payload); + foreach($this->outgoing_headers as $k => $v){ + $curl_headers[] = "$k: $v"; + } + if ($cookie_str != '') { + $curl_headers[] = 'Cookie: ' . $cookie_str; + } + curl_setopt($this->ch, CURLOPT_HTTPHEADER, $curl_headers); + if ($this->request_method == "POST") { + curl_setopt($this->ch, CURLOPT_POST, 1); + curl_setopt($this->ch, CURLOPT_POSTFIELDS, $data); + } else { + } + $this->debug('set cURL payload'); + return true; + } + } + + function getResponse(){ + $this->incoming_payload = ''; + + if ($this->scheme == 'http' || $this->scheme == 'ssl') { + // loop until headers have been retrieved + $data = ''; + while (!isset($lb)){ + + // We might EOF during header read. + if(feof($this->fp)) { + $this->incoming_payload = $data; + $this->debug('found no headers before EOF after length ' . strlen($data)); + $this->debug("received before EOF:\n" . $data); + $this->setError('server failed to send headers'); + return false; + } + + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read line of $tmplen bytes: " . trim($tmp)); + + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of headers timed out after length ' . strlen($data)); + $this->debug("read before timeout: " . $data); + $this->setError('socket read of headers timed out'); + return false; + } + + $data .= $tmp; + $pos = strpos($data,"\r\n\r\n"); + if($pos > 1){ + $lb = "\r\n"; + } else { + $pos = strpos($data,"\n\n"); + if($pos > 1){ + $lb = "\n"; + } + } + // remove 100 header + if(isset($lb) && ereg('^HTTP/1.1 100',$data)){ + unset($lb); + $data = ''; + }// + } + // store header data + $this->incoming_payload .= $data; + $this->debug('found end of headers after length ' . strlen($data)); + // process headers + $header_data = trim(substr($data,0,$pos)); + $header_array = explode($lb,$header_data); + $this->incoming_headers = array(); + $this->incoming_cookies = array(); + foreach($header_array as $header_line){ + $arr = explode(':',$header_line, 2); + if(count($arr) > 1){ + $header_name = strtolower(trim($arr[0])); + $this->incoming_headers[$header_name] = trim($arr[1]); + if ($header_name == 'set-cookie') { + // TODO: allow multiple cookies from parseCookie + $cookie = $this->parseCookie(trim($arr[1])); + if ($cookie) { + $this->incoming_cookies[] = $cookie; + $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); + } else { + $this->debug('did not find cookie in ' . trim($arr[1])); + } + } + } else if (isset($header_name)) { + // append continuation line to previous header + $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; + } + } + + // loop until msg has been received + if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') { + $content_length = 2147483647; // ignore any content-length header + $chunked = true; + $this->debug("want to read chunked content"); + } elseif (isset($this->incoming_headers['content-length'])) { + $content_length = $this->incoming_headers['content-length']; + $chunked = false; + $this->debug("want to read content of length $content_length"); + } else { + $content_length = 2147483647; + $chunked = false; + $this->debug("want to read content to EOF"); + } + $data = ''; + do { + if ($chunked) { + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read chunk line of $tmplen bytes"); + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of chunk length timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of chunk length timed out'); + return false; + } + $content_length = hexdec(trim($tmp)); + $this->debug("chunk length $content_length"); + } + $strlen = 0; + while (($strlen < $content_length) && (!feof($this->fp))) { + $readlen = min(8192, $content_length - $strlen); + $tmp = fread($this->fp, $readlen); + $tmplen = strlen($tmp); + $this->debug("read buffer of $tmplen bytes"); + if (($tmplen == 0) && (!feof($this->fp))) { + $this->incoming_payload = $data; + $this->debug('socket read of body timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of body timed out'); + return false; + } + $strlen += $tmplen; + $data .= $tmp; + } + if ($chunked && ($content_length > 0)) { + $tmp = fgets($this->fp, 256); + $tmplen = strlen($tmp); + $this->debug("read chunk terminator of $tmplen bytes"); + if ($tmplen == 0) { + $this->incoming_payload = $data; + $this->debug('socket read of chunk terminator timed out after length ' . strlen($data)); + $this->debug("read before timeout:\n" . $data); + $this->setError('socket read of chunk terminator timed out'); + return false; + } + } + } while ($chunked && ($content_length > 0) && (!feof($this->fp))); + if (feof($this->fp)) { + $this->debug('read to EOF'); + } + $this->debug('read body of length ' . strlen($data)); + $this->incoming_payload .= $data; + $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server'); + + // close filepointer + if( + (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || + (! $this->persistentConnection) || feof($this->fp)){ + fclose($this->fp); + $this->fp = false; + $this->debug('closed socket'); + } + + // connection was closed unexpectedly + if($this->incoming_payload == ''){ + $this->setError('no response from server'); + return false; + } + + // decode transfer-encoding +// if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){ +// if(!$data = $this->decodeChunked($data, $lb)){ +// $this->setError('Decoding of chunked data failed'); +// return false; +// } + //print "
\nde-chunked:\n---------------\n$data\n\n---------------\n
"; + // set decoded payload +// $this->incoming_payload = $header_data.$lb.$lb.$data; +// } + + } else if ($this->scheme == 'https') { + // send and receive + $this->debug('send and receive with cURL'); + $this->incoming_payload = curl_exec($this->ch); + $data = $this->incoming_payload; + + $cErr = curl_error($this->ch); + if ($cErr != '') { + $err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'
'; + // TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE + foreach(curl_getinfo($this->ch) as $k => $v){ + $err .= "$k: $v
"; + } + $this->debug($err); + $this->setError($err); + curl_close($this->ch); + return false; + } else { + //echo '
';
+			//var_dump(curl_getinfo($this->ch));
+			//echo '
'; + } + // close curl + $this->debug('No cURL error, closing cURL'); + curl_close($this->ch); + + // remove 100 header(s) + while (ereg('^HTTP/1.1 100',$data)) { + if ($pos = strpos($data,"\r\n\r\n")) { + $data = ltrim(substr($data,$pos)); + } elseif($pos = strpos($data,"\n\n") ) { + $data = ltrim(substr($data,$pos)); + } + } + + // separate content from HTTP headers + if ($pos = strpos($data,"\r\n\r\n")) { + $lb = "\r\n"; + } elseif( $pos = strpos($data,"\n\n")) { + $lb = "\n"; + } else { + $this->debug('no proper separation of headers and document'); + $this->setError('no proper separation of headers and document'); + return false; + } + $header_data = trim(substr($data,0,$pos)); + $header_array = explode($lb,$header_data); + $data = ltrim(substr($data,$pos)); + $this->debug('found proper separation of headers and document'); + $this->debug('cleaned data, stringlen: '.strlen($data)); + // clean headers + foreach ($header_array as $header_line) { + $arr = explode(':',$header_line,2); + if(count($arr) > 1){ + $header_name = strtolower(trim($arr[0])); + $this->incoming_headers[$header_name] = trim($arr[1]); + if ($header_name == 'set-cookie') { + // TODO: allow multiple cookies from parseCookie + $cookie = $this->parseCookie(trim($arr[1])); + if ($cookie) { + $this->incoming_cookies[] = $cookie; + $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']); + } else { + $this->debug('did not find cookie in ' . trim($arr[1])); + } + } + } else if (isset($header_name)) { + // append continuation line to previous header + $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; + } + } + } + + $arr = explode(' ', $header_array[0], 3); + $http_version = $arr[0]; + $http_status = intval($arr[1]); + $http_reason = count($arr) > 2 ? $arr[2] : ''; + + // see if we need to resend the request with http digest authentication + if (isset($this->incoming_headers['location']) && $http_status == 301) { + $this->debug("Got 301 $http_reason with Location: " . $this->incoming_headers['location']); + $this->setURL($this->incoming_headers['location']); + $this->tryagain = true; + return false; + } + + // see if we need to resend the request with http digest authentication + if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) { + $this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']); + if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) { + $this->debug('Server wants digest authentication'); + // remove "Digest " from our elements + $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']); + + // parse elements into array + $digestElements = explode(',', $digestString); + foreach ($digestElements as $val) { + $tempElement = explode('=', trim($val), 2); + $digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]); + } + + // should have (at least) qop, realm, nonce + if (isset($digestRequest['nonce'])) { + $this->setCredentials($this->username, $this->password, 'digest', $digestRequest); + $this->tryagain = true; + return false; + } + } + $this->debug('HTTP authentication failed'); + $this->setError('HTTP authentication failed'); + return false; + } + + if ( + ($http_status >= 300 && $http_status <= 307) || + ($http_status >= 400 && $http_status <= 417) || + ($http_status >= 501 && $http_status <= 505) + ) { + $this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient2->response has contents of the response)"); + return false; + } + + // decode content-encoding + if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){ + if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){ + // if decoding works, use it. else assume data wasn't gzencoded + if(function_exists('gzinflate')){ + //$timer->setMarker('starting decoding of gzip/deflated content'); + // IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress) + // this means there are no Zlib headers, although there should be + $this->debug('The gzinflate function exists'); + $datalen = strlen($data); + if ($this->incoming_headers['content-encoding'] == 'deflate') { + if ($degzdata = @gzinflate($data)) { + $data = $degzdata; + $this->debug('The payload has been inflated to ' . strlen($data) . ' bytes'); + if (strlen($data) < $datalen) { + // test for the case that the payload has been compressed twice + $this->debug('The inflated payload is smaller than the gzipped one; try again'); + if ($degzdata = @gzinflate($data)) { + $data = $degzdata; + $this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes'); + } + } + } else { + $this->debug('Error using gzinflate to inflate the payload'); + $this->setError('Error using gzinflate to inflate the payload'); + } + } elseif ($this->incoming_headers['content-encoding'] == 'gzip') { + if ($degzdata = @gzinflate(substr($data, 10))) { // do our best + $data = $degzdata; + $this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes'); + if (strlen($data) < $datalen) { + // test for the case that the payload has been compressed twice + $this->debug('The un-gzipped payload is smaller than the gzipped one; try again'); + if ($degzdata = @gzinflate(substr($data, 10))) { + $data = $degzdata; + $this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes'); + } + } + } else { + $this->debug('Error using gzinflate to un-gzip the payload'); + $this->setError('Error using gzinflate to un-gzip the payload'); + } + } + //$timer->setMarker('finished decoding of gzip/deflated content'); + //print "\nde-inflated:\n---------------\n$data\n-------------\n"; + // set decoded payload + $this->incoming_payload = $header_data.$lb.$lb.$data; + } else { + $this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); + $this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.'); + } + } else { + $this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); + $this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']); + } + } else { + $this->debug('No Content-Encoding header'); + } + + if(strlen($data) == 0){ + $this->debug('no data after headers!'); + $this->setError('no data present after HTTP headers'); + return false; + } + + return $data; + } + + function setContentType($type, $charset = false) { + $this->outgoing_headers['Content-Type'] = $type . ($charset ? '; charset=' . $charset : ''); + $this->debug('set Content-Type: ' . $this->outgoing_headers['Content-Type']); + } + + function usePersistentConnection(){ + if (isset($this->outgoing_headers['Accept-Encoding'])) { + return false; + } + $this->protocol_version = '1.1'; + $this->persistentConnection = true; + $this->outgoing_headers['Connection'] = 'Keep-Alive'; + $this->debug('set Connection: ' . $this->outgoing_headers['Connection']); + return true; + } + + /** + * parse an incoming Cookie into it's parts + * + * @param string $cookie_str content of cookie + * @return array with data of that cookie + * @access private + */ + /* + * TODO: allow a Set-Cookie string to be parsed into multiple cookies + */ + function parseCookie($cookie_str) { + $cookie_str = str_replace('; ', ';', $cookie_str) . ';'; + $data = split(';', $cookie_str); + $value_str = $data[0]; + + $cookie_param = 'domain='; + $start = strpos($cookie_str, $cookie_param); + if ($start > 0) { + $domain = substr($cookie_str, $start + strlen($cookie_param)); + $domain = substr($domain, 0, strpos($domain, ';')); + } else { + $domain = ''; + } + + $cookie_param = 'expires='; + $start = strpos($cookie_str, $cookie_param); + if ($start > 0) { + $expires = substr($cookie_str, $start + strlen($cookie_param)); + $expires = substr($expires, 0, strpos($expires, ';')); + } else { + $expires = ''; + } + + $cookie_param = 'path='; + $start = strpos($cookie_str, $cookie_param); + if ( $start > 0 ) { + $path = substr($cookie_str, $start + strlen($cookie_param)); + $path = substr($path, 0, strpos($path, ';')); + } else { + $path = '/'; + } + + $cookie_param = ';secure;'; + if (strpos($cookie_str, $cookie_param) !== FALSE) { + $secure = true; + } else { + $secure = false; + } + + $sep_pos = strpos($value_str, '='); + + if ($sep_pos) { + $name = substr($value_str, 0, $sep_pos); + $value = substr($value_str, $sep_pos + 1); + $cookie= array( 'name' => $name, + 'value' => $value, + 'domain' => $domain, + 'path' => $path, + 'expires' => $expires, + 'secure' => $secure + ); + return $cookie; + } + return false; + } + + /** + * sort out cookies for the current request + * + * @param array $cookies array with all cookies + * @param boolean $secure is the send-content secure or not? + * @return string for Cookie-HTTP-Header + * @access private + */ + function getCookiesForRequest($cookies, $secure=false) { + $cookie_str = ''; + if ((! is_null($cookies)) && (is_array($cookies))) { + foreach ($cookies as $cookie) { + if (! is_array($cookie)) { + continue; + } + $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']); + if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) { + if (strtotime($cookie['expires']) <= time()) { + $this->debug('cookie has expired'); + continue; + } + } + if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) { + $domain = preg_quote($cookie['domain']); + if (! preg_match("'.*$domain$'i", $this->host)) { + $this->debug('cookie has different domain'); + continue; + } + } + if ((isset($cookie['path'])) && (! empty($cookie['path']))) { + $path = preg_quote($cookie['path']); + if (! preg_match("'^$path.*'i", $this->path)) { + $this->debug('cookie is for a different path'); + continue; + } + } + if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) { + $this->debug('cookie is secure, transport is not'); + continue; + } + $cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; '; + $this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']); + } + } + return $cookie_str; + } +} + + ?> Modified: vtigercrm/branches/5.1_jens/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/CommonUtils.php Tue Nov 14 03:16:10 2006 @@ -220,6 +220,33 @@ return $string; } +/** + * Function used to decodes the given single quote and double quote only. This function used for popup selection + * @param string $string - string to be converted, $encode - flag to decode + * @return string $string - the decoded value in string fromat where as only single and double quotes will be decoded + */ + +function popup_from_html($string, $encode=true) +{ + global $log; + $log->debug("Entering popup_from_html(".$string.",".$encode.") method ..."); + + $popup_toHtml = array( + '"' => '"', + "'" => ''', + ); + + //if($encode && is_string($string))$string = html_entity_decode($string, ENT_QUOTES); + if($encode && is_string($string)) + { + $string = addslashes(str_replace(array_values($popup_toHtml), array_keys($popup_toHtml), $string)); + } + + $log->debug("Exiting popup_from_html method ..."); + return $string; +} + + /** To get the Currency of the specified user * @param $id -- The user Id:: Type integer * @returns vtiger_currencyid :: Type integer @@ -411,6 +438,27 @@ $log->debug("Exiting getContactName method ..."); return $contact_name; } + +/** + * Function to get the Campaign Name when a campaign id is given + * Takes the input as $campaign_id - campaign id + * returns the Campaign Name in string format. + */ + +function getOrgUnitName($orgunit_id) +{ + global $log; + $log->debug("Entering getOrgUnitName(".$orgunit_id.") method ..."); + $log->info("in getOrgUnitName ".$orgunit_id); + + global $adb; + $sql = "select * from vtiger_orgunit where orgunitid=".$orgunit_id; + $result = $adb->query($sql); + $orgunit_name = $adb->query_result($result,0,"name"); + $log->debug("Exiting getOrgUnitName method ..."); + return $orgunit_name; +} + /** * Function to get the Campaign Name when a campaign id is given @@ -600,9 +648,6 @@ /** * Get the username by giving the user id. This method expects the user id - * param $label_list - the array of strings to that contains the option list - * param $key_list - the array of strings to that contains the values list - * param $selected - the string which contains the default value */ function getUserName($userid) @@ -620,6 +665,29 @@ } $log->debug("Exiting getUserName method ..."); return $user_name; +} + +/** +* Get the user full name by giving the user id. This method expects the user id +* DG 30 Aug 2006 +*/ + +function getUserFullName($userid) +{ + global $log; + $log->debug("Entering getUserFullName(".$userid.") method ..."); + $log->info("in getUserFullName ".$userid); + global $adb; + if($userid != '') + { + $sql = "select first_name, last_name from vtiger_users where id=".$userid; + $result = $adb->query($sql); + $first_name = $adb->query_result($result,0,"first_name"); + $last_name = $adb->query_result($result,0,"last_name"); + $user_name = $first_name." ".$last_name; + } + $log->debug("Exiting getUserFullName method ..."); + return $user_name; } /** @@ -1020,7 +1088,6 @@ $result = $adb->query($sql); $getBlockInfo=getBlockInformation($module,$result,$col_fields,$tabid,$block_label,$mode); } - $log->debug("Exiting getBlocks method ..."); $index_count =1; $max_index =0; foreach($getBlockInfo as $label=>$contents) @@ -1045,6 +1112,7 @@ } } + $log->debug("Exiting getBlocks method ..."); return $getBlockInfo; } /** @@ -1552,27 +1620,26 @@ $value = $_REQUEST[$fieldname]; $focus->column_fields[$fieldname] = $value; } - if(isset($_REQUEST['txtTax'])) - { - $value = convertToDollar($_REQUEST['txtTax'],$rate); - $focus->column_fields['txtTax'] = $value; - } - if(isset($_REQUEST['txtAdjustment'])) - { - $value = convertToDollar($_REQUEST['txtAdjustment'],$rate); - $focus->column_fields['txtAdjustment'] = $value; - } - if(isset($_REQUEST['hdnSubTotal'])) - { - $value = convertToDollar($_REQUEST['hdnSubTotal'],$rate); - $focus->column_fields['hdnSubTotal'] = $value; - } - if(isset($_REQUEST['hdnGrandTotal'])) - { - $value = convertToDollar($_REQUEST['hdnGrandTotal'],$rate); - $focus->column_fields['hdnGrandTotal'] = $value; - } - + } + if(isset($_REQUEST['txtTax'])) + { + $value = convertToDollar($_REQUEST['txtTax'],$rate); + $focus->column_fields['txtTax'] = $value; + } + if(isset($_REQUEST['txtAdjustment'])) + { + $value = convertToDollar($_REQUEST['txtAdjustment'],$rate); + $focus->column_fields['txtAdjustment'] = $value; + } + if(isset($_REQUEST['hdnSubTotal'])) + { + $value = convertToDollar($_REQUEST['hdnSubTotal'],$rate); + $focus->column_fields['hdnSubTotal'] = $value; + } + if(isset($_REQUEST['hdnGrandTotal'])) + { + $value = convertToDollar($_REQUEST['hdnGrandTotal'],$rate); + $focus->column_fields['hdnGrandTotal'] = $value; } $log->debug("Exiting setObjectValuesFromRequest method ..."); } @@ -1953,7 +2020,10 @@ foreach($object_column_fields as $fieldname => $fieldlabel) { - $description .= $fieldlabel.' : '.$focus->column_fields[$fieldname].'
'; + //Get the translated string + $temp_label = isset($app_strings[$fieldlabel])?$app_strings[$fieldlabel]:(isset($mod_strings[$fieldlabel])?$mod_strings[$fieldlabel]:$fieldlabel); + + $description .= $temp_label.' : '.$focus->column_fields[$fieldname].'
'; } $description .= '

Thank You
'; @@ -1976,6 +2046,26 @@ $change_owner = get_select_options_with_id($usernamelist,'admin'); $log->debug("Exiting getUserslist method ..."); return $change_owner; +} + + +function getGroupslist() +{ + global $log; + $log->debug("Entering getGroupslist() method ..."); + global $adb; + $result=$adb->query("select * from vtiger_groups"); + + for($i=0;$i<$adb->num_rows($result);$i++) + { + $groupidlist[$i]=$adb->query_result($result,$i,'groupid'); + $groupnamelist[$groupidlist[$i]]=$adb->query_result($result,$i,'groupname'); + + } + $change_groups_owner = get_select_options_with_id($groupnamelist,''); + $log->debug("Exiting getGroupslist method ..."); + + return $change_groups_owner; } @@ -2019,214 +2109,30 @@ global $log; $log->debug("Entering getEntityName(".$module.") method ..."); - switch ($module) - { - case "Accounts" : $query = "select accountname from vtiger_account where accountid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $account_name = array(); - for ($i = 0; $i < $numrows; $i++) - { - $acc_id = $ids_list[$i]; - $account_name[$acc_id] = $adb->query_result($result,$i,'accountname'); - } - return $account_name; - break; - - case "Leads" : $query = "select concat(firstname,' ',lastname) as leadname from vtiger_leaddetails where leadid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $lead_name = array(); - for($i = 0; $i < $numrows; $i++) - { - $lead_id = $ids_list[$i]; - $lead_name[$lead_id] = $adb->query_result($result,$i,'leadname'); - } - - return $lead_name; - break; - - case "Contacts" : $query = "select concat(firstname,' ',lastname) as contactname from vtiger_contactdetails where contactid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $contact_name = array(); - for($i=0; $i < $numrows; $i++) - { - $cont_id = $ids_list[$i]; - $contact_name[$cont_id] = $adb->query_result($result,$i,'contactname'); - } - - return $contact_name; - break; - - case "Potentials" : $query = "select potentialname from vtiger_potential where potentialid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $potential_name = array(); - for($i=0; $i < $numrows; $i++) - { - $pot_id = $ids_list[$i]; - $potential_name[$pot_id] = $adb->query_result($result,$i,'potentialname'); - } - - return $potential_name; - break; - - case "Quotes" : $query = "select subject from vtiger_quotes where quoteid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $quote_subject = array(); - for($i=0; $i < $numrows; $i++) - { - $quote_id = $ids_list[$i]; - $quote_subject[$quote_id] = $adb->query_result($result,$i,'subject'); - } - - return $quote_subject; - break; - - case "SalesOrder" : $query = "select subject from vtiger_salesorder where salesorderid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $so_subject = array(); - for($i=0; $i < $numrows; $i++) - { - $so_id = $ids_list[$i]; - $so_subject[$so_id] = $adb->query_result($result,$i,'subject'); - } - - return $so_subject; - break; - - case "Invoice" : $query = "select subject from vtiger_invoice where invoiceid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $inv_subject = array(); - for($i=0; $i < $numrows; $i++) - { - $inv_id = $ids_list[$i]; - $inv_subject[$inv_id] = $adb->query_result($result,$i,'subject'); - } - - return $inv_subject; - break; - - case "Products" : $query = "select productname from vtiger_products where productid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $product_name = array(); - for($i=0; $i < $numrows; $i++) - { - $prod_id = $ids_list[$i]; - $product_name[$prod_id] = $adb->query_result($result,$i,'productname'); - } - - return $product_name; - break; - - case "PriceBooks" : $query = "select bookname from vtiger_pricebook where pricebookid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $pbook_name = array(); - for($i=0; $i < $numrows; $i++) - { - $pbook_id = $ids_list[$i]; - $pbook_name[$pbook_id] = $adb->query_result($result,$i,'bookname'); - } - - return $pbook_name; - break; - - case "Notes" : $query = "select title from vtiger_notes where notesid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $notes_title = array(); - for($i=0; $i < $numrows; $i++) - { - $note_id = $ids_list[$i]; - $notes_title[$note_id] = $adb->query_result($result,$i,'title'); - } - - return $notes_title; - break; - - case "Calendar" : $query = "select subject from vtiger_activity where activityid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $activity_subject = array(); - for($i=0; $i < $numrows; $i++) - { - $act_id = $ids_list[$i]; - $activity_subject[$act_id] = $adb->query_result($result,$i,'subject'); - } - - return $activity_subject; - break; - - case "Campaigns" : $query = "select campaignname from vtiger_campaign where campaignid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $campaign_name = array(); - for($i=0; $i < $numrows; $i++) - { - $cmpn_id = $ids_list[$i]; - $campaign_name[$cmpn_id] = $adb->query_result($result,$i,'campaignname'); - } - - return $campaign_name; - break; - - case "Faq" : $query = "select question from vtiger_faq where id in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $faq_name = array(); - for($i=0; $i < $numrows; $i++) - { - $faq_id = $ids_list[$i]; - $faq_name[$faq_id] = $adb->query_result($result,$i,'question'); - } - - return $faq_name; - break; - - case "Vendors" : $query = "select vendorname from vtiger_vendor where vendorid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $vendor_name = array(); - for($i=0; $i < $numrows; $i++) - { - $ven_id = $ids_list[$i]; - $vendor_name[$ven_id] = $adb->query_result($result,$i,'vendorname'); - } - - return $vendor_name; - break; - - case "PurchaseOrder" : $query = "select subject from vtiger_purchaseorder where purchaseorderid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $po_name = array(); - for($i=0; $i < $numrows; $i++) - { - $po_id = $ids_list[$i]; - $po_name[$po_id] = $adb->query_result($result,$i,'subject'); - } - - return $po_name; - break; - - case "HelpDesk" : $query = "select title from vtiger_troubletickets where ticketid in (".$list.")"; - $result = $adb->query($query); - $numrows = $adb->num_rows($result); - $ticket_name = array(); - for($i=0; $i < $numrows; $i++) - { - $tick_id = $ids_list[$i]; - $ticket_name[$tick_id] = $adb->query_result($result,$i,'title'); - } - - return $ticket_name; - break; + if($module != '') + { + $query = "select fieldname,tablename,entityidfield from vtiger_entityname where modulename = '$module'"; + $result = $adb->query($query); + $fieldsname = $adb->query_result($result,0,'fieldname'); + $tablename = $adb->query_result($result,0,'tablename'); + $entityidfield = $adb->query_result($result,0,'entityidfield'); + if(!(strpos($fieldsname,',') === false)) + { + $fieldlists = explode(',',$fieldsname); + $fieldsname = "concat("; + $fieldsname = $fieldsname.implode(",' ',",$fieldlists); + $fieldsname = $fieldsname.")"; + } + $query1 = "select $fieldsname as entityname from $tablename where $entityidfield in (".$list.")"; + $result = $adb->query($query1); + $numrows = $adb->num_rows($result); + $account_name = array(); + for ($i = 0; $i < $numrows; $i++) + { + $entity_id = $ids_list[$i]; + $entity_info[$entity_id] = $adb->query_result($result,$i,'entityname'); + } + return $entity_info; } $log->debug("Exiting getEntityName method ..."); } @@ -2430,6 +2336,13 @@ case 'Contacts': if(is_array($fields["contacts"])) { + //Checking for salutation type and checking the table column to be queried + $key = array_search('salutationtype',$fields["contacts"]); + if(isset($key) && $key !='') + { + $fields["contacts"][$key]='salutation'; + } + $columnfields = implode(',',$fields["contacts"]); $query = 'select '.$columnfields.' from vtiger_contactdetails where contactid='.$id; $result = $adb->query($query); @@ -2443,6 +2356,12 @@ case 'Leads': if(is_array($fields["leads"])) { + //Checking for salutation type and checking the table column to be queried + $key = array_search('salutationtype',$fields["contacts"]); + if(isset($key) && $key !='') + { + $fields["contacts"][$key]='salutation'; + } $columnfields = implode(',',$fields["leads"]); $query = 'select '.$columnfields.' from vtiger_leaddetails where leadid='.$id; $result = $adb->query($query); Modified: vtigercrm/branches/5.1_jens/include/utils/DeleteUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/DeleteUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/DeleteUtils.php Tue Nov 14 03:16:10 2006 @@ -6,7 +6,7 @@ * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. -* + * ********************************************************************************/ /** @@ -341,11 +341,22 @@ $del_query = "delete from vtiger_portal where portalid=".$record; $adb->query($del_query); break; + case Organization: + $del_query = "update vtiger_orgunit set deleted=1 where organizationname='".$record."'"; + $adb->query($del_query); + $del_query = "update vtiger_organizationdetails set deleted=1 where organizationname='".$record."'"; + $adb->query($del_query); + break; + case OrgUnit: + $del_query = "update vtiger_orgunit set deleted=1 where orgunitid=".$record; + $adb->query($del_query); + break; endswitch; } //this is added to update the crmentity.deleted=1 when we delete from listview and not from relatedlist - if($return_module == $module && $return_module !='Rss' && $return_module !='Portal') + if($return_module == $module && $return_module != 'Rss' && $return_module != 'Portal' && + $return_module != 'Organization' && $return_module != 'OrgUnit') { require_once('include/freetag/freetag.class.php'); $freetag=new freetag(); @@ -354,7 +365,7 @@ } //This is to delete the entity information from tracker ie., lastviewed - if($module != 'Faq') + if($module != 'Faq' && $module != 'Organization' && $module != 'OrgUnit') { $sql_recentviewed ='delete from vtiger_tracker where user_id = '.$current_user->id.' and item_id = '.$record; $adb->query($sql_recentviewed); Modified: vtigercrm/branches/5.1_jens/include/utils/DetailViewUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/DetailViewUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/DetailViewUtils.php Tue Nov 14 03:16:10 2006 @@ -304,7 +304,8 @@ { $imgpath = "test/contact/".$imagename; $label_fld[] =$mod_strings[$fieldlabel]; - $label_fld["cntimage"] ='
 '.$mod_strings[$fieldlabel]; + //This is used to show the contact image as a thumbnail near First Name field + //$label_fld["cntimage"] ='
 '.$mod_strings[$fieldlabel]; } else { @@ -332,7 +333,8 @@ $value = $col_fields[$fieldname]; if($value == 1) { - $display_val = 'yes'; + //Since "yes" is not been translated it is given as app strings here.. + $display_val = $app_strings['yes']; } else { @@ -363,7 +365,6 @@ $label_fld[] = $campaign_name; $label_fld["secid"] = $campaign_id; $label_fld["link"] = "index.php?module=Campaigns&action=DetailView&record=".$campaign_id; - } elseif($uitype == 59) { @@ -462,7 +463,7 @@ if($tabid==4) { //$imgpath = getModuleFileStoragePath('Contacts').$col_fields[$fieldname]; - $sql = "select vtiger_attachments.* from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid where vtiger_seattachmentsrel.crmid=".$col_fields['record_id']; + $sql = "select vtiger_attachments.* from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid inner join vtiger_contactdetails on vtiger_contactdetails.imagename=vtiger_attachments.name where vtiger_seattachmentsrel.crmid=".$col_fields['record_id']; $image_res = $adb->query($sql); $image_id = $adb->query_result($image_res,0,'attachmentsid'); $image_path = $adb->query_result($image_res,0,'path'); @@ -554,11 +555,14 @@ } - elseif($uitype == 105)//Added for user image + // UItype 105 added for user image + elseif($uitype == 105) { $label_fld[] =$mod_strings[$fieldlabel]; - //$imgpath = getModuleFileStoragePath('Contacts').$col_fields[$fieldname]; - $sql = "select vtiger_attachments.* from vtiger_attachments left join vtiger_salesmanattachmentsrel on vtiger_salesmanattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid where vtiger_salesmanattachmentsrel.smid=".$col_fields['record_id']; + $sql = "select vtiger_attachments.* from vtiger_attachments + left join vtiger_salesmanattachmentsrel + on vtiger_salesmanattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + where vtiger_salesmanattachmentsrel.smid=".$col_fields['record_id']; $image_res = $adb->query($sql); $image_id = $adb->query_result($image_res,0,'attachmentsid'); $image_path = $adb->query_result($image_res,0,'path'); @@ -568,6 +572,18 @@ $label_fld[] =''.$col_fields['user_name'].''; else $label_fld[] = ''; + } + // UItype 107 added for company logo + elseif($uitype == 107) + { + $label_fld[] =$mod_strings[$fieldlabel]; + $sql = "select logoname from vtiger_organizationdetails where organizationname='".$col_fields['record_id']."'"; + $image_res = $adb->query($sql); + $image_name = $adb->query_result($image_res,0,'logoname'); + if($image_name != '') + $label_fld[] = $image_name; + else + $label_fld[] = ''; } elseif($uitype == 66) { @@ -847,6 +863,18 @@ } $label_fld["cursymb"] = $curr_symbol; $label_fld[] = $display_val; + } + elseif($uitype == 74) + { + $label_fld[] =$mod_strings[$fieldlabel]; + $orgunit_id = $col_fields[$fieldname]; + if($orgunit_id != '') + { + $orgunit_name = getOrgUnitName($orgunit_id); + } + $label_fld[] = $orgunit_name; + $label_fld["secid"] = $orgunit_id; + $label_fld["link"] = "index.php?module=Organization&action=DetailView&record=".$orgunit_id; } elseif($uitype == 75 || $uitype == 81) { @@ -932,6 +960,10 @@ $label_fld[] = ''.getRoleName($col_fields[$fieldname]).''; else $label_fld[] = getRoleName($col_fields[$fieldname]); + }elseif($uitype == 85) //Added for Skype by Minnie + { + $label_fld[] =$mod_strings[$fieldlabel]; + $label_fld[]= $col_fields[$fieldname]; } else { @@ -940,13 +972,20 @@ $col_fields[$fieldname]=''; if($uitype == 1 && ($fieldname=='expectedrevenue' || $fieldname=='budgetcost' || $fieldname=='actualcost' || $fieldname=='expectedroi' || $fieldname=='actualroi' )) { - $label_fld[] = convertFromDollar($col_fields[$fieldname],$rate); + $rate_symbol=getCurrencySymbolandCRate($user_info['currency_id']); + $label_fld[] = convertFromDollar($col_fields[$fieldname],$rate_symbol['rate']); } else $label_fld[] = $col_fields[$fieldname]; } $label_fld[]=$uitype; + // For inheritance + if ( in_array($uitype,array(3,4,18,31,32)) ) + { + $label_fld["inherit"] = $col_fields[$fieldname."@##@"]; + } + //sets whether the currenct user is admin or not if(is_admin($current_user)) { @@ -1352,7 +1391,7 @@ $custfld = getDetailViewOutputHtml($uitype, $fieldname, $fieldlabel, $col_fields,$generatedtype,$tabid); if(is_array($custfld)) { - $label_data[$block][] = array($custfld[0]=>array("value"=>$custfld[1],"ui"=>$custfld[2],"options"=>$custfld["options"],"secid"=>$custfld["secid"],"link"=>$custfld["link"],"cursymb"=>$custfld["cursymb"],"salut"=>$custfld["salut"],"cntimage"=>$custfld["cntimage"],"isadmin"=>$custfld["isadmin"],"tablename"=>$fieldtablename,"fldname"=>$fieldname)); + $label_data[$block][] = array($custfld[0]=>array("value"=>$custfld[1],"ui"=>$custfld[2],"options"=>$custfld["options"],"secid"=>$custfld["secid"],"link"=>$custfld["link"],"cursymb"=>$custfld["cursymb"],"salut"=>$custfld["salut"],"cntimage"=>$custfld["cntimage"],"isadmin"=>$custfld["isadmin"],"tablename"=>$fieldtablename,"fldname"=>$fieldname,"inherit"=>$custfld["inherit"])); } $i++; if($i<$noofrows) @@ -1370,7 +1409,7 @@ $custfld = getDetailViewOutputHtml($uitype, $fieldname, $fieldlabel, $col_fields,$generatedtype,$tabid); if(is_array($custfld)) { - $label_data[$block][] = array($custfld[0]=>array("value"=>$custfld[1],"ui"=>$custfld[2],"options"=>$custfld["options"],"secid"=>$custfld["secid"],"link"=>$custfld["link"],"cursymb"=>$custfld["cursymb"],"salut"=>$custfld["salut"],"cntimage"=>$custfld["cntimage"],"isadmin"=>$custfld["isadmin"],"tablename"=>$fieldtablename,"fldname"=>$fieldname)); + $label_data[$block][] = array($custfld[0]=>array("value"=>$custfld[1],"ui"=>$custfld[2],"options"=>$custfld["options"],"secid"=>$custfld["secid"],"link"=>$custfld["link"],"cursymb"=>$custfld["cursymb"],"salut"=>$custfld["salut"],"cntimage"=>$custfld["cntimage"],"isadmin"=>$custfld["isadmin"],"tablename"=>$fieldtablename,"fldname"=>$fieldname,"inherit"=>$custfld["inherit"])); } } Modified: vtigercrm/branches/5.1_jens/include/utils/EditViewUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/EditViewUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/EditViewUtils.php Tue Nov 14 03:16:10 2006 @@ -106,7 +106,8 @@ } else { - $curr_time = date('H:i'); + $endtime = time() + (60 * 60); + $curr_time = date('H:i',$endtime); } } $fieldvalue[] = array($disp_value => $curr_time) ; @@ -151,7 +152,12 @@ } $fieldvalue [] = $options; } - elseif($uitype == 17) + elseif($uitype == 17 || $uitype == 18) + { + $editview_label[]=$mod_strings[$fieldlabel]; + $fieldvalue [] = $value; + } + elseif($uitype == 85) //added for Skype by Minnie { $editview_label[]=$mod_strings[$fieldlabel]; $fieldvalue [] = $value; @@ -578,8 +584,8 @@ $query = 'select vtiger_attachments.path, vtiger_attachments.attachmentsid, vtiger_attachments.name from vtiger_products left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_products.productid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where productid='.$col_fields['record_id']; } else - { - $query = "select vtiger_attachments.path, vtiger_attachments.attachmentsid, vtiger_attachments.name from vtiger_contactdetails left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_contactdetails.contactid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where contactid=".$col_fields['record_id']; + { + $query = "select vtiger_attachments.* from vtiger_attachments inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid inner join vtiger_contactdetails on vtiger_contactdetails.imagename=vtiger_attachments.name where vtiger_seattachmentsrel.crmid=".$col_fields['record_id']; } $result_image = $adb->query($query); for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++) @@ -857,15 +863,15 @@ $nemail=count($realid); if ($pmodule=='Accounts'){ - require_once('modules/Accounts/Account.php'); - $myfocus = new Account(); + require_once('modules/Accounts/Accounts.php'); + $myfocus = new Accounts(); $myfocus->retrieve_entity_info($entityid,"Accounts"); $fullname=br2nl($myfocus->column_fields['accountname']); $account_selected = 'selected'; } elseif ($pmodule=='Contacts'){ - require_once('modules/Contacts/Contact.php'); - $myfocus = new Contact(); + require_once('modules/Contacts/Contacts.php'); + $myfocus = new Contacts(); $myfocus->retrieve_entity_info($entityid,"Contacts"); $fname=br2nl($myfocus->column_fields['firstname']); $lname=br2nl($myfocus->column_fields['lastname']); @@ -873,8 +879,8 @@ $contact_selected = 'selected'; } elseif ($pmodule=='Leads'){ - require_once('modules/Leads/Lead.php'); - $myfocus = new Lead(); + require_once('modules/Leads/Leads.php'); + $myfocus = new Leads(); $myfocus->retrieve_entity_info($entityid,"Leads"); $fname=br2nl($myfocus->column_fields['firstname']); $lname=br2nl($myfocus->column_fields['lastname']); @@ -1195,12 +1201,14 @@ elseif($uitype == 105) { $editview_label[]=$mod_strings[$fieldlabel]; - $query = "select attachments.path, attachments.name from contactdetails left join seattachmentsrel on seattachmentsrel.crmid=contactdetails.contactid inner join attachments on attachments.attachmentsid=seattachmentsrel.attachmentsid where contactdetails.imagename=attachments.name and contactid=".$col_fields['record_id']; - $result_image = $adb->query($query); - for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++) - { - $image_array[] = $adb->query_result($result_image,$image_iter,'name'); - $image_path_array[] = $adb->query_result($result_image,$image_iter,'path'); + if( isset( $col_fields['record_id']) && $col_fields['record_id'] != '') { + $query = "select vtiger_attachments.path, vtiger_attachments.name from vtiger_contactdetails left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid=vtiger_contactdetails.contactid inner join vtiger_attachments on vtiger_attachments.attachmentsid=vtiger_seattachmentsrel.attachmentsid where vtiger_contactdetails.imagename=vtiger_attachments.name and contactid=".$col_fields['record_id']; + $result_image = $adb->query($query); + for($image_iter=0;$image_iter < $adb->num_rows($result_image);$image_iter++) + { + $image_array[] = $adb->query_result($result_image,$image_iter,'name'); + $image_path_array[] = $adb->query_result($result_image,$image_iter,'path'); + } } if(is_array($image_array)) for($img_itr=0;$img_itrdebug("Exiting getOutputHtml method ..."); return $final_arr; } @@ -1827,4 +1842,104 @@ } +/** This function returns the detailed list of organization units associated to +* the selected organization +* Param $organization - organization object +*/ + +function getOrgUnits($organization,$orgunitid="") +{ + // The array we're about to build + $orgunittab = array(); + $fields = "orgunitid,type,name,address,city,state,country,code,phone,fax,website"; + $fields .= ",logoname,quote_template,so_template,po_template,invoice_template"; + global $adb; + + // Parameter check + if( !isset( $organization) || $organization == '' || + !isset( $organization->id) || $organization->id == '') + return $orgunittab; + + // Database query + if( $orgunitid != "0") + $query = "SELECT vtiger_orgunit.orgunitid AS orgunitid,"; + else + $query = "SELECT 0 AS orgunitid,"; + + // logoname is only defined in the organization record. + $query .= "'@##@' AS logoname, vtiger_organizationdetails.logoname AS org_logoname"; + + foreach( split( ',', $fields) as $field) { + if( $field != "orgunitid" && $field != "logoname") { + if( $orgunitid != "0") + $query .= ",vtiger_orgunit.".$field." AS ".$field; + else + $query .= ",NULL AS ".$field; + if( $field != "type" && $field != "name") + $query .= ",vtiger_organizationdetails.".$field." AS org_".$field; + } + } + + if( $orgunitid != "0" ) { + // database joins + $query .= " FROM vtiger_orgunit + LEFT JOIN vtiger_organizationdetails + ON vtiger_orgunit.organizationname=vtiger_organizationdetails.organizationname "; + + // single or list query? + if( $orgunitid == "") + $query .= "WHERE vtiger_orgunit.organizationname='".$organization->id."' "; + else + $query .= "WHERE vtiger_orgunit.orgunitid=".$orgunitid." "; + + // do not return deleted orgunits + $query .= "AND vtiger_orgunit.deleted=0"; + } + + else { + $query .= " FROM vtiger_organizationdetails "; + $query .= " WHERE vtiger_organizationdetails.organizationname='".$organization->id."' "; + } + + // Do not return deleted organizations + $query .= " AND vtiger_organizationdetails.deleted=0"; + + $result = $adb->query( $query); + $noofrows = $adb->num_rows($result); + + // Get all rows from database + for($j = 0; $j < $noofrows; $j++) { + $orgunit = array(); + foreach( split( ',', $fields) as $field) { + if( $orgunitid != "0") { + $orgunit[$field] = $adb->query_result($result,$j,$field); + + // Inherited and extended fields + if( substr( $orgunit[$field], 0, 4) == "@##@") { + if( $field == "name") { + $orgunit[$field] = substr($orgunit[$field], 4, strlen( $orgunit[$field])-4); + if( $orgunitid != "") + $orgunit[$field] = $organization->id." ".$orgunit[$field]; + } else { + $orgunit[$field] = $adb->query_result($result,$j,"org_".$field); + } + } + } + + // no orgunit selected + else { + if( $field == "name") + $orgunit[$field] = $organization->id; + elseif( $field == "orgunitid") + $orgunit[$field] = 0; + else + $orgunit[$field] = $adb->query_result($result,$j,"org_".$field); + } + } + $id = $orgunit["orgunitid"]; + $orgunittab[$id] = $orgunit; + } + // Return what we've found + return $orgunittab; +} ?> Modified: vtigercrm/branches/5.1_jens/include/utils/InventoryUtils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/InventoryUtils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/InventoryUtils.php Tue Nov 14 03:16:10 2006 @@ -469,7 +469,7 @@ * @param $update_prod_stock - true or false (default), if true we have to update the stock for PO only * @return void */ -function saveInventoryProductDetails($focus, $module, $update_prod_stock='false') +function saveInventoryProductDetails($focus, $module, $update_prod_stock='false', $updateDemand='') { global $log, $adb; $log->debug("Entering into function saveInventoryProductDetails($focus, $module)."); @@ -488,6 +488,10 @@ } $tot_no_prod = $_REQUEST['totalProductCount']; + + //If the taxtype is group then retrieve all available taxes, else retrive associated taxes for each product inside loop + if($_REQUEST['taxtype'] == 'group') + $all_available_taxes = getAllTaxes('available'); $prod_seq=1; for($i=1; $i<=$tot_no_prod; $i++) @@ -508,6 +512,17 @@ { addToProductStock($prod_id,$qty); } + if($module == 'SalesOrder') + { + if($updateDemand == '-') + { + deductFromProductDemand($prod_id,$qty); + } + elseif($updateDemand == '+') + { + addToProductDemand($prod_id,$qty); + } + } $query ="insert into vtiger_inventoryproductrel(id, productid, sequence_no, quantity, listprice, comment) values($focus->id, $prod_id , $prod_seq, $qty, $listprice, '$comment')"; $prod_seq++; @@ -519,8 +534,6 @@ updateStk($prod_id,$qty,$focus->mode,$ext_prod_arr,$module); } - $taxes_for_product = getTaxDetailsForProduct($prod_id,'all'); - //we should update discount and tax details $updatequery = "update vtiger_inventoryproductrel set "; @@ -535,12 +548,11 @@ $updatequery .= " discount_amount='".$discount_amount."',"; } - if($_REQUEST['taxtype'] == 'group') { - for($tax_count=0;$tax_countquery_result($list_result,$i-1,"organizationname"); + }elseif($module != 'Users') { $entity_id = $adb->query_result($list_result,$i-1,"crmid"); $owner_id = $adb->query_result($list_result,$i-1,"smownerid"); @@ -538,22 +541,25 @@ } // Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2 // begin: Armando L??scher 05.07.2005 -> ??priority - // Code contri buted by fredy Desc: Set Priority color - $priority = $adb->query_result($list_result,$i-1,"priority"); - - $font_color_high = "color:#00DD00;"; - $font_color_medium = "color:#DD00DD;"; - $P_FONT_COLOR = ""; - switch ($priority) - { - case 'High': - $P_FONT_COLOR = $font_color_high; - break; - case 'Medium': - $P_FONT_COLOR = $font_color_medium; - break; - default: - $P_FONT_COLOR = ""; + // Code contributed by fredy Desc: Set Priority color + if($module != 'Organization') + { + $priority = $adb->query_result($list_result,$i-1,"priority"); + + $font_color_high = "color:#00DD00;"; + $font_color_medium = "color:#DD00DD;"; + $P_FONT_COLOR = ""; + switch ($priority) + { + case 'High': + $P_FONT_COLOR = $font_color_high; + break; + case 'Medium': + $P_FONT_COLOR = $font_color_medium; + break; + default: + $P_FONT_COLOR = ""; + } } //end: Armando L??scher 05.07.2005 -> ??priority @@ -572,9 +578,6 @@ if($is_admin==true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] ==0 || in_array($fieldname,$field)) { - - - if($fieldname == '') { $table_name = ''; @@ -772,7 +775,6 @@ } $log->debug("Exiting getListViewEntries method ..."); return $list_block; - } /**This function generates the List view entries in a popup list view @@ -861,9 +863,11 @@ { for ($i=$navigation_array['start']; $i<=$navigation_array['end_val']; $i++) { - //Getting the entityid - if($module != 'Users') + if($module == 'Organization') + { + $entity_id = $adb->query_result($list_result,$i-1,"organizationname"); + }elseif($module != 'Users') { $entity_id = $adb->query_result($list_result,$i-1,"crmid"); }else @@ -1275,6 +1279,16 @@ else $value=''; } + elseif($uitype == 74) + { + if($temp_val != '') + { + $orgunitname=getOrgUnitName($temp_val); + $value= ''.$orgunitname.''; + } + else + $value=''; + } elseif($uitype == 75 || $uitype == 81) { @@ -1309,12 +1323,13 @@ } $temp_val = str_replace("'",'\"',$temp_val); + $temp_val = popup_from_html($temp_val); //Added to avoid the error when select SO from Invoice through AjaxEdit if($module == 'SalesOrder') - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; else - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; } elseif($popuptype == "detailview") { @@ -1323,18 +1338,20 @@ elseif($colname == "lastname" && $module == 'Leads') $firstname=$adb->query_result($list_result,$list_result_count,'firstname'); $temp_val =$temp_val.' '.$firstname; + $temp_val = popup_from_html($temp_val); $focus->record_id = $_REQUEST['recordid']; if($_REQUEST['return_module'] == "Calendar") { - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; } else - $value = 'record_id.'","'.$module.'"); window.close()\'>'.$temp_val.''; + $value = 'record_id.'","'.$module.'");\'>'.$temp_val.''; } elseif($popuptype == "formname_specific") { - $value = ''.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } elseif($popuptype == "inventory_prod") { @@ -1354,7 +1371,8 @@ $unitprice = convertFromDollar($unitprice,$rate); $qty_stock=$adb->query_result($list_result,$list_result_count,'qtyinstock'); - $value = ''.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } elseif($popuptype == "inventory_prod_po") { @@ -1372,7 +1390,9 @@ $rate = $rate_symbol['rate']; $unitprice=$adb->query_result($list_result,$list_result_count,'unit_price'); $unitprice = convertFromDollar($unitprice,$rate); - $value = ''.$temp_val.''; + + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } elseif($popuptype == "inventory_pb") { @@ -1381,36 +1401,39 @@ $flname = $_REQUEST['fldname']; $listprice=getListPrice($prod_id,$entity_id); - $value = ''.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } elseif($popuptype == "specific_account_address") { - require_once('modules/Accounts/Account.php'); - $acct_focus = new Account(); + require_once('modules/Accounts/Accounts.php'); + $acct_focus = new Accounts(); $acct_focus->retrieve_entity_info($entity_id,"Accounts"); - $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'"); window.close()\'>'.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.''; } elseif($popuptype == "specific_contact_account_address") { - require_once('modules/Accounts/Account.php'); - $acct_focus = new Account(); + require_once('modules/Accounts/Accounts.php'); + $acct_focus = new Accounts(); $acct_focus->retrieve_entity_info($entity_id,"Accounts"); - $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'"); window.close()\'>'.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.''; } - elseif($popuptype == "specific_potential_account_address") { $acntid = $adb->query_result($list_result,$list_result_count,"accountid"); - require_once('modules/Accounts/Account.php'); - $acct_focus = new Account(); + require_once('modules/Accounts/Accounts.php'); + $acct_focus = new Accounts(); $acct_focus->retrieve_entity_info($acntid,"Accounts"); $account_name = getAccountName($acntid); - $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'"); window.close()\'>'.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = 'column_fields['bill_street']).'", "'.br2nl($acct_focus->column_fields['ship_street']).'", "'.br2nl($acct_focus->column_fields['bill_city']).'", "'.br2nl($acct_focus->column_fields['ship_city']).'", "'.br2nl($acct_focus->column_fields['bill_state']).'", "'.br2nl($acct_focus->column_fields['ship_state']).'", "'.br2nl($acct_focus->column_fields['bill_code']).'", "'.br2nl($acct_focus->column_fields['ship_code']).'", "'.br2nl($acct_focus->column_fields['bill_country']).'", "'.br2nl($acct_focus->column_fields['ship_country']).'","'.br2nl($acct_focus->column_fields['bill_pobox']).'", "'.br2nl($acct_focus->column_fields['ship_pobox']).'");\'>'.$temp_val.''; } //added by rdhital/Raju for better emails @@ -1429,7 +1452,7 @@ //Change this index 0 - to get the vtiger_fieldid based on email1 or email2 $fieldid = $adb->query_result($queryres,0,'fieldid'); - $value = ''.$name.''; + $value = ''.$name.''; }elseif ($module=='Contacts' || $module=='Leads') { @@ -1445,7 +1468,7 @@ //Change this index 0 - to get the vtiger_fieldid based on email or yahooid $fieldid = $adb->query_result($queryres,0,'fieldid'); - $value = ''.$name.''; + $value = ''.$name.''; }else { @@ -1454,23 +1477,25 @@ $name=$lastname.' '.$firstname; $emailaddress=$adb->query_result($list_result,$list_result_count,"email1"); - $value = ''.$name.''; + $value = ''.$name.''; } } elseif($popuptype == "specific_vendor_address") { - require_once('modules/Vendors/Vendor.php'); - $acct_focus = new Vendor(); + require_once('modules/Vendors/Vendors.php'); + $acct_focus = new Vendors(); $acct_focus->retrieve_entity_info($entity_id,"Vendors"); - $value = 'column_fields['street']).'", "'.br2nl($acct_focus->column_fields['city']).'", "'.br2nl($acct_focus->column_fields['state']).'", "'.br2nl($acct_focus->column_fields['postalcode']).'", "'.br2nl($acct_focus->column_fields['country']).'","'.br2nl($acct_focus->column_fields['pobox']).'"); window.close()\'>'.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = 'column_fields['street']).'", "'.br2nl($acct_focus->column_fields['city']).'", "'.br2nl($acct_focus->column_fields['state']).'", "'.br2nl($acct_focus->column_fields['postalcode']).'", "'.br2nl($acct_focus->column_fields['country']).'","'.br2nl($acct_focus->column_fields['pobox']).'");\'>'.$temp_val.''; } elseif($popuptype == "specific_campaign") { - $value = ''.$temp_val.''; + $temp_val = popup_from_html($temp_val); + $value = ''.$temp_val.''; } else { @@ -1479,12 +1504,13 @@ $temp_val =$temp_val.' '.$firstname; $temp_val = str_replace("'",'\"',$temp_val); + $temp_val = popup_from_html($temp_val); $log->debug("Exiting getValue method ..."); if($_REQUEST['maintab'] == 'Calendar') - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; else - $value = ''.$temp_val.''; + $value = ''.$temp_val.''; } } else @@ -1576,6 +1602,7 @@ function getListQuery($module,$where='') { global $log; + global $current_organization; $log->debug("Entering getListQuery(".$module.",".$where.") method ..."); global $current_user; @@ -1595,6 +1622,9 @@ ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_ticketgrouprelation ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid LEFT JOIN vtiger_groups @@ -1628,6 +1658,9 @@ FROM vtiger_account INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_account.accountid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_accountbillads ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid INNER JOIN vtiger_accountshipads @@ -1692,6 +1725,9 @@ FROM vtiger_potential INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_potential.potentialid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_account ON vtiger_potential.accountid = vtiger_account.accountid INNER JOIN vtiger_potentialscf @@ -1722,6 +1758,9 @@ FROM vtiger_leaddetails INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_leaddetails.leadid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_leadsubdetails ON vtiger_leadsubdetails.leadsubscriptionid = vtiger_leaddetails.leadid INNER JOIN vtiger_leadaddress @@ -1748,6 +1787,9 @@ FROM vtiger_products INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_products.productid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_productcf ON vtiger_products.productid = vtiger_productcf.productid LEFT JOIN vtiger_seproductsrel @@ -1771,6 +1813,9 @@ FROM vtiger_notes INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_notes.notesid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_senotesrel ON vtiger_senotesrel.notesid = vtiger_notes.notesid LEFT JOIN vtiger_contactdetails @@ -1798,6 +1843,9 @@ FROM vtiger_contactdetails INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_contactaddress ON vtiger_contactdetails.contactid = vtiger_contactaddress.contactaddressid INNER JOIN vtiger_contactsubdetails @@ -1831,6 +1879,9 @@ FROM vtiger_activity INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_cntactivityrel ON vtiger_cntactivityrel.activityid = vtiger_activity.activityid LEFT JOIN vtiger_contactdetails @@ -1870,6 +1921,9 @@ FROM vtiger_activity INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_activity.activityid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid LEFT JOIN vtiger_seactivityrel @@ -1903,6 +1957,9 @@ FROM vtiger_faq INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_faq.id + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_products ON vtiger_faq.product_id = vtiger_products.productid WHERE vtiger_crmentity.deleted = 0".$where; @@ -1920,6 +1977,9 @@ FROM vtiger_vendor INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_vendor.vendorid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' WHERE vtiger_crmentity.deleted = 0"; } if($module == "PriceBooks") @@ -1942,6 +2002,9 @@ FROM vtiger_quotes INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_quotes.quoteid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_quotesbillads ON vtiger_quotes.quoteid = vtiger_quotesbillads.quotebilladdressid INNER JOIN vtiger_quotesshipads @@ -1976,6 +2039,9 @@ FROM vtiger_purchaseorder INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_purchaseorder.purchaseorderid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT OUTER JOIN vtiger_vendor ON vtiger_purchaseorder.vendorid = vtiger_vendor.vendorid INNER JOIN vtiger_pobillads @@ -2009,6 +2075,9 @@ FROM vtiger_salesorder INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_sobillads ON vtiger_salesorder.salesorderid = vtiger_sobillads.sobilladdressid INNER JOIN vtiger_soshipads @@ -2045,6 +2114,9 @@ FROM vtiger_invoice INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' INNER JOIN vtiger_invoicebillads ON vtiger_invoice.invoiceid = vtiger_invoicebillads.invoicebilladdressid INNER JOIN vtiger_invoiceshipads @@ -2077,8 +2149,13 @@ FROM vtiger_campaign INNER JOIN vtiger_crmentity ON vtiger_crmentity.crmid = vtiger_campaign.campaignid + INNER JOIN vtiger_entity2org + ON vtiger_crmentity.crmid = vtiger_entity2org.crmid + AND vtiger_entity2org.organizationname = '".$current_organization."' LEFT JOIN vtiger_campaigngrouprelation ON vtiger_campaign.campaignid = vtiger_campaigngrouprelation.campaignid + INNER JOIN vtiger_campaignscf + ON vtiger_campaign.campaignid = vtiger_campaignscf.campaignid LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_campaigngrouprelation.groupname LEFT JOIN vtiger_users @@ -2094,9 +2171,13 @@ { $query = "select id,user_name,roleid,first_name,last_name,email1,phone_mobile,phone_work,is_admin,status from vtiger_users inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where deleted=0 ".$where ; } + if($module == "Organization") + { + $query = "SELECT organizationname,address,city,state,code FROM vtiger_organizationdetails where deleted=0 ".$where; + } - $log->debug("Exiting getListQuery method ..."); + $log->debug("Exiting getListQuery method ... "); return $query; } Modified: vtigercrm/branches/5.1_jens/include/utils/UserInfoUtil.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/UserInfoUtil.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/UserInfoUtil.php Tue Nov 14 03:16:10 2006 @@ -1346,6 +1346,23 @@ $log->debug("Exiting getProfileName method ..."); return $profilename; } +/** Function to get the vtiger_profile Description from the vtiger_profileid + * @param $profileid -- Profile Id:: Type integer + * @returns $rolename -- Role Name:: Type varchar + * + */ +function getProfileDescription($profileid) +{ + global $log; + $log->debug("Entering getProfileDescription(".$profileid.") method ..."); + global $adb; + $sql1 = "select description from vtiger_profile where profileid=".$profileid; + $result = $adb->query($sql1); + $profileDescription = $adb->query_result($result,0,"description"); + $log->debug("Exiting getProfileName method ..."); + return $profileDescription; +} + /** Function to check if the currently logged in user is permitted to perform the specified action * @param $module -- Module Name:: Type varchar Modified: vtigercrm/branches/5.1_jens/include/utils/export.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/export.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/export.php Tue Nov 14 03:16:10 2006 @@ -20,23 +20,23 @@ require_once('config.php'); require_once('include/logging.php'); require_once('include/database/PearDatabase.php'); -require_once('modules/Accounts/Account.php'); -require_once('modules/Contacts/Contact.php'); -require_once('modules/Leads/Lead.php'); -require_once('modules/Contacts/Contact.php'); -require_once('modules/Emails/Email.php'); +require_once('modules/Accounts/Accounts.php'); +require_once('modules/Contacts/Contacts.php'); +require_once('modules/Leads/Leads.php'); +require_once('modules/Contacts/Contacts.php'); +require_once('modules/Emails/Emails.php'); require_once('modules/Calendar/Activity.php'); -require_once('modules/Notes/Note.php'); -require_once('modules/Potentials/Opportunity.php'); -require_once('modules/Users/User.php'); -require_once('modules/Products/Product.php'); +require_once('modules/Notes/Notes.php'); +require_once('modules/Potentials/Potentials.php'); +require_once('modules/Users/Users.php'); +require_once('modules/Products/Products.php'); require_once('include/utils/UserInfoUtil.php'); global $allow_exports; session_start(); -$current_user = new User(); +$current_user = new Users(); if(isset($_SESSION['authenticated_user_id'])) { @@ -87,51 +87,15 @@ { global $log; $log->debug("Entering export_all(".$type.") method ..."); - $contact_fields = Array(); - $account_fields = Array(); global $adb; + $focus = 0; $content = ''; - if ($type == "Contacts") + if ($type != "") { - $focus = new Contact; + $focus = new $type; } - else if ($type == "Accounts") - { - $focus = new Account; - $exp_query="SELECT columnname, fieldlabel FROM vtiger_field where tabid=6"; - $account_result=$adb->query($exp_query); - if($adb->num_rows($account_result)!=0) - { - while($result = $adb->fetch_array($account_result)) - { - $account_columnname = $result['columnname']; - $account_fieldlabel = $result['fieldlabel']; - $account_fields[$account_columnname] = $account_fieldlabel; - } - } - } - else if ($type == "Potentials") - { - $focus = new Potential; - } - else if ($type == "Notes") - { - $focus = new Note; - } - else if ($type == "Leads") - { - $focus = new Lead; - } - else if ($type == "Emails") - { - $focus = new Email; - } - else if ($type == "Products") - { - $focus = new Product; - } $log = LoggerManager::getLogger('export_'.$type); $db = new PearDatabase(); Modified: vtigercrm/branches/5.1_jens/include/utils/utils.php ============================================================================== --- vtigercrm/branches/5.1_jens/include/utils/utils.php (original) +++ vtigercrm/branches/5.1_jens/include/utils/utils.php Tue Nov 14 03:16:10 2006 @@ -385,6 +385,35 @@ $return_value = $mod_strings; $mod_strings = $temp_mod_strings; + + $log->debug("Exiting return_module_language method ..."); + return $return_value; +} + +/*This function returns the mod_strings for the current language and the specified module +*/ + +function return_specified_module_language($language, $module) +{ + global $log; + global $default_language, $translation_string_prefix; + + @include("modules/$module/language/$language.lang.php"); + if(!isset($mod_strings)) + { + $log->warn("Unable to find the module language file for language: ".$language." and module: ".$module); + require("modules/$module/language/$default_language.lang.php"); + $language_used = $default_language; + } + + if(!isset($mod_strings)) + { + $log->fatal("Unable to load the module($module) language file for the selected language($language) or the default language($default_language)"); + $log->debug("Exiting return_module_language method ..."); + return null; + } + + $return_value = $mod_strings; $log->debug("Exiting return_module_language method ..."); return $return_value; @@ -837,7 +866,8 @@ $log->debug("Entering to_html(".$string.",".$encode.") method ..."); global $toHtml; if($encode && is_string($string)){//$string = htmlentities($string, ENT_QUOTES); - $string = str_replace(array_keys($toHtml), array_values($toHtml), $string); + if (is_array($toHtml)) + $string = str_replace(array_keys($toHtml), array_values($toHtml), $string); } $log->debug("Exiting to_html method ..."); return $string; @@ -947,8 +977,11 @@ $noofrows = $adb->num_rows($result); for($i=0; $i<$noofrows; $i++) { + $uitype = $adb->query_result($result,$i,"uitype"); $fieldname = $adb->query_result($result,$i,"fieldname"); $column_fld[$fieldname] = ''; + if( $uitype == 3 || $uitype == 4 || $uitype == 18 || $uitype == 31 || $uitype == 32) + $column_fld[$fieldname."@##@"] = 0; } $log->debug("Exiting getColumnFields method ..."); return $column_fld; @@ -2047,9 +2080,9 @@ $log->debug("Entering getEmailParentsList(".$module.",".$id.") method ..."); global $adb; if($module == 'Contacts') - $focus = new Contact(); + $focus = new Contacts(); if($module == 'Leads') - $focus = new Lead(); + $focus = new Leads(); $focus->retrieve_entity_info($id,$module); $fieldid = 0; @@ -2104,6 +2137,59 @@ $log->debug("Exiting addToProductStock method ..."); } + +/** This Function adds the specified product quantity to the Product Quantity in Demand in the Warehouse + * @param int $productId - ProductId + * @param int $qty - Quantity to be added + */ +function addToProductDemand($productId,$qty) +{ + global $log; + $log->debug("Entering addToProductDemand(".$productId.",".$qty.") method ..."); + global $adb; + $qtyInStck=getProductQtyInDemand($productId); + $updQty=$qtyInStck + $qty; + $sql = "UPDATE vtiger_products set qtyindemand=$updQty where productid=".$productId; + $adb->query($sql); + $log->debug("Exiting addToProductDemand method ..."); + +} + +/** This Function subtract the specified product quantity to the Product Quantity in Stock in the Warehouse + * @param int $productId - ProductId + * @param int $qty - Quantity to be subtracted + */ +function deductFromProductStock($productId,$qty) +{ + global $log; + $log->debug("Entering deductFromProductStock(".$productId.",".$qty.") method ..."); + global $adb; + $qtyInStck=getProductQtyInStock($productId); + $updQty=$qtyInStck - $qty; + $sql = "UPDATE vtiger_products set qtyinstock=$updQty where productid=".$productId; + $adb->query($sql); + $log->debug("Exiting deductFromProductStock method ..."); + +} + +/** This Function subtract the specified product quantity to the Product Quantity in Demand in the Warehouse + * @param int $productId - ProductId + * @param int $qty - Quantity to be subtract + */ +function deductFromProductDemand($productId,$qty) +{ + global $log; + $log->debug("Entering deductFromProductDemand(".$productId.",".$qty.") method ..."); + global $adb; + $qtyInStck=getProductQtyInDemand($productId); + $updQty=$qtyInStck - $qty; + $sql = "UPDATE vtiger_products set qtyindemand=$updQty where productid=".$productId; + $adb->query($sql); + $log->debug("Exiting deductFromProductDemand method ..."); + +} + + /** This Function returns the current product quantity in stock. * The following is the input parameter for the function: * $product_id --> ProductId, Type:Integer @@ -2121,6 +2207,23 @@ } + +/** This Function returns the current product quantity in demand. + * @param int $product_id - ProductId + * @return int $qtyInDemand - Quantity in Demand of a product + */ +function getProductQtyInDemand($product_id) +{ + global $log; + $log->debug("Entering getProductQtyInDemand(".$product_id.") method ..."); + global $adb; + $query1 = "select qtyindemand from vtiger_products where productid=".$product_id; + $result = $adb->query($query1); + $qtyInDemand = $adb->query_result($result,0,"qtyindemand"); + $log->debug("Exiting getProductQtyInDemand method ..."); + return $qtyInDemand; +} + /** Function to seperate the Date and Time * This function accepts a sting with date and time and * returns an array of two elements.The first element @@ -2175,6 +2278,12 @@ { $tablename = $adb->query_result($res,0,'tablename'); } + + //Since the introduction of the entity2org table, crmid has become + //ambiguous. So we need to explicitely set the vtiger_crmentity table + //in this case ... + if( $tablename == '' && $fieldname == 'crmid') + $tablename = 'vtiger_crmentity'; $log->debug("Exiting getTableNameForField method ..."); return $tablename; @@ -2617,4 +2726,40 @@ global $current_user,$adb; return $adb->query_result($adb->query("select int_mailer from vtiger_mail_accounts where user_id='".$current_user->id."'"),0,"int_mailer"); } + +/** +* the function is like unescape in javascript +* added by dingjianting on 2006-10-1 for picklist editor +*/ +function utf8RawUrlDecode ($source) { + $decodedStr = ""; + $pos = 0; + $len = strlen ($source); + while ($pos < $len) { + $charAt = substr ($source, $pos, 1); + if ($charAt == '%') { + $pos++; + $charAt = substr ($source, $pos, 1); + if ($charAt == 'u') { + // we got a unicode character + $pos++; + $unicodeHexVal = substr ($source, $pos, 4); + $unicode = hexdec ($unicodeHexVal); + $entity = "&#". $unicode . ';'; + $decodedStr .= utf8_encode ($entity); + $pos += 4; + } + else { + // we have an escaped ascii character + $hexVal = substr ($source, $pos, 2); + $decodedStr .= chr (hexdec ($hexVal)); + $pos += 2; + } + } else { + $decodedStr .= $charAt; + $pos++; + } + } + return $decodedStr; +} ?> Modified: vtigercrm/branches/5.1_jens/index.php ============================================================================== --- vtigercrm/branches/5.1_jens/index.php (original) +++ vtigercrm/branches/5.1_jens/index.php Tue Nov 14 03:16:10 2006 @@ -101,7 +101,7 @@ set_default_config($default_config_values); require_once('include/logging.php'); -require_once('modules/Users/User.php'); +require_once('modules/Users/Users.php'); global $currentModule; @@ -164,7 +164,7 @@ } //Code added for 'Multiple SQL Injection Vulnerabilities & XSS issue' fixes - Philip -if(isset($_REQUEST['record']) && !is_numeric($_REQUEST['record']) && $_REQUEST['record']!='') +if(isset($_REQUEST['record']) && $module!="Organization" && !is_numeric($_REQUEST['record']) && $_REQUEST['record']!='') { die("An invalid record number specified to view details."); } @@ -350,9 +350,15 @@ $action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : ""; $record = (isset($_REQUEST['record'])) ? $_REQUEST['record'] : ""; $lang_crm = (isset($_SESSION['authenticated_user_language'])) ? $_SESSION['authenticated_user_language'] : ""; + +if( isset($_REQUEST['org']) && $_REQUEST['org'] != '') { + $_SESSION['authenticated_user_current_organization'] = $_REQUEST['org']; + $log->debug("Change organization for user id ".$current_user->id.":".$_REQUEST['org']); +} + $GLOBALS['request_string'] = "&module=$module&action=$action&record=$record&lang_crm=$lang_crm"; -$current_user = new User(); +$current_user = new Users(); if($use_current_login) { @@ -417,6 +423,58 @@ } $log->debug('current_language is: '.$current_language); +//Current Organization +if( $use_current_login) { + if(isset($_SESSION['authenticated_user_organizations']) && $_SESSION['authenticated_user_organizations'] != '') { + $user_organizations = $_SESSION['authenticated_user_organizations']; + + } else { + $user_org_query = "SELECT organizationname,primarytag FROM vtiger_user2org WHERE userid=".$current_user->id; + $user_org_result = $adb->query($user_org_query); + $user_organizations = ''; + $current_organization = ''; + while($user_org = $adb->fetch_array($user_org_result)) { + if( $user_organizations != '') + $user_organizations .= "|"; + $user_organizations .= $user_org["organizationname"]; + if( $user_org["primarytag"] == 1) + $current_organization = $user_org["organizationname"]; + } + if( $current_organization == '') { + if( strpos($user_organizations,"|")) { + $current_organization = substr($user_organizations,0,strpos($user_organizations,"|")); + } else { + $current_organization = $user_organizations; + } + } + + $_SESSION['authenticated_user_organizations'] = $user_organizations; + $log->debug("Reloaded organizations for user id ".$current_user->id.":".$user_organizations); + $log->debug("Primary organization for user id ".$current_user->id.":".$current_organization); + } + + if(isset($_SESSION['authenticated_user_current_organization']) && $_SESSION['authenticated_user_current_organization'] != '') { + $current_organization = $_SESSION['authenticated_user_current_organization']; + $log->debug("Current organization for user id ".$current_user->id.":".$current_organization); + + } else { + if( $current_organization == '') { + $current_organization = "-- NONE --"; + } else { + $_SESSION['authenticated_user_current_organization'] = $current_organization; + } + } + +//No user authenticated, thus no organizations +} else { + $_SESSION['authenticated_user_current_organization'] = ''; + $_SESSION['authenticated_user_organizations'] = ''; +} + +//As long as we are modifying an existing record, the default organization may +//not change +$org_change_ok = ($record != "" || $action == "EditView") ? 0 : 1; + //set module and application string arrays based upon selected language $app_strings = return_application_language($current_language); $app_list_strings = return_app_list_strings_language($current_language); @@ -432,90 +490,22 @@ // Use the record to track the viewing. // todo - Have a record of modules and thier primary object names. //Getting the actual module - $actualModule = $currentModule; switch($currentModule) { - case 'Leads': - require_once("modules/$currentModule/Lead.php"); - $focus = new Lead(); - break; - case 'Contacts': - require_once("modules/$currentModule/Contact.php"); - $focus = new Contact(); - break; - case 'Accounts': - require_once("modules/$currentModule/Account.php"); - $focus = new Account(); - break; - case 'Potentials': - require_once("modules/$currentModule/Opportunity.php"); - $focus = new Potential(); - break; case 'Calendar': require_once("modules/$currentModule/Activity.php"); $focus = new Activity(); break; - case 'Notes': - require_once("modules/$currentModule/Note.php"); - $focus = new Note(); - break; - case 'Emails': - require_once("modules/$currentModule/Email.php"); - $focus = new Email(); - break; - case 'Users': - require_once("modules/$currentModule/User.php"); - $focus = new User(); - break; - case 'Products': - require_once("modules/$currentModule/Product.php"); - $focus = new Product(); - break; - case 'Vendors': - require_once("modules/$currentModule/Vendor.php"); - $focus = new Vendor(); - $actualModule = 'Vendors'; - break; - case 'PriceBooks': - require_once("modules/$currentModule/PriceBook.php"); - $focus = new PriceBook(); - $actualModule = 'PriceBooks'; - break; - case 'HelpDesk': - require_once("modules/$currentModule/HelpDesk.php"); - $focus = new HelpDesk(); - break; - case 'Faq': - require_once("modules/$currentModule/Faq.php"); - $focus = new Faq(); - break; - case 'Quotes': - require_once("modules/$currentModule/Quote.php"); - $focus = new Quote(); - break; - case 'PurchaseOrder': - require_once("modules/$currentModule/PurchaseOrder.php"); - $focus = new Order(); - break; - case 'SalesOrder': - require_once("modules/$currentModule/SalesOrder.php"); - $focus = new SalesOrder(); - break; - - case 'Invoice': - require_once("modules/$currentModule/Invoice.php"); - $focus = new Invoice(); - break; - case 'Campaigns': - require_once("modules/$currentModule/Campaign.php"); - $focus = new Campaign(); + default: + require_once("modules/$currentModule/$currentModule.php"); + $focus = new $currentModule(); break; } if(isset($_REQUEST['record']) && $_REQUEST['record']!='' && $_REQUEST["module"] != "Webmails") { // Only track a viewing if the record was retrieved. - $focus->track_view($current_user->id, $actualModule,$_REQUEST['record']); + $focus->track_view($current_user->id, $currentModule,$_REQUEST['record']); } } @@ -586,6 +576,7 @@ if(!$skipSecurityCheck) { + require_once('include/utils/UserInfoUtil.php'); @@ -707,7 +698,7 @@ echo ""; echo ''; echo "


"; - echo ""; + echo ""; echo "
vtiger CRM 5.0.0 | Visit www.vtiger.com for more information
vtiger CRM 5.0.2 | Visit www.vtiger.com for more information © Copyright Details
"; // echo "'; - } - - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - //SQL - $query = "SELECT vtiger_contactdetails.*, - vtiger_crmentity.crmid, - vtiger_crmentity.smownerid, - vtiger_users.user_name - FROM vtiger_contactdetails - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_contactdetails.accountid = ".$id; - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Accounts','Contacts',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated opportunities - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_opportunities($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_opportunities(".$id.") method ..."); - global $mod_strings; - - $focus = new Potential(); - $button = ''; - - if(isPermitted("Potentials",1,"") == 'yes') - { - $button .= ''; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_potential.potentialid, vtiger_potential.accountid, - vtiger_potential.potentialname, vtiger_potential.sales_stage, - vtiger_potential.potentialtype, vtiger_potential.amount, - vtiger_potential.closingdate, vtiger_potential.potentialtype, - vtiger_users.user_name, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid - FROM vtiger_potential - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_potential.potentialid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - LEFT JOIN vtiger_potentialgrouprelation - ON vtiger_potential.potentialid = vtiger_potentialgrouprelation.potentialid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_potentialgrouprelation.groupname - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_potential.accountid = ".$id; - $log->debug("Exiting get_opportunities method ..."); - - return GetRelatedList('Accounts','Potentials',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated tasks - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_activities($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - - $focus = new Activity(); - $button = ''; - if(isPermitted("Calendar",1,"") == 'yes') - { - - $button .= ' '; - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_activity.*, - vtiger_seactivityrel.*, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid, - vtiger_crmentity.modifiedtime, - vtiger_users.user_name, - vtiger_recurringevents.recurringtype - FROM vtiger_activity - INNER JOIN vtiger_seactivityrel - ON vtiger_seactivityrel.activityid = vtiger_activity.activityid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_activity.activityid - LEFT JOIN vtiger_users - ON vtiger_users.id = vtiger_crmentity.smownerid - LEFT OUTER JOIN vtiger_recurringevents - ON vtiger_recurringevents.activityid = vtiger_activity.activityid - LEFT JOIN vtiger_activitygrouprelation - ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname - WHERE vtiger_seactivityrel.crmid = ".$id." - AND (activitytype='Task' - OR activitytype='Call' - OR activitytype='Meeting') - AND vtiger_crmentity.deleted = 0 - AND ((vtiger_activity.status IS NOT NULL - AND vtiger_activity.status != 'Completed') - AND (vtiger_activity.status IS NOT NULL - AND vtiger_activity.status != 'Deferred') - OR (vtiger_activity.eventstatus !='' - AND vtiger_activity.eventstatus != 'Held'))"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Accounts','Calendar',$focus,$query,$button,$returnset); - - } - /** - * Function to get Account related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - accountid - * returns related Task or Event record in array format - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, - vtiger_activity.status, vtiger_activity.eventstatus, - vtiger_activity.activitytype, - vtiger_crmentity.modifiedtime, vtiger_crmentity.createdtime, - vtiger_crmentity.description, - vtiger_users.user_name - FROM vtiger_activity - INNER JOIN vtiger_seactivityrel - ON vtiger_seactivityrel.activityid = vtiger_activity.activityid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_activity.activityid - LEFT JOIN vtiger_activitygrouprelation - ON vtiger_activitygrouprelation.activityid = vtiger_activity.activityid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname - INNER JOIN vtiger_users - ON vtiger_crmentity.smcreatorid = vtiger_users.id - WHERE (vtiger_activity.activitytype = 'Meeting' - OR vtiger_activity.activitytype = 'Call' - OR vtiger_activity.activitytype = 'Task') - AND (vtiger_activity.status = 'Completed' - OR vtiger_activity.status = 'Deferred' - OR (vtiger_activity.eventstatus = 'Held' - AND vtiger_activity.eventstatus != '')) - AND vtiger_seactivityrel.crmid = ".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - $log->debug("Exiting get_history method ..."); - return getHistory('Accounts',$query,$id); - } - /** - * Function to get Account related Attachments - * @param integer $id - accountid - * returns related Attachment record in array format - */ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - $query = "SELECT vtiger_notes.title, vtiger_notes.notecontent AS description, - vtiger_notes.filename, vtiger_notes.notesid AS crmid, - 'Notes ' AS ActivityType, - vtiger_attachments.type AS FileType, - crm2.modifiedtime AS lastmodified, crm2.createdtime, - vtiger_seattachmentsrel.attachmentsid, - vtiger_users.user_name - FROM vtiger_notes - INNER JOIN vtiger_senotesrel - ON vtiger_senotesrel.notesid = vtiger_notes.notesid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_senotesrel.crmid - INNER JOIN vtiger_crmentity crm2 - ON crm2.crmid = vtiger_notes.notesid - AND crm2.deleted = 0 - LEFT JOIN vtiger_seattachmentsrel - ON vtiger_seattachmentsrel.crmid = vtiger_notes.notesid - LEFT JOIN vtiger_attachments - ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_users - ON crm2.smcreatorid = vtiger_users.id - WHERE vtiger_crmentity.crmid = ".$id." - UNION ALL - SELECT vtiger_attachments.description AS title, vtiger_attachments.description, - vtiger_attachments.name AS filename, - vtiger_seattachmentsrel.attachmentsid AS crmid, - 'Attachments' AS ActivityType, - vtiger_attachments.type AS FileType, - crm2.modifiedtime AS lastmodified, crm2.createdtime, - vtiger_attachments.attachmentsid, - vtiger_users.user_name - FROM vtiger_attachments - INNER JOIN vtiger_seattachmentsrel - ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_seattachmentsrel.crmid - INNER JOIN vtiger_crmentity crm2 - ON crm2.crmid = vtiger_attachments.attachmentsid - INNER JOIN vtiger_users - ON crm2.smcreatorid = vtiger_users.id - WHERE vtiger_crmentity.crmid = ".$id." - ORDER BY createdtime DESC"; - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Accounts',$query,$id); - } - /** - * Function to get Account related Quotes - * @param integer $id - accountid - * returns related Quotes record in array format - */ - function get_quotes($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_quotes(".$id.") method ..."); - global $app_strings; - require_once('modules/Quotes/Quote.php'); - - $focus = new Quote(); - - $button = ''; - if(isPermitted("Quotes",1,"") == 'yes') - { - $button .= ' '; - } - - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, - vtiger_groups.groupname, - vtiger_crmentity.*, - vtiger_quotes.*, - vtiger_potential.potentialname, - vtiger_account.accountname - FROM vtiger_quotes - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_quotes.quoteid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_quotes.accountid - LEFT OUTER JOIN vtiger_potential - ON vtiger_potential.potentialid = vtiger_quotes.potentialid - LEFT JOIN vtiger_quotegrouprelation - ON vtiger_quotes.quoteid = vtiger_quotegrouprelation.quoteid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_quotegrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_account.accountid = ".$id; - $log->debug("Exiting get_quotes method ..."); - return GetRelatedList('Accounts','Quotes',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Invoices - * @param integer $id - accountid - * returns related Invoices record in array format - */ - function get_invoices($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_invoices(".$id.") method ..."); - global $app_strings; - require_once('modules/Invoice/Invoice.php'); - - $focus = new Invoice(); - - $button = ''; - if(isPermitted("Invoice",1,"") == 'yes') - { - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, - vtiger_groups.groupname, - vtiger_crmentity.*, - vtiger_invoice.*, - vtiger_account.accountname, - vtiger_salesorder.subject AS salessubject - FROM vtiger_invoice - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_invoice.accountid - LEFT OUTER JOIN vtiger_salesorder - ON vtiger_salesorder.salesorderid = vtiger_invoice.salesorderid - LEFT JOIN vtiger_invoicegrouprelation - ON vtiger_invoice.invoiceid = vtiger_invoicegrouprelation.invoiceid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_invoicegrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_account.accountid = ".$id; - $log->debug("Exiting get_invoices method ..."); - return GetRelatedList('Accounts','Invoice',$focus,$query,$button,$returnset); - } - - /** - * Function to get Account related SalesOrder - * @param integer $id - accountid - * returns related SalesOrder record in array format - */ - function get_salesorder($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - global $app_strings; - - $focus = new SalesOrder(); - - $button = ''; - if(isPermitted("SalesOrder",1,"") == 'yes') - { - $button .= ' '; - } - - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_crmentity.*, - vtiger_salesorder.*, - vtiger_quotes.subject AS quotename, - vtiger_account.accountname, - vtiger_users.user_name, - vtiger_groups.groupname - FROM vtiger_salesorder - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid - LEFT OUTER JOIN vtiger_quotes - ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid - LEFT OUTER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_salesorder.accountid - LEFT JOIN vtiger_sogrouprelation - ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_salesorder.accountid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Accounts','SalesOrder',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Tickets - * @param integer $id - accountid - * returns related Ticket record in array format - */ - function get_tickets($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_tickets(".$id.") method ..."); - global $app_strings; - - $focus = new HelpDesk(); - $button = ''; - - $button .= ''; - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_users.user_name, vtiger_users.id, - vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, - vtiger_troubletickets.status, vtiger_troubletickets.priority, - vtiger_troubletickets.parent_id, - vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime - FROM vtiger_troubletickets - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid - LEFT JOIN vtiger_account - ON vtiger_account.accountid = vtiger_troubletickets.parent_id - LEFT JOIN vtiger_contactdetails - ON vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id - LEFT JOIN vtiger_users - ON vtiger_users.id=vtiger_crmentity.smownerid - LEFT JOIN vtiger_ticketgrouprelation - ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname - WHERE vtiger_troubletickets.parent_id=".$id." or " ; - - $query .= "vtiger_troubletickets.parent_id in(SELECT vtiger_contactdetails.contactid - FROM vtiger_contactdetails - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id - WHERE vtiger_crmentity.deleted = 0 - AND vtiger_contactdetails.accountid = ".$id; - - - //Appending the security parameter - global $current_user; - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $tab_id=getTabid('Contacts'); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter('Contacts'); - $query .= ' '.$sec_parameter; - - } - - $query .= ") "; - - /* - $query .= " UNION ALL - SELECT vtiger_users.user_name, vtiger_users.id, - vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, - vtiger_troubletickets.status, vtiger_troubletickets.priority, - vtiger_troubletickets.parent_id, - vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime - FROM vtiger_troubletickets - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid - LEFT JOIN vtiger_contactdetails - ON vtiger_contactdetails.contactid = vtiger_troubletickets.parent_id - LEFT JOIN vtiger_account - ON vtiger_account.accountid = vtiger_contactdetails.accountid - LEFT JOIN vtiger_users - ON vtiger_users.id = vtiger_crmentity.smownerid - LEFT JOIN vtiger_ticketgrouprelation - ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname - WHERE vtiger_account.accountid = ".$id; - */ - $log->debug("Exiting get_tickets method ..."); - return GetRelatedList('Accounts','HelpDesk',$focus,$query,$button,$returnset); - } - /** - * Function to get Account related Products - * @param integer $id - accountid - * returns related Products record in array format - */ - function get_products($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_products(".$id.") method ..."); - require_once('modules/Products/Product.php'); - global $app_strings; - - $focus = new Product(); - - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_products.productid, vtiger_products.productname, - vtiger_products.productcode, vtiger_products.commissionrate, - vtiger_products.qty_per_unit, vtiger_products.unit_price, - vtiger_crmentity.crmid, vtiger_crmentity.smownerid - FROM vtiger_products - INNER JOIN vtiger_seproductsrel - ON vtiger_products.productid = vtiger_seproductsrel.productid - INNER JOIN vtiger_crmentity - ON vtiger_crmentity.crmid = vtiger_products.productid - INNER JOIN vtiger_account - ON vtiger_account.accountid = vtiger_seproductsrel.crmid - WHERE vtiger_account.accountid = ".$id." - AND vtiger_crmentity.deleted = 0"; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Accounts','Products',$focus,$query,$button,$returnset); - } - - /** Function to export the account records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Accounts Query. - */ - function create_export_query(&$order_by, &$where) - { - global $log; - $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); - if($this->checkIfCustomTableExists('vtiger_accountscf')) - { - - $query = $this->constructCustomQueryAddendum('vtiger_accountscf','Accounts') . " - vtiger_account.*, - ".$this->entity_table.".*, - vtiger_accountbillads.city AS billing_city, - vtiger_accountbillads.country AS billing_country, - vtiger_accountbillads.code AS billing_code, - vtiger_accountbillads.state AS billing_state, - vtiger_accountbillads.street AS billing_street, - vtiger_accountshipads.city AS shipping_city, - vtiger_accountshipads.country AS shipping_country, - vtiger_accountshipads.code AS shipping_code, - vtiger_accountshipads.state AS shipping_state, - vtiger_accountshipads.street AS shipping_street, - vtiger_users.user_name, - vtiger_users.status AS user_status - FROM ".$this->entity_table." - INNER JOIN vtiger_account - ON vtiger_crmentity.crmid = vtiger_account.accountid - LEFT JOIN vtiger_accountbillads - ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid - LEFT JOIN vtiger_accountshipads - ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid - LEFT JOIN vtiger_accountscf - ON vtiger_accountscf.accountid = vtiger_account.accountid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id "; - - } - else - { - $query = "SELECT vtiger_account.*, - ".$this->entity_table.".*, - vtiger_accountbillads.city AS billing_city, - vtiger_accountbillads.country AS billing_country, - vtiger_accountbillads.code AS billing_code, - vtiger_accountbillads.state AS billing_state, - vtiger_accountbillads.street AS billing_street, - vtiger_accountshipads.city AS shipping_city, - vtiger_accountshipads.country AS shipping_country, - vtiger_accountshipads.code AS shipping_code, - vtiger_accountshipads.state AS shipping_state, - vtiger_accountshipads.street AS shipping_street, - vtiger_users.user_name, - vtiger_users.status AS user_status - FROM ".$this->entity_table." - INNER JOIN vtiger_account - ON vtiger_crmentity.crmid = vtiger_account.accountid - LEFT JOIN vtiger_accountbillads - ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid - LEFT JOIN vtiger_accountshipads - ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id "; - } - - $where_auto = " vtiger_users.status = 'Active' - AND vtiger_crmentity.deleted = 0 "; - - if($where != "") - $query .= "WHERE ($where) AND ".$where_auto; - else - $query .= "WHERE ".$where_auto; - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - $log->debug("Exiting create_export_query method ..."); - return $query; - } - - /** Function to get the Columnnames of the Account Record - * Used By vtigerCRM Word Plugin - * Returns the Merge Fields for Word Plugin - */ - function getColumnNames_Acnt() - { - global $log,$current_user; - $log->debug("Entering getColumnNames_Acnt() method ..."); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "SELECT fieldlabel FROM vtiger_field WHERE tabid = 6"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel 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 where vtiger_field.tabid=6 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames_Acnt method ..."); - return $mergeflds; - } - -} - -?> +'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid','vtiger_entity2org'=>'crmid'); + + var $entity_table = "vtiger_crmentity"; + + var $billadr_table = "vtiger_accountbillads"; + + var $object_name = "Accounts"; + // Mike Crowe Mod --------------------------------------------------------added for general search + var $base_table_name = "vtiger_account"; + var $cf_table_name = "vtiger_accountscf"; + + var $new_schema = true; + + var $module_id = "accountid"; + + var $column_fields = Array(); + + var $sortby_fields = Array('accountname','city','website','phone','smownerid'); + + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Account Name'=>Array('vtiger_account'=>'accountname'), + 'City'=>Array('vtiger_accountbillads'=>'city'), + 'Website'=>Array('vtiger_account'=>'website'), + 'Phone'=>Array('vtiger_account'=> 'phone'), + 'Assigned To'=>Array('vtiger_crmentity'=>'smownerid') + ); + + var $list_fields_name = Array( + 'Account Name'=>'accountname', + 'City'=>'bill_city', + 'Website'=>'website', + 'Phone'=>'phone', + 'Assigned To'=>'assigned_user_id' + ); + var $list_link_field= 'accountname'; + + var $search_fields = Array( + 'Account Name'=>Array('vtiger_account'=>'accountname'), + 'City'=>Array('vtiger_accountbillads'=>'city'), + ); + + var $search_fields_name = Array( + 'Account Name'=>'accountname', + 'City'=>'bill_city', + ); + + // This is the list of vtiger_fields that are required. + var $required_fields = array("accountname"=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'accountname'; + var $default_sort_order = 'ASC'; + + function Account() { + $this->log =LoggerManager::getLogger('account'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Accounts'); + } + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['ACCOUNTS_SORT_ORDER'] != '')?($_SESSION['ACCOUNTS_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'accountname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['ACCOUNTS_ORDER_BY'] != '')?($_SESSION['ACCOUNTS_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + /** Returns a list of the associated contacts + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_contacts($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $mod_strings; + + $focus = new Contact(); + + $button = ''; + if(isPermitted("Contacts",1,"") == 'yes') + { + $button .= ' '; + } + + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + //SQL + $query = "SELECT vtiger_contactdetails.*, + vtiger_crmentity.crmid, + vtiger_crmentity.smownerid, + vtiger_users.user_name + FROM vtiger_contactdetails + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_contactdetails.accountid = ".$id; + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Accounts','Contacts',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated opportunities + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_opportunities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_opportunities(".$id.") method ..."); + global $mod_strings; + + $focus = new Potential(); + $button = ''; + + if(isPermitted("Potentials",1,"") == 'yes') + { + $button .= ''; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_potential.potentialid, vtiger_potential.accountid, + vtiger_potential.potentialname, vtiger_potential.sales_stage, + vtiger_potential.potentialtype, vtiger_potential.amount, + vtiger_potential.closingdate, vtiger_potential.potentialtype, + vtiger_users.user_name, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid + FROM vtiger_potential + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_potential.potentialid + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + LEFT JOIN vtiger_potentialgrouprelation + ON vtiger_potential.potentialid = vtiger_potentialgrouprelation.potentialid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_potentialgrouprelation.groupname + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_potential.accountid = ".$id; + $log->debug("Exiting get_opportunities method ..."); + + return GetRelatedList('Accounts','Potentials',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated tasks + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_activities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + + $focus = new Activity(); + $button = ''; + if(isPermitted("Calendar",1,"") == 'yes') + { + + $button .= ' '; + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_activity.*, + vtiger_seactivityrel.*, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid, + vtiger_crmentity.modifiedtime, + vtiger_users.user_name, + vtiger_recurringevents.recurringtype + FROM vtiger_activity + INNER JOIN vtiger_seactivityrel + ON vtiger_seactivityrel.activityid = vtiger_activity.activityid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_activity.activityid + LEFT JOIN vtiger_users + ON vtiger_users.id = vtiger_crmentity.smownerid + LEFT OUTER JOIN vtiger_recurringevents + ON vtiger_recurringevents.activityid = vtiger_activity.activityid + LEFT JOIN vtiger_activitygrouprelation + ON vtiger_activitygrouprelation.activityid = vtiger_crmentity.crmid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname + WHERE vtiger_seactivityrel.crmid = ".$id." + AND (activitytype='Task' + OR activitytype='Call' + OR activitytype='Meeting') + AND vtiger_crmentity.deleted = 0 + AND ((vtiger_activity.status IS NOT NULL + AND vtiger_activity.status != 'Completed') + AND (vtiger_activity.status IS NOT NULL + AND vtiger_activity.status != 'Deferred') + OR (vtiger_activity.eventstatus !='' + AND vtiger_activity.eventstatus != 'Held'))"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Accounts','Calendar',$focus,$query,$button,$returnset); + + } + /** + * Function to get Account related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id - accountid + * returns related Task or Event record in array format + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, + vtiger_activity.status, vtiger_activity.eventstatus, + vtiger_activity.activitytype, + vtiger_crmentity.modifiedtime, vtiger_crmentity.createdtime, + vtiger_crmentity.description, + vtiger_users.user_name + FROM vtiger_activity + INNER JOIN vtiger_seactivityrel + ON vtiger_seactivityrel.activityid = vtiger_activity.activityid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_activity.activityid + LEFT JOIN vtiger_activitygrouprelation + ON vtiger_activitygrouprelation.activityid = vtiger_activity.activityid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_activitygrouprelation.groupname + INNER JOIN vtiger_users + ON vtiger_crmentity.smcreatorid = vtiger_users.id + WHERE (vtiger_activity.activitytype = 'Meeting' + OR vtiger_activity.activitytype = 'Call' + OR vtiger_activity.activitytype = 'Task') + AND (vtiger_activity.status = 'Completed' + OR vtiger_activity.status = 'Deferred' + OR (vtiger_activity.eventstatus = 'Held' + AND vtiger_activity.eventstatus != '')) + AND vtiger_seactivityrel.crmid = ".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + $log->debug("Exiting get_history method ..."); + return getHistory('Accounts',$query,$id); + } + /** + * Function to get Account related Attachments + * @param integer $id - accountid + * returns related Attachment record in array format + */ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + $query = "SELECT vtiger_notes.title, vtiger_notes.notecontent AS description, + vtiger_notes.filename, vtiger_notes.notesid AS crmid, + 'Notes ' AS ActivityType, + vtiger_attachments.type AS FileType, + crm2.modifiedtime AS lastmodified, crm2.createdtime, + vtiger_seattachmentsrel.attachmentsid, + vtiger_users.user_name + FROM vtiger_notes + INNER JOIN vtiger_senotesrel + ON vtiger_senotesrel.notesid = vtiger_notes.notesid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_senotesrel.crmid + INNER JOIN vtiger_crmentity crm2 + ON crm2.crmid = vtiger_notes.notesid + AND crm2.deleted = 0 + LEFT JOIN vtiger_seattachmentsrel + ON vtiger_seattachmentsrel.crmid = vtiger_notes.notesid + LEFT JOIN vtiger_attachments + ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_users + ON crm2.smcreatorid = vtiger_users.id + WHERE vtiger_crmentity.crmid = ".$id." + UNION ALL + SELECT vtiger_attachments.description AS title, vtiger_attachments.description, + vtiger_attachments.name AS filename, + vtiger_seattachmentsrel.attachmentsid AS crmid, + 'Attachments' AS ActivityType, + vtiger_attachments.type AS FileType, + crm2.modifiedtime AS lastmodified, crm2.createdtime, + vtiger_attachments.attachmentsid, + vtiger_users.user_name + FROM vtiger_attachments + INNER JOIN vtiger_seattachmentsrel + ON vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_seattachmentsrel.crmid + INNER JOIN vtiger_crmentity crm2 + ON crm2.crmid = vtiger_attachments.attachmentsid + INNER JOIN vtiger_users + ON crm2.smcreatorid = vtiger_users.id + WHERE vtiger_crmentity.crmid = ".$id." + ORDER BY createdtime DESC"; + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Accounts',$query,$id); + } + /** + * Function to get Account related Quotes + * @param integer $id - accountid + * returns related Quotes record in array format + */ + function get_quotes($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_quotes(".$id.") method ..."); + global $app_strings; + require_once('modules/Quotes/Quote.php'); + + $focus = new Quote(); + + $button = ''; + if(isPermitted("Quotes",1,"") == 'yes') + { + $button .= ' '; + } + + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, + vtiger_groups.groupname, + vtiger_crmentity.*, + vtiger_quotes.*, + vtiger_potential.potentialname, + vtiger_account.accountname + FROM vtiger_quotes + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_quotes.quoteid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_quotes.accountid + LEFT OUTER JOIN vtiger_potential + ON vtiger_potential.potentialid = vtiger_quotes.potentialid + LEFT JOIN vtiger_quotegrouprelation + ON vtiger_quotes.quoteid = vtiger_quotegrouprelation.quoteid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_quotegrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_account.accountid = ".$id; + $log->debug("Exiting get_quotes method ..."); + return GetRelatedList('Accounts','Quotes',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Invoices + * @param integer $id - accountid + * returns related Invoices record in array format + */ + function get_invoices($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_invoices(".$id.") method ..."); + global $app_strings; + require_once('modules/Invoice/Invoice.php'); + + $focus = new Invoice(); + + $button = ''; + if(isPermitted("Invoice",1,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, + vtiger_groups.groupname, + vtiger_crmentity.*, + vtiger_invoice.*, + vtiger_account.accountname, + vtiger_salesorder.subject AS salessubject + FROM vtiger_invoice + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_invoice.invoiceid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_invoice.accountid + LEFT OUTER JOIN vtiger_salesorder + ON vtiger_salesorder.salesorderid = vtiger_invoice.salesorderid + LEFT JOIN vtiger_invoicegrouprelation + ON vtiger_invoice.invoiceid = vtiger_invoicegrouprelation.invoiceid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_invoicegrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_account.accountid = ".$id; + $log->debug("Exiting get_invoices method ..."); + return GetRelatedList('Accounts','Invoice',$focus,$query,$button,$returnset); + } + + /** + * Function to get Account related SalesOrder + * @param integer $id - accountid + * returns related SalesOrder record in array format + */ + function get_salesorder($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + global $app_strings; + + $focus = new SalesOrder(); + + $button = ''; + if(isPermitted("SalesOrder",1,"") == 'yes') + { + $button .= ' '; + } + + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_crmentity.*, + vtiger_salesorder.*, + vtiger_quotes.subject AS quotename, + vtiger_account.accountname, + vtiger_users.user_name, + vtiger_groups.groupname + FROM vtiger_salesorder + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_salesorder.salesorderid + LEFT OUTER JOIN vtiger_quotes + ON vtiger_quotes.quoteid = vtiger_salesorder.quoteid + LEFT OUTER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_salesorder.accountid + LEFT JOIN vtiger_sogrouprelation + ON vtiger_salesorder.salesorderid = vtiger_sogrouprelation.salesorderid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_sogrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_salesorder.accountid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Accounts','SalesOrder',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Tickets + * @param integer $id - accountid + * returns related Ticket record in array format + */ + function get_tickets($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_tickets(".$id.") method ..."); + global $app_strings; + + $focus = new HelpDesk(); + $button = ''; + + $button .= ''; + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_users.user_name, vtiger_users.id, + vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, + vtiger_troubletickets.status, vtiger_troubletickets.priority, + vtiger_troubletickets.parent_id, + vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime + FROM vtiger_troubletickets + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + LEFT JOIN vtiger_account + ON vtiger_account.accountid = vtiger_troubletickets.parent_id + LEFT JOIN vtiger_contactdetails + ON vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id + LEFT JOIN vtiger_users + ON vtiger_users.id=vtiger_crmentity.smownerid + LEFT JOIN vtiger_ticketgrouprelation + ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname + WHERE vtiger_troubletickets.parent_id=".$id." or " ; + + $query .= "vtiger_troubletickets.parent_id in(SELECT vtiger_contactdetails.contactid + FROM vtiger_contactdetails + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + WHERE vtiger_crmentity.deleted = 0 + AND vtiger_contactdetails.accountid = ".$id; + + + //Appending the security parameter + global $current_user; + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $tab_id=getTabid('Contacts'); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter('Contacts'); + $query .= ' '.$sec_parameter; + + } + + $query .= ") "; + + /* + $query .= " UNION ALL + SELECT vtiger_users.user_name, vtiger_users.id, + vtiger_troubletickets.title, vtiger_troubletickets.ticketid AS crmid, + vtiger_troubletickets.status, vtiger_troubletickets.priority, + vtiger_troubletickets.parent_id, + vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime + FROM vtiger_troubletickets + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid + LEFT JOIN vtiger_contactdetails + ON vtiger_contactdetails.contactid = vtiger_troubletickets.parent_id + LEFT JOIN vtiger_account + ON vtiger_account.accountid = vtiger_contactdetails.accountid + LEFT JOIN vtiger_users + ON vtiger_users.id = vtiger_crmentity.smownerid + LEFT JOIN vtiger_ticketgrouprelation + ON vtiger_troubletickets.ticketid = vtiger_ticketgrouprelation.ticketid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_ticketgrouprelation.groupname + WHERE vtiger_account.accountid = ".$id; + */ + $log->debug("Exiting get_tickets method ..."); + return GetRelatedList('Accounts','HelpDesk',$focus,$query,$button,$returnset); + } + /** + * Function to get Account related Products + * @param integer $id - accountid + * returns related Products record in array format + */ + function get_products($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_products(".$id.") method ..."); + require_once('modules/Products/Product.php'); + global $app_strings; + + $focus = new Product(); + + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Accounts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Accounts&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_products.productid, vtiger_products.productname, + vtiger_products.productcode, vtiger_products.commissionrate, + vtiger_products.qty_per_unit, vtiger_products.unit_price, + vtiger_crmentity.crmid, vtiger_crmentity.smownerid + FROM vtiger_products + INNER JOIN vtiger_seproductsrel + ON vtiger_products.productid = vtiger_seproductsrel.productid + INNER JOIN vtiger_crmentity + ON vtiger_crmentity.crmid = vtiger_products.productid + INNER JOIN vtiger_account + ON vtiger_account.accountid = vtiger_seproductsrel.crmid + WHERE vtiger_account.accountid = ".$id." + AND vtiger_crmentity.deleted = 0"; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Accounts','Products',$focus,$query,$button,$returnset); + } + + /** Function to export the account records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Accounts Query. + */ + function create_export_query(&$order_by, &$where) + { + global $log; + global $current_user; + $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); + + include("include/utils/ExportUtils.php"); + + //To get the Permitted fields query and the permitted fields list + $sql = getPermittedFieldsQuery("Accounts", "detail_view"); + $fields_list = getFieldsListFromQuery($sql); + + $query = "SELECT $fields_list FROM ".$this->entity_table." + INNER JOIN vtiger_account + ON vtiger_crmentity.crmid = vtiger_account.accountid + LEFT JOIN vtiger_accountbillads + ON vtiger_account.accountid = vtiger_accountbillads.accountaddressid + LEFT JOIN vtiger_accountshipads + ON vtiger_account.accountid = vtiger_accountshipads.accountaddressid + LEFT JOIN vtiger_accountscf + ON vtiger_accountscf.accountid = vtiger_account.accountid + LEFT JOIN vtiger_accountgrouprelation + ON vtiger_accountscf.accountid = vtiger_accountgrouprelation.accountid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_accountgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id + LEFT JOIN vtiger_account vtiger_account2 + ON vtiger_account2.accountid = vtiger_account.parentid + ";//vtiger_account2 is added to get the Member of account + + + $where_auto = " vtiger_users.status = 'Active' + AND vtiger_crmentity.deleted = 0 "; + + if($where != "") + $query .= "WHERE ($where) AND ".$where_auto; + else + $query .= "WHERE ".$where_auto; + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + //we should add security check when the user has Private Access + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[6] == 3) + { + //Added security check to get the permitted records only + $query = $query." ".getListViewSecurityParameter("Accounts"); + } + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + + $log->debug("Exiting create_export_query method ..."); + return $query; + } + + /** Function to get the Columnnames of the Account Record + * Used By vtigerCRM Word Plugin + * Returns the Merge Fields for Word Plugin + */ + function getColumnNames_Acnt() + { + global $log,$current_user; + $log->debug("Entering getColumnNames_Acnt() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "SELECT fieldlabel FROM vtiger_field WHERE tabid = 6"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel 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 where vtiger_field.tabid=6 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames_Acnt method ..."); + return $mergeflds; + } + +} + +?> Modified: vtigercrm/branches/5.1_jens/modules/Accounts/CallRelatedList.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/CallRelatedList.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/CallRelatedList.php Tue Nov 14 03:16:10 2006 @@ -11,7 +11,7 @@ require_once('Smarty_setup.php'); -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('include/utils/utils.php'); //Redirecting Header for single page layout require_once('user_privileges/default_module_view.php'); @@ -22,7 +22,7 @@ } else { -$focus = new Account(); +$focus = new Accounts(); $currentmodule = $_REQUEST['module']; $RECORD = $_REQUEST['record']; if(isset($_REQUEST['record']) && $_REQUEST['record']!='') { Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Delete.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Delete.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Delete.php Tue Nov 14 03:16:10 2006 @@ -1,37 +1,37 @@ - + Modified: vtigercrm/branches/5.1_jens/modules/Accounts/DetailView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/DetailView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/DetailView.php Tue Nov 14 03:16:10 2006 @@ -22,7 +22,7 @@ require_once('Smarty_setup.php'); require_once('data/Tracker.php'); -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('include/CustomFieldUtil.php'); require_once('include/database/PearDatabase.php'); require_once('include/utils/utils.php'); @@ -32,7 +32,10 @@ global $app_list_strings; global $log, $currentModule, $singlepane_view; -$focus = new Account(); +global $current_organization; +global $user_organizations; + +$focus = new Accounts(); if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { $focus->retrieve_entity_info($_REQUEST['record'],"Accounts"); $focus->id = $_REQUEST['record']; @@ -118,5 +121,15 @@ } $smarty->assign("SinglePane_View", $singlepane_view); +// Assigned organizations +$smarty->assign("CURRENT_ORGANIZATION",$current_organization); +$org_array=array(); +$org=strtok( $user_organizations, "|"); +while( $org !== false) { + $org_array[$org] = 1; + $org=strtok( "|"); +} +$smarty->assign("USER_ORGANIZATIONS",$org_array); + $smarty->display("DetailView.tpl"); ?> Modified: vtigercrm/branches/5.1_jens/modules/Accounts/DetailViewAjax.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/DetailViewAjax.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/DetailViewAjax.php Tue Nov 14 03:16:10 2006 @@ -1,50 +1,50 @@ -retrieve_entity_info($crmid,"Accounts"); - $acntObj->column_fields[$fieldname] = $fieldvalue; - if($fieldname == 'annual_revenue')//annual revenue converted to dollar value while saving - { - $acntObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue); - } - $acntObj->id = $crmid; - $acntObj->mode = "edit"; - $acntObj->save("Accounts"); - if($acntObj->id != "") - { - echo ":#:SUCCESS"; - }else - { - echo ":#:FAILURE"; - } - }else - { - echo ":#:FAILURE"; - } -} -?> +retrieve_entity_info($crmid,"Accounts"); + $acntObj->column_fields[$fieldname] = $fieldvalue; + if($fieldname == 'annual_revenue')//annual revenue converted to dollar value while saving + { + $acntObj->column_fields[$fieldname] = getConvertedPrice($fieldvalue); + } + $acntObj->id = $crmid; + $acntObj->mode = "edit"; + $acntObj->save("Accounts"); + if($acntObj->id != "") + { + echo ":#:SUCCESS"; + }else + { + echo ":#:FAILURE"; + } + }else + { + echo ":#:FAILURE"; + } +} +?> Modified: vtigercrm/branches/5.1_jens/modules/Accounts/EditView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/EditView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/EditView.php Tue Nov 14 03:16:10 2006 @@ -22,16 +22,18 @@ require_once('Smarty_setup.php'); require_once('data/Tracker.php'); -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('include/CustomFieldUtil.php'); require_once('include/ComboUtil.php'); require_once('include/utils/utils.php'); require_once('include/FormValidationUtil.php'); global $app_strings,$mod_strings,$currentModule,$theme; +global $current_organization; +global $user_organizations; $smarty=new vtigerCRM_Smarty; -$focus = new Account(); +$focus = new Accounts(); if(isset($_REQUEST['record'])) { @@ -39,7 +41,10 @@ $focus->mode = 'edit'; $focus->retrieve_entity_info($_REQUEST['record'],"Accounts"); $focus->name=$focus->column_fields['accountname']; +} else { + $focus->column_fields["otherorgs"][$current_organization]=1; } + if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { $focus->id = ""; $focus->mode = ''; @@ -95,7 +100,7 @@ $smarty->assign("IMAGE_PATH", $image_path);$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); $smarty->assign("ID", $focus->id); $smarty->assign("MODULE",$currentModule); -$smarty->assign("SINGLE_MOD",$app_strings['Account']); +$smarty->assign("SINGLE_MOD",'Account'); $smarty->assign("CALENDAR_LANG", $app_strings['LBL_JSCALENDAR_LANG']); $smarty->assign("CALENDAR_DATEFORMAT", parse_calendardate($app_strings['NTC_DATE_FORMAT'])); @@ -111,6 +116,16 @@ $check_button = Button_Check($module); $smarty->assign("CHECK", $check_button); +// Assigned organizations +$smarty->assign("CURRENT_ORGANIZATION",$current_organization); +$org_array=array(); +$org=strtok( $user_organizations, "|"); +while( $org !== false) { + $org_array[$org] = 1; + $org=strtok( "|"); +} +$smarty->assign("USER_ORGANIZATIONS",$org_array); + if ($focus->mode == 'edit') $smarty->display('salesEditView.tpl'); else Modified: vtigercrm/branches/5.1_jens/modules/Accounts/HeadLines.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/HeadLines.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/HeadLines.php Tue Nov 14 03:16:10 2006 @@ -8,7 +8,7 @@ * All Rights Reserved. * ********************************************************************************/ -include("modules/Accounts/Account.php"); +include("modules/Accounts/Accounts.php"); include("getCompanyProfile.php"); $variable = $_REQUEST['tickersymbol']; $url = "http://finance.yahoo.com/q?s=".$variable; Modified: vtigercrm/branches/5.1_jens/modules/Accounts/ListView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/ListView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/ListView.php Tue Nov 14 03:16:10 2006 @@ -15,7 +15,7 @@ require_once('Smarty_setup.php'); require_once("data/Tracker.php"); -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('themes/'.$theme.'/layout_utils.php'); require_once('include/logging.php'); require_once('include/ListView/ListView.php'); @@ -43,7 +43,7 @@ $url_string = ''; -$focus = new Account(); +$focus = new Accounts(); $smarty = new vtigerCRM_Smarty; $other_text = Array(); @@ -80,6 +80,7 @@ $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid); //<<<<>>>> $smarty->assign("CHANGE_OWNER",getUserslist()); +$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist()); if(isset($_REQUEST['query']) && $_REQUEST['query'] == 'true') { list($where, $ustring) = split("#@@#",getWhereCondition($currentModule)); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/ListViewTop.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/ListViewTop.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/ListViewTop.php Tue Nov 14 03:16:10 2006 @@ -28,7 +28,7 @@ $log = LoggerManager::getLogger('top accounts_list'); $log->debug("Entering getTopAccounts() method ..."); require_once("data/Tracker.php"); - require_once('modules/Potentials/Opportunity.php'); + require_once('modules/Potentials/Potentials.php'); require_once('include/logging.php'); require_once('include/ListView/ListView.php'); global $app_strings; Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Merge.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Merge.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Merge.php Tue Nov 14 03:16:10 2006 @@ -108,7 +108,7 @@ { if($modulename == "Contacts") { - $tablename = "crmentityContacts"; + $tablename = "vtiger_crmentityContacts"; } } $querycolumns[$x] = $tablename.".".$columnname; @@ -120,20 +120,20 @@ } if($modulename == "Contacts") { - $querycolumns[$x] = "concat(usersContacts.last_name,' ',usersContacts.first_name) as userjoincname"; + $querycolumns[$x] = "concat(vtiger_usersContacts.last_name,' ',vtiger_usersContacts.first_name) as userjoincname"; } } if($columnname == "parentid") { - $querycolumns[$x] = "accountAccount.accountname"; + $querycolumns[$x] = "vtiger_accountAccount.accountname"; } if($columnname == "accountid") { - $querycolumns[$x] = "accountContacts.accountname"; + $querycolumns[$x] = "vtiger_accountContacts.accountname"; } if($columnname == "reportsto") { - $querycolumns[$x] = "contactdetailsContacts.lastname"; + $querycolumns[$x] = "vtiger_contactdetailsContacts.lastname"; } if($modulename == "Accounts") @@ -174,7 +174,7 @@ left join vtiger_contactdetails as vtiger_contactdetailsContacts on vtiger_contactdetailsContacts.contactid = vtiger_contactdetails.reportsto left join vtiger_account as vtiger_accountContacts on vtiger_accountContacts.accountid = vtiger_contactdetails.accountid left join vtiger_users as vtiger_usersContacts on vtiger_usersContacts.id = vtiger_crmentityContacts.smownerid - where vtiger_crmentity.deleted=0 and (crmentityContacts.deleted=0 || vtiger_crmentityContacts.deleted is null) and vtiger_account.accountid in(".$mass_merge.")"; + where vtiger_crmentity.deleted=0 and (vtiger_crmentityContacts.deleted=0 || vtiger_crmentityContacts.deleted is null) and vtiger_account.accountid in(".$mass_merge.")"; //echo $query; //die; $result = $adb->query($query); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Save.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Save.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Save.php Tue Nov 14 03:16:10 2006 @@ -21,14 +21,14 @@ * Contributor(s): ______________________________________.. ********************************************************************************/ -require_once('modules/Accounts/Account.php'); +require_once('modules/Accounts/Accounts.php'); require_once('include/logging.php'); //require_once('database/DatabaseConnection.php'); require_once('include/database/PearDatabase.php'); $local_log =& LoggerManager::getLogger('index'); global $log; -$focus = new Account(); +$focus = new Accounts(); global $current_user; $currencyid=fetchCurrency($current_user->id); $rate_symbol = getCurrencySymbolandCRate($currencyid); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Tickerdetail.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Tickerdetail.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Tickerdetail.php Tue Nov 14 03:16:10 2006 @@ -8,7 +8,7 @@ * All Rights Reserved. * ********************************************************************************/ -require_once("modules/Accounts/Account.php"); +require_once("modules/Accounts/Accounts.php"); require_once("getCompanyProfile.php"); $variable = $_REQUEST['tickersymbol']; $url = "http://moneycentral.msn.com/investor/research/profile.asp?Symbol=".trim($variable); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/language/en_us.lang.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/language/en_us.lang.php Tue Nov 14 03:16:10 2006 @@ -1,214 +1,217 @@ -'Accounts', -'LBL_MODULE_TITLE'=>'Accounts: Home', -'LBL_SEARCH_FORM_TITLE'=>'Account Search', -'LBL_LIST_FORM_TITLE'=>'Account List', -'LBL_NEW_FORM_TITLE'=>'New Account', -'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations', -// Label for Top Accounts in Home Page, added for 4.2 GA -'LBL_TOP_ACCOUNTS'=>'My Top Accounts', -'LBL_TOP_AMOUNT'=>'Amount', -'LBL_LIST_ACCOUNT_NAME'=>'Account Name', -'LBL_LIST_CITY'=>'City', -'LBL_LIST_WEBSITE'=>'Website', -'LBL_LIST_STATE'=>'State', -'LBL_LIST_PHONE'=>'Phone', -'LBL_LIST_EMAIL_ADDRESS'=>'Email Address', -'LBL_LIST_CONTACT_NAME'=>'Contact Name', -'LBL_LIST_AMOUNT' => 'Total Opportunities', - -//DON'T CONVERT THESE THEY ARE MAPPINGS -'db_name' => 'LBL_LIST_ACCOUNT_NAME', -'db_website' => 'LBL_LIST_WEBSITE', -'db_billing_address_city' => 'LBL_LIST_CITY', - -//END DON'T CONVERT - -'LBL_ACCOUNT'=>'Account:', -'LBL_ACCOUNT_NAME'=>'Account Name:', -'LBL_PHONE'=>'Phone:', -'LBL_WEBSITE'=>'Website:', -'LBL_FAX'=>'Fax:', -'LBL_TICKER_SYMBOL'=>'Ticker Symbol:', -'LBL_OTHER_PHONE'=>'Other Phone:', -'LBL_ANY_PHONE'=>'Any Phone:', -'LBL_MEMBER_OF'=>'Member of:', -'LBL_EMAIL'=>'Email:', -'LBL_EMPLOYEES'=>'Employees:', -'LBL_OTHER_EMAIL_ADDRESS'=>'Other Email:', -'LBL_ANY_EMAIL'=>'Any Email:', -'LBL_OWNERSHIP'=>'Ownership:', -'LBL_RATING'=>'Rating:', -'LBL_INDUSTRY'=>'Industry:', -'LBL_SIC_CODE'=>'SIC Code:', -'LBL_TYPE'=>'Type:', -'LBL_ANNUAL_REVENUE'=>'Annual Revenue:', -'LBL_ADDRESS_INFORMATION'=>'Address Information', -'LBL_ACCOUNT_INFORMATION'=>'Account Information', -'LBL_CUSTOM_INFORMATION'=>'Custom Information', -'LBL_BILLING_ADDRESS'=>'Billing Address:', -'LBL_SHIPPING_ADDRESS'=>'Shipping Address:', -'LBL_ANY_ADDRESS'=>'Any Address:', -'LBL_CITY'=>'City:', -'LBL_STATE'=>'State:', -'LBL_POSTAL_CODE'=>'Postal Code:', -'LBL_COUNTRY'=>'Country:', -'LBL_DESCRIPTION_INFORMATION'=>'Description Information', -'LBL_DESCRIPTION'=>'Description:', -'NTC_COPY_BILLING_ADDRESS'=>'Copy billing address to shipping address', -'NTC_COPY_SHIPPING_ADDRESS'=>'Copy shipping address to billing address', -'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'Are you sure you want to remove this record as a member organization?', -'LBL_DUPLICATE'=>'Potential Duplicate Accounts', -'MSG_DUPLICATE' => 'Creating this vtiger_account may vtiger_potentialy create a duplicate vtiger_account. You may either select an vtiger_account from the list below or you may click on Create New Account to continue creating a new vtiger_account with the previously entered data.', - -'LBL_INVITEE'=>'Contacts', -'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.", - -'LBL_SELECT_ACCOUNT'=>'Select Account', -'LBL_GENERAL_INFORMATION'=>'General Information', - -//for v4 release added -'LBL_NEW_POTENTIAL'=>'New Potential', -'LBL_POTENTIAL_TITLE'=>'Potentials', - -'LBL_NEW_TASK'=>'New Task', -'LBL_TASK_TITLE'=>'Tasks', -'LBL_NEW_CALL'=>'New Call', -'LBL_CALL_TITLE'=>'Calls', -'LBL_NEW_MEETING'=>'New Meeting', -'LBL_MEETING_TITLE'=>'Meetings', -'LBL_NEW_EMAIL'=>'New Email', -'LBL_EMAIL_TITLE'=>'Emails', -'LBL_NEW_CONTACT'=>'New Contact', -'LBL_CONTACT_TITLE'=>'Contacts', - -//Added vtiger_fields after RC1 - Release -'LBL_ALL'=>'All', -'LBL_PROSPECT'=>'Prospect', -'LBL_INVESTOR'=>'Investor', -'LBL_RESELLER'=>'Reseller', -'LBL_PARTNER'=>'Partner', - -// Added for 4GA -'LBL_TOOL_FORM_TITLE'=>'Account Tools', -//Added for 4GA -'Account Name'=>'Account Name', -'Phone'=>'Phone', -'Website'=>'Website', -'Fax'=>'Fax', -'Ticker Symbol'=>'Ticker Symbol', -'Other Phone'=>'Other Phone', -'Member Of'=>'Member Of', -'Email'=>'Email', -'Employees'=>'Employees', -'Other Email'=>'Other Email', -'Ownership'=>'Ownership', -'Rating'=>'Rating', -'industry'=>'Industry', -'SIC Code'=>'SIC Code', -'Type'=>'Type', -'Annual Revenue'=>'Annual Revenue', -'Assigned To'=>'Assigned To', -'Billing Address'=>'Billing Address', -'Shipping Address'=>'Shipping Address', -'Billing City'=>'Billing City', -'Shipping City'=>'Shipping City', -'Billing State'=>'Billing State', -'Shipping State'=>'Shipping State', -'Billing Code'=>'Billing Postal Code', -'Shipping Code'=>'Shipping Postal Code', -'Billing Country'=>'Billing Country', -'Shipping Country'=>'Shipping Country', -'Created Time'=>'Created Time', -'Modified Time'=>'Modified Time', -'Description'=>'Description', -'Shipping Po Box'=>'Shipping Po Box', -'Billing Po Box'=>'Billing Po Box', - -//Added after 4.2 patch 2 -'Email Opt Out'=>'Email Opt Out', -'LBL_EMAIL_OPT_OUT'=>'Email Opt Out:', - -//Added after 5Alpha5 -'Notify Owner'=>'Notify Owner', - -//Added for existing picklist entries - -'--None--'=>'--None--', - -'Acquired'=>'Acquired', -'Active'=>'Active', -'Market Failed'=>'Market Failed', -'Project Cancelled'=>'Project Cancelled', -'Shutdown'=>'Shutdown', - -'Apparel'=>'Apparel', -'Banking'=>'Banking', -'Biotechnology'=>'Biotechnology', -'Chemicals'=>'Chemicals', -'Communications'=>'Communications', -'Construction'=>'Construction', -'Consulting'=>'Consulting', -'Education'=>'Education', -'Electronics'=>'Electronics', -'Energy'=>'Energy', -'Engineering'=>'Engineering', -'Entertainment'=>'Entertainment', -'Environmental'=>'Environmental', -'Finance'=>'Finance', -'Food & Beverage'=>'Food & Beverage', -'Government'=>'Government', -'Healthcare'=>'Healthcare', -'Hospitality'=>'Hospitality', -'Insurance'=>'Insurance', -'Machinery'=>'Machinery', -'Manufacturing'=>'Manufacturing', -'Media'=>'Media', -'Not For Profit'=>'Not For Profit', -'Recreation'=>'Recreation', -'Retail'=>'Retail', -'Shipping'=>'Shipping', -'Technology'=>'Technology', -'Telecommunications'=>'Telecommunications', -'Transportation'=>'Transportation', -'Utilities'=>'Utilities', -'Other'=>'Other', - -'Analyst'=>'Analyst', -'Competitor'=>'Competitor', -'Customer'=>'Customer', -'Integrator'=>'Integrator', -'Investor'=>'Investor', -'Partner'=>'Partner', -'Press'=>'Press', -'Prospect'=>'Prospect', -'Reseller'=>'Reseller', - - - - -); - -?> +'Accounts', +'LBL_MODULE_TITLE'=>'Accounts: Home', +'LBL_SEARCH_FORM_TITLE'=>'Account Search', +'LBL_LIST_FORM_TITLE'=>'Account List', +'LBL_NEW_FORM_TITLE'=>'New Account', +'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations', +// Label for Top Accounts in Home Page, added for 4.2 GA +'LBL_TOP_ACCOUNTS'=>'My Top Accounts', +'LBL_TOP_AMOUNT'=>'Amount', +'LBL_LIST_ACCOUNT_NAME'=>'Account Name', +'LBL_LIST_CITY'=>'City', +'LBL_LIST_WEBSITE'=>'Website', +'LBL_LIST_STATE'=>'State', +'LBL_LIST_PHONE'=>'Phone', +'LBL_LIST_EMAIL_ADDRESS'=>'Email Address', +'LBL_LIST_CONTACT_NAME'=>'Contact Name', +'LBL_LIST_AMOUNT' => 'Total Opportunities', + +//DON'T CONVERT THESE THEY ARE MAPPINGS +'db_name' => 'LBL_LIST_ACCOUNT_NAME', +'db_website' => 'LBL_LIST_WEBSITE', +'db_billing_address_city' => 'LBL_LIST_CITY', + +//END DON'T CONVERT + +'LBL_ACCOUNT'=>'Account:', +'LBL_ACCOUNT_NAME'=>'Account Name:', +'LBL_PHONE'=>'Phone:', +'LBL_WEBSITE'=>'Website:', +'LBL_FAX'=>'Fax:', +'LBL_TICKER_SYMBOL'=>'Ticker Symbol:', +'LBL_OTHER_PHONE'=>'Other Phone:', +'LBL_ANY_PHONE'=>'Any Phone:', +'LBL_MEMBER_OF'=>'Member of:', +'LBL_EMAIL'=>'Email:', +'LBL_EMPLOYEES'=>'Employees:', +'LBL_OTHER_EMAIL_ADDRESS'=>'Other Email:', +'LBL_ANY_EMAIL'=>'Any Email:', +'LBL_OWNERSHIP'=>'Ownership:', +'LBL_RATING'=>'Rating:', +'LBL_INDUSTRY'=>'Industry:', +'LBL_SIC_CODE'=>'SIC Code:', +'LBL_TYPE'=>'Type:', +'LBL_ANNUAL_REVENUE'=>'Annual Revenue:', +'LBL_ADDRESS_INFORMATION'=>'Address Information', +'LBL_ACCOUNT_INFORMATION'=>'Account Information', +'LBL_CUSTOM_INFORMATION'=>'Custom Information', +'LBL_BILLING_ADDRESS'=>'Billing Address:', +'LBL_SHIPPING_ADDRESS'=>'Shipping Address:', +'LBL_ANY_ADDRESS'=>'Any Address:', +'LBL_CITY'=>'City:', +'LBL_STATE'=>'State:', +'LBL_POSTAL_CODE'=>'Postal Code:', +'LBL_COUNTRY'=>'Country:', +'LBL_DESCRIPTION_INFORMATION'=>'Description Information', +'LBL_DESCRIPTION'=>'Description:', +'NTC_COPY_BILLING_ADDRESS'=>'Copy billing address to shipping address', +'NTC_COPY_SHIPPING_ADDRESS'=>'Copy shipping address to billing address', +'NTC_REMOVE_MEMBER_ORG_CONFIRMATION'=>'Are you sure you want to remove this record as a member organization?', +'LBL_DUPLICATE'=>'Potential Duplicate Accounts', +'MSG_DUPLICATE' => 'Creating this vtiger_account may vtiger_potentialy create a duplicate vtiger_account. You may either select an vtiger_account from the list below or you may click on Create New Account to continue creating a new vtiger_account with the previously entered data.', + +'LBL_INVITEE'=>'Contacts', +'ERR_DELETE_RECORD'=>"A record number must be specified to delete the vtiger_account.", + +'LBL_SELECT_ACCOUNT'=>'Select Account', +'LBL_GENERAL_INFORMATION'=>'General Information', + +//for v4 release added +'LBL_NEW_POTENTIAL'=>'New Potential', +'LBL_POTENTIAL_TITLE'=>'Potentials', + +'LBL_NEW_TASK'=>'New Task', +'LBL_TASK_TITLE'=>'Tasks', +'LBL_NEW_CALL'=>'New Call', +'LBL_CALL_TITLE'=>'Calls', +'LBL_NEW_MEETING'=>'New Meeting', +'LBL_MEETING_TITLE'=>'Meetings', +'LBL_NEW_EMAIL'=>'New Email', +'LBL_EMAIL_TITLE'=>'Emails', +'LBL_NEW_CONTACT'=>'New Contact', +'LBL_CONTACT_TITLE'=>'Contacts', + +//Added vtiger_fields after RC1 - Release +'LBL_ALL'=>'All', +'LBL_PROSPECT'=>'Prospect', +'LBL_INVESTOR'=>'Investor', +'LBL_RESELLER'=>'Reseller', +'LBL_PARTNER'=>'Partner', + +// Added for 4GA +'LBL_TOOL_FORM_TITLE'=>'Account Tools', +//Added for 4GA +'Account Name'=>'Account Name', +'Phone'=>'Phone', +'Website'=>'Website', +'Fax'=>'Fax', +'Ticker Symbol'=>'Ticker Symbol', +'Other Phone'=>'Other Phone', +'Member Of'=>'Member Of', +'Email'=>'Email', +'Employees'=>'Employees', +'Other Email'=>'Other Email', +'Ownership'=>'Ownership', +'Rating'=>'Rating', +'industry'=>'Industry', +'SIC Code'=>'SIC Code', +'Type'=>'Type', +'Annual Revenue'=>'Annual Revenue', +'Assigned To'=>'Assigned To', +'Billing Address'=>'Billing Address', +'Shipping Address'=>'Shipping Address', +'Billing City'=>'Billing City', +'Shipping City'=>'Shipping City', +'Billing State'=>'Billing State', +'Shipping State'=>'Shipping State', +'Billing Code'=>'Billing Postal Code', +'Shipping Code'=>'Shipping Postal Code', +'Billing Country'=>'Billing Country', +'Shipping Country'=>'Shipping Country', +'Created Time'=>'Created Time', +'Modified Time'=>'Modified Time', +'Description'=>'Description', +'Shipping Po Box'=>'Shipping PO Box', +'Billing Po Box'=>'Billing PO Box', + +//Added after 4.2 patch 2 +'Email Opt Out'=>'Email Opt Out', +'LBL_EMAIL_OPT_OUT'=>'Email Opt Out:', + +//Added after 5Alpha5 +'Notify Owner'=>'Notify Owner', + +//Added for existing picklist entries + +'--None--'=>'--None--', + +'Acquired'=>'Acquired', +'Active'=>'Active', +'Market Failed'=>'Market Failed', +'Project Cancelled'=>'Project Cancelled', +'Shutdown'=>'Shutdown', + +'Apparel'=>'Apparel', +'Banking'=>'Banking', +'Biotechnology'=>'Biotechnology', +'Chemicals'=>'Chemicals', +'Communications'=>'Communications', +'Construction'=>'Construction', +'Consulting'=>'Consulting', +'Education'=>'Education', +'Electronics'=>'Electronics', +'Energy'=>'Energy', +'Engineering'=>'Engineering', +'Entertainment'=>'Entertainment', +'Environmental'=>'Environmental', +'Finance'=>'Finance', +'Food & Beverage'=>'Food & Beverage', +'Government'=>'Government', +'Healthcare'=>'Healthcare', +'Hospitality'=>'Hospitality', +'Insurance'=>'Insurance', +'Machinery'=>'Machinery', +'Manufacturing'=>'Manufacturing', +'Media'=>'Media', +'Not For Profit'=>'Not For Profit', +'Recreation'=>'Recreation', +'Retail'=>'Retail', +'Shipping'=>'Shipping', +'Technology'=>'Technology', +'Telecommunications'=>'Telecommunications', +'Transportation'=>'Transportation', +'Utilities'=>'Utilities', +'Other'=>'Other', + +'Analyst'=>'Analyst', +'Competitor'=>'Competitor', +'Customer'=>'Customer', +'Integrator'=>'Integrator', +'Investor'=>'Investor', +'Partner'=>'Partner', +'Press'=>'Press', +'Prospect'=>'Prospect', +'Reseller'=>'Reseller', +'LBL_START_DATE' => 'Start Date', +'LBL_END_DATE' => 'End Date', + +// Added for multi organization support TRAC #2035 +'LBL_COMPANY_ASSIGNMENT'=>'Organization Assignment', +'Organization Assignment'=>'Assigned to', + +); + +?> Modified: vtigercrm/branches/5.1_jens/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/Activity.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/Activity.php Tue Nov 14 03:16:10 2006 @@ -1,498 +1,740 @@ -'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid'); - - var $column_fields = Array(); - var $sortby_fields = Array('subject','due_date','date_start','smownerid','activitytype'); //Sorting is added for due date and start date - - // This is used to retrieve related vtiger_fields from form posts. - var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'); - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Close'=>Array('activity'=>'status'), - 'Type'=>Array('activity'=>'activitytype'), - 'Subject'=>Array('activity'=>'subject'), - 'Related to'=>Array('seactivityrel'=>'activityid'), - 'Start Date'=>Array('activity'=>'date_start'), - 'End Date'=>Array('activity'=>'due_date'), - 'Recurring Type'=>Array('recurringevents'=>'recurringtype'), - 'Assigned To'=>Array('crmentity'=>'smownerid') - ); - - var $range_fields = Array( - 'name', - 'date_modified', - 'start_date', - 'id', - 'status', - 'date_due', - 'time_start', - 'description', - 'contact_name', - 'priority', - 'duehours', - 'dueminutes', - 'location' - ); - - - var $list_fields_name = Array( - 'Close'=>'status', - 'Type'=>'activitytype', - 'Subject'=>'subject', - 'Contact Name'=>'lastname', - 'Related to'=>'activityid', - 'Start Date'=>'date_start', - 'End Date'=>'due_date', - 'Recurring Type'=>'recurringtype', - 'Assigned To'=>'assigned_user_id'); - - var $list_link_field= 'subject'; - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'due_date'; - var $default_sort_order = 'ASC'; - - function Activity() { - $this->log = LoggerManager::getLogger('Calendar'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Calendar'); - } - - var $new_schema = true; - - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '')?($_SESSION['ACTIVITIES_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder method ..."); - return $sorder; - } - - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'subject') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '')?($_SESSION['ACTIVITIES_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - -//Function Call for Related List -- Start - /** - * Function to get Activity related Contacts - * @param integer $id - activityid - * returns related Contacts record in array format - */ - function get_contacts($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new Contact(); - - $button = ''; - - $returnset = '&return_module=Calendar&return_action=CallRelatedList&activity_mode=Events&return_id='.$id; - - $query = 'select vtiger_users.user_name,vtiger_contactdetails.accountid,vtiger_contactdetails.contactid, vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_contactdetails.department, vtiger_contactdetails.title, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid=vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_cntactivityrel.activityid = vtiger_activitygrouprelation.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname where vtiger_cntactivityrel.activityid='.$id.' and vtiger_crmentity.deleted=0'; - $log->debug("Exiting get_contacts method ..."); - return GetRelatedList('Calendar','Contacts',$focus,$query,$button,$returnset); - } - - /** - * Function to get Activity related Users - * @param integer $id - activityid - * returns related Users record in array format - */ - - function get_users($id) - { - global $log; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $app_strings; - - $focus = new User(); - - $button = ''; - - $returnset = '&return_module=Calendar&return_action=CallRelatedList&return_id='.$id; - - $query = 'SELECT vtiger_users.id, vtiger_users.first_name,vtiger_users.last_name, vtiger_users.user_name, vtiger_users.email1, vtiger_users.email2, vtiger_users.status, vtiger_users.is_admin, vtiger_user2role.roleid, vtiger_users.yahoo_id, vtiger_users.phone_home, vtiger_users.phone_work, vtiger_users.phone_mobile, vtiger_users.phone_other, vtiger_users.phone_fax,vtiger_activity.date_start,vtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes from vtiger_users inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.smid=vtiger_users.id inner join vtiger_activity on vtiger_activity.activityid=vtiger_salesmanactivityrel.activityid inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where vtiger_activity.activityid='.$id; - $log->debug("Exiting get_users method ..."); - return GetRelatedList('Calendar','Users',$focus,$query,$button,$returnset); - - - } - - /** - * Function to get activities for given criteria - * @param string $criteria - query string - * returns activity records in array format($list) or null value - */ - function get_full_list($criteria) - { - global $log; - $log->debug("Entering get_full_list(".$criteria.") method ..."); - $query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 ".$criteria; - $result =& $this->db->query($query); - - if($this->db->getRowCount($result) > 0){ - - // We have some data. - while ($row = $this->db->fetchByAssoc($result)) { - foreach($this->list_fields_name as $field) - { - if (isset($row[$field])) { - $this->$field = $row[$field]; - } - else { - $this->$field = ''; - } - } - $list[] = $this; - } - } - if (isset($list)) - { - $log->debug("Exiting get_full_list method ..."); - return $list; - } - else - { - $log->debug("Exiting get_full_list method ..."); - return null; - } - - } - - -//calendarsync - /** - * Function to get meeting count - * @param string $user_name - User Name - * return integer $row["count(*)"] - count - */ - function getCount_Meeting($user_name) - { - global $log; - $log->debug("Entering getCount_Meeting(".$user_name.") method ..."); - $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - $log->debug("Exiting getCount_Meeting method ..."); - return $row["count(*)"]; - } - - function get_calendars($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_calendars(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_activity.location as location,vtiger_activity.duration_hours as duehours, vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as time_start, vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as vtiger_priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting' limit " .$from_index ."," .$offset; - $log->debug("Exiting get_calendars method ..."); - return $this->process_list_query1($query); - } -//calendarsync - /** - * Function to get task count - * @param string $user_name - User Name - * return integer $row["count(*)"] - count - */ - function getCount($user_name) - { - global $log; - $log->debug("Entering getCount(".$user_name.") method ..."); - $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - - $log->debug("Exiting getCount method ..."); - return $row["count(*)"]; - } - - /** - * Function to get list of task for user with given limit - * @param string $user_name - User Name - * @param string $from_index - query string - * @param string $offset - query string - * returns tasks in array format - */ - function get_tasks($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_tasks(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task' limit " .$from_index ."," .$offset; - $log->debug("Exiting get_tasks method ..."); - return $this->process_list_query1($query); - - } - - /** - * Function to process the activity list query - * @param string $query - query string - * return array $response - activity lists - */ - function process_list_query1($query) - { - global $log; - $log->debug("Entering process_list_query1(".$query.") method ..."); - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - $task = Array(); - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - - { - foreach($this->range_fields as $columnName) - { - if (isset($row[$columnName])) { - - $task[$columnName] = $row[$columnName]; - } - else - { - $task[$columnName] = ""; - } - } - - $task[contact_name] = return_name($row, 'cfn', 'cln'); - - $list[] = $task; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - - $log->debug("Exiting process_list_query1 method ..."); - return $response; - } - - /** - * Function to get reminder for activity - * @param integer $activity_id - activity id - * @param string $reminder_time - reminder time - * @param integer $reminder_sent - 0 or 1 - * @param integer $recurid - recuring eventid - * @param string $remindermode - string like 'edit' - */ - function activity_reminder($activity_id,$reminder_time,$reminder_sent=0,$recurid,$remindermode='') - { - global $log; - $log->debug("Entering vtiger_activity_reminder(".$activity_id.",".$reminder_time.",".$reminder_sent.",".$recurid.",".$remindermode.") method ..."); - //Check for vtiger_activityid already present in the reminder_table - $query_exist = "SELECT activity_id FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; - $result_exist = $this->db->query($query_exist); - - if($remindermode == 'edit') - { - if($this->db->num_rows($result_exist) == 1) - { - $query = "UPDATE ".$this->reminder_table." SET"; - $query .=" reminder_sent = ".$reminder_sent.","; - $query .=" reminder_time = ".$reminder_time." WHERE activity_id =".$activity_id; - } - else - { - $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; - } - } - elseif(($remindermode == 'delete') && ($this->db->num_rows($result_exist) == 1)) - { - $query = "DELETE FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; - } - else - { - $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; - } - $this->db->query($query,true,"Error in processing vtiger_table $this->reminder_table"); - $log->debug("Exiting vtiger_activity_reminder method ..."); - } - -//Used for vtigerCRM Outlook Add-In -/** - * Function to get tasks to display in outlookplugin - * @param string $username - User name - * return string $query - sql query - */ -function get_tasksforol($username) -{ - global $log,$adb; - $log->debug("Entering get_tasksforol(".$username.") method ..."); - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($username); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result1 = $adb->query($sql1); - for($i=0;$i < $adb->num_rows($result1);$i++) - { - $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); - $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); - /*if($adb->query_result($result1,$i,'columnname') == "parentid") - { - $permitted_lists[] = 'vtiger_account'; - $permitted_lists[] = 'accountname'; - }*/ - } - $permitted_lists = array_chunk($permitted_lists,2); - $column_table_lists = array(); - for($i=0;$i < count($permitted_lists);$i++) - { - $column_table_lists[] = implode(".",$permitted_lists[$i]); - } - - $query = "select vtiger_activity.activityid as taskid, ".implode(',',$column_table_lists)." from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid - left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid - where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; - $log->debug("Exiting get_tasksforol method ..."); - return $query; -} - -/** - * Function to get calendar query for outlookplugin - * @param string $username - User name * return string $query - sql query */ -function get_calendarsforol($user_name) -{ - global $log,$adb; - $log->debug("Entering get_calendarsforol(".$user_name.") method ..."); - global $current_user; - require_once("modules/Users/User.php"); - $seed_user=new User(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result1 = $adb->query($sql1); - for($i=0;$i < $adb->num_rows($result1);$i++) - { - $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); - $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); - /*if($adb->query_result($result1,$i,'columnname') == "parentid") - { - $permitted_lists[] = 'vtiger_account'; - $permitted_lists[] = 'accountname'; - }*/ - } - $permitted_lists = array_chunk($permitted_lists,2); - $column_table_lists = array(); - for($i=0;$i < count($permitted_lists);$i++) - { - $column_table_lists[] = implode(".",$permitted_lists[$i]); - } - - $query = "select vtiger_activity.activityid as clndrid, ".implode(',',$column_table_lists)." from vtiger_activity - inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid - left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; - $log->debug("Exiting get_calendarsforol method ..."); - return $query; -} -//End - -} -?> +'crmid','vtiger_activity'=>'activityid','vtiger_seactivityrel'=>'activityid','vtiger_cntactivityrel'=>'activityid','vtiger_salesmanactivityrel'=>'activityid','vtiger_activity_reminder'=>'activity_id','vtiger_recurringevents'=>'activityid'); + + var $column_fields = Array(); + var $sortby_fields = Array('subject','due_date','date_start','smownerid','activitytype'); //Sorting is added for due date and start date + + // This is used to retrieve related vtiger_fields from form posts. + var $additional_column_fields = Array('assigned_user_name', 'assigned_user_id', 'contactname', 'contact_phone', 'contact_email', 'parent_name'); + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Close'=>Array('activity'=>'status'), + 'Type'=>Array('activity'=>'activitytype'), + 'Subject'=>Array('activity'=>'subject'), + 'Related to'=>Array('seactivityrel'=>'activityid'), + 'Start Date'=>Array('activity'=>'date_start'), + 'End Date'=>Array('activity'=>'due_date'), + 'Recurring Type'=>Array('recurringevents'=>'recurringtype'), + 'Assigned To'=>Array('crmentity'=>'smownerid') + ); + + var $range_fields = Array( + 'name', + 'date_modified', + 'start_date', + 'id', + 'status', + 'date_due', + 'time_start', + 'description', + 'contact_name', + 'priority', + 'duehours', + 'dueminutes', + 'location' + ); + + + var $list_fields_name = Array( + 'Close'=>'status', + 'Type'=>'activitytype', + 'Subject'=>'subject', + 'Contact Name'=>'lastname', + 'Related to'=>'activityid', + 'Start Date'=>'date_start', + 'End Date'=>'due_date', + 'Recurring Type'=>'recurringtype', + 'Assigned To'=>'assigned_user_id'); + + var $list_link_field= 'subject'; + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'due_date'; + var $default_sort_order = 'ASC'; + + function Activity() { + $this->log = LoggerManager::getLogger('Calendar'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Calendar'); + } + + + function save_module($module) + { + //Handling module specific save + //Insert into seactivity rel + if(isset($this->column_fields['parent_id']) && $this->column_fields['parent_id'] != '') + { + $this->insertIntoEntityTable("vtiger_seactivityrel", $module); + } + elseif($this->column_fields['parent_id']=='' && $insertion_mode=="edit") + { + $this->deleteRelation("vtiger_seactivityrel"); + } + //Insert into cntactivity rel + + if(isset($this->column_fields['contact_id']) && $this->column_fields['contact_id'] != '') + { + $this->insertIntoEntityTable('vtiger_cntactivityrel', $module); + } + elseif($this->column_fields['contact_id'] =='' && $insertion_mode=="edit") + { + $this->deleteRelation('vtiger_cntactivityrel'); + } + + //Handling for recurring type + //Insert into vtiger_activity_remainder table + if(isset($this->column_fields['recurringtype']) && $this->column_fields['recurringtype']!='') + $recur_type = trim($this->column_fields['recurringtype']); + else + $recur_type=''; + + if($recur_type == "--None--") + { + $this->insertIntoReminderTable('vtiger_activity_reminder',$module,""); + } + + //Insert into vtiger_recurring event table + $recur_type = trim($this->column_fields['recurringtype']); + if($recur_type != "--None--" && $recur_type != '') + { + $recur_data = getrecurringObjValue(); + if(is_object($recur_data)) + $this->insertIntoRecurringTable($recur_data); + } + + //Handling for invitees + if(isset($_REQUEST['inviteesid']) && $_REQUEST['inviteesid']!='') + { + $selected_users_string = $_REQUEST['inviteesid']; + $invitees_array = explode(';',$selected_users_string); + $this->insertIntoInviteeTable('vtiger_invitees',$module,$invitees_array); + + } + + //Inserting into sales man activity rel + $this->insertIntoSmActivityRel($module); + + + + } + + + /** Function to insert values in vtiger_activity_remainder table for the specified module, + * @param $table_name -- table name:: Type varchar + * @param $module -- module:: Type varchar + */ + function insertIntoReminderTable($table_name,$module,$recurid) + { + global $log; + $log->info("in insertIntoReminderTable ".$table_name." module is ".$module); + if($_REQUEST['set_reminder'] == 'Yes') + { + $log->debug("set reminder is set"); + $rem_days = $_REQUEST['remdays']; + $log->debug("rem_days is ".$rem_days); + $rem_hrs = $_REQUEST['remhrs']; + $log->debug("rem_hrs is ".$rem_hrs); + $rem_min = $_REQUEST['remmin']; + $log->debug("rem_minutes is ".$rem_min); + $reminder_time = $rem_days * 24 * 60 + $rem_hrs * 60 + $rem_min; + $log->debug("reminder_time is ".$reminder_time); + if ($recurid == "") + { + if($_REQUEST['mode'] == 'edit') + { + $this->activity_reminder($this->id,$reminder_time,0,$recurid,'edit'); + } + else + { + $this->activity_reminder($this->id,$reminder_time,0,$recurid,''); + } + } + else + { + $this->activity_reminder($this->id,$reminder_time,0,$recurid,''); + } + } + elseif($_REQUEST['set_reminder'] == 'No') + { + $this->activity_reminder($this->id,'0',0,$recurid,'delete'); + } + } + + + // Code included by Jaguar - starts + /** Function to insert values in vtiger_recurringevents table for the specified tablename,module + * @param $recurObj -- Recurring Object:: Type varchar + */ +function insertIntoRecurringTable(& $recurObj) +{ + global $log,$adb; + $log->info("in insertIntoRecurringTable "); + $st_date = $recurObj->startdate->get_formatted_date(); + $log->debug("st_date ".$st_date); + $end_date = $recurObj->enddate->get_formatted_date(); + $log->debug("end_date is set ".$end_date); + $type = $recurObj->recur_type; + $log->debug("type is ".$type); + $flag="true"; + + if($_REQUEST['mode'] == 'edit') + { + $activity_id=$this->id; + + $sql='select min(recurringdate) AS min_date,max(recurringdate) AS max_date, recurringtype, activityid from vtiger_recurringevents where activityid='. $activity_id.' group by activityid, recurringtype'; + + $result = $adb->query($sql); + $noofrows = $adb->num_rows($result); + for($i=0; $i<$noofrows; $i++) + { + $recur_type_b4_edit = $adb->query_result($result,$i,"recurringtype"); + $date_start_b4edit = $adb->query_result($result,$i,"min_date"); + $end_date_b4edit = $adb->query_result($result,$i,"max_date"); + } + if(($st_date == $date_start_b4edit) && ($end_date==$end_date_b4edit) && ($type == $recur_type_b4_edit)) + { + if($_REQUEST['set_reminder'] == 'Yes') + { + $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; + $adb->query($sql); + $sql = 'delete from vtiger_recurringevents where activityid='.$activity_id; + $adb->query($sql); + $flag="true"; + } + elseif($_REQUEST['set_reminder'] == 'No') + { + $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; + $adb->query($sql); + $flag="false"; + } + else + $flag="false"; + } + else + { + $sql = 'delete from vtiger_activity_reminder where activity_id='.$activity_id; + $adb->query($sql); + $sql = 'delete from vtiger_recurringevents where activityid='.$activity_id; + $adb->query($sql); + } + } + $date_array = $recurObj->recurringdates; + if(isset($recurObj->recur_freq) && $recurObj->recur_freq != null) + $recur_freq = $recurObj->recur_freq; + else + $recur_freq = 1; + if($recurObj->recur_type == 'Daily' || $recurObj->recur_type == 'Yearly') + $recurringinfo = $recurObj->recur_type; + elseif($recurObj->recur_type == 'Weekly') + { + $recurringinfo = $recurObj->recur_type; + if($recurObj->dayofweek_to_rpt != null) + $recurringinfo = $recurringinfo.'::'.implode('::',$recurObj->dayofweek_to_rpt); + } + elseif($recurObj->recur_type == 'Monthly') + { + $recurringinfo = $recurObj->recur_type.'::'.$recurObj->repeat_monthby; + if($recurObj->repeat_monthby == 'date') + $recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_datevalue; + else + $recurringinfo = $recurringinfo.'::'.$recurObj->rptmonth_daytype.'::'.$recurObj->dayofweek_to_rpt[0]; + } + else + { + $recurringinfo = ''; + } + if($flag=="true") + { + for($k=0; $k< count($date_array); $k++) + { + $tdate=$date_array[$k]; + if($tdate <= $end_date) + { + $max_recurid_qry = 'select max(recurringid) AS recurid from vtiger_recurringevents;'; + $result = $adb->query($max_recurid_qry); + $noofrows = $adb->num_rows($result); + for($i=0; $i<$noofrows; $i++) + { + $recur_id = $adb->query_result($result,$i,"recurid"); + } + $current_id =$recur_id+1; + $recurring_insert = "insert into vtiger_recurringevents values ('".$current_id."','".$this->id."','".$tdate."','".$type."','".$recur_freq."','".$recurringinfo."')"; + $adb->query($recurring_insert); + if($_REQUEST['set_reminder'] == 'Yes') + { + $this->insertIntoReminderTable("vtiger_activity_reminder",$module,$current_id,''); + } + } + } + } +} + + + /** Function to insert values in vtiger_invitees table for the specified module,tablename ,invitees_array + * @param $table_name -- table name:: Type varchar + * @param $module -- module:: Type varchar + * @param $invitees_array Array + */ + function insertIntoInviteeTable($table_name,$module,$invitees_array) + { + global $log,$adb; + $log->debug("Entering insertIntoInviteeTable(".$table_name.",".$module.",".$invitees_array.") method ..."); + foreach($invitees_array as $inviteeid) + { + if($inviteeid != '') + { + $query="insert into vtiger_invitees values(".$this->id.",".$inviteeid.")"; + $adb->query($query); + } + } + $log->debug("Exiting insertIntoInviteeTable method ..."); + + } + + + /** Function to insert values in vtiger_salesmanactivityrel table for the specified module + * @param $module -- module:: Type varchar + */ + + function insertIntoSmActivityRel($module) + { + global $adb; + global $current_user; + if($this->mode == 'edit') + { + + $sql = "delete from vtiger_salesmanactivityrel where activityid=".$this->id." and smid = ".$this->column_fields['assigned_user_id'].""; + $adb->query($sql); + + } + $sql_qry = "insert into vtiger_salesmanactivityrel (smid,activityid) values(".$this->column_fields['assigned_user_id'].",".$this->id.")"; + $adb->query($sql_qry); + + } + + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['ACTIVITIES_SORT_ORDER'] != '')?($_SESSION['ACTIVITIES_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder method ..."); + return $sorder; + } + + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'subject') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['ACTIVITIES_ORDER_BY'] != '')?($_SESSION['ACTIVITIES_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + +//Function Call for Related List -- Start + /** + * Function to get Activity related Contacts + * @param integer $id - activityid + * returns related Contacts record in array format + */ + function get_contacts($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new Contacts(); + + $button = ''; + + $returnset = '&return_module=Calendar&return_action=CallRelatedList&activity_mode=Events&return_id='.$id; + + $query = 'select vtiger_users.user_name,vtiger_contactdetails.accountid,vtiger_contactdetails.contactid, vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_contactdetails.department, vtiger_contactdetails.title, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid=vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid left join vtiger_activitygrouprelation on vtiger_cntactivityrel.activityid = vtiger_activitygrouprelation.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname where vtiger_cntactivityrel.activityid='.$id.' and vtiger_crmentity.deleted=0'; + $log->debug("Exiting get_contacts method ..."); + return GetRelatedList('Calendar','Contacts',$focus,$query,$button,$returnset); + } + + /** + * Function to get Activity related Users + * @param integer $id - activityid + * returns related Users record in array format + */ + + function get_users($id) + { + global $log; + $log->debug("Entering get_contacts(".$id.") method ..."); + global $app_strings; + + $focus = new Users(); + + $button = ''; + + $returnset = '&return_module=Calendar&return_action=CallRelatedList&return_id='.$id; + + $query = 'SELECT vtiger_users.id, vtiger_users.first_name,vtiger_users.last_name, vtiger_users.user_name, vtiger_users.email1, vtiger_users.email2, vtiger_users.status, vtiger_users.is_admin, vtiger_user2role.roleid, vtiger_users.yahoo_id, vtiger_users.phone_home, vtiger_users.phone_work, vtiger_users.phone_mobile, vtiger_users.phone_other, vtiger_users.phone_fax,vtiger_activity.date_start,vtiger_activity.due_date,vtiger_activity.time_start,vtiger_activity.duration_hours,vtiger_activity.duration_minutes from vtiger_users inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.smid=vtiger_users.id inner join vtiger_activity on vtiger_activity.activityid=vtiger_salesmanactivityrel.activityid inner join vtiger_user2role on vtiger_user2role.userid=vtiger_users.id where vtiger_activity.activityid='.$id; + $log->debug("Exiting get_users method ..."); + return GetRelatedList('Calendar','Users',$focus,$query,$button,$returnset); + + + } + + /** + * Function to get activities for given criteria + * @param string $criteria - query string + * returns activity records in array format($list) or null value + */ + function get_full_list($criteria) + { + global $log; + $log->debug("Entering get_full_list(".$criteria.") method ..."); + $query = "select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 ".$criteria; + $result =& $this->db->query($query); + + if($this->db->getRowCount($result) > 0){ + + // We have some data. + while ($row = $this->db->fetchByAssoc($result)) { + foreach($this->list_fields_name as $field) + { + if (isset($row[$field])) { + $this->$field = $row[$field]; + } + else { + $this->$field = ''; + } + } + $list[] = $this; + } + } + if (isset($list)) + { + $log->debug("Exiting get_full_list method ..."); + return $list; + } + else + { + $log->debug("Exiting get_full_list method ..."); + return null; + } + + } + + +//calendarsync + /** + * Function to get meeting count + * @param string $user_name - User Name + * return integer $row["count(*)"] - count + */ + function getCount_Meeting($user_name) + { + global $log; + $log->debug("Entering getCount_Meeting(".$user_name.") method ..."); + $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + $log->debug("Exiting getCount_Meeting method ..."); + return $row["count(*)"]; + } + + function get_calendars($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_calendars(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_activity.location as location,vtiger_activity.duration_hours as duehours, vtiger_activity.duration_minutes as dueminutes,vtiger_activity.time_start as time_start, vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as vtiger_priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting' limit " .$from_index ."," .$offset; + $log->debug("Exiting get_calendars method ..."); + return $this->process_list_query1($query); + } +//calendarsync + /** + * Function to get task count + * @param string $user_name - User Name + * return integer $row["count(*)"] - count + */ + function getCount($user_name) + { + global $log; + $log->debug("Entering getCount(".$user_name.") method ..."); + $query = "select count(*) from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + + $log->debug("Exiting getCount method ..."); + return $row["count(*)"]; + } + + /** + * Function to get list of task for user with given limit + * @param string $user_name - User Name + * @param string $from_index - query string + * @param string $offset - query string + * returns tasks in array format + */ + function get_tasks($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_tasks(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_activity.subject as name,vtiger_crmentity.modifiedtime as date_modified, vtiger_activity.date_start start_date,vtiger_activity.activityid as id,vtiger_activity.status as status, vtiger_crmentity.description as description, vtiger_activity.priority as priority, vtiger_activity.due_date as date_due ,vtiger_contactdetails.firstname cfn, vtiger_contactdetails.lastname cln from vtiger_activity inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task' limit " .$from_index ."," .$offset; + $log->debug("Exiting get_tasks method ..."); + return $this->process_list_query1($query); + + } + + /** + * Function to process the activity list query + * @param string $query - query string + * return array $response - activity lists + */ + function process_list_query1($query) + { + global $log; + $log->debug("Entering process_list_query1(".$query.") method ..."); + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + $task = Array(); + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + + { + foreach($this->range_fields as $columnName) + { + if (isset($row[$columnName])) { + + $task[$columnName] = $row[$columnName]; + } + else + { + $task[$columnName] = ""; + } + } + + $task[contact_name] = return_name($row, 'cfn', 'cln'); + + $list[] = $task; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + + $log->debug("Exiting process_list_query1 method ..."); + return $response; + } + + /** + * Function to get reminder for activity + * @param integer $activity_id - activity id + * @param string $reminder_time - reminder time + * @param integer $reminder_sent - 0 or 1 + * @param integer $recurid - recuring eventid + * @param string $remindermode - string like 'edit' + */ + function activity_reminder($activity_id,$reminder_time,$reminder_sent=0,$recurid,$remindermode='') + { + global $log; + $log->debug("Entering vtiger_activity_reminder(".$activity_id.",".$reminder_time.",".$reminder_sent.",".$recurid.",".$remindermode.") method ..."); + //Check for vtiger_activityid already present in the reminder_table + $query_exist = "SELECT activity_id FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; + $result_exist = $this->db->query($query_exist); + + if($remindermode == 'edit') + { + if($this->db->num_rows($result_exist) == 1) + { + $query = "UPDATE ".$this->reminder_table." SET"; + $query .=" reminder_sent = ".$reminder_sent.","; + $query .=" reminder_time = ".$reminder_time." WHERE activity_id =".$activity_id; + } + else + { + $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; + } + } + elseif(($remindermode == 'delete') && ($this->db->num_rows($result_exist) == 1)) + { + $query = "DELETE FROM ".$this->reminder_table." WHERE activity_id = ".$activity_id; + } + else + { + $query = "INSERT INTO ".$this->reminder_table." VALUES (".$activity_id.",".$reminder_time.",0,'".$recurid."')"; + } + $this->db->query($query,true,"Error in processing vtiger_table $this->reminder_table"); + $log->debug("Exiting vtiger_activity_reminder method ..."); + } + +//Used for vtigerCRM Outlook Add-In +/** + * Function to get tasks to display in outlookplugin + * @param string $username - User name + * return string $query - sql query + */ +function get_tasksforol($username) +{ + global $log,$adb; + $log->debug("Entering get_tasksforol(".$username.") method ..."); + global $current_user; + require_once("modules/Users/Users.php"); + $seed_user=new Users(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + /*if($adb->query_result($result1,$i,'columnname') == "parentid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + }*/ + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $query = "select vtiger_activity.activityid as taskid, ".implode(',',$column_table_lists)." from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + inner join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid + where vtiger_users.user_name='".$username."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Task'"; + $log->debug("Exiting get_tasksforol method ..."); + return $query; +} + +/** + * Function to get calendar query for outlookplugin + * @param string $username - User name * return string $query - sql query */ +function get_calendarsforol($user_name) +{ + global $log,$adb; + $log->debug("Entering get_calendarsforol(".$user_name.") method ..."); + global $current_user; + require_once("modules/Users/Users.php"); + $seed_user=new Users(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder'"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=9 and tablename <> 'vtiger_recurringevents' and tablename <> 'vtiger_activity_reminder' and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + /*if($adb->query_result($result1,$i,'columnname') == "parentid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + }*/ + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $query = "select vtiger_activity.activityid as clndrid, ".implode(',',$column_table_lists)." from vtiger_activity + inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_users on vtiger_users.id=vtiger_salesmanactivityrel.smid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid=vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_cntactivityrel.contactid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + where vtiger_users.user_name='".$user_name."' and vtiger_crmentity.deleted=0 and vtiger_activity.activitytype='Meeting'"; + $log->debug("Exiting get_calendarsforol method ..."); + return $query; +} +//End + +} +?> Modified: vtigercrm/branches/5.1_jens/modules/Calendar/ActivityAjax.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/ActivityAjax.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/ActivityAjax.php Tue Nov 14 03:16:10 2006 @@ -19,6 +19,27 @@ $cal_log =& LoggerManager::getLogger('calendar'); $cal_log->debug("In CalendarAjax file"); $mysel = $_REQUEST['view']; +if($_REQUEST['file'] == 'OpenListView') +{ + require_once('Smarty_setup.php'); + $smarty = new vtigerCRM_Smarty; + require_once("modules/Calendar/OpenListView.php"); + $smarty->assign("APP",$app_strings); + $smarty->assign("IMAGE_PATH",$image_path); + if($_REQUEST['mode'] == '0') + { + $activities[0] = getPendingActivities(0); + $smarty->assign("ACTIVITIES",$activities); + $smarty->display("upcomingActivities.tpl"); + } + else if($_REQUEST['mode'] == '1') + { + $activities[1] = getPendingActivities(1); + $smarty->assign("ACTIVITIES",$activities); + $smarty->display("pendingActivities.tpl"); + } + die(); +} $calendar_arr = Array(); $calendar_arr['IMAGE_PATH'] = $image_path; $date_data = array(); Modified: vtigercrm/branches/5.1_jens/modules/Calendar/Appointment.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/Appointment.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/Appointment.php Tue Nov 14 03:16:10 2006 @@ -12,6 +12,7 @@ require_once('include/utils/CommonUtils.php'); require_once('include/utils/UserInfoUtil.php'); require_once('include/database/PearDatabase.php'); +require_once('include/database/Postgres8.php'); require_once('modules/Calendar/Activity.php'); class Appointment { @@ -56,11 +57,11 @@ function readAppointment($userid, &$from_datetime, &$to_datetime, $view) { - global $current_user,$adb; + global $current_user,$adb,$log; require('user_privileges/user_privileges_'.$current_user->id.'.php'); require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); $shared_ids = getSharedCalendarId($current_user->id); - $q= "select vtiger_activity.*, vtiger_crmentity.*, vtiger_activitygrouprelation.groupname FROM vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid left join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype in ('Call','Meeting') AND (vtiger_activity.date_start < '". $to_datetime->get_formatted_date() ."' AND vtiger_activity.date_start >= '". $from_datetime->get_formatted_date()."') "; + $q= "select vtiger_activity.*, vtiger_crmentity.*, vtiger_activitygrouprelation.groupname FROM vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid left join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname WHERE vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype in ('Call','Meeting') AND (vtiger_activity.date_start < '". $to_datetime->get_formatted_date() ."' AND vtiger_activity.date_start >= '". $from_datetime->get_formatted_date()."') "; if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[16] == 3) { $sec_parameter=getListViewSecurityParameter('Calendar'); @@ -68,7 +69,10 @@ } $q .= " AND vtiger_recurringevents.activityid is NULL "; - $q .= " group by vtiger_activity.activityid ORDER by vtiger_activity.date_start,vtiger_activity.time_start"; + $q .= " GROUP BY vtiger_activity.activityid ORDER by vtiger_activity.date_start,vtiger_activity.time_start"; + //Postgres 8 fixes + if( $adb->dbType == "pgsql") + $q = fixPostgresQuery( $q, $log, 0); $r = $adb->query($q); $n = $adb->getRowCount($r); $a = 0; @@ -83,7 +87,7 @@ unset($obj); } //Get Recurring events - $q = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_crmentity.description, vtiger_activity.time_start,vtiger_activity.time_end, vtiger_activity.duration_hours, vtiger_activity.duration_minutes,vtiger_activity.due_date, vtiger_activity.priority, vtiger_activity.location,vtiger_activity.eventstatus, vtiger_crmentity.*, vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start ,vtiger_recurringevents.recurringtype,vtiger_activitygrouprelation.groupname from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid"; + $q = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_crmentity.description, vtiger_activity.time_start,vtiger_activity.time_end, vtiger_activity.duration_hours, vtiger_activity.duration_minutes,vtiger_activity.due_date, vtiger_activity.priority, vtiger_activity.location,vtiger_activity.eventstatus, vtiger_crmentity.*, vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start ,vtiger_recurringevents.recurringtype,vtiger_activitygrouprelation.groupname from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left outer join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid left join vtiger_groups on vtiger_groups.groupname = vtiger_activitygrouprelation.groupname "; $q.=" where vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype in ('Call','Meeting') AND (recurringdate < '".$to_datetime->get_formatted_date()."' AND recurringdate >= '".$from_datetime->get_formatted_date(). "') "; @@ -93,7 +97,7 @@ $q .= $sec_parameter; } - $q .= " ORDER by recurringid"; + $q .= " ORDER by vtiger_recurringevents.recurringid"; $r = $adb->query($q); $n = $adb->getRowCount($r); $a = 0; Modified: vtigercrm/branches/5.1_jens/modules/Calendar/CalendarCommon.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/CalendarCommon.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/CalendarCommon.php Tue Nov 14 03:16:10 2006 @@ -182,6 +182,7 @@ function getTimeCombo($format,$bimode,$hour='',$min='',$fmt='') { $combo = ''; + $min = $min - ($min%5); if($format == 'am/pm') { $combo .= ' '; $combo .= ' '; $combo .= 'Hr '; $combo .= ' min'; } @@ -298,7 +299,7 @@ for($i = 0; $i < $noofrows; $i++) { $value = $adb->query_result($Res,$i,$fieldname); - $combo .= ''; + $combo .= ''; } $combo .= ''; Modified: vtigercrm/branches/5.1_jens/modules/Calendar/DetailView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/DetailView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/DetailView.php Tue Nov 14 03:16:10 2006 @@ -1,306 +1,306 @@ -'. $mod_strings{"LBL_NOTIFICATION_ERROR"}.'
'; -} -session_unregister('mail_send_error'); -$focus = new Activity(); -$smarty = new vtigerCRM_Smarty(); -$activity_mode = $_REQUEST['activity_mode']; -//If activity_mode == null - -if($activity_mode =='' || strlen($activity_mode) < 1) -{ - $query = "select activitytype from vtiger_activity where activityid=".$_REQUEST['record']; - $result = $adb->query($query); - $actType = $adb->query_result($result,0,'activitytype'); - if( $actType == 'Task') - { - $activity_mode = $actType; - } - elseif($actType == 'Meeting' || $actType == 'Call') - { - $activity_mode = 'Events'; - } -} - - - -if($activity_mode == 'Task') -{ - $tab_type = 'Calendar'; - $smarty->assign("SINGLE_MOD",$mod_strings['LBL_TODO']); -} -elseif($activity_mode == 'Events') -{ - $tab_type = 'Events'; - $smarty->assign("SINGLE_MOD",$mod_strings['LBL_EVENT']); -} -$tab_id=getTabid($tab_type); - - -if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { - $focus->retrieve_entity_info($_REQUEST['record'],$tab_type); - $focus->id = $_REQUEST['record']; - $focus->name=$focus->column_fields['subject']; -} - -if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { - $focus->id = ""; -} - -//needed when creating a new task with default values passed in -if (isset($_REQUEST['contactname']) && is_null($focus->contactname)) { - $focus->contactname = $_REQUEST['contactname']; -} -if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) { - $focus->contact_id = $_REQUEST['contact_id']; -} -if (isset($_REQUEST['opportunity_name']) && is_null($focus->parent_name)) { - $focus->parent_name = $_REQUEST['opportunity_name']; -} -if (isset($_REQUEST['opportunity_id']) && is_null($focus->parent_id)) { - $focus->parent_id = $_REQUEST['opportunity_id']; -} -if (isset($_REQUEST['accountname']) && is_null($focus->parent_name)) { - $focus->parent_name = $_REQUEST['accountname']; -} -if (isset($_REQUEST['accountid']) && is_null($focus->parent_id)) { - $focus->parent_id = $_REQUEST['accountid']; -} - -$act_data = getBlocks($tab_type,"detail_view",'',$focus->column_fields); -foreach($act_data as $block=>$entry) -{ - foreach($entry as $key=>$value) - { - foreach($value as $label=>$field) - { - $fldlabel[$field['fldname']] = $label; - $finaldata[$field['fldname']] = $field['value']; - } - } -} - -//Start -//To set user selected hour format -if($current_user->hour_format == '') - $format = 'am/pm'; -else - $format = $current_user->hour_format; -list($stdate,$sttime) = split(' ',$finaldata['date_start']); -list($enddate,$endtime) = split(' ',$finaldata['due_date']); -$time_arr = getaddEventPopupTime($sttime,$endtime,$format); -$data['starthr'] = $time_arr['starthour']; -$data['startmin'] = $time_arr['startmin']; -$data['startfmt'] = $time_arr['startfmt']; -$data['endhr'] = $time_arr['endhour']; -$data['endmin'] = $time_arr['endmin']; -$data['endfmt'] = $time_arr['endfmt']; -$data['record'] = $focus->id; -if(isset($finaldata['sendnotification']) && $finaldata['sendnotification'] == 'yes') - $data['sendnotification'] = 'Yes'; -else - $data['sendnotification'] = 'No'; -$data['subject'] = $finaldata['subject']; -$data['date_start'] = $stdate; -$data['due_date'] = $enddate; -$data['assigned_user_id'] = $finaldata['assigned_user_id']; -$data['taskpriority'] = $finaldata['taskpriority']; -$data['modifiedtime'] = $finaldata['modifiedtime']; -$data['createdtime'] = $finaldata['createdtime']; -$data['parent_name'] = $finaldata['parent_id']; -$data['description'] = $finaldata['description']; -if($activity_mode == 'Task') -{ - $data['taskstatus'] = $finaldata['taskstatus']; - $data['activitytype'] = $activity_mode; - $data['contact_id'] = $finaldata['contact_id']; -} -elseif($activity_mode == 'Events') -{ - $data['visibility'] = $finaldata['visibility']; - $data['eventstatus'] = $finaldata['eventstatus']; - $data['activitytype'] = $finaldata['activitytype']; - $data['location'] = $finaldata['location']; - //Calculating reminder time - $rem_days = 0; - $rem_hrs = 0; - $rem_min = 0; - if($focus->column_fields['reminder_time'] != null) - { - $data['set_reminder'] = 'Yes'; - $data['reminder_str'] = $finaldata['reminder_time']; - } - else - $data['set_reminder'] = 'No'; - //To set recurring details - $query = 'select vtiger_recurringevents.recurringfreq,vtiger_recurringevents.recurringinfo from vtiger_recurringevents where vtiger_recurringevents.activityid = '.$focus->id; - $res = $adb->query($query); - $rows = $adb->num_rows($res); - if($rows != 0) - { - $data['recurringcheck'] = 'Yes'; - $data['repeat_frequency'] = $adb->query_result($res,0,'recurringfreq'); - $recurringinfo = explode("::",$adb->query_result($res,0,'recurringinfo')); - $data['recurringtype'] = $recurringinfo[0]; - if($recurringinfo[0] == 'Weekly') - { - $weekrpt_str = ''; - if(count($recurringinfo) > 1) - { - $weekrpt_str .= 'on '; - for($i=1;$iassign("INVITEDUSERS",$related_array['Users']['entries']); - $smarty->assign("CONTACTS",$related_array['Contacts']['entries']); - - -} - -global $theme; -$theme_path="themes/".$theme."/"; -$image_path=$theme_path."images/"; -require_once($theme_path.'layout_utils.php'); - -$log->info("Calendar-Activities detail view"); -$category = getParentTab(); -$smarty->assign("CATEGORY",$category); - -$smarty->assign("MOD", $mod_strings); -$smarty->assign("APP", $app_strings); -$smarty->assign("ACTIVITY_MODE", $activity_mode); - -if (isset($focus->name)) -$smarty->assign("NAME", $focus->name); -else -$smarty->assign("NAME", ""); -$smarty->assign("UPDATEINFO",updateInfo($focus->id)); -if (isset($_REQUEST['return_module'])) -$smarty->assign("RETURN_MODULE", $_REQUEST['return_module']); -if (isset($_REQUEST['return_action'])) -$smarty->assign("RETURN_ACTION", $_REQUEST['return_action']); -if (isset($_REQUEST['return_id'])) -$smarty->assign("RETURN_ID", $_REQUEST['return_id']); -$smarty->assign("THEME", $theme); -$smarty->assign("IMAGE_PATH", $image_path); -$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string'].'&activity_mode='.$activity_mode); -$smarty->assign("ID", $focus->id); -$smarty->assign("NAME", $focus->name); -$smarty->assign("BLOCKS", $act_data); -$smarty->assign("LABEL", $fldlabel); -$smarty->assign("VIEWTYPE", $_REQUEST['viewtype']); -$smarty->assign("CUSTOMFIELD", $cust_fld); -$smarty->assign("ACTIVITYDATA", $data); -$smarty->assign("ID", $_REQUEST['record']); - -//get Description Information -if(isPermitted("Calendar","EditView",$_REQUEST['record']) == 'yes') - $smarty->assign("EDIT_DUPLICATE","permitted"); - -if(isPermitted("Calendar","Delete",$_REQUEST['record']) == 'yes') - $smarty->assign("DELETE","permitted"); - -$check_button = Button_Check($module); -$smarty->assign("CHECK", $check_button); - - $tabid = getTabid($tab_type); - $validationData = getDBValidationData($focus->tab_name,$tabid); - $data2 = split_validationdataArray($validationData); - - $smarty->assign("VALIDATION_DATA_FIELDNAME",$data2['fieldname']); - $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data2['datatype']); - $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data2['fieldlabel']); - -$smarty->assign("MODULE",$currentModule); -$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); -$smarty->display("ActivityDetailView.tpl"); - -?> +'. $mod_strings{"LBL_NOTIFICATION_ERROR"}.'
'; +} +session_unregister('mail_send_error'); +$focus = new Activity(); +$smarty = new vtigerCRM_Smarty(); +$activity_mode = $_REQUEST['activity_mode']; +//If activity_mode == null + +if($activity_mode =='' || strlen($activity_mode) < 1) +{ + $query = "select activitytype from vtiger_activity where activityid=".$_REQUEST['record']; + $result = $adb->query($query); + $actType = $adb->query_result($result,0,'activitytype'); + if( $actType == 'Task') + { + $activity_mode = $actType; + } + elseif($actType == 'Meeting' || $actType == 'Call') + { + $activity_mode = 'Events'; + } +} + + + +if($activity_mode == 'Task') +{ + $tab_type = 'Calendar'; + $smarty->assign("SINGLE_MOD",$mod_strings['LBL_TODO']); +} +elseif($activity_mode == 'Events') +{ + $tab_type = 'Events'; + $smarty->assign("SINGLE_MOD",$mod_strings['LBL_EVENT']); +} +$tab_id=getTabid($tab_type); + + +if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) { + $focus->retrieve_entity_info($_REQUEST['record'],$tab_type); + $focus->id = $_REQUEST['record']; + $focus->name=$focus->column_fields['subject']; +} + +if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') { + $focus->id = ""; +} + +//needed when creating a new task with default values passed in +if (isset($_REQUEST['contactname']) && is_null($focus->contactname)) { + $focus->contactname = $_REQUEST['contactname']; +} +if (isset($_REQUEST['contact_id']) && is_null($focus->contact_id)) { + $focus->contact_id = $_REQUEST['contact_id']; +} +if (isset($_REQUEST['opportunity_name']) && is_null($focus->parent_name)) { + $focus->parent_name = $_REQUEST['opportunity_name']; +} +if (isset($_REQUEST['opportunity_id']) && is_null($focus->parent_id)) { + $focus->parent_id = $_REQUEST['opportunity_id']; +} +if (isset($_REQUEST['accountname']) && is_null($focus->parent_name)) { + $focus->parent_name = $_REQUEST['accountname']; +} +if (isset($_REQUEST['accountid']) && is_null($focus->parent_id)) { + $focus->parent_id = $_REQUEST['accountid']; +} + +$act_data = getBlocks($tab_type,"detail_view",'',$focus->column_fields); +foreach($act_data as $block=>$entry) +{ + foreach($entry as $key=>$value) + { + foreach($value as $label=>$field) + { + $fldlabel[$field['fldname']] = $label; + $finaldata[$field['fldname']] = $field['value']; + } + } +} + +//Start +//To set user selected hour format +if($current_user->hour_format == '') + $format = 'am/pm'; +else + $format = $current_user->hour_format; +list($stdate,$sttime) = split(' ',$finaldata['date_start']); +list($enddate,$endtime) = split(' ',$finaldata['due_date']); +$time_arr = getaddEventPopupTime($sttime,$endtime,$format); +$data['starthr'] = $time_arr['starthour']; +$data['startmin'] = $time_arr['startmin']; +$data['startfmt'] = $time_arr['startfmt']; +$data['endhr'] = $time_arr['endhour']; +$data['endmin'] = $time_arr['endmin']; +$data['endfmt'] = $time_arr['endfmt']; +$data['record'] = $focus->id; +if(isset($finaldata['sendnotification']) && $finaldata['sendnotification'] == 'yes') + $data['sendnotification'] = 'Yes'; +else + $data['sendnotification'] = 'No'; +$data['subject'] = $finaldata['subject']; +$data['date_start'] = $stdate; +$data['due_date'] = $enddate; +$data['assigned_user_id'] = $finaldata['assigned_user_id']; +$data['taskpriority'] = $mod_strings[$finaldata['taskpriority']]; +$data['modifiedtime'] = $finaldata['modifiedtime']; +$data['createdtime'] = $finaldata['createdtime']; +$data['parent_name'] = $finaldata['parent_id']; +$data['description'] = $finaldata['description']; +if($activity_mode == 'Task') +{ + $data['taskstatus'] = $mod_strings[$finaldata['taskstatus']]; + $data['activitytype'] = $activity_mode; + $data['contact_id'] = $finaldata['contact_id']; +} +elseif($activity_mode == 'Events') +{ + $data['visibility'] = $finaldata['visibility']; + $data['eventstatus'] = $mod_strings[$finaldata['eventstatus']]; + $data['activitytype'] = $finaldata['activitytype']; + $data['location'] = $finaldata['location']; + //Calculating reminder time + $rem_days = 0; + $rem_hrs = 0; + $rem_min = 0; + if($focus->column_fields['reminder_time'] != null) + { + $data['set_reminder'] = 'Yes'; + $data['reminder_str'] = $finaldata['reminder_time']; + } + else + $data['set_reminder'] = 'No'; + //To set recurring details + $query = 'select vtiger_recurringevents.recurringfreq,vtiger_recurringevents.recurringinfo from vtiger_recurringevents where vtiger_recurringevents.activityid = '.$focus->id; + $res = $adb->query($query); + $rows = $adb->num_rows($res); + if($rows != 0) + { + $data['recurringcheck'] = 'Yes'; + $data['repeat_frequency'] = $adb->query_result($res,0,'recurringfreq'); + $recurringinfo = explode("::",$adb->query_result($res,0,'recurringinfo')); + $data['recurringtype'] = $recurringinfo[0]; + if($recurringinfo[0] == 'Weekly') + { + $weekrpt_str = ''; + if(count($recurringinfo) > 1) + { + $weekrpt_str .= 'on '; + for($i=1;$iassign("INVITEDUSERS",$related_array['Users']['entries']); + $smarty->assign("CONTACTS",$related_array['Contacts']['entries']); + + +} + +global $theme; +$theme_path="themes/".$theme."/"; +$image_path=$theme_path."images/"; +require_once($theme_path.'layout_utils.php'); + +$log->info("Calendar-Activities detail view"); +$category = getParentTab(); +$smarty->assign("CATEGORY",$category); + +$smarty->assign("MOD", $mod_strings); +$smarty->assign("APP", $app_strings); +$smarty->assign("ACTIVITY_MODE", $activity_mode); + +if (isset($focus->name)) +$smarty->assign("NAME", $focus->name); +else +$smarty->assign("NAME", ""); +$smarty->assign("UPDATEINFO",updateInfo($focus->id)); +if (isset($_REQUEST['return_module'])) +$smarty->assign("RETURN_MODULE", $_REQUEST['return_module']); +if (isset($_REQUEST['return_action'])) +$smarty->assign("RETURN_ACTION", $_REQUEST['return_action']); +if (isset($_REQUEST['return_id'])) +$smarty->assign("RETURN_ID", $_REQUEST['return_id']); +$smarty->assign("THEME", $theme); +$smarty->assign("IMAGE_PATH", $image_path); +$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string'].'&activity_mode='.$activity_mode); +$smarty->assign("ID", $focus->id); +$smarty->assign("NAME", $focus->name); +$smarty->assign("BLOCKS", $act_data); +$smarty->assign("LABEL", $fldlabel); +$smarty->assign("VIEWTYPE", $_REQUEST['viewtype']); +$smarty->assign("CUSTOMFIELD", $cust_fld); +$smarty->assign("ACTIVITYDATA", $data); +$smarty->assign("ID", $_REQUEST['record']); + +//get Description Information +if(isPermitted("Calendar","EditView",$_REQUEST['record']) == 'yes') + $smarty->assign("EDIT_DUPLICATE","permitted"); + +if(isPermitted("Calendar","Delete",$_REQUEST['record']) == 'yes') + $smarty->assign("DELETE","permitted"); + +$check_button = Button_Check($module); +$smarty->assign("CHECK", $check_button); + + $tabid = getTabid($tab_type); + $validationData = getDBValidationData($focus->tab_name,$tabid); + $data2 = split_validationdataArray($validationData); + + $smarty->assign("VALIDATION_DATA_FIELDNAME",$data2['fieldname']); + $smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data2['datatype']); + $smarty->assign("VALIDATION_DATA_FIELDLABEL",$data2['fieldlabel']); + +$smarty->assign("MODULE",$currentModule); +$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record])); +$smarty->display("ActivityDetailView.tpl"); + +?> Modified: vtigercrm/branches/5.1_jens/modules/Calendar/ListView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/ListView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/ListView.php Tue Nov 14 03:16:10 2006 @@ -76,6 +76,7 @@ $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid); //<<<<>>>> $smarty->assign("CHANGE_OWNER",getUserslist()); +$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist()); $where = ""; $url_string = ''; // assigning http url string Modified: vtigercrm/branches/5.1_jens/modules/Calendar/OpenListView.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/OpenListView.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/OpenListView.php Tue Nov 14 03:16:10 2006 @@ -49,82 +49,67 @@ //code added to customize upcomming and pending activities if($_REQUEST['activity_view']=='') { - $query = "select activity_view from vtiger_users where id ='$current_user->id'"; - $result=$adb->query($query); - $activity_view=$adb->query_result($result,0,'activity_view'); + $activity_view='today'; } else $activity_view=$_REQUEST['activity_view']; $today = date("Y-m-d", time()); - if($activity_view == 'Today') - { - $later = date("Y-m-d",strtotime("$today +1 day")); - } - else if($activity_view == 'This Week') - { - $later = date("Y-m-d", strtotime("$today +7 days")); - } - else if($activity_view == 'This Month') - { - $later = date("Y-m-d", strtotime("$today +1 month")); - } - else if($activity_view == 'This Year') - { - $later = date("Y-m-d", strtotime("$today +1 year")); - } - else if($activity_view == 'OverDue') - { - $later = date("Y-m-d", strtotime("$today +1 day")); - } - $last_tendays = date("Y-m-d",strtotime("$today -10 days")); + if($activity_view == 'today') + { + $upcoming_condition = " AND (date_start = '$today' OR vtiger_recurringevents.recurringdate = '$today')"; + $pending_condition = " AND (due_date = '$today' OR vtiger_recurringevents.recurringdate = '$today')"; + } + else if($activity_view == 'all') + { + $upcoming_condition = " AND (date_start >= '$today' OR vtiger_recurringevents.recurringdate >= '$today')"; + $pending_condition = " AND (due_date <= '$today' OR vtiger_recurringevents.recurringdate <= '$today')"; + } if($mode != 1) { //for upcoming avtivities - $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) AND ((date_start > '$today' AND date_start < '$later') OR (vtiger_recurringevents.recurringdate between '$today' and '$later') ) AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$upcoming_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; } else { - //for pending activities for the last 10 days - $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) AND ((due_date > '$last_tendays' AND due_date <= '$today') OR (vtiger_recurringevents.recurringdate > '$last_tendays' AND vtiger_recurringevents.recurringdate <= '$today')) AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; - } + //for pending activities + $list_query = " select vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.setype, vtiger_activity.*, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.contactid, vtiger_account.accountid, vtiger_account.accountname, vtiger_recurringevents.recurringtype,vtiger_recurringevents.recurringdate from vtiger_activity inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid left join vtiger_seactivityrel on vtiger_seactivityrel.activityid = vtiger_activity.activityid left outer join vtiger_account on vtiger_account.accountid = vtiger_contactdetails.accountid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid inner join vtiger_salesmanactivityrel on vtiger_salesmanactivityrel.activityid=vtiger_activity.activityid WHERE vtiger_crmentity.deleted=0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Deferred') and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') and (vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Not Held' ) ".$pending_condition." AND vtiger_crmentity.smownerid !=0 AND vtiger_salesmanactivityrel.smid ='$current_user->id'"; + } + $res = $adb->query($list_query); $noofrecords = $adb->num_rows($res); - $list_result = $adb->limitQuery($list_query,0,5); $open_activity_list = array(); - $noofrows = $adb->num_rows($list_result); - if (count($list_result)>0) + $noofrows = $adb->num_rows($res); + if (count($res)>0) for($i=0;$i<$noofrows;$i++) { - $parent_name=getRelatedTo("Calendar",$list_result,$i); - $open_activity_list[] = Array('name' => $adb->query_result($list_result,$i,'subject'), - 'id' => $adb->query_result($list_result,$i,'activityid'), - 'type' => $adb->query_result($list_result,$i,'activitytype'), - 'module' => $adb->query_result($list_result,$i,'setype'), - 'status' => $adb->query_result($list_result,$i,'status'), - 'firstname' => $adb->query_result($list_result,$i,'firstname'), - 'lastname' => $adb->query_result($list_result,$i,'lastname'), - 'accountname' => $adb->query_result($list_result,$i,'accountname'), - 'accountid' => $adb->query_result($list_result, $i, 'accountid'), - 'contactid' => $adb->query_result($list_result,$i,'contactid'), - 'date_start' => getDisplayDate($adb->query_result($list_result,$i,'date_start')), - 'due_date' => getDisplayDate($adb->query_result($list_result,$i,'due_date')), - 'recurringtype' => getDisplayDate($adb->query_result($list_result,$i,'recurringtype')), - 'recurringdate' => getDisplayDate($adb->query_result($list_result,$i,'recurringdate')), + $parent_name=getRelatedTo("Calendar",$res,$i); + $open_activity_list[] = Array('name' => $adb->query_result($res,$i,'subject'), + 'id' => $adb->query_result($res,$i,'activityid'), + 'type' => $adb->query_result($res,$i,'activitytype'), + 'module' => $adb->query_result($res,$i,'setype'), + 'status' => $adb->query_result($res,$i,'status'), + 'firstname' => $adb->query_result($res,$i,'firstname'), + 'lastname' => $adb->query_result($res,$i,'lastname'), + 'accountname' => $adb->query_result($res,$i,'accountname'), + 'accountid' => $adb->query_result($res, $i, 'accountid'), + 'contactid' => $adb->query_result($res,$i,'contactid'), + 'date_start' => getDisplayDate($adb->query_result($res,$i,'date_start')), + 'due_date' => getDisplayDate($adb->query_result($res,$i,'due_date')), + 'recurringtype' => getDisplayDate($adb->query_result($res,$i,'recurringtype')), + 'recurringdate' => getDisplayDate($adb->query_result($res,$i,'recurringdate')), 'parent'=> $parent_name, // Fredy Klammsteiner, 4.8.2005: changes from 4.0.1 migrated to 4.2 - 'priority' => $adb->query_result($list_result,$i,'priority'), // Armando L?scher 04.07.2005 -> ?priority -> Desc: Get vtiger_priority from db + 'priority' => $adb->query_result($res,$i,'priority'), // Armando L?scher 04.07.2005 -> ?priority -> Desc: Get vtiger_priority from db ); } - $later_day = getDisplayDate(date("Y-m-d", strtotime("$later -1 day "))); $title=array(); $title[]=$activity_view; $title[]='myUpcoPendAct.gif'; - //.'('.$current_module_strings["LBL_TODAY"].' '.$later_day.')'; $title[]='home_myact'; - $title[]=getActivityView($activity_view); + //$title[]=getActivityView($activity_view); $title[]='showActivityView'; $title[]='MyUpcumingFrm'; $title[]='activity_view'; @@ -229,7 +214,6 @@ } } // Code by Jaguar Ends - $entries['noofactivities'] = $noofrecords; $entries[$event['id']] = array( '0' => ''.$event["name"].'', 'IMAGE' => '', @@ -241,7 +225,7 @@ 'RECURRINGTYPE' => ereg_replace('--','',$event['recurringtype']), ); } - $values=Array('Title'=>$title,'Header'=>$header,'Entries'=>$entries); + $values=Array('noofactivities'=>$noofrecords,'Title'=>$title,'Header'=>$header,'Entries'=>$entries); $log->debug("Exiting getPendingActivities method ..."); return $values; } Modified: vtigercrm/branches/5.1_jens/modules/Calendar/RenderRelatedListUI.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/RenderRelatedListUI.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/RenderRelatedListUI.php Tue Nov 14 03:16:10 2006 @@ -10,8 +10,8 @@ ********************************************************************************/ require_once('include/RelatedListView.php'); -require_once('modules/Contacts/Contact.php'); -require_once('modules/Products/Product.php'); +require_once('modules/Contacts/Contacts.php'); +require_once('modules/Products/Products.php'); require_once('include/utils/UserInfoUtil.php'); // functions added for group calendar -Jaguar Modified: vtigercrm/branches/5.1_jens/modules/Calendar/addEventUI.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/addEventUI.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/addEventUI.php Tue Nov 14 03:16:10 2006 @@ -177,9 +177,9 @@ - + -
"; Modified: vtigercrm/branches/5.1_jens/install/0welcome.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/0welcome.php (original) +++ vtigercrm/branches/5.1_jens/install/0welcome.php Tue Nov 14 03:16:10 2006 @@ -1,164 +1,164 @@ -]*)\">/", $val, $sub_key); - preg_match_all("/]*> - ]*>(.*)<\/td> - ]*>(.*)<\/td>/Ux", $val, $sub); - preg_match_all("/]*> - ]*>(.*)<\/td> - ]*>(.*)<\/td> - ]*>(.*)<\/td>/Ux", $val, $sub_ext); - foreach($sub[0] as $key => $val) { - if (preg_match("/Configuration File \(php.ini\) Path /", $val)) { - $val = preg_replace("/Configuration File \(php.ini\) Path /", '', $val); - $phpini = strip_tags($val); - } - } - -} -?> - - - - - vtiger CRM 5 - Configuration Wizard - Welcome - - - - - -


- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- - - - - - - - - - - - - - - - - - - - - -
Welcome to Configuration Wizard
-
-

       This Configuration Wizard will create vtiger CRM 5.0.0 databases and tables and configuration files you need to start. The entire process should take about four minutes. Click the Start button when you are ready. -

-

- vtiger CRM 5.0.0 is tested on mySQL 4.1.X, mySQL 5.0.19, PHP 5.0.19 and Apache 2.0.40.

-

vtiger CRM 5.0.0 will not work on mysql 4.0.x versions

vtiger crm can run on a system which has xampp/lampp/wampp already installed in it provided it meets the above mentioned requirements
-

The installation wizard will guide you with the installation regardless of the setup you may have. - -

Please take a moment to register your copy of vtiger CRM. Though this is optional, we encourage you to register. Only your name and email address are required for registration. We do not sell, rent, share or otherwise, distribute your information to third parties.
- -
- -
- Please read the license agreement and click the "Start" button to continue. -
-
- - -

-
-
- -
-
- - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - +]*)\">/", $val, $sub_key); + preg_match_all("/]*> + ]*>(.*)<\/td> + ]*>(.*)<\/td>/Ux", $val, $sub); + preg_match_all("/]*> + ]*>(.*)<\/td> + ]*>(.*)<\/td> + ]*>(.*)<\/td>/Ux", $val, $sub_ext); + foreach($sub[0] as $key => $val) { + if (preg_match("/Configuration File \(php.ini\) Path /", $val)) { + $val = preg_replace("/Configuration File \(php.ini\) Path /", '', $val); + $phpini = strip_tags($val); + } + } + +} +?> + + + + + vtiger CRM 5 - Configuration Wizard - Welcome + + + + + +


+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ + + + + + + + + + + + + + + + + + + + + +
Welcome to Configuration Wizard
+
+

       This Configuration Wizard will create vtiger CRM 5.0.2 databases and tables and configuration files you need to start. The entire process should take about four minutes. Click the Start button when you are ready. +

+

- vtiger CRM 5.0.2 is tested on mySQL 4.1.X, mySQL 5.0.19, PHP 5.0.19 and Apache 2.0.40.

+

vtiger CRM 5.0.2 will not work on mysql 4.0.x versions

vtiger crm can run on a system which has xampp/lampp/wampp already installed in it provided it meets the above mentioned requirements
+

The installation wizard will guide you with the installation regardless of the setup you may have. + +

Please take a moment to register your copy of vtiger CRM. Though this is optional, we encourage you to register. Only your name and email address are required for registration. We do not sell, rent, share or otherwise, distribute your information to third parties.
+ +
+ +
+ Please read the license agreement and click the "Start" button to continue. +
+
+ + +

+
+
+ +
+
+ + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + Modified: vtigercrm/branches/5.1_jens/install/1checkSystem.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/1checkSystem.php (original) +++ vtigercrm/branches/5.1_jens/install/1checkSystem.php Tue Nov 14 03:16:10 2006 @@ -1,374 +1,374 @@ - - -]*)\">/", $val, $sub_key); - preg_match_all("/]*> - ]*>(.*)<\/td> - ]*>(.*)<\/td>/Ux", $val, $sub); - preg_match_all("/]*> - ]*>(.*)<\/td> - ]*>(.*)<\/td> - ]*>(.*)<\/td>/Ux", $val, $sub_ext); - foreach($sub[0] as $key => $val) { - if (preg_match("/Configuration File \(php.ini\) Path /", $val)) { - $val = preg_replace("/Configuration File \(php.ini\) Path /", '', $val); - $phpini = strip_tags($val); - } - } - -} - -$gd_info_alternate = 'function gd_info() { -$array = Array( - "GD Version" => "", - "FreeType Support" => 0, - "FreeType Support" => 0, - "FreeType Linkage" => "", - "T1Lib Support" => 0, - "GIF Read Support" => 0, - "GIF Create Support" => 0, - "JPG Support" => 0, - "PNG Support" => 0, - "WBMP Support" => 0, - "XBM Support" => 0 - ); - $gif_support = 0; - - ob_start(); - eval("phpinfo();"); - $info = ob_get_contents(); - ob_end_clean(); - - foreach(explode("\n", $info) as $line) { - if(strpos($line, "GD Version")!==false) - $array["GD Version"] = trim(str_replace("GD Version", "", strip_tags($line))); - if(strpos($line, "FreeType Support")!==false) - $array["FreeType Support"] = trim(str_replace("FreeType Support", "", strip_tags($line))); - if(strpos($line, "FreeType Linkage")!==false) - $array["FreeType Linkage"] = trim(str_replace("FreeType Linkage", "", strip_tags($line))); - if(strpos($line, "T1Lib Support")!==false) - $array["T1Lib Support"] = trim(str_replace("T1Lib Support", "", strip_tags($line))); - if(strpos($line, "GIF Read Support")!==false) - $array["GIF Read Support"] = trim(str_replace("GIF Read Support", "", strip_tags($line))); - if(strpos($line, "GIF Create Support")!==false) - $array["GIF Create Support"] = trim(str_replace("GIF Create Support", "", strip_tags($line))); - if(strpos($line, "GIF Support")!==false) - $gif_support = trim(str_replace("GIF Support", "", strip_tags($line))); - if(strpos($line, "JPG Support")!==false) - $array["JPG Support"] = trim(str_replace("JPG Support", "", strip_tags($line))); - if(strpos($line, "PNG Support")!==false) - $array["PNG Support"] = trim(str_replace("PNG Support", "", strip_tags($line))); - if(strpos($line, "WBMP Support")!==false) - $array["WBMP Support"] = trim(str_replace("WBMP Support", "", strip_tags($line))); - if(strpos($line, "XBM Support")!==false) - $array["XBM Support"] = trim(str_replace("XBM Support", "", strip_tags($line))); - } - - if($gif_support==="enabled") { - $array["GIF Read Support"] = 1; - $array["GIF Create Support"] = 1; - } - - if($array["FreeType Support"]==="enabled"){ - $array["FreeType Support"] = 1; } - - if($array["T1Lib Support"]==="enabled") - $array["T1Lib Support"] = 1; - - if($array["GIF Read Support"]==="enabled"){ - $array["GIF Read Support"] = 1; } - - if($array["GIF Create Support"]==="enabled") - $array["GIF Create Support"] = 1; - - if($array["JPG Support"]==="enabled") - $array["JPG Support"] = 1; - - if($array["PNG Support"]==="enabled") - $array["PNG Support"] = 1; - - if($array["WBMP Support"]==="enabled") - $array["WBMP Support"] = 1; - - if($array["XBM Support"]==="enabled") - $array["XBM Support"] = 1; - - return $array; - -}'; - -?> - - - - - - vtiger CRM 5 - Configuration Wizard - Installation Check - - - - - -


- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- - - - - - - - - -
Pre Installation Check
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Core Components
PHP version 5.0.x
Failed.
Invalid version ($php_version) Installed
" : "Passed
Version $php_version Installed
"; ?>
IMAP Support AvailabilityPassed
IMAP library available
":"Failed
Not Available
";?>
GD graphics library
version 2.0 or later
GD Graphics Library not configured. .
Check out our online documentation for tips on enabling this library. You can ignore this error and continue your vtiger CRM installation, however the chart images simply won't work.
"; - } - else { - if (!function_exists('gd_info')) - { - eval($gd_info_alternate); - } - $gd_info = gd_info(); - - if (isset($gd_info['GD Version'])) { - $gd_version = $gd_info['GD Version']; - $gd_version=preg_replace('%[^0-9.]%', '', $gd_version); - - if ($gd_version > "2.0") { - echo "Passed
Version $gd_version Installed
"; - } - else { - echo "Passed
Version $gd_version Installed.
"; - } - } - else { - echo "GD Library available, but not properly configured in your PHP installation.
You can ignore this error and continue your vtiger CRM installation, however the chart images simply won't work.
"; - } - } - ?> -
Read/Write Access
PHP Configuration
(config.inc.php)
Writeable":"Failed
Not Writeable
"; ?>
Cache Directory
(cache/)
Writeable":"Not Writeable"; ?>
Uploads Directory
(storage/)
Writeable":"Not Writeable
You might experience problems with the file vtiger_attachments feature. Refer File vtiger_attachments issue for more details
"; ?>
Install Directory
(install/)
Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?>
Installation file
(install.php)
Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?>
Tabdata File Permission
(tabdata.php)
Writeable":"Not Writeable
You will not be able to work with the product
";?>
ParentTabdata File Permission
(parent_tabdata.php)
Writeable":"Not Writeable
You will not be able to work with the product
";?>
User Privileges
(user_privileges/)
Writeable":"Not Writeable
You will not be able to login
"; ?>
Smarty Cache Directory
(Smarty/cache)
Writeable":"Not Writeable";?>
Smarty Compile Directory
(Smarty/templates_c)
Writeable":"Not Writeable
You will not be able to login
";?>
Email Templates Directory
(modules/Emails/templates/)
Writeable":"Not Writeable
You might experience problems with the email templates feature. Refer Email templates issue for more details
"; ?>
Mail Merge Template Directory
(test/wordtemplatedownload/)
Writeable":"Not Writeable
You might experience issues with the word template feature. Visit forums for more details
"; ?>
Product Image Directory
(test/product/)
Writeable":"Not Writeable
You might experience problems while attaching image for Products.Refer File vtiger_attachments issue for more details
"; ?>
User Image Directory
(test/user/)
Writeable":"Not Writeable
You might experience problems while attaching image for Users. Refer File vtiger_attachments issue for more details
"; ?>
Contact Image Directory
(test/contact/)
Writeable":"Not Writeable
You might experience problems while attaching image for Contacts. Refer File vtiger_attachments issue for more details
"; ?>
Logo Directory
(test/logo/)
Writeable":"Not Writeable
You might experience problems with the company logo in the pdf generation. Refer File vtiger_attachments issue for more details
"; ?>
-

- - - - - - - - - - - - - - - -
Recommended Settings: We strongly suggest that you check for the following values in your php.ini file
Safe Mode Off
Display Errors On
File Uploads On
Register Globals Off
Max Execution Time 600
output_buffering= On
Change the memory limit = 32M
error_reporting = E_WARNING & ~E_NOTICE
allow_call_time_reference = On
log_errors = Off
short_open_tag= On
Linux installation pre-requisites
-
-
- - -

-
-
- -
-
- - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - + + +]*)\">/", $val, $sub_key); + preg_match_all("/]*> + ]*>(.*)<\/td> + ]*>(.*)<\/td>/Ux", $val, $sub); + preg_match_all("/]*> + ]*>(.*)<\/td> + ]*>(.*)<\/td> + ]*>(.*)<\/td>/Ux", $val, $sub_ext); + foreach($sub[0] as $key => $val) { + if (preg_match("/Configuration File \(php.ini\) Path /", $val)) { + $val = preg_replace("/Configuration File \(php.ini\) Path /", '', $val); + $phpini = strip_tags($val); + } + } + +} + +$gd_info_alternate = 'function gd_info() { +$array = Array( + "GD Version" => "", + "FreeType Support" => 0, + "FreeType Support" => 0, + "FreeType Linkage" => "", + "T1Lib Support" => 0, + "GIF Read Support" => 0, + "GIF Create Support" => 0, + "JPG Support" => 0, + "PNG Support" => 0, + "WBMP Support" => 0, + "XBM Support" => 0 + ); + $gif_support = 0; + + ob_start(); + eval("phpinfo();"); + $info = ob_get_contents(); + ob_end_clean(); + + foreach(explode("\n", $info) as $line) { + if(strpos($line, "GD Version")!==false) + $array["GD Version"] = trim(str_replace("GD Version", "", strip_tags($line))); + if(strpos($line, "FreeType Support")!==false) + $array["FreeType Support"] = trim(str_replace("FreeType Support", "", strip_tags($line))); + if(strpos($line, "FreeType Linkage")!==false) + $array["FreeType Linkage"] = trim(str_replace("FreeType Linkage", "", strip_tags($line))); + if(strpos($line, "T1Lib Support")!==false) + $array["T1Lib Support"] = trim(str_replace("T1Lib Support", "", strip_tags($line))); + if(strpos($line, "GIF Read Support")!==false) + $array["GIF Read Support"] = trim(str_replace("GIF Read Support", "", strip_tags($line))); + if(strpos($line, "GIF Create Support")!==false) + $array["GIF Create Support"] = trim(str_replace("GIF Create Support", "", strip_tags($line))); + if(strpos($line, "GIF Support")!==false) + $gif_support = trim(str_replace("GIF Support", "", strip_tags($line))); + if(strpos($line, "JPG Support")!==false) + $array["JPG Support"] = trim(str_replace("JPG Support", "", strip_tags($line))); + if(strpos($line, "PNG Support")!==false) + $array["PNG Support"] = trim(str_replace("PNG Support", "", strip_tags($line))); + if(strpos($line, "WBMP Support")!==false) + $array["WBMP Support"] = trim(str_replace("WBMP Support", "", strip_tags($line))); + if(strpos($line, "XBM Support")!==false) + $array["XBM Support"] = trim(str_replace("XBM Support", "", strip_tags($line))); + } + + if($gif_support==="enabled") { + $array["GIF Read Support"] = 1; + $array["GIF Create Support"] = 1; + } + + if($array["FreeType Support"]==="enabled"){ + $array["FreeType Support"] = 1; } + + if($array["T1Lib Support"]==="enabled") + $array["T1Lib Support"] = 1; + + if($array["GIF Read Support"]==="enabled"){ + $array["GIF Read Support"] = 1; } + + if($array["GIF Create Support"]==="enabled") + $array["GIF Create Support"] = 1; + + if($array["JPG Support"]==="enabled") + $array["JPG Support"] = 1; + + if($array["PNG Support"]==="enabled") + $array["PNG Support"] = 1; + + if($array["WBMP Support"]==="enabled") + $array["WBMP Support"] = 1; + + if($array["XBM Support"]==="enabled") + $array["XBM Support"] = 1; + + return $array; + +}'; + +?> + + + + + + vtiger CRM 5 - Configuration Wizard - Installation Check + + + + + +


+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ + + + + + + + + +
Pre Installation Check
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Core Components
PHP version
Failed.
Invalid version ($php_version) Installed
" : "Passed
Version $php_version Installed
"; ?>
IMAP Support AvailabilityPassed
IMAP library available
":"Failed
Not Available
";?>
GD graphics library
version 2.0 or later
GD Graphics Library not configured. .
Check out our online documentation for tips on enabling this library. You can ignore this error and continue your vtiger CRM installation, however the chart images simply won't work.
"; + } + else { + if (!function_exists('gd_info')) + { + eval($gd_info_alternate); + } + $gd_info = gd_info(); + + if (isset($gd_info['GD Version'])) { + $gd_version = $gd_info['GD Version']; + $gd_version=preg_replace('%[^0-9.]%', '', $gd_version); + + if ($gd_version > "2.0") { + echo "Passed
Version $gd_version Installed
"; + } + else { + echo "Passed
Version $gd_version Installed.
"; + } + } + else { + echo "GD Library available, but not properly configured in your PHP installation.
You can ignore this error and continue your vtiger CRM installation, however the chart images simply won't work.
"; + } + } + ?> +
Read/Write Access
PHP Configuration
(config.inc.php)
Writeable":"Failed
Not Writeable
"; ?>
Cache Directory
(cache/)
Writeable":"Not Writeable"; ?>
Uploads Directory
(storage/)
Writeable":"Not Writeable
You might experience problems with the file vtiger_attachments feature. Refer File vtiger_attachments issue for more details
"; ?>
Install Directory
(install/)
Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?>
Installation file
(install.php)
Writeable":"Not Writeable
You might experience problems with the last step of installation.
"; ?>
Tabdata File Permission
(tabdata.php)
Writeable":"Not Writeable
You will not be able to work with the product
";?>
ParentTabdata File Permission
(parent_tabdata.php)
Writeable":"Not Writeable
You will not be able to work with the product
";?>
User Privileges
(user_privileges/)
Writeable":"Not Writeable
You will not be able to login
"; ?>
Smarty Cache Directory
(Smarty/cache)
Writeable":"Not Writeable";?>
Smarty Compile Directory
(Smarty/templates_c)
Writeable":"Not Writeable
You will not be able to login
";?>
Email Templates Directory
(modules/Emails/templates/)
Writeable":"Not Writeable
You might experience problems with the email templates feature. Refer Email templates issue for more details
"; ?>
Mail Merge Template Directory
(test/wordtemplatedownload/)
Writeable":"Not Writeable
You might experience issues with the word template feature. Visit forums for more details
"; ?>
Product Image Directory
(test/product/)
Writeable":"Not Writeable
You might experience problems while attaching image for Products.Refer File vtiger_attachments issue for more details
"; ?>
User Image Directory
(test/user/)
Writeable":"Not Writeable
You might experience problems while attaching image for Users. Refer File vtiger_attachments issue for more details
"; ?>
Contact Image Directory
(test/contact/)
Writeable":"Not Writeable
You might experience problems while attaching image for Contacts. Refer File vtiger_attachments issue for more details
"; ?>
Logo Directory
(test/logo/)
Writeable":"Not Writeable
You might experience problems with the company logo in the pdf generation. Refer File vtiger_attachments issue for more details
"; ?>
+

+ + + + + + + + + + + + + + + +
Recommended Settings: We strongly suggest that you check for the following values in your php.ini file
Safe Mode Off
Display Errors On
File Uploads On
Register Globals Off
Max Execution Time 600
output_buffering= On
Change the memory limit = 32M
error_reporting = E_WARNING & ~E_NOTICE
allow_call_time_reference = On
log_errors = Off
short_open_tag= On
Linux installation pre-requisites
+
+
+ + +

+
+
+ +
+
+ + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + Modified: vtigercrm/branches/5.1_jens/install/2setConfig.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/2setConfig.php (original) +++ vtigercrm/branches/5.1_jens/install/2setConfig.php Tue Nov 14 03:16:10 2006 @@ -1,523 +1,523 @@ -$value) { - $language_keys[] = $key; - $language_values[] = $value; - } - $_SESSION['language_keys'] = urlencode(implode(",",$language_keys)); - $_SESSION['language_values'] = urlencode(implode(",",$language_values)); - } - - global $dbconfig; - - if (isset($_REQUEST['db_hostname'])) - $db_hostname = $_REQUEST['db_hostname']; - elseif (isset($dbconfig['db_hostname'])) - $db_hostname = $dbconfig['db_hostname']; - else - $db_hostname = $hostname; - - if (isset($_REQUEST['db_username'])) - $db_username = $_REQUEST['db_username']; - elseif (isset($dbconfig['db_username'])) - $db_username = $dbconfig['db_username']; - - if (isset($_REQUEST['db_password'])) - $db_password = $_REQUEST['db_password']; - elseif (isset($dbconfig['db_password'])) - $db_password = $dbconfig['db_password']; - - if (isset($_REQUEST['db_type'])) - $db_type = $_REQUEST['db_type']; - elseif (isset($dbconfig['db_type'])) - $db_type = $dbconfig['db_type']; - - if (isset($_REQUEST['db_name'])) - $db_name = $_REQUEST['db_name']; - elseif (isset($dbconfig['db_name']) && $dbconfig['db_name']!='_DBC_NAME_') - $db_name = $dbconfig['db_name']; - else - $db_name = 'vtigercrm5'; - - !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; - if (isset($_REQUEST['host_name'])) $host_name = $_REQUEST['host_name']; - else $host_name = $hostname; - - if (isset($_REQUEST['site_URL'])) $site_URL = $_REQUEST['site_URL']; - elseif (isset($site_URL) && $site_URL!='_SITE_URL_') - $site_URL = $site_URL; - else $site_URL = $web_root; - - if(isset($_REQUEST['root_directory'])) $root_directory = $_REQUEST['root_directory']; - else $root_directory = $current_dir; - - if (isset($_REQUEST['cache_dir'])) - $cache_dir= $_REQUEST['cache_dir']; - - if (isset($_REQUEST['mail_server'])) - $mail_server= $_REQUEST['mail_server']; - - if (isset($_REQUEST['mail_server_username'])) - $mail_server_username= $_REQUEST['mail_server_username']; - - if (isset($_REQUEST['mail_server_password'])) - $mail_server_password= $_REQUEST['mail_server_password']; - - if (isset($_REQUEST['admin_email'])) - $admin_email = $_REQUEST['admin_email']; - - if (isset($_REQUEST['admin_password'])) - $admin_password = $_REQUEST['admin_password']; - - if (isset($_REQUEST['currency_name'])) - $currency_name = $_REQUEST['currency_name']; - else - $currency_name = ''; - - if (isset($_REQUEST['currency_symbol'])) - $currency_symbol = $_REQUEST['currency_symbol']; - - if (isset($_REQUEST['currency_code'])) - $currency_code = $_REQUEST['currency_code']; - - } - else { - !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; - !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm5" : $db_name = $_REQUEST['db_name']; - !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; - !isset($_REQUEST['host_name']) ? $host_name= $hostname : $host_name= $_REQUEST['host_name']; - !isset($_REQUEST['site_URL']) ? $site_URL = $web_root : $site_URL = $_REQUEST['site_URL']; - !isset($_REQUEST['root_directory']) ? $root_directory = $current_dir : $root_directory = stripslashes($_REQUEST['root_directory']); - !isset($_REQUEST['cache_dir']) ? $cache_dir = $cache_dir : $cache_dir = stripslashes($_REQUEST['cache_dir']); - !isset($_REQUEST['mail_server']) ? $mail_server = $mail_server : $mail_server = stripslashes($_REQUEST['mail_server']); - !isset($_REQUEST['mail_server_username']) ? $mail_server_username = $mail_server_username : $mail_server_username = stripslashes($_REQUEST['mail_server_username']); - !isset($_REQUEST['mail_server_password']) ? $mail_server_password = $mail_server_password : $mail_server_password = stripslashes($_REQUEST['mail_server_password']); - !isset($_REQUEST['admin_email']) ? $admin_email = "" : $admin_email = $_REQUEST['admin_email']; - } - !isset($_REQUEST['check_createdb']) ? $check_createdb = "" : $check_createdb = $_REQUEST['check_createdb']; - !isset($_REQUEST['root_user']) ? $root_user = "" : $root_user = $_REQUEST['root_user']; - !isset($_REQUEST['root_password']) ? $root_password = "" : $root_password = $_REQUEST['root_password']; - // determine database options - $db_options = array(); - if(function_exists('mysql_connect')) { - $db_options['mysql'] = 'MySQL'; - } - if(function_exists('pg_connect')) { - $db_options['pgsql'] = 'Postgres'; - } -?> - - - - - - vtiger CRM 5 - Configuration Wizard - System Configuration - - - - - - - - -


- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- -
- - - - - - - - -
System Configuration
-
- - - - - - -
- Please enter your database configuration information below...
- - If you do not have root access to your database (for example you are installing in a virtual - hosting environment), you will need to have your database created for you before you proceed. - However, this installer will still be able to create the necessary database tables.

- - If you are unsure of your database host, username or password, we suggest that you use the default - values below.

- - *- required information - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Database Configuration
Database Type * - - No Database Support Deteched - - - - - - -
Host Name *" />
User Name *" />
Password" />
Database Name *" />  - - - - - -  Create Database(will drop the database if exists)
Root Username *
Root Password
- -

- - - - - - - - - - - - - - - - - - -
Site Configuration
URL * -
Path *" size="40" />
Path to Cache Directory *
(must be writable)
-

- - - - - - - - - - - - - - - - - - - - - -
Admin Configuration
User nameadmin
Password*">
Email*">
Note: The default password is 'admin'. You can change the password if necessary now or else you can change it later after logging-in.
- -

- - - - - - - - - - - - - - - - - -
Currency Configuration
Name*">
Symbol*">
Code*">
- - -
- - -
-
-
-
- -
-
- - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - - +$value) { + $language_keys[] = $key; + $language_values[] = $value; + } + $_SESSION['language_keys'] = urlencode(implode(",",$language_keys)); + $_SESSION['language_values'] = urlencode(implode(",",$language_values)); + } + + global $dbconfig; + + if (isset($_REQUEST['db_hostname'])) + $db_hostname = $_REQUEST['db_hostname']; + elseif (isset($dbconfig['db_hostname'])) + $db_hostname = $dbconfig['db_hostname']; + else + $db_hostname = $hostname; + + if (isset($_REQUEST['db_username'])) + $db_username = $_REQUEST['db_username']; + elseif (isset($dbconfig['db_username'])) + $db_username = $dbconfig['db_username']; + + if (isset($_REQUEST['db_password'])) + $db_password = $_REQUEST['db_password']; + elseif (isset($dbconfig['db_password'])) + $db_password = $dbconfig['db_password']; + + if (isset($_REQUEST['db_type'])) + $db_type = $_REQUEST['db_type']; + elseif (isset($dbconfig['db_type'])) + $db_type = $dbconfig['db_type']; + + if (isset($_REQUEST['db_name'])) + $db_name = $_REQUEST['db_name']; + elseif (isset($dbconfig['db_name']) && $dbconfig['db_name']!='_DBC_NAME_') + $db_name = $dbconfig['db_name']; + else + $db_name = 'vtigercrm502'; + + !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; + if (isset($_REQUEST['host_name'])) $host_name = $_REQUEST['host_name']; + else $host_name = $hostname; + + if (isset($_REQUEST['site_URL'])) $site_URL = $_REQUEST['site_URL']; + elseif (isset($site_URL) && $site_URL!='_SITE_URL_') + $site_URL = $site_URL; + else $site_URL = $web_root; + + if(isset($_REQUEST['root_directory'])) $root_directory = $_REQUEST['root_directory']; + else $root_directory = $current_dir; + + if (isset($_REQUEST['cache_dir'])) + $cache_dir= $_REQUEST['cache_dir']; + + if (isset($_REQUEST['mail_server'])) + $mail_server= $_REQUEST['mail_server']; + + if (isset($_REQUEST['mail_server_username'])) + $mail_server_username= $_REQUEST['mail_server_username']; + + if (isset($_REQUEST['mail_server_password'])) + $mail_server_password= $_REQUEST['mail_server_password']; + + if (isset($_REQUEST['admin_email'])) + $admin_email = $_REQUEST['admin_email']; + + if (isset($_REQUEST['admin_password'])) + $admin_password = $_REQUEST['admin_password']; + + if (isset($_REQUEST['currency_name'])) + $currency_name = $_REQUEST['currency_name']; + else + $currency_name = ''; + + if (isset($_REQUEST['currency_symbol'])) + $currency_symbol = $_REQUEST['currency_symbol']; + + if (isset($_REQUEST['currency_code'])) + $currency_code = $_REQUEST['currency_code']; + + } + else { + !isset($_REQUEST['db_hostname']) ? $db_hostname = $hostname: $db_hostname = $_REQUEST['db_hostname']; + !isset($_REQUEST['db_name']) ? $db_name = "vtigercrm502" : $db_name = $_REQUEST['db_name']; + !isset($_REQUEST['db_drop_tables']) ? $db_drop_tables = "0" : $db_drop_tables = $_REQUEST['db_drop_tables']; + !isset($_REQUEST['host_name']) ? $host_name= $hostname : $host_name= $_REQUEST['host_name']; + !isset($_REQUEST['site_URL']) ? $site_URL = $web_root : $site_URL = $_REQUEST['site_URL']; + !isset($_REQUEST['root_directory']) ? $root_directory = $current_dir : $root_directory = stripslashes($_REQUEST['root_directory']); + !isset($_REQUEST['cache_dir']) ? $cache_dir = $cache_dir : $cache_dir = stripslashes($_REQUEST['cache_dir']); + !isset($_REQUEST['mail_server']) ? $mail_server = $mail_server : $mail_server = stripslashes($_REQUEST['mail_server']); + !isset($_REQUEST['mail_server_username']) ? $mail_server_username = $mail_server_username : $mail_server_username = stripslashes($_REQUEST['mail_server_username']); + !isset($_REQUEST['mail_server_password']) ? $mail_server_password = $mail_server_password : $mail_server_password = stripslashes($_REQUEST['mail_server_password']); + !isset($_REQUEST['admin_email']) ? $admin_email = "" : $admin_email = $_REQUEST['admin_email']; + } + !isset($_REQUEST['check_createdb']) ? $check_createdb = "" : $check_createdb = $_REQUEST['check_createdb']; + !isset($_REQUEST['root_user']) ? $root_user = "" : $root_user = $_REQUEST['root_user']; + !isset($_REQUEST['root_password']) ? $root_password = "" : $root_password = $_REQUEST['root_password']; + // determine database options + $db_options = array(); + if(function_exists('mysql_connect')) { + $db_options['mysql'] = 'MySQL'; + } + if(function_exists('pg_connect')) { + $db_options['pgsql'] = 'Postgres'; + } +?> + + + + + + vtiger CRM 5 - Configuration Wizard - System Configuration + + + + + + + + +


+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ +
+ + + + + + + + +
System Configuration
+
+ + + + + + +
+ Please enter your database configuration information below...
+ + If you do not have root access to your database (for example you are installing in a virtual + hosting environment), you will need to have your database created for you before you proceed. + However, this installer will still be able to create the necessary database tables.

+ + If you are unsure of your database host, username or password, we suggest that you use the default + values below.

+ + *- required information + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Database Configuration
Database Type * + + No Database Support Detected + + + + + + +
Host Name *" />
User Name *" />
Password" />
Database Name *" />  + + + + + +  Create Database(will drop the database if exists)
Root Username *
Root Password
+ +

+ + + + + + + + + + + + + + + + + + +
Site Configuration
URL * +
Path *" size="40" />
Path to Cache Directory *
(must be writable)
+

+ + + + + + + + + + + + + + + + + + + + + +
Admin Configuration
User nameadmin
Password*">
Email*">
Note: The default password is 'admin'. You can change the password if necessary now or else you can change it later after logging-in.
+ +

+ + + + + + + + + + + + + + + + + +
Currency Configuration
Name*">
Symbol*">
Code*">
+ + +
+ + +
+
+
+
+ +
+
+ + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + + Modified: vtigercrm/branches/5.1_jens/install/4createConfigFile.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/4createConfigFile.php (original) +++ vtigercrm/branches/5.1_jens/install/4createConfigFile.php Tue Nov 14 03:16:10 2006 @@ -1,505 +1,505 @@ - - - - - - - vtiger CRM 5 - Configuration Wizard - Config File Creation - - - - - -

- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- - - - - - - - - - -
Config File Creation
-
- -
-

Successfully created configuration file (config.inc.php) in :

-

- The installation will take at least 4 minutes. Grab a coffee,sit back and relax...
-

-
-
- -

Cannot write configuration file (config.inc.php ) in :

-

-

You can continue this installation by manually creating the config.inc.php file and pasting the configuration information below inside.However, you must create the configuration file before you continue to the next step.



- 'en', 'ja'=>'jp', 'sp_ve'=>'sp', 'it_it'=>'it', 'tw_zh'=>'zh', 'pt_br'=>'pt', 'se'=>'sv', 'cn_zh'=>'zh', 'ge_ge'=>'de', 'ge_ch'=>'de', 'fr'=>'fr');\n\n"; - - $config .= "//set default module and action\n"; - $config .= "\$default_module = 'Home';\n"; - $config .= "\$default_action = 'index';\n\n"; - - $config .= "//set default theme\n"; - $config .= "\$default_theme = 'bluelagoon';\n\n"; - - $config .= "// If true, the time to compose each page is placed in the browser.\n"; - $config .= "\$calculate_response_time = true;\n"; - - $config .= "// Default Username - The default text that is placed initially in the login form for user name.\n"; - $config .= "\$default_user_name = '';\n"; - - $config .= "// Default Password - The default text that is placed initially in the login form for password.\n"; - $config .= "\$default_password = '';\n"; - - $config .= "// Create default user - If true, a user with the default username and password is created.\n"; - $config .= "\$create_default_user = false;\n"; - $config .= "\$default_user_is_admin = false;\n"; - - $config .= "// disable persistent connections - If your MySQL/PHP configuration does not support persistent connections set this to true to avoid a large performance slowdown\n"; - $config .= "\$disable_persistent_connections = false;\n"; - $config .= "// Defined languages available. The key must be the language file prefix. E.g. 'en_us' is the prefix for every 'en_us.lang.php' file. \n"; - - $language_value = "Array('en_us'=>'US English',)"; - if(isset($_SESSION['language_keys']) && isset($_SESSION['language_values'])) - { - $language_value = 'Array('; - $language_keys = explode(',', urldecode($_SESSION['language_keys'])); - $language_values = explode(',', urldecode($_SESSION['language_values'])); - $size = count($language_keys); - for($i = 0; $i < $size; $i+=1) - { - $language_value .= "'$language_keys[$i]'=>'$language_values[$i]',"; - } - $language_value .= ')'; - } - $config .= "\$languages = $language_value;\n"; - $config .= "// Master currency name\n"; - $config .= "\$currency_name = '$currency_name';\n"; - $config .= "// Default charset if the language specific character set is not found.\n"; - $config .= "\$default_charset = 'ISO-8859-1';\n"; - $config .= "// Default language in case all or part of the user's language pack is not available.\n"; - $config .= "\$default_language = 'en_us';\n"; - $config .= "// Translation String Prefix - This will add the language pack name to every translation string in the display.\n"; - $config .= "\$translation_string_prefix = false;\n"; - - $config .= "//Option to cache tabs permissions for speed.\n"; - $config .= "\$cache_tab_perms = true;\n\n"; - - $config .= "//Option to hide empty home blocks if no entries.\n"; - $config .= "\$display_empty_home_blocks = false;\n\n"; - - $config .= "// Generating Unique Application Key\n"; - $config .= "\$application_unique_key = '".md5($root_directory)."';\n\n"; - $config .= "?>"; - - echo "

"; - echo "

Did you remember to create the config.inc.php file ?

"; - - - } ?> -
-
- - - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - " /> - -
- -
-
- -
-
- - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - - + + + + + + + vtiger CRM 5 - Configuration Wizard - Config File Creation + + + + + +

+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ + + + + + + + + + +
Config File Creation
+
+ +
+

Successfully created configuration file (config.inc.php) in :

+

+ The installation will take at least 4 minutes. Grab a coffee,sit back and relax...
+

+
+
+ +

Cannot write configuration file (config.inc.php ) in :

+

+

You can continue this installation by manually creating the config.inc.php file and pasting the configuration information below inside.However, you must create the configuration file before you continue to the next step.



+ 'en', 'ja'=>'jp', 'sp_ve'=>'sp', 'it_it'=>'it', 'tw_zh'=>'zh', 'pt_br'=>'pt', 'se'=>'sv', 'cn_zh'=>'zh', 'ge_ge'=>'de', 'ge_ch'=>'de', 'fr'=>'fr');\n\n"; + + $config .= "//set default module and action\n"; + $config .= "\$default_module = 'Home';\n"; + $config .= "\$default_action = 'index';\n\n"; + + $config .= "//set default theme\n"; + $config .= "\$default_theme = 'bluelagoon';\n\n"; + + $config .= "// If true, the time to compose each page is placed in the browser.\n"; + $config .= "\$calculate_response_time = true;\n"; + + $config .= "// Default Username - The default text that is placed initially in the login form for user name.\n"; + $config .= "\$default_user_name = '';\n"; + + $config .= "// Default Password - The default text that is placed initially in the login form for password.\n"; + $config .= "\$default_password = '';\n"; + + $config .= "// Create default user - If true, a user with the default username and password is created.\n"; + $config .= "\$create_default_user = false;\n"; + $config .= "\$default_user_is_admin = false;\n"; + + $config .= "// disable persistent connections - If your MySQL/PHP configuration does not support persistent connections set this to true to avoid a large performance slowdown\n"; + $config .= "\$disable_persistent_connections = false;\n"; + $config .= "// Defined languages available. The key must be the language file prefix. E.g. 'en_us' is the prefix for every 'en_us.lang.php' file. \n"; + + $language_value = "Array('en_us'=>'US English',)"; + if(isset($_SESSION['language_keys']) && isset($_SESSION['language_values'])) + { + $language_value = 'Array('; + $language_keys = explode(',', urldecode($_SESSION['language_keys'])); + $language_values = explode(',', urldecode($_SESSION['language_values'])); + $size = count($language_keys); + for($i = 0; $i < $size; $i+=1) + { + $language_value .= "'$language_keys[$i]'=>'$language_values[$i]',"; + } + $language_value .= ')'; + } + $config .= "\$languages = $language_value;\n"; + $config .= "// Master currency name\n"; + $config .= "\$currency_name = '$currency_name';\n"; + $config .= "// Default charset if the language specific character set is not found.\n"; + $config .= "\$default_charset = 'ISO-8859-1';\n"; + $config .= "// Default language in case all or part of the user's language pack is not available.\n"; + $config .= "\$default_language = 'en_us';\n"; + $config .= "// Translation String Prefix - This will add the language pack name to every translation string in the display.\n"; + $config .= "\$translation_string_prefix = false;\n"; + + $config .= "//Option to cache tabs permissions for speed.\n"; + $config .= "\$cache_tab_perms = true;\n\n"; + + $config .= "//Option to hide empty home blocks if no entries.\n"; + $config .= "\$display_empty_home_blocks = false;\n\n"; + + $config .= "// Generating Unique Application Key\n"; + $config .= "\$application_unique_key = '".md5($root_directory)."';\n\n"; + $config .= "?>"; + + echo "

"; + echo "

Did you remember to create the config.inc.php file ?

"; + + + } ?> +
+
+ + + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + " /> + +
+ +
+
+ +
+
+ + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + + Modified: vtigercrm/branches/5.1_jens/install/5createTables.inc.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/5createTables.inc.php (original) +++ vtigercrm/branches/5.1_jens/install/5createTables.inc.php Tue Nov 14 03:16:10 2006 @@ -1,304 +1,283 @@ -column_fields["last_name"] = 'Administrator'; - $user->column_fields["user_name"] = 'admin'; - $user->column_fields["status"] = 'Active'; - $user->column_fields["is_admin"] = 'on'; - $user->column_fields["user_password"] = $admin_password; - $user->column_fields["tz"] = 'Europe/Berlin'; - $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,'; - $user->column_fields["workdays"] = '0,1,2,3,4,5,6,'; - $user->column_fields["weekstart"] = '1'; - $user->column_fields["namedays"] = ''; - $user->column_fields["currency_id"] = 1; - $user->column_fields["date_format"] = 'yyyy-mm-dd'; - $user->column_fields["hour_format"] = 'am/pm'; - $user->column_fields["start_hour"] = '08:00'; - $user->column_fields["end_hour"] = '23:00'; - $user->column_fields["imagename"] = ''; - $user->column_fields["activity_view"] = 'This Year'; - $user->column_fields["lead_view"] = 'Today'; - $user->column_fields["defhomeview"] = 'home_metrics'; - //added by philip for default default admin emailid - if($admin_email == '') - $admin_email ="admin at vtigeruser.com"; - $user->column_fields["email1"] = $admin_email; - //to get the role id for standard_user - $role_query = "select roleid from vtiger_role where rolename='CEO'"; - $db->checkConnection(); - $db->database->SetFetchMode(ADODB_FETCH_ASSOC); - $role_result = $db->query($role_query); - $role_id = $db->query_result($role_result,0,"roleid"); - $user->column_fields["roleid"] = $role_id; - - $user->save("Users"); - - //Inserting Entries into vtiger_groups table - $result = $db->query("select groupid from vtiger_groups where groupname='Team Selling';"); - $group1_id = $db->query_result($result,0,"groupid"); - $result = $db->query("select groupid from vtiger_groups where groupname='Marketing Group';"); - $group2_id = $db->query_result($result,0,"groupid"); - $result = $db->query("select groupid from vtiger_groups where groupname='Support Group';"); - $group3_id = $db->query_result($result,0,"groupid"); - - $db->query("insert into vtiger_users2group values ('".$group2_id."',".$user->id.")"); - - // we need to change the admin user to a fixed id of 1. - //$query = "update vtiger_users set id='1' where user_name='$user->user_name'"; - //$result = $db->query($query, true, "Error updating admin user ID: "); - - $log->info("Created ".$user->table_name." vtiger_table. for user $user->id"); - - //Creating the flat files - createUserPrivilegesfile($user->id); - createUserSharingPrivilegesfile($user->id); - - - //Creating the Standard User - $user = new User(); - $user->column_fields["last_name"] = 'StandardUser'; - $user->column_fields["user_name"] = 'standarduser'; - $user->column_fields["is_admin"] = 'off'; - $user->column_fields["status"] = 'Active'; - $user->column_fields["user_password"] = 'standarduser'; - $user->column_fields["tz"] = 'Europe/Berlin'; - $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,'; - $user->column_fields["workdays"] = '0,1,2,3,4,5,6,'; - $user->column_fields["weekstart"] = '1'; - $user->column_fields["namedays"] = ''; - $user->column_fields["currency_id"] = 1; - $user->column_fields["date_format"] = 'yyyy-mm-dd'; - $user->column_fields["imagename"] = ''; - $user->column_fields["activity_view"] = 'This Year'; - $user->column_fields["lead_view"] = 'Today'; - $user->column_fields["defhomeview"] = 'home_metrics'; - //added by philip for default default admin emailid - if($admin_email == '') - $std_email ="standarduser at vtigeruser.com"; - $user->column_fields["email1"] = $std_email; - //to get the role id for standard_user - $role_query = "select roleid from vtiger_role where rolename='Vice President'"; - $db->database->SetFetchMode(ADODB_FETCH_ASSOC); - $role_result = $db->query($role_query); - $role_id = $db->query_result($role_result,0,"roleid"); - $user->column_fields["roleid"] = $role_id; - - $user->save('Users'); - - //Creating the flat vtiger_files - createUserPrivilegesfile($user->id); - createUserSharingPrivilegesfile($user->id); - - $db->query("insert into vtiger_users2group values ('".$group1_id."',".$user->id.")"); - $db->query("insert into vtiger_users2group values ('".$group2_id."',".$user->id.")"); - $db->query("insert into vtiger_users2group values ('".$group3_id."',".$user->id.")"); - -} - -//$startTime = microtime(); -$modules = array("DefaultDataPopulator"); -$focus=0; -// tables creation -//eecho("Creating Core tables: "); -//$adb->setDebug(true); -$success = $adb->createTables("schema/DatabaseSchema.xml"); - -//Postgres8 fix - create sequences. -// This should be a part of "createTables" however ... - if( $adb->dbType == "pgsql" ) { - $sequences = array( - "vtiger_leadsource_seq", - "vtiger_accounttype_seq", - "vtiger_industry_seq", - "vtiger_leadstatus_seq", - "vtiger_rating_seq", - "vtiger_licencekeystatus_seq", - "vtiger_opportunity_type_seq", - "vtiger_salutationtype_seq", - "vtiger_sales_stage_seq", - "vtiger_ticketstatus_seq", - "vtiger_ticketpriorities_seq", - "vtiger_ticketseverities_seq", - "vtiger_ticketcategories_seq", - "vtiger_duration_minutes_seq", - "vtiger_eventstatus_seq", - "vtiger_taskstatus_seq", - "vtiger_taskpriority_seq", - "vtiger_manufacturer_seq", - "vtiger_productcategory_seq", - "vtiger_activitytype_seq", - "vtiger_currency_seq", - "vtiger_faqcategories_seq", - "vtiger_usageunit_seq", - "vtiger_glacct_seq", - "vtiger_quotestage_seq", - "vtiger_carrier_seq", - "vtiger_taxclass_seq", - "vtiger_recurringtype_seq", - "vtiger_faqstatus_seq", - "vtiger_invoicestatus_seq", - "vtiger_postatus_seq", - "vtiger_sostatus_seq", - "vtiger_visibility_seq", - "vtiger_campaigntype_seq", - "vtiger_campaignstatus_seq", - "vtiger_expectedresponse_seq", - "vtiger_status_seq", - "vtiger_activity_view_seq", - "vtiger_lead_view_seq", - "vtiger_date_format_seq", - "vtiger_users_seq", - "vtiger_role_seq", - "vtiger_profile_seq", - "vtiger_field_seq", - "vtiger_def_org_share_seq", - "vtiger_datashare_relatedmodules_seq", - "vtiger_relatedlists_seq", - "vtiger_notificationscheduler_seq", - "vtiger_inventorynotification_seq", - "vtiger_currency_info_seq", - "vtiger_emailtemplates_seq", - "vtiger_inventory_tandc_seq", - "vtiger_selectquery_seq", - "vtiger_customview_seq", - "vtiger_crmentity_seq", - "vtiger_seactivityrel_seq", - "vtiger_freetags_seq", - "vtiger_shippingtaxinfo_seq", - "vtiger_inventorytaxinfo_seq" - ); - - foreach ($sequences as $sequence ) { - $log->info( "Creating sequence ".$sequence); - $adb->query( "CREATE SEQUENCE ".$sequence." INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1;"); - } - } - - -// TODO HTML -if($success==0) - die("Error: Tables not created. Table creation failed.\n"); -elseif ($success==1) - die("Error: Tables partially created. Table creation failed.\n"); - //eecho("Tables Successfully created.\n"); - -foreach ($modules as $module ) -{ - $focus = new $module(); - $focus->create_tables(); -} - - -// create and populate combo tables -require_once('include/PopulateComboValues.php'); -$combo = new PopulateComboValues(); -$combo->create_tables(); - -//Writing tab data in flat file -create_tab_data_file(); -create_parenttab_data_file(); - -create_default_users(); - -// default report population -require_once('modules/Reports/PopulateReports.php'); - -// default customview population -require_once('modules/CustomView/PopulateCustomView.php'); - - -// ensure required sequences are created (adodb creates them as needed, but if -// creation occurs within a transaction we get problems -$db->getUniqueID("vtiger_crmentity"); -$db->getUniqueID("vtiger_seactivityrel"); -$db->getUniqueID("vtiger_freetags"); - -//Master currency population -//Insert into vtiger_currency vtiger_table - $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$currency_name','$currency_code','$currency_symbol',1,'Active','-11')"); - -// populate the db with seed data -if ($db_populate) { - //eecho ("Populate seed data into $db_name"); - include("install/populateSeedData.php"); - //eecho ("...done

\n"); -} - -// populate forums data -global $log, $db; - -//$endTime = microtime(); -//$deltaTime = microtime_diff($startTime, $endTime); - - -// populate calendar data - -//eecho ("total time: $deltaTime seconds.\n"); -?> +column_fields["last_name"] = 'Administrator'; + $user->column_fields["user_name"] = 'admin'; + $user->column_fields["status"] = 'Active'; + $user->column_fields["is_admin"] = 'on'; + $user->column_fields["user_password"] = $admin_password; + $user->column_fields["tz"] = 'Europe/Berlin'; + $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,'; + $user->column_fields["workdays"] = '0,1,2,3,4,5,6,'; + $user->column_fields["weekstart"] = '1'; + $user->column_fields["namedays"] = ''; + $user->column_fields["currency_id"] = 1; + $user->column_fields["date_format"] = 'yyyy-mm-dd'; + $user->column_fields["hour_format"] = 'am/pm'; + $user->column_fields["start_hour"] = '08:00'; + $user->column_fields["end_hour"] = '23:00'; + $user->column_fields["imagename"] = ''; + $user->column_fields["activity_view"] = 'This Year'; + $user->column_fields["lead_view"] = 'Today'; + $user->column_fields["defhomeview"] = 'home_metrics'; + //added by philip for default default admin emailid + if($admin_email == '') + $admin_email ="admin at vtigeruser.com"; + $user->column_fields["email1"] = $admin_email; + //to get the role id for standard_user + $role_query = "select roleid from vtiger_role where rolename='CEO'"; + $db->checkConnection(); + $db->database->SetFetchMode(ADODB_FETCH_ASSOC); + $role_result = $db->query($role_query); + $role_id = $db->query_result($role_result,0,"roleid"); + $user->column_fields["roleid"] = $role_id; + $user->column_fields["assigned_org"] = array( "0" => "vtiger"); + $user->column_fields["primray_org"] = "vtiger"; + + $user->save("Users"); + + // we need to change the admin user to a fixed id of 1. + //$query = "update vtiger_users set id='1' where user_name='$user->user_name'"; + //$result = $db->query($query, true, "Error updating admin user ID: "); + + $log->info("Created ".$user->table_name." vtiger_table. for user $user->id"); + + //Creating the flat files + createUserPrivilegesfile($user->id); + createUserSharingPrivilegesfile($user->id); + + + //Creating the Standard User + $user = new Users(); + $user->column_fields["last_name"] = 'StandardUser'; + $user->column_fields["user_name"] = 'standarduser'; + $user->column_fields["is_admin"] = 'off'; + $user->column_fields["status"] = 'Active'; + $user->column_fields["user_password"] = 'standarduser'; + $user->column_fields["tz"] = 'Europe/Berlin'; + $user->column_fields["holidays"] = 'de,en_uk,fr,it,us,'; + $user->column_fields["workdays"] = '0,1,2,3,4,5,6,'; + $user->column_fields["weekstart"] = '1'; + $user->column_fields["namedays"] = ''; + $user->column_fields["currency_id"] = 1; + $user->column_fields["date_format"] = 'yyyy-mm-dd'; + $user->column_fields["imagename"] = ''; + $user->column_fields["activity_view"] = 'This Year'; + $user->column_fields["lead_view"] = 'Today'; + $user->column_fields["defhomeview"] = 'home_metrics'; + //added by philip for default default admin emailid + if($admin_email == '') + $std_email ="standarduser at vtigeruser.com"; + $user->column_fields["email1"] = $std_email; + //to get the role id for standard_user + $role_query = "select roleid from vtiger_role where rolename='Vice President'"; + $db->database->SetFetchMode(ADODB_FETCH_ASSOC); + $role_result = $db->query($role_query); + $role_id = $db->query_result($role_result,0,"roleid"); + $user->column_fields["roleid"] = $role_id; + $user->column_fields["assigned_org"] = array( "0" => "vtiger"); + $user->column_fields["primray_org"] = "vtiger"; + + $user->save('Users'); + + //Creating the flat vtiger_files + createUserPrivilegesfile($user->id); + createUserSharingPrivilegesfile($user->id); + + //Inserting into vtiger_groups table + $db->startTransaction(); + $result = $db->query("select groupid from vtiger_groups where groupname='Team Selling';"); + $group1_id = $db->query_result($result,0,"groupid"); + $result = $db->query("select groupid from vtiger_groups where groupname='Marketing Group';"); + $group2_id = $db->query_result($result,0,"groupid"); + $result = $db->query("select groupid from vtiger_groups where groupname='Support Group';"); + $group3_id = $db->query_result($result,0,"groupid"); + + $db->query("insert into vtiger_users2group values ('".$group1_id."',2)"); + $db->query("insert into vtiger_users2group values ('".$group2_id."',1)"); + $db->query("insert into vtiger_users2group values ('".$group2_id."',2)"); + $db->query("insert into vtiger_users2group values ('".$group3_id."',2)"); + $db->completeTransaction(); +} + +//$startTime = microtime(); +$modules = array("DefaultDataPopulator"); +$focus=0; +// tables creation +//eecho("Creating Core tables: "); +//$adb->setDebug(true); +$success = $adb->createTables("schema/DatabaseSchema.xml"); + +//Postgres8 fix - create sequences. + if( $adb->dbType == "pgsql" ) { + // Create required functions + $adb->query( 'CREATE LANGUAGE plperl'); + $adb->query( 'CREATE OR REPLACE FUNCTION concat(varchar,varchar) RETURNS varchar AS $$ + my $s = ""; + foreach my $t (@_) { $s .= $t; } + return $s; + $$ LANGUAGE plperl'); + $adb->query( 'CREATE OR REPLACE FUNCTION concat(varchar,varchar,varchar) RETURNS varchar AS $$ + my $s = ""; + foreach my $t (@_) { $s .= $t; } + return $s; + $$ LANGUAGE plperl'); + $adb->query( 'CREATE OR REPLACE FUNCTION concat(varchar,varchar,varchar,varchar) RETURNS varchar AS $$ + my $s = ""; + foreach my $t (@_) { $s .= $t; } + return $s; + $$ LANGUAGE plperl'); + + // Create sequences currently not implemented in the database schema + $sequences = array( + "vtiger_role_roleid_seq", + "vtiger_audit_trial_auditid_seq", + "vtiger_datashare_relatedmodules_datashare_relatedmodule_id_seq", + "vtiger_relatedlists_relation_id_seq", + "vtiger_inventory_tandc_id_seq", + "vtiger_customview_cvid_seq", + "vtiger_crmentity_crmid_seq", + "vtiger_seactivityrel_crmid_seq", + "vtiger_selectquery_queryid_seq", + "vtiger_systems_id_seq", + "vtiger_freetags_id_seq", + "vtiger_inventorytaxinfo_taxid_seq", + "vtiger_shippingtaxinfo_taxid_seq", + "vtiger_groups_groupid_seq" + ); + + foreach ($sequences as $sequence ) { + $log->info( "Creating sequence ".$sequence); + $adb->query( "CREATE SEQUENCE ".$sequence." INCREMENT BY 1 NO MAXVALUE NO MINVALUE CACHE 1;"); + } + } + + +// TODO HTML +if($success==0) + die("Error: Tables not created. Table creation failed.\n"); +elseif ($success==1) + die("Error: Tables partially created. Table creation failed.\n"); + //eecho("Tables Successfully created.\n"); + +// Populate default data +foreach ($modules as $module ) +{ + $focus = new $module(); + $focus->create_tables(); +} + + +// create and populate combo tables +require_once('include/PopulateComboValues.php'); +$combo = new PopulateComboValues(); +$combo->create_tables(); + +//Writing tab data in flat file +create_tab_data_file(); +create_parenttab_data_file(); + +// Create the default users +create_default_users(); + +// default report population +require_once('modules/Reports/PopulateReports.php'); + +// default customview population +require_once('modules/CustomView/PopulateCustomView.php'); + + +// ensure required sequences are created (adodb creates them as needed, but if +// creation occurs within a transaction we get problems +$db->getUniqueID("vtiger_crmentity"); +$db->getUniqueID("vtiger_seactivityrel"); +$db->getUniqueID("vtiger_freetags"); + +//Master currency population +//Insert into vtiger_currency vtiger_table + $db->query("insert into vtiger_currency_info values(".$db->getUniqueID("vtiger_currency_info").",'$currency_name','$currency_code','$currency_symbol',1,'Active','-11')"); + +// populate the db with seed data +if ($db_populate) { + //eecho ("Populate seed data into $db_name"); + include("install/populateSeedData.php"); + //eecho ("...done

\n"); +} + +// populate forums data +global $log, $db; + +//$endTime = microtime(); +//$deltaTime = microtime_diff($startTime, $endTime); + + +// populate calendar data + +//eecho ("total time: $deltaTime seconds.\n"); +?> Modified: vtigercrm/branches/5.1_jens/install/5createTables.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/5createTables.php (original) +++ vtigercrm/branches/5.1_jens/install/5createTables.php Tue Nov 14 03:16:10 2006 @@ -1,179 +1,179 @@ - - - - - - -vtiger CRM 5 - Configuration Wizard - Finish - - - - - - - -


- - - - - - - -
Configuration Wizardvtiger CRM 5
- - - - - -
- - - - -
- - - - - - -
- - - - - - - - - - -
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
- -
- - - - - - - - -
Configuration Completed
-
- - - - - - -
- vtigercrm-5.0.0 is all set to go! -
-
-
    -
  • Your install.php file has been renamed to install.php.txt. -
  • Your install folder too has been renamed to install/. -
  • Please log in using the "admin" user name and the password you entered in step 2. -
-
- -
-
- - -
-
- - -
-
-
- - -
-
- - - - - - -
- - - - -
- - - - - -
www.vtiger.com
- - + + + + + + +vtiger CRM 5 - Configuration Wizard - Finish + + + + + + + +


+ + + + + + + +
Configuration Wizardvtiger CRM 5
+ + + + + +
+ + + + +
+ + + + + + +
+ + + + + + + + + + +
Welcome
Installation Check
System Configuration
Confirm Settings
Config File Creation
Database Generation
Finish
+ +
+ + + + + + + + +
Configuration Completed
+
+ + + + + + +
+ vtigercrm-5.0.2 is all set to go! +
+
+
    +
  • Your install.php file has been renamed to install.php.txt. +
  • Your install folder too has been renamed to install/. +
  • Please log in using the "admin" user name and the password you entered in step 2. +
+
+ +
+
+ + +
+
+ + +
+
+
+ + +
+
+ + + + + + +
+ + + + +
+ + + + + +
www.vtiger.com
+ + Modified: vtigercrm/branches/5.1_jens/install/populateSeedData.php ============================================================================== --- vtigercrm/branches/5.1_jens/install/populateSeedData.php (original) +++ vtigercrm/branches/5.1_jens/install/populateSeedData.php Tue Nov 14 03:16:10 2006 @@ -1,1171 +1,1171 @@ -println("PSD dumping started"); - -$account_ids = Array(); -$opportunity_ids = Array(); -$vendor_ids = Array(); -$contact_ids = Array(); -$product_ids = Array(); -$pricebook_ids = Array(); -$quote_ids = Array(); -$salesorder_ids = Array(); -$purchaseorder_ids = Array(); -$invoice_ids = Array(); -$email_ids = Array(); - -// Determine the assigned user for all demo data. This is the default user if set, or admin -$assigned_user_name = "admin"; -if(isset($default_user_name) && $default_user_name != '' && isset($create_default_user) && $create_default_user) -{ - $assigned_user_name = $default_user_name; -} - -// Look up the user id for the assigned user -$seed_user = new User(); - -//$adb->println("PSD assignname=".$assigned_user_name); - -$assigned_user_id = $seed_user->retrieve_user_id($assigned_user_name); - -global $current_user; - -$current_user = new User(); -$result = $current_user->retrieve_entity_info($assigned_user_id,'Users'); - -$tagkey = 1; - -// Get _dom arrays -$comboFieldNames = Array('leadsource'=>'leadsource_dom' - ,'leadstatus'=>'lead_status_dom' - ,'industry'=>'industry_dom' - ,'rating'=>'rating_dom' - ,'opportunity_type'=>'opportunity_type_dom' - ,'sales_stage'=>'sales_stage_dom'); -$comboFieldArray = getComboArray($comboFieldNames); - -//$adb->println("PSD assignid=".$assigned_user_id); -$adb->println("company_name_array"); -$adb->println($company_name_array); - -$cloudtag = Array ('SO_vendtl', 'X-CEED', 'X-CEED', 'vtiger_50usr'); - -for($i = 0; $i < $company_name_count; $i++) -{ - - $account_name = $company_name_array[$i]; - - // Create new accounts. - $account = new Account(); - $account->column_fields["accountname"] = $account_name; - $account->column_fields["phone"] = create_phone_number(); - $account->column_fields["assigned_user_id"] = $assigned_user_id; - - $whitespace = array(" ", ".", "&", "\/"); - $website = str_replace($whitespace, "", strtolower($account->column_fields["accountname"])); - $account->column_fields["website"] = "www.".$website.".com"; - - $account->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $account->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $account->column_fields["bill_state"] = "CA"; - $account->column_fields["bill_code"] = rand(10000, 99999); - $account->column_fields["bill_country"] = 'USA'; - - $account->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $account->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $account->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $account->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $account->column_fields["ship_country"] = $account->column_fields["bill_country"]; - -// $key = array_rand($app_list_strings['industry_dom']); -// $account->industry = $app_list_strings['industry_dom'][$key]; - $key = array_rand($comboFieldArray['industry_dom']); - $account->column_fields["industry"] = $comboFieldArray['industry_dom'][$key]; - - $account->column_fields["account_type"] = "Customer"; - - //$account->saveentity("Accounts"); - $account->save("Accounts"); - - $account_ids[] = $account->id; - - if ($i > 3) - { - $freetag = $adb->getUniqueId('vtiger_freetags'); - $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[1]', '$cloudtag[1]')"; - $res = $adb->query($query); - - $date = $adb->formatDate(date('YmdHis')); - $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$account->id.", $date, 'Accounts')"; - $result = $adb->query($query_tag); - } - - -// $adb->println("PSD Account [".$account->id."] - ".$account_name); - - -//Create new opportunities - $opp = new Potential(); - - $opp->column_fields["assigned_user_id"] = $assigned_user_id; - $opp->column_fields["potentialname"] = $account_name." - 1000 units"; - $opp->column_fields["closingdate"] = & create_date(); - -// $key = array_rand($app_list_strings['lead_source_dom']); -// $opp->lead_source = $app_list_strings['lead_source_dom'][$key]; - $key = array_rand($comboFieldArray['leadsource_dom']); - $opp->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; - -// $key = array_rand($app_list_strings['sales_stage_dom']); -// $opp->sales_stage = $app_list_strings['sales_stage_dom'][$key]; - $comboSalesStageArray = Array ("Closed Won"); - $key = array_rand($comboSalesStageArray); - $opp->column_fields["sales_stage"] = $comboSalesStageArray[$key]; - -// $key = array_rand($app_list_strings['opportunity_type_dom']); -// $opp->opportunity_type = $app_list_strings['opportunity_type_dom'][$key]; - $key = array_rand($comboFieldArray['opportunity_type_dom']); - $opp->column_fields["opportunity_type"] = $comboFieldArray['opportunity_type_dom'][$key]; - - $amount = array("10000", "25000", "50000", "75000"); - $key = array_rand($amount); - $opp->column_fields["amount"] = $amount[$key]; - $opp->column_fields["account_id"] = $account->id; - - //$opp->saveentity("Potentials"); - $opp->save("Potentials"); - - $opportunity_ids[] = $opp->id; - -// $adb->println("PSD Potential [".$opp->id."] - account[".$account->id."]"); - -} - - -for($i=0; $i<10; $i++) -{ - $contact = new Contact(); - $contact->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i])); - $contact->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i])); - $contact->column_fields["assigned_user_id"] = $assigned_user_id; - - $contact->column_fields["email"] = strtolower($contact->column_fields["firstname"])."_".strtolower($contact->column_fields["lastname"])."@company.com"; - - $contact->column_fields["phone"] = create_phone_number(); - $contact->column_fields["homephone"] = create_phone_number(); - $contact->column_fields["mobile"] = create_phone_number(); - - // Fill in a bogus address - $key = array_rand($street_address_array); - $contact->column_fields["mailingstreet"] = $street_address_array[$key]; - $key = array_rand($city_array); - $contact->column_fields["mailingcity"] = $city_array[$key]; - $contact->column_fields["mailingstate"] = "CA"; - $contact->column_fields["mailingzip"] = '99999'; - $contact->column_fields["mailingcountry"] = 'USA'; - if ($contact->column_fields["mailingcity"] == "San Mateo") - $contact->column_fields["yahooid"] = "clint_oram"; - elseif ($contact->column_fields["mailingcity"] == "San Francisco") - $contact->column_fields["yahooid"] = "not_a_real_id"; - -// $key = array_rand($app_list_strings['lead_source_dom']); -// $contact->lead_source = $app_list_strings['lead_source_dom'][$key]; - $key = array_rand($comboFieldArray['leadsource_dom']); - $contact->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; - - $titles = array("President", - "VP Operations", - "VP Sales", - "Director Operations", - "Director Sales", - "Mgr Operations", - "IT Developer", - ""); - $key = array_rand($titles); - $contact->column_fields["title"] = $titles[$key]; - - $account_key = array_rand($account_ids); - $contact->column_fields["account_id"] = $account_ids[$account_key]; - - //$contact->saveentity("Contacts"); - $contact->save("Contacts"); - $contact_ids[] = $contact->id; - - - if ($i > 8) - { - $freetag = $adb->getUniqueId('vtiger_freetags'); - $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[2]', '$cloudtag[2]')"; - $res1 = $adb->query($query); - - $date = $adb->formatDate(date('YmdHis')); - $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$contact->id.", $date, 'Contacts')"; - $result1 = $adb->query($query_tag); - } - // This assumes that there will be one opportunity per company in the seed data. - $opportunity_key = array_rand($opportunity_ids); - //$query = "insert into opportunities_contacts set id='".create_guid()."', contact_id='$contact->id', contact_role='".$app_list_strings['opportunity_relationship_type_default_key']."', opportunity_id='".$opportunity_ids[$opportunity_key]."'"; - //$db->query($query, true, "unable to create seed links between opportunities and contacts"); - - $query = "insert into vtiger_contpotentialrel ( contactid, potentialid ) values (".$contact->id.",".$opportunity_ids[$opportunity_key].")"; - $db->query($query); - -// $adb->println("PSD Contact [".$contact->id."] - account[".$account_ids[$account_key]."] - potential[".$opportunity_ids[$opportunity_key]."]"); - - //Create new tasks - /*$task = new Task(); - - $key = array_rand($task->default_task_name_values); - $task->name = $task->default_task_name_values[$key]; - $task->date_due = & create_date(); - $task->time_due = date("H:i:s",time()); - $task->date_due_flag = 'off'; - $task->assigned_user_id = $assigned_user_id; - - $key = array_rand($app_list_strings['task_status_dom']); - $task->status = $app_list_strings['task_status_dom'][$key]; - $task->contact_id = $contact->id; - if ($contact->primary_address_city == "San Mateo") { - $task->parent_id = $account_ids[$account_key]; - $task->parent_type = 'Accounts'; - $task->save(); - }*/ - -} - - $company_count=0; -for($i=0; $i<10; $i++) -{ - $lead = new Lead(); - $lead->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i])); - $lead->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i])); - - if($i<5) - { - $lead->column_fields["company"] = ucfirst(strtolower($company_name_array[$i])); - } - else - { - $lead->column_fields["company"] = ucfirst(strtolower($company_name_array[$company_count])); - $company_count++; - } - - $lead->column_fields["assigned_user_id"] = $assigned_user_id; - - $lead->column_fields["email"] = strtolower($lead->column_fields["firstname"])."_".strtolower($lead->column_fields["lastname"])."@company.com"; - - $website = str_replace($whitespace, "", strtolower(ucfirst(strtolower($company_name_array[$i])))); - $lead->column_fields["website"] = "www.".$website.".com"; - - $lead->column_fields["phone"] = create_phone_number(); - $lead->column_fields["mobile"] = create_phone_number(); - - // Fill in a bogus address - $key = array_rand($street_address_array); - //$lead->address_street = $street_address_array[$key]; - $lead->column_fields["lane"] = $street_address_array[$key]; - $key = array_rand($city_array); - $lead->column_fields["city"] = $city_array[$key]; - $lead->column_fields["state"] = "CA"; - $lead->column_fields["code"] = '99999'; - $lead->column_fields["country"] = 'USA'; - if ($lead->column_fields["city"] == "San Mateo") - $lead->column_fields["yahooid"] = "clint_oram"; - elseif ($lead->column_fields["city"] == "San Francisco") - $lead->column_fields["yahooid"] = "not_a_real_id"; - -// $key = array_rand($app_list_strings['lead_source_dom']); -// $lead->lead_source = $app_list_strings['lead_source_dom'][$key]; - $key = array_rand($comboFieldArray['leadsource_dom']); - $lead->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; - -// $key = array_rand($app_list_strings['lead_status_dom']); -// $lead->lead_status = $app_list_strings['lead_status_dom'][$key]; - $key = array_rand($comboFieldArray['lead_status_dom']); - $lead->column_fields["leadstatus"] = $comboFieldArray['lead_status_dom'][$key]; - -// $key = array_rand($app_list_strings['rating_dom']); -// $lead->rating = $app_list_strings['rating_dom'][$key]; - $key = array_rand($comboFieldArray['rating_dom']); - $lead->column_fields["rating"] = $comboFieldArray['rating_dom'][$key]; - - $titles = array("President", - "VP Operations", - "VP Sales", - "Director Operations", - "Director Sales", - "Mgr Operations", - "IT Developer", - ""); - $key = array_rand($titles); - $lead->column_fields["designation"] = $titles[$key]; - - //$lead->saveentity("Leads"); - $lead->save("Leads"); - -// $adb->println("PSD Lead [".$lead->id."] - name=".$lead->column_fields["lastname"]); - -} - -// Temp fix since user is not logged in while populating data updating creatorid in crmentity - GS - - -//Populating Vendor Data -for($i=0; $i<10; $i++) -{ - $vendor = new Vendor(); - $vendor->column_fields["vendorname"] = ucfirst(strtolower($first_name_array[$i])); - $vendor->column_fields["phone"] = create_phone_number(); - $vendor->column_fields["email"] = strtolower($vendor->column_fields["vendorname"])."@company.com"; - $website = str_replace($whitespace, "", strtolower(ucfirst(strtolower($company_name_array[$i])))); - $vendor->column_fields["website"] = "www.".$website.".com"; - - $vendor->column_fields["assigned_user_id"] = $assigned_user_id; - - - - // Fill in a bogus address - $vendor->column_fields["street"] = $street_address_array[rand(0,$street_address_count-1)]; - $key = array_rand($city_array); - $vendor->column_fields["city"] = $city_array[$key]; - $vendor->column_fields["state"] = "CA"; - $vendor->column_fields["postalcode"] = '99999'; - $vendor->column_fields["country"] = 'USA'; - - $vendor->save("Vendors"); - $vendor_ids[] = $vendor->id; - - -} - - -//Populating Product Data - -$product_name_array= array( "Vtiger Single User Pack", "Vtiger 5 Users Pack", "Vtiger 10 Users Pack", - "Vtiger 25 Users Pack", "Vtiger 50 Users Pack", "Double Panel See-thru Clipboard", - "abcd1234", "Cd-R CD Recordable", "Sharp - Plain Paper Fax" , "Brother Ink Jet Cartridge"); -$product_code_array= array("001","002","003","023","005","sg-106","1324356","sg-108","sg-119","sg-125"); -$subscription_rate=array("149","699","1299","2999","4995"); -//added by jeri to populate product images -$product_image_array = array("product1.jpeg###","product2.jpeg###product3.jpeg###","product4.jpeg###product5.jpeg###product6 -.jpeg###","product7.jpeg###product8.jpeg###product9.jpeg###product10.jpeg###"); -for($i=0; $i<10; $i++) -{ - $product = new Product(); - if($i>4) - { - $parent_key = array_rand($opportunity_ids); - $product->column_fields["parent_id"]=$opportunity_ids[$parent_key]; - - $usageunit = "Each"; - $qty_per_unit = 1; - $qty_in_stock = rand(10000, 99999); - $category = "Hardware"; - $website = ""; - $manufacturer = ""; - $commission_rate= rand(10,20); - $unit_price = rand(100,999); - $product_image_name = ''; - } - else - { - $account_key = array_rand($account_ids); - $product->column_fields["parent_id"]=$account_ids[$account_key]; - - $usageunit = "Each"; - $qty_per_unit = 1; - $qty_in_stock = rand(10000, 99999); - $category = "Software"; - $website = "www.vtiger.com"; - $manufacturer = "vtiger"; - $commission_rate= rand(1,10); - $unit_price = $subscription_rate[$i]; - $product_image_name = $product_image_array[$i]; - } - - $product->column_fields["productname"] = $product_name_array[$i]; - $product->column_fields["productcode"] = $product_code_array[$i]; - $product->column_fields["manufacturer"] = $manufacturer; - - $product->column_fields["productcategory"] = $category; - $product->column_fields["website"] = $website; - $product->column_fields["productsheet"] = ""; - - $vendor_key = array_rand($vendor_ids); - $product->column_fields["vendor_id"] = $vendor_ids[$vendor_key]; - $contact_key = array_rand($contact_ids); - $product->column_fields["contact_id"] = $contact_ids[$contact_key]; - - $product->column_fields["start_date"] = & create_date(); - $product->column_fields["sales_start_date"] = & create_date(); - - $product->column_fields["unit_price"] = $unit_price; - $product->column_fields["commissionrate"] = $commission_rate; - $product->column_fields["taxclass"] = 'SalesTax'; - $product->column_fields["usageunit"] = $usageunit; - $product->column_fields["qty_per_unit"] = $qty_per_unit; - $product->column_fields["qtyinstock"] = $qty_in_stock; - $product->column_fields["imagename"] = $product_image_name; - - $product->save("Products"); - $product_ids[] = $product ->id; -} - - -//Populating HelpDesk- FAQ Data - - $status_array=array ("Draft","Reviewed","Published","Draft","Reviewed","Draft","Reviewed","Draft","Reviewed","Draft","Reviewed","Draft"); - $question_array=array ( - "How to migrate data from previous versions to the latest version?", - "Error message: The file is damaged and could not be repaired.", - "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose No when trying to add Email to vitger CRM ", - "When trying to merge a template with a contact, First I was asked allow installation of ActiveX control. I accepted. After it appears a message that it will not be installed because it can't verify the publisher. Do you have a workarround for this issue ?", - " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", - "How to migrate data from previous versions to the latest version?", - "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose No when trying to add Email to vitger CRM ", - " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", - "Error message: The file is damaged and could not be repaired.", - "When trying to merge a template with a contact, First I was asked allow installation of ActiveX control. I accepted. After it appears a message that it will not be installed because it can't verify the publisher. Do you have a workarround for this issue ?", - " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", - "How to migrate data from previous versions to the latest version?", - - ); - - - $answer_array=array ( - "Database migration scripts are available to migrate from the following versions: - - 1.0 to 2.0 - - 2.0 to 2.1 - - 2.1 to 3.0 - - 3.0 to 3.2 - - 3.2 to 4.0 - - 4.0 to 4.0.1 - - 4.0.1 to 4.2", - - "The above error message is due to version incompatibility between FPDF and PHP5. Use PHP 4.3.X version","Published", - "The above error message is displayed if you have installed the Microsoft(R) Outlook(R) E-mail Security Update. Please refer to the following URL for complete details: - -http://support.microsoft.com/default.aspx?scid=kb%3BEN-US%3B263074 - -If you want to continue working with vtiger Outlook Plug-in, select the Allow access for check box and select the time from drop-down box.", - " Since, vtigerCRM & all plugins are open source, it is not signed up with third party vendors and IE will ask to download even though the plugin are not signed. - -This message if produced by Microsoft Windows XP. I English Windows XP with the SP2 and the last updates. I told IE to accept installation of the ActiveX, but after it, this message has appeared. Provably there is a place where to tall to WinXP to not validate if the code is signed... but I don\'t know where. - -In IE from Tools->Internet Options->Security->Custom Level, there you can see various options for downloading plugins which are not signed and you can adjust according to your need, so relax your security settings for a while and give a try to vtiger Office Plugin.", - "Before modifying any templates, please ensure that you don\'t have any documents open and only one instance of word is available in your memory." - ); - -$num_array=array(0,1,2,3,4,6,7,8,9,10,11,12); -for($i=0;$i<12;$i++) -{ - - $faq = new Faq(); - - $rand=array_rand($num_array); - $faq->column_fields["product_id"] = $product_ids[$i]; - $faq->column_fields["faqcategories"] = "General"; - $faq->column_fields["faqstatus"] = $status_array[$i]; - $faq->column_fields["question"] = $question_array[$i]; - $faq->column_fields["faq_answer"] = $answer_array[$i]; - - $faq->save("Faq"); - $faq_ids[] = $faq ->id; -} - -//Populate Quote Data - -$sub_array = array ("Prod_Quote", "Cont_Quote", "SO_Quote", "PO_Quote", "Vendor_Quote"); -$stage_array = array ("Created", "Reviewed", "Delivered", "Accepted" , "Rejected"); -$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); -$validtill_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); -for($i=0;$i<5;$i++) -{ - $quote = new Quote(); - - $quote->column_fields["assigned_user_id"] = $assigned_user_id; - $account_key = array_rand($account_ids); - $quote->column_fields["account_id"] = $account_ids[$account_key]; - $op_key = array_rand($opportunity_ids); - $quote->column_fields["potential_id"] = $opportunity_ids[$op_key]; - $contact_key = array_rand($contact_ids); - $quote->column_fields["contact_id"] = $contact_ids[$contact_key]; - $rand = array_rand($num_array); - $quote->column_fields["subject"] = $sub_array[$i]; - $quote->column_fields["quotestage"] = $stage_array[$i]; - $quote->column_fields["carrier"] = $carrier_array[$i]; - $quote->column_fields["validtill"] = $validtill_array[$i]; - - $quote->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $quote->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $quote->column_fields["bill_state"] = "CA"; - $quote->column_fields["bill_code"] = rand(10000, 99999); - $quote->column_fields["bill_country"] = 'USA'; - - $quote->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $quote->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $quote->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $quote->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $quote->column_fields["ship_country"] = $account->column_fields["bill_country"]; - - - $quote->save("Quotes"); - - $quote_ids[] = $quote->id; - - $product_key = array_rand($product_ids); - $productid = $product_ids[$product_key]; - - //set the inventory product details in request then just call the saveInventoryProductDetails function - $_REQUEST['totalProductCount'] = 1; - - $_REQUEST['hdnProductId1'] = $productid; - $_REQUEST['qty1'] = $qty = 1; - $_REQUEST['listPrice1'] = $listprice = 130; - $_REQUEST['comment1'] = "This is test comment for product of Quotes"; - - $_REQUEST['deleted1'] = 0; - $_REQUEST['discount_type1'] = 'amount'; - $_REQUEST['discount_amount1'] = $discount_amount = '20'; - - $_REQUEST['taxtype'] = $taxtype = 'individual'; - $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; - $_REQUEST['discount_type_final'] = 'amount'; - $_REQUEST['discount_amount_final'] = $discount_amount_final = '10'; - - $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; - $_REQUEST['adjustmenttype'] = '+'; - $_REQUEST['adjustment'] = $adjustment = '10'; - - $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; - - //Upto this added to set the request values which will be used to save the inventory product details - - //Now call the saveInventoryProductDetails function - saveInventoryProductDetails(&$quote, 'Quotes'); -} - -//Populate SalesOrder Data - -$subj_array = array ("SO_vtiger", "SO_zoho", "SO_vtiger5usrp", "SO_vt100usrpk", "SO_vendtl"); -$status_array = array ("Created", "Delivered", "Approved" , "Cancelled" , "Created"); -$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); -$duedate_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); - -for($i=0;$i<5;$i++) -{ - $so = new SalesOrder(); - - $so->column_fields["assigned_user_id"] = $assigned_user_id; - $account_key = array_rand($account_ids); - $so->column_fields["account_id"] = $account_ids[$account_key]; - $quote_key = array_rand($quote_ids); - $so->column_fields["quote_id"] = $quote_ids[$quote_key]; - $contact_key = array_rand($contact_ids); - $so->column_fields["contact_id"] = $contact_ids[$contact_key]; - $rand = array_rand($num_array); - $so->column_fields["subject"] = $subj_array[$i]; - $so->column_fields["sostatus"] = $status_array[$i]; - $so->column_fields["hdnGrandTotal"] = $sototal_array[$i]; - $so->column_fields["carrier"] = $carrier_array[$i]; - $so->column_fields["duedate"] = $duedate_array[$i]; - - $so->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $so->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $so->column_fields["bill_state"] = "CA"; - $so->column_fields["bill_code"] = rand(10000, 99999); - $so->column_fields["bill_country"] = 'USA'; - - $so->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $so->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $so->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $so->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $so->column_fields["ship_country"] = $account->column_fields["bill_country"]; - - - $so->save("SalesOrder"); - - $salesorder_ids[] = $so->id; - - $product_key = array_rand($product_ids); - $productid = $product_ids[$product_key]; - - //set the inventory product details in request then just call the saveInventoryProductDetails function - $_REQUEST['totalProductCount'] = 1; - - $_REQUEST['hdnProductId1'] = $productid; - $_REQUEST['qty1'] = $qty = 1; - $_REQUEST['listPrice1'] = $listprice = 1230; - $_REQUEST['comment1'] = "This is test comment for product of SalesOrder"; - - $_REQUEST['deleted1'] = 0; - $_REQUEST['discount_type1'] = 'amount'; - $_REQUEST['discount_amount1'] = $discount_amount = '200'; - - $_REQUEST['taxtype'] = $taxtype = 'individual'; - $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; - $_REQUEST['discount_type_final'] = 'amount'; - $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; - - $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; - $_REQUEST['adjustmenttype'] = '+'; - $_REQUEST['adjustment'] = $adjustment = '100'; - - $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; - - //Upto this added to set the request values which will be used to save the inventory product details - - //Now call the saveInventoryProductDetails function - saveInventoryProductDetails(&$so, 'SalesOrder'); - - -} - - -//Populate PurchaseOrder Data - -$psubj_array = array ("PO_vtiger", "PO_zoho", "PO_vtiger5usrp", "PO_vt100usrpk", "PO_vendtl"); -$pstatus_array = array ("Created", "Delivered", "Approved" , "Cancelled", "Recieved Shipment"); -$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); -$trkno_array = array ("po1425", "po2587", "po7974", "po7979", "po6411"); -$duedate_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); - -for($i=0;$i<5;$i++) -{ - $po = new Order(); - - $po->column_fields["assigned_user_id"] = $assigned_user_id; - $vendor_key = array_rand($vendor_ids); - $po->column_fields["vendor_id"] = $vendor_ids[$vendor_key]; - $contact_key = array_rand($contact_ids); - $po->column_fields["contact_id"] = $contact_ids[$contact_key]; - $rand = array_rand($num_array); - $po->column_fields["subject"] = $psubj_array[$i]; - $po->column_fields["postatus"] = $pstatus_array[$i]; - $po->column_fields["carrier"] = $carrier_array[$i]; - $po->column_fields["tracking_no"] = $trkno_array[$i]; - $po->column_fields["duedate"] = $duedate_array[$i]; - - $po->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $po->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $po->column_fields["bill_state"] = "CA"; - $po->column_fields["bill_code"] = rand(10000, 99999); - $po->column_fields["bill_country"] = 'USA'; - - $po->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $po->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $po->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $po->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $po->column_fields["ship_country"] = $account->column_fields["bill_country"]; - - - $po->save("PurchaseOrder"); - - $purchaseorder_ids[] = $po->id; - - $product_key = array_rand($product_ids); - $productid = $product_ids[$product_key]; - - //set the inventory product details in request then just call the saveInventoryProductDetails function - $_REQUEST['totalProductCount'] = 1; - - $_REQUEST['hdnProductId1'] = $productid; - $_REQUEST['qty1'] = $qty = 1; - $_REQUEST['listPrice1'] = $listprice = 2200; - $_REQUEST['comment1'] = "This is test comment for product of PurchaseOrder"; - - $_REQUEST['deleted1'] = 0; - $_REQUEST['discount_type1'] = 'amount'; - $_REQUEST['discount_amount1'] = $discount_amount = '200'; - - $_REQUEST['taxtype'] = $taxtype = 'individual'; - $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; - $_REQUEST['discount_type_final'] = 'amount'; - $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; - - $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; - $_REQUEST['adjustmenttype'] = '+'; - $_REQUEST['adjustment'] = $adjustment = '100'; - - $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; - - //Upto this added to set the request values which will be used to save the inventory product details - - //Now call the saveInventoryProductDetails function - saveInventoryProductDetails(&$po, 'PurchaseOrder'); - - -} - -//Populate Invoice Data - -$isubj_array = array ("vtiger_invoice201", "zoho_inv7841", "vtiger5usrp_invoice71134", "vt100usrpk_inv113", "vendtl_inv214"); -$istatus_array = array ("Created", "Sent", "Approved" , "Credit Invoice", "Paid"); -$itotal_array = array ("4842.000", "4842.000", "4842.000", "4842.000", "4842.000"); - -for($i=0;$i<5;$i++) -{ - $invoice = new Invoice(); - - $invoice->column_fields["assigned_user_id"] = $assigned_user_id; - $account_key = array_rand($account_ids); - $invoice->column_fields["account_id"] = $account_ids[$account_key]; - $so_key = array_rand($salesorder_ids); - $invoice->column_fields["salesorder_id"] = $salesorder_ids[$so_key]; - $contact_key = array_rand($contact_ids); - $invoice->column_fields["contactid"] = $contact_ids[$contact_key]; - $rand = array_rand($num_array); - $invoice->column_fields["subject"] = $isubj_array[$i]; - $invoice->column_fields["invoicestatus"] = $istatus_array[$i]; - $invoice->column_fields["hdnGrandTotal"] = $itotal_array[$i]; - - $invoice->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; - $invoice->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; - $invoice->column_fields["bill_state"] = "CA"; - $invoice->column_fields["bill_code"] = rand(10000, 99999); - $invoice->column_fields["bill_country"] = 'USA'; - - $invoice->column_fields["ship_street"] = $account->column_fields["bill_street"]; - $invoice->column_fields["ship_city"] = $account->column_fields["bill_city"]; - $invoice->column_fields["ship_state"] = $account->column_fields["bill_state"]; - $invoice->column_fields["ship_code"] = $account->column_fields["bill_code"]; - $invoice->column_fields["ship_country"] = $account->column_fields["bill_country"]; - - - $invoice->save("Invoice"); - - $invoice_ids[] = $invoice->id; - if ($i > 3) - { - $freetag = $adb->getUniqueId('vtiger_freetags'); - $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[0]', '$cloudtag[0]')"; - $res_inv = $adb->query($query); - - $date = $adb->formatDate(date('YmdHis')); - $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$invoice->id.", $date, 'Invoice')"; - $result_inv = $adb->query($query_tag); - } - - $product_key = array_rand($product_ids); - $productid = $product_ids[$product_key]; - - //set the inventory product details in request then just call the saveInventoryProductDetails function - $_REQUEST['totalProductCount'] = 1; - - $_REQUEST['hdnProductId1'] = $productid; - $_REQUEST['qty1'] = $qty = 1; - $_REQUEST['listPrice1'] = $listprice = 4300; - $_REQUEST['comment1'] = "This is test comment for product of Invoice"; - - $_REQUEST['deleted1'] = 0; - $_REQUEST['discount_type1'] = 'amount'; - $_REQUEST['discount_amount1'] = $discount_amount = '300'; - - $_REQUEST['taxtype'] = $taxtype = 'individual'; - $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; - $_REQUEST['discount_type_final'] = 'amount'; - $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; - - $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; - $_REQUEST['adjustmenttype'] = '+'; - $_REQUEST['adjustment'] = $adjustment = '100'; - - $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; - - //Upto this added to set the request values which will be used to save the inventory product details - - //Now call the saveInventoryProductDetails function - saveInventoryProductDetails(&$invoice, 'Invoice'); - -} - -//Populate RSS Data - - - - -//Populate Email Data - -$esubj_array = array ("Vtiger 5 Released", "Try vtigercrm!", "Hi There!!!", "Welcome to Open Source", "Help needed in customization of Vtiger"); -$startdate_array = array ("2006-1-2","2003-3-4","2003-4-5","2001-2-1","2005-8-8"); -$filename_array = array ("vtiger5alpha.tar.gz", "zohowriter.zip", "hi.doc", "welcome.pps", "sos.doc"); - -$to_array = array("a at a.com","b at b.com", "tester at testvtiger.com","xanth at yaz.com","violet at bing.com"); -$cc_array = array("andrewa at a.com","casterb at b.com", "indomine at variancevtiger.com","becker at nosbest.com","electra at violet.com"); -$bcc_array = array("nathan at nathantests.com","jeff at karl1.com", "isotope at uranium.com","bunny at bugs.com","explosive at dud.com"); -$from_array = array("harvest at zss.com","rain at sunshine.com", "gloom at rainyday.com"); -$body_array = array("This is a good product! Have a go at it! ","Nice to have you visit us, very nice of you. Stay for sometime and have a look at our product. I am sure you will like it", "This will take some time to fix. Can you provide me more details please?","What a cool tool! I wish I had found it earlier. Oh it has a lot of my friends name in it too! I too can contribute. But how?","Urgent. I need this done last week! Guys, you are the ones I am depending on. Do something!"); - -for($i=0;$i<5;$i++) -{ - $email = new Email(); - - $email->column_fields["assigned_user_id"] = $assigned_user_id; - - $rand = array_rand($num_array); - $email->column_fields["subject"] = $esubj_array[$i]; - $email->column_fields["filename"] = $filename_array[$i]; - $email->column_fields["date_start"] = $startdate_array[$i]; - $email->column_fields["semodule"] = 'Tasks'; - $email->column_fields["activitytype"] = 'Emails'; - $email->column_fields["description"] = $body_array[$i]; - $email->save("Emails"); - $email_ids[] = $email->id; - - $query = "insert into vtiger_emaildetails(emailid,from_email,to_email,cc_email,bcc_email) values (".$email->id.", '".$from_array[$i]."', '".$to_array[$i]."','".$cc_array[$i]."','".$bcc_array[$i] ."')"; - $res = $adb->query($query); -} - - -//Populate PriceBook data - -$PB_array = array ("Cd-R PB", "Vtiger PB", "Gator PB", "Kyple PB", "Pastor PB", "Zoho PB", "PB_100", "Per_PB", "CST_PB", "GATE_PB", "Chevron_PB", "Pizza_PB"); -$Active_array = array ("0", "1", "1", "0", "1","0", "1", "1", "0", "1","0","1"); - -//$num_array = array(0,1,2,3,4); -for($i=0;$i<12;$i++) -{ - $pricebook = new PriceBook(); - - $rand = array_rand($num_array); - $pricebook->column_fields["bookname"] = $PB_array[$i]; - $pricebook->column_fields["active"] = $Active_array[$i]; - - $pricebook->save("PriceBooks"); - $pricebook_ids[] = $pricebook ->id; -} - - -//Populate Notes Data - -$notes_array = array ("Cont_Notes", "Prod_Notes", "Vendor_Notes", "Invoice_Notes", "Task_Notes", "Event_Notes", "Email_Notes"); - -for($i=0;$i<7;$i++) -{ - $notes = new Note(); - - $rand = array_rand($num_array); - $contact_key = array_rand($contact_ids); - $notes->column_fields["contact_id"] = $contact_ids[$contact_key]; - $notes->column_fields["notes_title"] = $notes_array[$i]; - - $notes->save("Notes"); - $notes_ids[] = $notes ->id; - - $product_key = array_rand($product_ids); - $query = "insert into vtiger_senotesrel (crmid, notesid) values (".$product_ids[$product_key].", ".$notes->id.")"; - $db->query($query); - -} - - - -// Populate Ticket data - - -//$severity_array=array("Minor","Major","Critical",""); -$status_array=array("Open","In Progress","Wait For Response","Open","Closed"); -$category_array=array("Big Problem ","Small Problem","Other Problem","Small Problem","Other Problem"); -$ticket_title_array=array("Upload Attachment problem", - "Individual Customization -Menu and RSS","Export Output query", - "Import Error CSV Leads","How to automatically add a lead from a web form to VTiger"); - -for($i=0;$i<5;$i++) -{ - $helpdesk= new HelpDesk(); - - $rand=array_rand($num_array); - $contact_key = array_rand($contact_ids); - $helpdesk->column_fields["parent_id"] = $contact_ids[$contact_key]; - - $helpdesk->column_fields["ticketpriorities"]= "Normal"; - $helpdesk->column_fields["product_id"] = $product_ids[$i]; - - $helpdesk->column_fields["ticketseverities"] = "Minor"; - $helpdesk->column_fields["ticketstatus"] = $status_array[$i]; - $helpdesk->column_fields["ticketcategories"] = $category_array[$i]; - //$rand_key = array_rand($s);$contact_key = array_rand($contact_ids); - $notes->column_fields["contact_id"] = $contact_ids[$contact_key]; - $helpdesk->column_fields["ticket_title"] = $ticket_title_array[$i]; - $helpdesk->column_fields["assigned_user_id"] = $assigned_user_id; - - $helpdesk->save("HelpDesk"); - $helpdesk_ids[] = $helpdesk->id; - - if ($i > 3) - { - $freetag = $adb->getUniqueId('vtiger_freetags'); - $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[3]', '$cloudtag[3]')"; - $res_tkt = $adb->query($query); - - $date = $adb->formatDate(date('YmdHis')); - $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$helpdesk->id.", $date, 'HelpDesk')"; - $result_tkt = $adb->query($query_tag); - } - -} - -// Populate Activities Data -$task_array=array("Tele Conference","Call user - John","Send Fax to Mary Smith"); -$event_array=array("","","Call Smith","Team Meeting","Call Richie","Meeting with Don"); -$task_status_array=array("Planned","In Progress","Completed"); -$task_priority_array=array("High","Medium","Low"); -$visibility=array("","","Private","Public","Private","Public"); - -for($i=0;$i<6;$i++) -{ - $event = new Activity(); - - $rand_num=array_rand($num_array); - - $rand_date = & create_date(); - $en=explode("-",$rand_date); - if($en[1]<10) - $en[1]="0".$en[1]; - if($en[2]<10) - $en[2]="0".$en[2]; - $recur_daily_date=date('Y-m-d',mktime(0,0,0,date($en[1]),date($en[2])+5,date($en[0]))); - $recur_week_date=date('Y-m-d',mktime(0,0,0,date($en[1]),date($en[2])+30,date($en[0]))); - - - $start_time_hr=rand(00,23); - $start_time_min=rand(00,59); - $end_time_hr=rand(00,23); - $end_time_min=rand(00,59); - if($start_time_hr<10) - $start_time_hr="0".$start_time_hr; - if($start_time_min<10) - $start_time_min="0".$start_time_min; - if($end_time_hr<10) - $end_time_hr="0".$end_time_hr; - if($end_time_min<10) - $end_time_min="0".$end_time_min; - $end_time=$end_time_hr.":".$end_time_min; - $start_time=$start_time_hr.":".$start_time_min; - if($i<2) - { - $event->column_fields["subject"] = $task_array[$i]; - if($i==1) - { - $account_key = array_rand($account_ids); - $event->column_fields["parent_id"] = $account_ids[$account_key];; - } - $event->column_fields["taskstatus"] = $task_status_array[$i]; - $event->column_fields["taskpriority"] = $task_priority_array[$i]; - $event->column_fields["activitytype"] = "Task"; - $event->column_fields["visibility"] = $visibility[$i]; - - } - else - { - $event->column_fields["subject"] = $event_array[$i]; - $event->column_fields["visibility"] = $visibility[$i]; - $event->column_fields["duration_hours"] = rand(0,3); - $event->column_fields["duration_minutes"]= rand(0,59); - $event->column_fields["eventstatus"] = "Planned"; - $event->column_fields["time_end"] = $end_time; - } - $event->column_fields["date_start"] = $rand_date; - $_REQUEST["date_start"] = $rand_date; - $event->column_fields["time_start"] = $start_time; - $event->column_fields["due_date"] = $rand_date; - $_REQUEST["due_date"] = $rand_date; - $contact_key = array_rand($contact_ids); - $event->column_fields["contact_id"] = $contact_ids[$contact_key]; - if($i==4) - { - $event->column_fields["recurringtype"] = "Daily"; - $_REQUEST["recurringtype"] = "Daily"; - $event->column_fields["activitytype"] = "Meeting"; - $event->column_fields["due_date"] = $recur_daily_date; - } - elseif($i==5) - { - $event->column_fields["recurringtype"] = "Weekly"; - $_REQUEST["recurringtype"] = "Weekly"; - $event->column_fields["activitytype"] = "Meeting"; - $event->column_fields["due_date"] = $recur_week_date; - } - elseif($i>1) - { - $event->column_fields["activitytype"] = "Call"; - } - $event->column_fields["assigned_user_id"] = $assigned_user_id; - $event->save("Calendar"); - $event_ids[] = $event->id; - -} - - -$adb->query("update vtiger_crmentity set smcreatorid=".$assigned_user_id); - -$expected_revenue = Array("250000","750000","500000"); -$budget_cost = Array("25000","50000","90000"); -$actual_cost = Array("23500","45000","80000"); -$num_sent = Array("2000","2500","3000"); -$clo_date = Array('2003-1-2','2004-2-3','2005-4-12'); - -$expected_response_count = Array("2500","7500","5000"); -$expected_sales_count = Array("25000","50000","90000"); -$expected_roi = Array("23","45","82"); - -$actual_response_count = Array("250","750","1500"); -$actual_sales_count = Array("1250","5200","2390"); -$actual_roi = Array("21","14","12"); - -$sponsor = Array("Finace","Marketing","Sales"); -$targetsize = Array("210000","13390","187424"); -$targetaudience = Array("Managers","CEOs","Rookies"); - -//$expected_response = Array(null,null,null); -for($i=0;$icolumn_fields["campaignname"] = $campaign_name; - $campaign->column_fields["campaigntype"] = $campaign_type_array[$i]; - $campaign->column_fields["campaignstatus"] = $campaign_status_array[$i]; - $campaign->column_fields["numsent"] = $num_sent[$i]; - $campaign->column_fields["expectedrevenue"] = $expected_revenue[$i]; - $campaign->column_fields["budgetcost"] = $budget_cost[$i]; - $campaign->column_fields["actualcost"] = $actual_cost[$i]; - $campaign->column_fields["closingdate"] = $clo_date[$i]; - $campaign->column_fields["expectedresponse"] = $expected_response[$i]; - $campaign->column_fields["assigned_user_id"] = $assigned_user_id; - - $campaign->column_fields["expectedresponsecount"] = $expected_response_count[$i]; - $campaign->column_fields["expectedsalescount"] = $expected_sales_count[$i]; - $campaign->column_fields["expectedroi"] = $expected_roi[$i]; - $campaign->column_fields["actualresponsecount"] = $actual_response_count[$i]; - $campaign->column_fields["actualsalescount"] = $actual_sales_count[$i]; - $campaign->column_fields["actualroi"] = $actual_roi[$i]; - $campaign->column_fields["sponsor"] = $sponsor[$i]; - $campaign->column_fields["targetsize"] = $targetsize[$i]; - $campaign->column_fields["targetaudience"] = $targetaudience[$i]; - - - - $campaign->save("Campaigns"); -} - -//Populate My Sites Data - -$portalname = array ("Vtiger", "Vtiger Blogs", "Vtiger Forums", "VtigerForge", "Vtiger Docs"); -$portalurl = array ("http://vtiger.com", "http://blogs.vtiger.com", "http://forums.vtiger.com", "http://vtigerforge.com", "http://wiki.vtiger.com"); - -for($i=0;$i<5;$i++) -{ - $portalid = $adb->getUniqueId('vtiger_portal'); - $portal_qry = "insert into vtiger_portal values (".$portalid.", '".$portalname[$i]."','".$portalurl[$i]."',0)"; - $result_qry = $adb->query($portal_qry); -} - -//Populate RSS Data -$rssname = array("vtiger - Forums","vtiger development - Active Tickets"); -$rssurl = array("http://forums.vtiger.com/rss.php?name=forums&file=rss","http://vtiger.fosslabs.com/cgi-bin/trac.cgi/report/1?format=rss&USER=anonymous"); - -for($i=0;$i<2;$i++) -{ - $rssid = $adb->getUniqueId('vtiger_rss'); - $rss_qry = "insert into vtiger_rss values (".$rssid.", '".$rssurl[$i]."','".$rssname[$i]."',0,0)"; - $result_qry = $adb->query($rss_qry); -} -?> +println("PSD dumping started"); + +$account_ids = Array(); +$opportunity_ids = Array(); +$vendor_ids = Array(); +$contact_ids = Array(); +$product_ids = Array(); +$pricebook_ids = Array(); +$quote_ids = Array(); +$salesorder_ids = Array(); +$purchaseorder_ids = Array(); +$invoice_ids = Array(); +$email_ids = Array(); + +// Determine the assigned user for all demo data. This is the default user if set, or admin +$assigned_user_name = "admin"; +if(isset($default_user_name) && $default_user_name != '' && isset($create_default_user) && $create_default_user) +{ + $assigned_user_name = $default_user_name; +} + +// Look up the user id for the assigned user +$seed_user = new Users(); + +//$adb->println("PSD assignname=".$assigned_user_name); + +$assigned_user_id = $seed_user->retrieve_user_id($assigned_user_name); + +global $current_user; + +$current_user = new Users(); +$result = $current_user->retrieve_entity_info($assigned_user_id,'Users'); + +$tagkey = 1; + +// Get _dom arrays +$comboFieldNames = Array('leadsource'=>'leadsource_dom' + ,'leadstatus'=>'lead_status_dom' + ,'industry'=>'industry_dom' + ,'rating'=>'rating_dom' + ,'opportunity_type'=>'opportunity_type_dom' + ,'sales_stage'=>'sales_stage_dom'); +$comboFieldArray = getComboArray($comboFieldNames); + +//$adb->println("PSD assignid=".$assigned_user_id); +$adb->println("company_name_array"); +$adb->println($company_name_array); + +$cloudtag = Array ('SO_vendtl', 'X-CEED', 'X-CEED', 'vtiger_50usr'); + +for($i = 0; $i < $company_name_count; $i++) +{ + + $account_name = $company_name_array[$i]; + + // Create new accounts. + $account = new Accounts(); + $account->column_fields["accountname"] = $account_name; + $account->column_fields["phone"] = create_phone_number(); + $account->column_fields["assigned_user_id"] = $assigned_user_id; + + $whitespace = array(" ", ".", "&", "\/"); + $website = str_replace($whitespace, "", strtolower($account->column_fields["accountname"])); + $account->column_fields["website"] = "www.".$website.".com"; + + $account->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $account->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $account->column_fields["bill_state"] = "CA"; + $account->column_fields["bill_code"] = rand(10000, 99999); + $account->column_fields["bill_country"] = 'USA'; + + $account->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $account->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $account->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $account->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $account->column_fields["ship_country"] = $account->column_fields["bill_country"]; + +// $key = array_rand($app_list_strings['industry_dom']); +// $account->industry = $app_list_strings['industry_dom'][$key]; + $key = array_rand($comboFieldArray['industry_dom']); + $account->column_fields["industry"] = $comboFieldArray['industry_dom'][$key]; + + $account->column_fields["account_type"] = "Customer"; + + //$account->saveentity("Accounts"); + $account->save("Accounts"); + + $account_ids[] = $account->id; + + if ($i > 3) + { + $freetag = $adb->getUniqueId('vtiger_freetags'); + $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[1]', '$cloudtag[1]')"; + $res = $adb->query($query); + + $date = $adb->formatDate(date('YmdHis')); + $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$account->id.", $date, 'Accounts')"; + $result = $adb->query($query_tag); + } + + +// $adb->println("PSD Account [".$account->id."] - ".$account_name); + + +//Create new opportunities + $opp = new Potentials(); + + $opp->column_fields["assigned_user_id"] = $assigned_user_id; + $opp->column_fields["potentialname"] = $account_name." - 1000 units"; + $opp->column_fields["closingdate"] = & create_date(); + +// $key = array_rand($app_list_strings['lead_source_dom']); +// $opp->lead_source = $app_list_strings['lead_source_dom'][$key]; + $key = array_rand($comboFieldArray['leadsource_dom']); + $opp->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; + +// $key = array_rand($app_list_strings['sales_stage_dom']); +// $opp->sales_stage = $app_list_strings['sales_stage_dom'][$key]; + $comboSalesStageArray = Array ("Closed Won"); + $key = array_rand($comboSalesStageArray); + $opp->column_fields["sales_stage"] = $comboSalesStageArray[$key]; + +// $key = array_rand($app_list_strings['opportunity_type_dom']); +// $opp->opportunity_type = $app_list_strings['opportunity_type_dom'][$key]; + $key = array_rand($comboFieldArray['opportunity_type_dom']); + $opp->column_fields["opportunity_type"] = $comboFieldArray['opportunity_type_dom'][$key]; + + $amount = array("10000", "25000", "50000", "75000"); + $key = array_rand($amount); + $opp->column_fields["amount"] = $amount[$key]; + $opp->column_fields["account_id"] = $account->id; + + //$opp->saveentity("Potentials"); + $opp->save("Potentials"); + + $opportunity_ids[] = $opp->id; + +// $adb->println("PSD Potential [".$opp->id."] - account[".$account->id."]"); + +} + + +for($i=0; $i<10; $i++) +{ + $contact = new Contacts(); + $contact->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i])); + $contact->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i])); + $contact->column_fields["assigned_user_id"] = $assigned_user_id; + + $contact->column_fields["email"] = strtolower($contact->column_fields["firstname"])."_".strtolower($contact->column_fields["lastname"])."@company.com"; + + $contact->column_fields["phone"] = create_phone_number(); + $contact->column_fields["homephone"] = create_phone_number(); + $contact->column_fields["mobile"] = create_phone_number(); + + // Fill in a bogus address + $key = array_rand($street_address_array); + $contact->column_fields["mailingstreet"] = $street_address_array[$key]; + $key = array_rand($city_array); + $contact->column_fields["mailingcity"] = $city_array[$key]; + $contact->column_fields["mailingstate"] = "CA"; + $contact->column_fields["mailingzip"] = '99999'; + $contact->column_fields["mailingcountry"] = 'USA'; + if ($contact->column_fields["mailingcity"] == "San Mateo") + $contact->column_fields["yahooid"] = "clint_oram"; + elseif ($contact->column_fields["mailingcity"] == "San Francisco") + $contact->column_fields["yahooid"] = "not_a_real_id"; + +// $key = array_rand($app_list_strings['lead_source_dom']); +// $contact->lead_source = $app_list_strings['lead_source_dom'][$key]; + $key = array_rand($comboFieldArray['leadsource_dom']); + $contact->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; + + $titles = array("President", + "VP Operations", + "VP Sales", + "Director Operations", + "Director Sales", + "Mgr Operations", + "IT Developer", + ""); + $key = array_rand($titles); + $contact->column_fields["title"] = $titles[$key]; + + $account_key = array_rand($account_ids); + $contact->column_fields["account_id"] = $account_ids[$account_key]; + + //$contact->saveentity("Contacts"); + $contact->save("Contacts"); + $contact_ids[] = $contact->id; + + + if ($i > 8) + { + $freetag = $adb->getUniqueId('vtiger_freetags'); + $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[2]', '$cloudtag[2]')"; + $res1 = $adb->query($query); + + $date = $adb->formatDate(date('YmdHis')); + $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$contact->id.", $date, 'Contacts')"; + $result1 = $adb->query($query_tag); + } + // This assumes that there will be one opportunity per company in the seed data. + $opportunity_key = array_rand($opportunity_ids); + //$query = "insert into opportunities_contacts set id='".create_guid()."', contact_id='$contact->id', contact_role='".$app_list_strings['opportunity_relationship_type_default_key']."', opportunity_id='".$opportunity_ids[$opportunity_key]."'"; + //$db->query($query, true, "unable to create seed links between opportunities and contacts"); + + $query = "insert into vtiger_contpotentialrel ( contactid, potentialid ) values (".$contact->id.",".$opportunity_ids[$opportunity_key].")"; + $db->query($query); + +// $adb->println("PSD Contact [".$contact->id."] - account[".$account_ids[$account_key]."] - potential[".$opportunity_ids[$opportunity_key]."]"); + + //Create new tasks + /*$task = new Task(); + + $key = array_rand($task->default_task_name_values); + $task->name = $task->default_task_name_values[$key]; + $task->date_due = & create_date(); + $task->time_due = date("H:i:s",time()); + $task->date_due_flag = 'off'; + $task->assigned_user_id = $assigned_user_id; + + $key = array_rand($app_list_strings['task_status_dom']); + $task->status = $app_list_strings['task_status_dom'][$key]; + $task->contact_id = $contact->id; + if ($contact->primary_address_city == "San Mateo") { + $task->parent_id = $account_ids[$account_key]; + $task->parent_type = 'Accounts'; + $task->save(); + }*/ + +} + + $company_count=0; +for($i=0; $i<10; $i++) +{ + $lead = new Leads(); + $lead->column_fields["firstname"] = ucfirst(strtolower($first_name_array[$i])); + $lead->column_fields["lastname"] = ucfirst(strtolower($last_name_array[$i])); + + if($i<5) + { + $lead->column_fields["company"] = ucfirst(strtolower($company_name_array[$i])); + } + else + { + $lead->column_fields["company"] = ucfirst(strtolower($company_name_array[$company_count])); + $company_count++; + } + + $lead->column_fields["assigned_user_id"] = $assigned_user_id; + + $lead->column_fields["email"] = strtolower($lead->column_fields["firstname"])."_".strtolower($lead->column_fields["lastname"])."@company.com"; + + $website = str_replace($whitespace, "", strtolower(ucfirst(strtolower($company_name_array[$i])))); + $lead->column_fields["website"] = "www.".$website.".com"; + + $lead->column_fields["phone"] = create_phone_number(); + $lead->column_fields["mobile"] = create_phone_number(); + + // Fill in a bogus address + $key = array_rand($street_address_array); + //$lead->address_street = $street_address_array[$key]; + $lead->column_fields["lane"] = $street_address_array[$key]; + $key = array_rand($city_array); + $lead->column_fields["city"] = $city_array[$key]; + $lead->column_fields["state"] = "CA"; + $lead->column_fields["code"] = '99999'; + $lead->column_fields["country"] = 'USA'; + if ($lead->column_fields["city"] == "San Mateo") + $lead->column_fields["yahooid"] = "clint_oram"; + elseif ($lead->column_fields["city"] == "San Francisco") + $lead->column_fields["yahooid"] = "not_a_real_id"; + +// $key = array_rand($app_list_strings['lead_source_dom']); +// $lead->lead_source = $app_list_strings['lead_source_dom'][$key]; + $key = array_rand($comboFieldArray['leadsource_dom']); + $lead->column_fields["leadsource"] = $comboFieldArray['leadsource_dom'][$key]; + +// $key = array_rand($app_list_strings['lead_status_dom']); +// $lead->lead_status = $app_list_strings['lead_status_dom'][$key]; + $key = array_rand($comboFieldArray['lead_status_dom']); + $lead->column_fields["leadstatus"] = $comboFieldArray['lead_status_dom'][$key]; + +// $key = array_rand($app_list_strings['rating_dom']); +// $lead->rating = $app_list_strings['rating_dom'][$key]; + $key = array_rand($comboFieldArray['rating_dom']); + $lead->column_fields["rating"] = $comboFieldArray['rating_dom'][$key]; + + $titles = array("President", + "VP Operations", + "VP Sales", + "Director Operations", + "Director Sales", + "Mgr Operations", + "IT Developer", + ""); + $key = array_rand($titles); + $lead->column_fields["designation"] = $titles[$key]; + + //$lead->saveentity("Leads"); + $lead->save("Leads"); + +// $adb->println("PSD Lead [".$lead->id."] - name=".$lead->column_fields["lastname"]); + +} + +// Temp fix since user is not logged in while populating data updating creatorid in crmentity - GS + + +//Populating Vendor Data +for($i=0; $i<10; $i++) +{ + $vendor = new Vendors(); + $vendor->column_fields["vendorname"] = ucfirst(strtolower($first_name_array[$i])); + $vendor->column_fields["phone"] = create_phone_number(); + $vendor->column_fields["email"] = strtolower($vendor->column_fields["vendorname"])."@company.com"; + $website = str_replace($whitespace, "", strtolower(ucfirst(strtolower($company_name_array[$i])))); + $vendor->column_fields["website"] = "www.".$website.".com"; + + $vendor->column_fields["assigned_user_id"] = $assigned_user_id; + + + + // Fill in a bogus address + $vendor->column_fields["street"] = $street_address_array[rand(0,$street_address_count-1)]; + $key = array_rand($city_array); + $vendor->column_fields["city"] = $city_array[$key]; + $vendor->column_fields["state"] = "CA"; + $vendor->column_fields["postalcode"] = '99999'; + $vendor->column_fields["country"] = 'USA'; + + $vendor->save("Vendors"); + $vendor_ids[] = $vendor->id; + + +} + + +//Populating Product Data + +$product_name_array= array( "Vtiger Single User Pack", "Vtiger 5 Users Pack", "Vtiger 10 Users Pack", + "Vtiger 25 Users Pack", "Vtiger 50 Users Pack", "Double Panel See-thru Clipboard", + "abcd1234", "Cd-R CD Recordable", "Sharp - Plain Paper Fax" , "Brother Ink Jet Cartridge"); +$product_code_array= array("001","002","003","023","005","sg-106","1324356","sg-108","sg-119","sg-125"); +$subscription_rate=array("149","699","1299","2999","4995"); +//added by jeri to populate product images +$product_image_array = array("product1.jpeg###","product2.jpeg###product3.jpeg###","product4.jpeg###product5.jpeg###product6 +.jpeg###","product7.jpeg###product8.jpeg###product9.jpeg###product10.jpeg###"); +for($i=0; $i<10; $i++) +{ + $product = new Products(); + if($i>4) + { + $parent_key = array_rand($opportunity_ids); + $product->column_fields["parent_id"]=$opportunity_ids[$parent_key]; + + $usageunit = "Each"; + $qty_per_unit = 1; + $qty_in_stock = rand(10000, 99999); + $category = "Hardware"; + $website = ""; + $manufacturer = ""; + $commission_rate= rand(10,20); + $unit_price = rand(100,999); + $product_image_name = ''; + } + else + { + $account_key = array_rand($account_ids); + $product->column_fields["parent_id"]=$account_ids[$account_key]; + + $usageunit = "Each"; + $qty_per_unit = 1; + $qty_in_stock = rand(10000, 99999); + $category = "Software"; + $website = "www.vtiger.com"; + $manufacturer = "vtiger"; + $commission_rate= rand(1,10); + $unit_price = $subscription_rate[$i]; + $product_image_name = $product_image_array[$i]; + } + + $product->column_fields["productname"] = $product_name_array[$i]; + $product->column_fields["productcode"] = $product_code_array[$i]; + $product->column_fields["manufacturer"] = $manufacturer; + + $product->column_fields["productcategory"] = $category; + $product->column_fields["website"] = $website; + $product->column_fields["productsheet"] = ""; + + $vendor_key = array_rand($vendor_ids); + $product->column_fields["vendor_id"] = $vendor_ids[$vendor_key]; + $contact_key = array_rand($contact_ids); + $product->column_fields["contact_id"] = $contact_ids[$contact_key]; + + $product->column_fields["start_date"] = & create_date(); + $product->column_fields["sales_start_date"] = & create_date(); + + $product->column_fields["unit_price"] = $unit_price; + $product->column_fields["commissionrate"] = $commission_rate; + $product->column_fields["taxclass"] = 'SalesTax'; + $product->column_fields["usageunit"] = $usageunit; + $product->column_fields["qty_per_unit"] = $qty_per_unit; + $product->column_fields["qtyinstock"] = $qty_in_stock; + $product->column_fields["imagename"] = $product_image_name; + + $product->save("Products"); + $product_ids[] = $product ->id; +} + + +//Populating HelpDesk- FAQ Data + + $status_array=array ("Draft","Reviewed","Published","Draft","Reviewed","Draft","Reviewed","Draft","Reviewed","Draft","Reviewed","Draft"); + $question_array=array ( + "How to migrate data from previous versions to the latest version?", + "Error message: The file is damaged and could not be repaired.", + "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose No when trying to add Email to vitger CRM ", + "When trying to merge a template with a contact, First I was asked allow installation of ActiveX control. I accepted. After it appears a message that it will not be installed because it can't verify the publisher. Do you have a workarround for this issue ?", + " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", + "How to migrate data from previous versions to the latest version?", + "A program is trying to access e-mail addresses you have stored in Outlook. Do you want to allow this? If this is unexpected, it may be a virus and you should choose No when trying to add Email to vitger CRM ", + " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", + "Error message: The file is damaged and could not be repaired.", + "When trying to merge a template with a contact, First I was asked allow installation of ActiveX control. I accepted. After it appears a message that it will not be installed because it can't verify the publisher. Do you have a workarround for this issue ?", + " Error message - please close all instances of word before using the vtiger word plugin. Do I need to close all Word and Outlook instances first before I can reopen Word and sign in?", + "How to migrate data from previous versions to the latest version?", + + ); + + + $answer_array=array ( + "Database migration scripts are available to migrate from the following versions: + + 1.0 to 2.0 + + 2.0 to 2.1 + + 2.1 to 3.0 + + 3.0 to 3.2 + + 3.2 to 4.0 + + 4.0 to 4.0.1 + + 4.0.1 to 4.2", + + "The above error message is due to version incompatibility between FPDF and PHP5. Use PHP 4.3.X version","Published", + "The above error message is displayed if you have installed the Microsoft(R) Outlook(R) E-mail Security Update. Please refer to the following URL for complete details: + +http://support.microsoft.com/default.aspx?scid=kb%3BEN-US%3B263074 + +If you want to continue working with vtiger Outlook Plug-in, select the Allow access for check box and select the time from drop-down box.", + " Since, vtigerCRM & all plugins are open source, it is not signed up with third party vendors and IE will ask to download even though the plugin are not signed. + +This message if produced by Microsoft Windows XP. I English Windows XP with the SP2 and the last updates. I told IE to accept installation of the ActiveX, but after it, this message has appeared. Provably there is a place where to tall to WinXP to not validate if the code is signed... but I don\'t know where. + +In IE from Tools->Internet Options->Security->Custom Level, there you can see various options for downloading plugins which are not signed and you can adjust according to your need, so relax your security settings for a while and give a try to vtiger Office Plugin.", + "Before modifying any templates, please ensure that you don\'t have any documents open and only one instance of word is available in your memory." + ); + +$num_array=array(0,1,2,3,4,6,7,8,9,10,11,12); +for($i=0;$i<12;$i++) +{ + + $faq = new Faq(); + + $rand=array_rand($num_array); + $faq->column_fields["product_id"] = $product_ids[$i]; + $faq->column_fields["faqcategories"] = "General"; + $faq->column_fields["faqstatus"] = $status_array[$i]; + $faq->column_fields["question"] = $question_array[$i]; + $faq->column_fields["faq_answer"] = $answer_array[$i]; + + $faq->save("Faq"); + $faq_ids[] = $faq ->id; +} + +//Populate Quote Data + +$sub_array = array ("Prod_Quote", "Cont_Quote", "SO_Quote", "PO_Quote", "Vendor_Quote"); +$stage_array = array ("Created", "Reviewed", "Delivered", "Accepted" , "Rejected"); +$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); +$validtill_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); +for($i=0;$i<5;$i++) +{ + $quote = new Quotes(); + + $quote->column_fields["assigned_user_id"] = $assigned_user_id; + $account_key = array_rand($account_ids); + $quote->column_fields["account_id"] = $account_ids[$account_key]; + $op_key = array_rand($opportunity_ids); + $quote->column_fields["potential_id"] = $opportunity_ids[$op_key]; + $contact_key = array_rand($contact_ids); + $quote->column_fields["contact_id"] = $contact_ids[$contact_key]; + $rand = array_rand($num_array); + $quote->column_fields["subject"] = $sub_array[$i]; + $quote->column_fields["quotestage"] = $stage_array[$i]; + $quote->column_fields["carrier"] = $carrier_array[$i]; + $quote->column_fields["validtill"] = $validtill_array[$i]; + + $quote->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $quote->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $quote->column_fields["bill_state"] = "CA"; + $quote->column_fields["bill_code"] = rand(10000, 99999); + $quote->column_fields["bill_country"] = 'USA'; + + $quote->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $quote->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $quote->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $quote->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $quote->column_fields["ship_country"] = $account->column_fields["bill_country"]; + + + $quote->save("Quotes"); + + $quote_ids[] = $quote->id; + + $product_key = array_rand($product_ids); + $productid = $product_ids[$product_key]; + + //set the inventory product details in request then just call the saveInventoryProductDetails function + $_REQUEST['totalProductCount'] = 1; + + $_REQUEST['hdnProductId1'] = $productid; + $_REQUEST['qty1'] = $qty = 1; + $_REQUEST['listPrice1'] = $listprice = 130; + $_REQUEST['comment1'] = "This is test comment for product of Quotes"; + + $_REQUEST['deleted1'] = 0; + $_REQUEST['discount_type1'] = 'amount'; + $_REQUEST['discount_amount1'] = $discount_amount = '20'; + + $_REQUEST['taxtype'] = $taxtype = 'individual'; + $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; + $_REQUEST['discount_type_final'] = 'amount'; + $_REQUEST['discount_amount_final'] = $discount_amount_final = '10'; + + $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; + $_REQUEST['adjustmenttype'] = '+'; + $_REQUEST['adjustment'] = $adjustment = '10'; + + $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; + + //Upto this added to set the request values which will be used to save the inventory product details + + //Now call the saveInventoryProductDetails function + saveInventoryProductDetails(&$quote, 'Quotes'); +} + +//Populate SalesOrder Data + +$subj_array = array ("SO_vtiger", "SO_zoho", "SO_vtiger5usrp", "SO_vt100usrpk", "SO_vendtl"); +$status_array = array ("Created", "Delivered", "Approved" , "Cancelled" , "Created"); +$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); +$duedate_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); + +for($i=0;$i<5;$i++) +{ + $so = new SalesOrder(); + + $so->column_fields["assigned_user_id"] = $assigned_user_id; + $account_key = array_rand($account_ids); + $so->column_fields["account_id"] = $account_ids[$account_key]; + $quote_key = array_rand($quote_ids); + $so->column_fields["quote_id"] = $quote_ids[$quote_key]; + $contact_key = array_rand($contact_ids); + $so->column_fields["contact_id"] = $contact_ids[$contact_key]; + $rand = array_rand($num_array); + $so->column_fields["subject"] = $subj_array[$i]; + $so->column_fields["sostatus"] = $status_array[$i]; + $so->column_fields["hdnGrandTotal"] = $sototal_array[$i]; + $so->column_fields["carrier"] = $carrier_array[$i]; + $so->column_fields["duedate"] = $duedate_array[$i]; + + $so->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $so->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $so->column_fields["bill_state"] = "CA"; + $so->column_fields["bill_code"] = rand(10000, 99999); + $so->column_fields["bill_country"] = 'USA'; + + $so->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $so->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $so->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $so->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $so->column_fields["ship_country"] = $account->column_fields["bill_country"]; + + + $so->save("SalesOrder"); + + $salesorder_ids[] = $so->id; + + $product_key = array_rand($product_ids); + $productid = $product_ids[$product_key]; + + //set the inventory product details in request then just call the saveInventoryProductDetails function + $_REQUEST['totalProductCount'] = 1; + + $_REQUEST['hdnProductId1'] = $productid; + $_REQUEST['qty1'] = $qty = 1; + $_REQUEST['listPrice1'] = $listprice = 1230; + $_REQUEST['comment1'] = "This is test comment for product of SalesOrder"; + + $_REQUEST['deleted1'] = 0; + $_REQUEST['discount_type1'] = 'amount'; + $_REQUEST['discount_amount1'] = $discount_amount = '200'; + + $_REQUEST['taxtype'] = $taxtype = 'individual'; + $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; + $_REQUEST['discount_type_final'] = 'amount'; + $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; + + $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; + $_REQUEST['adjustmenttype'] = '+'; + $_REQUEST['adjustment'] = $adjustment = '100'; + + $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; + + //Upto this added to set the request values which will be used to save the inventory product details + + //Now call the saveInventoryProductDetails function + saveInventoryProductDetails(&$so, 'SalesOrder'); + + +} + + +//Populate PurchaseOrder Data + +$psubj_array = array ("PO_vtiger", "PO_zoho", "PO_vtiger5usrp", "PO_vt100usrpk", "PO_vendtl"); +$pstatus_array = array ("Created", "Delivered", "Approved" , "Cancelled", "Recieved Shipment"); +$carrier_array = array ("FedEx", "UPS", "USPS", "DHL", "BlueDart"); +$trkno_array = array ("po1425", "po2587", "po7974", "po7979", "po6411"); +$duedate_array = array ("2006-09-21", "2006-10-29", "2006-12-11", "2006-10-09", "2006-11-18"); + +for($i=0;$i<5;$i++) +{ + $po = new PurchaseOrder(); + + $po->column_fields["assigned_user_id"] = $assigned_user_id; + $vendor_key = array_rand($vendor_ids); + $po->column_fields["vendor_id"] = $vendor_ids[$vendor_key]; + $contact_key = array_rand($contact_ids); + $po->column_fields["contact_id"] = $contact_ids[$contact_key]; + $rand = array_rand($num_array); + $po->column_fields["subject"] = $psubj_array[$i]; + $po->column_fields["postatus"] = $pstatus_array[$i]; + $po->column_fields["carrier"] = $carrier_array[$i]; + $po->column_fields["tracking_no"] = $trkno_array[$i]; + $po->column_fields["duedate"] = $duedate_array[$i]; + + $po->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $po->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $po->column_fields["bill_state"] = "CA"; + $po->column_fields["bill_code"] = rand(10000, 99999); + $po->column_fields["bill_country"] = 'USA'; + + $po->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $po->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $po->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $po->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $po->column_fields["ship_country"] = $account->column_fields["bill_country"]; + + + $po->save("PurchaseOrder"); + + $purchaseorder_ids[] = $po->id; + + $product_key = array_rand($product_ids); + $productid = $product_ids[$product_key]; + + //set the inventory product details in request then just call the saveInventoryProductDetails function + $_REQUEST['totalProductCount'] = 1; + + $_REQUEST['hdnProductId1'] = $productid; + $_REQUEST['qty1'] = $qty = 1; + $_REQUEST['listPrice1'] = $listprice = 2200; + $_REQUEST['comment1'] = "This is test comment for product of PurchaseOrder"; + + $_REQUEST['deleted1'] = 0; + $_REQUEST['discount_type1'] = 'amount'; + $_REQUEST['discount_amount1'] = $discount_amount = '200'; + + $_REQUEST['taxtype'] = $taxtype = 'individual'; + $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; + $_REQUEST['discount_type_final'] = 'amount'; + $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; + + $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; + $_REQUEST['adjustmenttype'] = '+'; + $_REQUEST['adjustment'] = $adjustment = '100'; + + $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; + + //Upto this added to set the request values which will be used to save the inventory product details + + //Now call the saveInventoryProductDetails function + saveInventoryProductDetails(&$po, 'PurchaseOrder'); + + +} + +//Populate Invoice Data + +$isubj_array = array ("vtiger_invoice201", "zoho_inv7841", "vtiger5usrp_invoice71134", "vt100usrpk_inv113", "vendtl_inv214"); +$istatus_array = array ("Created", "Sent", "Approved" , "Credit Invoice", "Paid"); +$itotal_array = array ("4842.000", "4842.000", "4842.000", "4842.000", "4842.000"); + +for($i=0;$i<5;$i++) +{ + $invoice = new Invoice(); + + $invoice->column_fields["assigned_user_id"] = $assigned_user_id; + $account_key = array_rand($account_ids); + $invoice->column_fields["account_id"] = $account_ids[$account_key]; + $so_key = array_rand($salesorder_ids); + $invoice->column_fields["salesorder_id"] = $salesorder_ids[$so_key]; + $contact_key = array_rand($contact_ids); + $invoice->column_fields["contactid"] = $contact_ids[$contact_key]; + $rand = array_rand($num_array); + $invoice->column_fields["subject"] = $isubj_array[$i]; + $invoice->column_fields["invoicestatus"] = $istatus_array[$i]; + $invoice->column_fields["hdnGrandTotal"] = $itotal_array[$i]; + + $invoice->column_fields["bill_street"] = $street_address_array[rand(0,$street_address_count-1)]; + $invoice->column_fields["bill_city"] = $city_array[rand(0,$city_array_count-1)]; + $invoice->column_fields["bill_state"] = "CA"; + $invoice->column_fields["bill_code"] = rand(10000, 99999); + $invoice->column_fields["bill_country"] = 'USA'; + + $invoice->column_fields["ship_street"] = $account->column_fields["bill_street"]; + $invoice->column_fields["ship_city"] = $account->column_fields["bill_city"]; + $invoice->column_fields["ship_state"] = $account->column_fields["bill_state"]; + $invoice->column_fields["ship_code"] = $account->column_fields["bill_code"]; + $invoice->column_fields["ship_country"] = $account->column_fields["bill_country"]; + + + $invoice->save("Invoice"); + + $invoice_ids[] = $invoice->id; + if ($i > 3) + { + $freetag = $adb->getUniqueId('vtiger_freetags'); + $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[0]', '$cloudtag[0]')"; + $res_inv = $adb->query($query); + + $date = $adb->formatDate(date('YmdHis')); + $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$invoice->id.", $date, 'Invoice')"; + $result_inv = $adb->query($query_tag); + } + + $product_key = array_rand($product_ids); + $productid = $product_ids[$product_key]; + + //set the inventory product details in request then just call the saveInventoryProductDetails function + $_REQUEST['totalProductCount'] = 1; + + $_REQUEST['hdnProductId1'] = $productid; + $_REQUEST['qty1'] = $qty = 1; + $_REQUEST['listPrice1'] = $listprice = 4300; + $_REQUEST['comment1'] = "This is test comment for product of Invoice"; + + $_REQUEST['deleted1'] = 0; + $_REQUEST['discount_type1'] = 'amount'; + $_REQUEST['discount_amount1'] = $discount_amount = '300'; + + $_REQUEST['taxtype'] = $taxtype = 'individual'; + $_REQUEST['subtotal'] = $subtotal = $qty*$listprice-$discount_amount; + $_REQUEST['discount_type_final'] = 'amount'; + $_REQUEST['discount_amount_final'] = $discount_amount_final = '100'; + + $_REQUEST['shipping_handling_charge'] = $shipping_handling_charge = '50'; + $_REQUEST['adjustmenttype'] = '+'; + $_REQUEST['adjustment'] = $adjustment = '100'; + + $_REQUEST['total'] = $subtotal-$discount_amount_final+$shipping_handling_charge+$adjustment; + + //Upto this added to set the request values which will be used to save the inventory product details + + //Now call the saveInventoryProductDetails function + saveInventoryProductDetails(&$invoice, 'Invoice'); + +} + +//Populate RSS Data + + + + +//Populate Email Data + +$esubj_array = array ("Vtiger 5 Released", "Try vtigercrm!", "Hi There!!!", "Welcome to Open Source", "Help needed in customization of Vtiger"); +$startdate_array = array ("2006-1-2","2003-3-4","2003-4-5","2001-2-1","2005-8-8"); +$filename_array = array ("vtiger5alpha.tar.gz", "zohowriter.zip", "hi.doc", "welcome.pps", "sos.doc"); + +$to_array = array("a at a.com","b at b.com", "tester at testvtiger.com","xanth at yaz.com","violet at bing.com"); +$cc_array = array("andrewa at a.com","casterb at b.com", "indomine at variancevtiger.com","becker at nosbest.com","electra at violet.com"); +$bcc_array = array("nathan at nathantests.com","jeff at karl1.com", "isotope at uranium.com","bunny at bugs.com","explosive at dud.com"); +$from_array = array("harvest at zss.com","rain at sunshine.com", "gloom at rainyday.com"); +$body_array = array("This is a good product! Have a go at it! ","Nice to have you visit us, very nice of you. Stay for sometime and have a look at our product. I am sure you will like it", "This will take some time to fix. Can you provide me more details please?","What a cool tool! I wish I had found it earlier. Oh it has a lot of my friends name in it too! I too can contribute. But how?","Urgent. I need this done last week! Guys, you are the ones I am depending on. Do something!"); + +for($i=0;$i<5;$i++) +{ + $email = new Emails(); + + $email->column_fields["assigned_user_id"] = $assigned_user_id; + + $rand = array_rand($num_array); + $email->column_fields["subject"] = $esubj_array[$i]; + $email->column_fields["filename"] = $filename_array[$i]; + $email->column_fields["date_start"] = $startdate_array[$i]; + $email->column_fields["semodule"] = 'Tasks'; + $email->column_fields["activitytype"] = 'Emails'; + $email->column_fields["description"] = $body_array[$i]; + $email->save("Emails"); + $email_ids[] = $email->id; + + $query = "insert into vtiger_emaildetails(emailid,from_email,to_email,cc_email,bcc_email) values (".$email->id.", '".$from_array[$i]."', '".$to_array[$i]."','".$cc_array[$i]."','".$bcc_array[$i] ."')"; + $res = $adb->query($query); +} + + +//Populate PriceBook data + +$PB_array = array ("Cd-R PB", "Vtiger PB", "Gator PB", "Kyple PB", "Pastor PB", "Zoho PB", "PB_100", "Per_PB", "CST_PB", "GATE_PB", "Chevron_PB", "Pizza_PB"); +$Active_array = array ("0", "1", "1", "0", "1","0", "1", "1", "0", "1","0","1"); + +//$num_array = array(0,1,2,3,4); +for($i=0;$i<12;$i++) +{ + $pricebook = new PriceBooks(); + + $rand = array_rand($num_array); + $pricebook->column_fields["bookname"] = $PB_array[$i]; + $pricebook->column_fields["active"] = $Active_array[$i]; + + $pricebook->save("PriceBooks"); + $pricebook_ids[] = $pricebook ->id; +} + + +//Populate Notes Data + +$notes_array = array ("Cont_Notes", "Prod_Notes", "Vendor_Notes", "Invoice_Notes", "Task_Notes", "Event_Notes", "Email_Notes"); + +for($i=0;$i<7;$i++) +{ + $notes = new Notes(); + + $rand = array_rand($num_array); + $contact_key = array_rand($contact_ids); + $notes->column_fields["contact_id"] = $contact_ids[$contact_key]; + $notes->column_fields["notes_title"] = $notes_array[$i]; + + $notes->save("Notes"); + $notes_ids[] = $notes ->id; + + $product_key = array_rand($product_ids); + $query = "insert into vtiger_senotesrel (crmid, notesid) values (".$product_ids[$product_key].", ".$notes->id.")"; + $db->query($query); + +} + + + +// Populate Ticket data + + +//$severity_array=array("Minor","Major","Critical",""); +$status_array=array("Open","In Progress","Wait For Response","Open","Closed"); +$category_array=array("Big Problem ","Small Problem","Other Problem","Small Problem","Other Problem"); +$ticket_title_array=array("Upload Attachment problem", + "Individual Customization -Menu and RSS","Export Output query", + "Import Error CSV Leads","How to automatically add a lead from a web form to VTiger"); + +for($i=0;$i<5;$i++) +{ + $helpdesk= new HelpDesk(); + + $rand=array_rand($num_array); + $contact_key = array_rand($contact_ids); + $helpdesk->column_fields["parent_id"] = $contact_ids[$contact_key]; + + $helpdesk->column_fields["ticketpriorities"]= "Normal"; + $helpdesk->column_fields["product_id"] = $product_ids[$i]; + + $helpdesk->column_fields["ticketseverities"] = "Minor"; + $helpdesk->column_fields["ticketstatus"] = $status_array[$i]; + $helpdesk->column_fields["ticketcategories"] = $category_array[$i]; + //$rand_key = array_rand($s);$contact_key = array_rand($contact_ids); + $notes->column_fields["contact_id"] = $contact_ids[$contact_key]; + $helpdesk->column_fields["ticket_title"] = $ticket_title_array[$i]; + $helpdesk->column_fields["assigned_user_id"] = $assigned_user_id; + + $helpdesk->save("HelpDesk"); + $helpdesk_ids[] = $helpdesk->id; + + if ($i > 3) + { + $freetag = $adb->getUniqueId('vtiger_freetags'); + $query = "insert into vtiger_freetags values ($freetag, '$cloudtag[3]', '$cloudtag[3]')"; + $res_tkt = $adb->query($query); + + $date = $adb->formatDate(date('YmdHis')); + $query_tag = "insert into vtiger_freetagged_objects values ($freetag, 1,".$helpdesk->id.", $date, 'HelpDesk')"; + $result_tkt = $adb->query($query_tag); + } + +} + +// Populate Activities Data +$task_array=array("Tele Conference","Call user - John","Send Fax to Mary Smith"); +$event_array=array("","","Call Smith","Team Meeting","Call Richie","Meeting with Don"); +$task_status_array=array("Planned","In Progress","Completed"); +$task_priority_array=array("High","Medium","Low"); +$visibility=array("","","Private","Public","Private","Public"); + +for($i=0;$i<6;$i++) +{ + $event = new Activity(); + + $rand_num=array_rand($num_array); + + $rand_date = & create_date(); + $en=explode("-",$rand_date); + if($en[1]<10) + $en[1]="0".$en[1]; + if($en[2]<10) + $en[2]="0".$en[2]; + $recur_daily_date=date('Y-m-d',mktime(0,0,0,date($en[1]),date($en[2])+5,date($en[0]))); + $recur_week_date=date('Y-m-d',mktime(0,0,0,date($en[1]),date($en[2])+30,date($en[0]))); + + + $start_time_hr=rand(00,23); + $start_time_min=rand(00,59); + $end_time_hr=rand(00,23); + $end_time_min=rand(00,59); + if($start_time_hr<10) + $start_time_hr="0".$start_time_hr; + if($start_time_min<10) + $start_time_min="0".$start_time_min; + if($end_time_hr<10) + $end_time_hr="0".$end_time_hr; + if($end_time_min<10) + $end_time_min="0".$end_time_min; + $end_time=$end_time_hr.":".$end_time_min; + $start_time=$start_time_hr.":".$start_time_min; + if($i<2) + { + $event->column_fields["subject"] = $task_array[$i]; + if($i==1) + { + $account_key = array_rand($account_ids); + $event->column_fields["parent_id"] = $account_ids[$account_key];; + } + $event->column_fields["taskstatus"] = $task_status_array[$i]; + $event->column_fields["taskpriority"] = $task_priority_array[$i]; + $event->column_fields["activitytype"] = "Task"; + $event->column_fields["visibility"] = $visibility[$i]; + + } + else + { + $event->column_fields["subject"] = $event_array[$i]; + $event->column_fields["visibility"] = $visibility[$i]; + $event->column_fields["duration_hours"] = rand(0,3); + $event->column_fields["duration_minutes"]= rand(0,59); + $event->column_fields["eventstatus"] = "Planned"; + $event->column_fields["time_end"] = $end_time; + } + $event->column_fields["date_start"] = $rand_date; + $_REQUEST["date_start"] = $rand_date; + $event->column_fields["time_start"] = $start_time; + $event->column_fields["due_date"] = $rand_date; + $_REQUEST["due_date"] = $rand_date; + $contact_key = array_rand($contact_ids); + $event->column_fields["contact_id"] = $contact_ids[$contact_key]; + if($i==4) + { + $event->column_fields["recurringtype"] = "Daily"; + $_REQUEST["recurringtype"] = "Daily"; + $event->column_fields["activitytype"] = "Meeting"; + $event->column_fields["due_date"] = $recur_daily_date; + } + elseif($i==5) + { + $event->column_fields["recurringtype"] = "Weekly"; + $_REQUEST["recurringtype"] = "Weekly"; + $event->column_fields["activitytype"] = "Meeting"; + $event->column_fields["due_date"] = $recur_week_date; + } + elseif($i>1) + { + $event->column_fields["activitytype"] = "Call"; + } + $event->column_fields["assigned_user_id"] = $assigned_user_id; + $event->save("Calendar"); + $event_ids[] = $event->id; + +} + + +$adb->query("update vtiger_crmentity set smcreatorid=".$assigned_user_id); + +$expected_revenue = Array("250000","750000","500000"); +$budget_cost = Array("25000","50000","90000"); +$actual_cost = Array("23500","45000","80000"); +$num_sent = Array("2000","2500","3000"); +$clo_date = Array('2003-1-2','2004-2-3','2005-4-12'); + +$expected_response_count = Array("2500","7500","5000"); +$expected_sales_count = Array("25000","50000","90000"); +$expected_roi = Array("23","45","82"); + +$actual_response_count = Array("250","750","1500"); +$actual_sales_count = Array("1250","5200","2390"); +$actual_roi = Array("21","14","12"); + +$sponsor = Array("Finace","Marketing","Sales"); +$targetsize = Array("210000","13390","187424"); +$targetaudience = Array("Managers","CEOs","Rookies"); + +//$expected_response = Array(null,null,null); +for($i=0;$icolumn_fields["campaignname"] = $campaign_name; + $campaign->column_fields["campaigntype"] = $campaign_type_array[$i]; + $campaign->column_fields["campaignstatus"] = $campaign_status_array[$i]; + $campaign->column_fields["numsent"] = $num_sent[$i]; + $campaign->column_fields["expectedrevenue"] = $expected_revenue[$i]; + $campaign->column_fields["budgetcost"] = $budget_cost[$i]; + $campaign->column_fields["actualcost"] = $actual_cost[$i]; + $campaign->column_fields["closingdate"] = $clo_date[$i]; + $campaign->column_fields["expectedresponse"] = $expected_response[$i]; + $campaign->column_fields["assigned_user_id"] = $assigned_user_id; + + $campaign->column_fields["expectedresponsecount"] = $expected_response_count[$i]; + $campaign->column_fields["expectedsalescount"] = $expected_sales_count[$i]; + $campaign->column_fields["expectedroi"] = $expected_roi[$i]; + $campaign->column_fields["actualresponsecount"] = $actual_response_count[$i]; + $campaign->column_fields["actualsalescount"] = $actual_sales_count[$i]; + $campaign->column_fields["actualroi"] = $actual_roi[$i]; + $campaign->column_fields["sponsor"] = $sponsor[$i]; + $campaign->column_fields["targetsize"] = $targetsize[$i]; + $campaign->column_fields["targetaudience"] = $targetaudience[$i]; + + + + $campaign->save("Campaigns"); +} + +//Populate My Sites Data + +$portalname = array ("Vtiger", "Vtiger Blogs", "Vtiger Forums", "VtigerForge", "Vtiger Docs"); +$portalurl = array ("http://vtiger.com", "http://blogs.vtiger.com", "http://forums.vtiger.com", "http://vtigerforge.com", "http://wiki.vtiger.com"); + +for($i=0;$i<5;$i++) +{ + $portalid = $adb->getUniqueId('vtiger_portal'); + $portal_qry = "insert into vtiger_portal values (".$portalid.", '".$portalname[$i]."','".$portalurl[$i]."',0)"; + $result_qry = $adb->query($portal_qry); +} + +//Populate RSS Data +$rssname = array("vtiger - Forums","vtiger development - Active Tickets"); +$rssurl = array("http://forums.vtiger.com/rss.php?name=forums&file=rss","http://vtiger.fosslabs.com/cgi-bin/trac.cgi/report/1?format=rss&USER=anonymous"); + +for($i=0;$i<2;$i++) +{ + $rssid = $adb->getUniqueId('vtiger_rss'); + $rss_qry = "insert into vtiger_rss values (".$rssid.", '".$rssurl[$i]."','".$rssname[$i]."',0,0)"; + $result_qry = $adb->query($rss_qry); +} +?> Modified: vtigercrm/branches/5.1_jens/jscalendar/calendar.js ============================================================================== --- vtigercrm/branches/5.1_jens/jscalendar/calendar.js (original) +++ vtigercrm/branches/5.1_jens/jscalendar/calendar.js Tue Nov 14 03:16:10 2006 @@ -1703,7 +1703,9 @@ return str; }; +if ( Date.prototype.__msh_oldSetFullYear == null ) { Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; +} Date.prototype.setFullYear = function(y) { var d = new Date(this); d.__msh_oldSetFullYear(y); Modified: vtigercrm/branches/5.1_jens/modules/Accounts/Account.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Accounts/Account.php (original) +++ vtigercrm/branches/5.1_jens/modules/Accounts/Account.php Tue Nov 14 03:16:10 2006 @@ -1,778 +1,758 @@ -'crmid','vtiger_account'=>'accountid','vtiger_accountbillads'=>'accountaddressid','vtiger_accountshipads'=>'accountaddressid','vtiger_accountscf'=>'accountid'); - - var $entity_table = "vtiger_crmentity"; - - var $billadr_table = "vtiger_accountbillads"; - - var $object_name = "Accounts"; - // Mike Crowe Mod --------------------------------------------------------added for general search - var $base_table_name = "vtiger_account"; - var $cf_table_name = "vtiger_accountscf"; - - var $new_schema = true; - - var $module_id = "accountid"; - - var $column_fields = Array(); - - var $sortby_fields = Array('accountname','city','website','phone','smownerid'); - - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Account Name'=>Array('vtiger_account'=>'accountname'), - 'City'=>Array('vtiger_accountbillads'=>'city'), - 'Website'=>Array('vtiger_account'=>'website'), - 'Phone'=>Array('vtiger_account'=> 'phone'), - 'Assigned To'=>Array('vtiger_crmentity'=>'smownerid') - ); - - var $list_fields_name = Array( - 'Account Name'=>'accountname', - 'City'=>'bill_city', - 'Website'=>'website', - 'Phone'=>'phone', - 'Assigned To'=>'assigned_user_id' - ); - var $list_link_field= 'accountname'; - - var $search_fields = Array( - 'Account Name'=>Array('vtiger_account'=>'accountname'), - 'City'=>Array('vtiger_accountbillads'=>'city'), - ); - - var $search_fields_name = Array( - 'Account Name'=>'accountname', - 'City'=>'bill_city', - ); - - // This is the list of vtiger_fields that are required. - var $required_fields = array("accountname"=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'accountname'; - var $default_sort_order = 'ASC'; - - function Account() { - $this->log =LoggerManager::getLogger('account'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Accounts'); - } - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['ACCOUNTS_SORT_ORDER'] != '')?($_SESSION['ACCOUNTS_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'accountname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['ACCOUNTS_ORDER_BY'] != '')?($_SESSION['ACCOUNTS_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - /** Returns a list of the associated contacts - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_contacts($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_contacts(".$id.") method ..."); - global $mod_strings; - - $focus = new Contact(); - - $button = ''; - if(isPermitted("Contacts",1,"") == 'yes') - { - $button .= ' 

  
- - + +
@@ -288,12 +288,12 @@ - - + -
+
hour_format,'start');?>
- Set date.. +
+ Set date.. Modified: vtigercrm/branches/5.1_jens/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/branches/5.1_jens/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/branches/5.1_jens/modules/Calendar/calendarLayout.php Tue Nov 14 03:16:10 2006 @@ -1,1959 +1,1968 @@ -debug("Entering calendar_layout() method"); - $cal_header = array (); - if (isset($param_arr['size']) && $param_arr['size'] == 'small') - $param_arr['calendar']->show_events = false; - - $cal_header['view'] = $param_arr['view']; - $cal_header['IMAGE_PATH'] = $param_arr['IMAGE_PATH']; - $cal_header['calendar'] = $param_arr['calendar']; - $eventlabel = $mod_strings['LBL_EVENTS']; - $todolabel = $mod_strings['LBL_TODOS']; - //if $param_arr['size'] is set to 'small', get small(mini) calendar - if(isset($param_arr['size']) && $param_arr['size'] == 'small') - { - get_mini_calendar($param_arr); - } - else - { - //To differentiate selected subtab from unselected one - Starts - if($subtab == 'event') - { - $eventtab_class = 'dvtSelectedCell'; - $todotab_class = 'dvtUnSelectedCell'; - $event_anchor = $eventlabel; - $todo_anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=todo&parenttab=".$category."'>".$todolabel.""; - - } - elseif($subtab == 'todo') - { - $eventtab_class = 'dvtUnSelectedCell'; - $todotab_class = 'dvtSelectedCell'; - $event_anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=event&parenttab=".$category."'>".$eventlabel.""; - $todo_anchor = $todolabel; - } - //Ends - //To get calendar header and its links(like Day,Week,Month,Year and etc.) - get_cal_header_tab($cal_header,$viewBox,$subtab); - $subheader = ""; - $subheader .=<< - - - - - - -
- - - - - - - - - -
 $event_anchor $todo_anchor 
-
-EOQ; - echo $subheader; - if($viewBox == 'hourview' && $subtab == 'event') - { - get_cal_header_data($param_arr,$viewBox,$subtab); - getHourView($param_arr); - } - elseif($viewBox == 'listview' && $subtab == 'event') - { - get_cal_header_data($param_arr,$viewBox,$subtab); - getEventListView($param_arr); - } - elseif($subtab == 'todo') - { - $todo_list = ""; - $todo_list .= getTodosListView($param_arr,'',$subtab); - $todo_list .= '

'; - echo $todo_list; - } - } - - $cal_log->debug("Exiting calendar_layout() method"); - -} - -/** - * Function creates HTML to display small(mini) Calendar - * @param array $cal - collection of objects and strings - */ -function get_mini_calendar(& $cal) -{ - global $current_user,$adb,$cal_log; - $category = getParentTab(); - $cal_log->debug('Entering get_mini_calendar() method...'); - $count = 0; - //To decide number of rows(weeks) in a month - if ($cal['calendar']->month_array[$cal['calendar']->slices[35]]->start_time->month != $cal['calendar']->date_time->month) { - $rows = 5; - } else { - $rows = 6; - } - $minical = ""; - $minical .= " - - - "; - $minical .= ""; - $minical .= ""; - //To display days in week - $minical .= ''; - for ($i = 0; $i < 7; $i ++) - { - $weekdays_row = $cal['calendar']->month_array[$cal['calendar']->slices[$i]]; - $weekday = $weekdays_row->start_time->getdayofWeek_inshort(); - $minical .= ''; - } - $minical .= ""; - $event_class = ''; - $class = ''; - for ($i = 0; $i < $rows; $i ++) - { - $minical .= ""; - for ($j = 0; $j < 7; $j ++) - { - $cal['slice'] = $cal['calendar']->month_array[$cal['calendar']->slices[$count]]; - $class = dateCheck($cal['slice']->start_time->get_formatted_date()); - if($count%7 == 0) - $minical .= ""; - //To differentiate day having events from other days - if(count($cal['slice']->activities) != 0 && ($cal['slice']->start_time->get_formatted_date() == $cal['slice']->activities[0]->start_time->get_formatted_date())) - { - $event_class = 'class="eventDay"'; - } - else - { - $event_class = ''; - } - //To differentiate current day from other days - if($class != '' ) - $class = 'class="'.$class.'"'; - else - $class = $event_class; - - //To display month dates - if ($cal['slice']->start_time->getMonth() == $cal['calendar']->date_time->getMonth()) - { - $minical .= ""; - } - else - { - $minical .= ""; - } - $count++; - } - $minical .= ''; - } - - $minical .= "
 ".get_previous_cal($cal)." "; - $minical .= "date_time->get_date_str()."&parenttab=".$category."'>".display_date($cal['view'],$cal['calendar']->date_time)." ".get_next_cal($cal)." -
Week'.$weekday.'
start_time->get_date_str()."&parenttab=".$category."'>".$cal['slice']->start_time->week.""; - $minical .= "getView()."".$cal['slice']->start_time->get_date_str()."&parenttab=".$category."'>"; - $minical .= $cal['slice']->start_time->get_Date()."
"; - echo $minical; - $cal_log->debug("Exiting get_mini_calendar() method..."); -} - -/** - * Function creates HTML to display Calendar Header and its Links - * @param array $header - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means Events ListView.if 'hourview' means Events HourView. if empty means get Todos ListView - * @param string $subtab - string 'todo' or 'event'. if 'todo' means Todos View else Events View - */ -function get_cal_header_tab(& $header,$viewBox,$subtab) -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_cal_header_tab() method..."); - $tabhtml = ""; - $count = 1; - include_once 'modules/Calendar/addEventUI.php'; - include_once 'modules/Calendar/header.php'; - $eventlabel = $mod_strings['LBL_EVENTS']; - $todolabel = $mod_strings['LBL_TODOS']; - $div = " - -
- "; - echo $div; - $tabhtml .= ""; - $links = array ('day','week','month','year'); - //To differentiate the selected link from unselected links - foreach ($links as $link) - { - if ($header['view'] == $link) - { - $class = 'calSel'; - $anchor = $mod_strings["LBL_".$header['calendar']->getCalendarView($link)]; - } - else - { - $class = 'calUnSel'; - $anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>".$mod_strings["LBL_".$header['calendar']->getCalendarView($link)].""; - } - - if($count == 1) - $tabhtml .= ""; - else - $tabhtml .= ""; - $count++; - } - //To get Navigation(next&previous) links and display Date info - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - echo $tabhtml; - $cal_log->debug("Exiting get_cal_header_tab() method..."); -} - -/** - * Function creates HTML to display number of Events, Todos and pending list in calendar under header(Eg:Total Events : 5, 2 Pending / Total To Dos: 4, 1 Pending) - * @param array $cal_arr - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview'. if 'listview' means Events ListView.if 'hourview' means Events HourView. - */ -function get_cal_header_data(& $cal_arr,$viewBox,$subtab) -{ - global $mod_strings,$cal_log; - $cal_log->debug("Entering get_cal_header_data() method..."); - global $current_user,$app_strings; - $date_format = $current_user->date_format; - $format = $cal_arr['calendar']->hour_format; - $hour_startat = convertTime2UserSelectedFmt($format,$cal_arr['calendar']->day_start_hour,false); - $hour_endat = convertTime2UserSelectedFmt($format,($cal_arr['calendar']->day_start_hour+1),false); - $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); - $temp_ts = $cal_arr['calendar']->date_time->ts; - //To get date in user selected format - $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - $headerdata = ""; - $headerdata .=" -
- -
".$anchor."".$anchor." - - - "; - $tabhtml .= ""; - $tabhtml .= " -
".get_previous_cal($header,$viewBox,$subtab)." - ".display_date($header['view'],$header['calendar']->date_time)."".get_next_cal($header,$viewBox,$subtab)." -
-
view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."btnL3Calendar.gif' alt='".$mod_strings['LBL_OPENCAL']."...' title='".$mod_strings['LBL_OPENCAL']."...' align='absmiddle' border='0'>view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."tbarSettings.gif' alt='".$mod_strings['LBL_SETTINGS']."' title='".$mod_strings['LBL_SETTINGS']."' align='absmiddle' border='0'>".$app_strings[Calendar]."
- "; - if(isPermitted("Calendar","EditView") == "yes") - { - $headerdata .=" - "; - } - else - { - $headerdata .=""; - } - $headerdata .=" - - -
 
-
- ".$mod_strings['LBL_ADD']." - -
 "; - $headerdata .= getEventTodoInfo($cal_arr,'listcnt'); - $headerdata .= "
".$mod_strings['LBL_VIEW']." : "; - $view_options = getEventViewOption($cal_arr,$viewBox); - $headerdata .=$view_options."
-
"; - echo $headerdata; - $cal_log->debug("Exiting get_cal_header_data() method..."); -} - -/** - * Function creates HTML select statement to display View selection box - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview'. if 'listview' means get Events ListView.if 'hourview' means get Events HourView. - * return string $view - html selection box - */ -function getEventViewOption(& $cal,$viewBox) -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - if($viewBox == 'listview') - { - $list_sel = 'selected'; - $hr_sel = ''; - } - else - { - $list_sel = ''; - $hr_sel = 'selected'; - } - $cal_log->debug("Entering getEventViewOption() method..."); - $view = "view."'> - date_time->hour."'> - date_time->day."'> - date_time->week."'> - date_time->month."'> - date_time->year."'> - - - - - - - - "; - $cal_log->debug("Exiting getEventViewOption() method..."); - return $view; -} - -/** - * Function creates HTML anchor tag to get previous-day/week/month/year view - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means previous link in Events ListView.if 'hourview' means previous link in Events HourView. if empty means previous link in Todos ListView - * @param string $subtab - string 'todo' or 'event' or may be empty. if 'todo' means Todos View. if 'event' means Events View. if empty means small calendar view. - * return string $link - html tags in string format - */ -function get_previous_cal(& $cal,$viewBox='',$subtab='') -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_previous_cal() method..."); - if(isset($cal['size']) && $cal['size'] == 'small') - { - $link = "view."".$cal['calendar']->get_datechange_info('prev')."&parenttab=".$category."\")'>"; - } - else - { - $link = "view."".$cal['calendar']->get_datechange_info('prev')."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>"; - } - $cal_log->debug("Exiting get_previous_cal() method..."); - return $link; -} - -/** - * Function creates HTML anchor tag to get next-day/week/month/year view - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means next link in Events ListView.if 'hourview' means next link in Events HourView. if empty means next link in Todos ListView - * @param string $subtab - string 'todo' or 'event' or may be empty. if 'todo' means Todos View. if 'event' means Events View. if empty means small calendar view. - * return string $link - html tags in string format - */ -function get_next_cal(& $cal,$viewBox='',$subtab='') -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_next_cal() method..."); - if(isset($cal['size']) && $cal['size'] == 'small') - { - $link = "view."".$cal['calendar']->get_datechange_info('next')."&parenttab=".$category."\")' >"; - } - else - { - $link = "view."".$cal['calendar']->get_datechange_info('next')."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>"; - } - $cal_log->debug("Exiting get_next_cal() method..."); - return $link; - -} - -/** - * Function to get date info depending upon on the calendar view(Eg: 21 July 2000) - * @param string $view - calendar view(day/week/month/year) - * @param array $date_time - contains DateTime object - * return string $label - date info(Eg for dayview : 13 July 2000) - */ -function display_date($view,$date_time) -{ - global $cal_log; - $cal_log->debug("Entering display_date() method..."); - if ($view == 'day') - { - //$label = $date_time->getdayofWeek()." "; - $label = $date_time->get_Date()." "; - $label .= $date_time->getmonthName()." "; - $label .= $date_time->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - elseif ($view == 'week') - { - $week_start = $date_time->getThisweekDaysbyIndex(0); - $week_end = $date_time->getThisweekDaysbyIndex(6); - $label = $week_start->get_Date()." "; - $label .= $week_start->getmonthName()." "; - $label .= $week_start->year; - $label .= " - "; - $label .= $week_end->get_Date()." "; - $label .= $week_end->getmonthName()." "; - $label .= $week_end->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - - elseif ($view == 'month') - { - $label = $date_time->getmonthName()." "; - $label .= $date_time->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - elseif ($view == 'year') - { - $cal_log->debug("Exiting display_date() method..."); - return $date_time->year; - } - -} -/** - * Function to get css class name for date - * @param string $slice_date - date - * returns string - css class name or empty string - */ -function dateCheck($slice_date) -{ - global $cal_log; - $cal_log->debug("Entering dateCheck() method..."); - $today = date('Y-m-d'); - if($today == $slice_date) - { - $cal_log->debug("Exiting dateCheck() method..."); - //css class for day having event(s) - return 'currDay'; - } - else - { - $cal_log->debug("Exiting dateCheck() method..."); - return ''; - } -} - -/** - * Function to construct respective calendar layout depends on the calendar view - * @param array $view - collection of objects and strings - */ -function getHourView(& $view) -{ - global $cal_log; - $hourview_layout = ''; - $cal_log->debug("Entering getHourView() method..."); - $hourview_layout .= '
-
'; - - if($view['view'] == 'day') - $hourview_layout .= getDayViewLayout($view); - elseif($view['view'] == 'week') - $hourview_layout .= getWeekViewLayout($view); - elseif($view['view'] == 'month') - $hourview_layout .= getMonthViewLayout($view); - elseif($view['view'] == 'year') - $hourview_layout .= getYearViewLayout($view); - else - die("view:".$view['view']." is not defined"); - - $hourview_layout .= '
- '; - $hourview_layout .= '
- - - - - - - - -
'; - echo $hourview_layout; - $cal_log->debug("Exiting getHourView() method..."); -} - -/** - * Fuction constructs Events ListView depends on the view - * @param array $cal - collection of objects and strings - * @param string $mode - string 'listcnt' or empty. if empty means get Events ListView else get total no. of events and no. of pending events Info. - * returns string $activity_list - total no. of events and no. of pending events Info(Eg: Total Events : 2, 1 Pending). - */ -function getEventListView(& $cal,$mode='') -{ - global $cal_log; - $list_view = ""; - $cal_log->debug("Entering getEventListView() method..."); - if($cal['calendar']->view == 'day') - { - $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date(); - } - elseif($cal['calendar']->view == 'week') - { - $start_date = $cal['calendar']->slices[0]; - $end_date = $cal['calendar']->slices[6]; - } - elseif($cal['calendar']->view == 'month') - { - $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0); - $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - elseif($cal['calendar']->view == 'year') - { - $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0); - $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment'); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - else - { - die("view:".$cal['calendar']->view." is not defined"); - } - //if $mode value is empty means get Events list in array format else get the count of total events and pending events in array format. - $activity_list = getEventList($cal, $start_date, $end_date,$mode); - if($mode != '') - { - $cal_log->debug("Exiting getEventListView() method..."); - return $activity_list; - } - //To get Events listView - $list_view .="
"; - $list_view .=constructEventListView($cal,$activity_list); - $list_view .="
- "; - $list_view .="
- - - - - - - - -
"; - echo $list_view; - $cal_log->debug("Exiting getEventListView() method..."); -} - - -/** - * Fuction constructs Todos ListView depends on the view - * @param array $cal - collection of objects and strings - * @param string $check - string 'listcnt' or empty. if empty means get Todos ListView else get total no. of Todos and no. of pending todos Info. - * returns string $todo_list - total no. of todos and no. of pending todos Info(Eg: Total Todos : 2, 1 Pending). - */ -function getTodosListView($cal, $check='',$subtab='') -{ - global $cal_log; - $list_view = ""; - $cal_log->debug("Entering getTodosListView() method..."); - if($cal['calendar']->view == 'day') - { - $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date(); - } - elseif($cal['calendar']->view == 'week') - { - $start_date = $cal['calendar']->slices[0]; - $end_date = $cal['calendar']->slices[6]; - } - elseif($cal['calendar']->view == 'month') - { - $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0); - $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - elseif($cal['calendar']->view == 'year') - { - $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0); - $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment'); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - else - { - die("view:".$cal['calendar']->view." is not defined"); - } - //if $check value is empty means get Todos list in array format else get the count of total todos and pending todos in array format. - $todo_list = getTodoList($cal, $start_date, $end_date,$check); - if($check != '') - { - $cal_log->debug("Exiting getTodosListView() method..."); - return $todo_list; - } - $cal_log->debug("Exiting getTodosListView() method..."); - $list_view .="
"; - //To get Todos listView - $list_view .= constructTodoListView($todo_list,$cal,$subtab); - $list_view .="
- - - - - - - - - - "; - echo $list_view; -} - -/** - * Function creates HTML to display Calendar DayView - * @param array $cal - collections of objects and strings. - * return string $dayview_layout - html tags in string format - */ -function getDayViewLayout(& $cal) -{ - //echo '
';print_r($cal);echo '
'; - global $current_user,$app_strings,$cal_log,$adb; - $no_of_rows = 1; - $cal_log->debug("Entering getDayViewLayout() method..."); - $shared_ids = getSharedCalendarId($current_user->id); - $user_details = getAllUserName(); - $usersid = $current_user->id.','.$shared_ids; - $userid_arr = explode(",",$usersid); - $date_format = $current_user->date_format; - $day_start_hour = $cal['calendar']->day_start_hour; - $day_end_hour = $cal['calendar']->day_end_hour; - $format = $cal['calendar']->hour_format; - $dayview_layout = ''; - $dayview_layout .= ' '; - $dayview_layout .= ' -
- '; - for($j=0;$j<24;$j++) - { - $slice = $cal['calendar']->slices[$j]; - $act = $cal['calendar']->day_slice[$slice]->activities; - if(!empty($act)) - { - $temprows = count($act); - $no_of_rows = ($no_of_rows>$temprows)?$no_of_rows:$temprows; - } - } - for($i=$day_start_hour;$i<=$day_end_hour;$i++) - { - - if($cal['calendar']->hour_format == 'am/pm') - { - if($i == 12) - { - $hour = $i; - $sub_str = 'pm'; - } - elseif($i>12) - { - $hour = $i - 12; - $sub_str = 'pm'; - } - else - { - if($i == 0) - $hour = 12; - else - $hour = $i; - $sub_str = 'am'; - } - - } - else - { - $hour = $i; - if($hour <= 9 && strlen(trim($hour)) < 2) - $hour = "0".$hour; - $sub_str = ':00'; - } - $y = $i+1; - $hour_startat = convertTime2UserSelectedFmt($format,$i,false); - $hour_endat = convertTime2UserSelectedFmt($format,$y,false); - $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); - $temp_ts = $cal['calendar']->date_time->ts; - $sttemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - if($i != 23) - { - $endtemp_date = $sttemp_date; - } - else - { - $addday = $temp_ts + (1 * 24 * 60 * 60); - $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$addday)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$addday)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $addday)):('')))); - } - - $js_string = ""; - if(isPermitted("Calendar","EditView") == "yes") - $js_string = 'onClick="fnvshobj(this,\'addEvent\'); gshow(\'addEvent\',\'call\',\''.$sttemp_date.'\',\''.$endtemp_date.'\',\''.$time_arr['starthour'].'\',\''.$time_arr['startmin'].'\',\''.$time_arr['startfmt'].'\',\''.$time_arr['endhour'].'\',\''.$time_arr['endmin'].'\',\''.$time_arr['endfmt'].'\',\'hourview\',\'event\')"'; - $dayview_layout .= ' - '; - //To display events in Dayview - $dayview_layout .= getdayEventLayer($cal,$cal['calendar']->slices[$i],$no_of_rows); - $dayview_layout .= ''; - } - $dayview_layout .= '
'.$hour.''.$sub_str.'
-
'; - $cal_log->debug("Exiting getDayViewLayout() method..."); - return $dayview_layout; -} - -/** - * Function creates HTML to display Calendar WeekView - * @param array $cal - collections of objects and strings From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 05:32:47 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 10:32:47 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9830 - in /vtigercrm/branches/5.0.3/modules/Emails: DetailView.php EditView.php Message-ID: <20061114103247.89EBD787F17@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 03:32:41 2006 New Revision: 9830 Log: Language support added for header. Fixes #2584 Modified: vtigercrm/branches/5.0.3/modules/Emails/DetailView.php vtigercrm/branches/5.0.3/modules/Emails/EditView.php Modified: vtigercrm/branches/5.0.3/modules/Emails/DetailView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Emails/DetailView.php (original) +++ vtigercrm/branches/5.0.3/modules/Emails/DetailView.php Tue Nov 14 03:32:41 2006 @@ -132,7 +132,8 @@ $entries = getBlocks($currentModule,"detail_view",'',$focus->column_fields); $entries['Email Information']['4']['Description']['value'] = from_html($entries['Email Information']['4']['Description']['value']); -$smarty->assign("BLOCKS", $entries['Email Information']); +//changed this to view description in all langauge - bharath +$smarty->assign("BLOCKS",$entries[$mod_strings['LBL_EMAIL_INFORMATION']]); $smarty->assign("SINGLE_MOD", 'Email'); $smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); Modified: vtigercrm/branches/5.0.3/modules/Emails/EditView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Emails/EditView.php (original) +++ vtigercrm/branches/5.0.3/modules/Emails/EditView.php Tue Nov 14 03:32:41 2006 @@ -163,7 +163,8 @@ $disp_view = getView($focus->mode); $details = getBlocks($currentModule,$disp_view,$mode,$focus->column_fields); -$smarty->assign("BLOCKS",$details['Email Information']); +//changed this below line to view description in all language - bharath +$smarty->assign("BLOCKS",$details[$mod_strings['LBL_EMAIL_INFORMATION']]); $smarty->assign("MODULE",$currentModule); $smarty->assign("SINGLE_MOD",$app_strings['Email']); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 06:36:43 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 11:36:43 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9831 - /customerportal/trunk/login.php Message-ID: <20061114113644.1838A7893C2@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 04:36:40 2006 New Revision: 9831 Log: * Added form validation, now we will not face apache redirection error Modified: customerportal/trunk/login.php Modified: customerportal/trunk/login.php ============================================================================== --- customerportal/trunk/login.php (original) +++ customerportal/trunk/login.php Tue Nov 14 04:36:40 2006 @@ -21,7 +21,7 @@ if($_REQUEST['close_window'] == 'true') { ?> - Email ID : - + Password : - +   - + @@ -131,5 +131,40 @@ + + From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 07:21:44 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 12:21:44 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9832 - /vtigercrm/branches/5.0.3/include/language/en_us.lang.php Message-ID: <20061114122144.BC7A27893BB@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 05:21:25 2006 New Revision: 9832 Log: Changes done for the generic module addition --By Don Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/include/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/include/language/en_us.lang.php Tue Nov 14 05:21:25 2006 @@ -635,31 +635,9 @@ 'Expected Response' => 'Expected Response', 'LBL_ADDRESS_INF' => 'Address Information', 'yes' => 'yes', - 'don' => 'don', - 'nayanthara' => 'nayanthara', - 'LNK_NEW_DON' => 'New don', - 'patient' => 'patient', - 'medical' => 'medical', - 'LNK_NEW_PATIENT' => 'New patient', - 'cars' => 'cars', - 'automobile' => 'automobile', - 'LNK_NEW_CARS' => 'New cars', - 'king' => 'king', - 'LNK_NEW_KING' => 'New king', - 'Forests' => 'Forests', - 'Congo' => 'Congo', - 'LNK_NEW_FORESTS' => 'New Forests', - 'rock' => 'rock', - 'Solid' => 'Solid', - 'LNK_NEW_ROCK' => 'New rock', - 'lexus' => 'lexus', - 'toyota' => 'toyota', - 'LNK_NEW_LEXUS' => 'New lexus', - 'medicine' => 'medicine', - 'Indica' => 'Indica', - 'Tata' => 'Tata', - 'SINGLE_Indica' => 'Indica', -);$app_list_strings = array ( +); + +$app_list_strings = array ( 'moduleList' => array ( 'Home' => 'Home', From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 08:02:06 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 13:02:06 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9833 - /vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Message-ID: <20061114130206.526A1787FC1@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 06:01:58 2006 New Revision: 9833 Log: Made changes for module Addition -- By Jeri Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Tue Nov 14 06:01:58 2006 @@ -1070,26 +1070,29 @@ $log->debug("Exiting getBlocks method ..."); $index_count =1; $max_index =0; - foreach($getBlockInfo as $label=>$contents) - { + if(count($getBlockInfo) > 0) + { + foreach($getBlockInfo as $label=>$contents) + { $no_rows = count($contents); $index_count = $max_index+1; - foreach($contents as $block_row => $elements) - { - $max_index= $no_rows+$index_count; - - for($i=0;$i $elements) + { + $max_index= $no_rows+$index_count; + + for($i=0;$i Author: richie Date: Tue Nov 14 06:05:51 2006 New Revision: 9834 Log: Made changes for module Addition -- By Jeri Modified: vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/CreateView.tpl Tue Nov 14 06:05:51 2006 @@ -77,7 +77,7 @@   - {if $MODULE eq 'Leads' || $MODULE eq 'Accounts' || $MODULE eq 'Contacts' || $MODULE eq 'Products'} + {if $ADVBLOCKS neq ''} {$APP.LBL_BASIC} {$APP.LBL_INFORMATION} {$APP.LBL_MORE} {$APP.LBL_INFORMATION}   From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 08:38:38 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 13:38:38 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9835 - in /customerportal/trunk: header.html index.php js/general.js Message-ID: <20061114133838.85B247893C2@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 06:38:32 2006 New Revision: 9835 Log: * Changed the tab highlighting code to simplify the process Modified: customerportal/trunk/header.html customerportal/trunk/index.php customerportal/trunk/js/general.js Modified: customerportal/trunk/header.html ============================================================================== --- customerportal/trunk/header.html (original) +++ customerportal/trunk/header.html Tue Nov 14 06:38:32 2006 @@ -63,8 +63,8 @@   - My Tickets - FAQ + My Tickets + FAQ   Modified: customerportal/trunk/index.php ============================================================================== --- customerportal/trunk/index.php (original) +++ customerportal/trunk/index.php Tue Nov 14 06:38:32 2006 @@ -96,19 +96,22 @@ Modified: customerportal/trunk/js/general.js ============================================================================== --- customerportal/trunk/js/general.js (original) +++ customerportal/trunk/js/general.js Tue Nov 14 06:38:32 2006 @@ -1,17 +1,19 @@ // JavaScript Document -function fnLoadValues(obj1,obj2){ - - var tabName1 = document.getElementById(obj1); - var tabName2 = document.getElementById(obj2); - if(tabName1.className == "dvtUnSelectedCell") - tabName1.className = "dvtSelectedCell"; - if(tabName2.className == "dvtSelectedCell") - tabName2.className = "dvtUnSelectedCell"; - if(obj1 == 'mi') - window.location.href = "index.php?module=Faq&action=index"; - else if(obj1 == 'pi') - window.location.href = "index.php"; +function fnLoadValues(obj){ + + /* + var tabArray = Array("Tickets","Faq"); + + for(var i=0;i<2;i++) + { + if(tabArray[i].indexOf(obj) > -1) + document.getElementById(tabArray[i]).className = "dvtSelectedCell"; + else + document.getElementById(tabArray[i]).className = "dvtUnSelectedCell"; + } + */ + window.location.href = "index.php?module="+obj+"&action=index"; } function fnDown(obj){ From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 14 09:11:17 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 14 Nov 2006 14:11:17 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9836 - in /vtigercrm/branches/5.0.3: Smarty/templates/pendingActivities.tpl Smarty/templates/upcomingActivities.tpl modules/Calendar/Save.php modules/Calendar/language/en_us.lang.php Message-ID: <20061114141117.59F357893F9@vtiger.fosslabs.com> Author: richie Date: Tue Nov 14 07:11:09 2006 New Revision: 9836 Log: language support added for invitees mail in calendar Modified: vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl vtigercrm/branches/5.0.3/Smarty/templates/upcomingActivities.tpl vtigercrm/branches/5.0.3/modules/Calendar/Save.php vtigercrm/branches/5.0.3/modules/Calendar/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/pendingActivities.tpl Tue Nov 14 07:11:09 2006 @@ -9,19 +9,36 @@ * ********************************************************************************/ -->*} -{if $ACTIVITIES.1.noofactivities > 0} -{assign var=label value=$ACTIVITIES.1.Title.0} +{if $ACTIVITIES.2.noofactivities > 0 || $ACTIVITIES.3.noofactivities > 0} + + +
+{assign var=label value=$ACTIVITIES.2.Title.0} @@ -33,7 +50,47 @@ - {foreach item=entries name=entryloop from=$ACTIVITIES.1.Entries} + {if $ACTIVITIES.2.noofactivities != 0} + {foreach item=entries name=entryloop from=$ACTIVITIES.2.Entries} + + + + + + {/foreach} + {else} + + + + {/if} +
- {$APP.$label} {$APP.LBL_PENDING_EVENTS} ({$ACTIVITIES.1.noofactivities})
+ {$APP.$label} {$APP.LBL_PENDING_EVENTS} ({$ACTIVITIES.2.noofactivities})
{$APP.LBL_SHOW} - {if $ACTIVITIES.1.Title.0 eq 'today'} - {$APP.LBL_TODAY}  |  {$APP.LBL_ALL} - {else} - {$APP.LBL_TODAY}  |  {$APP.LBL_ALL} - {/if} + {$APP.LBL_TODAY}  |  {$APP.LBL_ALL}
 
{math equation="x+1" x=$smarty.foreach.entryloop.index}{$entries.IMAGE}{$entries.0}{*
{$entries.ACCOUNT_NAME*}
{$APP.LBL_NONE_SCHEDULED}
+
+ + + +
+ + + - - - - - +{**} + + +
+ + + + + +
+
+ +
+ {include file='SetMenu.tpl'} + + + + + + + + + + + + + + + + +
{$MOD.LBL_SETTINGS} > {$CMOD.LBL_ROLES} > {$CMOD.LBL_VIEWING} "{$ROLE_NAME}"
{$CMOD.LBL_VIEWING} {$CMOD.LBL_PROPERTIES} "{$ROLE_NAME}" {$MOD.LBL_LIST_CONTACT_ROLE}
+ +
+ + + + +
+ + + + + + +
{$CMOD.LBL_PROPERTIES} "{$ROLE_NAME}"
+ +
+ + + + + + + + + + + + + +
{$CMOD.LBL_ROLE_NAME}{$ROLE_NAME}
{$CMOD.LBL_REPORTS_TO}{$PARENTNAME}
{$CMOD.LBL_MEMBER} + + + + + {foreach item=elements from=$ROLEINFO.profileinfo} + + + + + + {/foreach} + + + + {if $ROLEINFO.userinfo.0 neq ''} + {foreach item=elements from=$ROLEINFO.userinfo} + + + + + + {/foreach} + {/if} +
+
{$CMOD.LBL_ASSOCIATED_PROFILES}
+
+ {$elements.1}
+
+
{$CMOD.LBL_ASSOCIATED_USERS}
+
+ {$elements.1}
+
+
+ + +
{$MOD.LBL_SCROLL}
+ + +
+ + + +
+ + + + + + + + + + + Modified: vtigercrm/branches/5.0.3/Smarty/templates/SetMenu.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/SetMenu.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/SetMenu.tpl Thu Nov 23 08:23:17 2006 @@ -30,9 +30,9 @@ {/if} {if $smarty.request.action eq 'listroles' || $smarty.request.action eq 'RoleDetailView' || $smarty.request.action eq 'saverole' || $smarty.request.action eq 'createrole' || $smarty.request.action eq 'RoleDeleteStep1'} - {$MOD.LBL_ROLES} + {$MOD.LBL_ROLES} {else} - {$MOD.LBL_ROLES} + {$MOD.LBL_ROLES} {/if} {if $smarty.request.action eq 'ListProfiles' || $smarty.request.action eq 'profilePrivileges' || $smarty.request.action eq 'CreateProfile' || $smarty.request.action eq 'SaveProfile' || $smarty.request.action eq 'UpdateProfileChanges' } Modified: vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/modules/Settings/language/en_us.lang.php Thu Nov 23 08:23:17 2006 @@ -725,6 +725,20 @@ 'LBL_ENABLE'=>'Enable', 'LBL_FAQ_FIELD_ACCESS'=>'Faq Field Access', 'LBL_ADD_TAX_BUTTON'=>'Add Tax', +//Added while moving role file from User to Setting Module +'LBL_ROLES'=>'Roles', +'LBL_CREATE_NEW_ROLE'=>'Create New Role', +'LBL_PROPERTIES'=>'Properties of', +'LBL_NEW_ROLE'=>'New Role', +'LBL_ROLE_NAME'=>'Role Name', +'LBL_REPORTS_TO'=>'Reports to', +'LBL_PROFILE_M'=>'Profile', +'LBL_PROFILES_AVLBL'=>'Profiles Available', +'LBL_ASSIGN_PROFILES'=>'Assigned Profiles', +'LBL_MEMBER'=>'Members', +'LBL_DELETE_ROLE'=>'Delete Role', +'LBL_ROLE_TO_BE_DELETED'=>'Role to be Deleted', +'LBL_TRANSFER_USER_ROLE'=>'Transfer Users to Role', ); Modified: vtigercrm/branches/5.0.3/modules/Users/DeleteRole.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/DeleteRole.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/DeleteRole.php Thu Nov 23 08:23:17 2006 @@ -15,5 +15,5 @@ deleteRole($del_id,$tran_id); -header("Location: index.php?action=listroles&module=Users"); +header("Location: index.php?action=listroles&module=Settings"); ?> From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 23 10:28:14 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 23 Nov 2006 15:28:14 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9902 - /vtigercrm/branches/5.0.3/index.php Message-ID: <20061123152815.176AD7895FC@vtiger.fosslabs.com> Author: richie Date: Thu Nov 23 08:28:11 2006 New Revision: 9902 Log: version changed to 5.0.3 Modified: vtigercrm/branches/5.0.3/index.php Modified: vtigercrm/branches/5.0.3/index.php ============================================================================== --- vtigercrm/branches/5.0.3/index.php (original) +++ vtigercrm/branches/5.0.3/index.php Thu Nov 23 08:28:11 2006 @@ -643,7 +643,7 @@ echo ""; echo ''; echo "


"; - echo ""; + echo ""; echo "
vtiger CRM 5.0.2 | Visit www.vtiger.com for more information
vtiger CRM 5.0.3 | Visit www.vtiger.com for more information © Copyright Details
"; // echo "'; + $listview_entries[$num][] = ''; else - $listview_entries[$num][] = ''; + $listview_entries[$num][] = ''; return $listview_entries[$num]; } Modified: vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php Thu Nov 23 08:32:31 2006 @@ -114,7 +114,7 @@ } function downloadAttachments() { - return $this->dl_attachments($this->mailid,$this->mbox); + return $this->dl_attachments(); } function load_headers() { @@ -146,7 +146,7 @@ } private function get_attachments() { - $struct = imap_fetchstructure($this->mbox, $this->mailid); + $struct = @imap_fetchstructure($this->mbox, $this->mailid); $parts = $struct->parts; $done="false"; @@ -217,177 +217,361 @@ return 0; } - private function dl_inline() { - $struct = imap_fetchstructure($this->mbox, $this->mailid); - $parts = $struct->parts; - - $i = 0; - if (!$parts) - return; - else { - - $stack = array(); - $inline = array(); - - $endwhile = false; - - while (!$endwhile) { - if (!$parts[$i]) { - if (count($stack) > 0) { - $parts = $stack[count($stack)-1]["p"]; - $i = $stack[count($stack)-1]["i"] + 1; - array_pop($stack); - } else { - $endwhile = true; - } - } - if (!$endwhile) { - - $partstring = ""; - foreach ($stack as $s) { - $partstring .= ($s["i"]+1) . "."; - } - $partstring .= ($i+1); - - if (strtoupper($parts[$i]->disposition) == "INLINE") - $inline[] = array("filename" => $parts[$i]->dparameters[0]->value,"filedata"=>imap_fetchbody($this->mbox, $this->mailid, $partstring),"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); - } - if ($parts[$i]->parts) { - $stack[] = array("p" => $parts, "i" => $i); - $parts = $parts[$i]->parts; - $i = 0; - } else { - $i++; - } - } - } - return $inline; - } - - private function dl_attachments() { - $struct = imap_fetchstructure($this->mbox, $this->mailid); - $parts = $struct->parts; - - $content = array(); - $i = 0; - if (!$parts) - return; - else { - - $stack = array(); - $attachment = array(); - - $endwhile = false; - - while (!$endwhile) { - if (!$parts[$i]) { - if (count($stack) > 0) { - $parts = $stack[count($stack)-1]["p"]; - $i = $stack[count($stack)-1]["i"] + 1; - array_pop($stack); - } else { - $endwhile = true; - } - } - if (!$endwhile) { - - $partstring = ""; - foreach ($stack as $s) { - $partstring .= ($s["i"]+1) . "."; - } - $partstring .= ($i+1); - - if (strtoupper($parts[$i]->disposition) == "ATTACHMENT") - $attachment[] = array("filename" => $parts[$i]->dparameters[0]->value,"filedata"=>imap_fetchbody($this->mbox, $this->mailid, $partstring),"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); - } - if ($parts[$i]->parts) { - $stack[] = array("p" => $parts, "i" => $i); - $parts = $parts[$i]->parts; - $i = 0; - } else { - $i++; - } - } - } - return $attachment; - } - private function load_mail() { - // parse the message - $struct = imap_fetchstructure($this->mbox, $this->mailid); - $parts = $struct->parts; - - $content = array(); - $i = 0; - if (!$parts) { /* Simple message, only 1 piece */ - $attachment = array(); /* No vtiger_attachments */ - $bod=imap_body($this->mbox, $this->mailid); - if(preg_match("/\/",$bod)) - $content['body'] = $bod; - else - $content['body'] = nl2br($bod); - } else { - - $stack = array(); - $attachment = array(); - - $endwhile = false; - - while (!$endwhile) { - if (!$parts[$i]) { - if (count($stack) > 0) { - $parts = $stack[count($stack)-1]["p"]; - $i = $stack[count($stack)-1]["i"] + 1; - array_pop($stack); - } else { - $endwhile = true; - } - } - $search = array("/=20=/","/=20/","/=\r\n/","/=3D/","@&(disposition) == "INLINE" && strtoupper($parts[$i]->subtype) != "PLAIN") { - $inline[] = array("filename" => $parts[$i]->dparameters[0]->value,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); - } elseif (strtoupper($parts[$i]->disposition) == "ATTACHMENT") { - $attachment[] = array("filename" => $parts[$i]->dparameters[0]->value,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); - - } elseif (strtoupper($parts[$i]->subtype) == "HTML") { - $content['body'] = preg_replace($search,$replace,imap_fetchbody($this->mbox, $this->mailid, $partstring)); - $stat="done"; - } elseif (strtoupper($parts[$i]->subtype) == "TEXT" && !$stat == "done") { - $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); - $stat="done"; - } elseif (strtoupper($parts[$i]->subtype) == "PLAIN" && !$stat == "done") { - $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); - $stat="done"; - } elseif (!$stat == "done") { - $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); - } - } - - if ($parts[$i]->parts) { - $stack[] = array("p" => $parts, "i" => $i); - $parts = $parts[$i]->parts; - $i = 0; - } else { - $i++; - } - } - } - if($struct->encoding==3) - $content['body'] = base64_decode($content['body']); - if($struct->encoding==4) - $content['body'] = quoted_printable_decode($content['body']); - - $ret = Array("content" => $content,"attachments"=>$attachment,"inline"=>$inline); - return $ret; - } + + private function dl_inline() + { + $struct = imap_fetchstructure($this->mbox, $this->mailid); + $parts = $struct->parts; + + $i = 0; + if (!$parts) + return; + else + { + $stack = array(); + $inline = array(); + + $endwhile = false; + + while (!$endwhile) + { + if (!$parts[$i]) + { + if (count($stack) > 0) + { + $parts = $stack[count($stack)-1]["p"]; + $i = $stack[count($stack)-1]["i"] + 1; + array_pop($stack); + } + else + { + $endwhile = true; + } + } + if (!$endwhile) + { + $partstring = ""; + foreach ($stack as $s) + { + $partstring .= ($s["i"]+1) . "."; + } + $partstring .= ($i+1); + + if (strtoupper($parts[$i]->disposition) == "INLINE") + { + //if the type is JPEG or GIF then call mail_fetchpart else fetchbody + if($parts[$i]->subtype == "JPEG" || $parts[$i]->subtype == "GIF") + $filedata = $this->mail_fetchpart($partstring); + else + $filedata = imap_fetchbody($this->mbox, $this->mailid, $partstring); + + $inline[] = array("filename" => $parts[$i]->dparameters[0]->value,"filedata"=>$filedata,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); + } + } + if ($parts[$i]->parts) + { + $stack[] = array("p" => $parts, "i" => $i); + $parts = $parts[$i]->parts; + $i = 0; + } + else + { + $i++; + } + } + } + return $inline; + } + + private function dl_attachments() + { + + $struct = imap_fetchstructure($this->mbox, $this->mailid); + $parts = $struct->parts; + + $i = 0; + if (!$parts) + return; + else + { + $stack = array(); + $attachment = array(); + + $endwhile = false; + + while (!$endwhile) + { + if (!$parts[$i]) + { + if (count($stack) > 0) + { + $parts = $stack[count($stack)-1]["p"]; + $i = $stack[count($stack)-1]["i"] + 1; + array_pop($stack); + } + else + { + $endwhile = true; + } + } + if (!$endwhile) + { + $partstring = ""; + foreach ($stack as $s) + { + $partstring .= ($s["i"]+1) . "."; + } + $partstring .= ($i+1); + + if (strtoupper($parts[$i]->disposition) == "ATTACHMENT") + { + $filedata = $this->mail_fetchpart($partstring); + $attachment[] = array("filename" => $parts[$i]->dparameters[0]->value,"filedata"=>$filedata,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); + } + } + if ($parts[$i]->parts) + { + $stack[] = array("p" => $parts, "i" => $i); + $parts = $parts[$i]->parts; + $i = 0; + } + else + { + $i++; + } + } + } + return $attachment; + } + + + private function load_mail() + { + // parse the message + $struct = imap_fetchstructure($this->mbox, $this->mailid); + $parts = $struct->parts; + + $content = array(); + $i = 0; + if (!$parts) + { + /* Simple message, only 1 piece */ + $attachment = array(); /* No vtiger_attachments */ + $bod=imap_body($this->mbox, $this->mailid); + if(preg_match("/\/",$bod)) + $content['body'] = $bod; + else + $content['body'] = nl2br($bod); + } + else + { + + $stack = array(); + $attachment = array(); + + $endwhile = false; + + while (!$endwhile) + { + if (!$parts[$i]) + { + if (count($stack) > 0) + { + $parts = $stack[count($stack)-1]["p"]; + $i = $stack[count($stack)-1]["i"] + 1; + array_pop($stack); + } + else + { + $endwhile = true; + } + } + $search = array("/=20=/","/=20/","/=\r\n/","/=3D/","@&(disposition) == "INLINE" && strtoupper($parts[$i]->subtype) != "PLAIN") + { + $inline[] = array("filename" => $parts[$i]->dparameters[0]->value,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); + } + elseif (strtoupper($parts[$i]->disposition) == "ATTACHMENT") + { + $attachment[] = array("filename" => $parts[$i]->dparameters[0]->value,"subtype"=>$parts[$i]->subtype,"filesize"=>$parts[$i]->bytes); + + } + elseif (strtoupper($parts[$i]->subtype) == "HTML") + { + $content['body'] = preg_replace($search,$replace,imap_fetchbody($this->mbox, $this->mailid, $partstring)); + $stat="done"; + } + elseif (strtoupper($parts[$i]->subtype) == "TEXT" && !$stat == "done") + { + $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); + $stat="done"; + } + elseif (strtoupper($parts[$i]->subtype) == "PLAIN" && !$stat == "done") + { + $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); + $stat="done"; + } + elseif (!$stat == "done") + { + $content['body'] = nl2br(imap_fetchbody($this->mbox, $this->mailid, $partstring)); + } + } + + if ($parts[$i]->parts) + { + $stack[] = array("p" => $parts, "i" => $i); + $parts = $parts[$i]->parts; + $i = 0; + } + else + { + $i++; + } + } + } + if($struct->encoding==3) + $content['body'] = base64_decode($content['body']); + if($struct->encoding==4) + $content['body'] = quoted_printable_decode($content['body']); + + $ret = Array("content" => $content,"attachments"=>$attachment,"inline"=>$inline); + return $ret; + } + + + + + + + + // get the body of a part of a message according to the + // string in $part + function mail_fetchpart($part) + { + $parts = $this->mail_fetchparts(); + + $partNos = explode(".", $part); + + $currentPart = $parts; + while(list ($key, $val) = each($partNos)) + { + $currentPart = $currentPart[$val]; + } + + if ($currentPart != "") return $currentPart; + else return false; + } + + // splits a message given in the body if it is + // a mulitpart mime message and returns the parts, + // if no parts are found, returns false + function mail_mimesplit($header, $body) + { + $parts = array(); + + $PN_EREG_BOUNDARY = "Content-Type:(.*)boundary=\"([^\"]+)\""; + + if (eregi ($PN_EREG_BOUNDARY, $header, $regs)) + { + $boundary = $regs[2]; + + $delimiterReg = "([^\r\n]*)$boundary([^\r\n]*)"; + if (eregi ($delimiterReg, $body, $results)) + { + $delimiter = $results[0]; + $parts = explode($delimiter, $body); + $parts = array_slice ($parts, 1, -1); + } + + return $parts; + } + else + { + return false; + } + } + + // returns an array with all parts that are + // subparts of the given part + // if no subparts are found, return the body of + // the current part + function mail_mimesub($part) + { + $i = 1; + $headDelimiter = "\r\n\r\n"; + $delLength = strlen($headDelimiter); + + // get head & body of the current part + $endOfHead = strpos( $part, $headDelimiter); + $head = substr($part, 0, $endOfHead); + $body = substr($part, $endOfHead + $delLength, strlen($part)); + + // check whether it is a message according to rfc822 + if (stristr($head, "Content-Type: message/rfc822")) + { + $part = substr($part, $endOfHead + $delLength, strlen($part)); + $returnParts[1] = $this->mail_mimesub($part); + return $returnParts; + // if no message, get subparts and call function recursively + } + elseif ($subParts = $this->mail_mimesplit($head, $body)) + { + // got more subparts + while (list ($key, $val) = each($subParts)) + { + $returnParts[$i] = $this->mail_mimesub($val); + $i++; + } + return $returnParts; + } + else + { + return $body; + } + } + + // get an array with the bodies all parts of an email + // the structure of the array corresponds to the + // structure that is available with imap_fetchstructure + function mail_fetchparts() + { + $parts = array(); + $header = imap_fetchheader($this->mbox, $this->mailid); + $body = imap_body($this->mbox, $this->mailid, FT_INTERNAL); + + $i = 1; + + if ($newParts = $this->mail_mimesplit($header, $body)) + { + while (list ($key, $val) = each($newParts)) + { + $parts[$i] = $this->mail_mimesub($val); + $i++; + } + } + else + { + $parts[$i] = $body; + } + return $parts; + } + + + + + + } ?> Modified: vtigercrm/branches/5.0.3/modules/Webmails/body.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/body.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/body.php Thu Nov 23 08:32:31 2006 @@ -31,40 +31,54 @@ el.style.display='block'; } -loadMail(); - echo $email->body; - echo "

"; - if(is_array($email->inline)) { - $inline = $email->downloadInlineAttachments(); - $num=sizeof($inline); - echo "

Inline Attachments:

"; - for($i=0;$i<$num;$i++) { - //var_dump($inline[$i]); - // PLAIN TEXT - if($inline[$i]["subtype"] == "RFC822") { - echo ($i+1).") ".$inline[$i]["filename"].""; - } elseif($inline[$i]["subtype"] == "JPEG" || $inline[$i]["subtype"] == "GIF") { - echo ($i+1).") ".$inline[$i]["filename"]."

'; } + else + echo "
".($i+1).") ".$inline[$i]["filename"]."
"; } +} imap_close($MailBox->mbox); + + ?> Modified: vtigercrm/branches/5.0.3/modules/Webmails/dlAttachments.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/dlAttachments.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/dlAttachments.php Thu Nov 23 08:32:31 2006 @@ -1,4 +1,4 @@ -downloadAttachments(); $inline=$email->downloadInlineAttachments(); -if($num == "" || !isset($num) && count($attachments) >0 ) { - echo "
"; From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 23 10:32:40 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 23 Nov 2006 15:32:40 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9903 - in /vtigercrm/branches/5.0.3: index.php modules/Webmails/MailParse.php modules/Webmails/Webmail.php modules/Webmails/body.php modules/Webmails/dlAttachments.php modules/Webmails/webmails.js Message-ID: <20061123153240.13FEF78962F@vtiger.fosslabs.com> Author: richie Date: Thu Nov 23 08:32:31 2006 New Revision: 9903 Log: * Modified to fix some issues include attachment issues - Mickie Modified: vtigercrm/branches/5.0.3/index.php vtigercrm/branches/5.0.3/modules/Webmails/MailParse.php vtigercrm/branches/5.0.3/modules/Webmails/Webmail.php vtigercrm/branches/5.0.3/modules/Webmails/body.php vtigercrm/branches/5.0.3/modules/Webmails/dlAttachments.php vtigercrm/branches/5.0.3/modules/Webmails/webmails.js Modified: vtigercrm/branches/5.0.3/index.php ============================================================================== --- vtigercrm/branches/5.0.3/index.php (original) +++ vtigercrm/branches/5.0.3/index.php Thu Nov 23 08:32:31 2006 @@ -278,10 +278,9 @@ ereg("^HeadLines",$action) || ereg("^TodoSave",$action) || ereg("^RecalculateSharingRules",$action) || - (ereg("^body",$action) && - ereg("^Webmails",$module)) || - (ereg("^DetailView",$action) && - ereg("^Webmails",$module) )) + (ereg("^body",$action) && ereg("^Webmails",$module)) || + (ereg("^dlAttachments",$action) && ereg("^Webmails",$module)) || + (ereg("^DetailView",$action) && ereg("^Webmails",$module) )) { $skipHeaders=true; //skip headers for all these invocations as they are mostly popups Modified: vtigercrm/branches/5.0.3/modules/Webmails/MailParse.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/MailParse.php (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/MailParse.php Thu Nov 23 08:32:31 2006 @@ -87,9 +87,9 @@ } if($mails[$start_message]->deleted) - $listview_entries[$num][] = 'del
del
del
del
"; +if($num == "" || !isset($num) && count($attachments) >0 ) +{ + echo "
There are ".count($attachments)." attachment(s) to choose from:
"; - for($i=0;$i"; + for($i=0;$i"; } echo "
 There are ".count($attachments)." attachment(s) to choose from:
".count($attachments).")   ".$attachments[$i]["filename"]."
    ".($i+1).")   ".$attachments[$i]["filename"]."

"; - echo ""; + echo "
There are ".count($inline)." inline attachment(s) to choose from:
"; - for($i=0;$i"; + for($i=0;$i"; } echo "
 There are ".count($inline)." inline attachment(s) to choose from:
".count($inline).")   ".$inline[$i]["filename"]."
    ".($i+1).")   ".$inline[$i]["filename"]."


"; -} elseif (count(attachments) == 0 && count($inline) == 0) { +} +elseif (count($attachments) == 0 && count($inline) == 0) +{ echo "
No vtiger_attachments for this email


"; -} else { +} +else +{ -global $root_directory; -$save_path=$root_directory.'/modules/Webmails/tmp'; -if(!is_dir($save_path)) - mkdir($save_path); + global $root_directory; + $save_path=$root_directory.'/modules/Webmails/tmp'; + if(!is_dir($save_path)) + mkdir($save_path); -$user_dir=$save_path."/".$_SESSION["authenticated_user_id"]; -if(!is_dir($user_dir)) - mkdir($user_dir); + $user_dir=$save_path."/".$_SESSION["authenticated_user_id"]; + if(!is_dir($user_dir)) + mkdir($user_dir); -if(isset($_REQUEST["inline"]) && $_REQUEST["inline"] == "true") { - $fp = fopen($user_dir.'/'.$inline[$num]["filename"], "w") or die("Can't open file"); - fputs($fp, base64_decode($inline[$num]["filedata"])); - $filename = 'modules/Webmails/tmp/'.$_SESSION['authenticated_user_id'].'/'.$inline[$num]['filename']; -} else { - $fp = fopen($user_dir.'/'.$attachments[$num]["filename"], "w") or die("Can't open file"); - fputs($fp, base64_decode($attachments[$num]["filedata"])); - $filename = 'modules/Webmails/tmp/'.$_SESSION['authenticated_user_id'].'/'.$attachments[$num]['filename']; + if(isset($_REQUEST["inline"]) && $_REQUEST["inline"] == "true") + { + $fp = fopen($user_dir.'/'.$inline[$num]["filename"], "w") or die("Can't open file"); + fputs($fp, base64_decode($inline[$num]["filedata"])); + $filename = 'modules/Webmails/tmp/'.$_SESSION['authenticated_user_id'].'/'.$inline[$num]['filename']; + } + else + { + $fp = fopen($user_dir.'/'.$attachments[$num]["filename"], "w") or die("Can't open file"); + fputs($fp, base64_decode($attachments[$num]["filedata"])); + $filename = 'modules/Webmails/tmp/'.$_SESSION['authenticated_user_id'].'/'.$attachments[$num]['filename']; + } + fclose($fp); + imap_close($MailBox->mbox); + + ?> +

File Download

+ mbox); + ?> -

File Download

- Modified: vtigercrm/branches/5.0.3/modules/Webmails/webmails.js ============================================================================== --- vtigercrm/branches/5.0.3/modules/Webmails/webmails.js (original) +++ vtigercrm/branches/5.0.3/modules/Webmails/webmails.js Thu Nov 23 08:32:31 2006 @@ -336,6 +336,10 @@ if(els[i].type === "checkbox" && els[i].name.indexOf("_")) { if(els[i].checked) { var nid = els[i].name.substr((els[i].name.indexOf("_")+1),els[i].name.length); + + //change the selected rows as red when they deleted + $("row_"+nid).className = "delete_email"; + if(typeof nid == 'undefined' || nid == "checkbox") nids += ''; else From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 06:30:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:30:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9904 - /vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Message-ID: <20061127113037.E21997888F4@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:30:22 2006 New Revision: 9904 Log: added field ownedby in vtiger_tab table Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Modified: vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml ============================================================================== --- vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml (original) +++ vtigercrm/branches/5.0.3/schema/DatabaseSchema.xml Mon Nov 27 04:30:22 2006 @@ -179,7 +179,8 @@ - + + name From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 06:35:35 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:35:35 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9905 - /vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Message-ID: <20061127113535.9841878964E@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:35:26 2006 New Revision: 9905 Log: made changes in vtiger_tab table Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/DefaultDataPopulator.php Mon Nov 27 04:35:26 2006 @@ -52,31 +52,31 @@ $this->db->query("insert into vtiger_role values('H".$role5_id."','Sales Man','H".$role1_id."::H".$role2_id."::H".$role3_id."::H".$role4_id."::H".$role5_id."',4)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (3,'Home',0,1,'Home',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (7,'Leads',0,4,'Leads',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (6,'Accounts',0,5,'Accounts',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (4,'Contacts',0,6,'Contacts',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (2,'Potentials',0,7,'Potentials',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (8,'Notes',0,9,'Notes',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (9,'Calendar',0,3,'Calendar',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (10,'Emails',0,10,'Emails',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (13,'HelpDesk',0,11,'HelpDesk',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (14,'Products',0,8,'Products',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (1,'Dashboard',0,12,'Dashboards',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (15,'Faq',0,14,'Faq',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (16,'Events',2,13,'Events',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (18,'Vendors',0,15,'Vendors',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (19,'PriceBooks',0,16,'PriceBooks',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (20,'Quotes',0,17,'Quotes',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (21,'PurchaseOrder',0,18,'PurchaseOrder',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (22,'SalesOrder',0,19,'SalesOrder',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (23,'Invoice',0,20,'Invoice',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (24,'Rss',0,21,'Rss',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (25,'Reports',0,22,'Reports',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (26,'Campaigns',0,23,'Campaigns',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (27,'Portal',0,24,'Portal',null,null,1)"); - $this->db->query("INSERT INTO vtiger_tab VALUES (28,'Webmails',0,25,'Webmails',null,null,1)"); - $this->db->query("insert into vtiger_tab values (29,'Users',0,26,'Users',null,null,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (3,'Home',0,1,'Home',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (7,'Leads',0,4,'Leads',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (6,'Accounts',0,5,'Accounts',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (4,'Contacts',0,6,'Contacts',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (2,'Potentials',0,7,'Potentials',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (8,'Notes',0,9,'Notes',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (9,'Calendar',0,3,'Calendar',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (10,'Emails',0,10,'Emails',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (13,'HelpDesk',0,11,'HelpDesk',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (14,'Products',0,8,'Products',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (1,'Dashboard',0,12,'Dashboards',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (15,'Faq',0,14,'Faq',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (16,'Events',2,13,'Events',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (18,'Vendors',0,15,'Vendors',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (19,'PriceBooks',0,16,'PriceBooks',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (20,'Quotes',0,17,'Quotes',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (21,'PurchaseOrder',0,18,'PurchaseOrder',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (22,'SalesOrder',0,19,'SalesOrder',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (23,'Invoice',0,20,'Invoice',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (24,'Rss',0,21,'Rss',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (25,'Reports',0,22,'Reports',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (26,'Campaigns',0,23,'Campaigns',null,null,0,0)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (27,'Portal',0,24,'Portal',null,null,0,1)"); + $this->db->query("INSERT INTO vtiger_tab VALUES (28,'Webmails',0,25,'Webmails',null,null,0,1)"); + $this->db->query("insert into vtiger_tab values (29,'Users',0,26,'Users',null,null,0,1)"); // Populate the vtiger_blocks vtiger_table $this->db->query("insert into vtiger_blocks values (1,2,'LBL_OPPORTUNITY_INFORMATION',1,0,0,0,0,0)"); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 06:39:13 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:39:13 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9906 - /vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php Message-ID: <20061127113913.D070178964E@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:39:00 2006 New Revision: 9906 Log: Added function for group support Modified: vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php Modified: vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php (original) +++ vtigercrm/branches/5.0.3/include/utils/UserInfoUtil.php Mon Nov 27 04:39:00 2006 @@ -879,6 +879,56 @@ return $replacedString; } + +/** Function to add module group relation + * @param $module -- module name:: Type varchar + * @param $groupname -- Group Name:: Type varchar + * + */ + function insertIntoGroupRelation($module,$moduleid,$groupname) + { + global $log; + $log->debug("Entering insertIntoGroupRelation(".$module.",".$moduleid.",".$groupname.") method ..."); + global $adb; + + //Get the module grouptable name and the + require_once("modules/$module/$module.php"); + $modObj = new $module(); + + $sql = "insert into ".$modObj->groupTable[0]." values (" .$moduleid .",'".$groupname."')"; + + $adb->query($sql); + $log->debug("Exiting insert2LeadGroupRelation method ..."); + + } + +/** Function to update lead group relation + * @param $module -- module name:: Type varchar + * @param $leadid -- Lead Id:: Type integer + * @param $groupname -- Group Name:: Type varchar + * + */ +function updateModuleGroupRelation($module,$moduleid,$groupname) +{ + global $log; + $log->debug("Entering updateModuleGroupRelation(".$moduleid.",".$groupname.") method ..."); + global $adb; + + //Get the module grouptable name and the + require_once("modules/$module/$module.php"); + $modObj = new $module(); + + //Deleting the existing entry + $sqldelete = "delete from ".$modObj->groupTable[0]." where " .$modObj->groupTable[1] ."=".$moduleid; + $adb->query($sqldelete); + $sql = "insert into ".$modObj->groupTable[0]." values (".$moduleid .",'" .$groupname ."')"; + $adb->query($sql); + $log->debug("Exiting updateLeadGroupRelation method ..."); + +} + + + /** Function to add lead group relation * @param $leadid -- Lead Id:: Type integer * @param $groupname -- Group Name:: Type varchar @@ -1491,7 +1541,8 @@ //If modules is Notes,Products,Vendors,Faq,PriceBook then no sharing if($record_id != '') { - if($module == 'Notes' || $module == 'Products' || $module == 'Faq' || $module == 'Vendors' || $module == 'PriceBooks') + //if($module == 'Notes' || $module == 'Products' || $module == 'Faq' || $module == 'Vendors' || $module == 'PriceBooks') + if(getTabOwnedBy($module) == 0) { $permission = "yes"; $log->debug("Exiting isPermitted method ..."); @@ -4528,45 +4579,9 @@ } else { - - //Current User - $sec_query = " and (vtiger_crmentity.smownerid=".$current_user->id; - - //Subordinate User - $subUsersList=getSubordinateUsersList(); - if($subUsersList != '') - { - $sec_query .= " or vtiger_crmentity.smownerid in".$subUsersList; - } - - //Shared User - $sharedUsersList=getReadSharingUsersList($module); - if($sharedUsersList != '') - { - $sec_query .= " or vtiger_crmentity.smownerid in".$sharedUsersList; - } - - - //Current User Groups - if($module == 'Leads' or $module=='HelpDesk' or $module=='Calendar') - { - $userGroupsList=getCurrentUserGroupList(); - if($userGroupsList != '') - { - $sec_query .= " or (vtiger_crmentity.smownerid in(0) and vtiger_groups.groupid in".$userGroupsList.")"; - } - - //Shared User Groups - $sharedGroupsList=getReadSharingGroupsList($module); - if($sharedGroupsList != '') - { - $sec_query .= " or (vtiger_crmentity.smownerid in(0) and vtiger_groups.groupid in".$sharedGroupsList.")"; - } - - - } - - $sec_query .=") "; + $mobObj = new $module; + $sec_query = $modObj->getListViewSecurityParameter($module); + } $log->debug("Exiting getListViewSecurityParameter method ..."); return $sec_query; @@ -4667,8 +4682,20 @@ function getFieldModuleAccessArray() { global $log; + global $adb; $log->debug("Entering getFieldModuleAccessArray() method ..."); + $fldModArr=Array(); + $query = 'select distinct(name) from vtiger_profile2field inner join vtiger_tab on vtiger_tab.tabid=vtiger_profile2field.tabid'; + $result = $adb->query($query); + $num_rows=$adb->num_rows($result); + for($i=0;$i<$num_rows;$i++) + { + $fldModArr[$adb->query_result($result,$i,'name')]=$adb->query_result($result,$i,'name'); + } + + + /* $fldModArr=Array('Leads'=>'LBL_LEAD_FIELD_ACCESS', 'Accounts'=>'LBL_ACCOUNT_FIELD_ACCESS', 'Contacts'=>'LBL_CONTACT_FIELD_ACCESS', @@ -4687,6 +4714,7 @@ 'Campaigns'=>'LBL_CAMPAIGN_FIELD_ACCESS', 'Faq'=>'LBL_FAQ_FIELD_ACCESS' ); + */ $log->debug("Exiting getFieldModuleAccessArray method ..."); return $fldModArr; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 06:51:50 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:51:50 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9907 - /vtigercrm/branches/5.0.3/data/CRMEntity.php Message-ID: <20061127115150.D470D789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:51:39 2006 New Revision: 9907 Log: The grouprelation code is made generic Modified: vtigercrm/branches/5.0.3/data/CRMEntity.php Modified: vtigercrm/branches/5.0.3/data/CRMEntity.php ============================================================================== --- vtigercrm/branches/5.0.3/data/CRMEntity.php (original) +++ vtigercrm/branches/5.0.3/data/CRMEntity.php Mon Nov 27 04:51:39 2006 @@ -39,6 +39,8 @@ * Contributor(s): ______________________________________.. */ + var $ownedby; + function saveentity($module) { @@ -62,6 +64,12 @@ } } + //Inserting into the group Table + if($this->ownedby == 0) + { + $this->insertIntoGroupTable($module); + } + //Calling the Module specific save code $this->save_module($module); @@ -229,12 +237,18 @@ { $ownerid = $this->column_fields['assigned_user_id']; } - - if($module == 'Products' || $module == 'Notes' || $module =='Faq' || $module == 'Vendors' || $module == 'PriceBooks') + + $sql="select ownedby from vtiger_tab where name='".$module."'"; + $res=$adb->query($sql); + $this->ownedby = $adb->query_result($res,0,'ownedby'); + + if($this->ownedby == 1) { $log->info("module is =".$module); $ownerid = $current_user->id; - } + } + + if($module == 'Events') { $module = 'Calendar'; @@ -276,6 +290,12 @@ $sql1 = "insert into vtiger_ownernotify values(".$this->id.",".$ownerid.",null)"; $adb->query($sql1); } + + + + + + } else { @@ -288,6 +308,9 @@ $adb->query($sql); $this->id = $current_id; } + + + } @@ -510,168 +533,14 @@ $adb->query($sql1); } - //to disable the update of groupentity relation in ajax edit for the fields except assigned_user_id field - if($_REQUEST['ajxaction'] != 'DETAILVIEW' || ($_REQUEST['ajxaction'] == 'DETAILVIEW' && $_REQUEST['fldName'] == 'assigned_user_id')) - { - if($_REQUEST['assigntype'] == 'T') - { - $groupname = $_REQUEST['assigned_group_name']; - //echo 'about to update lead group relation'; - if($module == 'Leads' && $table_name == 'vtiger_leaddetails') - { - updateLeadGroupRelation($this->id,$groupname); - } - elseif($module == 'Accounts' && $table_name == 'vtiger_account') - { - updateAccountGroupRelation($this->id,$groupname); - } - elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') - { - updateContactGroupRelation($this->id,$groupname); - } - elseif($module == 'Potentials' && $table_name == 'vtiger_potential') - { - updatePotentialGroupRelation($this->id,$groupname); - } - elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') - { - updateQuoteGroupRelation($this->id,$groupname); - } - elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') - { - updateSoGroupRelation($this->id,$groupname); - } - elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') - { - updateInvoiceGroupRelation($this->id,$groupname); - } - elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') - { - updatePoGroupRelation($this->id,$groupname); - } - elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') - { - updateTicketGroupRelation($this->id,$groupname); - } - elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') - { - updateCampaignGroupRelation($this->id,$groupname); - } - elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') - { - if($table_name == 'vtiger_activity') - { - updateActivityGroupRelation($this->id,$groupname); - } - } - - - } - else - { - //echo 'about to update lead group relation again!'; - if($module == 'Leads' && $table_name == 'vtiger_leaddetails') - { - updateLeadGroupRelation($this->id,''); - } - elseif($module == 'Accounts' && $table_name == 'vtiger_account') - { - updateAccountGroupRelation($this->id,''); - } - elseif($module == 'Contacts' && $table_name == 'vtiger_contactdetails') - { - updateContactGroupRelation($this->id,''); - } - elseif($module == 'Potentials' && $table_name == 'vtiger_potential') - { - updatePotentialGroupRelation($this->id,''); - } - elseif($module == 'Quotes' && $table_name == 'vtiger_quotes') - { - updateQuoteGroupRelation($this->id,''); - } - elseif($module == 'SalesOrder' && $table_name == 'vtiger_salesorder') - { - updateSoGroupRelation($this->id,''); - } - elseif($module == 'Invoice' && $table_name == 'vtiger_invoice') - { - updateInvoiceGroupRelation($this->id,''); - } - elseif($module == 'PurchaseOrder' && $table_name == 'vtiger_purchaseorder') - { - updatePoGroupRelation($this->id,''); - } - elseif($module == 'HelpDesk' && $table_name == 'vtiger_troubletickets') - { - updateTicketGroupRelation($this->id,''); - } - elseif($module == 'Campaigns' && $table_name == 'vtiger_campaign') - { - updateCampaignGroupRelation($this->id,$groupname); - } - elseif($module =='Calendar' || $module =='Events' || $module == 'Emails') - { - if($table_name == 'vtiger_activity') - { - updateActivityGroupRelation($this->id,$groupname); - } - } - - - } - } + } else - { + { $sql1 = "insert into ".$table_name." (".$column.") values(".$value.")"; $adb->query($sql1); - $groupname = $_REQUEST['assigned_group_name']; - if($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_leaddetails') - { - insert2LeadGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_account') - { - insert2AccountGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_contactdetails') - { - insert2ContactGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_potential') - { - insert2PotentialGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_quotes') - { - insert2QuoteGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_salesorder') - { - insert2SoGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_invoice') - { - insert2InvoiceGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_purchaseorder') - { - insert2PoGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_activity') - { - insert2ActivityGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_troubletickets') - { - insert2TicketGroupRelation($this->id,$groupname); - } - elseif($_REQUEST['assigntype'] == 'T' && $table_name == 'vtiger_campaign') - { - insert2CampaignGroupRelation($this->id,$groupname); - } + } @@ -750,9 +619,10 @@ $fieldcolname = $adb->query_result($result1,$i,"columnname"); $tablename = $adb->query_result($result1,$i,"tablename"); $fieldname = $adb->query_result($result1,$i,"fieldname"); - + $fld_value = $adb->query_result($result[$tablename],0,$fieldcolname); $this->column_fields[$fieldname] = $fld_value; + } if($module == 'Users') @@ -1020,6 +890,41 @@ $tracker->track_view($user_id, $current_module, $id, ''); } + function insertIntoGroupTable($module) + { + if($this->mode=='edit') + { + + //to disable the update of groupentity relation in ajax edit for the fields except assigned_user_id field + if($_REQUEST['ajxaction'] != 'DETAILVIEW' || ($_REQUEST['ajxaction'] == 'DETAILVIEW' && $_REQUEST['fldName'] == 'assigned_user_id')) + { + if($_REQUEST['assigntype'] == 'T') + { + $groupname = $_REQUEST['assigned_group_name']; + updateModuleGroupRelation($module,$this->id,$groupname); + + } + else + { + updateModuleGroupRelation($module,$this->id,''); + + } + } + } + else + { + + + $groupname = $_REQUEST['assigned_group_name']; + if($_REQUEST['assigntype'] == 'T') + { + insertIntoGroupRelation($module,$this->id,$groupname); + } + + } + + } + } From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 06:54:42 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 11:54:42 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9908 - /vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Message-ID: <20061127115442.92B82789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 04:54:34 2006 New Revision: 9908 Log: group handling code made generic Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Modified: vtigercrm/branches/5.0.3/include/utils/CommonUtils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/CommonUtils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/CommonUtils.php Mon Nov 27 04:54:34 2006 @@ -329,6 +329,42 @@ return $tabid; } + + +/** + * Function to get the ownedby value for the specified module + * Takes the input as $module - module name + * returns the tabid, integer type + */ + +function getTabOwnedBy($module) +{ + global $log; + $log->debug("Entering getTabid(".$module.") method ..."); + + $tabid=getTabid($module); + + if (file_exists('tabdata.php') && (filesize('tabdata.php') != 0)) + { + include('tabdata.php'); + $tab_ownedby= $tab_ownedby_array[$tabid]; + } + else + { + + $log->info("module is ".$module); + global $adb; + $sql = "select ownedby from vtiger_tab where name='".$module."'"; + $result = $adb->query($sql); + $tab_ownedby= $adb->query_result($result,0,"ownedby"); + } + $log->debug("Exiting getTabid method ..."); + return $tab_ownedby; + +} + + + /** * Function to get the tabid @@ -617,6 +653,14 @@ { $sql = "select vtiger_activitygrouprelation.groupname,vtiger_groups.groupid from vtiger_activitygrouprelation inner join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_activitygrouprelation.activityid=".$id; } + else + { + $modObj = new $module(); + + $sql = "select ".$modObj->groupTable[0].".groupname,vtiger_groups.groupid from ".$modObj->groupTable[0]." inner join vtiger_groups on vtiger_groups.groupname=".$modObj->groupTable[0].".groupname where ".$modObj->groupTable[0].".".$modObj->groupTable[1]."=".$id; + } + + $result = $adb->query($sql); $group_info[] = $adb->query_result($result,0,"groupname"); $group_info[] = $adb->query_result($result,0,"groupid"); @@ -1644,13 +1688,17 @@ $num_rows=$adb->num_rows($result); $result_array=Array(); $seq_array=Array(); + $ownedby_array=Array(); + for($i=0;$i<$num_rows;$i++) { $tabid=$adb->query_result($result,$i,'tabid'); $tabname=$adb->query_result($result,$i,'name'); $presence=$adb->query_result($result,$i,'presence'); + $ownedby=$adb->query_result($result,$i,'ownedby'); $result_array[$tabname]=$tabid; $seq_array[$tabid]=$presence; + $ownedby_array[$tabid]=$ownedby; } @@ -1699,6 +1747,8 @@ $newbuf .= "\$tab_info_array=".constructArray($result_array).";\n"; $newbuf .= "\n"; $newbuf .= "\$tab_seq_array=".constructArray($seq_array).";\n"; + $newbuf .= "\n"; + $newbuf .= "\$tab_ownedby_array=".constructArray($ownedby_array).";\n"; $newbuf .= "\n"; $newbuf .= "\$action_id_array=".constructSingleStringKeyAndValueArray($actionid_array).";\n"; $newbuf .= "\n"; From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 07:01:37 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:01:37 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9909 - /vtigercrm/branches/5.0.3/modules/Leads/Leads.php Message-ID: <20061127120137.7D3E1789686@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:01:25 2006 New Revision: 9909 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Leads/Leads.php Modified: vtigercrm/branches/5.0.3/modules/Leads/Leads.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Leads/Leads.php (original) +++ vtigercrm/branches/5.0.3/modules/Leads/Leads.php Mon Nov 27 05:01:25 2006 @@ -1,431 +1,433 @@ -'crmid','vtiger_leaddetails'=>'leadid','vtiger_leadsubdetails'=>'leadsubscriptionid','vtiger_leadaddress'=>'leadaddressid','vtiger_leadscf'=>'leadid'); - - var $entity_table = "vtiger_crmentity"; - - //construct this from database; - var $column_fields = Array(); - var $sortby_fields = Array('lastname','firstname','email','phone','company','smownerid','website'); - - // This is used to retrieve related vtiger_fields from form posts. - var $additional_column_fields = Array('smcreatorid', 'smownerid', 'contactid','potentialid' ,'crmid'); - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Last Name'=>Array('leaddetails'=>'lastname'), - 'First Name'=>Array('leaddetails'=>'firstname'), - 'Company'=>Array('leaddetails'=>'company'), - 'Phone'=>Array('leadaddress'=>'phone'), - 'Website'=>Array('leadsubdetails'=>'website'), - 'Email'=>Array('leaddetails'=>'email'), - 'Assigned To'=>Array('crmentity'=>'smownerid') - ); - var $list_fields_name = Array( - 'Last Name'=>'lastname', - 'First Name'=>'firstname', - 'Company'=>'company', - 'Phone'=>'phone', - 'Website'=>'website', - 'Email'=>'email', - 'Assigned To'=>'assigned_user_id' - ); - var $list_link_field= 'lastname'; - - var $search_fields = Array( - 'Name'=>Array('leaddetails'=>'lastname'), - 'Company'=>Array('leaddetails'=>'company') - ); - var $search_fields_name = Array( - 'Name'=>'lastname', - 'Company'=>'company' - ); - - var $required_fields = array("lastname"=>1, 'company'=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'lastname'; - var $default_sort_order = 'ASC'; - - function Leads() { - $this->log = LoggerManager::getLogger('lead'); - $this->log->debug("Entering Leads() method ..."); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Leads'); - $this->log->debug("Exiting Lead method ..."); - } - - /** Function to handle module specific operations when saving a entity - */ - function save_module($module) - { - } - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['LEADS_SORT_ORDER'] != '')?($_SESSION['LEADS_SORT_ORDER']):($this->default_sort_order)); - - $log->debug("Exiting getSortOrder method ..."); - return $sorder; - } - - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'leadname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['LEADS_ORDER_BY'] != '')?($_SESSION['LEADS_ORDER_BY']):($this->default_order_by)); - - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - - - - /** Function to export the lead records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Leads Query. - */ - function create_export_query(&$order_by, &$where) - { - global $log; - global $current_user; - $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); - - include("include/utils/ExportUtils.php"); - - //To get the Permitted fields query and the permitted fields list - $sql = getPermittedFieldsQuery("Leads", "detail_view"); - $fields_list = getFieldsListFromQuery($sql); - - $query = "SELECT $fields_list, vtiger_leadgrouprelation.groupname as 'Assigned To Group' - FROM ".$this->entity_table." - INNER JOIN vtiger_leaddetails - ON vtiger_crmentity.crmid=vtiger_leaddetails.leadid - LEFT JOIN vtiger_leadsubdetails - ON vtiger_leaddetails.leadid = vtiger_leadsubdetails.leadsubscriptionid - LEFT JOIN vtiger_leadaddress - ON vtiger_leaddetails.leadid=vtiger_leadaddress.leadaddressid - LEFT JOIN vtiger_leadscf - ON vtiger_leadscf.leadid=vtiger_leaddetails.leadid - LEFT JOIN vtiger_leadgrouprelation - ON vtiger_leadscf.leadid = vtiger_leadgrouprelation.leadid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_leadgrouprelation.groupname - LEFT JOIN vtiger_users - ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status='Active' - "; - - - $where_auto = " vtiger_crmentity.deleted=0 AND vtiger_leaddetails.converted =0"; - - if($where != "") - $query .= "where ($where) AND ".$where_auto; - else - $query .= "where ".$where_auto; - - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - //we should add security check when the user has Private Access - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[7] == 3) - { - //Added security check to get the permitted records only - $query = $query." ".getListViewSecurityParameter("Leads"); - } - - if(!empty($order_by)) - $query .= " ORDER BY $order_by"; - - $log->debug("Exiting create_export_query method ..."); - return $query; - } - - - - /** Returns a list of the associated tasks - * @param integer $id - leadid - * returns related Task or Event record in array format - */ -function get_activities($id) -{ - global $log, $singlepane_view; - $log->debug("Entering get_activities(".$id.") method ..."); - global $app_strings; - - $focus = new Activity(); - $button = ''; - - if(isPermitted("Calendar",1,"") == 'yes') - { - $button .= ' '; - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; - - - // First, get the list of IDs. - $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') and ((vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') or (vtiger_activity.eventstatus !='' && vtiger_activity.eventstatus != 'Held'))"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Leads','Calendar',$focus,$query,$button,$returnset); -} - -/** Returns a list of the associated Campaigns - * @param $id -- campaign id :: Type Integer - * @returns list of campaigns in array format - */ -function get_campaigns($id) -{ - global $log, $singlepane_view; - $log->debug("Entering get_campaigns(".$id.") method ..."); - global $mod_strings; - $focus = new Campaigns(); - $button = ''; - - if($singlepane_view == 'true') - $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; - - $log->info("Campaign Related List for Lead Displayed"); - $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaignleadrel on vtiger_campaignleadrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaignleadrel.leadid=".$id." and vtiger_crmentity.deleted=0"; - - $log->debug("Exiting get_campaigns method ..."); - return GetRelatedList('Leads','Campaigns',$focus,$query,$button,$returnset); - -} - - - /** Returns a list of the associated emails - * @param integer $id - leadid - * returns related emails record in array format - */ -function get_emails($id) -{ - global $log, $singlepane_view; - $log->debug("Entering get_emails(".$id.") method ..."); - global $mod_strings; - require_once('include/RelatedListView.php'); - - $focus = new Emails(); - - $button = ''; - - if(isPermitted("Emails",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; - - $query ="select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.semodule, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.status, vtiger_activity.priority, vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted=0 and vtiger_seactivityrel.crmid=".$id; - $log->debug("Exiting get_emails method ..."); - return GetRelatedList('Leads','Emails',$focus,$query,$button,$returnset); -} - -/** - * Function to get Lead related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - leadid - * returns related Task or Event record in array format - */ -function get_history($id) -{ - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, - vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name,vtiger_activitygrouprelation.groupname - from vtiger_activity - inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - left join vtiger_users on vtiger_crmentity.smownerid= vtiger_users.id - where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) - and vtiger_seactivityrel.crmid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - - $log->debug("Exiting get_history method ..."); - return getHistory('Leads',$query,$id); -} - -/** - * Function to get Lead related Attachments - * @param integer $id - leadid - * returns related Attachment record in array format - */ -function get_attachments($id) -{ - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, - vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_seattachmentsrel.attachmentsid attachmentsid, vtiger_notes.notesid crmid, - crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name - from vtiger_notes - inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 - left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid - left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - $query .= ' union all '; - // Armando L?scher 18.10.2005 -> ?visibleDescription - // Desc: Inserted crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - // Inserted order by createdtime desc - $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, - vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, - vtiger_attachments.attachmentsid attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, - crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - from vtiger_attachments - inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id." - order by createdtime desc"; - - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Leads',$query,$id); -} - -/** -* Function to get lead related Products -* @param integer $id - leadid -* returns related Products record in array format -*/ -function get_products($id) -{ - global $log, $singlepane_view; - $log->debug("Entering get_products(".$id.") method ..."); - require_once('modules/Products/Products.php'); - global $mod_strings; - global $app_strings; - - $focus = new Products(); - - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; - - $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_leaddetails on vtiger_leaddetails.leadid = vtiger_seproductsrel.crmid where vtiger_leaddetails.leadid = '.$id.' and vtiger_crmentity.deleted = 0'; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Leads','Products',$focus,$query,$button,$returnset); -} - - /** Function to get the Combo List Values of Leads Field - * @param string $list_option - * Returns Combo List Options - */ - function get_lead_field_options($list_option) - { - global $log; - $log->debug("Entering get_lead_field_options(".$list_option.") method ..."); - $comboFieldArray = getComboArray($this->combofieldNames); - $log->debug("Exiting get_lead_field_options method ..."); - return $comboFieldArray[$list_option]; - } - -/** Function to get the Columnnames of the Leads Record -* Used By vtigerCRM Word Plugin -* Returns the Merge Fields for Word Plugin -*/ -function getColumnNames_Lead() -{ - global $log,$current_user; - $log->debug("Entering getColumnNames_Lead() method ..."); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select fieldlabel from vtiger_field where tabid=7"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel 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 where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames_Lead method ..."); - return $mergeflds; -} -//End - -} - -?> +'crmid','vtiger_leaddetails'=>'leadid','vtiger_leadsubdetails'=>'leadsubscriptionid','vtiger_leadaddress'=>'leadaddressid','vtiger_leadscf'=>'leadid'); + + var $entity_table = "vtiger_crmentity"; + + //construct this from database; + var $column_fields = Array(); + var $sortby_fields = Array('lastname','firstname','email','phone','company','smownerid','website'); + + // This is used to retrieve related vtiger_fields from form posts. + var $additional_column_fields = Array('smcreatorid', 'smownerid', 'contactid','potentialid' ,'crmid'); + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Last Name'=>Array('leaddetails'=>'lastname'), + 'First Name'=>Array('leaddetails'=>'firstname'), + 'Company'=>Array('leaddetails'=>'company'), + 'Phone'=>Array('leadaddress'=>'phone'), + 'Website'=>Array('leadsubdetails'=>'website'), + 'Email'=>Array('leaddetails'=>'email'), + 'Assigned To'=>Array('crmentity'=>'smownerid') + ); + var $list_fields_name = Array( + 'Last Name'=>'lastname', + 'First Name'=>'firstname', + 'Company'=>'company', + 'Phone'=>'phone', + 'Website'=>'website', + 'Email'=>'email', + 'Assigned To'=>'assigned_user_id' + ); + var $list_link_field= 'lastname'; + + var $search_fields = Array( + 'Name'=>Array('leaddetails'=>'lastname'), + 'Company'=>Array('leaddetails'=>'company') + ); + var $search_fields_name = Array( + 'Name'=>'lastname', + 'Company'=>'company' + ); + + var $required_fields = array("lastname"=>1, 'company'=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'lastname'; + var $default_sort_order = 'ASC'; + + var $groupTable = Array('vtiger_leadgrouprelation','leadid'); + + function Leads() { + $this->log = LoggerManager::getLogger('lead'); + $this->log->debug("Entering Leads() method ..."); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Leads'); + $this->log->debug("Exiting Lead method ..."); + } + + /** Function to handle module specific operations when saving a entity + */ + function save_module($module) + { + } + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['LEADS_SORT_ORDER'] != '')?($_SESSION['LEADS_SORT_ORDER']):($this->default_sort_order)); + + $log->debug("Exiting getSortOrder method ..."); + return $sorder; + } + + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'leadname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['LEADS_ORDER_BY'] != '')?($_SESSION['LEADS_ORDER_BY']):($this->default_order_by)); + + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + + + + /** Function to export the lead records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Leads Query. + */ + function create_export_query(&$order_by, &$where) + { + global $log; + global $current_user; + $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); + + include("include/utils/ExportUtils.php"); + + //To get the Permitted fields query and the permitted fields list + $sql = getPermittedFieldsQuery("Leads", "detail_view"); + $fields_list = getFieldsListFromQuery($sql); + + $query = "SELECT $fields_list, vtiger_leadgrouprelation.groupname as 'Assigned To Group' + FROM ".$this->entity_table." + INNER JOIN vtiger_leaddetails + ON vtiger_crmentity.crmid=vtiger_leaddetails.leadid + LEFT JOIN vtiger_leadsubdetails + ON vtiger_leaddetails.leadid = vtiger_leadsubdetails.leadsubscriptionid + LEFT JOIN vtiger_leadaddress + ON vtiger_leaddetails.leadid=vtiger_leadaddress.leadaddressid + LEFT JOIN vtiger_leadscf + ON vtiger_leadscf.leadid=vtiger_leaddetails.leadid + LEFT JOIN vtiger_leadgrouprelation + ON vtiger_leadscf.leadid = vtiger_leadgrouprelation.leadid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_leadgrouprelation.groupname + LEFT JOIN vtiger_users + ON vtiger_crmentity.smownerid = vtiger_users.id and vtiger_users.status='Active' + "; + + + $where_auto = " vtiger_crmentity.deleted=0 AND vtiger_leaddetails.converted =0"; + + if($where != "") + $query .= "where ($where) AND ".$where_auto; + else + $query .= "where ".$where_auto; + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + //we should add security check when the user has Private Access + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[7] == 3) + { + //Added security check to get the permitted records only + $query = $query." ".getListViewSecurityParameter("Leads"); + } + + if(!empty($order_by)) + $query .= " ORDER BY $order_by"; + + $log->debug("Exiting create_export_query method ..."); + return $query; + } + + + + /** Returns a list of the associated tasks + * @param integer $id - leadid + * returns related Task or Event record in array format + */ +function get_activities($id) +{ + global $log, $singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $app_strings; + + $focus = new Activity(); + $button = ''; + + if(isPermitted("Calendar",1,"") == 'yes') + { + $button .= ' '; + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + + + // First, get the list of IDs. + $query = "SELECT vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and (activitytype='Task' or activitytype='Call' or activitytype='Meeting') and ((vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred') or (vtiger_activity.eventstatus !='' && vtiger_activity.eventstatus != 'Held'))"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Leads','Calendar',$focus,$query,$button,$returnset); +} + +/** Returns a list of the associated Campaigns + * @param $id -- campaign id :: Type Integer + * @returns list of campaigns in array format + */ +function get_campaigns($id) +{ + global $log, $singlepane_view; + $log->debug("Entering get_campaigns(".$id.") method ..."); + global $mod_strings; + $focus = new Campaigns(); + $button = ''; + + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + + $log->info("Campaign Related List for Lead Displayed"); + $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaignleadrel on vtiger_campaignleadrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaignleadrel.leadid=".$id." and vtiger_crmentity.deleted=0"; + + $log->debug("Exiting get_campaigns method ..."); + return GetRelatedList('Leads','Campaigns',$focus,$query,$button,$returnset); + +} + + + /** Returns a list of the associated emails + * @param integer $id - leadid + * returns related emails record in array format + */ +function get_emails($id) +{ + global $log, $singlepane_view; + $log->debug("Entering get_emails(".$id.") method ..."); + global $mod_strings; + require_once('include/RelatedListView.php'); + + $focus = new Emails(); + + $button = ''; + + if(isPermitted("Emails",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + + $query ="select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.semodule, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.status, vtiger_activity.priority, vtiger_crmentity.crmid,vtiger_crmentity.smownerid,vtiger_crmentity.modifiedtime, vtiger_users.user_name from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted=0 and vtiger_seactivityrel.crmid=".$id; + $log->debug("Exiting get_emails method ..."); + return GetRelatedList('Leads','Emails',$focus,$query,$button,$returnset); +} + +/** + * Function to get Lead related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id - leadid + * returns related Task or Event record in array format + */ +function get_history($id) +{ + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, + vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name,vtiger_activitygrouprelation.groupname + from vtiger_activity + inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + left join vtiger_users on vtiger_crmentity.smownerid= vtiger_users.id + where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) + and vtiger_seactivityrel.crmid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + + $log->debug("Exiting get_history method ..."); + return getHistory('Leads',$query,$id); +} + +/** + * Function to get Lead related Attachments + * @param integer $id - leadid + * returns related Attachment record in array format + */ +function get_attachments($id) +{ + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + $query = "select vtiger_notes.title,'Notes ' ActivityType, vtiger_notes.filename, + vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_seattachmentsrel.attachmentsid attachmentsid, vtiger_notes.notesid crmid, + crm2.createdtime, vtiger_notes.notecontent description, vtiger_users.user_name + from vtiger_notes + inner join vtiger_senotesrel on vtiger_senotesrel.notesid= vtiger_notes.notesid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_senotesrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 + left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid + left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + $query .= ' union all '; + // Armando L?scher 18.10.2005 -> ?visibleDescription + // Desc: Inserted crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + // Inserted inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + // Inserted order by createdtime desc + $query .= "select vtiger_attachments.description title ,'Attachments' ActivityType, + vtiger_attachments.name filename, vtiger_attachments.type FileType,crm2.modifiedtime lastmodified, + vtiger_attachments.attachmentsid attachmentsid, vtiger_seattachmentsrel.attachmentsid crmid, + crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + from vtiger_attachments + inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id." + order by createdtime desc"; + + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Leads',$query,$id); +} + +/** +* Function to get lead related Products +* @param integer $id - leadid +* returns related Products record in array format +*/ +function get_products($id) +{ + global $log, $singlepane_view; + $log->debug("Entering get_products(".$id.") method ..."); + require_once('modules/Products/Products.php'); + global $mod_strings; + global $app_strings; + + $focus = new Products(); + + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Leads&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Leads&return_action=CallRelatedList&return_id='.$id; + + $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_products inner join vtiger_seproductsrel on vtiger_products.productid = vtiger_seproductsrel.productid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid inner join vtiger_leaddetails on vtiger_leaddetails.leadid = vtiger_seproductsrel.crmid where vtiger_leaddetails.leadid = '.$id.' and vtiger_crmentity.deleted = 0'; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Leads','Products',$focus,$query,$button,$returnset); +} + + /** Function to get the Combo List Values of Leads Field + * @param string $list_option + * Returns Combo List Options + */ + function get_lead_field_options($list_option) + { + global $log; + $log->debug("Entering get_lead_field_options(".$list_option.") method ..."); + $comboFieldArray = getComboArray($this->combofieldNames); + $log->debug("Exiting get_lead_field_options method ..."); + return $comboFieldArray[$list_option]; + } + +/** Function to get the Columnnames of the Leads Record +* Used By vtigerCRM Word Plugin +* Returns the Merge Fields for Word Plugin +*/ +function getColumnNames_Lead() +{ + global $log,$current_user; + $log->debug("Entering getColumnNames_Lead() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=7"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel 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 where vtiger_field.tabid=7 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames_Lead method ..."); + return $mergeflds; +} +//End + +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 07:06:09 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:06:09 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9910 - /vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php Message-ID: <20061127120609.7FEF5789686@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:05:56 2006 New Revision: 9910 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php Modified: vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php (original) +++ vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php Mon Nov 27 05:05:56 2006 @@ -1,869 +1,871 @@ -'crmid','vtiger_contactdetails'=>'contactid','vtiger_contactaddress'=>'contactaddressid','vtiger_contactsubdetails'=>'contactsubscriptionid','vtiger_contactscf'=>'contactid','vtiger_customerdetails'=>'customerid','vtiger_attachments'=>'attachmentsid'); - - - - var $column_fields = Array(); - - var $sortby_fields = Array('lastname','firstname','title','email','phone','smownerid','accountid'); - - var $list_link_field= 'lastname'; - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Last Name' => Array('contactdetails'=>'lastname'), - 'First Name' => Array('contactdetails'=>'firstname'), - 'Title' => Array('contactdetails'=>'title'), - 'Account Name' => Array('account'=>'accountname'), - 'Email' => Array('contactdetails'=>'email'), - 'Phone' => Array('contactdetails'=>'phone'), - 'Assigned To' => Array('crmentity'=>'smownerid') - ); - - var $range_fields = Array( - 'first_name', - 'last_name', - 'primary_address_city', - 'account_name', - 'account_id', - 'id', - 'email1', - 'salutation', - 'title', - 'phone_mobile', - 'reports_to_name', - 'primary_address_street', - 'primary_address_city', - 'primary_address_state', - 'primary_address_postalcode', - 'primary_address_country', - 'alt_address_city', - 'alt_address_street', - 'alt_address_city', - 'alt_address_state', - 'alt_address_postalcode', - 'alt_address_country', - 'office_phone', - 'home_phone', - 'other_phone', - 'fax', - 'department', - 'birthdate', - 'assistant_name', - 'assistant_phone'); - - - var $list_fields_name = Array( - 'Last Name' => 'lastname', - 'First Name' => 'firstname', - 'Title' => 'title', - 'Account Name' => 'accountid', - 'Email' => 'email', - 'Phone' => 'phone', - 'Assigned To' => 'assigned_user_id' - ); - - var $search_fields = Array( - 'Name' => Array('contactdetails'=>'lastname'), - 'Title' => Array('contactdetails'=>'title') - ); - - var $search_fields_name = Array( - 'Name' => 'lastname', - 'Title' => 'title' - ); - - // This is the list of vtiger_fields that are required - var $required_fields = array("lastname"=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'lastname'; - var $default_sort_order = 'ASC'; - - function Contacts() { - $this->log = LoggerManager::getLogger('contact'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Contacts'); - } - - // Mike Crowe Mod --------------------------------------------------------Default ordering for us - /** - * Function to get sort order - * return string $sorder - sortorder string either 'ASC' or 'DESC' - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['CONTACTS_SORT_ORDER'] != '')?($_SESSION['CONTACTS_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder method ..."); - return $sorder; - } - /** - * Function to get order by - * return string $order_by - fieldname(eg: 'Contactname') - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['CONTACTS_ORDER_BY'] != '')?($_SESSION['CONTACTS_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - // Mike Crowe Mod -------------------------------------------------------- - /** Function to get the number of Contacts assigned to a particular User. - * @param varchar $user name - Assigned to User - * Returns the count of contacts assigned to user. - */ - function getCount($user_name) - { - global $log; - $log->debug("Entering getCount(".$user_name.") method ..."); - $query = "select count(*) from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0"; - - $result = $this->db->query($query,true,"Error retrieving contacts count"); - $rows_found = $this->db->getRowCount($result); - $row = $this->db->fetchByAssoc($result, 0); - - - $log->debug("Exiting getCount method ..."); - return $row["count(*)"]; - } - /** Function to get the Contact Details assigned to a given User ID which has a valid Email Address. - * @param varchar $user_name - User Name (eg. Admin) - * @param varchar $email_address - Email Addr of each contact record. - * Returns the query. - */ - function get_contacts1($user_name,$email_address) - { - global $log; - $log->debug("Entering get_contacts1(".$user_name.",".$email_address.") method ..."); - $query = "select vtiger_users.user_name, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name,vtiger_account.accountid as account_id from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%" .$email_address ."%' limit 50"; - - $log->debug("Exiting get_contacts1 method ..."); - return $this->process_list_query1($query); - } - /** Function to get the Contact Details assigned to a particular User based on the starting count and the number of subsequent records. - * @param varchar $user_name - Assigned User - * @param integer $from_index - Initial record number to be displayed - * @param integer $offset - Count of the subsequent records to be displayed. - * Returns Query. - */ - function get_contacts($user_name,$from_index,$offset) - { - global $log; - $log->debug("Entering get_contacts(".$user_name.",".$from_index.",".$offset.") method ..."); - $query = "select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.department department, vtiger_contactdetails.phone office_phone, vtiger_contactdetails.fax fax, vtiger_contactsubdetails.assistant assistant_name, vtiger_contactsubdetails.otherphone other_phone, vtiger_contactsubdetails.homephone home_phone,vtiger_contactsubdetails.birthday birthdate, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name,vtiger_account.accountid as account_id, vtiger_contactaddress.mailingcity as primary_address_city,vtiger_contactaddress.mailingstreet as primary_address_street, vtiger_contactaddress.mailingcountry as primary_address_country,vtiger_contactaddress.mailingstate as primary_address_state, vtiger_contactaddress.mailingzip as primary_address_postalcode, vtiger_contactaddress.othercity as alt_address_city,vtiger_contactaddress.otherstreet as alt_address_street, vtiger_contactaddress.othercountry as alt_address_country,vtiger_contactaddress.otherstate as alt_address_state, vtiger_contactaddress.otherzip as alt_address_postalcode from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 limit " .$from_index ."," .$offset; - - $log->debug("Exiting get_contacts method ..."); - return $this->process_list_query1($query); - } - - - /** Function to process list query for a given query - * @param $query - * Returns the results of query in array format - */ - function process_list_query1($query) - { - global $log; - $log->debug("Entering process_list_query1(".$query.") method ..."); - - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - $contact = Array(); - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - - { - foreach($this->range_fields as $columnName) - { - if (isset($row[$columnName])) { - - $contact[$columnName] = $row[$columnName]; - } - else - { - $contact[$columnName] = ""; - } - } -// TODO OPTIMIZE THE QUERY ACCOUNT NAME AND ID are set separetly for every vtiger_contactdetails and hence -// vtiger_account query goes for ecery single vtiger_account row - - $list[] = $contact; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - - - $log->debug("Exiting process_list_query1 method ..."); - return $response; - } - - - /** Function to process list query for Plugin with Security Parameters for a given query - * @param $query - * Returns the results of query in array format - */ - function plugin_process_list_query($query) - { - global $log,$adb,$current_user; - $log->debug("Entering process_list_query1(".$query.") method ..."); - $permitted_field_lists = Array(); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select columnname from vtiger_field where tabid=4 and block <> 75"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select columnname 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 where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result1 = $this->db->query($sql1); - for($i=0;$i < $adb->num_rows($result1);$i++) - { - $permitted_field_lists[] = $adb->query_result($result1,$i,'columnname'); - } - - $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); - $list = Array(); - $rows_found = $this->db->getRowCount($result); - if($rows_found != 0) - { - for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) - { - $contact = Array(); - foreach($permitted_field_lists as $columnName) - { - if ($columnName == "lastname" || $columnName == "firstname" || $columnName == "email") - { - $contact[$columnName] = $row[$columnName]; - } - else - { - $contact[$columnName] = ""; - } - } - if(in_array("accountid",$permitted_field_lists)) - { - $contact[accountname] = $row[accountname]; - $contact[account_id] = $row[accountid]; - } - $contact[contactid] = $row[contactid]; - $list[] = $contact; - } - } - - $response = Array(); - $response['list'] = $list; - $response['row_count'] = $rows_found; - $response['next_offset'] = $next_offset; - $response['previous_offset'] = $previous_offset; - $log->debug("Exiting process_list_query1 method ..."); - return $response; - } - - - /** Returns a list of the associated opportunities - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_opportunities($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_opportunities(".$id.") method ..."); - global $mod_strings; - - $focus = new Potentials(); - $button = ''; - - if(isPermitted("Potentials",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $log->info("Potential Related List for Contact Displayed"); - - // First, get the list of IDs. - $query = 'select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.accountid, vtiger_contactdetails.contactid , vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.potentialtype, vtiger_potential.sales_stage, vtiger_potential.amount, vtiger_potential.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_contactdetails inner join vtiger_potential on vtiger_contactdetails.accountid = vtiger_potential.accountid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid left join vtiger_potentialgrouprelation on vtiger_potential.potentialid=vtiger_potentialgrouprelation.potentialid left join vtiger_groups on vtiger_groups.groupname=vtiger_potentialgrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted=0'; - if($this->column_fields['account_id'] != 0) - $log->debug("Exiting get_opportunities method ..."); - return GetRelatedList('Contacts','Potentials',$focus,$query,$button,$returnset); - } - - - /** Returns a list of the associated tasks - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_activities($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_activities(".$id.") method ..."); - global $mod_strings; - - $focus = new Activity(); - - $button = ''; - - if(isPermitted("Calendar",1,"") == 'yes') - { - $button .= ' '; - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $log->info("Activity Related List for Contact Displayed"); - - $query = "SELECT vtiger_users.user_name,vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.activityid , vtiger_activity.subject, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.due_date, vtiger_cntactivityrel.contactid, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_recurringevents.recurringtype from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid = vtiger_contactdetails.contactid inner join vtiger_activity on vtiger_cntactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_cntactivityrel.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_contactdetails.contactid=".$id." and vtiger_crmentity.deleted = 0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') "; //recurring type is added in Query -Jaguar - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Contacts','Calendar',$focus,$query,$button,$returnset); - - } - /** - * Function to get Contact related Task & Event which have activity type Held, Completed or Deferred. - * @param integer $id - contactid - * returns related Task or Event record in array format - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus, - vtiger_activity.activitytype, vtiger_contactdetails.contactid, vtiger_contactdetails.firstname, - vtiger_contactdetails.lastname, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name - from vtiger_activity - inner join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid - inner join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id - where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) - and vtiger_cntactivityrel.contactid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - $log->debug("Entering get_history method ..."); - return getHistory('Contacts',$query,$id); - } - /** - * Function to get Contact related Tickets. - * @param integer $id - contactid - * returns related Ticket records in array format - */ - function get_tickets($id) - { - global $log, $singlepane_view; - global $app_strings; - $log->debug("Entering get_tickets(".$id.") method ..."); - $focus = new HelpDesk(); - - $button = ' '; - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $query = "select vtiger_users.user_name,vtiger_crmentity.crmid, vtiger_troubletickets.title, vtiger_contactdetails.contactid, vtiger_troubletickets.parent_id, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_troubletickets.status, vtiger_troubletickets.priority, vtiger_crmentity.smownerid from vtiger_troubletickets inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_ticketgrouprelation on vtiger_troubletickets.ticketid=vtiger_ticketgrouprelation.ticketid left join vtiger_groups on vtiger_groups.groupname=vtiger_ticketgrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; - $log->info("Ticket Related List for Contact Displayed"); - $log->debug("Exiting get_tickets method ..."); - return GetRelatedList('Contacts','HelpDesk',$focus,$query,$button,$returnset); - } - /** - * Function to get Contact related Attachments - * @param integer $id - contactid - * returns related Attachment record in array format - */ - function get_attachments($id) - { - global $log; - $log->debug("Entering get_attachments(".$id.") method ..."); - $query = "select vtiger_notes.title,'Notes ' AS ActivityType, - vtiger_notes.filename, vtiger_attachments.type AS FileType,crm2.modifiedtime AS lastmodified, - vtiger_seattachmentsrel.attachmentsid AS attachmentsid, vtiger_notes.notesid AS crmid, - crm2.createdtime, vtiger_notes.notecontent AS description, vtiger_users.user_name - from vtiger_notes - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_notes.contact_id - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 - left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid - left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id; - $query .= " union all "; - $query .= "select vtiger_attachments.description AS title,'Attachments' AS ActivityType, - vtiger_attachments.name AS filename, vtiger_attachments.type AS FileType,crm2.modifiedtime AS lastmodified, - vtiger_attachments.attachmentsid AS attachmentsid, vtiger_seattachmentsrel.attachmentsid AS crmid, - crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name - from vtiger_attachments - inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid - inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid - inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid - inner join vtiger_users on crm2.smcreatorid= vtiger_users.id - where vtiger_crmentity.crmid=".$id." - order by createdtime desc"; - $log->info("Notes&Attachmenmts for Contact Displayed"); - $log->debug("Exiting get_attachments method ..."); - return getAttachmentsAndNotes('Contacts',$query,$id); - } - /** - * Function to get Contact related Quotes - * @param integer $id - contactid - * returns related Quotes record in array format - */ - function get_quotes($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_quotes(".$id.") method ..."); - global $app_strings; - require_once('modules/Quotes/Quotes.php'); - $focus = new Quotes(); - - $button = ''; - if(isPermitted("Quotes",1,"") == 'yes') - { - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_quotes.*,vtiger_potential.potentialname,vtiger_contactdetails.lastname from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_quotes.contactid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; - $log->debug("Exiting get_quotes method ..."); - return GetRelatedList('Contacts','Quotes',$focus,$query,$button,$returnset); - } - /** - * Function to get Contact related SalesOrder - * @param integer $id - contactid - * returns related SalesOrder record in array format - */ - function get_salesorder($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - global $app_strings; - $focus = new SalesOrder(); - $button = ''; - - if(isPermitted("SalesOrder",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_contactdetails.lastname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_salesorder.contactid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.contactid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Contacts','SalesOrder',$focus,$query,$button,$returnset); - } - /** - * Function to get Contact related Products - * @param integer $id - contactid - * returns related Products record in array format - */ - function get_products($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_products(".$id.") method ..."); - global $app_strings; - require_once('modules/Products/Products.php'); - $focus = new Products(); - $button = ''; - - if(isPermitted("Products",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_contactdetails.lastname from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_products.contactid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted = 0'; - $log->debug("Exiting get_products method ..."); - return GetRelatedList('Contacts','Products',$focus,$query,$button,$returnset); - } - - /** - * Function to get Contact related PurchaseOrder - * @param integer $id - contactid - * returns related PurchaseOrder record in array format - */ - function get_purchase_orders($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_purchase_orders(".$id.") method ..."); - global $app_strings; - require_once('modules/PurchaseOrder/PurchaseOrder.php'); - $focus = new PurchaseOrder(); - - $button = ''; - - if(isPermitted("PurchaseOrder",1,"") == 'yes') - { - - $button .= ' '; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_purchaseorder.*,vtiger_vendor.vendorname,vtiger_contactdetails.lastname from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left outer join vtiger_vendor on vtiger_purchaseorder.vendorid=vtiger_vendor.vendorid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_purchaseorder.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_pogrouprelation on vtiger_purchaseorder.purchaseorderid=vtiger_pogrouprelation.purchaseorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_pogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_purchaseorder.contactid=".$id; - $log->debug("Exiting get_purchase_orders method ..."); - return GetRelatedList('Contacts','PurchaseOrder',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated emails - * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. - * All Rights Reserved.. - * Contributor(s): ______________________________________.. - */ - function get_emails($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_emails(".$id.") method ..."); - global $mod_strings; - - $focus = new Emails(); - - $button = ''; - - if(isPermitted("Emails",1,"") == 'yes') - { - $button .= ''; - } - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - - $log->info("Email Related List for Contact Displayed"); - - $query = "select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_users.user_name, vtiger_crmentity.modifiedtime, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_activity.date_start from vtiger_activity, vtiger_seactivityrel, vtiger_contactdetails, vtiger_users, vtiger_crmentity left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.activityid = vtiger_activity.activityid and vtiger_contactdetails.contactid = vtiger_seactivityrel.crmid and vtiger_users.id=vtiger_crmentity.smownerid and vtiger_crmentity.crmid = vtiger_activity.activityid and vtiger_contactdetails.contactid = ".$id." and vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted = 0"; - $log->debug("Exiting get_emails method ..."); - return GetRelatedList('Contacts','Emails',$focus,$query,$button,$returnset); - } - - /** Returns a list of the associated Campaigns - * @param $id -- campaign id :: Type Integer - * @returns list of campaigns in array format - */ - - function get_campaigns($id) - { - global $log, $singlepane_view; - $log->debug("Entering get_campaigns(".$id.") method ..."); - global $mod_strings; - - $focus = new Campaigns(); - if($singlepane_view == 'true') - $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; - $button = ''; - - $log->info("Campaign Related List for Contact Displayed"); - $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaigncontrel on vtiger_campaigncontrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaigncontrel.contactid=".$id." and vtiger_crmentity.deleted=0"; - - $log->debug("Exiting get_campaigns method ..."); - return GetRelatedList('Contacts','Campaigns',$focus,$query,$button,$returnset); - - } - /** Function to export the contact records in CSV Format - * @param reference variable - order by is passed when the query is executed - * @param reference variable - where condition is passed when the query is executed - * Returns Export Contacts Query. - */ - function create_export_query(&$order_by, &$where) - { - global $log; - global $current_user; - $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); - - include("include/utils/ExportUtils.php"); - - //To get the Permitted fields query and the permitted fields list - $sql = getPermittedFieldsQuery("Contacts", "detail_view"); - $fields_list = getFieldsListFromQuery($sql); - - $query = "SELECT $fields_list, vtiger_contactgrouprelation.groupname as 'Assigned To Group' - FROM vtiger_contactdetails - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid - LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id and vtiger_users.status='Active' - LEFT JOIN vtiger_account on vtiger_contactdetails.accountid=vtiger_account.accountid - left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid=vtiger_contactdetails.contactid - left join vtiger_contactscf on vtiger_contactscf.contactid=vtiger_contactdetails.contactid - left join vtiger_customerdetails on vtiger_customerdetails.customerid=vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation - ON vtiger_contactscf.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups - ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - LEFT JOIN vtiger_contactdetails vtiger_contactdetails2 - ON vtiger_contactdetails2.contactid = vtiger_contactdetails.reportsto - where vtiger_crmentity.deleted=0"; - //vtiger_contactdetails2 is added to get the Reports To of Contact - - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - //we should add security check when the user has Private Access - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[4] == 3) - { - //Added security check to get the permitted records only - $query = $query." ".getListViewSecurityParameter("Contacts"); - } - - $log->info("Export Query Constructed Successfully"); - $log->debug("Exiting create_export_query method ..."); - return $query; - } - - -/** Function to get the Columnnames of the Contacts -* Used By vtigerCRM Word Plugin -* Returns the Merge Fields for Word Plugin -*/ -function getColumnNames() -{ - global $log, $current_user; - $log->debug("Entering getColumnNames() method ..."); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select fieldlabel 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 where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result = $this->db->query($sql1); - $numRows = $this->db->num_rows($result); - for($i=0; $i < $numRows;$i++) - { - $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); - $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); - $custom_fields[$i] = strtoupper($custom_fields[$i]); - } - $mergeflds = $custom_fields; - $log->debug("Exiting getColumnNames method ..."); - return $mergeflds; -} -//End -/** Function to get the Contacts assigned to a user with a valid email address. -* @param varchar $username - User Name -* @param varchar $emailaddress - Email Addr for each contact. -* Used By vtigerCRM Outlook Plugin -* Returns the Query -*/ -function get_searchbyemailid($username,$emailaddress) -{ - global $log; - global $current_user; - require_once("modules/Users/Users.php"); - $seed_user=new Users(); - $user_id=$seed_user->retrieve_user_id($username); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - $log->debug("Entering get_searchbyemailid(".$username.",".$emailaddress.") method ..."); - $query = "select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname, - vtiger_contactdetails.contactid, vtiger_contactdetails.salutation, - vtiger_contactdetails.email,vtiger_contactdetails.title, - vtiger_contactdetails.mobile,vtiger_account.accountname, - vtiger_account.accountid as accountid from vtiger_contactdetails - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid - inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid - left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid - left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%".$emailaddress."%'"; - $tab_id = getTabid("Contacts"); - if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) - { - $sec_parameter=getListViewSecurityParameter("Contacts"); - $query .= $sec_parameter; - - } - $log->debug("Exiting get_searchbyemailid method ..."); - return $this->plugin_process_list_query($query); -} - -/** Function to get the Contacts associated with the particular User Name. -* @param varchar $user_name - User Name -* Returns query -*/ - -function get_contactsforol($user_name) -{ - global $log,$adb; - global $current_user; - require_once("modules/Users/Users.php"); - $seed_user=new Users(); - $user_id=$seed_user->retrieve_user_id($user_name); - $current_user=$seed_user; - $current_user->retrieve_entity_info($user_id, 'Users'); - require('user_privileges/user_privileges_'.$current_user->id.'.php'); - require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); - - if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) - { - $sql1 = "select tablename,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and vtiger_field.block <> 5"; - }else - { - $profileList = getCurrentUserProfileList(); - $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; - } - $result1 = $adb->query($sql1); - for($i=0;$i < $adb->num_rows($result1);$i++) - { - $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); - $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); - if($adb->query_result($result1,$i,'columnname') == "accountid") - { - $permitted_lists[] = 'vtiger_account'; - $permitted_lists[] = 'accountname'; - } - } - $permitted_lists = array_chunk($permitted_lists,2); - $column_table_lists = array(); - for($i=0;$i < count($permitted_lists);$i++) - { - $column_table_lists[] = implode(".",$permitted_lists[$i]); - } - - $log->debug("Entering get_contactsforol(".$user_name.") method ..."); - $query = "select vtiger_contactdetails.contactid as id, ".implode(',',$column_table_lists)." from vtiger_contactdetails - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid - inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid - left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid - left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid - left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid - LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid - LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname - where vtiger_crmentity.deleted=0 and vtiger_users.user_name='".$user_name."'"; - $log->debug("Exiting get_contactsforol method ..."); - return $query; -} - - - /** Function to handle module specific operations when saving a entity - */ - function save_module($module) - { - $this->insertIntoAttachment($this->id,$module); - } - - /** - * This function is used to add the vtiger_attachments. This will call the function uploadAndSaveFile which will upload the attachment into the server and save that attachment information in the database. - * @param int $id - entity id to which the vtiger_files to be uploaded - * @param string $module - the current module name - */ - function insertIntoAttachment($id,$module) - { - global $log, $adb; - $log->debug("Entering into insertIntoAttachment($id,$module) method."); - - $file_saved = false; - - //This is to added to store the existing attachment id of the contact where we should delete this when we give new image - $old_attachmentid = $adb->query_result($adb->query("select * from vtiger_seattachmentsrel where crmid=$id"),0,'attachmentsid'); - - foreach($_FILES as $fileindex => $files) - { - if($files['name'] != '' && $files['size'] > 0) - { - $file_saved = $this->uploadAndSaveFile($id,$module,$files); - } - } - - //This is to handle the delete image for contacts - if($module == 'Contacts' && $file_saved) - { - $del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$old_attachmentid"); - $del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$old_attachmentid"); - } - - $log->debug("Exiting from insertIntoAttachment($id,$module) method."); - } - - -//End - -} - -?> +'crmid','vtiger_contactdetails'=>'contactid','vtiger_contactaddress'=>'contactaddressid','vtiger_contactsubdetails'=>'contactsubscriptionid','vtiger_contactscf'=>'contactid','vtiger_customerdetails'=>'customerid','vtiger_attachments'=>'attachmentsid'); + + + + var $column_fields = Array(); + + var $sortby_fields = Array('lastname','firstname','title','email','phone','smownerid','accountid'); + + var $list_link_field= 'lastname'; + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Last Name' => Array('contactdetails'=>'lastname'), + 'First Name' => Array('contactdetails'=>'firstname'), + 'Title' => Array('contactdetails'=>'title'), + 'Account Name' => Array('account'=>'accountname'), + 'Email' => Array('contactdetails'=>'email'), + 'Phone' => Array('contactdetails'=>'phone'), + 'Assigned To' => Array('crmentity'=>'smownerid') + ); + + var $range_fields = Array( + 'first_name', + 'last_name', + 'primary_address_city', + 'account_name', + 'account_id', + 'id', + 'email1', + 'salutation', + 'title', + 'phone_mobile', + 'reports_to_name', + 'primary_address_street', + 'primary_address_city', + 'primary_address_state', + 'primary_address_postalcode', + 'primary_address_country', + 'alt_address_city', + 'alt_address_street', + 'alt_address_city', + 'alt_address_state', + 'alt_address_postalcode', + 'alt_address_country', + 'office_phone', + 'home_phone', + 'other_phone', + 'fax', + 'department', + 'birthdate', + 'assistant_name', + 'assistant_phone'); + + + var $list_fields_name = Array( + 'Last Name' => 'lastname', + 'First Name' => 'firstname', + 'Title' => 'title', + 'Account Name' => 'accountid', + 'Email' => 'email', + 'Phone' => 'phone', + 'Assigned To' => 'assigned_user_id' + ); + + var $search_fields = Array( + 'Name' => Array('contactdetails'=>'lastname'), + 'Title' => Array('contactdetails'=>'title') + ); + + var $search_fields_name = Array( + 'Name' => 'lastname', + 'Title' => 'title' + ); + + // This is the list of vtiger_fields that are required + var $required_fields = array("lastname"=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'lastname'; + var $default_sort_order = 'ASC'; + + var $groupTable = Array('vtiger_contactgrouprelation','contactid'); + + function Contacts() { + $this->log = LoggerManager::getLogger('contact'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Contacts'); + } + + // Mike Crowe Mod --------------------------------------------------------Default ordering for us + /** + * Function to get sort order + * return string $sorder - sortorder string either 'ASC' or 'DESC' + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['CONTACTS_SORT_ORDER'] != '')?($_SESSION['CONTACTS_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder method ..."); + return $sorder; + } + /** + * Function to get order by + * return string $order_by - fieldname(eg: 'Contactname') + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['CONTACTS_ORDER_BY'] != '')?($_SESSION['CONTACTS_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + // Mike Crowe Mod -------------------------------------------------------- + /** Function to get the number of Contacts assigned to a particular User. + * @param varchar $user name - Assigned to User + * Returns the count of contacts assigned to user. + */ + function getCount($user_name) + { + global $log; + $log->debug("Entering getCount(".$user_name.") method ..."); + $query = "select count(*) from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0"; + + $result = $this->db->query($query,true,"Error retrieving contacts count"); + $rows_found = $this->db->getRowCount($result); + $row = $this->db->fetchByAssoc($result, 0); + + + $log->debug("Exiting getCount method ..."); + return $row["count(*)"]; + } + /** Function to get the Contact Details assigned to a given User ID which has a valid Email Address. + * @param varchar $user_name - User Name (eg. Admin) + * @param varchar $email_address - Email Addr of each contact record. + * Returns the query. + */ + function get_contacts1($user_name,$email_address) + { + global $log; + $log->debug("Entering get_contacts1(".$user_name.",".$email_address.") method ..."); + $query = "select vtiger_users.user_name, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name,vtiger_account.accountid as account_id from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%" .$email_address ."%' limit 50"; + + $log->debug("Exiting get_contacts1 method ..."); + return $this->process_list_query1($query); + } + /** Function to get the Contact Details assigned to a particular User based on the starting count and the number of subsequent records. + * @param varchar $user_name - Assigned User + * @param integer $from_index - Initial record number to be displayed + * @param integer $offset - Count of the subsequent records to be displayed. + * Returns Query. + */ + function get_contacts($user_name,$from_index,$offset) + { + global $log; + $log->debug("Entering get_contacts(".$user_name.",".$from_index.",".$offset.") method ..."); + $query = "select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.department department, vtiger_contactdetails.phone office_phone, vtiger_contactdetails.fax fax, vtiger_contactsubdetails.assistant assistant_name, vtiger_contactsubdetails.otherphone other_phone, vtiger_contactsubdetails.homephone home_phone,vtiger_contactsubdetails.birthday birthdate, vtiger_contactdetails.lastname last_name,vtiger_contactdetails.firstname first_name,vtiger_contactdetails.contactid as id, vtiger_contactdetails.salutation as salutation, vtiger_contactdetails.email as email1,vtiger_contactdetails.title as title,vtiger_contactdetails.mobile as phone_mobile,vtiger_account.accountname as account_name,vtiger_account.accountid as account_id, vtiger_contactaddress.mailingcity as primary_address_city,vtiger_contactaddress.mailingstreet as primary_address_street, vtiger_contactaddress.mailingcountry as primary_address_country,vtiger_contactaddress.mailingstate as primary_address_state, vtiger_contactaddress.mailingzip as primary_address_postalcode, vtiger_contactaddress.othercity as alt_address_city,vtiger_contactaddress.otherstreet as alt_address_street, vtiger_contactaddress.othercountry as alt_address_country,vtiger_contactaddress.otherstate as alt_address_state, vtiger_contactaddress.otherzip as alt_address_postalcode from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where user_name='" .$user_name ."' and vtiger_crmentity.deleted=0 limit " .$from_index ."," .$offset; + + $log->debug("Exiting get_contacts method ..."); + return $this->process_list_query1($query); + } + + + /** Function to process list query for a given query + * @param $query + * Returns the results of query in array format + */ + function process_list_query1($query) + { + global $log; + $log->debug("Entering process_list_query1(".$query.") method ..."); + + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + $contact = Array(); + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + + { + foreach($this->range_fields as $columnName) + { + if (isset($row[$columnName])) { + + $contact[$columnName] = $row[$columnName]; + } + else + { + $contact[$columnName] = ""; + } + } +// TODO OPTIMIZE THE QUERY ACCOUNT NAME AND ID are set separetly for every vtiger_contactdetails and hence +// vtiger_account query goes for ecery single vtiger_account row + + $list[] = $contact; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + + + $log->debug("Exiting process_list_query1 method ..."); + return $response; + } + + + /** Function to process list query for Plugin with Security Parameters for a given query + * @param $query + * Returns the results of query in array format + */ + function plugin_process_list_query($query) + { + global $log,$adb,$current_user; + $log->debug("Entering process_list_query1(".$query.") method ..."); + $permitted_field_lists = Array(); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select columnname from vtiger_field where tabid=4 and block <> 75"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select columnname 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 where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $this->db->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_field_lists[] = $adb->query_result($result1,$i,'columnname'); + } + + $result =& $this->db->query($query,true,"Error retrieving $this->object_name list: "); + $list = Array(); + $rows_found = $this->db->getRowCount($result); + if($rows_found != 0) + { + for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index)) + { + $contact = Array(); + foreach($permitted_field_lists as $columnName) + { + if ($columnName == "lastname" || $columnName == "firstname" || $columnName == "email") + { + $contact[$columnName] = $row[$columnName]; + } + else + { + $contact[$columnName] = ""; + } + } + if(in_array("accountid",$permitted_field_lists)) + { + $contact[accountname] = $row[accountname]; + $contact[account_id] = $row[accountid]; + } + $contact[contactid] = $row[contactid]; + $list[] = $contact; + } + } + + $response = Array(); + $response['list'] = $list; + $response['row_count'] = $rows_found; + $response['next_offset'] = $next_offset; + $response['previous_offset'] = $previous_offset; + $log->debug("Exiting process_list_query1 method ..."); + return $response; + } + + + /** Returns a list of the associated opportunities + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_opportunities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_opportunities(".$id.") method ..."); + global $mod_strings; + + $focus = new Potentials(); + $button = ''; + + if(isPermitted("Potentials",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $log->info("Potential Related List for Contact Displayed"); + + // First, get the list of IDs. + $query = 'select vtiger_users.user_name,vtiger_groups.groupname,vtiger_contactdetails.accountid, vtiger_contactdetails.contactid , vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.potentialtype, vtiger_potential.sales_stage, vtiger_potential.amount, vtiger_potential.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_contactdetails inner join vtiger_potential on vtiger_contactdetails.accountid = vtiger_potential.accountid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid left join vtiger_potentialgrouprelation on vtiger_potential.potentialid=vtiger_potentialgrouprelation.potentialid left join vtiger_groups on vtiger_groups.groupname=vtiger_potentialgrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted=0'; + if($this->column_fields['account_id'] != 0) + $log->debug("Exiting get_opportunities method ..."); + return GetRelatedList('Contacts','Potentials',$focus,$query,$button,$returnset); + } + + + /** Returns a list of the associated tasks + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_activities($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $mod_strings; + + $focus = new Activity(); + + $button = ''; + + if(isPermitted("Calendar",1,"") == 'yes') + { + $button .= ' '; + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $log->info("Activity Related List for Contact Displayed"); + + $query = "SELECT vtiger_users.user_name,vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.activityid , vtiger_activity.subject, vtiger_activity.activitytype, vtiger_activity.date_start, vtiger_activity.due_date, vtiger_cntactivityrel.contactid, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_recurringevents.recurringtype from vtiger_contactdetails inner join vtiger_cntactivityrel on vtiger_cntactivityrel.contactid = vtiger_contactdetails.contactid inner join vtiger_activity on vtiger_cntactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_cntactivityrel.activityid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_contactdetails.contactid=".$id." and vtiger_crmentity.deleted = 0 and (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') AND ( vtiger_activity.status is NULL OR vtiger_activity.status != 'Completed' ) and ( vtiger_activity.eventstatus is NULL OR vtiger_activity.eventstatus != 'Held') "; //recurring type is added in Query -Jaguar + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Contacts','Calendar',$focus,$query,$button,$returnset); + + } + /** + * Function to get Contact related Task & Event which have activity type Held, Completed or Deferred. + * @param integer $id - contactid + * returns related Task or Event record in array format + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, vtiger_activity.eventstatus, + vtiger_activity.activitytype, vtiger_contactdetails.contactid, vtiger_contactdetails.firstname, + vtiger_contactdetails.lastname, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name + from vtiger_activity + inner join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid + inner join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id + where (vtiger_activity.activitytype = 'Meeting' or vtiger_activity.activitytype='Call' or vtiger_activity.activitytype='Task') + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred' or (vtiger_activity.eventstatus = 'Held' and vtiger_activity.eventstatus != '')) + and vtiger_cntactivityrel.contactid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + $log->debug("Entering get_history method ..."); + return getHistory('Contacts',$query,$id); + } + /** + * Function to get Contact related Tickets. + * @param integer $id - contactid + * returns related Ticket records in array format + */ + function get_tickets($id) + { + global $log, $singlepane_view; + global $app_strings; + $log->debug("Entering get_tickets(".$id.") method ..."); + $focus = new HelpDesk(); + + $button = ' '; + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $query = "select vtiger_users.user_name,vtiger_crmentity.crmid, vtiger_troubletickets.title, vtiger_contactdetails.contactid, vtiger_troubletickets.parent_id, vtiger_contactdetails.firstname, vtiger_contactdetails.lastname, vtiger_troubletickets.status, vtiger_troubletickets.priority, vtiger_crmentity.smownerid from vtiger_troubletickets inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_troubletickets.ticketid left join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_troubletickets.parent_id left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_ticketgrouprelation on vtiger_troubletickets.ticketid=vtiger_ticketgrouprelation.ticketid left join vtiger_groups on vtiger_groups.groupname=vtiger_ticketgrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; + $log->info("Ticket Related List for Contact Displayed"); + $log->debug("Exiting get_tickets method ..."); + return GetRelatedList('Contacts','HelpDesk',$focus,$query,$button,$returnset); + } + /** + * Function to get Contact related Attachments + * @param integer $id - contactid + * returns related Attachment record in array format + */ + function get_attachments($id) + { + global $log; + $log->debug("Entering get_attachments(".$id.") method ..."); + $query = "select vtiger_notes.title,'Notes ' AS ActivityType, + vtiger_notes.filename, vtiger_attachments.type AS FileType,crm2.modifiedtime AS lastmodified, + vtiger_seattachmentsrel.attachmentsid AS attachmentsid, vtiger_notes.notesid AS crmid, + crm2.createdtime, vtiger_notes.notecontent AS description, vtiger_users.user_name + from vtiger_notes + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_notes.contact_id + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_notes.notesid and crm2.deleted=0 + left join vtiger_seattachmentsrel on vtiger_seattachmentsrel.crmid =vtiger_notes.notesid + left join vtiger_attachments on vtiger_seattachmentsrel.attachmentsid = vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id; + $query .= " union all "; + $query .= "select vtiger_attachments.description AS title,'Attachments' AS ActivityType, + vtiger_attachments.name AS filename, vtiger_attachments.type AS FileType,crm2.modifiedtime AS lastmodified, + vtiger_attachments.attachmentsid AS attachmentsid, vtiger_seattachmentsrel.attachmentsid AS crmid, + crm2.createdtime, vtiger_attachments.description, vtiger_users.user_name + from vtiger_attachments + inner join vtiger_seattachmentsrel on vtiger_seattachmentsrel.attachmentsid= vtiger_attachments.attachmentsid + inner join vtiger_crmentity on vtiger_crmentity.crmid= vtiger_seattachmentsrel.crmid + inner join vtiger_crmentity crm2 on crm2.crmid=vtiger_attachments.attachmentsid + inner join vtiger_users on crm2.smcreatorid= vtiger_users.id + where vtiger_crmentity.crmid=".$id." + order by createdtime desc"; + $log->info("Notes&Attachmenmts for Contact Displayed"); + $log->debug("Exiting get_attachments method ..."); + return getAttachmentsAndNotes('Contacts',$query,$id); + } + /** + * Function to get Contact related Quotes + * @param integer $id - contactid + * returns related Quotes record in array format + */ + function get_quotes($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_quotes(".$id.") method ..."); + global $app_strings; + require_once('modules/Quotes/Quotes.php'); + $focus = new Quotes(); + + $button = ''; + if(isPermitted("Quotes",1,"") == 'yes') + { + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_quotes.*,vtiger_potential.potentialname,vtiger_contactdetails.lastname from vtiger_quotes inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_quotes.quoteid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_quotes.contactid left outer join vtiger_potential on vtiger_potential.potentialid=vtiger_quotes.potentialid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_quotegrouprelation on vtiger_quotes.quoteid=vtiger_quotegrouprelation.quoteid left join vtiger_groups on vtiger_groups.groupname=vtiger_quotegrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_contactdetails.contactid=".$id; + $log->debug("Exiting get_quotes method ..."); + return GetRelatedList('Contacts','Quotes',$focus,$query,$button,$returnset); + } + /** + * Function to get Contact related SalesOrder + * @param integer $id - contactid + * returns related SalesOrder record in array format + */ + function get_salesorder($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + global $app_strings; + $focus = new SalesOrder(); + $button = ''; + + if(isPermitted("SalesOrder",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname, vtiger_contactdetails.lastname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_salesorder.contactid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.contactid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Contacts','SalesOrder',$focus,$query,$button,$returnset); + } + /** + * Function to get Contact related Products + * @param integer $id - contactid + * returns related Products record in array format + */ + function get_products($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_products(".$id.") method ..."); + global $app_strings; + require_once('modules/Products/Products.php'); + $focus = new Products(); + $button = ''; + + if(isPermitted("Products",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $query = 'select vtiger_products.productid, vtiger_products.productname, vtiger_products.productcode, vtiger_products.commissionrate, vtiger_products.qty_per_unit, vtiger_products.unit_price, vtiger_crmentity.crmid, vtiger_crmentity.smownerid,vtiger_contactdetails.lastname from vtiger_products inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_products.productid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_products.contactid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted = 0'; + $log->debug("Exiting get_products method ..."); + return GetRelatedList('Contacts','Products',$focus,$query,$button,$returnset); + } + + /** + * Function to get Contact related PurchaseOrder + * @param integer $id - contactid + * returns related PurchaseOrder record in array format + */ + function get_purchase_orders($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_purchase_orders(".$id.") method ..."); + global $app_strings; + require_once('modules/PurchaseOrder/PurchaseOrder.php'); + $focus = new PurchaseOrder(); + + $button = ''; + + if(isPermitted("PurchaseOrder",1,"") == 'yes') + { + + $button .= ' '; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $query = "select vtiger_users.user_name,vtiger_crmentity.*, vtiger_purchaseorder.*,vtiger_vendor.vendorname,vtiger_contactdetails.lastname from vtiger_purchaseorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_purchaseorder.purchaseorderid left outer join vtiger_vendor on vtiger_purchaseorder.vendorid=vtiger_vendor.vendorid left outer join vtiger_contactdetails on vtiger_contactdetails.contactid=vtiger_purchaseorder.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left join vtiger_pogrouprelation on vtiger_purchaseorder.purchaseorderid=vtiger_pogrouprelation.purchaseorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_pogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_purchaseorder.contactid=".$id; + $log->debug("Exiting get_purchase_orders method ..."); + return GetRelatedList('Contacts','PurchaseOrder',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated emails + * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.. + * All Rights Reserved.. + * Contributor(s): ______________________________________.. + */ + function get_emails($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_emails(".$id.") method ..."); + global $mod_strings; + + $focus = new Emails(); + + $button = ''; + + if(isPermitted("Emails",1,"") == 'yes') + { + $button .= ''; + } + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + + $log->info("Email Related List for Contact Displayed"); + + $query = "select vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.activitytype, vtiger_users.user_name, vtiger_crmentity.modifiedtime, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_activity.date_start from vtiger_activity, vtiger_seactivityrel, vtiger_contactdetails, vtiger_users, vtiger_crmentity left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.activityid = vtiger_activity.activityid and vtiger_contactdetails.contactid = vtiger_seactivityrel.crmid and vtiger_users.id=vtiger_crmentity.smownerid and vtiger_crmentity.crmid = vtiger_activity.activityid and vtiger_contactdetails.contactid = ".$id." and vtiger_activity.activitytype='Emails' and vtiger_crmentity.deleted = 0"; + $log->debug("Exiting get_emails method ..."); + return GetRelatedList('Contacts','Emails',$focus,$query,$button,$returnset); + } + + /** Returns a list of the associated Campaigns + * @param $id -- campaign id :: Type Integer + * @returns list of campaigns in array format + */ + + function get_campaigns($id) + { + global $log, $singlepane_view; + $log->debug("Entering get_campaigns(".$id.") method ..."); + global $mod_strings; + + $focus = new Campaigns(); + if($singlepane_view == 'true') + $returnset = '&return_module=Contacts&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Contacts&return_action=CallRelatedList&return_id='.$id; + $button = ''; + + $log->info("Campaign Related List for Contact Displayed"); + $query = "SELECT vtiger_users.user_name, vtiger_campaign.campaignid, vtiger_campaign.campaignname, vtiger_campaign.campaigntype, vtiger_campaign.campaignstatus, vtiger_campaign.expectedrevenue, vtiger_campaign.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_campaign inner join vtiger_campaigncontrel on vtiger_campaigncontrel.campaignid=vtiger_campaign.campaignid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_campaign.campaignid left join vtiger_campaigngrouprelation on vtiger_campaign.campaignid=vtiger_campaigngrouprelation.campaignid left join vtiger_groups on vtiger_groups.groupname=vtiger_campaigngrouprelation.groupname left join vtiger_users on vtiger_users.id = vtiger_crmentity.smownerid where vtiger_campaigncontrel.contactid=".$id." and vtiger_crmentity.deleted=0"; + + $log->debug("Exiting get_campaigns method ..."); + return GetRelatedList('Contacts','Campaigns',$focus,$query,$button,$returnset); + + } + /** Function to export the contact records in CSV Format + * @param reference variable - order by is passed when the query is executed + * @param reference variable - where condition is passed when the query is executed + * Returns Export Contacts Query. + */ + function create_export_query(&$order_by, &$where) + { + global $log; + global $current_user; + $log->debug("Entering create_export_query(".$order_by.",".$where.") method ..."); + + include("include/utils/ExportUtils.php"); + + //To get the Permitted fields query and the permitted fields list + $sql = getPermittedFieldsQuery("Contacts", "detail_view"); + $fields_list = getFieldsListFromQuery($sql); + + $query = "SELECT $fields_list, vtiger_contactgrouprelation.groupname as 'Assigned To Group' + FROM vtiger_contactdetails + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid + LEFT JOIN vtiger_users ON vtiger_crmentity.smownerid=vtiger_users.id and vtiger_users.status='Active' + LEFT JOIN vtiger_account on vtiger_contactdetails.accountid=vtiger_account.accountid + left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid + left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid=vtiger_contactdetails.contactid + left join vtiger_contactscf on vtiger_contactscf.contactid=vtiger_contactdetails.contactid + left join vtiger_customerdetails on vtiger_customerdetails.customerid=vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation + ON vtiger_contactscf.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups + ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + LEFT JOIN vtiger_contactdetails vtiger_contactdetails2 + ON vtiger_contactdetails2.contactid = vtiger_contactdetails.reportsto + where vtiger_crmentity.deleted=0"; + //vtiger_contactdetails2 is added to get the Reports To of Contact + + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + //we should add security check when the user has Private Access + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[4] == 3) + { + //Added security check to get the permitted records only + $query = $query." ".getListViewSecurityParameter("Contacts"); + } + + $log->info("Export Query Constructed Successfully"); + $log->debug("Exiting create_export_query method ..."); + return $query; + } + + +/** Function to get the Columnnames of the Contacts +* Used By vtigerCRM Word Plugin +* Returns the Merge Fields for Word Plugin +*/ +function getColumnNames() +{ + global $log, $current_user; + $log->debug("Entering getColumnNames() method ..."); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select fieldlabel from vtiger_field where tabid=4 and block <> 75"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select fieldlabel 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 where vtiger_field.tabid=4 and vtiger_field.block <> 6 and vtiger_field.block <> 75 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result = $this->db->query($sql1); + $numRows = $this->db->num_rows($result); + for($i=0; $i < $numRows;$i++) + { + $custom_fields[$i] = $this->db->query_result($result,$i,"fieldlabel"); + $custom_fields[$i] = ereg_replace(" ","",$custom_fields[$i]); + $custom_fields[$i] = strtoupper($custom_fields[$i]); + } + $mergeflds = $custom_fields; + $log->debug("Exiting getColumnNames method ..."); + return $mergeflds; +} +//End +/** Function to get the Contacts assigned to a user with a valid email address. +* @param varchar $username - User Name +* @param varchar $emailaddress - Email Addr for each contact. +* Used By vtigerCRM Outlook Plugin +* Returns the Query +*/ +function get_searchbyemailid($username,$emailaddress) +{ + global $log; + global $current_user; + require_once("modules/Users/Users.php"); + $seed_user=new Users(); + $user_id=$seed_user->retrieve_user_id($username); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + $log->debug("Entering get_searchbyemailid(".$username.",".$emailaddress.") method ..."); + $query = "select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname, + vtiger_contactdetails.contactid, vtiger_contactdetails.salutation, + vtiger_contactdetails.email,vtiger_contactdetails.title, + vtiger_contactdetails.mobile,vtiger_account.accountname, + vtiger_account.accountid as accountid from vtiger_contactdetails + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid + inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid + left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid + left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + where vtiger_crmentity.deleted=0 and vtiger_contactdetails.email like '%".$emailaddress."%'"; + $tab_id = getTabid("Contacts"); + if($is_admin==false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1 && $defaultOrgSharingPermission[$tab_id] == 3) + { + $sec_parameter=getListViewSecurityParameter("Contacts"); + $query .= $sec_parameter; + + } + $log->debug("Exiting get_searchbyemailid method ..."); + return $this->plugin_process_list_query($query); +} + +/** Function to get the Contacts associated with the particular User Name. +* @param varchar $user_name - User Name +* Returns query +*/ + +function get_contactsforol($user_name) +{ + global $log,$adb; + global $current_user; + require_once("modules/Users/Users.php"); + $seed_user=new Users(); + $user_id=$seed_user->retrieve_user_id($user_name); + $current_user=$seed_user; + $current_user->retrieve_entity_info($user_id, 'Users'); + require('user_privileges/user_privileges_'.$current_user->id.'.php'); + require('user_privileges/sharing_privileges_'.$current_user->id.'.php'); + + if($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) + { + $sql1 = "select tablename,columnname from vtiger_field where tabid=4 and block <> 75 and block <> 6 and vtiger_field.block <> 5"; + }else + { + $profileList = getCurrentUserProfileList(); + $sql1 = "select tablename,columnname 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 where vtiger_field.tabid=4 and vtiger_field.block <> 75 and vtiger_field.block <> 6 and vtiger_field.block <> 5 and vtiger_field.displaytype in (1,2,4) and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_profile2field.profileid in ".$profileList; + } + $result1 = $adb->query($sql1); + for($i=0;$i < $adb->num_rows($result1);$i++) + { + $permitted_lists[] = $adb->query_result($result1,$i,'tablename'); + $permitted_lists[] = $adb->query_result($result1,$i,'columnname'); + if($adb->query_result($result1,$i,'columnname') == "accountid") + { + $permitted_lists[] = 'vtiger_account'; + $permitted_lists[] = 'accountname'; + } + } + $permitted_lists = array_chunk($permitted_lists,2); + $column_table_lists = array(); + for($i=0;$i < count($permitted_lists);$i++) + { + $column_table_lists[] = implode(".",$permitted_lists[$i]); + } + + $log->debug("Entering get_contactsforol(".$user_name.") method ..."); + $query = "select vtiger_contactdetails.contactid as id, ".implode(',',$column_table_lists)." from vtiger_contactdetails + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid + inner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid + left join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid + left join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid + left join vtiger_contactsubdetails on vtiger_contactsubdetails.contactsubscriptionid = vtiger_contactdetails.contactid + LEFT JOIN vtiger_contactgrouprelation ON vtiger_contactdetails.contactid = vtiger_contactgrouprelation.contactid + LEFT JOIN vtiger_groups ON vtiger_groups.groupname = vtiger_contactgrouprelation.groupname + where vtiger_crmentity.deleted=0 and vtiger_users.user_name='".$user_name."'"; + $log->debug("Exiting get_contactsforol method ..."); + return $query; +} + + + /** Function to handle module specific operations when saving a entity + */ + function save_module($module) + { + $this->insertIntoAttachment($this->id,$module); + } + + /** + * This function is used to add the vtiger_attachments. This will call the function uploadAndSaveFile which will upload the attachment into the server and save that attachment information in the database. + * @param int $id - entity id to which the vtiger_files to be uploaded + * @param string $module - the current module name + */ + function insertIntoAttachment($id,$module) + { + global $log, $adb; + $log->debug("Entering into insertIntoAttachment($id,$module) method."); + + $file_saved = false; + + //This is to added to store the existing attachment id of the contact where we should delete this when we give new image + $old_attachmentid = $adb->query_result($adb->query("select * from vtiger_seattachmentsrel where crmid=$id"),0,'attachmentsid'); + + foreach($_FILES as $fileindex => $files) + { + if($files['name'] != '' && $files['size'] > 0) + { + $file_saved = $this->uploadAndSaveFile($id,$module,$files); + } + } + + //This is to handle the delete image for contacts + if($module == 'Contacts' && $file_saved) + { + $del_res1 = $adb->query("delete from vtiger_attachments where attachmentsid=$old_attachmentid"); + $del_res2 = $adb->query("delete from vtiger_seattachmentsrel where attachmentsid=$old_attachmentid"); + } + + $log->debug("Exiting from insertIntoAttachment($id,$module) method."); + } + + +//End + +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 07:07:28 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:07:28 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9911 - /vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php Message-ID: <20061127120728.E4B22789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:07:17 2006 New Revision: 9911 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php Modified: vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php (original) +++ vtigercrm/branches/5.0.3/modules/Campaigns/Campaigns.php Mon Nov 27 05:07:17 2006 @@ -55,6 +55,8 @@ //Added these variables which are used as default order by and sortorder in ListView var $default_order_by = 'crmid'; var $default_sort_order = 'DESC'; + + var $groupTable = Array('vtiger_campaigngrouprelation','campaignid'); var $search_fields = Array( 'Campaign Name'=>Array('vtiger_campaign'=>'campaignname'), From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 07:08:54 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:08:54 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9912 - /vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php Message-ID: <20061127120854.EBC48789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:08:44 2006 New Revision: 9912 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php Modified: vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php (original) +++ vtigercrm/branches/5.0.3/modules/Accounts/Accounts.php Mon Nov 27 05:08:44 2006 @@ -48,7 +48,8 @@ var $sortby_fields = Array('accountname','city','website','phone','smownerid'); - + var $groupTable = Array('vtiger_accountgrouprelation','accountid'); + // This is the list of vtiger_fields that are in the lists. var $list_fields = Array( 'Account Name'=>Array('vtiger_account'=>'accountname'), From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 07:12:01 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 12:12:01 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9913 - /vtigercrm/branches/5.0.3/modules/Calendar/Activity.php Message-ID: <20061127121201.91E8478969B@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 05:11:53 2006 New Revision: 9913 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Calendar/Activity.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/Activity.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/Activity.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/Activity.php Mon Nov 27 05:11:53 2006 @@ -86,6 +86,8 @@ //Added these variables which are used as default order by and sortorder in ListView var $default_order_by = 'due_date'; var $default_sort_order = 'ASC'; + + var $groupTable = Array('vtiger_activitygrouprelation','activityid'); function Activity() { $this->log = LoggerManager::getLogger('Calendar'); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 10:36:07 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 15:36:07 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9914 - /vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Message-ID: <20061127153607.B484678969B@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 08:36:02 2006 New Revision: 9914 Log: changes made fix empty combo list in quick create Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Modified: vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/QuickCreate.tpl Mon Nov 27 08:36:02 2006 @@ -69,7 +69,7 @@ From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 12:33:27 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:33:27 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9915 - /vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php Message-ID: <20061127173327.472A0789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:33:17 2006 New Revision: 9915 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php Modified: vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php (original) +++ vtigercrm/branches/5.0.3/modules/HelpDesk/HelpDesk.php Mon Nov 27 10:33:17 2006 @@ -80,6 +80,8 @@ var $default_order_by = 'crmid'; var $default_sort_order = 'DESC'; + var $groupTable = Array('vtiger_ticketgrouprelation','ticketid'); + /** Constructor which will set the column_fields in this object */ function HelpDesk() From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 12:36:30 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:36:30 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9916 - /vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php Message-ID: <20061127173630.E6280788A36@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:36:24 2006 New Revision: 9916 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php Modified: vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php (original) +++ vtigercrm/branches/5.0.3/modules/Invoice/Invoice.php Mon Nov 27 10:36:24 2006 @@ -83,6 +83,8 @@ var $default_order_by = 'crmid'; var $default_sort_order = 'ASC'; + var $groupTable = Array('vtiger_invoicegrouprelation','invoiceid'); + /** Constructor which will set the column_fields in this object */ function Invoice() { From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 12:38:08 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:38:08 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9917 - /vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php Message-ID: <20061127173808.8560D789687@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:37:58 2006 New Revision: 9917 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php Modified: vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php (original) +++ vtigercrm/branches/5.0.3/modules/PurchaseOrder/PurchaseOrder.php Mon Nov 27 10:37:58 2006 @@ -86,6 +86,8 @@ var $default_order_by = 'subject'; var $default_sort_order = 'ASC'; + var $groupTable = Array('vtiger_pogrouprelation','purchaseorderid'); + /** Constructor Function for Order class * This function creates an instance of LoggerManager class using getLogger method * creates an instance for PearDatabase class and get values for column_fields array of Order class. From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 12:39:56 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:39:56 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9918 - /vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php Message-ID: <20061127173956.A202C788A36@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:39:46 2006 New Revision: 9918 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php Modified: vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php (original) +++ vtigercrm/branches/5.0.3/modules/Quotes/Quotes.php Mon Nov 27 10:39:46 2006 @@ -1,272 +1,275 @@ -'crmid','vtiger_quotes'=>'quoteid','vtiger_quotesbillads'=>'quotebilladdressid','vtiger_quotesshipads'=>'quoteshipaddressid','vtiger_quotescf'=>'quoteid'); - - var $entity_table = "vtiger_crmentity"; - - var $billadr_table = "vtiger_quotesbillads"; - - var $object_name = "Quote"; - - var $new_schema = true; - - var $module_id = "quoteid"; - - var $column_fields = Array(); - - var $sortby_fields = Array('subject','crmid','smownerid'); - - // This is used to retrieve related vtiger_fields from form posts. - var $additional_column_fields = Array('assigned_user_name', 'smownerid', 'opportunity_id', 'case_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id', 'parent_name', 'member_id' ); - - // This is the list of vtiger_fields that are in the lists. - var $list_fields = Array( - 'Quote Id'=>Array('crmentity'=>'crmid'), - 'Subject'=>Array('quotes'=>'subject'), - 'Quote Stage'=>Array('quotes'=>'quotestage'), - 'Potential Name'=>Array('quotes'=>'potentialid'), - 'Account Name'=>Array('account'=> 'accountid'), - 'Total'=>Array('quotes'=> 'total'), - 'Assigned To'=>Array('crmentity'=>'smownerid') - ); - - var $list_fields_name = Array( - 'Quote Id'=>'', - 'Subject'=>'subject', - 'Quote Stage'=>'quotestage', - 'Potential Name'=>'potential_id', - 'Account Name'=>'account_id', - 'Total'=>'hdnGrandTotal', - 'Assigned To'=>'assigned_user_id' - ); - var $list_link_field= 'subject'; - - var $search_fields = Array( - 'Quote Id'=>Array('crmentity'=>'crmid'), - 'Subject'=>Array('quotes'=>'subject'), - 'Account Name'=>Array('quotes'=>'accountid'), - 'Quote Stage'=>Array('quotes'=>'quotestage'), - ); - - var $search_fields_name = Array( - 'Quote Id'=>'', - 'Subject'=>'subject', - 'Account Name'=>'account_id', - 'Quote Stage'=>'quotestage', - ); - - // This is the list of vtiger_fields that are required. - var $required_fields = array("accountname"=>1); - - //Added these variables which are used as default order by and sortorder in ListView - var $default_order_by = 'crmid'; - var $default_sort_order = 'ASC'; - - /** Constructor which will set the column_fields in this object - */ - function Quotes() { - $this->log =LoggerManager::getLogger('quote'); - $this->db = new PearDatabase(); - $this->column_fields = getColumnFields('Quotes'); - } - - function save_module() - { - //in ajax save we should not call this function, because this will delete all the existing product values - if($_REQUEST['action'] != 'QuotesAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW') - { - //Based on the total Number of rows we will save the product relationship with this entity - saveInventoryProductDetails(&$this, 'Quotes'); - } - } - - /** Function used to get the sort order for Quote listview - * @return string $sorder - first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['QUOTES_SORT_ORDER'] if this session value is empty then default sort order will be returned. - */ - function getSortOrder() - { - global $log; - $log->debug("Entering getSortOrder() method ..."); - if(isset($_REQUEST['sorder'])) - $sorder = $_REQUEST['sorder']; - else - $sorder = (($_SESSION['QUOTES_SORT_ORDER'] != '')?($_SESSION['QUOTES_SORT_ORDER']):($this->default_sort_order)); - $log->debug("Exiting getSortOrder() method ..."); - return $sorder; - } - - /** Function used to get the order by value for Quotes listview - * @return string $order_by - first check the $_REQUEST['order_by'] if request value is empty then check in the $_SESSION['QUOTES_ORDER_BY'] if this session value is empty then default order by will be returned. - */ - function getOrderBy() - { - global $log; - $log->debug("Entering getOrderBy() method ..."); - if (isset($_REQUEST['order_by'])) - $order_by = $_REQUEST['order_by']; - else - $order_by = (($_SESSION['QUOTES_ORDER_BY'] != '')?($_SESSION['QUOTES_ORDER_BY']):($this->default_order_by)); - $log->debug("Exiting getOrderBy method ..."); - return $order_by; - } - - /** function used to get the list of sales orders which are related to the Quotes - * @param int $id - quote id - * @return array - return an array which will be returned from the function GetRelatedList - */ - function get_salesorder($id) - { - global $log,$singlepane_view; - $log->debug("Entering get_salesorder(".$id.") method ..."); - require_once('modules/SalesOrder/SalesOrder.php'); - $focus = new SalesOrder(); - - $button = ''; - - if($singlepane_view == 'true') - $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; - - $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.quoteid = ".$id; - $log->debug("Exiting get_salesorder method ..."); - return GetRelatedList('Quotes','SalesOrder',$focus,$query,$button,$returnset); - } - - /** function used to get the list of activities which are related to the Quotes - * @param int $id - quote id - * @return array - return an array which will be returned from the function GetRelatedList - */ - function get_activities($id) - { - global $log,$singlepane_view; - $log->debug("Entering get_activities(".$id.") method ..."); - global $app_strings; - require_once('modules/Calendar/Activity.php'); - $focus = new Activity(); - - $button = ''; - - if($singlepane_view == 'true') - $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; - else - $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; - - $query = "SELECT vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred')"; - $log->debug("Exiting get_activities method ..."); - return GetRelatedList('Quotes','Calendar',$focus,$query,$button,$returnset); - } - - /** function used to get the the activity history related to the quote - * @param int $id - quote id - * @return array - return an array which will be returned from the function GetHistory - */ - function get_history($id) - { - global $log; - $log->debug("Entering get_history(".$id.") method ..."); - $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, - vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_contactdetails.contactid, - vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_crmentity.modifiedtime, - vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name - from vtiger_activity - inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid - inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid - left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid - left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid - inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id - left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid - left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname - where vtiger_activity.activitytype='Task' - and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred') - and vtiger_seactivityrel.crmid=".$id; - //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php - - $log->debug("Exiting get_history method ..."); - return getHistory('Quotes',$query,$id); - } - - - /** Function used to get the Quote Stage history of the Quotes - * @param $id - quote id - * @return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are arrays which contains header values and all column values of all entries - */ - function get_quotestagehistory($id) - { - global $log; - $log->debug("Entering get_quotestagehistory(".$id.") method ..."); - - global $adb; - global $mod_strings; - global $app_strings; - - $query = 'select vtiger_quotestagehistory.*, vtiger_quotes.subject from vtiger_quotestagehistory inner join vtiger_quotes on vtiger_quotes.quoteid = vtiger_quotestagehistory.quoteid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_quotes.quoteid where vtiger_crmentity.deleted = 0 and vtiger_quotes.quoteid = '.$id; - $result=$adb->query($query); - $noofrows = $adb->num_rows($result); - - $header[] = $app_strings['Quote Id']; - $header[] = $app_strings['LBL_ACCOUNT_NAME']; - $header[] = $app_strings['LBL_AMOUNT']; - $header[] = $app_strings['Quote Stage']; - $header[] = $app_strings['LBL_LAST_MODIFIED']; - - while($row = $adb->fetch_array($result)) - { - $entries = Array(); - - $entries[] = $row['quoteid']; - $entries[] = $row['accountname']; - $entries[] = $row['total']; - $entries[] = $row['quotestage']; - $entries[] = getDisplayDate($row['lastmodified']); - - $entries_list[] = $entries; - } - - $return_data = Array('header'=>$header,'entries'=>$entries_list); - - $log->debug("Exiting get_quotestagehistory method ..."); - - return $return_data; - } - -} - -?> +'crmid','vtiger_quotes'=>'quoteid','vtiger_quotesbillads'=>'quotebilladdressid','vtiger_quotesshipads'=>'quoteshipaddressid','vtiger_quotescf'=>'quoteid'); + + var $entity_table = "vtiger_crmentity"; + + var $billadr_table = "vtiger_quotesbillads"; + + var $object_name = "Quote"; + + var $new_schema = true; + + var $module_id = "quoteid"; + + var $column_fields = Array(); + + var $sortby_fields = Array('subject','crmid','smownerid'); + + // This is used to retrieve related vtiger_fields from form posts. + var $additional_column_fields = Array('assigned_user_name', 'smownerid', 'opportunity_id', 'case_id', 'contact_id', 'task_id', 'note_id', 'meeting_id', 'call_id', 'email_id', 'parent_name', 'member_id' ); + + // This is the list of vtiger_fields that are in the lists. + var $list_fields = Array( + 'Quote Id'=>Array('crmentity'=>'crmid'), + 'Subject'=>Array('quotes'=>'subject'), + 'Quote Stage'=>Array('quotes'=>'quotestage'), + 'Potential Name'=>Array('quotes'=>'potentialid'), + 'Account Name'=>Array('account'=> 'accountid'), + 'Total'=>Array('quotes'=> 'total'), + 'Assigned To'=>Array('crmentity'=>'smownerid') + ); + + var $list_fields_name = Array( + 'Quote Id'=>'', + 'Subject'=>'subject', + 'Quote Stage'=>'quotestage', + 'Potential Name'=>'potential_id', + 'Account Name'=>'account_id', + 'Total'=>'hdnGrandTotal', + 'Assigned To'=>'assigned_user_id' + ); + var $list_link_field= 'subject'; + + var $search_fields = Array( + 'Quote Id'=>Array('crmentity'=>'crmid'), + 'Subject'=>Array('quotes'=>'subject'), + 'Account Name'=>Array('quotes'=>'accountid'), + 'Quote Stage'=>Array('quotes'=>'quotestage'), + ); + + var $search_fields_name = Array( + 'Quote Id'=>'', + 'Subject'=>'subject', + 'Account Name'=>'account_id', + 'Quote Stage'=>'quotestage', + ); + + // This is the list of vtiger_fields that are required. + var $required_fields = array("accountname"=>1); + + //Added these variables which are used as default order by and sortorder in ListView + var $default_order_by = 'crmid'; + var $default_sort_order = 'ASC'; + var $groupTable = Array('vtiger_quotegrouprelation','quoteid'); + + + + /** Constructor which will set the column_fields in this object + */ + function Quotes() { + $this->log =LoggerManager::getLogger('quote'); + $this->db = new PearDatabase(); + $this->column_fields = getColumnFields('Quotes'); + } + + function save_module() + { + //in ajax save we should not call this function, because this will delete all the existing product values + if($_REQUEST['action'] != 'QuotesAjax' && $_REQUEST['ajxaction'] != 'DETAILVIEW') + { + //Based on the total Number of rows we will save the product relationship with this entity + saveInventoryProductDetails(&$this, 'Quotes'); + } + } + + /** Function used to get the sort order for Quote listview + * @return string $sorder - first check the $_REQUEST['sorder'] if request value is empty then check in the $_SESSION['QUOTES_SORT_ORDER'] if this session value is empty then default sort order will be returned. + */ + function getSortOrder() + { + global $log; + $log->debug("Entering getSortOrder() method ..."); + if(isset($_REQUEST['sorder'])) + $sorder = $_REQUEST['sorder']; + else + $sorder = (($_SESSION['QUOTES_SORT_ORDER'] != '')?($_SESSION['QUOTES_SORT_ORDER']):($this->default_sort_order)); + $log->debug("Exiting getSortOrder() method ..."); + return $sorder; + } + + /** Function used to get the order by value for Quotes listview + * @return string $order_by - first check the $_REQUEST['order_by'] if request value is empty then check in the $_SESSION['QUOTES_ORDER_BY'] if this session value is empty then default order by will be returned. + */ + function getOrderBy() + { + global $log; + $log->debug("Entering getOrderBy() method ..."); + if (isset($_REQUEST['order_by'])) + $order_by = $_REQUEST['order_by']; + else + $order_by = (($_SESSION['QUOTES_ORDER_BY'] != '')?($_SESSION['QUOTES_ORDER_BY']):($this->default_order_by)); + $log->debug("Exiting getOrderBy method ..."); + return $order_by; + } + + /** function used to get the list of sales orders which are related to the Quotes + * @param int $id - quote id + * @return array - return an array which will be returned from the function GetRelatedList + */ + function get_salesorder($id) + { + global $log,$singlepane_view; + $log->debug("Entering get_salesorder(".$id.") method ..."); + require_once('modules/SalesOrder/SalesOrder.php'); + $focus = new SalesOrder(); + + $button = ''; + + if($singlepane_view == 'true') + $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; + + $query = "select vtiger_crmentity.*, vtiger_salesorder.*, vtiger_quotes.subject as quotename, vtiger_account.accountname from vtiger_salesorder inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_salesorder.salesorderid left outer join vtiger_quotes on vtiger_quotes.quoteid=vtiger_salesorder.quoteid left outer join vtiger_account on vtiger_account.accountid=vtiger_salesorder.accountid left join vtiger_sogrouprelation on vtiger_salesorder.salesorderid=vtiger_sogrouprelation.salesorderid left join vtiger_groups on vtiger_groups.groupname=vtiger_sogrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_salesorder.quoteid = ".$id; + $log->debug("Exiting get_salesorder method ..."); + return GetRelatedList('Quotes','SalesOrder',$focus,$query,$button,$returnset); + } + + /** function used to get the list of activities which are related to the Quotes + * @param int $id - quote id + * @return array - return an array which will be returned from the function GetRelatedList + */ + function get_activities($id) + { + global $log,$singlepane_view; + $log->debug("Entering get_activities(".$id.") method ..."); + global $app_strings; + require_once('modules/Calendar/Activity.php'); + $focus = new Activity(); + + $button = ''; + + if($singlepane_view == 'true') + $returnset = '&return_module=Quotes&return_action=DetailView&return_id='.$id; + else + $returnset = '&return_module=Quotes&return_action=CallRelatedList&return_id='.$id; + + $query = "SELECT vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_activity.*,vtiger_seactivityrel.*,vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime, vtiger_users.user_name,vtiger_recurringevents.recurringtype from vtiger_activity inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid left join vtiger_contactdetails on vtiger_contactdetails.contactid = vtiger_cntactivityrel.contactid left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid left outer join vtiger_recurringevents on vtiger_recurringevents.activityid=vtiger_activity.activityid left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_crmentity.crmid left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname where vtiger_seactivityrel.crmid=".$id." and activitytype='Task' and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Completed') and (vtiger_activity.status is not NULL && vtiger_activity.status != 'Deferred')"; + $log->debug("Exiting get_activities method ..."); + return GetRelatedList('Quotes','Calendar',$focus,$query,$button,$returnset); + } + + /** function used to get the the activity history related to the quote + * @param int $id - quote id + * @return array - return an array which will be returned from the function GetHistory + */ + function get_history($id) + { + global $log; + $log->debug("Entering get_history(".$id.") method ..."); + $query = "SELECT vtiger_activity.activityid, vtiger_activity.subject, vtiger_activity.status, + vtiger_activity.eventstatus, vtiger_activity.activitytype, vtiger_contactdetails.contactid, + vtiger_contactdetails.firstname,vtiger_contactdetails.lastname, vtiger_crmentity.modifiedtime, + vtiger_crmentity.createdtime, vtiger_crmentity.description, vtiger_users.user_name + from vtiger_activity + inner join vtiger_seactivityrel on vtiger_seactivityrel.activityid=vtiger_activity.activityid + inner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_activity.activityid + left join vtiger_cntactivityrel on vtiger_cntactivityrel.activityid= vtiger_activity.activityid + left join vtiger_contactdetails on vtiger_contactdetails.contactid= vtiger_cntactivityrel.contactid + inner join vtiger_users on vtiger_crmentity.smcreatorid= vtiger_users.id + left join vtiger_activitygrouprelation on vtiger_activitygrouprelation.activityid=vtiger_activity.activityid + left join vtiger_groups on vtiger_groups.groupname=vtiger_activitygrouprelation.groupname + where vtiger_activity.activitytype='Task' + and (vtiger_activity.status = 'Completed' or vtiger_activity.status = 'Deferred') + and vtiger_seactivityrel.crmid=".$id; + //Don't add order by, because, for security, one more condition will be added with this query in include/RelatedListView.php + + $log->debug("Exiting get_history method ..."); + return getHistory('Quotes',$query,$id); + } + + + /** Function used to get the Quote Stage history of the Quotes + * @param $id - quote id + * @return $return_data - array with header and the entries in format Array('header'=>$header,'entries'=>$entries_list) where as $header and $entries_list are arrays which contains header values and all column values of all entries + */ + function get_quotestagehistory($id) + { + global $log; + $log->debug("Entering get_quotestagehistory(".$id.") method ..."); + + global $adb; + global $mod_strings; + global $app_strings; + + $query = 'select vtiger_quotestagehistory.*, vtiger_quotes.subject from vtiger_quotestagehistory inner join vtiger_quotes on vtiger_quotes.quoteid = vtiger_quotestagehistory.quoteid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_quotes.quoteid where vtiger_crmentity.deleted = 0 and vtiger_quotes.quoteid = '.$id; + $result=$adb->query($query); + $noofrows = $adb->num_rows($result); + + $header[] = $app_strings['Quote Id']; + $header[] = $app_strings['LBL_ACCOUNT_NAME']; + $header[] = $app_strings['LBL_AMOUNT']; + $header[] = $app_strings['Quote Stage']; + $header[] = $app_strings['LBL_LAST_MODIFIED']; + + while($row = $adb->fetch_array($result)) + { + $entries = Array(); + + $entries[] = $row['quoteid']; + $entries[] = $row['accountname']; + $entries[] = $row['total']; + $entries[] = $row['quotestage']; + $entries[] = getDisplayDate($row['lastmodified']); + + $entries_list[] = $entries; + } + + $return_data = Array('header'=>$header,'entries'=>$entries_list); + + $log->debug("Exiting get_quotestagehistory method ..."); + + return $return_data; + } + +} + +?> From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 12:41:19 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:41:19 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9919 - /vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php Message-ID: <20061127174120.1AD55788A36@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:41:11 2006 New Revision: 9919 Log: added var $groupTable --by Don Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php Modified: vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php (original) +++ vtigercrm/branches/5.0.3/modules/SalesOrder/SalesOrder.php Mon Nov 27 10:41:11 2006 @@ -95,6 +95,7 @@ //Added these variables which are used as default order by and sortorder in ListView var $default_order_by = 'subject'; var $default_sort_order = 'ASC'; + var $groupTable = Array('vtiger_sogrouprelation','salesorderid'); /** Constructor Function for SalesOrder class From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 12:43:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:43:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9920 - /vtigercrm/branches/5.0.3/include/utils/utils.php Message-ID: <20061127174323.46B9E789668@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:43:10 2006 New Revision: 9920 Log: group handling code made generic Modified: vtigercrm/branches/5.0.3/include/utils/utils.php Modified: vtigercrm/branches/5.0.3/include/utils/utils.php ============================================================================== --- vtigercrm/branches/5.0.3/include/utils/utils.php (original) +++ vtigercrm/branches/5.0.3/include/utils/utils.php Mon Nov 27 10:43:10 2006 @@ -1181,6 +1181,12 @@ elseif($module == 'Campaigns') { $query1="select vtiger_groups.groupid from vtiger_campaigngrouprelation inner join vtiger_groups on vtiger_groups.groupname = vtiger_campaigngrouprelation.groupname where campaignid=".$record; + } + else + { + require_once("modules/$module/$module.php"); + $modObj = new $module(); + $query1="select vtiger_groups.groupid from vtiger_".$module."grouprelation inner join vtiger_groups on vtiger_groups.groupname = vtiger_".$module."grouprelation.groupname where ".$modObj->groupTable[1]."=".$record; } $result1=$adb->query($query1); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 12:47:40 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:47:40 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9921 - /vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php Message-ID: <20061127174740.C8C0F789668@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:47:34 2006 New Revision: 9921 Log: made the code generic for module addition -- field level security support Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php Modified: vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/DefaultFieldPermissions.php Mon Nov 27 10:47:34 2006 @@ -31,9 +31,10 @@ $image_path=$theme_path."images/"; require_once($theme_path.'layout_utils.php'); -$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq'); +//$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq'); +$field_module=getFieldModuleAccessArray(); $allfields=Array(); -foreach($field_module as $fld_module) +foreach($field_module as $fld_module=>$mod_name) { $fieldListResult = getDefOrgFieldList($fld_module); $noofrows = $adb->num_rows($fieldListResult); From vtigercrm-commits at vtiger.fosslabs.com Mon Nov 27 12:48:34 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Mon, 27 Nov 2006 17:48:34 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9922 - /vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php Message-ID: <20061127174834.EFFD0789668@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 10:48:26 2006 New Revision: 9922 Log: made the code generic for module addition -- field level security support Modified: vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php Modified: vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php (original) +++ vtigercrm/branches/5.0.3/modules/Users/UpdateDefaultFieldLevelAccess.php Mon Nov 27 10:48:26 2006 @@ -14,8 +14,11 @@ require_once('include/utils/utils.php'); global $adb; -$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Emails','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq'); -foreach($field_module as $fld_module) +//$field_module = Array('Leads','Accounts','Contacts','Potentials','HelpDesk','Products','Notes','Emails','Calendar','Events','Vendors','PriceBooks','Quotes','PurchaseOrder','SalesOrder','Invoice','Campaigns','Faq'); + +$field_module=getFieldModuleAccessArray(); + +foreach($field_module as $fld_module=>$fld_name) { $fieldListResult = getDefOrgFieldList($fld_module); $noofrows = $adb->num_rows($fieldListResult); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 28 01:07:39 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 28 Nov 2006 06:07:39 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9923 - in /vtigercrm/branches/5.0.3/modules/Calendar: CalendarCommon.php Save.php TodoSave.php Message-ID: <20061128060739.55C707888FD@vtiger.fosslabs.com> Author: richie Date: Mon Nov 27 23:07:32 2006 New Revision: 9923 Log: Problem in send notification in ToDo - fixed Modified: vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php vtigercrm/branches/5.0.3/modules/Calendar/Save.php vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php Modified: vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/CalendarCommon.php Mon Nov 27 23:07:32 2006 @@ -359,4 +359,42 @@ } //Code Added by Minnie -Ends +/** + * Function to get the vtiger_activity details for mail body + * @param string $description - activity description + * return string $list - HTML in string format + */ +function getActivityDetails($description,$inviteeid='') +{ + global $log,$current_user; + global $adb,$mod_strings; + $log->debug("Entering getActivityDetails(".$description.") method ..."); + + $reply = (($_REQUEST['mode'] == 'edit')?'Replied':'Created'); + if($inviteeid=='') + $name = getUserName($_REQUEST['assigned_user_id']); + else + $name = getUserName($inviteeid); + + $current_username = getUserName($current_user->id); + $status = (($_REQUEST['activity_mode']=='Task')?($_REQUEST['taskstatus']):($_REQUEST['eventstatus'])); + + $list = $mod_strings['LBL_DEAR'].' ' .$name.','; + $list .= '

'.$mod_strings['LBL_ACTIVITY_STRING'].' '.$reply.'. '.$mod_strings['LBL_DETAILS_STRING'].':'; + $list .= '
'.$mod_strings["LBL_SUBJECT"].' '.$_REQUEST['subject']; + $list .= '
'.$mod_strings["LBL_STATUS"].': '.$status; + $list .= '
'.$mod_strings["Priority"].': '.$_REQUEST['taskpriority']; + $list .= '
'.$mod_strings["Related To"].' : '.$_REQUEST['parent_name']; + if($_REQUEST['activity_mode']!= 'Events') + { + $list .= '
'.$mod_strings["LBL_CONTACT"].' '.$_REQUEST['contactlist']; + } + $list .= '
'.$mod_strings["LBL_APP_DESCRIPTION"].': '.$description; + $list .= '

'.$mod_strings["LBL_REGARDS_STRING"].' ,'; + $list .= '
'.$current_username.'.'; + + $log->debug("Exiting getActivityDetails method ..."); + return $list; +} + ?> Modified: vtigercrm/branches/5.0.3/modules/Calendar/Save.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/Save.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/Save.php Mon Nov 27 23:07:32 2006 @@ -26,6 +26,7 @@ //require("modules/Emails/class.phpmailer.php"); require_once("config.php"); require_once('include/database/PearDatabase.php'); +require_once('modules/Calendar/CalendarCommon.php'); global $adb; $local_log =& LoggerManager::getLogger('index'); $focus = new Activity(); @@ -194,38 +195,4 @@ else header("Location: index.php?action=$return_action&module=$return_module$view$hour$day$month$year&record=$return_id$activemode&viewname=$return_viewname$page&parenttab=$parenttab"); -/** - * Function to get the vtiger_activity details for mail body - * @param string $description - activity description - * return string $list - HTML in string format - */ -function getActivityDetails($description,$inviteeid='') -{ - global $log,$current_user; - global $adb,$mod_strings; - $log->debug("Entering getActivityDetails(".$description.") method ..."); - - $reply = (($_REQUEST['mode'] == 'edit')?'Replied':'Created'); - if($inviteeid=='') - $name = getUserName($_REQUEST['assigned_user_id']); - else - $name = getUserName($inviteeid); - - $current_username = getUserName($current_user->id); - $status = (($_REQUEST['activity_mode']=='Task')?($_REQUEST['taskstatus']):($_REQUEST['eventstatus'])); - - $list = $mod_strings['LBL_DEAR'].' ' .$name.','; - $list .= '

'.$mod_strings['LBL_ACTIVITY_STRING'].' '.$reply.'. '.$mod_strings['LBL_DETAILS_STRING'].':'; - $list .= '
'.$mod_strings["LBL_SUBJECT"].' '.$_REQUEST['subject']; - $list .= '
'.$mod_strings["LBL_STATUS"].': '.$status; - $list .= '
'.$mod_strings["Priority"].': '.$_REQUEST['taskpriority']; - $list .= '
'.$mod_strings["Related To"].' : '.$_REQUEST['parent_name']; - $list .= '
'.$mod_strings["LBL_CONTACT"].' '.$_REQUEST['contact_name']; - $list .= '
'.$mod_strings["LBL_APP_DESCRIPTION"].': '.$description; - $list .= '

'.$mod_strings["LBL_REGARDS_STRING"].' ,'; - $list .= '
'.$current_username.'.'; - - $log->debug("Exiting getActivityDetails method ..."); - return $list; -} ?> Modified: vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/TodoSave.php Mon Nov 27 23:07:32 2006 @@ -9,6 +9,7 @@ * ********************************************************************************/ require_once('modules/Calendar/Activity.php'); +require_once('modules/Calendar/CalendarCommon.php'); require_once('include/logging.php'); require_once("config.php"); require_once('include/database/PearDatabase.php'); @@ -46,6 +47,23 @@ if(isset($_REQUEST['task_sendnotification']) && $_REQUEST['task_sendnotification'] != null) $focus->column_fields["sendnotification"] = $_REQUEST["task_sendnotification"]; - $focus->save($tab_type); + $focus->save($tab_type); + if($_REQUEST["task_sendnotification"]=='on' && $_REQUEST['task_assigntype'] == 'U') + { + + global $current_user; + $local_log->info("send notification is on"); + require_once("modules/Emails/mail.php"); + $to_email = getUserEmailId('id',$_REQUEST['task_assigned_user_id']); + $subject = $_REQUEST['activity_mode'].' : '.$_REQUEST['task_subject']; + $_REQUEST["assigned_user_id"]= $_REQUEST["task_assigned_user_id"]; + $_REQUEST["subject"]=$subject; + $_REQUEST["parent_name"]=$_REQUEST["task_parent_name"]; + $_REQUEST['contactlist']=$_REQUEST['task_contact_name']; + $description = getActivityDetails($_REQUEST['task_description']); + $mail_status = send_mail('Calendar',$to_email,$current_user->user_name,'',$subject,$description); + + } + header("Location: index.php?action=index&module=Calendar&view=".$_REQUEST['view']."&hour=".$_REQUEST['hour']."&day=".$_REQUEST['day']."&month=".$_REQUEST['month']."&year=".$_REQUEST['year']."&viewOption=".$_REQUEST['viewOption']."&subtab=".$_REQUEST['subtab']."&parenttab=".$_REQUEST['parenttab']); ?> From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 28 05:11:23 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 28 Nov 2006 10:11:23 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9924 - /vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Message-ID: <20061128101123.670AD7896D5@vtiger.fosslabs.com> Author: richie Date: Tue Nov 28 03:11:17 2006 New Revision: 9924 Log: Error when custom field filter is set to no filter. Fixes #2453 Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php (original) +++ vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Tue Nov 28 03:11:17 2006 @@ -86,7 +86,7 @@ $querycolumns = $this->getEscapedColumns($selectedfields); - if(sizeof($permitted_fields) != 0 && !in_array($colname,$permitted_fields)) + if(sizeof($permitted_fields) != 0 && !in_array($fieldname,$permitted_fields)) { continue; } @@ -94,14 +94,7 @@ { if($querycolumns == "") { - if($selectedfields[0] == 'vtiger_activity' && $selectedfields[1] == 'status') - { - $columnslist[$fieldcolname] = " case when (vtiger_activity.status not like '') then vtiger_activity.status else vtiger_activity.eventstatus end as Calendar_Status"; - } - else - { - $columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1].' AS "'.$selectedfields[2].'"'; - } + $columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1].' AS "'.$selectedfields[2].'"'; } else { @@ -1322,6 +1315,7 @@ { $selectlist = $columnlist; } + //columns list if(isset($selectlist)) { @@ -1362,7 +1356,7 @@ } $reportquery = $this->getReportsQuery($this->primarymodule); - $log->DEBUG("ReportRun test now this :: Successfully returned sGetSQLforReport".$reportquery."or and or".$selectedcolumns); + if($type == 'COLUMNSTOTOTAL') { if(trim($groupsquery) != "") @@ -1388,7 +1382,6 @@ $reportquery = "select ".$selectedcolumns." ".$reportquery." ".$wheresql; } } - $log->DEBUG("ReportRun :: Successfully returned sGetSQLforReport".$reportquery); $log->info("ReportRun :: Successfully returned sGetSQLforReport".$reportid); return $reportquery; @@ -1415,10 +1408,9 @@ { $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); - $y=$adb->num_fields($result); - if($result) { + $y=$adb->num_fields($result); for ($x=0; $x<$y; $x++) { $fld = $adb->field_name($result, $x); @@ -1530,10 +1522,10 @@ $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); - $y=$adb->num_fields($result); if($result) { + $y=$adb->num_fields($result); $noofrows = $adb->num_rows($result); $custom_field_values = $adb->fetch_array($result); @@ -1636,10 +1628,10 @@ { $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); - $y=$adb->num_fields($result); - if($result) { + + $y=$adb->num_fields($result); for ($x=0; $x<$y; $x++) { $fld = $adb->field_name($result, $x); @@ -1647,6 +1639,7 @@ } $noofrows = $adb->num_rows($result); + $custom_field_values = $adb->fetch_array($result); $groupslist = $this->getGroupingList($this->reportid); From vtigercrm-commits at vtiger.fosslabs.com Tue Nov 28 05:27:21 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Tue, 28 Nov 2006 10:27:21 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9925 - /vtigercrm/branches/5.0.3/include/language/en_us.lang.php Message-ID: <20061128102721.EBAED788B2C@vtiger.fosslabs.com> Author: richie Date: Tue Nov 28 03:27:18 2006 New Revision: 9925 Log: label added for mail merge Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php Modified: vtigercrm/branches/5.0.3/include/language/en_us.lang.php ============================================================================== --- vtigercrm/branches/5.0.3/include/language/en_us.lang.php (original) +++ vtigercrm/branches/5.0.3/include/language/en_us.lang.php Tue Nov 28 03:27:18 2006 @@ -626,7 +626,10 @@ 'LBL_PROFILE_NAME'=>'Profile Name', 'LBL_START_DATE'=>'Start Date', 'LBL_END_DATE'=>'End Date', -);$app_list_strings = array ( +'LBL_CREATE_MERGE_TEMPLATE'=>'Create Mail Merge templates ', +); + +$app_list_strings = array ( 'moduleList' => array ( 'Home' => 'Home', From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 29 09:41:05 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 29 Nov 2006 14:41:05 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9926 - in /vtigercrm/branches/5.0.3: Smarty/templates/ActivityListView.tpl modules/Calendar/ListView.php modules/Calendar/addEventUI.php modules/Calendar/calendarLayout.php modules/Calendar/script.js Message-ID: <20061129144106.55F037889BD@vtiger.fosslabs.com> Author: richie Date: Wed Nov 29 07:40:53 2006 New Revision: 9926 Log: Related to and Action Security added in calendar listview Modified: vtigercrm/branches/5.0.3/Smarty/templates/ActivityListView.tpl vtigercrm/branches/5.0.3/modules/Calendar/ListView.php vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php vtigercrm/branches/5.0.3/modules/Calendar/script.js Modified: vtigercrm/branches/5.0.3/Smarty/templates/ActivityListView.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/ActivityListView.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/ActivityListView.tpl Wed Nov 29 07:40:53 2006 @@ -1,518 +1,527 @@ -{**} - -{**} - - - - - - - {include file='Buttons_List.tpl'} - - - - - - - - -{**} -
- - - - - - - -
- - - - - -{**} - - -
- - - - - -
- - - - - - - - -
 {$APP.Calendar} {$MOD.LBL_ALL_EVENTS_TODOS} 
-
- - -
- - - -
- - -
-
- - - - - - - - - -
- - - - - - - -
- {foreach key=button_check item=button_label from=$BUTTONS} - {if $button_check eq 'del'} - - {elseif $button_check eq 's_mail'} - - {elseif $button_check eq 's_cmail'} - - {elseif $button_check eq 'c_status'} - - {elseif $button_check eq 'c_owner'} - {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} - - {/if} - {/if} - - {/foreach} - {$RECORD_COUNTS} - - {$NAVIGATION} -
-
- - - - - {if $ALL eq 'All'} - - {else} - - {/if} - -
{$APP.LBL_VIEW} - {$APP.LNK_CV_CREATEVIEW} - | - {$APP.LNK_CV_EDIT} - | - {$APP.LNK_CV_DELETE}{$APP.LNK_CV_CREATEVIEW} - | - {$APP.LNK_CV_EDIT} - | - {$APP.LNK_CV_DELETE}
-
-
- - - - {foreach name="listviewforeach" item=header from=$LISTHEADER} - - {/foreach} - - {foreach item=entity key=entity_id from=$LISTENTITY} - - - {foreach item=data from=$entity} - - {/foreach} - - {foreachelse} - - {/foreach} -
{$header}
{$data}
-
- {assign var=vowel_conf value='LBL_A'} - {assign var=MODULE_CREATE value=$SINGLE_MOD} - - {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} - - - - - - - - - -
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_CAN_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE} {$APP.LBL_NOW}. {$APP.LBL_CLICK_THE_LINK}:
- {if $MODULE neq 'Calendar'} -   -{$APP.LBL_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
- {else} -   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Meeting}
-   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Call}
-   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Todo} - {/if} -
- {else} - - - - - - - - -
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
-
- {/if} -
-
-
- - - - - - - -
- {foreach key=button_check item=button_label from=$BUTTONS} - {if $button_check eq 'del'} - - {elseif $button_check eq 's_mail'} - - {elseif $button_check eq 's_cmail'} - - {elseif $button_check eq 'c_status'} - - {elseif $button_check eq 'c_owner'} - {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} - - {/if} - {/if} - - {/foreach} - {$RECORD_COUNTS} - - {$NAVIGATION} -
-
- - - {$WORDTEMPLATEOPTIONS}{$MERGEBUTTON} - -
-
-
- -
-{$SELECT_SCRIPT} -
-
-
-
-
- -
- - -
- - - - - - - - - - - - - - - - - - -
{$APP.LBL_CHANGE_OWNER} {$APP.LBL_CLOSE}
 
{$APP.LBL_TRANSFER_OWNERSHIP}: -
- {$APP.LBL_USER}  - {$APP.LBL_GROUP}
- - -
-
 
-    - - -
-
- - - -{/literal} - +{**} + +{**} + + + + + + + {include file='Buttons_List.tpl'} + + + + + + + + +{**} +
+ + + + + + + +
+ + + + + +{**} + + +
+ + + + + +
+ + + + + + + + +
 {$APP.Calendar} {$MOD.LBL_ALL_EVENTS_TODOS} 
+
+ + +
+ + + +
+ + +
+
+ + + + + + + + + +
+ + + + + + + +
+ {foreach key=button_check item=button_label from=$BUTTONS} + {if $button_check eq 'del'} + + {elseif $button_check eq 's_mail'} + + {elseif $button_check eq 's_cmail'} + + {elseif $button_check eq 'c_status'} + + {elseif $button_check eq 'c_owner'} + {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} + + {/if} + {/if} + + {/foreach} + {$RECORD_COUNTS} + + {$NAVIGATION} +
+
+ + + + + {if $ALL eq 'All'} + + {else} + + {/if} + +
{$APP.LBL_VIEW} + {$APP.LNK_CV_CREATEVIEW} + | + {$APP.LNK_CV_EDIT} + | + {$APP.LNK_CV_DELETE}{$APP.LNK_CV_CREATEVIEW} + | + {$APP.LNK_CV_EDIT} + | + {$APP.LNK_CV_DELETE}
+
+
+ + + + {foreach name="listviewforeach" item=header from=$LISTHEADER} + + {/foreach} + + {foreach item=entity key=entity_id from=$LISTENTITY} + + + {foreach item=data from=$entity} + + {/foreach} + + {foreachelse} + + {/foreach} +
{$header}
{$data}
+
+ {assign var=vowel_conf value='LBL_A'} + {assign var=MODULE_CREATE value=$SINGLE_MOD} + + {if $CHECK.EditView eq 'yes' && $MODULE neq 'Emails' && $MODULE neq 'Webmails'} + + + + + + + + + +
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_CAN_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE} {$APP.LBL_NOW}. {$APP.LBL_CLICK_THE_LINK}:
+ {if $MODULE neq 'Calendar'} +   -{$APP.LBL_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
+ {else} +   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Meeting}
+   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Call}
+   -{$APP.LBL_CREATE} {$APP.LBL_A} {$APP.Todo} + {/if} +
+ {else} + + + + + + + + +
{$APP.LBL_NO} {$APP.$MODULE_CREATE}s {$APP.LBL_FOUND} !
{$APP.LBL_YOU_ARE_NOT_ALLOWED_TO_CREATE} {$APP.$vowel_conf} {$APP.$MODULE_CREATE}
+
+ {/if} +
+
+
+ + + + + + + +
+ {foreach key=button_check item=button_label from=$BUTTONS} + {if $button_check eq 'del'} + + {elseif $button_check eq 's_mail'} + + {elseif $button_check eq 's_cmail'} + + {elseif $button_check eq 'c_status'} + + {elseif $button_check eq 'c_owner'} + {if $MODULE neq 'Notes' && $MODULE neq 'Products' && $MODULE neq 'Faq' && $MODULE neq 'Vendors' && $MODULE neq 'PriceBooks'} + + {/if} + {/if} + + {/foreach} + {$RECORD_COUNTS} + + {$NAVIGATION} +
+
+ + + {$WORDTEMPLATEOPTIONS}{$MERGEBUTTON} + +
+
+
+ +
+{$SELECT_SCRIPT} +
+
+
+
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + +
{$APP.LBL_CHANGE_OWNER} {$APP.LBL_CLOSE}
 
{$APP.LBL_TRANSFER_OWNERSHIP}: +
+ {$APP.LBL_USER}  + {$APP.LBL_GROUP}
+ + +
+
 
+    + + +
+
+ + + +{/literal} + Modified: vtigercrm/branches/5.0.3/modules/Calendar/ListView.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/ListView.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/ListView.php Wed Nov 29 07:40:53 2006 @@ -28,6 +28,7 @@ require_once('include/ListView/ListView.php'); require_once('include/utils/utils.php'); require_once('modules/CustomView/CustomView.php'); +require_once('modules/Calendar/CalendarCommon.php'); require_once('include/database/PearDatabase.php'); global $app_strings; @@ -75,6 +76,13 @@ $customviewcombo_html = $oCustomView->getCustomViewCombo($viewid); $viewnamedesc = $oCustomView->getCustomViewByCvid($viewid); //<<<<>>>> +$changeOwner = getAssignedTo(16); +$userList = $changeOwner[0]; +$groupList = $changeOwner[1]; +//echo '
';print_r($changeOwner); echo '
'; + +$smarty->assign("CHANGE_USER",$userList); +$smarty->assign("CHANGE_GROUP",$groupList); $smarty->assign("CHANGE_OWNER",getUserslist()); $smarty->assign("CHANGE_GROUP_OWNER",getGroupslist()); $where = ""; Modified: vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/addEventUI.php Wed Nov 29 07:40:53 2006 @@ -26,6 +26,8 @@ $date_format = parse_calendardate($app_strings['NTC_DATE_FORMAT']); $taskassignedto = getAssignedTo(9); $eventassignedto = getAssignedTo(16); + $userList = $eventassignedto[0]; + $groupList = $eventassignedto[1]; $mysel= $_GET['view']; $calendar_arr = Array(); $calendar_arr['IMAGE_PATH'] = $image_path; @@ -630,12 +632,24 @@
- - - - + + - + - - - - - + - + - + - +
@@ -873,10 +887,30 @@  
@@ -897,12 +931,25 @@
+ - - - - + - + +
Modified: vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php (original) +++ vtigercrm/branches/5.0.3/modules/Calendar/calendarLayout.php Wed Nov 29 07:40:53 2006 @@ -1,1961 +1,2000 @@ -debug("Entering calendar_layout() method"); - $cal_header = array (); - if (isset($param_arr['size']) && $param_arr['size'] == 'small') - $param_arr['calendar']->show_events = false; - - $cal_header['view'] = $param_arr['view']; - $cal_header['IMAGE_PATH'] = $param_arr['IMAGE_PATH']; - $cal_header['calendar'] = $param_arr['calendar']; - $eventlabel = $mod_strings['LBL_EVENTS']; - $todolabel = $mod_strings['LBL_TODOS']; - //if $param_arr['size'] is set to 'small', get small(mini) calendar - if(isset($param_arr['size']) && $param_arr['size'] == 'small') - { - get_mini_calendar($param_arr); - } - else - { - //To differentiate selected subtab from unselected one - Starts - if($subtab == 'event') - { - $eventtab_class = 'dvtSelectedCell'; - $todotab_class = 'dvtUnSelectedCell'; - $event_anchor = $eventlabel; - $todo_anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=todo&parenttab=".$category."'>".$todolabel.""; - - } - elseif($subtab == 'todo') - { - $eventtab_class = 'dvtUnSelectedCell'; - $todotab_class = 'dvtSelectedCell'; - $event_anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=event&parenttab=".$category."'>".$eventlabel.""; - $todo_anchor = $todolabel; - } - //Ends - //To get calendar header and its links(like Day,Week,Month,Year and etc.) - get_cal_header_tab($cal_header,$viewBox,$subtab); - $subheader = ""; - $subheader .=<< - - - - - - -
- - - - - - - - - -
 $event_anchor $todo_anchor 
-
-EOQ; - echo $subheader; - if($viewBox == 'hourview' && $subtab == 'event') - { - get_cal_header_data($param_arr,$viewBox,$subtab); - getHourView($param_arr); - } - elseif($viewBox == 'listview' && $subtab == 'event') - { - get_cal_header_data($param_arr,$viewBox,$subtab); - getEventListView($param_arr); - } - elseif($subtab == 'todo') - { - $todo_list = ""; - $todo_list .= getTodosListView($param_arr,'',$subtab); - $todo_list .= '

'; - echo $todo_list; - } - } - - $cal_log->debug("Exiting calendar_layout() method"); - -} - -/** - * Function creates HTML to display small(mini) Calendar - * @param array $cal - collection of objects and strings - */ -function get_mini_calendar(& $cal) -{ - global $current_user,$adb,$cal_log; - $category = getParentTab(); - $cal_log->debug('Entering get_mini_calendar() method...'); - $count = 0; - //To decide number of rows(weeks) in a month - if ($cal['calendar']->month_array[$cal['calendar']->slices[35]]->start_time->month != $cal['calendar']->date_time->month) { - $rows = 5; - } else { - $rows = 6; - } - $minical = ""; - $minical .= " - - - "; - $minical .= ""; - $minical .= ""; - //To display days in week - $minical .= ''; - for ($i = 0; $i < 7; $i ++) - { - $weekdays_row = $cal['calendar']->month_array[$cal['calendar']->slices[$i]]; - $weekday = $weekdays_row->start_time->getdayofWeek_inshort(); - $minical .= ''; - } - $minical .= ""; - $event_class = ''; - $class = ''; - for ($i = 0; $i < $rows; $i ++) - { - $minical .= ""; - for ($j = 0; $j < 7; $j ++) - { - $cal['slice'] = $cal['calendar']->month_array[$cal['calendar']->slices[$count]]; - $class = dateCheck($cal['slice']->start_time->get_formatted_date()); - if($count%7 == 0) - $minical .= ""; - //To differentiate day having events from other days - if(count($cal['slice']->activities) != 0 && ($cal['slice']->start_time->get_formatted_date() == $cal['slice']->activities[0]->start_time->get_formatted_date())) - { - $event_class = 'class="eventDay"'; - } - else - { - $event_class = ''; - } - //To differentiate current day from other days - if($class != '' ) - $class = 'class="'.$class.'"'; - else - $class = $event_class; - - //To display month dates - if ($cal['slice']->start_time->getMonth() == $cal['calendar']->date_time->getMonth()) - { - $minical .= ""; - } - else - { - $minical .= ""; - } - $count++; - } - $minical .= ''; - } - - $minical .= "
 ".get_previous_cal($cal)." "; - $minical .= "date_time->get_date_str()."&parenttab=".$category."'>".display_date($cal['view'],$cal['calendar']->date_time)." ".get_next_cal($cal)." -
Week'.$weekday.'
start_time->get_date_str()."&parenttab=".$category."'>".$cal['slice']->start_time->week.""; - $minical .= "getView()."".$cal['slice']->start_time->get_date_str()."&parenttab=".$category."'>"; - $minical .= $cal['slice']->start_time->get_Date()."
"; - echo $minical; - $cal_log->debug("Exiting get_mini_calendar() method..."); -} - -/** - * Function creates HTML to display Calendar Header and its Links - * @param array $header - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means Events ListView.if 'hourview' means Events HourView. if empty means get Todos ListView - * @param string $subtab - string 'todo' or 'event'. if 'todo' means Todos View else Events View - */ -function get_cal_header_tab(& $header,$viewBox,$subtab) -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_cal_header_tab() method..."); - $tabhtml = ""; - $count = 1; - include_once 'modules/Calendar/addEventUI.php'; - include_once 'modules/Calendar/header.php'; - $eventlabel = $mod_strings['LBL_EVENTS']; - $todolabel = $mod_strings['LBL_TODOS']; - $div = " - -
- "; - echo $div; - $tabhtml .= ""; - $links = array ('day','week','month','year'); - //To differentiate the selected link from unselected links - foreach ($links as $link) - { - if ($header['view'] == $link) - { - $class = 'calSel'; - $anchor = $mod_strings["LBL_".$header['calendar']->getCalendarView($link)]; - } - else - { - $class = 'calUnSel'; - $anchor = "date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>".$mod_strings["LBL_".$header['calendar']->getCalendarView($link)].""; - } - - if($count == 1) - $tabhtml .= ""; - else - $tabhtml .= ""; - $count++; - } - //To get Navigation(next&previous) links and display Date info - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - $tabhtml .= ""; - echo $tabhtml; - $cal_log->debug("Exiting get_cal_header_tab() method..."); -} - -/** - * Function creates HTML to display number of Events, Todos and pending list in calendar under header(Eg:Total Events : 5, 2 Pending / Total To Dos: 4, 1 Pending) - * @param array $cal_arr - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview'. if 'listview' means Events ListView.if 'hourview' means Events HourView. - */ -function get_cal_header_data(& $cal_arr,$viewBox,$subtab) -{ - global $mod_strings,$cal_log; - $cal_log->debug("Entering get_cal_header_data() method..."); - global $current_user,$app_strings; - $date_format = $current_user->date_format; - $format = $cal_arr['calendar']->hour_format; - $hour_startat = convertTime2UserSelectedFmt($format,$cal_arr['calendar']->day_start_hour,false); - $hour_endat = convertTime2UserSelectedFmt($format,($cal_arr['calendar']->day_start_hour+1),false); - $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); - $temp_ts = $cal_arr['calendar']->date_time->ts; - //To get date in user selected format - $temp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - $headerdata = ""; - $headerdata .=" -
-
-
".$anchor."".$anchor." - - - "; - $tabhtml .= ""; - $tabhtml .= " -
".get_previous_cal($header,$viewBox,$subtab)." - ".display_date($header['view'],$header['calendar']->date_time)."".get_next_cal($header,$viewBox,$subtab)." -
-
view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."btnL3Calendar.gif' alt='".$mod_strings['LBL_OPENCAL']."...' title='".$mod_strings['LBL_OPENCAL']."...' align='absmiddle' border='0'>view."".$header['calendar']->date_time->get_date_str()."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."\");' src='".$header['IMAGE_PATH']."tbarSettings.gif' alt='".$mod_strings['LBL_SETTINGS']."' title='".$mod_strings['LBL_SETTINGS']."' align='absmiddle' border='0'>".$app_strings['Calendar']."
- "; - if(isPermitted("Calendar","EditView") == "yes") - { - $headerdata .=" - "; - } - else - { - $headerdata .=""; - } - $headerdata .=" - - -
 
-
- ".$mod_strings['LBL_ADD']." - -
 "; - $headerdata .= getEventTodoInfo($cal_arr,'listcnt'); - $headerdata .= "
".$mod_strings['LBL_VIEW']." : "; - $view_options = getEventViewOption($cal_arr,$viewBox); - $headerdata .=$view_options."
-
"; - echo $headerdata; - $cal_log->debug("Exiting get_cal_header_data() method..."); -} - -/** - * Function creates HTML select statement to display View selection box - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview'. if 'listview' means get Events ListView.if 'hourview' means get Events HourView. - * return string $view - html selection box - */ -function getEventViewOption(& $cal,$viewBox) -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - if($viewBox == 'listview') - { - $list_sel = 'selected'; - $hr_sel = ''; - } - else - { - $list_sel = ''; - $hr_sel = 'selected'; - } - $cal_log->debug("Entering getEventViewOption() method..."); - $view = "view."'> - date_time->hour."'> - date_time->day."'> - date_time->week."'> - date_time->month."'> - date_time->year."'> - - - - - - - - "; - $cal_log->debug("Exiting getEventViewOption() method..."); - return $view; -} - -/** - * Function creates HTML anchor tag to get previous-day/week/month/year view - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means previous link in Events ListView.if 'hourview' means previous link in Events HourView. if empty means previous link in Todos ListView - * @param string $subtab - string 'todo' or 'event' or may be empty. if 'todo' means Todos View. if 'event' means Events View. if empty means small calendar view. - * return string $link - html tags in string format - */ -function get_previous_cal(& $cal,$viewBox='',$subtab='') -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_previous_cal() method..."); - if(isset($cal['size']) && $cal['size'] == 'small') - { - $link = "view."".$cal['calendar']->get_datechange_info('prev')."&parenttab=".$category."\")'>"; - } - else - { - $link = "view."".$cal['calendar']->get_datechange_info('prev')."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>"; - } - $cal_log->debug("Exiting get_previous_cal() method..."); - return $link; -} - -/** - * Function creates HTML anchor tag to get next-day/week/month/year view - * @param array $cal - collection of objects and strings - * @param string $viewBox - string 'listview' or 'hourview' or may be empty. if 'listview' means next link in Events ListView.if 'hourview' means next link in Events HourView. if empty means next link in Todos ListView - * @param string $subtab - string 'todo' or 'event' or may be empty. if 'todo' means Todos View. if 'event' means Events View. if empty means small calendar view. - * return string $link - html tags in string format - */ -function get_next_cal(& $cal,$viewBox='',$subtab='') -{ - global $mod_strings,$cal_log; - $category = getParentTab(); - $cal_log->debug("Entering get_next_cal() method..."); - if(isset($cal['size']) && $cal['size'] == 'small') - { - $link = "view."".$cal['calendar']->get_datechange_info('next')."&parenttab=".$category."\")' >"; - } - else - { - $link = "view."".$cal['calendar']->get_datechange_info('next')."&viewOption=".$viewBox."&subtab=".$subtab."&parenttab=".$category."'>"; - } - $cal_log->debug("Exiting get_next_cal() method..."); - return $link; - -} - -/** - * Function to get date info depending upon on the calendar view(Eg: 21 July 2000) - * @param string $view - calendar view(day/week/month/year) - * @param array $date_time - contains DateTime object - * return string $label - date info(Eg for dayview : 13 July 2000) - */ -function display_date($view,$date_time) -{ - global $cal_log; - $cal_log->debug("Entering display_date() method..."); - if ($view == 'day') - { - //$label = $date_time->getdayofWeek()." "; - $label = $date_time->get_Date()." "; - $label .= $date_time->getmonthName()." "; - $label .= $date_time->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - elseif ($view == 'week') - { - $week_start = $date_time->getThisweekDaysbyIndex(0); - $week_end = $date_time->getThisweekDaysbyIndex(6); - $label = $week_start->get_Date()." "; - $label .= $week_start->getmonthName()." "; - $label .= $week_start->year; - $label .= " - "; - $label .= $week_end->get_Date()." "; - $label .= $week_end->getmonthName()." "; - $label .= $week_end->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - - elseif ($view == 'month') - { - $label = $date_time->getmonthName()." "; - $label .= $date_time->year; - $cal_log->debug("Exiting display_date() method..."); - return $label; - } - elseif ($view == 'year') - { - $cal_log->debug("Exiting display_date() method..."); - return $date_time->year; - } - -} -/** - * Function to get css class name for date - * @param string $slice_date - date - * returns string - css class name or empty string - */ -function dateCheck($slice_date) -{ - global $cal_log; - $cal_log->debug("Entering dateCheck() method..."); - $today = date('Y-m-d'); - if($today == $slice_date) - { - $cal_log->debug("Exiting dateCheck() method..."); - //css class for day having event(s) - return 'currDay'; - } - else - { - $cal_log->debug("Exiting dateCheck() method..."); - return ''; - } -} - -/** - * Function to construct respective calendar layout depends on the calendar view - * @param array $view - collection of objects and strings - */ -function getHourView(& $view) -{ - global $cal_log; - $hourview_layout = ''; - $cal_log->debug("Entering getHourView() method..."); - $hourview_layout .= '
-
'; - - if($view['view'] == 'day') - $hourview_layout .= getDayViewLayout($view); - elseif($view['view'] == 'week') - $hourview_layout .= getWeekViewLayout($view); - elseif($view['view'] == 'month') - $hourview_layout .= getMonthViewLayout($view); - elseif($view['view'] == 'year') - $hourview_layout .= getYearViewLayout($view); - else - die("view:".$view['view']." is not defined"); - - $hourview_layout .= '
- '; - $hourview_layout .= '
- - - - - - - - -
'; - echo $hourview_layout; - $cal_log->debug("Exiting getHourView() method..."); -} - -/** - * Fuction constructs Events ListView depends on the view - * @param array $cal - collection of objects and strings - * @param string $mode - string 'listcnt' or empty. if empty means get Events ListView else get total no. of events and no. of pending events Info. - * returns string $activity_list - total no. of events and no. of pending events Info(Eg: Total Events : 2, 1 Pending). - */ -function getEventListView(& $cal,$mode='') -{ - global $cal_log; - $list_view = ""; - $cal_log->debug("Entering getEventListView() method..."); - if($cal['calendar']->view == 'day') - { - $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date(); - } - elseif($cal['calendar']->view == 'week') - { - $start_date = $cal['calendar']->slices[0]; - $end_date = $cal['calendar']->slices[6]; - } - elseif($cal['calendar']->view == 'month') - { - $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0); - $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - elseif($cal['calendar']->view == 'year') - { - $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0); - $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment'); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - else - { - die("view:".$cal['calendar']->view." is not defined"); - } - //if $mode value is empty means get Events list in array format else get the count of total events and pending events in array format. - $activity_list = getEventList($cal, $start_date, $end_date,$mode); - if($mode != '') - { - $cal_log->debug("Exiting getEventListView() method..."); - return $activity_list; - } - //To get Events listView - $list_view .="
"; - $list_view .=constructEventListView($cal,$activity_list); - $list_view .="
- "; - $list_view .="
- - - - - - - - -
"; - echo $list_view; - $cal_log->debug("Exiting getEventListView() method..."); -} - - -/** - * Fuction constructs Todos ListView depends on the view - * @param array $cal - collection of objects and strings - * @param string $check - string 'listcnt' or empty. if empty means get Todos ListView else get total no. of Todos and no. of pending todos Info. - * returns string $todo_list - total no. of todos and no. of pending todos Info(Eg: Total Todos : 2, 1 Pending). - */ -function getTodosListView($cal, $check='',$subtab='') -{ - global $cal_log; - $list_view = ""; - $cal_log->debug("Entering getTodosListView() method..."); - if($cal['calendar']->view == 'day') - { - $start_date = $end_date = $cal['calendar']->date_time->get_formatted_date(); - } - elseif($cal['calendar']->view == 'week') - { - $start_date = $cal['calendar']->slices[0]; - $end_date = $cal['calendar']->slices[6]; - } - elseif($cal['calendar']->view == 'month') - { - $start_date = $cal['calendar']->date_time->getThismonthDaysbyIndex(0); - $end_date = $cal['calendar']->date_time->getThismonthDaysbyIndex($cal['calendar']->date_time->daysinmonth - 1); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - elseif($cal['calendar']->view == 'year') - { - $start_date = $cal['calendar']->date_time->getThisyearMonthsbyIndex(0); - $end_date = $cal['calendar']->date_time->get_first_day_of_changed_year('increment'); - $start_date = $start_date->get_formatted_date(); - $end_date = $end_date->get_formatted_date(); - } - else - { - die("view:".$cal['calendar']->view." is not defined"); - } - //if $check value is empty means get Todos list in array format else get the count of total todos and pending todos in array format. - $todo_list = getTodoList($cal, $start_date, $end_date,$check); - if($check != '') - { - $cal_log->debug("Exiting getTodosListView() method..."); - return $todo_list; - } - $cal_log->debug("Exiting getTodosListView() method..."); - $list_view .="
"; - //To get Todos listView - $list_view .= constructTodoListView($todo_list,$cal,$subtab); - $list_view .="
- - - - - - - - - - "; - echo $list_view; -} - -/** - * Function creates HTML to display Calendar DayView - * @param array $cal - collections of objects and strings. - * return string $dayview_layout - html tags in string format - */ -function getDayViewLayout(& $cal) -{ - //echo '
';print_r($cal);echo '
'; - global $current_user,$app_strings,$cal_log,$adb; - $no_of_rows = 1; - $cal_log->debug("Entering getDayViewLayout() method..."); - $shared_ids = getSharedCalendarId($current_user->id); - $user_details = getAllUserName(); - $usersid = $current_user->id.','.$shared_ids; - $userid_arr = explode(",",$usersid); - $date_format = $current_user->date_format; - $day_start_hour = $cal['calendar']->day_start_hour; - $day_end_hour = $cal['calendar']->day_end_hour; - $format = $cal['calendar']->hour_format; - $dayview_layout = ''; - $dayview_layout .= ' '; - $dayview_layout .= ' -
- '; - for($j=0;$j<24;$j++) - { - $slice = $cal['calendar']->slices[$j]; - $act = $cal['calendar']->day_slice[$slice]->activities; - if(!empty($act)) - { - $temprows = count($act); - $no_of_rows = ($no_of_rows>$temprows)?$no_of_rows:$temprows; - } - } - for($i=$day_start_hour;$i<=$day_end_hour;$i++) - { - - if($cal['calendar']->hour_format == 'am/pm') - { - if($i == 12) - { - $hour = $i; - $sub_str = 'pm'; - } - elseif($i>12) - { - $hour = $i - 12; - $sub_str = 'pm'; - } - else - { - if($i == 0) - $hour = 12; - else - $hour = $i; - $sub_str = 'am'; - } - - } - else - { - $hour = $i; - if($hour <= 9 && strlen(trim($hour)) < 2) - $hour = "0".$hour; - $sub_str = ':00'; - } - $y = $i+1; - $hour_startat = convertTime2UserSelectedFmt($format,$i,false); - $hour_endat = convertTime2UserSelectedFmt($format,$y,false); - $time_arr = getaddEventPopupTime($hour_startat,$hour_endat,$format); - $temp_ts = $cal['calendar']->date_time->ts; - $sttemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$temp_ts)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$temp_ts)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $temp_ts)):('')))); - if($i != 23) - { - $endtemp_date = $sttemp_date; - } - else - { - $addday = $temp_ts + (1 * 24 * 60 * 60); - $endtemp_date = (($date_format == 'dd-mm-yyyy')?(date('d-m-Y',$addday)):(($date_format== 'mm-dd-yyyy')?(date('m-d-Y',$addday)):(($date_format == 'yyyy-mm-dd')?(date('Y-m-d', $addday)):('')))); - } - - $js_string = ""; - if(isPermitted("Calendar","EditView") == "yes") - $js_string = 'onClick="fnvshobj(this,\'addEvent\'); gshow(\'addEvent\',\'call\',\''.$sttemp_date.'\',\''.$endtemp_date.'\',\''.$time_arr['starthour'].'\',\''.$time_arr['startmin'].'\',\''.$time_arr['startfmt'].'\',\''.$time_arr['endhour'].'\',\''.$time_arr['endmin'].'\',\''.$time_arr['endfmt'].'\',\'hourview\',\'event\')"'; - $dayview_layout .= ' - '; - //To display events in Dayview - $dayview_layout .= getdayEventLayer($cal,$cal['calendar']->slices[$i],$no_of_rows); - $dayview_layout .= ''; - } - $dayview_layout .= '
'.$hour.''.$sub_str.'
-
'; - $cal_log->debug("Exiting getDayViewLayout() method..."); - return $dayview_layout; -} - -/** - * Function creates HTML to display Calendar WeekView - * @param array $cal - collections of objects and strings From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 29 11:10:14 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 29 Nov 2006 16:10:14 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9927 - in /vtigercrm/branches/5.0.3: Smarty/templates/HomePage.tpl modules/Home/index.php Message-ID: <20061129161014.6C692788A28@vtiger.fosslabs.com> Author: richie Date: Wed Nov 29 09:09:54 2006 New Revision: 9927 Log: Changes made that the More link in home page shows only the user record Modified: vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl vtigercrm/branches/5.0.3/modules/Home/index.php Modified: vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl ============================================================================== --- vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl (original) +++ vtigercrm/branches/5.0.3/Smarty/templates/HomePage.tpl Wed Nov 29 09:09:54 2006 @@ -147,7 +147,7 @@ {if $modulename neq 'CustomView' && $modulename neq 'GroupAllocation'} - {$APP.LBL_MORE}.. + {$APP.LBL_MORE}.. {else}   {/if} Modified: vtigercrm/branches/5.0.3/modules/Home/index.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Home/index.php (original) +++ vtigercrm/branches/5.0.3/modules/Home/index.php Wed Nov 29 09:09:54 2006 @@ -175,10 +175,13 @@ } global $current_language; + +global $current_user; +$user_name = $current_user->column_fields[user_name]; $current_module_strings = return_module_language($current_language, 'Calendar'); $t=Date("Ymd"); -//echo '
';print_r($activities); echo '
'; +//echo '
';print_r($home_values); echo '
'; $buttoncheck['Calendar'] = isPermitted('Calendar','index'); $smarty->assign("CHECK",$buttoncheck); $smarty->assign("IMAGE_PATH",$image_path); @@ -189,6 +192,7 @@ $smarty->assign("HOMEDETAILS",$home_values); $smarty->assign("HOMEDEFAULTVIEW",DefHomeView()); $smarty->assign("ACTIVITIES",$activities); +$smarty->assign("CURRENTUSER",$user_name); $freetag = new freetag(); $smarty->assign("ALL_TAG",$freetag->get_tag_cloud_html("",$current_user->id)); $smarty->display("HomePage.tpl"); From vtigercrm-commits at vtiger.fosslabs.com Wed Nov 29 12:05:36 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Wed, 29 Nov 2006 17:05:36 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9928 - /vtigercrm/tags/vtigercrm-5.0.3-val/ Message-ID: <20061129170536.0433C7896EC@vtiger.fosslabs.com> Author: richie Date: Wed Nov 29 10:05:31 2006 New Revision: 9928 Log: 5.0.3 version tagged for Webmail fix Added: vtigercrm/tags/vtigercrm-5.0.3-val/ - copied from r9927, vtigercrm/branches/5.0.3/ From vtigercrm-commits at vtiger.fosslabs.com Thu Nov 30 05:58:22 2006 From: vtigercrm-commits at vtiger.fosslabs.com (vtigercrm-commits at vtiger.fosslabs.com) Date: Thu, 30 Nov 2006 10:58:22 -0000 Subject: [Vtigercrm-commits] [vtiger-commits] r9929 - /vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Message-ID: <20061130105822.74234789436@vtiger.fosslabs.com> Author: richie Date: Thu Nov 30 03:58:16 2006 New Revision: 9929 Log: Status missing in activity report - fixed Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Modified: vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php ============================================================================== --- vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php (original) +++ vtigercrm/branches/5.0.3/modules/Reports/ReportRun.php Thu Nov 30 03:58:16 2006 @@ -86,7 +86,7 @@ $querycolumns = $this->getEscapedColumns($selectedfields); - if(sizeof($permitted_fields) != 0 && !in_array($fieldname,$permitted_fields)) + if(sizeof($permitted_fields) != 0 && !in_array($colname,$permitted_fields)) { continue; } @@ -94,7 +94,14 @@ { if($querycolumns == "") { - $columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1].' AS "'.$selectedfields[2].'"'; + if($selectedfields[0] == 'vtiger_activity' && $selectedfields[1] == 'status') + { + $columnslist[$fieldcolname] = " case when (vtiger_activity.status not like '') then vtiger_activity.status else vtiger_activity.eventstatus end as Calendar_Status"; + } + else + { + $columnslist[$fieldcolname] = $selectedfields[0].".".$selectedfields[1].' AS "'.$selectedfields[2].'"'; + } } else { @@ -1315,7 +1322,6 @@ { $selectlist = $columnlist; } - //columns list if(isset($selectlist)) { @@ -1356,7 +1362,6 @@ } $reportquery = $this->getReportsQuery($this->primarymodule); - if($type == 'COLUMNSTOTOTAL') { if(trim($groupsquery) != "") @@ -1408,6 +1413,7 @@ { $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); + if($result) { $y=$adb->num_fields($result); @@ -1628,9 +1634,9 @@ { $sSQL = $this->sGetSQLforReport($this->reportid,$filterlist); $result = $adb->query($sSQL); + if($result) { - $y=$adb->num_fields($result); for ($x=0; $x<$y; $x++) { @@ -1639,7 +1645,6 @@ } $noofrows = $adb->num_rows($result); - $custom_field_values = $adb->fetch_array($result); $groupslist = $this->getGroupingList($this->reportid);