From 218a7bf3e0b2708890af0d3ed062945ad4b60355 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Thu, 25 Nov 2010 00:56:35 +0000 Subject: [PATCH] =?UTF-8?q?=E5=8F=A6=E4=B8=80=E4=B8=AA=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E6=B1=89=E5=8C=96=E4=B8=8D=E5=87=86=E7=A1=AE=EF=BC=9A=20vTiger?= =?UTF-8?q?=205.2.1=20=E7=AE=80=E4=BD=93=20NB=2020101122=20=E6=B1=89?= =?UTF-8?q?=E5=8C=96=E7=89=88=E7=9A=84=EF=BC=9A=20=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E3=80=8B=E4=BA=A7=E5=93=81=20=E4=BF=A1=E6=81=AF=E3=80=8B?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E4=BB=BB=E5=8A=A1=20=20=EF=BC=8C=E8=BF=99?= =?UTF-8?q?=E4=B8=AA=E4=BA=A7=E5=93=81=E4=BB=BB=E5=8A=A1=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=B1=89=E5=8C=96=E6=88=90=E2=80=9C=E4=BA=A7=E5=93=81=E4=B8=8A?= =?UTF-8?q?=E7=BA=BF=E2=80=9D=EF=BC=8C=E6=88=96=E8=80=85=E2=80=9C=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=B8=8A=E6=9E=B6=E2=80=9D=E4=B9=8B=E7=B1=BB=E7=9A=84?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 因之前把产品任务理解错,关闭了这个项目,录入的产品在报价时居然找不到,产品任务这个词在简体里面比较容易误解。 http://forums.hawebs.net/computer/viewthread.php?tid=3979 yuchenghu@hawebs.net http://www.hawebs.net git-svn-id: https://svn.code.sf.net/p/hawebs/svn@655 a2543c7e-f6e9-4f8a-8bff-1ffc34733512 --- .../trunk/modules/Products/ListView.php | 448 +++++++++--------- .../modules/Products/language/zh_cn.lang.php | 82 ++-- 2 files changed, 272 insertions(+), 258 deletions(-) diff --git a/oss/vtiger/trunk/modules/Products/ListView.php b/oss/vtiger/trunk/modules/Products/ListView.php index ba08c5a4..aac79759 100644 --- a/oss/vtiger/trunk/modules/Products/ListView.php +++ b/oss/vtiger/trunk/modules/Products/ListView.php @@ -1,223 +1,227 @@ -initSortbyField($currentModule); -$sorder = $focus->getSortOrder(); -$order_by = $focus->getOrderBy(); - -$_SESSION['PRODUCTS_ORDER_BY'] = $order_by; -$_SESSION['PRODUCTS_SORT_ORDER'] = $sorder; - -$smarty = new vtigerCRM_Smarty(); - -$smarty->assign('MOD', $mod_strings); -$smarty->assign('APP', $app_strings); -$smarty->assign("THEME", $theme); -$smarty->assign('MODULE', $currentModule); -$smarty->assign('SINGLE_MOD', $currentModule); -$smarty->assign('CATEGORY', $category); -$smarty->assign('BUTTONS', $list_buttons); -$smarty->assign('CHECK', $tool_buttons); -$smarty->assign('IMAGE_PATH', "themes/$theme/images/"); - -$smarty->assign('CHANGE_OWNER', getUserslist()); -$smarty->assign('CHANGE_GROUP_OWNER', getGroupslist()); - -// Custom View -$customView = new CustomView($currentModule); -$viewid = $customView->getViewId($currentModule); -$customview_html = $customView->getCustomViewCombo($viewid); -$viewinfo = $customView->getCustomViewByCvid($viewid); - -// Feature available from 5.1 -if(method_exists($customView, 'isPermittedChangeStatus')) { - // Approving or Denying status-public by the admin in CustomView - $statusdetails = $customView->isPermittedChangeStatus($viewinfo['status']); - - // To check if a user is able to edit/delete a CustomView - $edit_permit = $customView->isPermittedCustomView($viewid,'EditView',$currentModule); - $delete_permit = $customView->isPermittedCustomView($viewid,'Delete',$currentModule); - - $smarty->assign("CUSTOMVIEW_PERMISSION",$statusdetails); - $smarty->assign("CV_EDIT_PERMIT",$edit_permit); - $smarty->assign("CV_DELETE_PERMIT",$delete_permit); -} -// END - -$smarty->assign("VIEWID", $viewid); - -if($viewinfo['viewname'] == 'All') $smarty->assign('ALL', 'All'); - -if($viewid ==0) -{ - echo "
"; - echo "
- - - - - - - - - -
$app_strings[LBL_PERMISSION]
- $app_strings[LBL_GO_BACK]
-
-
"; - echo "
"; - exit; -} - -global $current_user; -$queryGenerator = new QueryGenerator($currentModule, $current_user); -if ($viewid != "0") { - $queryGenerator->initForCustomViewById($viewid); -} else { - $queryGenerator->initForDefaultCustomView(); -} - -// Enabling Module Search -$url_string = ''; -if($_REQUEST['query'] == 'true') { - // has to REQUEST as it can either $_GET for Dashboard and - // $_POST for search in listview. - $queryGenerator->addUserSearchConditions($_REQUEST); - $ustring = getSearchURL($_REQUEST); - $url_string .= "&query=true$ustring"; - $smarty->assign('SEARCH_URL', $url_string); -} - -$list_query = $queryGenerator->getQuery(); -$where = $queryGenerator->getConditionalWhere(); -if(isset($where) && $where != '') { - $_SESSION['export_where'] = $where; -} else { - unset($_SESSION['export_where']); -} -// Sorting -if(!empty($order_by)) { - if($order_by == 'smownerid') $list_query .= ' ORDER BY user_name '.$sorder; - else { - $tablename = getTableNameForField($currentModule, $order_by); - $tablename = ($tablename != '')? ($tablename . '.') : ''; - $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder; - } -} - -//Postgres 8 fixes -if( $adb->dbType == "pgsql") - $list_query = fixPostgresQuery( $list_query, $log, 0); - -if(PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true){ - $count_result = $adb->query( mkCountQuery( $list_query)); - $noofrows = $adb->query_result($count_result,0,"count"); -}else{ - $noofrows = null; -} - -$queryMode = (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true'); -$start = ListViewSession::getRequestCurrentPage($currentModule, $list_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($list_query. " OFFSET $limit_start_rec LIMIT $list_max_entries_per_page", array()); -else - $list_result = $adb->pquery($list_query. " LIMIT $limit_start_rec, $list_max_entries_per_page", array()); - -$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec,$noofrows); -$smarty->assign('recordListRange',$recordListRangeMsg); - -$smarty->assign("CUSTOMVIEW_OPTION",$customview_html); - -$navigationOutput = getTableHeaderSimpleNavigation($navigation_array, $url_string, $currentModule, 'index', $viewid); -$smarty->assign("NAVIGATION", $navigationOutput); - -$controller = new ListViewController($adb, $current_user, $queryGenerator); -$listview_header = $controller->getListViewHeader($focus,$currentModule,$url_string,$sorder, - $order_by); -$listview_entries = $controller->getListViewEntries($focus,$currentModule,$list_result, - $navigation_array); -$listview_header_search = $controller->getBasicSearchFieldInfoList(); - -$smarty->assign('LISTHEADER', $listview_header); -$smarty->assign('LISTENTITY', $listview_entries); -$smarty->assign('SEARCHLISTHEADER',$listview_header_search); - -// Module Search -$alphabetical = AlphabeticalSearch($currentModule,'index',$focus->def_basicsearch_col,'true','basic','','','','',$viewid); -$fieldnames = $controller->getAdvancedSearchOptionString(); -$criteria = getcriteria_options(); -$smarty->assign("ALPHABETICAL", $alphabetical); -$smarty->assign("FIELDNAMES", $fieldnames); -$smarty->assign("CRITERIA", $criteria); - -ListViewSession::setSessionQuery($currentModule,$list_query,$viewid); - -if($_REQUEST['errormsg'] != '') -{ - $errormsg = vtlib_purify($_REQUEST['errormsg']); - $smarty->assign("ERROR","The User does not have permission to delete ".$errormsg." ".$currentModule); -}else -{ - $smarty->assign("ERROR",""); -} -$url_string = '&smodule=PRODUCTS'; // assigning http url string - -$smarty->assign("SELECT_SCRIPT", $view_script); - -$smarty->assign("AVALABLE_FIELDS", getMergeFields($currentModule,"available_fields")); -$smarty->assign("FIELDS_TO_MERGE", getMergeFields($currentModule,"fileds_to_merge")); - -//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),";")); - -// 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'); - +initSortbyField($currentModule); + +if(ListViewSession::hasViewChanged($currentModule,$viewid)) { + $_SESSION['PRODUCTS_ORDER_BY'] = ''; +} +$sorder = $focus->getSortOrder(); +$order_by = $focus->getOrderBy(); + +$_SESSION['PRODUCTS_ORDER_BY'] = $order_by; +$_SESSION['PRODUCTS_SORT_ORDER'] = $sorder; + +$smarty = new vtigerCRM_Smarty(); + +$smarty->assign('MOD', $mod_strings); +$smarty->assign('APP', $app_strings); +$smarty->assign("THEME", $theme); +$smarty->assign('MODULE', $currentModule); +$smarty->assign('SINGLE_MOD', $currentModule); +$smarty->assign('CATEGORY', $category); +$smarty->assign('BUTTONS', $list_buttons); +$smarty->assign('CHECK', $tool_buttons); +$smarty->assign('IMAGE_PATH', "themes/$theme/images/"); + +$smarty->assign('CHANGE_OWNER', getUserslist()); +$smarty->assign('CHANGE_GROUP_OWNER', getGroupslist()); + +// Custom View +$customView = new CustomView($currentModule); +$viewid = $customView->getViewId($currentModule); +$customview_html = $customView->getCustomViewCombo($viewid); +$viewinfo = $customView->getCustomViewByCvid($viewid); + +// Feature available from 5.1 +if(method_exists($customView, 'isPermittedChangeStatus')) { + // Approving or Denying status-public by the admin in CustomView + $statusdetails = $customView->isPermittedChangeStatus($viewinfo['status']); + + // To check if a user is able to edit/delete a CustomView + $edit_permit = $customView->isPermittedCustomView($viewid,'EditView',$currentModule); + $delete_permit = $customView->isPermittedCustomView($viewid,'Delete',$currentModule); + + $smarty->assign("CUSTOMVIEW_PERMISSION",$statusdetails); + $smarty->assign("CV_EDIT_PERMIT",$edit_permit); + $smarty->assign("CV_DELETE_PERMIT",$delete_permit); +} +// END + +$smarty->assign("VIEWID", $viewid); + +if($viewinfo['viewname'] == 'All') $smarty->assign('ALL', 'All'); + +if($viewid ==0) +{ + echo "
"; + echo "
+ + + + + + + + + +
$app_strings[LBL_PERMISSION]
+ $app_strings[LBL_GO_BACK]
+
+
"; + echo "
"; + exit; +} + +global $current_user; +$queryGenerator = new QueryGenerator($currentModule, $current_user); +if ($viewid != "0") { + $queryGenerator->initForCustomViewById($viewid); +} else { + $queryGenerator->initForDefaultCustomView(); +} + +// Enabling Module Search +$url_string = ''; +if($_REQUEST['query'] == 'true') { + // has to REQUEST as it can either $_GET for Dashboard and + // $_POST for search in listview. + $queryGenerator->addUserSearchConditions($_REQUEST); + $ustring = getSearchURL($_REQUEST); + $url_string .= "&query=true$ustring"; + $smarty->assign('SEARCH_URL', $url_string); +} + +$list_query = $queryGenerator->getQuery(); +$where = $queryGenerator->getConditionalWhere(); +if(isset($where) && $where != '') { + $_SESSION['export_where'] = $where; +} else { + unset($_SESSION['export_where']); +} +// Sorting +if(!empty($order_by)) { + if($order_by == 'smownerid') $list_query .= ' ORDER BY user_name '.$sorder; + else { + $tablename = getTableNameForField($currentModule, $order_by); + $tablename = ($tablename != '')? ($tablename . '.') : ''; + $list_query .= ' ORDER BY ' . $tablename . $order_by . ' ' . $sorder; + } +} + +//Postgres 8 fixes +if( $adb->dbType == "pgsql") + $list_query = fixPostgresQuery( $list_query, $log, 0); + +if(PerformancePrefs::getBoolean('LISTVIEW_COMPUTE_PAGE_COUNT', false) === true){ + $count_result = $adb->query( mkCountQuery( $list_query)); + $noofrows = $adb->query_result($count_result,0,"count"); +}else{ + $noofrows = null; +} + +$queryMode = (isset($_REQUEST['query']) && $_REQUEST['query'] == 'true'); +$start = ListViewSession::getRequestCurrentPage($currentModule, $list_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($list_query. " OFFSET $limit_start_rec LIMIT $list_max_entries_per_page", array()); +else + $list_result = $adb->pquery($list_query. " LIMIT $limit_start_rec, $list_max_entries_per_page", array()); + +$recordListRangeMsg = getRecordRangeMessage($list_result, $limit_start_rec,$noofrows); +$smarty->assign('recordListRange',$recordListRangeMsg); + +$smarty->assign("CUSTOMVIEW_OPTION",$customview_html); + +$navigationOutput = getTableHeaderSimpleNavigation($navigation_array, $url_string, $currentModule, 'index', $viewid); +$smarty->assign("NAVIGATION", $navigationOutput); + +$controller = new ListViewController($adb, $current_user, $queryGenerator); +$listview_header = $controller->getListViewHeader($focus,$currentModule,$url_string,$sorder, + $order_by); +$listview_entries = $controller->getListViewEntries($focus,$currentModule,$list_result, + $navigation_array); +$listview_header_search = $controller->getBasicSearchFieldInfoList(); + +$smarty->assign('LISTHEADER', $listview_header); +$smarty->assign('LISTENTITY', $listview_entries); +$smarty->assign('SEARCHLISTHEADER',$listview_header_search); + +// Module Search +$alphabetical = AlphabeticalSearch($currentModule,'index',$focus->def_basicsearch_col,'true','basic','','','','',$viewid); +$fieldnames = $controller->getAdvancedSearchOptionString(); +$criteria = getcriteria_options(); +$smarty->assign("ALPHABETICAL", $alphabetical); +$smarty->assign("FIELDNAMES", $fieldnames); +$smarty->assign("CRITERIA", $criteria); + +ListViewSession::setSessionQuery($currentModule,$list_query,$viewid); + +if($_REQUEST['errormsg'] != '') +{ + $errormsg = vtlib_purify($_REQUEST['errormsg']); + $smarty->assign("ERROR","The User does not have permission to delete ".$errormsg." ".$currentModule); +}else +{ + $smarty->assign("ERROR",""); +} +$url_string = '&smodule=PRODUCTS'; // assigning http url string + +$smarty->assign("SELECT_SCRIPT", $view_script); + +$smarty->assign("AVALABLE_FIELDS", getMergeFields($currentModule,"available_fields")); +$smarty->assign("FIELDS_TO_MERGE", getMergeFields($currentModule,"fileds_to_merge")); + +//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),";")); + +// 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'); + ?> \ No newline at end of file diff --git a/oss/vtiger/trunk/modules/Products/language/zh_cn.lang.php b/oss/vtiger/trunk/modules/Products/language/zh_cn.lang.php index dad09962..d08a3bfc 100644 --- a/oss/vtiger/trunk/modules/Products/language/zh_cn.lang.php +++ b/oss/vtiger/trunk/modules/Products/language/zh_cn.lang.php @@ -21,15 +21,15 @@ * --------------------------------------------- */ $mod_strings = Array( -'LBL_MODULE_NAME' => '产品', +'LBL_MODULE_NAME'=>'产品', 'SINGLE_Products'=>'产品', -'LBL_LIST_PRODUCT_NAME' => '产品名称', -'LBL_TOOL_FORM_TITLE' => '产品工具', -'LBL_SEARCH_FORM_TITLE' => '搜寻产品', -'LBL_PRODUCT_NAME' => '产品类型名称:', -'LBL_VENDOR_NAME' => '厂商名称:', -'LBL_PRICEBOOK_NAME' => '价目表名称:', -'LBL_VENDOR' => '厂商', +'LBL_LIST_PRODUCT_NAME'=>'产品名称', +'LBL_TOOL_FORM_TITLE'=>'产品工具', +'LBL_SEARCH_FORM_TITLE'=>'搜寻产品', +'LBL_PRODUCT_NAME'=>'产品类型名称:', +'LBL_VENDOR_NAME'=>'厂商名称:', +'LBL_PRICEBOOK_NAME'=>'价目表名称:', +'LBL_VENDOR'=> '厂商', 'LBL_PRICEBOOK' => '价目表:', 'LBL_VENDOR_INFORMATION' => '厂商信息:', 'LBL_PRICEBOOK_INFORMATION' => '价目表信息:', @@ -44,7 +44,7 @@ $mod_strings = Array( 'LBL_CATEGORY' => '产品分类:', 'LBL_PRODUCT_CODE' => '产品编码', 'LBL_LIST_PRODUCT_CODE' => '产品类型编码:', -'LBL_PRODUCT_ACTIVE' => '产品任务', +'LBL_PRODUCT_ACTIVE' => '产品上架', 'LBL_PRODUCT_COMMISSION_RATE' => '评价', 'LBL_PRODUCT_QTY_PER_UNIT' => '量/单位', 'LBL_PRODUCT_UNIT_PRICE' => '单位价格', @@ -96,7 +96,7 @@ $mod_strings = Array( 'Product Name' => '产品名称', //'Product Code'=>'Part Number', 'Part Number' => '部件编码', -'Product Active' => '产品任务', +'Product Active' => '产品上架', 'Commission Rate' => '评价 (%)', 'Qty/Unit' => '量/单位', 'Unit Price' => '单位价格', @@ -182,33 +182,33 @@ $mod_strings = Array( 'Software'=>'签证', 'CRM Applications'=>'企业注册', -'300-Sales-Software' => '投资性公司', -'301-Sales-Hardware' => '股份有限公司', -'302-Rental-Income' => '研发机构', -'303-Interest-Income' => '拍卖企业', -'304-Sales-Software-Support' => '物流', -'305-Sales Other' => '贸易公司', -'306-Internet Sales' => '资产评估机构', -'307-Service-Hardware Labor' => '人才中介机构', -'308-Sales-Books' => '其他', +'300-Sales-Software'=>'投资性公司', +'301-Sales-Hardware'=>'股份有限公司', +'302-Rental-Income'=>'研发机构', +'303-Interest-Income'=>'拍卖企业', +'304-Sales-Software-Support'=>'物流', +'305-Sales Other'=>'贸易公司', +'306-Internet Sales'=>'资产评估机构', +'307-Service-Hardware Labor'=>'人才中介机构', +'308-Sales-Books'=>'其他', -'Box' => '盒', -'Carton' => '纸板', -'Caton' => 'Caton', -'Dozen' => '打', -'Each' => '每件', -'Hours' => '小时', -'Impressions' => '印象', -'Lb' => '磅', -'M' => '公尺', -'Pack' => '包装', -'Pages' => '包装', -'Pieces' => '片', -'Quantity' => '数量', -'Reams' => '大量', -'Sheet' => '张', -'Spiral Binder' => '打包带', -'Sq Ft' => '平方英呎', +'Box'=>'盒', +'Carton'=>'纸板', +'Caton'=>'箱', +'Dozen'=>'打', +'Each'=>'每件', +'Hours'=>'小时', +'Impressions'=>'印象', +'Lb'=>'磅', +'M'=>'公尺', +'Pack'=>'包装', +'Pages'=>'包装', +'Pieces'=>'片', +'Quantity'=>'数量', +'Reams'=>'大量', +'Sheet'=>'张', +'Spiral Binder'=>'打包带', +'Sq Ft'=>'平方英呎', //Added for 5.0.3 'MSG_STOCK_LEVEL'=>'库存水平依然很低', @@ -219,6 +219,16 @@ $mod_strings = Array( 'MSG_SEVERITY'=>'严重性:重大', 'MSG_THANKS'=>'Thanks,', +// Added after 5.0.4 GA + +'LBL_PRODUCT_PRICES'=>'产品价格', +'Member Of'=>'是什么的成员:', + +// Module Sequence Numbering +'Product No' => '产品编号', +// END + +'LBL_NO_TAXES_ASSOCIATED'=>'本产品无相关税务信息', ); ?>