From bce18b6c1950b107e445106b99d1e9315e93866a Mon Sep 17 00:00:00 2001 From: Sashi20 Date: Tue, 24 Aug 2021 11:51:28 +0530 Subject: Resolve issue while applying for an open proposal --- email.inc | 14 ++++----- lab_migration.module | 68 +++++++++++++++++++++++++++++++++++++-- manage_proposal.inc | 14 ++------- manage_solution_proposal.inc | 10 +----- proposal.inc | 61 ----------------------------------- solution_proposal.inc | 75 +++++--------------------------------------- upload_code.inc | 14 +-------- 7 files changed, 85 insertions(+), 171 deletions(-) diff --git a/email.inc b/email.inc index 56c796f..6355299 100755 --- a/email.inc +++ b/email.inc @@ -63,7 +63,7 @@ State : ' . $proposal_data->solution_provider_state . ' List of experiments : ' . $experiment_list . ' -Please ensure that ALL the codes follow guidelines at http://cfd.fossee.in/lab-migration/lab-migration-guidelines +Please ensure that ALL the codes follow guidelines at https://cfd.fossee.in/lab-migration/lab-migration-guidelines Best Wishes, @@ -394,7 +394,7 @@ Solution Provided By : ' . $solution_provider_user . ' List of experiments : ' . $experiment_list . ' Please ensure that ALL the guidelines for coding are strictly followed: -http://cfd.fossee.in/lab-migration-project/lab-migration-guidelines +https://cfd.fossee.in/lab-migration-project/lab-migration-guidelines Best Wishes, @@ -482,11 +482,11 @@ List of experiments : ' . $experiment_list . ' Your Lab solution is now available at following link to download. -http://cfd.fossee.in/lab-migration/lab-migration-run/' . $proposal_data->id . ' +https://cfd.fossee.in/lab-migration/lab-migration-run/' . $proposal_data->id . ' Now you should be able to propose a new Lab migration. -Please ensure that ALL the codes follow guidelines at http://cfd.fossee.in/lab-migration-project/lab-migration-guidelines +Please ensure that ALL the codes follow guidelines at https://cfd.fossee.in/lab-migration-project/lab-migration-guidelines Best Wishes, @@ -554,7 +554,7 @@ University/Institute : ' . $proposal_data->solution_provider_university . ' Your proposal is under review. You will soon receive an email when the same has been approved / disapproved. -Please ensure that ALL the codes follow guidelines at http://cfd.fossee.in/lab-migration-project/lab-migration-guidelines +Please ensure that ALL the codes follow guidelines at https://cfd.fossee.in/lab-migration-project/lab-migration-guidelines Best Wishes, @@ -644,7 +644,7 @@ Experiment Title : ' . $experiment_data->title . ' Solution number : ' . $solution_data->code_number . ' Caption : ' . $solution_data->caption . ' -Please ensure that ALL the codes follow guidelines at http://cfd.fossee.in/lab-migration-project/lab-migration-guidelines +Please ensure that ALL the codes follow guidelines at https://cfd.fossee.in/lab-migration-project/lab-migration-guidelines Best Wishes, @@ -736,7 +736,7 @@ Dear !user_name, You have uploaded following dependency files : ' . $dependency_files . ' -Please ensure that ALL the codes follow guidelines at http://cfd.fossee.in/lab-migration-project/lab-migration-guidelines +Please ensure that ALL the codes follow guidelines at https://cfd.fossee.in/lab-migration-project/lab-migration-guidelines Best Wishes, diff --git a/lab_migration.module b/lab_migration.module index fbb512d..43fd315 100755 --- a/lab_migration.module +++ b/lab_migration.module @@ -1,5 +1,8 @@ '-Select-'); + $query = db_select('list_states_of_india'); + $query->fields('list_states_of_india'); + //$query->orderBy('', ''); + $states_list = $query->execute(); + while ($states_list_data = $states_list->fetchObject()) + { + $states[$states_list_data->state] = $states_list_data->state; + } + return $states; + } +function _lm_list_of_cities() + { + $city = array(0 => '-Select-'); + $query = db_select('list_cities_of_india'); + $query->fields('list_cities_of_india'); + $query->orderBy('city', 'ASC'); + $city_list = $query->execute(); + while ($city_list_data = $city_list->fetchObject()) + { + $city[$city_list_data->city] = $city_list_data->city; + } + return $city; + } +function _lm_list_of_departments() + { + $department = array(); + $query = db_select('list_of_departments'); + $query->fields('list_of_departments'); + $query->orderBy('id', 'DESC'); + $department_list = $query->execute(); + while ($department_list_data = $department_list->fetchObject()) + { + $department[$department_list_data->department] = $department_list_data->department; + } + return $department; + } +function _lm_list_of_software_version() + { + $software_version = array(); + $query = db_select('openfoam_software_version'); + $query->fields('openfoam_software_version'); + $query->orderBy('id', 'DESC'); + $software_version_list = $query->execute(); + while ($software_version_list_data = $software_version_list->fetchObject()) + { + $software_version[$software_version_list_data->openfoam_version] = $software_version_list_data->openfoam_version; + } + return $software_version; + } + + function _lm_dir_name($lab, $name, $university) + { + $lab_title = ucname($lab); + $proposar_name = ucname($name); + $university_name = ucname($university); + $dir_name = $lab_title . " " . "by". " " . $proposar_name . ' ' . $university_name; + $directory_name = str_replace("__", "_", str_replace(" ", "_", $dir_name)); + return $directory_name; + } + diff --git a/manage_proposal.inc b/manage_proposal.inc index 557ce2c..6df058c 100755 --- a/manage_proposal.inc +++ b/manage_proposal.inc @@ -1390,7 +1390,7 @@ function lab_migration_category_edit_form_submit($form, &$form_state) drupal_set_message(t('Proposal Category Updated'), 'status'); drupal_goto('lab-migration/manage-proposal/category'); } -function _lm_list_of_departments() +/*function _lm_list_of_departments() { $department = array( 0 => '-Select-' @@ -1447,7 +1447,7 @@ function _lm_list_of_cities() $city[$city_list_data->city] = $city_list_data->city; } return $city; - } + }*/ function CreateReadmeFileLabMigration($proposal_id) { $result = db_query(" @@ -1515,12 +1515,4 @@ return; }*/ return ; } -function _lm_dir_name($lab, $name, $university) - { - $lab_title = ucname($lab); - $proposar_name = ucname($name); - $university_name = ucname($university); - $dir_name = $lab_title . " " . "by" . " " . $proposar_name . ' ' . $university_name; - $directory_name = str_replace("__", "_", str_replace(" ", "_", $dir_name)); - return $directory_name; - } + diff --git a/manage_solution_proposal.inc b/manage_solution_proposal.inc index 3e9aad5..bd65200 100755 --- a/manage_solution_proposal.inc +++ b/manage_solution_proposal.inc @@ -115,14 +115,6 @@ $form['country'] = array( '#title' => t('Pincode/Postal code') ); - - $form['esim_version'] = array( - '#type' => 'item', - '#title' => t('eSim version used'), - '#markup'=>$proposal_data->esim_version, - ); - - $form['lab_title'] = array( '#type' => 'item', '#markup' => $proposal_data->lab_title, @@ -149,7 +141,7 @@ $form['country'] = array( ); $form['solution_display'] = array( '#type' => 'item', - '#title' => t('Display the solution on the www.esim.fossee.in website'), + '#title' => t('Display the solution on the www.cfd.fossee.in website'), '#markup' => ($proposal_data->solution_display == 1) ? "Yes" : "No" ); /*if ($proposal_data->solution_provider_uid == 0) diff --git a/proposal.inc b/proposal.inc index e580467..bd35d39 100755 --- a/proposal.inc +++ b/proposal.inc @@ -526,64 +526,3 @@ function lab_migration_proposal_form_submit($form, &$form_state) drupal_set_message(t('We have received you Lab migration proposal. We will get back to you soon.'), 'status'); drupal_goto(''); } -/*function _lm_list_of_states() - { - $states = array(0 => '-Select-'); - $query = db_select('list_states_of_india'); - $query->fields('list_states_of_india'); - //$query->orderBy('', ''); - $states_list = $query->execute(); - while ($states_list_data = $states_list->fetchObject()) - { - $states[$states_list_data->state] = $states_list_data->state; - } - return $states; - }*/ -/*function _lm_list_of_cities() - { - $city = array(0 => '-Select-'); - $query = db_select('list_cities_of_india'); - $query->fields('list_cities_of_india'); - $query->orderBy('city', 'ASC'); - $city_list = $query->execute(); - while ($city_list_data = $city_list->fetchObject()) - { - $city[$city_list_data->city] = $city_list_data->city; - } - return $city; - } -function _lm_list_of_departments() - { - $department = array(); - $query = db_select('list_of_departments'); - $query->fields('list_of_departments'); - $query->orderBy('id', 'DESC'); - $department_list = $query->execute(); - while ($department_list_data = $department_list->fetchObject()) - { - $department[$department_list_data->department] = $department_list_data->department; - } - return $department; - }*/ -/*function _lm_list_of_software_version() - { - $software_version = array(); - $query = db_select('openfoam_software_version'); - $query->fields('openfoam_software_version'); - $query->orderBy('id', 'DESC'); - $software_version_list = $query->execute(); - while ($software_version_list_data = $software_version_list->fetchObject()) - { - $software_version[$software_version_list_data->openfoam_version] = $software_version_list_data->openfoam_version; - } - return $software_version; - }*/ -function _lm_dir_name($lab, $name, $university) - { - $lab_title = ucname($lab); - $proposar_name = ucname($lab); - $university_name = ucname($university); - $dir_name = $lab_title . " " . "by". " " . $proposar_name . ' ' . $university_name; - $directory_name = str_replace("__", "_", str_replace(" ", "_", $dir_name)); - return $directory_name; - } diff --git a/solution_proposal.inc b/solution_proposal.inc index b854771..e23f4fa 100755 --- a/solution_proposal.inc +++ b/solution_proposal.inc @@ -115,7 +115,7 @@ function lab_migration_solution_proposal_form($form, $form_state) $form['solution_provider_department'] = array( '#type' => 'select', '#title' => t('Department/Branch'), - '#options' => lm_list_of_departments(), + '#options' => _lm_list_of_departments(), '#required' => TRUE ); $form['solution_provider_university'] = array( @@ -184,7 +184,7 @@ function lab_migration_solution_proposal_form($form, $form_state) $form['all_state'] = array( '#type' => 'select', '#title' => t('State'), - '#options' => lm_list_of_states(), + '#options' => _lm_list_of_states(), '#validated' => TRUE, '#states' => array( 'visible' => array( @@ -197,7 +197,7 @@ function lab_migration_solution_proposal_form($form, $form_state) $form['city'] = array( '#type' => 'select', '#title' => t('City'), - '#options' => lm_list_of_cities(), + '#options' => _lm_list_of_cities(), '#validated' => TRUE, '#states' => array( 'visible' => array( @@ -217,10 +217,10 @@ function lab_migration_solution_proposal_form($form, $form_state) 'placeholder' => 'Enter pincode....' ) ); - $form['version'] = array( + /*$form['version'] = array( '#type' => 'select', '#title' => t('Version'), - '#options' => lm_list_of_software_version(), + '#options' => _lm_list_of_software_version(), '#required' => TRUE ); $form['older'] = array( @@ -236,7 +236,7 @@ function lab_migration_solution_proposal_form($form, $form_state) ) ) ) - ); + );*/ $form['submit'] = array( '#type' => 'submit', '#value' => t('Apply for Solution') @@ -347,7 +347,7 @@ function lab_migration_solution_proposal_form_submit($form, &$form_state) drupal_set_message("Someone has already applied for solving this Lab.", 'error'); drupal_goto('lab-migration/open-proposal'); } - $query = "UPDATE {lab_migration_proposal} set solution_provider_uid = :uid, solution_status = 1, solution_provider_name_title = :solution_provider_name_title, solution_provider_name = :solution_provider_contact_name, solution_provider_contact_ph = :solution_provider_contact_ph, solution_provider_department = :solution_provider_department, solution_provider_university = :solution_provider_university , solution_provider_city = :solution_provider_city, solution_provider_pincode = :solution_provider_pincode, solution_provider_state = :solution_provider_state,solution_provider_country = :solution_provider_country, version = :version WHERE id = :proposal_id"; + $query = "UPDATE {lab_migration_proposal} set solution_provider_uid = :uid, solution_status = 1, solution_provider_name_title = :solution_provider_name_title, solution_provider_name = :solution_provider_contact_name, solution_provider_contact_ph = :solution_provider_contact_ph, solution_provider_department = :solution_provider_department, solution_provider_university = :solution_provider_university , solution_provider_city = :solution_provider_city, solution_provider_pincode = :solution_provider_pincode, solution_provider_state = :solution_provider_state,solution_provider_country = :solution_provider_country WHERE id = :proposal_id"; $args = array( ":uid" => $user->uid, ":solution_provider_name_title" => $form_state['values']['solution_provider_name_title'], @@ -359,7 +359,6 @@ function lab_migration_solution_proposal_form_submit($form, &$form_state) ":solution_provider_pincode" => $form_state['values']['pincode'], ":solution_provider_state" => $form_state['values']['all_state'], ":solution_provider_country" => $form_state['values']['country'], - ":version" => $form_state['values']['version'], ":proposal_id" => $proposal_id ); @@ -389,64 +388,4 @@ function lab_migration_solution_proposal_form_submit($form, &$form_state) if (!drupal_mail('lab_migration', 'solution_proposal_received', $email_to , language_default(), $param, variable_get('lab_migration_from_email', NULL), TRUE)) drupal_set_message('Error sending email message.', 'error');*/ drupal_goto('lab-migration/open-proposal'); - } - - -function lm_list_of_departments() - { - $department = array( - 0 => '-Select-' - ); - $query = db_select('list_of_departments'); - $query->fields('list_of_departments'); - $query->orderBy('id', 'DESC'); - $department_list = $query->execute(); - while ($department_list_data = $department_list->fetchObject()) - { - $department[$department_list_data->department] = $department_list_data->department; - } - return $department; - } -function lm_list_of_states() - { - $states = array( - 0 => '-Select-' - ); - $query = db_select('list_states_of_india'); - $query->fields('list_states_of_india'); - //$query->orderBy('', ''); - $states_list = $query->execute(); - while ($states_list_data = $states_list->fetchObject()) - { - $states[$states_list_data->state] = $states_list_data->state; - } - return $states; - } -function lm_list_of_cities() - { - $states = array( - 0 => '-Select-' - ); - $query = db_select('list_cities_of_india'); - $query->fields('list_cities_of_india'); - $query->orderBy('city', 'ASC'); - $city_list = $query->execute(); - while ($city_list_data = $city_list->fetchObject()) - { - $city[$city_list_data->city] = $city_list_data->city; - } - return $city; - } - function lm_list_of_software_version() - { - $software_version = array(); - $query = db_select('openfoam_software_version'); - $query->fields('openfoam_software_version'); - $query->orderBy('id', 'ASC'); - $software_version_list = $query->execute(); - while ($software_version_list_data = $software_version_list->fetchObject()) - { - $software_version[$software_version_list_data->version] = $software_version_list_data->version; - } - return $software_version; } \ No newline at end of file diff --git a/upload_code.inc b/upload_code.inc index 9e14843..7dca349 100755 --- a/upload_code.inc +++ b/upload_code.inc @@ -654,17 +654,5 @@ function _list_of_dependency_files() } return array($dependency_files, $dependency_files_class, $dependency_files_value); } -function _lm_list_of_software_version() - { - $software_version = array(); - $query = db_select('openfoam_software_version'); - $query->fields('openfoam_software_version'); - $query->orderBy('id', 'ASC'); - $software_version_list = $query->execute(); - while ($software_version_list_data = $software_version_list->fetchObject()) - { - $software_version[$software_version_list_data->version] = $software_version_list_data->version; - } - return $software_version; - } + -- cgit