summaryrefslogtreecommitdiff
path: root/osdag_workshop_booking.module
blob: e8ebf2d0cbff73979d791012791db3026ff29a60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<?php
/**
 * Implementation of hook_menu().
 */
function osdag_workshop_booking_menu()
{
    $items = array();
    /* PROPOSAL */
    $items['osdag-workshop-booking/registration'] = array(
        'title' => 'Osdag Workshop Registration form',
        'description' => 'Osdag Workshop Registration form',
        'page callback' => 'drupal_get_form',
        'page arguments' => array(
            'osdag_workshop_booking_form'
        ),
        'access arguments' => array(
            'create workshop proposal'
        ),
        'type' => MENU_NORMAL_ITEM,
        'file' => 'workshop_registration.inc'
    );
    $items['osdag-workshop-booking/manage-proposal'] = array(
        'title' => 'Osdag Workshop Registration Pending Proposal',
        'description' => 'Osdag Workshop Registration Pending Proposal',
        'page callback' => '_proposal_pending',
        'page arguments' => array(
            'osdag_workshop_booking_form'
        ),
        'access arguments' => array(
            'approve workshop proposal'
        ),
        'file' => 'workshop_registration_process.inc'
    );
    $items['osdag-workshop-booking/manage-proposal/pending'] = array(
        'title' => 'Pending Proposals',
        'description' => 'Pending Proposals Queue',
        'page callback' => '_proposal_pending',
        'access callback' => 'user_access',
        'access arguments' => array(
            'approve workshop proposal'
        ),
        'type' => MENU_DEFAULT_LOCAL_TASK,
        'weight' => 1,
        'file' => 'workshop_registration_process.inc'
    );
    $items['osdag-workshop-booking/manage-proposal/all'] = array(
        'title' => 'All Proposals',
        'description' => 'All Proposals',
        'page callback' => '_proposal_all',
        'access callback' => 'user_access',
        'access arguments' => array(
            'approve workshop proposal'
        ),
        'type' => MENU_LOCAL_TASK,
        'weight' => 2,
        'file' => 'workshop_registration_process.inc'
    );
    $items['osdag-workshop-booking/manage-proposal/approve'] = array(
        'title' => 'Osdag Workshop Registration Proposal Approval',
        'description' => 'Osdag Workshop Registration Proposal Approval',
        'page callback' => 'drupal_get_form',
        'page arguments' => array(
            'osdag_workshop_booking_proposal_approval_form'
        ),
        'access arguments' => array(
            'approve workshop proposal'
        ),
        'type' => MENU_CALLBACK,
        'file' => 'workshop_registration_process.inc'
    );
    return $items;
}

/**
 * Implementation of hook_permission().
 */
function osdag_workshop_booking_permission()
{
    return array(
        "create workshop proposal" => array(
            "title" => t("Workshop Booking Proposal Form"),
            "description" => t("Workshop Booking Proposal Form.")
        ),
        "approve workshop proposal" => array(
            "title" => t("Workshop Booking Proposal Form approve"),
            "description" => t("Workshop Booking Proposal Form approve.")
        ),
    );
}

function osdag_workshop_booking_list_of_states()
{
    $query = db_select('list_states_of_india');
    $query->fields('list_states_of_india');
    $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;
}