| 1 |
<?php |
<?php |
| 2 |
// $Id: send.views.inc,v 1.2 2009/03/19 20:01:02 vauxia Exp $ |
// $Id: send.views.inc,v 1.3 2009/05/25 20:25:56 vauxia Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 56 |
'field' => 'sid', |
'field' => 'sid', |
| 57 |
), |
), |
| 58 |
|
|
| 59 |
// Join to the users table via the send_node table. |
// Join to the send_contact table via the send_contact table. |
| 60 |
|
'send_contact' => array( |
| 61 |
|
'left_field' => 'scid', |
| 62 |
|
'field' => 'scid', |
| 63 |
|
), |
| 64 |
|
|
| 65 |
|
// Join to the users table via the send_contact table. |
| 66 |
'users' => array( |
'users' => array( |
| 67 |
'left_table' => 'send_contact', |
'left_table' => 'send_contact', |
| 68 |
'left_field' => 'scid', |
'left_field' => 'scid', |
| 69 |
'field' => 'scid', |
'field' => 'scid', |
| 70 |
), |
) |
| 71 |
); |
); |
| 72 |
|
|
| 73 |
$data['send']['sid'] = array( |
$data['send']['sid'] = array( |
| 74 |
'title' => t('Send id'), |
'title' => t('Message'), |
| 75 |
'help' => t('The unique id of a send message'), |
'help' => t('The unique id of a send message'), |
| 76 |
'argument' => array( |
'argument' => array( |
| 77 |
'handler' => 'views_handler_argument_numeric', |
'handler' => 'views_handler_argument_numeric', |
| 78 |
|
'name field' => 'subject' |
| 79 |
), |
), |
| 80 |
); |
); |
| 81 |
$data['send']['scid'] = array( // TODO |
/* |
| 82 |
|
$data['send']['scid'] = array( // TODO - now joining scid => uid. |
| 83 |
'title' => t('Sender'), |
'title' => t('Sender'), |
| 84 |
'help' => t('The person who sent the message.'), |
'help' => t('The contact who sent the message.'), |
| 85 |
'relationship' => array( |
'relationship' => array( |
| 86 |
'handler' => 'views_handler_relationship', |
'label' => t('sender'), |
| 87 |
'base' => 'send_contact', |
'title' => t('Sender'), |
| 88 |
'relationship field' => 'scid', |
'help' => t('User information for the contact who sent the message.'), |
| 89 |
'label' => t('Send: Sender'), |
'base' => 'users', |
| 90 |
|
'base field' => 'uid', |
| 91 |
|
), |
| 92 |
|
'argument' => array( |
| 93 |
|
'handler' => 'views_handler_argument_numeric', |
| 94 |
), |
), |
| 95 |
); |
); |
| 96 |
|
*/ |
| 97 |
$data['send']['profile'] = array( |
$data['send']['profile'] = array( |
| 98 |
'title' => t('Profile'), |
'title' => t('Profile'), |
| 99 |
'help' => t('The module that sent the message'), |
'help' => t('The module used to send the message.'), |
| 100 |
'field' => array( |
'field' => array( |
| 101 |
'handler' => 'send_views_handler_field_module', |
'handler' => 'views_handler_field', // TODO with label |
| 102 |
'click sortable' => TRUE, |
'click sortable' => TRUE, |
| 103 |
), |
), |
| 104 |
'filter' => array( |
'filter' => array( |
| 105 |
'handler' => 'send_views_handler_filter_in_operator_module', |
'handler' => 'send_views_handler_filter_in_operator_module', |
| 106 |
|
'options callback' => 'send_profile_names', |
| 107 |
), |
), |
| 108 |
'sort' => array( |
'sort' => array( |
| 109 |
'help' => t('Sort by send module used'), |
'help' => t('Sort by module used to send the message.'), |
| 110 |
'handler' => 'views_handler_sort', |
'handler' => 'views_handler_sort', |
| 111 |
), |
), |
| 112 |
'argument' => array( |
'argument' => array( // TODO with label. |
| 113 |
'help' => t('Filter by the module which sent the message'), |
'help' => t('Filter by the module which sent the message'), |
| 114 |
'handler' => 'views_handler_argument_string', |
'handler' => 'views_handler_argument_string', |
| 115 |
), |
), |
| 131 |
), |
), |
| 132 |
); |
); |
| 133 |
$data['send']['subject'] = array( |
$data['send']['subject'] = array( |
| 134 |
'title' => t('Subject'), |
'title' => t('Message subject'), |
| 135 |
'help' => t('The subject of the sent message'), |
'help' => t('The subject of the sent message'), |
| 136 |
'field' => array( |
'field' => array( |
| 137 |
'handler' => 'views_handler_field', |
'handler' => 'views_handler_field', |
| 138 |
'click sortable' => TRUE, |
'click sortable' => TRUE, |
| 139 |
), |
), |
| 140 |
); |
); |
| 141 |
$data['send']['message'] = array( |
$data['send']['message'] = array( |
| 142 |
'title' => t('Message'), |
'title' => t('Message text'), |
| 143 |
'help' => t('The message which was sent'), |
'help' => t('The message text.'), |
| 144 |
'field' => array( |
'field' => array( |
| 145 |
'handler' => 'views_handler_field', |
'handler' => 'views_handler_field', |
| 146 |
'click sortable' => FALSE, |
'click sortable' => FALSE, |
| 147 |
), |
), |
| 148 |
); |
); |
| 149 |
|
|
| 150 |
|
// The send_node table. |
| 151 |
$data['send_node']['table']['join'] = array( |
$data['send_node']['table']['join'] = array( |
| 152 |
'send' => array( |
'send' => array( |
| 153 |
'field' => 'sid', |
'field' => 'sid', |
| 160 |
'type' => 'inner', |
'type' => 'inner', |
| 161 |
), |
), |
| 162 |
); |
); |
|
/* |
|
|
$data['send_node']['nid'] = array( |
|
|
'title' => t('Message node'), |
|
|
'help' => t('The node contained in a sent message.'), |
|
|
'relationship' => array( |
|
|
'handler' => 'views_handler_relationship', |
|
|
'base' => 'node', |
|
|
'field' => 'nid', |
|
|
'base field' => 'nid', |
|
|
), |
|
|
'argument' => array( |
|
|
'handler' => 'views_handler_argument_numeric', |
|
|
); |
|
|
$data['send_node']['sid'] = array( |
|
|
'title' => t('Message sent'), |
|
|
'help' => t('The message that contained the node.'), |
|
|
'relationship' => array( |
|
|
'handler' => 'views_handler_relationship', |
|
|
'base' => 'send', |
|
|
'field' => 'sid', |
|
|
'base field' => 'sid', |
|
|
), |
|
|
); |
|
|
*/ |
|
| 163 |
|
|
| 164 |
$data['send_contact']['uid'] = array( |
// The send_contact table. |
| 165 |
'title' => t('User id'), |
$data['send_contact']['table']['join'] = array( |
| 166 |
'help' => t('The user id.'), |
'users' => array( |
| 167 |
'relationship' => array( |
'left_field' => 'uid', |
|
'handler' => 'views_handler_relationship', |
|
|
'base' => 'users', |
|
| 168 |
'field' => 'uid', |
'field' => 'uid', |
|
'base field' => 'uid', |
|
| 169 |
), |
), |
| 170 |
); |
); |
| 171 |
|
|
|
/* |
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
| 172 |
$data['send_recipient']['table']['group'] = t('Send'); |
$data['send_recipient']['table']['group'] = t('Send'); |
| 173 |
$data['send_recipient']['table']['join'] = array( |
$data['send_recipient']['table']['join'] = array( |
| 174 |
'node' => array( |
// Join to the send table. |
|
'left_field' => 'nid', |
|
|
'field' => 'nid', |
|
|
'type' => 'inner', |
|
|
), |
|
|
'users' => array( |
|
|
'field' => 'rid', |
|
|
'left_field' => 'uid', |
|
|
'type' => 'inner', |
|
|
), |
|
| 175 |
'send' => array( |
'send' => array( |
| 176 |
'left_field' => 'sid', |
'left_field' => 'sid', |
| 177 |
'field' => 'sid', |
'field' => 'sid', |
| 178 |
|
'type' => 'inner', |
| 179 |
), |
), |
| 180 |
|
|
| 181 |
|
// Join to the users table via the send_contact table. |
| 182 |
|
'users' => array( |
| 183 |
|
'left_table' => 'send_contact', |
| 184 |
|
'left_field' => 'scid', |
| 185 |
|
'field' => 'scid', |
| 186 |
|
) |
| 187 |
); |
); |
| 188 |
$data['send_recipient']['rid'] = array( |
|
| 189 |
|
$data['send_recipient']['scid'] = array( |
| 190 |
'title' => t('Recipient'), |
'title' => t('Recipient'), |
| 191 |
'help' => t('The message recipient'), |
'help' => t('The contact who received the message.'), |
|
'relationship' => array( |
|
|
'base' => 'users', |
|
|
'field' => 'rid', |
|
|
'handler' => 'views_handler_relationship', |
|
|
'label' => t('Send: Recipient'), |
|
|
), |
|
|
); |
|
|
$data['send_recipient']['contact_count'] = array( |
|
|
'title' => t('Recipient count'), |
|
|
'help' => t('The total number of recipients for a message'), |
|
|
'field' => array( |
|
|
'handler' => 'views_handler_field_numeric', |
|
|
'click sortable' => TRUE, |
|
|
), |
|
|
'sort' => array( |
|
|
'handler' => 'views_handler_sort', |
|
|
), |
|
|
); |
|
|
$data['send_recipient']['nid'] = array( |
|
|
'title' => t('Node'), |
|
|
'help' => t('Nodes that have been sent'), |
|
| 192 |
'relationship' => array( |
'relationship' => array( |
| 193 |
'base' => 'node', |
'label' => t('recipient'), |
| 194 |
'field' => 'nid', |
'title' => t('Recipient'), |
| 195 |
'handler' => 'views_handler_relationship', |
'help' => t('User information for the contact who received the message.'), |
| 196 |
'label' => t('Send: Node'), |
'relationship table' => 'users', |
| 197 |
), |
'base' => 'users', |
| 198 |
); |
'relationship field' => 'uid', |
| 199 |
|
'field' => 'scid', |
|
$data['send_node']['table']['group'] = t('Send'); |
|
|
$data['send_node']['table']['join'] = array( |
|
|
'node' => array( |
|
|
'left_field' => 'nid', |
|
|
'field' => 'nid', |
|
|
'type' => 'inner', |
|
|
), |
|
|
'send' => array( |
|
|
'left_field' => 'sid', |
|
|
'field' => 'sid', |
|
|
), |
|
|
); |
|
|
$data['send_node']['send_count'] = array( |
|
|
'title' => t('Count'), |
|
|
'help' => t('Total times sent'), |
|
|
'field' => array( |
|
|
'handler' => 'send_views_handler_field_count', |
|
| 200 |
), |
), |
| 201 |
'sort' => array( |
'argument' => array( |
| 202 |
'help' => t('Sort by total times a node has been sent'), |
'handler' => 'views_handler_argument_numeric', |
|
'handler' => 'send_views_handler_sort_count', |
|
| 203 |
), |
), |
| 204 |
); |
); |
| 205 |
|
|
|
*/ |
|
| 206 |
return $data; |
return $data; |
| 207 |
} |
} |