Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/10/2008, 05:53
Avatar de jerkan
jerkan
 
Fecha de Ingreso: septiembre-2005
Mensajes: 1.607
Antigüedad: 18 años, 7 meses
Puntos: 19
Respuesta: 'No se puede mostrar la página' sólo en IE

En esta función genero la tabla (va dentro de un formulario):
Código php:
Ver original
  1. // function form_presupuesto
  2.        
  3.             private function form_presupuesto(CDBEntidad $oEntidadPedido)
  4.             {  
  5.                 $oEntidadProducto = $this->modulo->getEntidad('producto');
  6.                 $oEntidadProductoExt = $this->modulo->getEntidad('producto_ext');
  7.                 $oEntidadConcepto = $this->modulo->getEntidad('concepto');
  8.                 $this->modulo->load->modelo('pedido');
  9.                 $this->modulo->load->helper('currency');
  10.                
  11.             // formulario presupuesto
  12.                
  13.                 $oForm = new CForm('FormPresupuesto');
  14.                
  15.                 $oForm->setTitle($this->modulo->lang->PRESUPUESTO);
  16.  
  17.                 if( ($cesta_info = $this->modulo->modelo['pedido']->getCestaInfo($oEntidadPedido->getId())) == false )
  18.                 {
  19.                     $this->log->addMessageError($this->root_modulo->lang->ERROR_CARGAR.'('.$this->modulo->lang->PEDIDO.')');
  20.                 }
  21.                 else
  22.                 {
  23.                     $conceptos_editables = in_array($oEntidadPedido->getEstado(), $this->modulo->modelo['pedido']->getEstadosConceptosEditables() );
  24.                    
  25.                 // estado
  26.  
  27.                     if( !$conceptos_editables )
  28.                     {
  29.                         $oForm->select('estado', $this->modulo->lang->PEDIDO_ESTADO, $this->modulo->modelo['pedido']->getEstadoArray(), $oEntidadPedido->getEstado(), true);
  30.                     }
  31.                     //$pedido_estados = $this->modulo->modelo['pedido']->getEstadoArray();
  32.                     //$oForm->static_text('estado', $this->modulo->lang->PEDIDO_ESTADO, $pedido_estados[$oEntidadPedido->getEstado()]);
  33.  
  34.                    
  35.                 // cargamos la plantilla asociada
  36.                
  37.                     $oTemplate = new NokTemplate( $this->modulo->getDirTemplates() );
  38.                    
  39.                     $oTemplate->cargar( 'tpMain', 'common.presupuesto.tpl' );
  40.                    
  41.                     $oTemplate->definirBloque( 'tpForm', 'tpMain');
  42.                     $oTemplate->definirBloque( 'tpFormProducto', 'tpMain');
  43.                     $oTemplate->definirBloque( 'tpFormExtra', 'tpMain');
  44.                    
  45.                     $oTemplate->asignar('NOMBRE_LABEL', $this->modulo->lang->PRODUCTO_NOMBRE);
  46.                     $oTemplate->asignar('PRECIO_LABEL', $this->modulo->lang->PRODUCTO_PRECIO);
  47.                     $oTemplate->asignar('DESCUENTO_LABEL', $this->modulo->lang->PRODUCTO_DESCUENTO.' %');
  48.                     $oTemplate->asignar('CANTIDAD_LABEL', $this->modulo->lang->CONCEPTO_CANTIDAD);
  49.                     $oTemplate->asignar('SUBTOTAL_LABEL', $this->modulo->lang->CESTA_SUBTOTAL);
  50.  
  51.                     foreach( $cesta_info['productos'] as $producto_id => $producto_info )
  52.                     {      
  53.                         if( $conceptos_editables )
  54.                         {
  55.                             $oFormFieldDescuento = new CFormFieldText($oForm, 'descuento['.$producto_id.']', null, false, array('size'=>'6'), $producto_info['descuento'] );
  56.                             $html_descuento = $oFormFieldDescuento->getHtmlField();
  57.                            
  58.                             $oFormFieldCantidad = new CFormFieldText($oForm, 'cantidad['.$producto_id.']', null, false, array('size'=>'6'), $producto_info['cantidad'] );
  59.                             $html_cantidad = $oFormFieldCantidad->getHtmlField();
  60.                         }
  61.                         else
  62.                         {
  63.                             $html_descuento = $producto_info['descuento'] == null ? '-' : $producto_info['descuento'];
  64.                             $html_cantidad = $producto_info['cantidad'];
  65.                         }
  66.                        
  67.                         $oTemplate->asignar('NOMBRE_VALUE', $producto_info['nombre']);
  68.                         $oTemplate->asignar('PRECIO_VALUE', format_currency($producto_info['precio']));
  69.                         $oTemplate->asignar('DESCUENTO_VALUE', $html_descuento);
  70.                         $oTemplate->asignar('CANTIDAD_VALUE', $html_cantidad);
  71.                         $oTemplate->asignar('SUBTOTAL_VALUE', format_currency($producto_info['subtotal']));
  72.                        
  73.                         $oTemplate->expandir('PRODUCTOS', '+tpFormProducto');
  74.                     }
  75.  
  76.                 // encuadernacion
  77.                
  78.                     if( $conceptos_editables )
  79.                     {
  80.                         $oFormFieldEncuadernacion = new CFormFieldText($oForm, 'encuadernacion', null, false, array('size'=>'6'), $cesta_info['encuadernacion'] );
  81.                         $html_encuadernacion = $oFormFieldEncuadernacion->getHtmlField();
  82.                     }
  83.                     else
  84.                     {
  85.                         $html_encuadernacion = $cesta_info['encuadernacion'];
  86.                     }
  87.                    
  88.                     $oTemplate->asignar('EXTRA_LABEL', $this->modulo->lang->CESTA_ENCUADERNACION);
  89.                     $oTemplate->asignar('EXTRA_VALUE', $html_encuadernacion.' '.CLocale::getInstance()->getCurrencySign());
  90.                     $oTemplate->expandir('EXTRAS', '+tpFormExtra');
  91.                    
  92.                     $subtotal += $oEntidadPedido->getAux1();
  93.                        
  94.                 // gastos de envio
  95.                
  96.                     if( $conceptos_editables )
  97.                     {
  98.                         $oFormFieldGastosEnvio = new CFormFieldText($oForm, 'ship_tax', null, false, array('size'=>'6'), $cesta_info['ship_tax'] );
  99.                         $html_gastos_envio = $oFormFieldGastosEnvio->getHtmlField();
  100.                     }
  101.                     else
  102.                     {
  103.                         $html_gastos_envio = $cesta_info['ship_tax'];
  104.                     }
  105.                    
  106.                     $oTemplate->asignar('EXTRA_LABEL', $this->modulo->lang->PEDIDO_SHIP_TAX);
  107.                     $oTemplate->asignar('EXTRA_VALUE', $html_gastos_envio.' '.CLocale::getInstance()->getCurrencySign());
  108.                     $oTemplate->expandir('EXTRAS', '+tpFormExtra');
  109.                    
  110.                 // subtotal
  111.                
  112.                     $oTemplate->asignar('EXTRA_LABEL', $this->modulo->lang->CESTA_SUBTOTAL);
  113.                     $oTemplate->asignar('EXTRA_VALUE', format_currency($cesta_info['subtotal']));
  114.                     $oTemplate->expandir('EXTRAS', '+tpFormExtra');
  115.                    
  116.                 // iva
  117.                
  118.                     $oTemplate->asignar('EXTRA_LABEL', sprintf($this->modulo->lang->PEDIDO_TAX, $this->modulo->config->pedido->tax));
  119.                     $oTemplate->asignar('EXTRA_VALUE', format_currency($cesta_info['tax']));
  120.                     $oTemplate->expandir('EXTRAS', '+tpFormExtra');
  121.                    
  122.                     $subtotal += $tax;
  123.                    
  124.                 // total
  125.                
  126.                     $oTemplate->asignar('EXTRA_LABEL', $this->modulo->lang->CESTA_TOTAL);
  127.                     $oTemplate->asignar('EXTRA_VALUE', '<b>'.format_currency($cesta_info['total']).'</b>');
  128.                     $oTemplate->expandir('EXTRAS', '+tpFormExtra');
  129.                    
  130.                     $oTemplate->expandir('FORM_PRESUPUESTO', 'tpForm');
  131.                
  132.                 // tabla
  133.                
  134.                     $oForm->insert_html($oTemplate->exportar('FORM_PRESUPUESTO'));
  135.                        
  136.                 // botones
  137.                
  138.                     $oForm->input_submit('submit', $this->root_modulo->lang->GUARDAR);
  139.                     $oForm->input_reset('reset', $this->root_modulo->lang->RESTAURAR);
  140.                    
  141.                    
  142.                 // validaciones
  143.                
  144.                     //$oForm->addValidation(new CValidatorCurrency($oFormFieldGastosEnvio));
  145.                     //$oForm->addValidation(new CValidatorCurrency($oFormFieldEncuadernacion));
  146.                 }
  147.                
  148.             // borramos las variables de sesion asociadas
  149.            
  150.                 $oForm->deleteAll();
  151.                
  152.                 return $oForm;
  153.             }
