Esempio n. 1
0
 /**
  *
  */
 private function getDefaultDetails($dfid, $calCnt)
 {
     global $adb;
     $qry = "select * from vtiger_homedefault where stuffid=?";
     $result = $adb->pquery($qry, array($dfid));
     $maxval = $adb->query_result($result, 0, "maxentries");
     $hometype = $adb->query_result($result, 0, "hometype");
     if ($hometype == "ALVT" && vtlib_isModuleActive("Accounts")) {
         include_once "modules/Accounts/ListViewTop.php";
         $home_values = getTopAccounts($maxval, $calCnt);
     } elseif ($hometype == "PLVT" && vtlib_isModuleActive("Potentials")) {
         if (isPermitted('Potentials', 'index') == "yes") {
             include_once "modules/Potentials/ListViewTop.php";
             $home_values = getTopPotentials($maxval, $calCnt);
         }
     } elseif ($hometype == "QLTQ" && vtlib_isModuleActive("Quotes")) {
         if (isPermitted('Quotes', 'index') == "yes") {
             require_once 'modules/Quotes/ListTopQuotes.php';
             $home_values = getTopQuotes($maxval, $calCnt);
         }
     } elseif ($hometype == "HLT" && vtlib_isModuleActive("HelpDesk")) {
         if (isPermitted('HelpDesk', 'index') == "yes") {
             require_once 'modules/HelpDesk/ListTickets.php';
             $home_values = getMyTickets($maxval, $calCnt);
         }
     } elseif ($hometype == "GRT") {
         $home_values = getGroupTaskLists($maxval, $calCnt);
     } elseif ($hometype == "OLTSO" && vtlib_isModuleActive("SalesOrder")) {
         if (isPermitted('SalesOrder', 'index') == "yes") {
             require_once 'modules/SalesOrder/ListTopSalesOrder.php';
             $home_values = getTopSalesOrder($maxval, $calCnt);
         }
     } elseif ($hometype == "ILTI" && vtlib_isModuleActive("Invoice")) {
         if (isPermitted('Invoice', 'index') == "yes") {
             require_once 'modules/Invoice/ListTopInvoice.php';
             $home_values = getTopInvoice($maxval, $calCnt);
         }
     } elseif ($hometype == "MNL" && vtlib_isModuleActive("Leads")) {
         if (isPermitted('Leads', 'index') == "yes") {
             include_once "modules/Leads/ListViewTop.php";
             $home_values = getNewLeads($maxval, $calCnt);
         }
     } elseif ($hometype == "OLTPO" && vtlib_isModuleActive("PurchaseOrder")) {
         if (isPermitted('PurchaseOrder', 'index') == "yes") {
             require_once 'modules/PurchaseOrder/ListTopPurchaseOrder.php';
             $home_values = getTopPurchaseOrder($maxval, $calCnt);
         }
     } elseif ($hometype == "LTFAQ" && vtlib_isModuleActive("Faq")) {
         if (isPermitted('Faq', 'index') == "yes") {
             require_once 'modules/Faq/ListFaq.php';
             $home_values = getMyFaq($maxval, $calCnt);
         }
     } elseif ($hometype == "CVLVT") {
         include_once "modules/CustomView/ListViewTop.php";
         $home_values = getKeyMetrics($maxval, $calCnt);
     } elseif ($hometype == 'UA' && vtlib_isModuleActive("Calendar")) {
         require_once "modules/Home/HomeUtils.php";
         $home_values = homepage_getUpcomingActivities($maxval, $calCnt);
     } elseif ($hometype == 'PA' && vtlib_isModuleActive("Calendar")) {
         require_once "modules/Home/HomeUtils.php";
         $home_values = homepage_getPendingActivities($maxval, $calCnt);
     }
     if ($calCnt == 'calculateCnt') {
         return $home_values;
     }
     $return_value = array();
     if (count($home_values) > 0) {
         $return_value = array('Maxentries' => $maxval, 'Details' => $home_values);
     }
     return $return_value;
 }
Esempio n. 2
0
 private function getDefaultDetails($dfid, $calCnt)
 {
     global $adb;
     $qry = "select * from ec_homedefault where stuffid=" . $dfid;
     $result = $adb->query($qry);
     $maxval = $adb->query_result($result, 0, "maxentries");
     $hometype = $adb->query_result($result, 0, "hometype");
     if ($hometype == "ALVT") {
         include_once "modules/Accounts/ListViewTop.php";
         $home_values = getTopAccounts($maxval, $calCnt);
     } elseif ($hometype == "HDB") {
         if (isPermitted('Dashboard', 'index') == "yes") {
             //$home_values['Dashboard']="true";
         }
     } elseif ($hometype == "PLVT") {
         if (isPermitted('Potentials', 'index') == "yes") {
             include_once "modules/Potentials/ListViewTop.php";
             $home_values = getTopPotentials($maxval, $calCnt);
         }
     } elseif ($hometype == "QLTQ") {
         if (isPermitted('Quotes', 'index') == "yes") {
             require_once 'modules/Quotes/ListTopQuotes.php';
             $home_values = getTopQuotes($maxval, $calCnt);
         }
     } elseif ($hometype == "HLT") {
         if (isPermitted('HelpDesk', 'index') == "yes") {
             require_once 'modules/HelpDesk/ListTickets.php';
             $home_values = getMyTickets($maxval, $calCnt);
         }
     } elseif ($hometype == "GRT") {
         //$home_values = getGroupTaskLists($maxval,$calCnt);
     } elseif ($hometype == "OLTSO") {
         if (isPermitted('SalesOrder', 'index') == "yes") {
             require_once 'modules/SalesOrder/ListTopSalesOrder.php';
             $home_values = getTopSalesOrder($maxval, $calCnt);
         }
     } elseif ($hometype == "ILTI") {
         if (isPermitted('Invoice', 'index') == "yes") {
             require_once 'modules/Invoice/ListTopInvoice.php';
             $home_values = getTopInvoice($maxval, $calCnt);
         }
     } elseif ($hometype == "MNL") {
         if (isPermitted('Leads', 'index') == "yes") {
             include_once "modules/Leads/ListViewTop.php";
             $home_values = getNewLeads($maxval, $calCnt);
         }
     } elseif ($hometype == "OLTPO") {
         if (isPermitted('PurchaseOrder', 'index') == "yes") {
             require_once 'modules/PurchaseOrder/ListTopPurchaseOrder.php';
             $home_values = getTopPurchaseOrder($maxval, $calCnt);
         }
     } elseif ($hometype == "LTFAQ") {
         if (isPermitted('Faq', 'index') == "yes") {
             require_once 'modules/Faq/ListFaq.php';
             $home_values = getMyFaq($maxval, $calCnt);
         }
     } elseif ($hometype == "CVLVT") {
         include_once "modules/CustomView/ListViewTop.php";
         $home_values = getKeyMetrics();
     }
     if ($calCnt == 'calculateCnt') {
         return $home_values;
     }
     $return_value = array();
     if (count($home_values) > 0) {
         $return_value = array('Maxentries' => $maxval, 'Details' => $home_values);
     }
     return $return_value;
 }