diff options
-rwxr-xr-x | manage_proposal.inc | 11 | ||||
-rwxr-xr-x | proposal.inc | 14 | ||||
-rwxr-xr-x | run.inc | 8 |
3 files changed, 24 insertions, 9 deletions
diff --git a/manage_proposal.inc b/manage_proposal.inc index 6b70e8a..cc4563f 100755 --- a/manage_proposal.inc +++ b/manage_proposal.inc @@ -523,6 +523,15 @@ function dwsim_flowsheet_proposal_status_form($form, &$form_state) '#markup' => $proposal_data->project_title, '#title' => t('Title of the Flowsheet Project') ); + /************************** reference link filter *******************/ + $url = '~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])~i'; + $reference = preg_replace($url, '<a href="$0" target="_blank" title="$0">$0</a>', $proposal_data->reference); + /******************************/ + $form['reference'] = array( + '#type' => 'item', + '#markup' => $reference, + '#title' => t('References') + ); $form['process_development_compound_name'] = array( '#type' => 'item', '#title' => t('Name of compound for which process development is carried out'), @@ -890,7 +899,7 @@ function dwsim_flowsheet_proposal_edit_form($form, &$form_state) '#size' => 10000, '#attributes' => array( 'placeholder' => 'Links of must be provided....' - ) + ), '#default_value' => $proposal_data->reference ); $form['delete_proposal'] = array( diff --git a/proposal.inc b/proposal.inc index 660b858..c7ee4f1 100755 --- a/proposal.inc +++ b/proposal.inc @@ -103,9 +103,9 @@ function dwsim_flowsheet_proposal_form($form, &$form_state, $no_js_use = FALSE) '#default_value' => '', '#date_format' => 'M-Y', '#date_increment' => 0, - '#date_year_range' => '1960:+0', + '#date_year_range' => '1960:2100', '#datepicker_options' => array( - 'maxDate' => 0 + 'maxDate' => 3000 ), '#required' => TRUE ); @@ -133,7 +133,7 @@ function dwsim_flowsheet_proposal_form($form, &$form_state, $no_js_use = FALSE) $form['university'] = array( '#type' => 'textfield', '#title' => t('University/ Institute'), - '#size' => 80, + '#size' => 200, '#maxlength' => 200, '#required' => TRUE, '#attributes' => array( @@ -168,7 +168,7 @@ function dwsim_flowsheet_proposal_form($form, &$form_state, $no_js_use = FALSE) ); $form['other_state'] = array( '#type' => 'textfield', - '#title' => t('State other than India'), + '#title' => t('State other than India '. '<span class="form-required">*</span>'), '#size' => 100, '#attributes' => array( 'placeholder' => t('Enter your state/region name') @@ -183,7 +183,7 @@ function dwsim_flowsheet_proposal_form($form, &$form_state, $no_js_use = FALSE) ); $form['other_city'] = array( '#type' => 'textfield', - '#title' => t('City other than India'), + '#title' => t('City other than India '. '<span class="form-required">*</span>'), '#size' => 100, '#attributes' => array( 'placeholder' => t('Enter your city name') @@ -198,7 +198,7 @@ function dwsim_flowsheet_proposal_form($form, &$form_state, $no_js_use = FALSE) ); $form['all_state'] = array( '#type' => 'select', - '#title' => t('State'), + '#title' => t('State '. '<span class="form-required">*</span>'), '#options' => _df_list_of_states(), '#validated' => TRUE, '#states' => array( @@ -211,7 +211,7 @@ function dwsim_flowsheet_proposal_form($form, &$form_state, $no_js_use = FALSE) ); $form['city'] = array( '#type' => 'select', - '#title' => t('City'), + '#title' => t('City '.'<span class="form-required">*</span>'), '#options' => _df_list_of_cities(), '#states' => array( 'visible' => array( @@ -137,7 +137,13 @@ function _flowsheet_details($flowsheet_default_value) { $flowsheet_details = _flowsheet_information($flowsheet_default_value); if ($flowsheet_default_value != 0) { - $form['flowsheet_details']['#markup'] = '<span style="color: rgb(128, 0, 0);"><strong>About the Flowsheet</strong></span></td><td style="width: 35%;"><br />' . '<ul>' . '<li><strong>Proposer Name:</strong> ' . $flowsheet_details->name_title . ' ' . $flowsheet_details->contributor_name . '</li>' . '<li><strong>Title of the Flowhseet:</strong> ' . l($flowsheet_details->project_title,'flowsheeting-project/full-download/project/' . $flowsheet_default_value,array('attributes' => array('title' => 'This is a zip file containing a pdf (abstract) and a dwxml/dwxmz file which is the DWSIM flow sheet which is to be viewed by right clicking on the file and opening with DWSIM.'))) . '</li>' . '<li><strong>University:</strong> ' . $flowsheet_details->university . '</li>' . '</ul>'; + if($flowsheet_details->reference != NULL){ + $url = '~(?:(https?)://([^\s<]+)|(www\.[^\s<]+?\.[^\s<]+))(?<![\.,:])~i'; + $reference = preg_replace($url, '<a href="$0" target="_blank" title="$0">$0</a>', $flowsheet_details->reference); + }else{ + $reference = 'Not provided'; + } + $form['flowsheet_details']['#markup'] = '<span style="color: rgb(128, 0, 0);"><strong>About the Flowsheet</strong></span></td><td style="width: 35%;"><br />' . '<ul>' . '<li><strong>Proposer Name:</strong> ' . $flowsheet_details->name_title . ' ' . $flowsheet_details->contributor_name . '</li>' . '<li><strong>Title of the Flowhseet:</strong> ' . l($flowsheet_details->project_title,'flowsheeting-project/full-download/project/' . $flowsheet_default_value,array('attributes' => array('title' => 'This is a zip file containing a pdf (abstract) and a dwxml/dwxmz file which is the DWSIM flow sheet which is to be viewed by right clicking on the file and opening with DWSIM.'))) . '</li>' . '<li><strong>University:</strong> ' . $flowsheet_details->university . '</li>' . '<li>'.'<strong>Reference:</strong> ' . $reference .'</li>'.'</ul>'; $details = $form['flowsheet_details']['#markup']; return $details; } //$flowsheet_default_value != 0 |