aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2011-09-26 21:24:44 -0300
committerSilvio Rhatto <rhatto@riseup.net>2011-09-26 21:24:44 -0300
commit7bdf5f7a1e9fcdf1888f42ef8e7e92a7bc472fa6 (patch)
tree2fb88ececc48f58cfdfdc3db25f7f2113b43de70
parentb74600a75946c09159d02f39dfe807ee892cdf71 (diff)
downloadmuamba-7bdf5f7a1e9fcdf1888f42ef8e7e92a7bc472fa6.tar.gz
muamba-7bdf5f7a1e9fcdf1888f42ef8e7e92a7bc472fa6.tar.bz2
Fixes and message link
-rw-r--r--muamba.business.inc22
-rw-r--r--muamba.theme.inc7
2 files changed, 15 insertions, 14 deletions
diff --git a/muamba.business.inc b/muamba.business.inc
index 1b40d1b..79fefd1 100644
--- a/muamba.business.inc
+++ b/muamba.business.inc
@@ -26,20 +26,13 @@ function muamba_actions_available($type = 'sent', $status) {
switch ($status) {
case MUAMBA_REQUESTED:
$actions = array(
- MUAMBA_ACCEPTED,
- MUAMBA_REJECTED,
+ MUAMBA_CANCELLED,
);
break;
case MUAMBA_ACCEPTED:
$actions = array(
- MUAMBA_RELEASED,
- );
- break;
-
- case MUAMBA_RETURNED:
- $actions = array(
- MUAMBA_RELEASED,
+ MUAMBA_RETURNED,
);
break;
@@ -51,13 +44,20 @@ function muamba_actions_available($type = 'sent', $status) {
switch ($status) {
case MUAMBA_REQUESTED:
$actions = array(
- MUAMBA_CANCELLED,
+ MUAMBA_ACCEPTED,
+ MUAMBA_REJECTED,
);
break;
case MUAMBA_ACCEPTED:
$actions = array(
- MUAMBA_RETURNED,
+ MUAMBA_RELEASED,
+ );
+ break;
+
+ case MUAMBA_RETURNED:
+ $actions = array(
+ MUAMBA_RELEASED,
);
break;
diff --git a/muamba.theme.inc b/muamba.theme.inc
index 1bec871..b2da534 100644
--- a/muamba.theme.inc
+++ b/muamba.theme.inc
@@ -33,19 +33,20 @@ function theme_muamba_transactions($variables) {
foreach($transactions as $transaction) {
foreach (muamba_actions_available($type, $transaction['status']) as $action) {
$callback = muamba_actions($action);
- $available_actions[] = l(t($callback), $callback);
+ $actions[] = l(t($callback), $callback);
}
$rows[] = array(
'asset' => $transaction['node']->title,
'user' => $transaction['user']->name,
'status' => t(muamba_statuses($transaction['status'])),
- 'available_actions' => implode($available_actions, '|'),
+ 'actions' => implode($actions, ' | '),
+ 'thread' => l(t('view'), 'messages/view/'. $transaction['thread_id']),
);
}
// Make a table for them.
- $header = array(t('Asset'), t('User'), t('Status'), t('Actions'));
+ $header = array(t('Asset'), t('User'), t('Status'), t('Actions'), t('Messages'));
$output .= theme('table', array('header' => $header, 'rows' => $rows));
$output .= '</div>';