diff options
author | Sashi20 | 2019-10-03 12:22:42 +0530 |
---|---|---|
committer | GitHub | 2019-10-03 12:22:42 +0530 |
commit | 4b6d047ccbb49ca38da31a39489b5a92603286b6 (patch) | |
tree | b71aa7e8f287f24d9899c941a3153d7dd24c78e7 | |
parent | b9b8768dc69765d111e1bc950366655320751c30 (diff) | |
parent | d62c7d56e20610f23ac6631fc2b0ae020b155e66 (diff) | |
download | openmodelica_textbook_companion-4b6d047ccbb49ca38da31a39489b5a92603286b6.tar.gz openmodelica_textbook_companion-4b6d047ccbb49ca38da31a39489b5a92603286b6.tar.bz2 openmodelica_textbook_companion-4b6d047ccbb49ca38da31a39489b5a92603286b6.zip |
Merge pull request #10 from Sashi20/drupal_7.x
Display exp no in the error message on empty reason for disapproval
-rwxr-xr-x | code_approval.inc | 8 | ||||
-rwxr-xr-x | textbook_companion.module | 121 |
2 files changed, 6 insertions, 123 deletions
diff --git a/code_approval.inc b/code_approval.inc index 43ab0c4..1349344 100755 --- a/code_approval.inc +++ b/code_approval.inc @@ -128,7 +128,7 @@ function code_approval_form($form, &$form_state) $form['example_details'][$example_data->id]['example_number'] = array( '#type' => 'item', '#markup' => $example_data->number, - '#title' => t('Example Number') + '#title' => t('Example Number'), ); $form['example_details'][$example_data->id]['example_caption'] = array( '#type' => 'item', @@ -154,6 +154,10 @@ function code_approval_form($form, &$form_state) '#type' => 'hidden', '#value' => $example_data->id ); + $form['example_details'][$example_data->id]['example_number_hidden'] = array( + '#type' => 'hidden', + '#value' => $example_data->number + ); } $form['submit'] = array( '#type' => 'submit', @@ -165,7 +169,7 @@ function code_approval_form_validate($form, &$form_state){ foreach ($form_state['values']['example_details'] as $ex_id => $ex_data) { if ($ex_data['approved'] == "1"){ if($ex_data['message'] == NULL || $ex_data['message'] == '') - form_set_error('example_details' , t('Enter reason for disapproval')); + form_set_error($ex_id . '][message', t('Enter reason for disapproval for experiment no: ' . $ex_data['example_number_hidden'])); } } } diff --git a/textbook_companion.module b/textbook_companion.module index 9ca429b..a40fb3b 100755 --- a/textbook_companion.module +++ b/textbook_companion.module @@ -2078,127 +2078,6 @@ function book_proposal_form($form, &$form_state) '#required' => TRUE //'#value' => $row1->year, ); - /*$form['preference2'] = array( - '#type' => 'fieldset', - '#title' => t('Book Preference 2'), - '#collapsible' => TRUE, - '#collapsed' => FALSE - ); - $form['preference2']['book2'] = array( - '#type' => 'textfield', - '#title' => t('Title of the book'), - '#size' => 30, - '#maxlength' => 100, - '#required' => TRUE - //'#value' => $row2->book, - //'#disabled' => ($row2->book?TRUE:FALSE), - ); - $form['preference2']['author2'] = array( - '#type' => 'textfield', - '#title' => t('Author Name'), - '#size' => 30, - '#maxlength' => 100, - '#required' => TRUE - //'#value' => $row2->author, - //'#disabled' => ($row2->author?TRUE:FALSE), - ); - $form['preference2']['isbn2'] = array( - '#type' => 'textfield', - '#title' => t('ISBN No'), - '#size' => 30, - '#maxlength' => 25, - '#required' => TRUE - // '#value' => $row2->isbn, - // '#disabled' => ($row2->isbn?TRUE:FALSE), - ); - $form['preference2']['publisher2'] = array( - '#type' => 'textfield', - '#title' => t('Publisher & Place'), - '#size' => 30, - '#maxlength' => 50, - '#required' => TRUE - //'#value' => $row2->publisher, - ); - $form['preference2']['edition2'] = array( - '#type' => 'textfield', - '#title' => t('Edition'), - '#size' => 4, - '#maxlength' => 2, - '#required' => TRUE - //'#value' => $row2->edition, - ); - $form['preference2']['year2'] = array( - '#type' => 'textfield', - '#title' => t('Year of pulication'), - '#size' => 4, - '#maxlength' => 4, - '#required' => TRUE - //'#value' => $row2->year, - ); - $form['preference3'] = array( - '#type' => 'fieldset', - '#title' => t('Book Preference 3'), - '#collapsible' => TRUE, - '#collapsed' => FALSE - ); - $form['preference3']['book3'] = array( - '#type' => 'textfield', - '#title' => t('Title of the book'), - '#size' => 30, - '#maxlength' => 100, - '#required' => TRUE - //'#value' => $row3->book, - //'#disabled' => ($row3->book?TRUE:FALSE), - ); - $form['preference3']['author3'] = array( - '#type' => 'textfield', - '#title' => t('Author Name'), - '#size' => 30, - '#maxlength' => 100, - '#required' => TRUE - //'#value' => $row3->author, - // '#disabled' => ($row3->author?TRUE:FALSE), - ); - $form['preference3']['isbn3'] = array( - '#type' => 'textfield', - '#title' => t('ISBN No'), - '#size' => 30, - '#maxlength' => 25, - '#required' => TRUE - //'#value' => $row3->isbn, - //'#disabled' => ($row3->isbn?TRUE:FALSE), - ); - $form['preference3']['publisher3'] = array( - '#type' => 'textfield', - '#title' => t('Publisher & Place'), - '#size' => 30, - '#maxlength' => 50, - '#required' => TRUE - // '#value' => $row3->publisher, - ); - $form['preference3']['edition3'] = array( - '#type' => 'textfield', - '#title' => t('Edition'), - '#size' => 4, - '#maxlength' => 2, - '#required' => TRUE - //'#value' => $row3->edition, - ); - $form['preference3']['year3'] = array( - '#type' => 'textfield', - '#title' => t('Year of pulication'), - '#size' => 4, - '#maxlength' => 4, - '#required' => TRUE - //'#value' => $row3->year, - ); - /*$form['termconditions'] = array( - '#type' => 'checkboxes', - '#title' => t('Terms And Conditions'), - '#options' => array( - 'status' => t('<a href="term-and-conditions" target="_blank">I agree to the Terms and Conditions</a>'),), - '#required' => TRUE, - );*/ $form['samplefile'] = array( '#type' => 'fieldset', '#title' => t('Sample Source Files'), |