return;
}
elseif (!$available && $transactions['uid'] != $user->uid) {
- $content .= theme('image',
- array(
- 'path' => $path .'/images/unavailable.png',
- 'alt' => t('Item unavailable'),
- 'title' => t('Item unavailable'),
- )
- );
+ if (variable_get('muamba_allow_request_unavailable', FALSE) == TRUE) {
+ $content .= theme('muamba_widget_icon', array(
+ 'status' => MUAMBA_REQUESTED,
+ 'id' => $node->nid,
+ 'size' => $size,
+ ));
+ }
+ else {
+ $content .= theme('image',
+ array(
+ 'path' => $path .'/images/unavailable.png',
+ 'alt' => t('Item unavailable'),
+ 'title' => t('Item unavailable'),
+ )
+ );
+ }
}
elseif ($transactions['uid'] == $user->uid) {
$content .= theme('muamba_widget_requester', array(
'#type' => 'checkbox',
'#title' => t('Reject all pending requests upon acceptance'),
'#default_value' => variable_get('muamba_reject_all_on_accept', FALSE),
- '#description' => t('Cancel all other requests of an item upon acceptance'),
+ '#description' => t('Cancel all other requests of an item upon acceptance.'),
+ );
+
+ $form['muamba_allow_request_unavailable'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Allow request of unavailable items'),
+ '#default_value' => variable_get('muamba_allow_request_unavailable', FALSE),
+ '#description' => t('Makes possible users request items that are not currently available.'),
);
return system_settings_form($form);
*/
function muamba_request($nid) {
global $user;
- $nid = (int) $nid;
- $node = node_load($nid);
+ $nid = (int) $nid;
+ $node = node_load($nid);
+ $allow_unavailable = variable_get('muamba_allow_request_unavailable', FALSE);
// Access check
if (!muamba_has_request_access($node)) {
}
// Check if the item is available
- if (!muamba_check_availability($nid)) {
+ if (!muamba_check_availability($nid) && $allow_unavailable == FALSE) {
return t('Item not available');
}