diff options
-rwxr-xr-x | manage_proposal.inc | 114 | ||||
-rwxr-xr-x | proposal.inc | 76 |
2 files changed, 190 insertions, 0 deletions
diff --git a/manage_proposal.inc b/manage_proposal.inc index 5f1a7a5..928c6ea 100755 --- a/manage_proposal.inc +++ b/manage_proposal.inc @@ -149,6 +149,24 @@ function cfd_case_study_proposal_approval_form($form, &$form_state) drupal_goto('case-study-project/manage-proposal'); return; } + if($proposal_data->faculty_name == ''){ + $faculty_name = 'NA'; + } + else{ + $faculty_name = $proposal_data->faculty_name; + } + if($proposal_data->faculty_department == ''){ + $faculty_department = 'NA'; + } + else{ + $faculty_department = $proposal_data->faculty_department; + } + if($proposal_data->faculty_email == ''){ + $faculty_email = 'NA'; + } + else{ + $faculty_email = $proposal_data->faculty_email; + } $form['contributor_name'] = array( '#type' => 'item', '#markup' => l($proposal_data->name_title . ' ' . $proposal_data->contributor_name, 'user/' . $proposal_data->uid), @@ -170,6 +188,26 @@ function cfd_case_study_proposal_approval_form($form, &$form_state) '#markup' => $proposal_data->university, '#title' => t('University/Institute') ); + $form['how_did_you_know_about_project'] = array( + '#type' => 'item', + '#markup' => $proposal_data->how_did_you_know_about_project, + '#title' => t('How did you know about the project') + ); + $form['faculty_name'] = array( + '#type' => 'item', + '#markup' => $faculty_name, + '#title' => t('Name of the faculty') + ); + $form['faculty_department'] = array( + '#type' => 'item', + '#markup' => $faculty_department, + '#title' => t('Department of the faculty') + ); + $form['faculty_email'] = array( + '#type' => 'item', + '#markup' => $faculty_email, + '#title' => t('Email of the faculty') + ); $form['country'] = array( '#type' => 'item', '#markup' => $proposal_data->country, @@ -406,6 +444,24 @@ function cfd_case_study_proposal_status_form($form, &$form_state) drupal_goto('case-study-project/manage-proposal'); return; } + if($proposal_data->faculty_name == ''){ + $faculty_name = 'NA'; + } + else{ + $faculty_name = $proposal_data->faculty_name; + } + if($proposal_data->faculty_department == ''){ + $faculty_department = 'NA'; + } + else{ + $faculty_department = $proposal_data->faculty_department; + } + if($proposal_data->faculty_email == ''){ + $faculty_email = 'NA'; + } + else{ + $faculty_email = $proposal_data->faculty_email; + } $form['contributor_name'] = array( '#type' => 'item', '#markup' => l($proposal_data->name_title . ' ' . $proposal_data->contributor_name, 'user/' . $proposal_data->uid), @@ -422,6 +478,26 @@ function cfd_case_study_proposal_status_form($form, &$form_state) '#markup' => $proposal_data->university, '#title' => t('University/Institute') ); + $form['how_did_you_know_about_project'] = array( + '#type' => 'item', + '#markup' => $proposal_data->how_did_you_know_about_project, + '#title' => t('How did you know about the project') + ); + $form['faculty_name'] = array( + '#type' => 'item', + '#markup' => $faculty_name, + '#title' => t('Name of the faculty') + ); + $form['faculty_department'] = array( + '#type' => 'item', + '#markup' => $faculty_department, + '#title' => t('Department of the faculty') + ); + $form['faculty_email'] = array( + '#type' => 'item', + '#markup' => $faculty_email, + '#title' => t('Email of the faculty') + ); $form['country'] = array( '#type' => 'item', '#markup' => $proposal_data->country, @@ -682,6 +758,36 @@ function cfd_case_study_proposal_edit_form($form, &$form_state) '#required' => TRUE, '#default_value' => $proposal_data->institute ); + $form['how_did_you_know_about_project'] = array( + '#type' => 'textfield', + '#title' => t('How did you come to know about the Case Study Project?'), + '#default_value' => $proposal_data->how_did_you_know_about_project, + '#required' => TRUE + ); + $form['faculty_name'] = array( + '#type' => 'textfield', + '#title' => t('Name of the Faculty'), + '#size' => 50, + '#maxlength' => 50, + '#validated' => TRUE, + '#default_value' => $proposal_data->faculty_name + ); + $form['faculty_department'] = array( + '#type' => 'textfield', + '#title' => t('Department of the Faculty'), + '#size' => 50, + '#maxlength' => 50, + '#validated' => TRUE, + '#default_value' => $proposal_data->faculty_department + ); + $form['faculty_email'] = array( + '#type' => 'textfield', + '#title' => t('Email id of the Faculty'), + '#size' => 50, + '#maxlength' => 50, + '#validated' => TRUE, + '#default_value' => $proposal_data->faculty_email + ); $form['country'] = array( '#type' => 'select', '#title' => t('Country'), @@ -896,6 +1002,10 @@ function cfd_case_study_proposal_edit_form_submit($form, &$form_state) contributor_name=:contributor_name, university=:university, institute=:institute, + how_did_you_know_about_project = :how_did_you_know_about_project, + faculty_name = :faculty_name, + faculty_department = :faculty_department, + faculty_email = :faculty_email, city=:city, pincode=:pincode, state=:state, @@ -908,6 +1018,10 @@ function cfd_case_study_proposal_edit_form_submit($form, &$form_state) ':contributor_name' => $v['contributor_name'], ':university' => $v['university'], ":institute" => $v['institute'], + ":how_did_you_know_about_project" => $v['how_did_you_know_about_project'], + ":faculty_name" => $v['faculty_name'], + ":faculty_department" => $v['faculty_department'], + ":faculty_email" => $v['faculty_email'], ':city' => $v['city'], ':pincode' => $v['pincode'], ':state' => $v['all_state'], diff --git a/proposal.inc b/proposal.inc index c1beb27..99d6b1a 100755 --- a/proposal.inc +++ b/proposal.inc @@ -108,6 +108,50 @@ function cfd_case_study_proposal_form($form, &$form_state, $no_js_use = FALSE) 'placeholder' => 'Insert full name of your institute.... ' ) ); + $form['how_did_you_know_about_project'] = array( + '#type' => 'select', + '#title' => t('How did you come to know about the Case Study Project?'), + '#options' => array( + 'Poster' => 'Poster', + 'Website' => 'Website', + 'Email' => 'Email', + 'Others' => 'Others' + ), + '#required' => TRUE + ); + $form['others_how_did_you_know_about_project'] = array( + '#type' => 'textfield', + '#title' => t('If ‘Other’, please specify'), + '#maxlength' => 50, + '#states' => array( + 'visible' => array( + ':input[name="how_did_you_know_about_project"]' => array( + 'value' => 'Others' + ) + ) + ) + ); + $form['faculty_name'] = array( + '#type' => 'textfield', + '#title' => t('Name of the Faculty'), + '#size' => 50, + '#maxlength' => 50, + '#validated' => TRUE + ); + $form['faculty_department'] = array( + '#type' => 'textfield', + '#title' => t('Department of the Faculty'), + '#size' => 50, + '#maxlength' => 50, + '#validated' => TRUE + ); + $form['faculty_email'] = array( + '#type' => 'textfield', + '#title' => t('Email id of the Faculty'), + '#size' => 50, + '#maxlength' => 50, + '#validated' => TRUE + ); $form['country'] = array( '#type' => 'select', '#title' => t('Country'), @@ -395,6 +439,19 @@ function cfd_case_study_proposal_form_validate($form, &$form_state) { form_set_error('expected_date_of_completion', t('Completion date should not be earlier than proposal date')); } + + if ($form_state['values']['how_did_you_know_about_project'] == 'Others') + { + if ($form_state['values']['others_how_did_you_know_about_project'] == '') + { + form_set_error('others_how_did_you_know_about_project', t('Please enter how did you know about the project')); + // $form_state['values']['country'] = $form_state['values']['other_country']; + } //$form_state['values']['other_country'] == '' + else + { + $form_state['values']['how_did_you_know_about_project'] = $form_state['values']['others_how_did_you_know_about_project']; + } + } if (isset($_FILES['files'])) { @@ -440,6 +497,13 @@ function cfd_case_study_proposal_form_submit($form, &$form_state) $project_title = $form_state['values']['project_title']; } + if ($form_state['values']['how_did_you_know_about_project'] == 'Others') + { + $how_did_you_know_about_project = $form_state['values']['others_how_did_you_know_about_project']; + } + else { + $how_did_you_know_about_project = $form_state['values']['how_did_you_know_about_project']; + } /* inserting the user proposal */ $v = $form_state["values"]; $project_title = trim($project_title); @@ -455,6 +519,10 @@ function cfd_case_study_proposal_form_submit($form, &$form_state) contact_no, university, institute, + how_did_you_know_about_project, + faculty_name, + faculty_department, + faculty_email, city, pincode, state, @@ -477,6 +545,10 @@ function cfd_case_study_proposal_form_submit($form, &$form_state) :contact_no, :university, :institute, + :how_did_you_know_about_project, + :faculty_name, + :faculty_department, + :faculty_email, :city, :pincode, :state, @@ -499,6 +571,10 @@ function cfd_case_study_proposal_form_submit($form, &$form_state) ":contact_no" => $v['contributor_contact_no'], ":university" => $v['university'], ":institute" => _df_sentence_case($v['institute']), + ":how_did_you_know_about_project" => trim($how_did_you_know_about_project), + ":faculty_name" => $v['faculty_name'], + ":faculty_department" => $v['faculty_department'], + ":faculty_email" => $v['faculty_email'], ":city" => $v['city'], ":pincode" => $v['pincode'], ":state" => $v['all_state'], |