Permalink
Browse files
Arreglos a css, y mas testeo
- Loading branch information...
|
@@ -164,9 +164,12 @@ def lista_aprobaciones(format = "%d de %B %Y, %H:%M:%S") |
|
|
usuarios = Usuario.all(:conditions => {:id => usuarios})
|
|
|
lista = []
|
|
|
fechas.each do |fecha|
|
|
|
+ begin
|
|
|
lista << {:fecha => (I18n.l fecha, :format => format),
|
|
|
:usuario => usuarios.find{|v| self.aprobaciones[fecha][:usuario_id] == v.id}.nombre_completo,
|
|
|
:estado => @@estados[self.aprobaciones[fecha][:estado]][1]}
|
|
|
+ rescue
|
|
|
+ end
|
|
|
end
|
|
|
lista
|
|
|
end
|
|
@@ -183,6 +186,9 @@ def lista_modificaciones |
|
|
lista = []
|
|
|
# Se prepara un array con un detalle de lo que existe en cada modificación
|
|
|
self.solicitud_modificaciones.each do |mod|
|
|
|
+ # Es necesario manejar la exepcion debido a que pueden haber hecho modificaciones
|
|
|
+ # en la base de datos directamente sin hacer uso de la aplicación
|
|
|
+ begin
|
|
|
lista << {
|
|
|
:usuario => usuarios.find{|v| v.id == mod.usuario_id}.nombre_completo,
|
|
|
:descripcion => mod.descripcion,
|
|
@@ -193,6 +199,8 @@ def lista_modificaciones |
|
|
{:item => item.to_s, :unidad_medida => item.unidad_medida.to_s, :cantidad => v[:cantidad]}
|
|
|
end
|
|
|
}
|
|
|
+ rescue
|
|
|
+ end
|
|
|
end
|
|
|
lista
|
|
|
end
|
|
|
|
@@ -20,4 +20,10 @@ def current_user |
|
|
UsuarioSession.find.record
|
|
|
end
|
|
|
|
|
|
+ # Retorna la lista de modificaciones realizada al detale
|
|
|
+ # de una solicitud
|
|
|
+ def lista_detalle
|
|
|
+
|
|
|
+ end
|
|
|
+
|
|
|
end
|
|
|
@@ -0,0 +1,7 @@ |
|
|
+class TestModel < ActiveRecord::Base
|
|
|
+
|
|
|
+
|
|
|
+ def to_s
|
|
|
+ self.name
|
|
|
+ end
|
|
|
+end
|
|
@@ -5,11 +5,14 @@ |
|
|
<head>
|
|
|
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
|
|
|
<title><%= yield :title %> - Sistema de Almacenes</title>
|
|
|
- <%= stylesheet_link_tag "style.css", "../javascripts/jquery-ui/themes/darkness/ui.all.css"%>
|
|
|
+
|
|
|
+ <%= stylesheet_link_tag "style.css", "../javascripts/jquery-ui/themes/darkness/ui.all.css" %>
|
|
|
+ <%= stylesheet_link_tag "../javascripts/jquery.flexselect-0.2/flexselect.css" %>
|
|
|
+
|
|
|
<%= javascript_include_tag "jquery-1.3.2.min.js", "jquery-ui/jquery-ui-1.7.1.custom.min.js",
|
|
|
"application.js", "jquery-ui/ui/i18n/ui.datepicker-es.js", "grider/grider.js" %>
|
|
|
-<%= javascript_include_tag "jquery.flexselect-0.2/liquidmetal.js", "jquery.flexselect-0.2/jquery.flexselect" %>
|
|
|
-<%= stylesheet_link_tag "../javascripts/jquery.flexselect-0.2/flexselect.css" %>
|
|
|
+ <%= javascript_include_tag "jquery.flexselect-0.2/liquidmetal.js",
|
|
|
+ "jquery.flexselect-0.2/jquery.flexselect" %>
|
|
|
|
|
|
</head>
|
|
|
<body>
|
|
|
|
@@ -48,8 +48,7 @@ |
|
|
|
|
|
<script type="text/javascript">
|
|
|
$(document).ready(function(){
|
|
|
- <% @json = {}%>
|
|
|
- <% @items.each{|v| @json[v.id] = "#{v.unidad_medida.nombre} (#{v.unidad_medida.abreviacion})"} %>
|
|
|
+ <% @json = @items.inject({}){|arr, v| arr[v.id] = "#{v.unidad_medida.nombre} (#{v.unidad_medida.abreviacion})"; arr} %>
|
|
|
var itemUnidades = <%= @json.to_json %>;
|
|
|
|
|
|
|
|
@@ -61,7 +60,9 @@ $(document).ready(function(){ |
|
|
val = $('#item').val();
|
|
|
var init = <%= @solicitud.solicitud_detalles.first.item_id.nil? ? false : true %>;
|
|
|
|
|
|
- elementos = {}
|
|
|
+ // Elementos seleccionados, en caso de edición es necesario tener el listado
|
|
|
+ elementos = <%= @solicitud.solicitud_detalles.inject({}){|hash, v| hash[v.item_id] = true; hash}.to_json %>;
|
|
|
+
|
|
|
$('#item_flexselect').focus(function(){
|
|
|
var tmp = $('#item').val();
|
|
|
if(val != tmp && !elementos[tmp + ""]) {
|
|
|
|
|
@@ -1,9 +1,8 @@ |
|
|
-<% content_for :title do %>}
|
|
|
+<% content_for :title do %>
|
|
|
Editar solicitud
|
|
|
<% end %>
|
|
|
<h1>Editar Solicitud</h1>
|
|
|
<%= render :partial => "forma" %>
|
|
|
<%= link_to "Listado", solicitudes_path(:page => @page) %>
|
|
|
<%= link_to "Ver", solicitud_path(@solicitud) %>
|
|
|
|
|
|
-
|
|
@@ -30,6 +30,7 @@ Ver Solicitud |
|
|
<li><%= link_to "Rechazar", send("#{@estado[:ruta]}_solicitud_path", @solicitud), :class => "rechazar estados" %></li>
|
|
|
</ul>
|
|
|
<% end %>
|
|
|
+
|
|
|
<br/><br/>
|
|
|
|
|
|
<a href="#" id="a_detalle" class="bold icon-r mas">Mostrar detalle</a>
|
|
|
|
@@ -82,8 +82,8 @@ def gem_version |
|
|
end
|
|
|
|
|
|
def load_rubygems
|
|
|
+ min_version = '1.3.2'
|
|
|
require 'rubygems'
|
|
|
- min_version = '1.3.1'
|
|
|
unless rubygems_version >= min_version
|
|
|
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
|
|
exit 1
|
|
|
|
|
@@ -1,7 +1,7 @@ |
|
|
# Be sure to restart your server when you modify this file
|
|
|
|
|
|
# Specifies gem version of Rails to use when vendor/rails is not present
|
|
|
-RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
|
|
|
+RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION
|
|
|
|
|
|
# Bootstrap the Rails environment, frameworks, and default configuration
|
|
|
require File.join(File.dirname(__FILE__), 'boot')
|
|
|
Oops, something went wrong.
0 comments on commit
0d4151d