diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2011-11-16 15:07:26 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2011-11-16 15:07:26 -0200 |
commit | 8ae3a00a11d55c31de37b35cf6855fd333b0a29a (patch) | |
tree | b6d2b0fb9ff69868c6c96303163d46775eb6e030 | |
parent | fdfe199f9b2b185ce95aa51a5d644be821d87d03 (diff) | |
download | muamba-8ae3a00a11d55c31de37b35cf6855fd333b0a29a.tar.gz muamba-8ae3a00a11d55c31de37b35cf6855fd333b0a29a.tar.bz2 |
Changing muamba_availability_info() behavior due to new muamba_check_availability() argument
-rw-r--r-- | muamba.business.inc | 12 | ||||
-rw-r--r-- | muamba.db.inc | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/muamba.business.inc b/muamba.business.inc index a295667..9aea8ee 100644 --- a/muamba.business.inc +++ b/muamba.business.inc @@ -447,8 +447,7 @@ function muamba_widget($node, $size = 'small') { */ function muamba_availability_info($nid) { global $user; - $available = muamba_check_availability($nid); - $node = node_load($nid); + $node = node_load($nid); if ($node->uid == $user->uid) { $transactions = muamba_current_transactions($nid); @@ -472,12 +471,11 @@ function muamba_availability_info($nid) { } else { $transaction = muamba_current_transactions($nid, $user->uid); + $available = muamba_check_availability($nid, $user->uid); if (!$available) { if (isset($transaction['uid']) && $transaction['uid'] == $user->uid) { - return t('You requested, status is @status', array( - '@status' => t(muamba_statuses($transaction['status'])), - )); + return t('You requested, but it is not available'); } else { return t('No'); @@ -485,7 +483,9 @@ function muamba_availability_info($nid) { } else { if (isset($transaction['uid']) && $transaction['uid'] == $user->uid) { - return t('Yes, you requested'); + return t('Yes, you requested, status is @status', array( + '@status' => t(muamba_statuses($transaction['status'])), + )); } else { return t('Yes'); diff --git a/muamba.db.inc b/muamba.db.inc index 1c1894e..e24492b 100644 --- a/muamba.db.inc +++ b/muamba.db.inc @@ -199,7 +199,7 @@ function muamba_check_availability($data, $uid = NULL) { if (empty($current)) { return TRUE; } - elseif ($uid !== NULL && $current['uid'] == $user->uid) { + elseif ($uid !== NULL && $current[0]->uid == $user->uid) { return TRUE; } |