Completely agree with you about complementary currencies, have been wanting to start one for a while. Have just recently sent letters out in my neighbourhood asking everyone if they would be interested in sharing the resources we have. So far, I've had 22 responses out of 200 letters and it keeps on growing. I'm setting up a website at thesharehood.org, which will hopefully be extensible later on so that other small local groups can use the same site. But yeah, your module is perfect for what I want, I've been working making drupal sites for a few years now, and noticed when this came on..

Anyway, I've been editing the module for the past few hours, to make it work for our site..

I tried disabling everything except give, but this doesnt work all that well..

Firstly, even if only one option is available, it still shows a select box, so I've added an if statement to pre_transaction_form() in .module

if (count(_available_transaction_types()) > 1) {
  $form['transaction_type']=array(
    '#type' => 'select',
    '#title' => t('Transaction type'),
    '#required' => TRUE, 
    '#default_value' => TRANSACTION_TYPE_INVOICE,
    '#weight'=> -5,
    '#options'=> $allowed_transactions
  );  
  } else {
	$form['transaction_type']=array(
    '#type' => 'hidden',
	'#value' => $allowed_transactions[0]
	);
  }

and this in edit_transaction_form() in .inc

  if (count(_available_transaction_types()) > 1) {
  $form['transaction_type']=array(
    '#type'=>'select',
    '#title'=>t('Transaction type'),
    '#required' => TRUE, 
    '#default_value' => 1,
    '#weight'=> -5,
    '#options'=> _available_transaction_types(),
  );
  } else {
  $t_types = _available_transaction_types();
  foreach ($t_types as $key=>$value) {
	$t_type = $key;
  }
  $form['transaction_type']=array(
    '#type'=>'hidden',
	'#value'=>$key
  );
  }

There's also the ' Is this transaction completed?' question which I'd rather not have there.. I've gotten rid of it on some forms, but not all strangely, with

function _available_incomplete_transactions() {
	$allowed_transactions = _available_transaction_types();
	if ($allowed_transactions[TRANSACTION_TYPE_INVOICE]) return false;
	if ($allowed_transactions[TRANSACTION_TYPE_PAY]) return false;
	return TRUE;
}

and this IF in transactions_form_alter()

if (_available_incomplete_transactions() == true) {
		  //move the node status checkbox out of the options group and call it 'completed'
	      $form['status']= $form['options']['status'];
	      $form['status']['#title']='Is this transaction completed?';
	      $form['status']['#weight']= 4;
	      unset($form['options']['status']);
	  }
      unset ($form['buttons']['preview']);

and this in theme_balances()

 if (_available_incomplete_transactions() == TRUE) {
	$html .= "\n<tr><td>".t('Pending Balance').'</td><td>'. theme('money', $turnover, $currency) . '</td></tr>';
  }

because even when there are only the permissions for give, the whole system is still really designed around there being incomplete transactions I think..

I haven't gotten all the way through the files yet, may be other things too I think.

And you're right, the grading system goes away if you delete the qualities. excellent. I just came up with an elaborate unnecessary way of choosing the grading system or not the grading system, but never mind...

And fair enough about the per-user transaction limit, I can see that it would be a hassle and something probably for much later..

With the description length, I changed the IF in transactions_validate() to

  if (strlen($node->title) < 3) {

Comments

matslats’s picture

Can you write to me using the contact form (your contact form is not enabled). I'd like to hear more about your project. Also this issue queue is doesn't seem the place for a potentially wide ranging discussion.
I'm busy this week, but look forward to responding to all these matters at the weekend.

Some of these changes you're making should be re-coded into configuration options. I hope you're keeping track of them.
There's a difference between the 'are-you-sure' page and the other-user confirmation. I think the are-you-sure page is generally a good idea.

Your _available_incomplete_transactions() doesn't feel right to me. If it doesn't work not to permit payments and invoices then better to fix that. I haven't had time to look at that yet.

It's very gratifying to have someone else contributing!

matslats’s picture

Status: Active » Closed (fixed)