From 24b142128197cbcaddecc9d4dba12a0cccbbc355 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Wed, 17 Nov 2010 02:43:41 +0000 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=B0=205.2=20=E6=AD=A3?= =?UTF-8?q?=E5=BC=8F=E7=89=88=E5=90=8E=E7=AC=AC=E4=B8=80=E6=AC=A1=20SVN=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit yuchenghu@hawebs.net git-svn-id: https://svn.code.sf.net/p/hawebs/svn@651 a2543c7e-f6e9-4f8a-8bff-1ffc34733512 --- oss/vtiger/trunk/modules/Vtiger/Settings.php | 82 ++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 oss/vtiger/trunk/modules/Vtiger/Settings.php diff --git a/oss/vtiger/trunk/modules/Vtiger/Settings.php b/oss/vtiger/trunk/modules/Vtiger/Settings.php new file mode 100644 index 00000000..cd459235 --- /dev/null +++ b/oss/vtiger/trunk/modules/Vtiger/Settings.php @@ -0,0 +1,82 @@ +assign("MOD",$mod_strings); +$smarty->assign("APP",$app_strings); +$smarty->assign("THEME", "$theme"); +$smarty->assign("IMAGE_PATH", "themes/$theme/images/"); + +// Operation to be restricted for non-admin users. +global $current_user; +if(!is_admin($current_user)) { + $smarty->display(vtlib_getModuleTemplate('Vtiger','OperationNotPermitted.tpl')); +} else { + $module = vtlib_purify($_REQUEST['formodule']); + + $menu_array = Array(); + + //if(layout editor is permitted) + $menu_array['LayoutEditor']['location'] = 'index.php?module=Settings&action=LayoutBlockList&parenttab=Settings&formodule='.$module; + $menu_array['LayoutEditor']['image_src'] = 'themes/images/orgshar.gif'; + $menu_array['LayoutEditor']['desc'] = getTranslatedString('LBL_LAYOUT_EDITOR_DESCRIPTION'); + $menu_array['LayoutEditor']['label'] = getTranslatedString('LBL_LAYOUT_EDITOR'); + + if(vtlib_isModuleActive('FieldFormulas')) { + $modules = com_vtGetModules($adb); + if(in_array(getTranslatedString($module),$modules)) { + $sql_result = $adb->pquery("select * from vtiger_settings_field where name = ? and active=0",array('LBL_FIELDFORMULAS')); + if($adb->num_rows($sql_result) > 0) { + $menu_array['FieldFormulas']['location'] = $adb->query_result($sql_result, 0, 'linkto').'&formodule='.$module; + $menu_array['FieldFormulas']['image_src'] = $adb->query_result($sql_result, 0, 'iconpath'); + $menu_array['FieldFormulas']['desc'] = getTranslatedString($adb->query_result($sql_result, 0, 'description'),'FieldFormulas'); + $menu_array['FieldFormulas']['label'] = getTranslatedString($adb->query_result($sql_result, 0, 'name'),'FieldFormulas'); + } + } + } + + if(vtlib_isModuleActive('Tooltip')){ + $sql_result = $adb->pquery("select * from vtiger_settings_field where name = ? and active=0",array('LBL_TOOLTIP_MANAGEMENT')); + if($adb->num_rows($sql_result) > 0) { + $menu_array['Tooltip']['location'] = $adb->query_result($sql_result, 0, 'linkto').'&formodule='.$module; + $menu_array['Tooltip']['image_src'] = vtiger_imageurl($adb->query_result($sql_result, 0, 'iconpath'), $theme); + $menu_array['Tooltip']['desc'] = getTranslatedString($adb->query_result($sql_result, 0, 'description'),'Tooltip'); + $menu_array['Tooltip']['label'] = getTranslatedString($adb->query_result($sql_result, 0, 'name'),'Tooltip'); + } + } + + if(VTWorkflowUtils::checkModuleWorkflow($module)){ + $sql_result = $adb->pquery("SELECT * FROM vtiger_settings_field WHERE name = ? AND active=0",array('LBL_WORKFLOW_LIST')); + if($adb->num_rows($sql_result) > 0) { + $menu_array['Workflow']['location'] = $adb->query_result($sql_result, 0, 'linkto').'&list_module='.$module; + $menu_array['Workflow']['image_src'] = vtiger_imageurl($adb->query_result($sql_result, 0, 'iconpath'), $theme); + $menu_array['Workflow']['desc'] = getTranslatedString($adb->query_result($sql_result, 0, 'description'),'com_vtiger_workflow'); + $menu_array['Workflow']['label'] = getTranslatedString($adb->query_result($sql_result, 0, 'name'),'com_vtiger_workflow'); + } + } + //add blanks for 3-column layout + $count = count($menu_array)%3; + if($count>0) { + for($i=0;$i<3-$count;$i++) { + $menu_array[] = array(); + } + } + + $smarty->assign('MODULE',$module); + $smarty->assign('MODULE_LBL',getTranslatedString($module)); + $smarty->assign('MENU_ARRAY', $menu_array); + + $smarty->display(vtlib_getModuleTemplate('Vtiger','Settings.tpl')); +} +?> \ No newline at end of file