<?php
class eventclass_derecho_propietario_2  extends TableEventsBase {
	
	function init() {
		$this->events = array(
			'BeforeAdd' => true,
			'OnPageLoad' => true,
			'BeforeMoveNextList' => true 
		);
		$this->fieldValues = array(
			'filterLimit' => array(
				 
			),
			'mapIcon' => array(
				 
			),
			'viewCustom' => array(
				 
			),
			'lookupWhere' => array(
				 
			),
			'viewFileText' => array(
				 
			),
			'defaultValue' => array(
				'fecha_Emision' => array(
					'edit' => true 
				),
				'responsable' => array(
					'edit' => true 
				),
				'responsable_devolucion' => array(
					'edit' => true 
				) 
			),
			'autoUpdateValue' => array(
				'fecha_Emision' => array(
					'edit' => true 
				),
				'responsable' => array(
					'edit' => true 
				),
				'responsable_devolucion' => array(
					'edit' => true 
				) 
			),
			'uploadFolder' => array(
				 
			),
			'viewPluginInit' => array(
				 
			),
			'editPluginInit' => array(
				 
			) 
		);
			}
		function BeforeAdd( &$values, &$sqlValues, &$message, $inline, $pageObject ) {
			
	
	
	$values["total_bs"] = 100 * $values["nro_Acciones_2"];
	$values["total_acumulado"] = $values["sub_total_acciones"] +  $values["nro_Acciones_2"];
	
	require __DIR__ . '/../app/number/convert3.php';
	
	
	
	
	return true;
			;
			return true;
		}
	
		function BeforeMoveNextList( &$data, &$row, &$record, $recordId, $pageObject ) {
			// Place event code here.
	// Use "Add Action" button to add code snippets.
	
	
	
	if ($data ["estado_titulo"] == '67')
	{
	$pageObject->hideItem("custom_button", $recordId);
	$pageObject->hideItem("custom_button1", $recordId);
	$pageObject->hideItem("custom_button3", $recordId);
	$pageObject->hideItem("grid_edit", $recordId);
	
	}
	
	
	
	if ($data ["estado_titulo"] == '64')
	{
	
	$pageObject->hideItem("custom_button4", $recordId);
	
	$pageObject->hideItem("grid_edit", $recordId);
	
	}
	
	
	
	else {
	$pageObject->showItem("custom_button");
	}
	
	
	// Place event code here.
	// Use "Add Action" button to add code snippets.
			;
			
		}
	public function default_fecha_Emision_efedit(  ) {
		$defaultValue = now();
		return $defaultValue;
	}
	
	public function autoupdate_fecha_Emision_efedit(  ) {
		$defaultValue = now();
		return $defaultValue;
	}
	
	public function default_responsable_efedit(  ) {
		$defaultValue = $_SESSION['user_id'];
		return $defaultValue;
	}
	
	public function autoupdate_responsable_efedit(  ) {
		$defaultValue = $_SESSION['user_id'];
		return $defaultValue;
	}
	
	public function default_responsable_devolucion_efedit(  ) {
		$defaultValue = $_SESSION['user_id'];
		return $defaultValue;
	}
	
	public function autoupdate_responsable_devolucion_efedit(  ) {
		$defaultValue = $_SESSION['user_id'];
		return $defaultValue;
	}	

}


?>