actions_documentfollower.class.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. class ActionsDocumentFollower
  3. {
  4. /**
  5. * Overriding the doActions function : replacing the parent function with the one below
  6. *
  7. * @param array() $parameters Hook metadatas (context, etc...)
  8. * @param CommonObject &$object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
  9. * @param string &$action Current action (if set). Generally create or edit or null
  10. * @param HookManager $hookmanager Hook manager propagated to allow calling another hook
  11. * @return int < 0 on error, 0 on success, 1 to replace standard code
  12. */
  13. function doActions($parameters, &$object, &$action, $hookmanager)
  14. {
  15. $error = 0; // Error counter
  16. $myvalue = 'test'; // A result value
  17. /*
  18. print_r($parameters);
  19. echo "action: " . $action;
  20. print_r($object);
  21. die;
  22. */
  23. if (in_array('documentFollowerEmailTemplateType', explode(':', $parameters['context'])))
  24. {
  25. }
  26. if (!$error)
  27. {
  28. $this->results = array('myreturn' => $myvalue);
  29. $this->resprints = 'A text to show';
  30. return 0; // or return 1 to replace standard code
  31. }
  32. else
  33. {
  34. $this->errors[] = 'Error message';
  35. return -1;
  36. }
  37. }
  38. }