Example #1
0
 static function prepareUrl($path, $params = array(), $requestParams = array(), $customPathParams = array(), $applyPreviousYear = false, $applySpendingYear = false)
 {
     $pathParams = explode('/', drupal_get_path_alias($_GET['q']));
     $url = $path . _checkbook_append_url_params() . _checkbook_project_get_year_url_param_string($applySpendingYear, $applyPreviousYear);
     if (is_array($params)) {
         foreach ($params as $key => $value) {
             $url .= self::get_url_param($pathParams, $key, $value);
         }
     }
     if (is_array($customPathParams)) {
         foreach ($customPathParams as $key => $value) {
             $url .= "/{$key}";
             if (isset($value)) {
                 $url .= "/{$value}";
             }
         }
     }
     if (is_array($requestParams) && !empty($requestParams)) {
         $cnt = 0;
         foreach ($requestParams as $key => $value) {
             if ($cnt == 0) {
                 $url .= "?{$key}={$value}";
             } else {
                 $url .= "&{$key}={$value}";
             }
             $cnt++;
         }
     }
     return $url;
 }
Example #2
0
 /** Returns top navigation URL */
 static function getTopNavURL($domain)
 {
     $year = _getRequestParamValue("year");
     if ($year == null) {
         $year = _getCurrentYearID();
     }
     switch ($domain) {
         case "contracts":
             $path = "contracts_landing/status/A/yeartype/B/year/" . $year . _checkbook_append_url_params(null, array(), true);
             if (_getRequestParamValue("agency") > 0) {
                 $path = $path . "/agency/" . _getRequestParamValue("agency");
             } else {
                 if (_checkbook_check_isEDCPage()) {
                     $path = $path . "/agency/9000";
                 }
             }
             if (_getRequestParamValue("vendor") > 0) {
                 $path = $path . "/vendor/" . _getRequestParamValue("vendor");
             }
             break;
         case "spending":
             $path = "spending_landing/yeartype/B/year/" . $year . _checkbook_append_url_params(null, array(), true);
             if (_getRequestParamValue("agency") > 0) {
                 $path = $path . "/agency/" . _getRequestParamValue("agency");
             } else {
                 if (_checkbook_check_isEDCPage()) {
                     $path = $path . "/agency/9000";
                 }
             }
             if (_getRequestParamValue("vendor") > 0) {
                 $path = $path . "/vendor/" . _getRequestParamValue("vendor");
             }
             break;
         case "payroll":
             if (_getRequestParamValue("agency") > 0) {
                 $path = "payroll/" . "agency/" . _getRequestParamValue("agency") . "/yeartype/B/year/" . $year;
             } else {
                 $path = "payroll/yeartype/B/year/" . $year;
             }
             break;
         case "budget":
             if (_getRequestParamValue("agency") > 0) {
                 $path = "budget/yeartype/B/year/" . $year . "/agency/" . _getRequestParamValue("agency");
             } else {
                 $path = "budget/yeartype/B/year/" . $year;
             }
             break;
         case "revenue":
             if (_getRequestParamValue("agency") > 0) {
                 $path = "revenue/yeartype/B/year/" . $year . "/agency/" . _getRequestParamValue("agency");
             } else {
                 $path = "revenue/yeartype/B/year/" . $year;
             }
             break;
     }
     return $path;
 }
Example #3
0
 /**
  * Gets the Spent to date link Url for the Sub Vendors widget
  * @param $node
  * @param $row
  * @return string
  */
 public static function getSubVendorSpentToDateLinkUrl($node, $row)
 {
     $dashboard = _getRequestParamValue("dashboard");
     $url = "/contract/spending/transactions/csubvendor/" . $row["subvendor_subvendor"] . _checkbook_append_url_params() . _checkbook_project_get_url_param_string("status") . _checkbook_project_get_url_param_string("agency", "cagency") . _checkbook_project_get_url_param_string("awdmethod") . _checkbook_project_get_url_param_string("cindustry") . _checkbook_project_get_url_param_string("csize");
     if ($node->nid == 720) {
         $url .= '/doctype/CT1~CTA1' . ContractURLHelper::_checkbook_project_spending_get_year_url_param_string();
     } else {
         if ($dashboard == "ss" || $dashboard == "ms" || $dashboard == "sp") {
             $url .= '/doctype/CT1~CTA1' . ContractURLHelper::_checkbook_project_spending_get_year_url_param_string();
         } else {
             $url .= '/doctype/CT1~CTA1~MA1' . ContractURLHelper::_checkbook_project_spending_get_year_url_param_string();
         }
     }
     $url .= '/smnid/' . $node->nid . self::getSpentToDateParams() . '/newwindow';
     if ($dashboard == "mp" && $node->nid == 720) {
         $url = str_replace("dashboard/mp", "dashboard/ms", $url);
     }
     return $url;
 }
Example #4
0
 /**
  * Checks to see if this is from the Advanced search page,
  * if so, need to append the data source but not the m/wbe parameter.
  */
 static function getDataSourceParams()
 {
     if (self::isAdvancedSearchResults()) {
         $data_source = _getRequestParamValue("datasource");
         return isset($data_source) ? "/datasource/checkbook_oge" : "";
     }
     return _checkbook_append_url_params();
 }
Example #5
0
 function _prepare_oge_contracts_spending_url($row, $node)
 {
     $agencies = _checkbook_project_querydataset('checkbook_oge:agency', array('agency_id', 'agency_name'), array('agency_id' => $row['agency_id'], 'is_oge_agency' => 'Y'));
     $oge_agency_name = $agencies[0]['agency_name'];
     $vendors = _checkbook_project_querydataset('checkbook_oge:vendor', array('vendor_id', 'legal_name'), array('vendor_id' => $row['vendor_id']));
     $oge_vendor_name = $vendors[0]['legal_name'];
     $vendor_url = '';
     if (strtolower($oge_agency_name) != strtolower($oge_vendor_name)) {
         $vendor_url = '/svendor/' . $row['vendor_id'];
     }
     $year_url = '';
     if (!(_getRequestParamValue('year') || _getRequestParamValue('calyear'))) {
         $year_url = '/yeartype/B/year/' . _getFiscalYearID() . '/syear/' . _getFiscalYearID();
     } else {
         $year_url = $row['type_of_year'] == 'B' ? '/year/' . $row['fiscal_year_id'] . '/syear/' . $row['fiscal_year_id'] : '/calyear/' . $row['fiscal_year_id'] . '/scalyear/' . $row['fiscal_year_id'];
     }
     $url = "<a href='/spending/transactions" . ($row['master_agreement_yn'] == 'Y' ? '/magid/' : '/agid/') . $row['original_agreement_id'] . ($row['master_agreement_yn'] == 'Y' ? $vendor_url : '/svendor/' . $row['vendor_id']) . ($row['master_agreement_yn'] == 'Y' ? '' : '/scomline/' . $row['fms_commodity_line']) . $year_url . _checkbook_project_get_url_param_string('vendor') . _checkbook_append_url_params() . "/newwindow' class='new_window'>" . custom_number_formatter_basic_format($row['spending_amount_disb']) . '</a>';
     return $url;
 }