<commit_before><?php
  require_once ('data/SugarBean.php');
  require_once('custom/include/AvisosAdmin.php');


  class AccionesGuardadoEvento {

    protected static $fetchedRow = array();
    /**
     * Called as before_save logic hook to grab the fetched_row values
     */
    public function saveFetchedRow($bean, $event, $arguments) {
      if ($bean -> fetched_row) {
        self::$fetchedRow[$bean -> id] = $bean -> fetched_row;
      }
    }

    public function CreacionEventoD(&$bean, $event, $arguments) {

      //Creación
      if (!isset($bean -> ignore_update_c) || $bean -> ignore_update_c === false) {

        $AvisosAdmin= new AvisosAdmin();
        $AvisosAdmin->enviaCorreo(AvisosAdmin::CREACION_EVENTO,'',$bean->name,$bean->fecha_celebracion);

        //Modificacion
      }else{

      }
    }

    function ActualizarRel(&$bean, $event, $arguments) {

      if (!isset($bean -> ignore_update_c) || $bean -> ignore_update_c === false) {
        //logic goes here;

        $fran= new Expan_Franquicia();
        $fran->retrieve($arguments[related_bean]->id);

        if ($fran->tipo_cuenta==1 || $fran->tipo_cuenta==2){
          $AvisosAdmin= new AvisosAdmin();
          $AvisosAdmin->enviaCorreo(AvisosAdmin::SALIDA_PORTAL,$fran->name,$bean->name,$bean->fecha_celebracion);
        }
      }
    }

  }
?><commit_msg>#8574 mal definido la forma de comprobar si es nuevo o una modificacion<commit_after><?php
  require_once ('data/SugarBean.php');
  require_once('custom/include/AvisosAdmin.php');


  class AccionesGuardadoEvento {

    protected static $fetchedRow = array();
    /**
     * Called as before_save logic hook to grab the fetched_row values
     */
    public function saveFetchedRow($bean, $event, $arguments) {
      if ($bean -> fetched_row) {
        self::$fetchedRow[$bean -> id] = $bean -> fetched_row;
      }
    }

    public function CreacionEventoD(&$bean, $event, $arguments) {
      if (!isset($bean -> ignore_update_c) || $bean -> ignore_update_c === false) {

        $bean->ignore_update_c = true;

        //Creacion de una nuevo Evento
        if (!isset(self::$fetchedRow[$bean->id])) {
          $AvisosAdmin= new AvisosAdmin();
          $AvisosAdmin->enviaCorreo(AvisosAdmin::CREACION_EVENTO,'',$bean->name,$bean->fecha_celebracion);
        //Modificacion
        }else {

        }
      }
    }

    function ActualizarRel(&$bean, $event, $arguments) {

      if (!isset($bean -> ignore_update_c) || $bean -> ignore_update_c === false) {
        //logic goes here;

        $fran= new Expan_Franquicia();
        $fran->retrieve($arguments[related_bean]->id);

        if ($fran->tipo_cuenta==1 || $fran->tipo_cuenta==2){
          $AvisosAdmin= new AvisosAdmin();
          $AvisosAdmin->enviaCorreo(AvisosAdmin::SALIDA_PORTAL,$fran->name,$bean->name,$bean->fecha_celebracion);
        }
      }
    }

  }
?>
{'fraction_non_alphanumeric': 0.15307185005206525, 'fraction_numerical': 0.0027768136063866713, 'mean_word_length': 2.9051490514905147, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1665459', 'n_tokens_mistral': 1000, 'n_tokens_neox': 958, 'n_words': 168}