Hi. I'm using 5.2 and i'm having a big problem.
I added a custom field 'datetime' in
custom/Extension/modules/Cases/Ext/Vardefs/additionaldetailsfromSup_suporte.php
When i do repair/rebuild the field doesn't go to Casevardefs.phpCode:$dictionary["Case"]["fields"]["data_vencimento_c"] = array ( 'required' => '0', 'source' => 'custom_fields', 'name' => 'data_vencimento_c', 'vname' => 'LBL_DATA_VENCIMENTO_C', 'type' => 'datetime', 'massupdate' => '0', 'default' => NULL, 'comments' => '', 'help' => '', 'importable' => 'true', 'duplicate_merge' => 'disabled', 'duplicate_merge_dom_value' => '0', 'audited' => 1, 'reportable' => 0, 'id' => 'Casesdata_vencimento_c', 'custom_module' => 'Cases', );
I also have a Logic hook to update this field on the Database:
/custom/Cases/logic_hooks.php
/modules/Cases/CaseLogicHook.phpCode:<?php // Do not store anything in this file that is not part of the array or the hook version. This file will // be automatically rebuilt in the future. $hook_version = 2; $hook_array = Array(); // position, file, function $hook_array['before_save'] = Array(); $hook_array['before_save'][] = Array(2,'dtvenc', 'modules/Cases/CaseLogicHook.php','CaseLogicHook', 'dtvenc'); $hook_array['before_save'][] = Array(5, 'Cases push feed', 'modules/Cases/SugarFeeds/CaseFeed.php','CaseFeed', 'pushFeed'); ?>
The logic hook work just fine.Code:<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); class CaseLogicHook { function dtvenc(&$focus, $event, $arguments) { global $db; $query = "UPDATE cases_cstm cas SET cas.data_vencimento_c=(SELECT ADDTIME(SUBTIME(c.date_entered,'03:00:00'), (CASE WHEN c.type='Software' THEN (CASE WHEN c.priority='P0' THEN s.slacriressw ELSE (CASE WHEN c.priority='P1' THEN s.slaaltressw ELSE (CASE WHEN c.priority='P2' THEN s.slamedressw ELSE s.slabairessw END) END) END) ELSE (CASE WHEN c.priority='P0' THEN s.slacrireshw ELSE (CASE WHEN c.priority='P1' THEN s.slaaltreshw ELSE (CASE WHEN c.priority='P2' THEN s.slamedreshw ELSE s.slabaireshw END) END) END) END)) " . "from sup_contratosuporte s, sup_contratuporte_cases_c cstm, cases c where s.id=cstm.sup_contra8d4esuporte_ida and c.id=cstm.sup_contra20a5escases_idb and c.deleted=0 and cstm.deleted=0 and s.deleted=0 and c.id= '" . $focus->id . "') " . " where cas.id_c= '" . $focus->id . "'"; $result = $db->query($query, true, 'Error ao atualizar data de vencimento'); } } ?>
When i manualy add the field to Casevardefs.php the logic hook stop working!
Can anyone help my on this one?


LinkBack URL
About LinkBacks




Reply With Quote
Bookmarks