Entiendo que no se entienda puesto que utilizo un framework propio para la aplicación. Cualquier duda, preguntar sin problema.

Aquí la plantilla common.presupuesto.tpl
Código:
<!-- inicioBloque: tpForm -->
<table border="1">
	<tr>
		<td align="center"><b>{NOMBRE_LABEL}</b></td>
		<td align="center"><b>{PRECIO_LABEL}</b></td>
		<td align="center"><b>{CANTIDAD_LABEL}</b></td>
		<td align="center"><b>{DESCUENTO_LABEL}</b></td>
		<td align="center"><b>{SUBTOTAL_LABEL}</b></td>
	</tr>
	{PRODUCTOS}
	{EXTRAS}
</table>
<!-- finBloque: tpForm -->

<!-- inicioBloque: tpFormProducto -->
	<tr>
		<td align="center">{NOMBRE_VALUE}</td>
		<td align="right">{PRECIO_VALUE}</td>
		<td align="center">{CANTIDAD_VALUE}</td>
		<td align="center">{DESCUENTO_VALUE}</td>
		<td align="right">{SUBTOTAL_VALUE}</td>
	</tr>
<!-- finBloque: tpFormProducto -->

<!-- inicioBloque: tpFormExtra -->
	<tr>
		<td align="right" colspan="4"><b>{EXTRA_LABEL}</b></td>
		<td align="right">{EXTRA_VALUE}</td>
	</tr>
<!-- finBloque: tpFormExtra -->