示例#1
0
 /**
  * Returns true/false if M/WBE Category should be a link
  *
  * @param $node
  * @param $row
  * @return string
  */
 static function showMWBECategoryLink($node, $row)
 {
     $dtsmnid = _getRequestParamValue("dtsmnid");
     $smnid = _getRequestParamValue("smnid");
     $showLink = !RequestUtil::isNewWindow() && MappingUtil::isMWBECertified(array($row['minority_type_id'])) && $dtsmnid != 763 && $smnid != 763 && $dtsmnid != 747 && $smnid != 747 && $dtsmnid != 717 && $smnid != 717;
     return $showLink;
 }
示例#2
0
 /**
  * Returns chart title for a prime or sub vendor page based on 'category'/'featured dashboard'/'domain'
  * using values from current path.
  *
  * The page title above the visualization for Prime vendor Level and Sub vendor level pages:
  *
  * 1. Follow a three-line format when the M/WBE Category is equal to any of the following:
  *    Asian American, Black American, Women or Hispanic
  * 2. Follow a two-line format when the M/WBE Category is equal to any of the following:
  *    Individual & Others or Non M/WBE
  *
  * @param string $domain
  * @param string $defaultTitle
  * @return string
  */
 static function getTitleByVendorType($domain, $defaultTitle = 'Total Spending')
 {
     $title = $minority_category = $minority_type_id = '';
     if (_checkbook_check_is_mwbe_page()) {
         $minority_type_id = _getRequestParamValue('mwbe');
     } else {
         $lastReqParam = _getLastRequestParamValue();
         foreach ($lastReqParam as $key => $value) {
             switch ($key) {
                 case 'vendor':
                     $minority_type_id = self::getLatestMinorityTypeByVendorType($domain, $value, VendorType::$PRIME_VENDOR);
                     break;
                 case 'subvendor':
                     if ($value != 'all') {
                         $minority_type_id = self::getLatestMinorityTypeByVendorType($domain, $value, VendorType::$SUB_VENDOR);
                     }
                     break;
                 default:
             }
         }
     }
     $minority_type_ids = explode('~', $minority_type_id);
     $minority_category = MappingUtil::getCurrenEhtnicityName($minority_type_ids);
     $MWBE_certified = MappingUtil::isMWBECertified($minority_type_ids);
     $title = $MWBE_certified ? '<p class="sub-chart-title">M/WBE Category: ' . $minority_category . '</p>' : $minority_category . ' ';
     $title .= RequestUtil::getSpendingCategoryName($defaultTitle);
     return html_entity_decode($title);
 }
示例#3
0
 /**
  * Returns M/WBE category for the given vendor id in the given year and year type for
  * Active/Registered Contracts Landing Pages
  * @param $row
  * @return string
  */
 public static function get_contracts_vendor_link_by_mwbe_category($row)
 {
     $vendor_id = $row["vendor_vendor"] != null ? $row["vendor_vendor"] : $row["vendor_id"];
     $year_id = _getRequestParamValue("year");
     $year_type = $row["yeartype_yeartype"];
     $is_prime_or_sub = $row["is_prime_or_sub"] != null ? $row["is_prime_or_sub"] : "P";
     $agency_id = null;
     if ($row["current_prime_minority_type_id"]) {
         $minority_type_id = $row["current_prime_minority_type_id"];
     }
     if ($row["minority_type_id"]) {
         $minority_type_id = $row["minority_type_id"];
     }
     $smnid = _getRequestParamValue("smnid");
     if ($smnid == 720 || $smnid == 784) {
         return self::get_contracts_vendor_link_sub($vendor_id, $year_id, $year_type, $agency_id);
     }
     $latest_minority_id = self::getLatestMwbeCategoryByVendor($vendor_id, $agency_id = null, $year_id, $year_type, $is_prime_or_sub);
     $latest_minority_id = isset($latest_minority_id) ? $latest_minority_id : $minority_type_id;
     $is_mwbe_certified = MappingUtil::isMWBECertified(array($latest_minority_id));
     $url = _checkbook_project_get_url_param_string("agency") . _checkbook_project_get_url_param_string("contstatus", "status") . _checkbook_project_get_year_url_param_string();
     if ($is_mwbe_certified && _getRequestParamValue('dashboard') == 'mp') {
         $url .= _checkbook_project_get_url_param_string("cindustry") . _checkbook_project_get_url_param_string("csize") . _checkbook_project_get_url_param_string("awdmethod") . "/dashboard/mp/mwbe/2~3~4~5~9/vendor/" . $vendor_id;
     } else {
         if ($is_mwbe_certified && _getRequestParamValue('dashboard') != 'mp') {
             $url .= "/dashboard/mp/mwbe/2~3~4~5~9/vendor/" . $vendor_id;
         } else {
             $url .= _checkbook_project_get_url_param_string("datasource") . "/vendor/" . $vendor_id;
         }
     }
     return $url;
 }