From 930c6ac12538237c4e51f1bd2cd01454e6906abc Mon Sep 17 00:00:00 2001 From: prashant Date: Fri, 16 Oct 2015 11:46:17 +0530 Subject: done mioner changes --- bulk_approval.inc | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/bulk_approval.inc b/bulk_approval.inc index 55d35fc..4be6843 100755 --- a/bulk_approval.inc +++ b/bulk_approval.inc @@ -511,6 +511,16 @@ function lab_migration_bulk_approval_form_submit($form, $form_state) elseif (($form_state['values']['lab_actions'] == 4) && ($form_state['values']['lab_experiment_actions'] == 0) && ($form_state['values']['lab_experiment_solution_actions'] == 0)) { + if (!$form_state['values']['message']) + { + if (strlen(trim($form_state['values']['message'])) <= 30) + { + form_set_error('message', t('')); + drupal_set_message("Please mention the reason for disapproval.", 'error'); + return; + } + } + if (!user_access('lab migration bulk delete code')) { drupal_set_message(t('You do not have permission to Bulk Delete Entire Lab Including Proposal.'), 'error'); @@ -606,9 +616,19 @@ function lab_migration_bulk_approval_form_submit($form, $form_state) ); } - elseif (($form_state['values']['lab_actions'] == 1) && ($form_state['values']['lab_experiment_actions'] == 3) && ($form_state['values']['lab_experiment_solution_actions'] == 0)) + elseif (($form_state['values']['lab_actions'] == 0) && ($form_state['values']['lab_experiment_actions'] == 3) && ($form_state['values']['lab_experiment_solution_actions'] == 0)) { + if (!$form_state['values']['message']) + { + if (strlen(trim($form_state['values']['message'])) <= 30) + { + form_set_error('message', t('')); + drupal_set_message("Please mention the reason for disapproval.", 'error'); + return; + } + } + if (!user_access('lab migration bulk delete code')) { drupal_set_message(t('You do not have permission to Bulk Dis-Approved and Deleted Entire Experiment.'), 'error'); @@ -668,6 +688,15 @@ function lab_migration_bulk_approval_form_submit($form, $form_state) } elseif (($form_state['values']['lab_actions'] == 0) && ($form_state['values']['lab_experiment_actions'] == 0) && ($form_state['values']['lab_experiment_solution_actions'] == 3)) { + if (!$form_state['values']['message']) + { + if (strlen(trim($form_state['values']['message'])) <= 30) + { + form_set_error('message', t('')); + drupal_set_message("Please mention the reason for disapproval.", 'error'); + return; + } + } if (lab_migration_delete_solution($form_state['values']['lab_solution_list'])) { @@ -692,7 +721,7 @@ function lab_migration_bulk_approval_form_submit($form, $form_state) else { - drupal_set_message("Please select any one action", 'error'); + drupal_set_message("Please select any one action at a time", 'error'); return; } -- cgit