更新到 5.2 正式版后第一次 SVN 提交。

[email protected]


git-svn-id: https://svn.code.sf.net/p/hawebs/svn@614 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
YuCheng Hu
2010-11-16 07:59:52 +00:00
parent cf564e03d4
commit fd6c951deb
30 changed files with 2800 additions and 0 deletions
@@ -0,0 +1,85 @@
<?php
/*+********************************************************************************
* 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.
********************************************************************************/
require_once('Smarty_setup.php');
require_once('include/utils/utils.php');
//Redirecting Header for single page layout
require_once('user_privileges/default_module_view.php');
global $singlepane_view;
$currentmodule = vtlib_purify($_REQUEST['module']);
$RECORD = vtlib_purify($_REQUEST['record']);
$category = getParentTab();
if($singlepane_view == 'true' && $_REQUEST['action'] == 'CallRelatedList') {
header("Location:index.php?action=DetailView&module=$currentmodule&record=$RECORD&parenttab=$category");
} else {
$focus = CRMEntity::getInstance($currentmodule);
if(isset($_REQUEST['record']) && $_REQUEST['record']!='') {
$focus->retrieve_entity_info($RECORD,$currentmodule);
$focus->id = $RECORD;
$focus->name=$focus->column_fields['subject'];
$log->debug("id is ".$focus->id);
$log->debug("name is ".$focus->name);
}
global $mod_strings;
global $app_strings;
global $currentModule;
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$smarty = new vtigerCRM_Smarty;
if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
$related_array=getRelatedLists($currentModule,$focus);
$smarty->assign("RELATEDLISTS", $related_array);
require_once('include/ListView/RelatedListViewSession.php');
if(!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
$relationId = vtlib_purify($_REQUEST['relation_id']);
RelatedListViewSession::addRelatedModuleToSession($relationId,
vtlib_purify($_REQUEST['selected_header']));
}
$open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
$smarty->assign("SELECTEDHEADERS", $open_related_modules);
$smarty->assign("CATEGORY",$category);
if(isset($_REQUEST['mode']) && $_REQUEST['mode'] != ' ') {
$smarty->assign("OP_MODE",vtlib_purify($_REQUEST['mode']));
}
$smarty->assign("TODO_PERMISSION",CheckFieldPermission('parent_id','Calendar'));
$smarty->assign("EVENT_PERMISSION",CheckFieldPermission('parent_id','Events'));
$smarty->assign("ID",$focus->id);
// Module Sequence Numbering
$mod_seq_field = getModuleSequenceField($currentModule);
if ($mod_seq_field != null) {
$mod_seq_id = $focus->column_fields[$mod_seq_field['name']];
} else {
$mod_seq_id = $focus->id;
}
$smarty->assign('MOD_SEQ_ID', $mod_seq_id);
// END
$smarty->assign("MODULE",$currentmodule);
$smarty->assign("SINGLE_MOD",$mod_strings['Invoice']);
$smarty->assign("UPDATEINFO",updateInfo($focus->id));
$smarty->assign("MOD",$mod_strings);
$smarty->assign("APP",$app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$smarty->display("RelatedLists.tpl");
}
?>
@@ -0,0 +1,26 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
include_once 'modules/Invoice/InvoicePDFController.php';
global $currentModule;
$controller = new Vtiger_InvoicePDFController($currentModule);
$controller->loadRecord(vtlib_purify($_REQUEST['record']));
if(isset($_REQUEST['savemode']) && $_REQUEST['savemode'] == 'file') {
$id = vtlib_purify($_REQUEST['record']);
$filepath='test/product/'.$id.'_Invoice.pdf';
$controller->Output($filepath,'F'); //added file name to make it work in IE, also forces the download giving the user the option to save
} else {
$controller->Output('Invoice.pdf', 'D');//added file name to make it work in IE, also forces the download giving the user the option to save
exit();
}
?>
@@ -0,0 +1,14 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
include('modules/CustomView/index.php');
?>
@@ -0,0 +1,38 @@
<?php
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* $Header$
* Description: Deletes an Account record and then redirects the browser to the
* defined return URL.
********************************************************************************/
global $currentModule;
$focus = CRMEntity::getInstance($currentModule);
global $mod_strings;
require_once('include/logging.php');
$log = LoggerManager::getLogger('invoice_delete');
//Added to fix 4600
$url = getBasic_Advance_SearchURL();
if(!isset($_REQUEST['record']))
die($mod_strings['ERR_DELETE_RECORD']);
DeleteEntity($_REQUEST['module'],$_REQUEST['return_module'],$focus,$_REQUEST['record'],$_REQUEST['return_id']);
$parenttab = getParentTab();
header("Location: index.php?module=".vtlib_purify($_REQUEST['return_module'])."&action=".vtlib_purify($_REQUEST['return_action'])."&record=".vtlib_purify($_REQUEST['return_id'])."&parenttab=$parenttab&relmodule=".vtlib_purify($_REQUEST['module']).$url);
?>
@@ -0,0 +1,138 @@
<?php
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* $Header$
* Description: TODO To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('Smarty_setup.php');
require_once('data/Tracker.php');
require_once('include/CustomFieldUtil.php');
require_once('include/utils/utils.php');
require_once('user_privileges/default_module_view.php');
global $mod_strings,$app_strings,$currentModule,$theme,$singlepane_view;
$focus = CRMEntity::getInstance($currentModule);
if(isset($_REQUEST['record']) && isset($_REQUEST['record'])) {
$focus->retrieve_entity_info($_REQUEST['record'],"Invoice");
$focus->id = $_REQUEST['record'];
$focus->name=$focus->column_fields['subject'];
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
}
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$log->info("Order detail view");
$smarty = new vtigerCRM_Smarty;
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("MODULE",$currentModule);
$smarty->assign("UPDATEINFO",updateInfo($focus->id));
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
$smarty->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']);
if (isset($focus->name)) $smarty->assign("NAME", $focus->name);
else $smarty->assign("NAME", "");
$smarty->assign("BLOCKS", getBlocks($currentModule,"detail_view",'',$focus->column_fields));
$smarty->assign("CUSTOMFIELD", $cust_fld);
$smarty->assign("ID", vtlib_purify($_REQUEST['record']));
// Module Sequence Numbering
$mod_seq_field = getModuleSequenceField($currentModule);
if ($mod_seq_field != null) {
$mod_seq_id = $focus->column_fields[$mod_seq_field['name']];
} else {
$mod_seq_id = $focus->id;
}
$smarty->assign('MOD_SEQ_ID', $mod_seq_id);
// END
$smarty->assign("SINGLE_MOD", 'Invoice');
$category = getParentTab();
$smarty->assign("CATEGORY",$category);
if(isPermitted("Invoice","EditView",$_REQUEST['record']) == 'yes')
$smarty->assign("EDIT_DUPLICATE","permitted");
$smarty->assign("CREATEPDF","permitted");
if(isPermitted("Invoice","Delete",$_REQUEST['record']) == 'yes')
$smarty->assign("DELETE","permitted");
//Get the associated Products and then display above Terms and Conditions
$smarty->assign("ASSOCIATED_PRODUCTS",getDetailAssociatedProducts('Invoice',$focus));
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
$tabid = getTabid("Invoice");
$validationData = getDBValidationData($focus->tab_name,$tabid);
$data = split_validationdataArray($validationData);
$smarty->assign("VALIDATION_DATA_FIELDNAME",$data['fieldname']);
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$data['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL",$data['fieldlabel']);
$smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST['record']));
$smarty->assign("TODO_PERMISSION",CheckFieldPermission('parent_id','Calendar'));
$smarty->assign("EVENT_PERMISSION",CheckFieldPermission('parent_id','Events'));
$smarty->assign("IS_REL_LIST",isPresentRelatedLists($currentModule));
if($singlepane_view == 'true')
{
$related_array = getRelatedLists($currentModule,$focus);
$smarty->assign("RELATEDLISTS", $related_array);
require_once('include/ListView/RelatedListViewSession.php');
if(!empty($_REQUEST['selected_header']) && !empty($_REQUEST['relation_id'])) {
RelatedListViewSession::addRelatedModuleToSession(vtlib_purify($_REQUEST['relation_id']),
vtlib_purify($_REQUEST['selected_header']));
}
$open_related_modules = RelatedListViewSession::getRelatedModulesFromSession();
$smarty->assign("SELECTEDHEADERS", $open_related_modules);
}
$smarty->assign("SinglePane_View", $singlepane_view);
if(PerformancePrefs::getBoolean('DETAILVIEW_RECORD_NAVIGATION', true) && isset($_SESSION[$currentModule.'_listquery'])){
$recordNavigationInfo = ListViewSession::getListViewNavigation($focus->id);
VT_detailViewNavigation($smarty,$recordNavigationInfo,$focus->id);
}
// Record Change Notification
$focus->markAsViewed($current_user->id);
// END
include_once('vtlib/Vtiger/Link.php');
$customlink_params = Array('MODULE'=>$currentModule, 'RECORD'=>$focus->id, 'ACTION'=>vtlib_purify($_REQUEST['action']));
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), Array('DETAILVIEWBASIC','DETAILVIEW','DETAILVIEWWIDGET'), $customlink_params));
$smarty->assign('DETAILVIEW_AJAX_EDIT', PerformancePrefs::getBoolean('DETAILVIEW_AJAX_EDIT', true));
$smarty->display("Inventory/InventoryDetailView.tpl");
?>
@@ -0,0 +1,48 @@
<?php
/*+********************************************************************************
* 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.
*********************************************************************************/
require_once('include/logging.php');
require_once('include/database/PearDatabase.php');
global $adb;
$local_log =& LoggerManager::getLogger('InvoiceAjax');
global $currentModule;
$modObj = CRMEntity::getInstance($currentModule);
$ajaxaction = $_REQUEST["ajxaction"];
if($ajaxaction == "DETAILVIEW")
{
$crmid = $_REQUEST["recordid"];
$tablename = $_REQUEST["tableName"];
$fieldname = $_REQUEST["fldName"];
$fieldvalue = utf8RawUrlDecode($_REQUEST["fieldValue"]);
if($crmid != "")
{
$modObj->retrieve_entity_info($crmid,"Invoice");
$modObj->column_fields[$fieldname] = $fieldvalue;
$modObj->id = $crmid;
$modObj->mode = "edit";
$modObj->save("Invoice");
if($modObj->id != "")
{
echo ":#:SUCCESS";
}else
{
echo ":#:FAILURE";
}
}else
{
echo ":#:FAILURE";
}
} elseif($ajaxaction == "LOADRELATEDLIST" || $ajaxaction == "DISABLEMODULE"){
require_once 'include/ListView/RelatedListViewContents.php';
}
?>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,55 @@
/*********************************************************************************
** 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.
*
********************************************************************************/
document.write("<script type='text/javascript' src='include/js/Inventory.js'></"+"script>");
function set_return(product_id, product_name) {
if(document.getElementById('from_link').value != '') {
window.opener.document.QcEditView.parent_name.value = product_name;
window.opener.document.QcEditView.parent_id.value = product_id;
} else {
window.opener.document.EditView.parent_name.value = product_name;
window.opener.document.EditView.parent_id.value = product_id;
}
}
function set_return_specific(product_id, product_name) {
//getOpenerObj used for DetailView
var fldName = getOpenerObj("product_name");
var fldId = getOpenerObj("product_id");
fldName.value = product_name;
fldId.value = product_id;
}
function set_return_formname_specific(formname,product_id, product_name) {
window.opener.document.EditView1.product_name.value = product_name;
window.opener.document.EditView1.product_id.value = product_id;
}
function set_return_inventory(product_id,product_name,unitprice,qtyinstock,curr_row) {
window.opener.document.EditView.elements["txtProduct"+curr_row].value = product_name;
window.opener.document.EditView.elements["hdnProductId"+curr_row].value = product_id;
window.opener.document.EditView.elements["txtListPrice"+curr_row].value = unitprice;
getOpenerObj("unitPrice"+curr_row).innerHTML = unitprice;
getOpenerObj("qtyInStock"+curr_row).innerHTML = qtyinstock;
window.opener.document.EditView.elements["txtQty"+curr_row].focus()
}
function set_return_todo(product_id, product_name) {
if(document.getElementById('from_link').value != '') {
window.opener.document.QcEditView.task_parent_name.value = product_name;
window.opener.document.QcEditView.task_parent_id.value = product_id;
} else {
window.opener.document.createTodo.task_parent_name.value = product_name;
window.opener.document.createTodo.task_parent_id.value = product_id;
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,12 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
require_once('include/Ajax/CommonAjax.php');
?>
@@ -0,0 +1,59 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
include_once 'include/InventoryPDFController.php';
class Vtiger_InvoicePDFController extends Vtiger_InventoryPDFController{
function buildHeaderModelTitle() {
return sprintf("%s: %s", rtrim($this->moduleName, 's'), $this->focusColumnValue('invoice_no'));
}
function buildHeaderModelColumnCenter() {
$customerName = $this->resolveReferenceLabel($this->focusColumnValue('account_id'), 'Accounts');
$contactName = $this->resolveReferenceLabel($this->focusColumnValue('contact_id'), 'Contacts');
$purchaseOrder = $this->focusColumnValue('vtiger_purchaseorder');
$salesOrder = $this->resolveReferenceLabel($this->focusColumnValue('salesorder_id'));
$customerNameLabel = getTranslatedString('Customer Name', $this->moduleName);
$contactNameLabel = getTranslatedString('Contact Name', $this->moduleName);
$purchaseOrderLabel = getTranslatedString('Purchase Order', $this->moduleName);
$salesOrderLabel = getTranslatedString('Sales Order', $this->moduleName);
$modelColumnCenter = array(
$customerNameLabel => $customerName,
$purchaseOrderLabel => $purchaseOrder,
$contactNameLabel => $contactName,
$salesOrderLabel => $salesOrder
);
return $modelColumnCenter;
}
function buildHeaderModelColumnRight() {
$issueDateLabel = getTranslatedString('Issued Date', $this->moduleName);
$validDateLabel = getTranslatedString('Due Date', $this->moduleName);
$billingAddressLabel = getTranslatedString('Billing Address', $this->moduleName);
$shippingAddressLabel = getTranslatedString('Shipping Address', $this->moduleName);
$modelColumnRight = array(
'dates' => array(
$issueDateLabel => $this->formatDate(date("Y-m-d")),
$validDateLabel => $this->formatDate($this->focusColumnValue('duedate')),
),
$billingAddressLabel => $this->buildHeaderBillingAddress(),
$shippingAddressLabel => $this->buildHeaderShippingAddress()
);
return $modelColumnRight;
}
function getWatermarkContent() {
return $this->focusColumnValue('invoicestatus');
}
}
?>
@@ -0,0 +1,164 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
function getTopInvoice($maxval,$calCnt)
{
require_once("data/Tracker.php");
require_once('modules/Invoice/Invoice.php');
require_once('include/logging.php');
require_once('include/ListView/ListView.php');
require_once('include/utils/utils.php');
require_once('modules/CustomView/CustomView.php');
global $app_strings,$current_language,$current_user,$adb,$list_max_entries_per_page,$theme;
$current_module_strings = return_module_language($current_language, 'Invoice');
$log = LoggerManager::getLogger('invoice_list');
$url_string = '';
$sorder = '';
$oCustomView = new CustomView("Invoice");
$customviewcombo_html = $oCustomView->getCustomViewCombo();
if(isset($_REQUEST['viewname']) == false || $_REQUEST['viewname']=='')
{
if($oCustomView->setdefaultviewid != "")
{
$viewid = $oCustomView->setdefaultviewid;
}else
{
$viewid = "0";
}
}
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
$date_var = date('Y-m-d');
$currentModule = 'Invoice';
$viewId = getCvIdOfAll($currentModule);
$queryGenerator = new QueryGenerator($currentModule, $current_user);
$queryGenerator->initForCustomViewById($viewId);
$meta = $queryGenerator->getMeta($currentModule);
$accessibleFieldNameList = array_keys($meta->getModuleFields());
$customViewFields = $queryGenerator->getCustomViewFields();
$fields = $queryGenerator->getFields();
$newFields = array_diff($fields, $customViewFields);
$widgetFieldsList = array('subject','salesorder_id','account_id','contact_id','invoicestatus',
'total');
$widgetFieldsList = array_intersect($accessibleFieldNameList, $widgetFieldsList);
$widgetSelectedFields = array_chunk(array_intersect($customViewFields, $widgetFieldsList), 2);
//select the first chunk of two fields
$widgetSelectedFields = $widgetSelectedFields[0];
if(count($widgetSelectedFields) < 2) {
$widgetSelectedFields = array_chunk(array_merge($widgetSelectedFields, $accessibleFieldNameList), 2);
//select the first chunk of two fields
$widgetSelectedFields = $widgetSelectedFields[0];
}
$newFields = array_merge($newFields, $widgetSelectedFields);
$queryGenerator->setFields($newFields);
$_REQUEST = getTopInvoiceSearch($_REQUEST, array(
'assigned_user_id'=>$current_user->column_fields['user_name']));
$queryGenerator->addUserSearchConditions($_REQUEST);
$search_qry = '&query=true'.getSearchURL($_REQUEST);
$query = $queryGenerator->getQuery();
//<<<<<<<<customview>>>>>>>>>
$query .= " LIMIT " . $adb->sql_escape_string($maxval);
if($calCnt == 'calculateCnt') {
$list_result_rows = $adb->query(mkCountQuery($query));
return $adb->query_result($list_result_rows, 0, 'count');
}
$list_result = $adb->query($query);
//Retreiving the no of rows
$noofrows = $adb->num_rows($list_result);
//Retreiving the start value from request
if(isset($_REQUEST['start']) && $_REQUEST['start'] != '') {
$start = vtlib_purify($_REQUEST['start']);
} else {
$start = 1;
}
//Retreive the Navigation array
$navigation_array = getNavigationValues($start, $noofrows, $list_max_entries_per_page);
if ($navigation_array['start'] == 1)
{
if($noofrows != 0)
$start_rec = $navigation_array['start'];
else
$start_rec = 0;
if($noofrows > $list_max_entries_per_page)
{
$end_rec = $navigation_array['start'] + $list_max_entries_per_page - 1;
}
else
{
$end_rec = $noofrows;
}
}
else
{
if($navigation_array['next'] > $list_max_entries_per_page)
{
$start_rec = $navigation_array['next'] - $list_max_entries_per_page;
$end_rec = $navigation_array['next'] - 1;
}
else
{
$start_rec = $navigation_array['prev'] + $list_max_entries_per_page;
$end_rec = $noofrows;
}
}
$focus = new Invoice();
$title=array('myTopInvoices.gif',$current_module_strings['LBL_MY_TOP_INVOICE'],'home_mytopinv');
//Retreive the List View Table Header
$controller = new ListViewController($adb, $current_user, $queryGenerator);
$controller->setHeaderSorting(false);
$header = $controller->getListViewHeader($focus,$currentModule,$url_string,$sorder,
$order_by, true);
$entries = $controller->getListViewEntries($focus,$currentModule,$list_result,
$navigation_array, true);
$values=Array('ModuleName'=>'Invoice','Title'=>$title,'Header'=>$header,'Entries'=>$entries,'search_qry'=>$search_qry);
if ( ($display_empty_home_blocks && $noofrows == 0 ) || ($noofrows>0) )
return $values;
}
function getTopInvoiceSearch($output, $input) {
$output['query'] = 'true';
$output['Fields0'] = 'invoicestatus';
$output['Condition0'] = 'n';
$output['Srch_value0'] = 'Paid';
$output['Fields1'] = 'assigned_user_id';
$output['Condition1'] = 'e';
$output['Srch_value1'] = $input['assigned_user_id'];
$output['searchtype'] = 'advance';
$output['search_cnt'] = '2';
$output['matchtype'] = 'all';
return $output;
}
?>
@@ -0,0 +1,236 @@
<?php
/*+********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
require_once('Smarty_setup.php');
require_once("data/Tracker.php");
require_once('modules/Invoice/Invoice.php');
require_once('include/logging.php');
require_once('include/ListView/ListView.php');
require_once('include/utils/utils.php');
require_once('modules/CustomView/CustomView.php');
require_once('include/database/Postgres8.php');
global $app_strings,$list_max_entries_per_page,$currentModule,$theme;
$log = LoggerManager::getLogger('order_list');
if (!isset($where)) $where = "";
$url_string = '';
$focus = new Invoice();
// Initialize sort by fields
$focus->initSortbyField('Invoice');
// END
$smarty = new vtigerCRM_Smarty;
$other_text = Array();
if(!$_SESSION['lvs'][$currentModule])
{
unset($_SESSION['lvs']);
$modObj = new ListViewSession();
$modObj->sorder = $sorder;
$modObj->sortby = $order_by;
$_SESSION['lvs'][$currentModule] = get_object_vars($modObj);
}
if($_REQUEST['errormsg'] != '')
{
$errormsg = vtlib_purify($_REQUEST['errormsg']);
$smarty->assign("ERROR","The User does not have permission to Change/Delete ".$errormsg." ".$currentModule);
}else
{
$smarty->assign("ERROR","");
}
//<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
$sorder = $focus->getSortOrder();
$order_by = $focus->getOrderBy();
$_SESSION['INVOICE_ORDER_BY'] = $order_by;
$_SESSION['INVOICE_SORT_ORDER'] = $sorder;
//<<<<<<<<<<<<<<<<<<< sorting - stored in session >>>>>>>>>>>>>>>>>>>>
//<<<<cutomview>>>>>>>
$oCustomView = new CustomView("Invoice");
$viewid = $oCustomView->getViewId($currentModule);
$customviewcombo_html = $oCustomView->getCustomViewCombo($viewid);
$viewnamedesc = $oCustomView->getCustomViewByCvid($viewid);
//Added to handle approving or denying status-public by the admin in CustomView
$statusdetails = $oCustomView->isPermittedChangeStatus($viewnamedesc['status']);
$smarty->assign("CUSTOMVIEW_PERMISSION",$statusdetails);
//To check if a user is able to edit/delete a customview
$edit_permit = $oCustomView->isPermittedCustomView($viewid,'EditView',$currentModule);
$delete_permit = $oCustomView->isPermittedCustomView($viewid,'Delete',$currentModule);
$smarty->assign("CV_EDIT_PERMIT",$edit_permit);
$smarty->assign("CV_DELETE_PERMIT",$delete_permit);
//<<<<<customview>>>>>
$smarty->assign("CHANGE_OWNER",getUserslist());
$smarty->assign("CHANGE_GROUP_OWNER",getGroupslist());
if(isPermitted('Invoice','Delete','') == 'yes')
{
$other_text['del'] = $app_strings[LBL_MASS_DELETE];
}
if(isPermitted('Invoice','EditView','') == 'yes')
{
$other_text['mass_edit'] = $app_strings[LBL_MASS_EDIT];
$other_text['c_owner'] = $app_strings[LBL_CHANGE_OWNER];
}
if($viewnamedesc['viewname'] == 'All')
{
$smarty->assign("ALL", 'All');
}
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH",$image_path);
$smarty->assign("MODULE",$currentModule);
$smarty->assign("SINGLE_MOD",'Invoice');
$smarty->assign("CUSTOMVIEW_OPTION",$customviewcombo_html);
$smarty->assign("VIEWID", $viewid);
$smarty->assign("BUTTONS",$other_text);
$category = getParentTab();
$smarty->assign("CATEGORY",$category);
//Retreive the list from Database
//<<<<<<<<<customview>>>>>>>>>
global $current_user;
$queryGenerator = new QueryGenerator($currentModule, $current_user);
if ($viewid != "0") {
$queryGenerator->initForCustomViewById($viewid);
} else {
$queryGenerator->initForDefaultCustomView();
}
//<<<<<<<<customview>>>>>>>>>
// Enabling Module Search
$url_string = '';
if($_REQUEST['query'] == 'true') {
$queryGenerator->addUserSearchConditions($_REQUEST);
$ustring = getSearchURL($_REQUEST);
$url_string .= "&query=true$ustring";
$smarty->assign('SEARCH_URL', $url_string);
}
$query = $queryGenerator->getQuery();
//$url_qry = getURLstring($focus);
if(isset($order_by) && $order_by != '')
{
if($order_by == 'smownerid')
{
if( $adb->dbType == "pgsql")
$query .= ' GROUP BY user_name';
$query .= ' ORDER BY user_name '.$sorder;
}
else
{
$tablename = getTableNameForField('Invoice',$order_by);
$tablename = (($tablename != '')?($tablename."."):'');
if( $adb->dbType == "pgsql")
$query .= ' GROUP BY '.$tablename.$order_by;
$query .= ' ORDER BY '.$tablename.$order_by.' '.$sorder;
}
}
//Postgres 8 fixes
if( $adb->dbType == "pgsql")
$query = fixPostgresQuery( $query, $log, 0);
if(PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true){
$count_result = $adb->query( mkCountQuery( $query));
$noofrows = $adb->query_result($count_result,0,"count");
}else{
$noofrows = null;
}
$queryMode = (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true');
$start = ListViewSession::getRequestCurrentPage($currentModule, $query, $viewid, $queryMode);
$navigation_array = VT_getSimpleNavigationValues($start,$list_max_entries_per_page,$noofrows);
$limit_start_rec = ($start-1) * $list_max_entries_per_page;
if( $adb->dbType == "pgsql")
$list_result = $adb->pquery($query. " OFFSET $limit_start_rec LIMIT $list_max_entries_per_page", array());
else
$list_result = $adb->pquery($query. " LIMIT $limit_start_rec, $list_max_entries_per_page", array());
$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec,$noofrows);
$smarty->assign('recordListRange',$recordListRangeMsg);
//Retreive the List View Table Header
if($viewid !='')
$url_string .="&viewname=".$viewid;
$controller = new ListViewController($adb, $current_user, $queryGenerator);
$listview_header = $controller->getListViewHeader($focus,$currentModule,$url_string,$sorder,
$order_by);
$smarty->assign("LISTHEADER", $listview_header);
$listview_header_search = $controller->getBasicSearchFieldInfoList();
$smarty->assign("SEARCHLISTHEADER",$listview_header_search);
$listview_entries = $controller->getListViewEntries($focus,$currentModule,$list_result,
$navigation_array);
$smarty->assign("LISTENTITY", $listview_entries);
$smarty->assign("SELECT_SCRIPT", $view_script);
//Added to select Multiple records in multiple pages
$smarty->assign("SELECTEDIDS", vtlib_purify($_REQUEST['selobjs']));
$smarty->assign("ALLSELECTEDIDS", vtlib_purify($_REQUEST['allselobjs']));
$smarty->assign("CURRENT_PAGE_BOXES", implode(array_keys($listview_entries),";"));
$navigationOutput = getTableHeaderSimpleNavigation($navigation_array, $url_string,"Invoice","index",$viewid);
$alphabetical = AlphabeticalSearch($currentModule,'index','subject','true','basic',"","","","",$viewid);
$fieldnames = $controller->getAdvancedSearchOptionString();
$criteria = getcriteria_options();
$smarty->assign("CRITERIA", $criteria);
$smarty->assign("FIELDNAMES", $fieldnames);
$smarty->assign("CUSTOMVIEW_OPTION",$customviewcombo_html);
$smarty->assign("VIEWID", $viewid);
$smarty->assign("BUTTONS", $other_text);
$smarty->assign("ALPHABETICAL", $alphabetical);
$smarty->assign("NAVIGATION", $navigationOutput);
$smarty->assign("CUSTOMVIEW_OPTION",$customviewcombo_html);
$smarty->assign("VIEWID", $viewid);
$smarty->assign("BUTTONS", $other_text);
$check_button = Button_Check($module);
$smarty->assign("CHECK", $check_button);
ListViewSession::setSessionQuery($currentModule,$query,$viewid);
// Gather the custom link information to display
include_once('vtlib/Vtiger/Link.php');
$customlink_params = Array('MODULE'=>$currentModule, 'ACTION'=>vtlib_purify($_REQUEST['action']), 'CATEGORY'=> $category);
$smarty->assign('CUSTOM_LINKS', Vtiger_Link::getAllByType(getTabid($currentModule), Array('LISTVIEWBASIC','LISTVIEW'), $customlink_params));
// END
if(isset($_REQUEST['ajax']) && $_REQUEST['ajax'] != '')
$smarty->display("ListViewEntries.tpl");
else
$smarty->display("ListView.tpl");
?>
@@ -0,0 +1,11 @@
<?php
/*+*******************************************************************************
* 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.
*********************************************************************************/
require_once 'include/ListView/ListViewPagging.php';
?>
@@ -0,0 +1,45 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
global $mod_strings,$app_strings,$theme,$currentModule,$current_user;
require_once('Smarty_setup.php');
require_once('include/utils/utils.php');
$focus = CRMEntity::getInstance($currentModule);
$focus->mode = '';
$mode = 'mass_edit';
$disp_view = getView($focus->mode);
$smarty = new vtigerCRM_Smarty;
$smarty->assign("BLOCKS",getBlocks($currentModule,$disp_view,$mode,$focus->column_fields));
$smarty->assign("IDS",$_REQUEST['idstring']);
$smarty->assign("MASS_EDIT","1");
$smarty->assign("MODULE",$currentModule);
$smarty->assign("APP",$app_strings);
$smarty->assign("CATEGORY",getParentTab());
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
// Field Validation Information
$tabid = getTabid($currentModule);
$validationData = getDBValidationData($focus->tab_name,$tabid);
$validationArray = split_validationdataArray($validationData);
$smarty->assign("VALIDATION_DATA_FIELDNAME",$validationArray['fieldname']);
$smarty->assign("VALIDATION_DATA_FIELDDATATYPE",$validationArray['datatype']);
$smarty->assign("VALIDATION_DATA_FIELDLABEL",$validationArray['fieldlabel']);
$smarty->display('MassEditForm.tpl');
?>
@@ -0,0 +1,67 @@
<?php
/*+********************************************************************************
* 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.
*********************************************************************************/
global $currentModule;
$focus = CRMEntity::getInstance($currentModule);
$idlist= vtlib_purify($_REQUEST['massedit_recordids']);
$viewid = vtlib_purify($_REQUEST['viewname']);
$return_module = vtlib_purify($_REQUEST['massedit_module']);
$return_action = 'index';
global $rstart;
//Added to fix 4600
$url = getBasic_Advance_SearchURL();
if(isset($_REQUEST['start']) && $_REQUEST['start']!=''){
$rstart = "&start=".vtlib_purify($_REQUEST['start']);
}
if(isset($idlist)) {
$recordids = explode(';', $idlist);
for($index = 0; $index < count($recordids); ++$index) {
$recordid = $recordids[$index];
if($recordid == '') continue;
if(isPermitted($currentModule,'EditView',$recordid) == 'yes') {
// Save each module record with update value.
$focus->retrieve_entity_info($recordid, $currentModule);
$focus->mode = 'edit';
$focus->id = $recordid;
foreach($focus->column_fields as $fieldname => $val)
{
if(isset($_REQUEST[$fieldname."_mass_edit_check"]))
{
if($fieldname == 'assigned_user_id'){
if($_REQUEST['assigntype'] == 'U') {
$value = $_REQUEST['assigned_user_id'];
} elseif($_REQUEST['assigntype'] == 'T') {
$value = $_REQUEST['assigned_group_id'];
}
} else {
if(is_array($_REQUEST[$fieldname]))
$value = $_REQUEST[$fieldname];
else
$value = trim($_REQUEST[$fieldname]);
}
$focus->column_fields[$fieldname] = $value;
}
else{
$focus->column_fields[$fieldname] = decode_html($focus->column_fields[$fieldname]);
}
}
$focus->save($currentModule);
}
}
}
$parenttab = getParentTab();
header("Location: index.php?module=$return_module&action=$return_action&parenttab=$parenttab$rstart");
?>
@@ -0,0 +1,13 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
require_once('Popup.php');
?>
+65
View File
@@ -0,0 +1,65 @@
<?php
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* $Header: /cvsroot/vtigercrm/vtiger_crm/modules/Invoice/Save.php,v 1.8 2005/11/17 09:43:48 jerrydgeorge Exp $
* Description: Saves an Account record and then redirects the browser to the
* defined return URL.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('modules/Invoice/Invoice.php');
require_once('include/logging.php');
require_once('include/database/PearDatabase.php');
include_once("modules/Emails/mail.php");
$local_log =& LoggerManager::getLogger('index');
$focus = new Invoice();
//added to fix 4600
$search=vtlib_purify($_REQUEST['search_url']);
global $current_user;
setObjectValuesFromRequest($focus);
$focus->column_fields['currency_id'] = $_REQUEST['inventory_currency'];
$cur_sym_rate = getCurrencySymbolandCRate($_REQUEST['inventory_currency']);
$focus->column_fields['conversion_rate'] = $cur_sym_rate['rate'];
if($_REQUEST['assigntype'] == 'U') {
$focus->column_fields['assigned_user_id'] = $_REQUEST['assigned_user_id'];
} elseif($_REQUEST['assigntype'] == 'T') {
$focus->column_fields['assigned_user_id'] = $_REQUEST['assigned_group_id'];
}
$focus->save("Invoice");
$return_id = $focus->id;
$parenttab = getParentTab();
if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") $return_module = vtlib_purify($_REQUEST['return_module']);
else $return_module = "Invoice";
if(isset($_REQUEST['return_action']) && $_REQUEST['return_action'] != "") $return_action = vtlib_purify($_REQUEST['return_action']);
else $return_action = "DetailView";
if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") $return_id = vtlib_purify($_REQUEST['return_id']);
$local_log->debug("Saved record with id of ".$return_id);
//code added for returning back to the current view after edit from list view
if($_REQUEST['return_viewname'] == '') $return_viewname='0';
if($_REQUEST['return_viewname'] != '')$return_viewname=vtlib_purify($_REQUEST['return_viewname']);
header("Location: index.php?action=$return_action&module=$return_module&parenttab=$parenttab&record=$return_id&viewname=$return_viewname&start=".vtlib_purify($_REQUEST['pagenumber']).$search);
?>
@@ -0,0 +1,25 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
include_once 'modules/Invoice/InvoicePDFController.php';
$controller = new Vtiger_InvoicePDFController($currentModule);
$controller->loadRecord(vtlib_purify($_REQUEST['record']));
$filenameid = $_REQUEST['record'];
if(empty($filenameid)) $filenameid = time();
$filepath="storage/Invoice_$filenameid.pdf";
//added file name to make it work in IE, also forces the download giving the user the option to save
$controller->Output($filepath,'F');
// Added to fix annoying bug that includes HTML in your PDF
echo "<script>window.history.back();</script>";
exit()
?>
@@ -0,0 +1,13 @@
<?php
/*+**********************************************************************************
* 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.
************************************************************************************/
include('modules/Vtiger/Settings.php');
?>
@@ -0,0 +1,12 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
require_once('include/Ajax/TagCloud.php')
?>
@@ -0,0 +1,11 @@
<?php
/*+*******************************************************************************
* 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.
*********************************************************************************/
require_once 'modules/Home/UnifiedSearch.php';
?>
@@ -0,0 +1,52 @@
<?php
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* $Header$
* Description: TODO To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $theme,$mod_strings;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
include ('modules/Invoice/ListView.php');
?>
@@ -0,0 +1,202 @@
<?php
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version 1.1.2
* ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* $Header$
* Description: Defines the English language pack
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = Array(
'LBL_MODULE_NAME'=>'Invoice',
'LBL_SO_MODULE_NAME'=>'Invoice',
'LBL_RELATED_PRODUCTS'=>'Product Details',
'LBL_MODULE_TITLE'=>'Invoice: Home',
'LBL_SEARCH_FORM_TITLE'=>'Invoice Search',
'LBL_LIST_FORM_TITLE'=>'Invoice List',
'LBL_LIST_SO_FORM_TITLE'=>'Sales Order List',
'LBL_NEW_FORM_TITLE'=>'New Invoice',
'LBL_NEW_FORM_SO_TITLE'=>'New Sales Order',
'LBL_MEMBER_ORG_FORM_TITLE'=>'Member Organizations',
'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',
//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_Quote_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:',
'LBL_TERMS_INFORMATION'=>'Terms & Conditions',
'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
'Subject'=>'Subject',
'Quote Name'=>'Quote Name',
'Vendor Name'=>'Vendor Name',
'Invoice Terms'=>'Invoice Terms',
'Contact Name'=>'Contact Name',//to include contact name vtiger_field in Invoice
'Invoice Date'=>'Invoice Date',
'Sub Total'=>'Sub Total',
'Due date'=>'Due Date',
'Carrier'=>'Carrier',
'Type'=>'Type',
'Sales Tax'=>'Sales Tax',
'Sales Commission'=>'Sales Commission',
'Excise Duty'=>'Excise Duty',
'Total'=>'Total',
'Product Name'=>'Product Name',
'Assigned To'=>'Assigned To',
'Billing Address'=>'Billing Address',
'Shipping Address'=>'Shipping Address',
'Billing City'=>'Billing City',
'Billing State'=>'Billing State',
'Billing Code'=>'Billing Postal Code',
'Billing Country'=>'Billing Country',
'Billing Po Box'=>'Billing PO Box',
'Shipping Po Box'=>'Shipping PO Box',
'Shipping City'=>'Shipping City',
'Shipping State'=>'Shipping State',
'Shipping Code'=>'Shipping Postal Code',
'Shipping Country'=>'Shipping Country',
'City'=>'City',
'State'=>'State',
'Code'=>'Code',
'Country'=>'Country',
'Created Time'=>'Created Time',
'Modified Time'=>'Modified Time',
'Description'=>'Description',
'Potential Name'=>'Potential Name',
'Customer No'=>'Customer No',
'Sales Order'=>'Sales Order',
'Pending'=>'Pending',
'Account Name'=>'Account Name',
'Terms & Conditions'=>'Terms & Conditions',
//Quote Info
'LBL_INVOICE_INFORMATION'=>'Invoice Information',
'LBL_INVOICE'=>'Invoice:',
'LBL_SO_INFORMATION'=>'Sales Order Information',
'LBL_SO'=>'Sales Order:',
//Added in release 4.2
'LBL_SUBJECT'=>'Subject:',
'LBL_SALES_ORDER'=>'Sales order:',
'Invoice Id'=>'Invoice Id',
'LBL_MY_TOP_INVOICE'=>'My Top Open Invoice',
'LBL_INVOICE_NAME'=>'Invoice Name:',
'Purchase Order'=>'Purchase Order',
'Status'=>'Status',
'Id'=>'Invoice Id',
'Invoice'=>'Invoice',
//Added for existing Picklist Entries
'Created'=>'Created',
'Approved'=>'Approved',
'Sent'=>'Sent',
'Credit Invoice'=>'Credit Invoice',
'Paid'=>'Paid',
'AutoCreated'=>'AutoCreated',
//Added to Custom Invoice Number
'Invoice No'=>'Invoice No',
'Adjustment'=>'Adjustment',
//Added for Reports (5.0.4)
'Tax Type'=>'Tax Type',
'Discount Percent'=>'Discount Percent',
'Discount Amount'=>'Discount Amount',
'Terms & Conditions'=>'Terms & Conditions',
'No'=>'No',
'Date'=>'Date',
// Added affter 5.0.4 GA
//Added for Documents module
'Documents'=>'Documents',
);
?>
@@ -0,0 +1,201 @@
<?php
/**
* Copyright (C) 2006-2010 YUCHENG HU
*
* ---------------------------------------------
* HA WEBSYSTEMS
* http://www.hawebs.net
* https://www.hawebs.org/forums/computer/
*
* CONTACT
* [email protected] / [email protected]
*
* ---------------------------------------------
* [A] GNU GENERAL PUBLIC LICENSE GNU/LGPL
* [B] Apache License, Version 2.0
*
* ---------------------------------------------
* NOTE
* 1. 所有的语言配置文件请采用 UTF-8 编码
*
* ---------------------------------------------
*/
$mod_strings = Array(
'LBL_MODULE_NAME' => '发票',
'LBL_SO_MODULE_NAME' => '发票',
'LBL_RELATED_PRODUCTS' => '在线清单',
'LBL_MODULE_TITLE' => '发票:首页',
'LBL_SEARCH_FORM_TITLE' => '搜寻发票',
'LBL_LIST_FORM_TITLE' => '发票列表',
'LBL_LIST_SO_FORM_TITLE' => '销售列表',
'LBL_NEW_FORM_TITLE' => '新增发票',
'LBL_NEW_FORM_SO_TITLE' => '新增销售',
'LBL_MEMBER_ORG_FORM_TITLE' => '会员所属单位',
'LBL_LIST_ACCOUNT_NAME' => '客户名称',
'LBL_LIST_CITY' => '乡镇市区',
'LBL_LIST_WEBSITE' => '网站',
'LBL_LIST_STATE' => '市(县)',
'LBL_LIST_PHONE' => '电话',
'LBL_LIST_EMAIL_ADDRESS' => '电子邮件',
'LBL_LIST_CONTACT_NAME' => '联络人名称',
//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' => '客户:',
'LBL_ACCOUNT_NAME' => '客户名称:',
'LBL_PHONE' => '电话:',
'LBL_WEBSITE' => '网站:',
'LBL_FAX' => '传真:',
'LBL_TICKER_SYMBOL' => '传票符号:',
'LBL_OTHER_PHONE' => '其它电话:',
'LBL_ANY_PHONE' => '其它电话:',
'LBL_MEMBER_OF' => '会员:',
'LBL_EMAIL' => '电子信箱:',
'LBL_EMPLOYEES' => '员工数:',
'LBL_OTHER_EMAIL_ADDRESS' => '其它电子信箱:',
'LBL_ANY_EMAIL' => '其它电子信箱:',
'LBL_OWNERSHIP' => '负责人:',
'LBL_RATING' => '评分:',
'LBL_INDUSTRY' => '产业别:',
'LBL_SIC_CODE' => '统一编号:',
'LBL_TYPE' => '类型:',
'LBL_ANNUAL_REVENUE' => '年收入:',
'LBL_ADDRESS_INFORMATION' => '地址信息',
'LBL_Quote_INFORMATION' => '客户信息',
'LBL_CUSTOM_INFORMATION' => '自订信息',
'LBL_BILLING_ADDRESS' => '发票地址:',
'LBL_SHIPPING_ADDRESS' => '送货地址:',
'LBL_ANY_ADDRESS' => '任一地址:',
'LBL_CITY' => '乡镇市区:',
'LBL_STATE' => '市(县):',
'LBL_POSTAL_CODE' => '邮政编码:',
'LBL_COUNTRY' => '省(市/自治区):',
'LBL_DESCRIPTION_INFORMATION' => '细节内容',
'LBL_DESCRIPTION' => '描述:',
'LBL_TERMS_INFORMATION' => '限制与条件',
'NTC_COPY_BILLING_ADDRESS' => '复制发票地址到送货地址',
'NTC_COPY_SHIPPING_ADDRESS' => '复制送货地址到发票地址',
'NTC_REMOVE_MEMBER_ORG_CONFIRMATION' => '您确定要移除这笔会员所属单位记录?',
'LBL_DUPLICATE' => '潜在案件内容复制到客户',
'MSG_DUPLICATE' => '建立这笔客户数据来自于潜在案件内容,您可以点选客户列表中的客户以复制建立新的客户,并且继承它的相关数据。',
'LBL_INVITEE' => '联络人',
'ERR_DELETE_RECORD' => '必须指定一笔记录编号才能够删除客户。',
'LBL_SELECT_ACCOUNT' => '选择客户',
'LBL_GENERAL_INFORMATION' => '一般信息',
//for v4 release added
'LBL_NEW_POTENTIAL' => '新增潜在案件',
'LBL_POTENTIAL_TITLE' => '潜在案件',
'LBL_NEW_TASK' => '新增任务',
'LBL_TASK_TITLE' => '任务',
'LBL_NEW_CALL' => '新增电话记录',
'LBL_CALL_TITLE' => '电话记录',
'LBL_NEW_MEETING' => '新增会议记录',
'LBL_MEETING_TITLE' => '会议',
'LBL_NEW_EMAIL' => '新增电子邮件',
'LBL_EMAIL_TITLE' => '邮件',
'LBL_NEW_CONTACT' => '新增联络人',
'LBL_CONTACT_TITLE' => '联络人',
//Added vtiger_fields after RC1 - Release
'LBL_ALL' => '全部',
'LBL_PROSPECT' => '期望',
'LBL_INVESTOR' => '投资者',
'LBL_RESELLER' => '转售人',
'LBL_PARTNER' => '伙伴',
// Added for 4GA
'LBL_TOOL_FORM_TITLE' => '客户工具',
//Added for 4GA
'Subject' => '标题',
'Quote Name' => '报价名称',
'Vendor Name' => '卖方名称',
'Invoice Terms' => '发票期限',
'Contact Name' => '联络人名称',//to include contact name vtiger_field in Invoice
'Invoice Date' => '发票日期',
'Sub Total' => '小计',
'Issued Date' => '创建日期',
'Due Date' => '应付日期',
'Carrier' => '货运商',
'Type' => '类型',
'Sales Tax' => '销售税金',
'Sales Commission' => '销售佣金',
'Excise Duty' => '营业税',
'Total' => '总计 ',
'Product Name' => '商品名称',
'Assigned To' => '负责人',
'Billing Address' => '发票地址',
'Shipping Address' => '送货地址',
'Billing City' => '[发票地址]乡镇市区',
'Billing State' => '[发票地址]市(县)',
'Billing Code' => '[发票地址]邮政编码',
'Billing Country' => '[发票地址]省(市/自治区)',
'Billing Po Box' => '[发票地址]邮政信箱',
'Shipping Po Box' => '[送货地址]邮政信箱',
'Shipping City' => '[送货地址]乡镇市区',
'Shipping State' => '[送货地址]市(县)',
'Shipping Code' => '[送货地址]邮政编码',
'Shipping Country' => '[送货地址]省(市/自治区)',
'City' => '乡镇市区',
'State' => '市(县)',
'Code' => '邮政编码',
'Country' => '省(市/自治区)',
'Created Time' => '建档时间',
'Modified Time' => '修改时间',
'Description' => '细节内容',
'Potential Name' => '潜在案件名称',
'Customer No' => '客户编号',
'Sales Order' => '销售',
'Notes' => '备忘录',
'Pending' => '期间',
'Account Name' => '客户名称',
'Terms & Conditions' => '限制与条件',
//Quote Info
'LBL_INVOICE_INFORMATION' => '发票信息',
'LBL_INVOICE' => '发票:',
'LBL_SO_INFORMATION' => '销售订单信息',
'LBL_SO' => '销售订单:',
//Added in release 4.2
'LBL_SUBJECT' => '主旨:',
'LBL_SALES_ORDER' => '销售订单:',
'Invoice Id' => '发票号码',
'LBL_MY_TOP_INVOICE' => '自己未处理的发票',
'LBL_INVOICE_NAME' => '发票名称:',
'Purchase Order' => '采购订单',
'Status' => '状态',
'Id' => '发票编号',
'Invoice' => '发票',
//Added for existing Picklist Entries
'Created' => '已建立',
'Approved' => '已审核',
'Sent' => '已寄送',
'Credit Invoice' => '贷方发票',
'Paid' => '已付款',
//Added to Custom Invoice Number
'Invoice No'=>'发票号码',
'Adjustment'=>'调整',
//Added for Reports (5.0.4)
'Tax Type'=>'Tax Type',
'Discount Percent'=>'Discount Percent',
'Discount Amount'=>'Discount Amount',
'Terms & Conditions'=>'Terms & Conditions',
'No'=>'No',
'Date'=>'Date',
// Added affter 5.0.4 GA
//Added for Documents module
'Documents'=>'Documents',
);
?>
@@ -0,0 +1,35 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
define('USD',"$");
define('EURO', chr(128) );
$desc=explode("\n",$description);
$cond=explode("\n",$conditions);
$num=230;
/* **************** Begin Description ****************** */
$descBlock=array("10",$top,"53", $num);
$pdf->addDescBlock($description, $app_strings["Description"], $descBlock);
/* ************** End Description *********************** */
/* **************** Begin Terms ****************** */
$termBlock=array("107",$top,"53", $num);
$pdf->addDescBlock($conditions, $app_strings["Terms & Conditions"], $termBlock);
/* ************** End Terms *********************** */
?>
@@ -0,0 +1,104 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
define('USD',"$");
define('EURO', chr(128) );
// ************** Begin company information *****************
$imageBlock=array("10","3","0","0");
$pdf->addImage( $logo_name, $imageBlock);
// x,y,width
if($org_phone != '')
$phone ="\n".$app_strings["Phone"].":".$org_phone;
$companyBlockPositions=array( "10","23","62" );
$companyText=$org_address."\n".$org_city.", ".$org_state." ".$org_code." ".$org_country." ".$phone."\n".$org_website;
$pdf->addTextBlock( $org_name, $companyText ,$companyBlockPositions );
// ************** End company information *******************
// ************* Begin Top-Right Header ***************
// title
$titleBlock=array("147","7");
$pdf->title( $app_strings["Invoice"],"", $titleBlock );
$soBubble=array("168","17","12");
$pdf->addBubbleBlock($so_name, $app_strings["SalesOrder"], $soBubble);
$poBubble=array("114","17","12");
$pdf->addBubbleBlock($po_name, $app_strings["PurchaseOrder"], $poBubble);
// page number
$pageBubble=array("147","17",0);
$pdf->addBubbleBlock($page_num, $app_strings["Page"], $pageBubble);
// ************** End Top-Right Header *****************
// ************** Begin Addresses **************
// shipping Address
$shipLocation = array("147","40","61");
if(trim($ship_street)!='')
$shipText = $ship_street."\n";
if(trim($ship_city) !='')
$shipText .= $ship_city.", ";
if(trim($ship_state)!='' || trim($ship_code)!= '')
$shipText .= $ship_state." ".$ship_code."\n";
$shipText .=$ship_country;
$pdf->addTextBlock( $app_strings["Shipping Address"].":", $shipText, $shipLocation );
// billing Address
$billPositions = array("10","51","61");
if(trim($bill_street)!='')
$billText = $bill_street."\n";
if(trim($bill_city) !='')
$billText .= $bill_city.", ";
if(trim($bill_state)!='' || trim($bill_code)!= '')
$billText .= $bill_state." ".$bill_code."\n";
$billText .=$bill_country;
$pdf->addTextBlock($app_strings["Billing Address"].":",$billText, $billPositions);
// ********** End Addresses ******************
/* ******** Begin Invoice Data ************************ */
// terms block
$termBlock=array("10","67");
$pdf->addRecBlock($account_name, $app_strings["Customer Name"], $termBlock);
// issue date block
$issueBlock=array("80","37");
$pdf->addRecBlock(getDisplayDate(date("Y-m-d")), $app_strings["Issue Date"],$issueBlock);
// due date block
$dueBlock=array("81","52");
$pdf->addRecBlock($valid_till, $app_strings["Due Date"],$dueBlock);
// Contact Name block
$conBlock=array("79","67");
$pdf->addRecBlock($contact_name, $app_strings["Contact Name"],$conBlock);
// vtiger_invoice number block
$invBlock=array("145","67");
$pdf->addRecBlock($invoice_no, $app_strings["Invoice Number"],$invBlock);
/* ************ End Invoice Data ************************ */
?>
@@ -0,0 +1,62 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
// Fun with watermarks :)
$waterMarkPositions=array("60","110");
$waterMarkRotate=array("0","0","0");
$pdf->watermark( $app_strings["Thank You"], $waterMarkPositions, $waterMarkRotate );
$waterMarkPositions=array("30","130");
$pdf->watermark( $app_strings["For Your Business"], $waterMarkPositions, $waterMarkRotate );
// blowing bubbles
$Bubble=array("10","80","170","4");
$pdf->addBubble("", "", $Bubble);
$Bubble=array("168","131","12");
//$pdf->addBubbleBlock("Neat Look", "For A", $Bubble);
$Bubble=array("10","131","12");
//$pdf->addBubbleBlock("The Corners", "Line Up", $Bubble);
/* ************* Begin Totals ************************** */
$totalBlock=array("59","135");
$names=array($app_strings["Subtotal"],$app_strings["Tax"],$app_strings["Adjustment"],$app_strings["Total"]);
$totals=array($price_subtotal,$price_salestax,$price_adjustment,$price_total);
$pdf->addTotalsRec($names,$totals,$totalBlock);
/* ************* End Totals *************************** */
// lets add an image :)
$imageBlock=array("15","95","8","8");
$pdf->addImage( "sale.jpeg", $imageBlock);
$imageBlock=array("185","95","8","8");
$pdf->addImage( "sale.jpeg", $imageBlock);
// descriptions that change sizes!
$descc=count(explode("\n",$description));
$condc=count(explode("\n",$conditions));
if( (strlen($description) > 256) || (strlen($conditions) > 256) || $condc >6 || $descc > 6 )
$num=255;
else
$num=150;
/* **************** Begin Description ****************** */
$descBlock=array("10","160","53", $num);
$pdf->addDescBlock($description, $app_strings["Description"], $descBlock);
$termBlock=array("107","160","53", $num);
$pdf->addDescBlock($conditions, $app_strings["Terms & Conditions"], $termBlock);
/* ************** End Terms *********************** */
?>
@@ -0,0 +1,59 @@
<?php
/*********************************************************************************
** 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.
*
********************************************************************************/
// draw a broken line
$width=3;
$area=216;
$pad=2;
for ($i=10;$i<200;$i++) {
$linePos=array($i,$area,$width);
$pdf->drawLine($linePos);
$i = (($i+$width)+$pad)-1;
}
// company addy
if($org_phone != '')
$phone="\n".$app_strings["Phone"].": ".$org_phone;
if($org_fax != '')
$fax ="\nFax: ".$org_fax;
$companyBlockPositions=array( "10","220","60" );
$companyText=$org_address."\n".$org_city.", ".$org_state." ".$org_code." ".$org_country." ".$phone." ".$fax."\n".$org_website ;
$pdf->addTextBlock( $org_name, $companyText ,$companyBlockPositions );
// billing Address
$billPositions = array("85","235","60");
if(trim($bill_street)!='')
$billText = $bill_street."\n";
if(trim($bill_city) !='')
$billText .= $bill_city.", ";
if(trim($bill_state)!='' || trim($bill_code)!= '')
$billText .= $bill_state." ".$bill_code."\n";
$billText .=$bill_country;
$pdf->addTextBlock($app_strings["Billing Address"].":",$billText, $billPositions);
// totals
$totalBlock=array("145","235","10", "110");
$totalText=$app_strings["Subtotal"].": ".$price_subtotal."\n".
$app_strings["Tax"].": ".$price_salestax."\n".
$app_strings["Adjustment"].": ".$price_adjustment."\n".
$app_strings["Total"].": ".$price_total;
$pdf->addDescBlock($totalText, $app_strings["Total Due"], $totalBlock);
$blurbBlock=array("10","265","150", "60");
$blockText=$app_strings["Detach_Info"];
$pdf->addDescBlock($blockText, $app_strings["Instructions"], $blurbBlock);
?>
@@ -0,0 +1,48 @@
<?php
/*+********************************************************************************
* 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.
*********************************************************************************/
require_once('include/database/PearDatabase.php');
require_once('user_privileges/default_module_view.php');
global $adb, $singlepane_view, $currentModule;
$idlist = vtlib_purify($_REQUEST['idlist']);
$dest_mod = vtlib_purify($_REQUEST['destination_module']);
$parenttab = getParentTab();
$forCRMRecord = vtlib_purify($_REQUEST['parentid']);
if($singlepane_view == 'true')
$action = "DetailView";
else
$action = "CallRelatedList";
$storearray = array();
if(!empty($_REQUEST['idlist'])) {
// Split the string of ids
$storearray = explode (";",trim($idlist,";"));
} else if(!empty($_REQUEST['entityid'])){
$storearray = array($_REQUEST['entityid']);
}
$focus = CRMEntity::getInstance($currentModule);
foreach($storearray as $id)
{
if($id != '')
{
if($dest_mod == 'Documents')
$adb->pquery("insert into vtiger_senotesrel values (?,?)", array($forCRMRecord,$id));
else {
$focus->save_related_module($currentModule, $forCRMRecord, $dest_mod, $id);
}
}
}
header("Location: index.php?action=$action&module=$currentModule&record=".$forCRMRecord."&parenttab=".$parenttab);
?>