code/pagetypes/MetadataPostcardEntryPage.php
/**
     * Calculates the URL to the page containing parameters for the form fields which have been specified as
     * needing values passed via the URL. This helps when the CMS user wants to copy and paste the URL in to
     * an email to others, or display on the screen etc. Often a 3rd party system should create the paramertised URL.
     *
     * @return String
     */
Calculates the URL to the page containing parameters for the form fields which have been specified as
needing values passed via the URL. This helps when the CMS user wants to copy and paste the URL in to
an email to others, or display on the screen etc. Often a 3rd party system should create the paramertised URL.

@return String
Calculates the URL to the page containing parameters for the form fields which have been specified as needing values passed via the URL . This helps when the CMS user wants to copy and paste the URL in to an email to others or display on the screen etc . Often a 3rd party system should create the paramertised URL . @return String
protected function calculateUrlWithParams()
    {
        $pageUrl = $this->AbsoluteLink();
        $parameters = "";
        if ($this->ProjectName) {
            $parameters .= '&Project_Name=' . urlencode($this->ProjectName);
        }
        if ($this->ProjectCode) {
            $parameters .= '&Project_Code=' . urlencode($this->ProjectCode);
        }
        if ($this->ProjectManager) {
            $parameters .= '&Project_Manager=' . urlencode($this->ProjectManager);
        }
        if ($this->ProjectManagerEmail) {
            $parameters .= '&Project_Manager_email=' . urlencode($this->ProjectManagerEmail);
        }
        if ($this->ProjectCoordinator) {
            $parameters .= '&Project_Coordinator=' . urlencode($this->ProjectCoordinator);
        }
        if ($this->ProjectCoordinatorEmail) {
            $parameters .= '&Project_Coordinator_email=' . urlencode($this->ProjectCoordinatorEmail);
        }
        $parameterFields = $this->UrlParams()->sort('SortOrder', 'Asc');
        foreach($parameterFields as $field) {
            $parameters .= '&' . str_replace(' ', '_', $field->PostcardMetadataField()->Label) . '=' . urlencode($field->Value);
        }
        $parameters = ltrim($parameters, '&');
        $pageUrl .= '?' . $parameters;
        return $pageUrl;
    }
protected function calculateUrlWithParams ( ) { $ pageUrl = $ this -> AbsoluteLink ( ) ; $ parameters = " " ; if ( $ this -> ProjectName ) { $ parameters .= '&Project_Name=' . urlencode ( $ this -> ProjectName ) ; } if ( $ this -> ProjectCode ) { $ parameters .= '&Project_Code=' . urlencode ( $ this -> ProjectCode ) ; } if ( $ this -> ProjectManager ) { $ parameters .= '&Project_Manager=' . urlencode ( $ this -> ProjectManager ) ; } if ( $ this -> ProjectManagerEmail ) { $ parameters .= '&Project_Manager_email=' . urlencode ( $ this -> ProjectManagerEmail ) ; } if ( $ this -> ProjectCoordinator ) { $ parameters .= '&Project_Coordinator=' . urlencode ( $ this -> ProjectCoordinator ) ; } if ( $ this -> ProjectCoordinatorEmail ) { $ parameters .= '&Project_Coordinator_email=' . urlencode ( $ this -> ProjectCoordinatorEmail ) ; } $ parameterFields = $ this -> UrlParams ( ) -> sort ( 'SortOrder' , 'Asc' ) ; foreach ( $ parameterFields as $ field ) { $ parameters .= '&' . str_replace ( ' ' , '_' , $ field -> PostcardMetadataField ( ) -> Label ) . '=' . urlencode ( $ field -> Value ) ; } $ parameters = ltrim ( $ parameters , '&' ) ; $ pageUrl .= '?' . $ parameters ; return $ pageUrl ; }
Calculates the URL to the page containing parameters for the form fields which have been specified as
 needing values passed via the URL.
Calculates the URL to the page containing parameters for the form fields which have been specified as needing values passed via the URL .
// Get the absolute URL to the page including the site domain. // Get the Url parameter records for this page. // Also include the project coordinator field values in the URL parameters. // If values for the project code, Project Manager, Project Coordinator, or Project Coordinator // email fields have been specified include them as parameters in the URL. // Get the URL parameters specified for this page. Loop and add them. // Remove first & and replace with ?. // Put together the URL of the page with the params.