diff options
Diffstat (limited to 'form_edit.module')
-rwxr-xr-x[-rw-r--r--] | form_edit.module | 246 |
1 files changed, 133 insertions, 113 deletions
diff --git a/form_edit.module b/form_edit.module index b7b6da5..dd58953 100644..100755 --- a/form_edit.module +++ b/form_edit.module @@ -1,114 +1,134 @@ -<?php - function form_edit_menu() { - $items = array(); - - /*$items['form_edit'] = array( - 'title' => 'Edit Book Proposals', - 'description' => 'Edit Book Proposals', - 'page callback' => '_proposal_pending', - 'access callback' => 'user_access', - 'access arguments' => array('approve book proposal'), - 'file' => 'form_edit.inc', - ); - $items['form_edit/pending'] = array( - 'title' => 'Completed Proposals', - 'description' => 'Completed Proposals Queue', - 'page callback' => '_proposal_pending', - 'access callback' => 'user_access', - 'access arguments' => array('approve book proposal'), - 'type' => MENU_DEFAULT_LOCAL_TASK, - 'weight' => 1, - 'file' => 'form_edit.inc', - );*/ - $items['form_edit/tbc/all'] = array( - 'title' => 'All completed Proposals', - 'description' => 'All completed Proposals', - 'page callback' => '_completed_proposal_all', - 'access callback' => 'user_access', - 'access arguments' => array('edit completed book proposal'), - 'type' => MENU_NORMAL_ITEM, - 'weight' => 2, - 'file' => 'form_edit.inc', - ); - $items['form_edit/lm/all'] = array( - 'title' => 'All completed Lab Proposals', - 'description' => 'All completed Lab Proposals', - 'page callback' => '_completed_lab_proposal_all', - 'access callback' => 'user_access', - 'access arguments' => array('edit completed lab proposal'), - 'type' => MENU_NORMAL_ITEM, - 'weight' => 2, - 'file' => 'form_edit.inc', - ); - /* $items['form_edit/category'] = array( - 'title' => 'Categorize', - 'description' => 'Categorize Books', - 'page callback' => '_category_all', - 'access callback' => 'user_access', - 'access arguments' => array('approve book proposal'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 2, - 'file' => 'form_edit.inc', - ); - $items['form_edit/failed'] = array( - 'title' => 'Failed Proposals', - 'description' => 'Failed to submit code', - 'page callback' => '_failed_all', - 'access callback' => 'user_access', - 'access arguments' => array('approve book proposal'), - 'type' => MENU_LOCAL_TASK, - 'weight' => 3, - 'file' => 'form_edit.inc', - ); - $items['form_edit/approve'] = array( - 'title' => 'Proposal Approval', - 'description' => 'Proposal Approval', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('proposal_approval_form'), - 'access arguments' => array('approve book proposal'), - 'type' => MENU_CALLBACK, - 'file' => 'form_edit.inc', - ); - $items['form_edit/status'] = array( - 'title' => 'Proposal Status', - 'description' => 'Proposal Status', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('proposal_status_form'), - 'access arguments' => array('approve book proposal'), - 'type' => MENU_CALLBACK, - 'file' => 'form_edit.inc', - );*/ - $items['form_edit/tbc/edit'] = array( - 'title' => 'Edit Proposal', - 'description' => 'Edit Proposal', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('proposal_edit_form'), - 'access arguments' => array('edit completed book proposal'), - 'type' => MENU_CALLBACK, - 'file' => 'form_edit.inc', - ); - $items['form_edit/lm/edit'] = array( - 'title' => 'Edit Lab Proposal', - 'description' => 'Edit Lab Proposal', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('_completed_lab_proposal_edit_form'), - 'access arguments' => array('edit completed lab proposal'), - 'type' => MENU_CALLBACK, - 'file' => 'form_edit.inc', - ); - /*$items['form_edit/category/edit'] = array( - 'title' => 'Edit Category', - 'description' => 'Edit category', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('category_edit_form'), - 'access arguments' => array('edit book proposal'), - 'type' => MENU_CALLBACK, - 'file' => 'form_edit.inc', - );*/ - - return $items; - - } - function form_edit_perm() { - return array('edit completed book proposal','edit completed lab proposal'); +<?php +function form_edit_menu() +{ + $items = array(); + + $items['form_edit/tbc/all'] = array( + 'title' => 'All completed Proposals', + 'description' => 'All completed Proposals', + 'page callback' => '_completed_proposal_all', + 'access callback' => 'user_access', + 'access arguments' => array( + 'edit completed book proposal' + ), + 'type' => MENU_NORMAL_ITEM, + 'weight' => 2, + 'file' => 'form_edit.inc' + ); + $items['form_edit/lm/all'] = array( + 'title' => 'All completed Lab Proposals', + 'description' => 'All completed Lab Proposals', + 'page callback' => '_completed_lab_proposal_all', + 'access callback' => 'user_access', + 'access arguments' => array( + 'edit completed lab proposal' + ), + 'type' => MENU_NORMAL_ITEM, + 'weight' => 2, + 'file' => 'form_edit.inc' + ); + + $items['form_edit/tbc/edit'] = array( + 'title' => 'Edit Proposal', + 'description' => 'Edit Proposal', + 'page callback' => 'drupal_get_form', + 'page arguments' => array( + 'proposal_edit_form' + ), + 'access arguments' => array( + 'edit completed book proposal' + ), + 'type' => MENU_CALLBACK, + 'file' => 'form_edit.inc' + ); + $items['form_edit/lm/edit'] = array( + 'title' => 'Edit Lab Proposal', + 'description' => 'Edit Lab Proposal', + 'page callback' => 'drupal_get_form', + 'page arguments' => array( + '_completed_lab_proposal_edit_form' + ), + 'access arguments' => array( + 'edit completed lab proposal' + ), + 'type' => MENU_CALLBACK, + 'file' => 'form_edit.inc' + ); + + return $items; + +} +function form_edit_permission() +{ + return array( + "edit completed book proposal" => array( + "title" => t("edit completed book proposal"), + "description" => t("Allows users to edit completed book proposal.") + ), + "edit completed lab proposal" => array( + "title" => t("edit completed lab proposal"), + "description" => t("Allows users to edit completed lab proposal.") + ) + ); +} +function _form_edit_list_of_departments() +{ + + $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; + } //$department_list_data = $department_list->fetchObject() + return $department; +} +function _form_edit_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; + } //$states_list_data = $states_list->fetchObject() + return $states; +} +function _form_edit_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; + } //$city_list_data = $city_list->fetchObject() + return $city; +} +function _form_edit_list_of_category($category_id = NULL) +{ + if ($category_id == NULL) { + $query = db_select('list_of_category'); + $query->fields('list_of_category'); + $query->orderBy('id', 'ASC'); + $category_list = $query->execute(); + } //$category_id == NULL + else { + $query = db_select('list_of_category'); + $query->fields('list_of_category'); + $query->condition('category_id', $category_id); + $query->orderBy('id', 'ASC'); + $category_list = $query->execute(); + } + while ($category_list_data = $category_list->fetchObject()) { + $category[$category_list_data->category_id] = $category_list_data->category_name; + } //$category_list_data = $category_list->fetchObject() + return $category; } |