<?php
/*
  workflows invoke custom function example register file (myexample_register.php)

  this will register a specific method function created in the myexample.inc 
  this method function can then be invoked under: 
   workflows > new condition > new task > invoke custom function

  how to register function:
  in order to register the function, this register file needs to be placed in
   your vtiger root directory, and then you manually need to call it from your
   browser: http://www.mydomain.com/vtiger/myexample_register.php

  warning: you only want to call this register file once...
   everytime you call this register file, it will add the function to the
   vtiger_workflowtasks_entitymethod table in the database, so if you call it
   more than once then it will get added to the database more than once.
   
  to remove a registered method function, you need to manually delete it from the
   vtiger_workflowtasks_entitymethod table in the database.

  $emm->addentitymethod("modulename", "mymethodname", "modules/workflow/myexample.inc", "myexamplefunctionname");
    modulename - valid module names are: contacts, purchaseorder, ???more???
    mymethodname - this is the name that will appear in the drop down list for you to choose from.
    modules/workflow/myexample.inc - the path and filename that contains the method function. 
     if the modules/workflow/ directory does not exist, then just create it!
    mymethodfunctionname - the name of the method function declared in myexample.inc
*/
//die(var_dump("YA CREADO"));

require_once 'include/utils/utils.php';
require 'modules/com_vtiger_workflow/VTEntityMethodManager.inc';
$emm = new vtentitymethodmanager($adb);

//$emm->addentitymethod("Accounts", "Sincronizar Cuentas con ERP", "modules/workflow/Accounts/function_sincronizar_cuentas_erp.inc", "function_sincronizar_cuentas_erp");

//$emm->addentitymethod("Potentials", "Enviar email a todos los usuarios", "modules/workflow/Potentials/function_sendmail_allusers.inc", "function_sendmail_allusers");
//$emm->addentitymethod("Events", "Enviar correo a diseñadores", "modules/workflow/Events/function_sendmail_disenadores.inc", "function_sendmail_disenadores");
//$emm->addentitymethod("Calendar", "Enviar correo a diseñadores", "modules/workflow/Calendar/function_sendmail_disenadores.inc", "function_sendmail_disenadores");
//$emm->addentitymethod("Accounts", "Email Riesgo Crediticio Alto", "modules/workflow/Accounts/function_sendmail_rc_alto.inc", "function_sendmail_rc_alto");
//$emm->addentitymethod("Accounts", "Email Tipo Prospecto", "modules/workflow/Accounts/function_sendmail_tipo_prospecto.inc", "function_sendmail_tipo_prospecto");
//$emm->addentitymethod("Potentials", "Email Nueva Oportunidad", "modules/workflow/Potentials/function_sendmail_new_potential.inc", "function_sendmail_new_potential");
//$emm->addentitymethod("Potentials", "Email Fase Approach", "modules/workflow/Potentials/function_sendmail_fase_approach.inc", "function_sendmail_fase_approach");

//Jeff
//$emm->addEntityMethod("HelpDesk", "Email al Crear", "modules/workflow/HelpDesk/function_sendmail_asignadocuenta.inc", "function_sendmail_asignadocuenta");
//$emm->addEntityMethod("HelpDesk", "Email al cambio de Registrado", "modules/workflow/HelpDesk/function_sendmail_cambioregistrado.inc", "function_sendmail_cambioregistrado");
//$emm->addEntityMethod("HelpDesk", "Email cuando hay cotizacion", "modules/workflow/HelpDesk/function_sendmail_haycotizacion.inc", "function_sendmail_haycotizacion");
//$emm->addEntityMethod("HelpDesk", "Email cuando Cotizacion por Tercero Cambia", "modules/workflow/HelpDesk/function_sendmail_cambiocotizacionportercero.inc", "function_sendmail_cambiocotizacionportercero");
// $emm->addEntityMethod("ModComments", "Add Comment", "modules/workflow/ModComments/addComment.inc", "addComment");

// $emm->addentitymethod("Contacts", "Email Cumpleaños al Asignado", "modules/workflow/Contacts/function_mail_cumpleanios.inc", "function_mail_cumpleanios");

echo 'No workflows !!';

?>