assign("FORUM", "
"); */ $xtpl->assign("APP", $app_strings); if(isset($app_strings['LBL_CHARSET'])) { $xtpl->assign("LBL_CHARSET", $app_strings['LBL_CHARSET']); } else { $xtpl->assign("LBL_CHARSET", $default_charset); } $xtpl->assign("THEME", $theme); $xtpl->assign("IMAGE_PATH", $image_path);$xtpl->assign("PRINT_URL", "phprint.php?jt=".session_id().$GLOBALS['request_string']); $xtpl->assign("MODULE_NAME", $currentModule); $xtpl->assign("DATE", getDisplayDate(date("Y-m-d H:i"))); if ($current_user->first_name != '') $xtpl->assign("CURRENT_USER", $current_user->first_name); else $xtpl->assign("CURRENT_USER", $current_user->user_name); $xtpl->assign("CURRENT_USER_ID", $current_user->id); if (is_admin($current_user)) $xtpl->assign("ADMIN_LINK", "".$app_strings['LBL_SETTINGS'].""); if (isset($_REQUEST['query_string'])) $xtpl->assign("SEARCH", $_REQUEST['query_string']); if ($action == "EditView" || $action == "Login") $xtpl->assign("ONLOAD", 'onload="set_focus()"'); // Loop through the module list. // For each tab that is off, parse a tab_off. // For the current tab, parse a tab_on foreach($moduleList as $module_name) { $xtpl->assign("MODULE_NAME", $app_list_strings['moduleList'][$module_name]); $xtpl->assign("MODULE_KEY", $module_name); if($module_name == $currentModule) { $xtpl->assign("TAB_CLASS", "currentTab"); $xtpl->assign("IMAGE_TABTILE", "menu_on_tile.gif"); $xtpl->assign("IMAGE_TABSTART", "menu_on_start.gif"); $xtpl->assign("IMAGE_TABEND", "menu_on_end.gif"); } else { $xtpl->assign("TAB_CLASS", "otherTab"); $xtpl->assign("IMAGE_TABTILE", "menu_off_tile.gif"); $xtpl->assign("IMAGE_TABSTART", "menu_off_start.gif"); $xtpl->assign("IMAGE_TABEND", "menu_off_end.gif"); } $xtpl->parse("main.tab"); } // Assign the module name back to the current module. $xtpl->assign("MODULE_NAME", $currentModule); //Menu items to be displayed $showmenu = 0; foreach($module_menu as $menu_item) { $after_this = current($module_menu); if($showmenu < 10) { if ($menu_item[1] != 'Deleted Items') { $xtpl->assign("URL", $menu_item[0]); $xtpl->assign("LABEL", $menu_item[1]); if (empty($after_this)) $xtpl->assign("SEPARATOR", ""); else $xtpl->assign("SEPARATOR", "|"); } else { $xtpl->assign("DELETED_ITEMS_URL", $menu_item[0]); $xtpl->assign("DELETED_ITEMS_LABEL", $menu_item[1]); } $xtpl->parse("main.sub_menu.sub_menu_item"); } $showmenu++; } //Menu items to be displayed in drop down $showmenu = 0; $showmenu_drop = 10; foreach($module_menu as $menu_item) { if(($showmenu >= $showmenu_drop) && ($showmenu < count($module_menu))) { $after_this = current($module_menu); if ($menu_item[1] != 'Deleted Items') { $xtpl->assign("URL", $menu_item[0]); $xtpl->assign("LABEL", $menu_item[1]); } else { $xtpl->assign("DELETED_ITEMS_URL", $menu_item[0]); $xtpl->assign("DELETED_ITEMS_LABEL", $menu_item[1]); } $xtpl->parse("main.dropdown_sub_menu_item"); } $showmenu++; } $xtpl->parse("main.sub_menu"); $xtpl->assign("TITLE", $app_strings['LBL_SEARCH']); $xtpl->parse("main.left_form.left_form_search"); $xtpl->parse("main.left_form"); if($currentModule != "Rss") { $xtpl->assign("LASTVIEWED_TITLE", $app_strings['LBL_LAST_VIEWED']); $tracker = new Tracker(); $history = $tracker->get_recently_viewed($current_user->id); $current_row=1; if (count($history) > 0) { foreach($history as $row) { $xtpl->assign("MODULE_NAME",$row['module_name']); $xtpl->assign("ROW_NUMBER",$current_row); $xtpl->assign("RECENT_LABEL",$row['item_summary']); if($row['module_name']=='Activities') { $sql = 'select activitytype from activity where activityid = '.$row['item_id']; $activitytype = $adb->query_result($adb->query($sql),0,'activitytype'); if($activitytype == 'Task') $activity_mode = '&activity_mode=Task'; elseif($activitytype == 'Call' || $activitytype == 'Meeting') $activity_mode = '&activity_mode=Events'; } $url_module = $row['module_name']; $url_action = 'DetailView'; if($row['module_name']=='Orders') { $xtpl->assign("MODULE_IMAGE_NAME","purchase_order"); } elseif($row['module_name']=='SalesOrder') { $xtpl->assign("MODULE_IMAGE_NAME","sales_order"); $url_module = 'Orders'; $url_action = 'SalesOrderDetailView'; } elseif($row['module_name']=='Vendor') { $xtpl->assign("MODULE_IMAGE_NAME","vendor"); $url_module = 'Products'; $url_action = 'VendorDetailView'; } elseif($row['module_name']=='PriceBook') { $xtpl->assign("MODULE_IMAGE_NAME","pricebook"); $url_module = 'Products'; $url_action = 'PriceBookDetailView'; } else { $xtpl->assign("MODULE_IMAGE_NAME",$row['module_name']); } $xtpl->assign("RECENT_URL","index.php?module=$url_module&action=$url_action&record=$row[item_id]$activity_mode"); $activity_mode = ''; $xtpl->parse("main.left_form.left_form_recent_view.left_form_recent_view_row"); $current_row++; } } else { $xtpl->parse("main.left_form.left_form_recent_view.left_form_recent_view_empty"); } $xtpl->parse("main.left_form.left_form_recent_view"); $xtpl->parse("main.left_form"); } //check for the access for Create/Edit and enable or disable //check for the presence of the currentModule and also for EditView permission $now_action = $_REQUEST['action']; $now_module = $_REQUEST['module']; $tabid = getTabid($now_module); $actionid = getActionid($now_action); if($actionid == 3) { $QuickCreateForm = getQuickCreate($tabid,$actionid); } if(isset($QuickCreateForm) && $QuickCreateForm == 'true') { require_once("modules/".$currentModule."/Forms.php"); if (function_exists('get_new_record_form')) { $xtpl->assign("NEW_RECORD", get_new_record_form()); $xtpl->parse("main.left_form_new_record"); } } if($currentModule == "Rss") { require_once("modules/".$currentModule."/Forms.php"); if (function_exists('get_rssfeeds_form')) { $xtpl->assign("RSSFEEDS_TITLE","
".$app_strings['LBL_RSS_FEEDS'].":
Add 
"); $xtpl->assign("RSSFEEDS", get_rssfeeds_form()); $xtpl->parse("main.left_form_rss"); } } $xtpl->assign("CLOCK_TITLE", $app_strings['LBL_WORLD_CLOCK']); $xtpl->assign("WORLD_CLOCK", get_world_clock($image_path)); if($currentModule != "Rss" && $WORLD_CLOCK_DISPLAY == 'true') { $xtpl->parse("main.left_form_clock"); } $xtpl->assign("CALC_TITLE", $app_strings['LBL_CALCULATOR']); $xtpl->assign("CALC", get_calc($image_path)); if($currentModule != "Rss" && $CALCULATOR_DISPLAY == 'true') { $xtpl->parse("main.left_form_calculator"); } $xtpl->parse("main"); $xtpl->out("main"); ?>