From de0bb0e30a9348c6cea504d43d9b47d7da5a4745 Mon Sep 17 00:00:00 2001 From: stv-beep Date: Fri, 29 Apr 2022 12:05:13 +0200 Subject: [PATCH] 0.9.9 - ui fix create users & cleaning code --- README.md | 10 +- app/Http/Controllers/ActivityController.php | 116 ------------------ app/Http/Controllers/ComandaController.php | 114 +---------------- app/Http/Controllers/InventariController.php | 9 -- app/Http/Controllers/RecepcioController.php | 9 -- .../Controllers/ReoperacionsController.php | 9 -- app/Http/Controllers/ReportsController.php | 8 +- package-lock.json | 4 +- package.json | 2 +- public/js/AdminUsers.js | 6 +- public/js/Comandes.js | 68 +--------- public/js/Inventari.js | 10 +- public/js/Jornada.js | 16 --- public/js/Recepcions.js | 20 +-- public/js/Reoperacions.js | 20 +-- public/js/Reports.js | 23 +--- resources/views/admin/usuaris.blade.php | 20 +-- resources/views/auth/login.blade.php | 2 +- routes/web.php | 12 +- 19 files changed, 50 insertions(+), 428 deletions(-) delete mode 100644 app/Http/Controllers/ActivityController.php diff --git a/README.md b/README.md index d5a6fed..6690fa8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ -# Aplicació per a fitxatges Nath v0.9.8 +# Aplicació per a fitxatges Nath v0.9.9 #### Aleix Algueró, 2022 ## Sobre l'aplicació App per a realitzar fitxatges d'inici i final de jornades i torns a l'empresa, a més de fitxatges de certes tasques concretes de magatzem. Aquests fitxatges (torns, jornades senceres i tasques) podran ser llistats pel propi treballador des de dins de l'aplicació. I l'administrador podrà llistar totes les jornades de tothom i fer consultes des d'una taula dinàmica. A més, l'administrador podrà canviar certs camps dels usuaris, crear-ne de nous i eliminar-los. -Ara mateix, en versió 0.9.8, sembla que té una certa estabilitat. +Ara mateix, en versió 0.9.9, sembla que té una certa estabilitat. + +### Update 0.9.8 +- Correcció de UI a la creació d'usuaris. +- Millora de rendiment. ### Update 0.9.8 - Corregit error de momentjs. @@ -55,7 +59,7 @@ Ara mateix, en versió 0.9.8, sembla que té una certa estabilitat. - Icones d'idioma. -### Errors i bugs (versió 0.9.8) +### Errors i bugs (versió 0.9.9) - La geolocalització no funciona sense HTTPS. - Si s'inicia una tasca i es finalitza molt ràpid (cosa antinatural), es pot arribar a buguejar i deixar penjada una tasca inacabada mentres s'ha començat una de nova. - Desactivant el JS segurament es pot trencar el funcionament dels botons. És possible que es puguen iniciar varies tasques alhora i que el programa perdi la seva funcionalitat de sèrie. diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php deleted file mode 100644 index 0ee87e5..0000000 --- a/app/Http/Controllers/ActivityController.php +++ /dev/null @@ -1,116 +0,0 @@ -task; - if($task <= 4){//pedidos - $tipus = TaskType::where(['tipus' => 'Pedidos'])->get(); - } else if($task >= 5 && $task <= 8){//recepciones - $tipus = TaskType::where(['tipus' => 'Recepciones'])->get(); - } else if($task >= 9 && $task <= 12){//reoperaciones - $tipus = TaskType::where(['tipus' => 'Reoperaciones'])->get(); - } else if($task >= 13 && $task <= 14){//inventario - $tipus = TaskType::where(['tipus' => 'Inventario'])->get(); - } - - //$tipus = TaskType::where(['tipus' => 'Inventario'])->get(); - $tipus = $tipus[0]->id; - - $user = Auth::user(); - //comprovacio de si la jornada esta iniciada - $tornComprovacio = Torn::where(['treballador'=> Auth::id(), 'total'=> null])->latest('updated_at')->first(); - if (!($tornComprovacio == null)){//si la jornada no esta acabada - - //$nomTasca = Tasca::where(['tasca' => 'Compactar'])->get(); - - //$idTasca = $nomTasca[0]->id;//Compactar - - $diaFormat = Carbon::parse(now())->setTimezone('Europe/Madrid')->format('Y-m-d'); - - $horaInici = Carbon::parse(now())->setTimezone('Europe/Madrid')->format('Y-m-d H:i:s'); - $horaFinal = Carbon::parse(now())->setTimezone('Europe/Madrid')->format('Y-m-d H:i:s'); - - - /*nou registre*/ - $Inv1 = Inventari::firstOrNew( - ['treballador'=> Auth::id()], - ['iniciTasca' => $horaInici,'fiTasca' => $horaFinal, 'tasca' => $request->task, 'geolocation' => $request->x, - 'info' => $request->info]//device info - ); - $Inv1->save(); - - //busco l'ultima tasca del treballador creada. Pot ser la de dalt o una ja feta - $ultimaTasca = Inventari::where(['treballador'=> Auth::id()])->latest('id')->first(); - - if($ultimaTasca->iniciTasca == $ultimaTasca->fiTasca){//si es una tasca nomes començada - $invUpdate = Inventari::updateOrCreate( - [/* 'dia'=> $diaFormat, */'treballador'=> Auth::id(),'tasca' => $request->task, 'iniciTasca'=> $ultimaTasca->iniciTasca], - ['tasca' => $request->task, 'dia'=> $diaFormat, 'treballador'=> Auth::id(), 'fiTasca'=> Carbon::parse(now())->setTimezone('Europe/Madrid')->format('Y-m-d H:i:s')] - ); - - $inventari = Inventari::where(['dia'=> $diaFormat, 'treballador'=> Auth::id(), 'tasca' =>$request->task])->latest('id')->first(); - $iniciada = $inventari->iniciTasca; - $acabada = $inventari->fiTasca; - $iniciSegs = strtotime($iniciada); - $acabadaSegs = strtotime($acabada); - $resta = $acabadaSegs - $iniciSegs; - $min = $resta/60; - $hores = $min/60; - $inventari-> total = $min; - $inventari-> fiTasca = $horaFinal; - $inventari->tipusTasca=$tipus;//task type - $inventari->info=$request->info; - $inventari->update(); - //task finished - - } else { - - $newInv = new Inventari(); - $newInv->treballador=Auth::id(); - $newInv->tipusTasca=$tipus;//task type - $newInv->info=$request->info; - $newInv->geolocation=$request->x; - $newInv->tasca=$request->task; - $newInv->dia=$diaFormat; - $hour = Carbon::parse(now())->setTimezone('Europe/Madrid')->format('Y-m-d H:i:s'); - $newInv-> iniciTasca = $hour; - $newInv-> fiTasca = $hour; - $newInv->save(); - $nInv = Inventari::where(['treballador'=> Auth::id(), 'tasca' => $request->task])->latest('id')->first(); - //task started - } - - $tasques = Tasca::all();//inner join per a mostrar el nom de la tasca i no la id - /* SELECT * FROM `pedidos` INNER JOIN tasques ON activitats.tasca = tasques.id - where activitats.id = 127 */ - $tasques = Inventari::join('tasques','activitats.tasca', '=','tasques.id') - ->where(['treballador' => Auth::id(), 'activitats.tipusTasca'=> $tipus]) - ->orderBy('activitats.id','desc')->take(10)->get(); - - return view('activities.inventari',compact('user','tasques')); - } else {//si la jornada no esta iniciada torno false - return response()->json(false, 200); - - } - - } -} diff --git a/app/Http/Controllers/ComandaController.php b/app/Http/Controllers/ComandaController.php index ce44908..a9c73d5 100644 --- a/app/Http/Controllers/ComandaController.php +++ b/app/Http/Controllers/ComandaController.php @@ -18,21 +18,11 @@ class ComandaController extends Controller { /** - * Display a listing of the resource. + * Display a listing of the resource * * @return \Illuminate\Http\Response */ - public function index() - { - - } - - /** - * Show the form for creating a new resource. - * - * @return \Illuminate\Http\Response - */ - public function create() + public function create() /* Tenir en compte que la taula 'activitats' engloba a totes les tasques que es completen */ { $user = Auth::user(); @@ -46,10 +36,6 @@ public function create() ->orderBy('activitats.id','desc')->take(10)->get(); return view('activities.comandes',compact('user','tasques')); - - /* jaseando */ - $tot = Comanda::all(); - return response()->json($tot, 200); } /** @@ -58,7 +44,7 @@ public function create() * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ - public function store(Request $request) + public function store(Request $request)//preparacion pedido { /* task type */ $tipus = TaskType::where(['tipus' => 'Pedidos'])->get(); @@ -111,7 +97,7 @@ public function store(Request $request) $pedido->update(); //task finished - } else { + } else {//si es una tasca acabada, en fem una de nova $nouPedido = new Comanda(); $nouPedido->treballador=Auth::id(); @@ -144,7 +130,7 @@ public function store(Request $request) } - public function storeRevPedido(Request $request){ + public function storeRevPedido(Request $request){//revisio pedido /* task type */ $tipus = TaskType::where(['tipus' => 'Pedidos'])->get(); $tipus = $tipus[0]->id; @@ -395,13 +381,8 @@ public function checkTasques(Request $request){ $user = Auth::user(); //tasca where no hi ha total i per tant no esta acabada - $taskCheck = Comanda::join('tasques','activitats.tasca', '=','tasques.id') ->where(['treballador' => Auth::id()])->latest('activitats.updated_at')->first(); - /* $id = $taskCheck->id; - $task = $taskCheck->tasca; */ - - //$taskCheck = Comanda::where(['treballador'=> Auth::id()])->latest('updated_at')->first(); //si no hi ha tasca ó ja esta acabada if ($taskCheck == null || $taskCheck->total > 0){ @@ -411,89 +392,4 @@ public function checkTasques(Request $request){ } } - - - - /** - * Display the specified resource. - * - * @param int $id - * @return \Illuminate\Http\Response - */ - public function show($id) - { - // - } - - /** - * Show the form for editing the specified resource. - * - * @param int $id - * @return \Illuminate\Http\Response - */ - public function edit($id) - { - // - } - - /** - * Update the specified resource in storage. - * - * @param \Illuminate\Http\Request $request - * @param int $id - * @return \Illuminate\Http\Response - */ - public function update(Request $request, $id) - { - // - } - - /** - * Remove the specified resource from storage. - * - * @param int $id - * @return \Illuminate\Http\Response - */ - public function destroy($id) - { - // - } - - - /* ara mateix ja no s'esta utilitzant degut a que les tasques es poden parar per elles mateixes */ - public function stopPedidos(Request $request){ - $user = Auth::user(); - $horaFinal = Carbon::parse(now())->setTimezone('Europe/Madrid')->format('Y-m-d H:i:s'); - /* s'hauria de parar totes les tasques, pero millor començar per la ultima */ - $tascaUltima = Comanda::where(['treballador'=> Auth::id()])->latest('id')->first(); - if ($tascaUltima->iniciTasca == $tascaUltima->fiTasca){ - $tascaUltima->fiTasca = $horaFinal; - $iniciSegs = strtotime($tascaUltima->iniciTasca); - $acabadaSegs = strtotime($tascaUltima->fiTasca); - $resta = $acabadaSegs - $iniciSegs; - $min = $resta/60; - $hores = $min/60; - $tascaUltima-> total = $min; - $tascaUltima-> fiTasca = $horaFinal; - $tascaUltima->update(); - } - - $tasques = Tasca::all();//s'hauria de fer un inner join per a mostrar el nom de la tasca i no la id - /* SELECT * FROM `pedidos` INNER JOIN tasques ON activitats.tasca = tasques.id - where activitats.id = 127 */ - $pedidos = Comanda::join('tasques','activitats.tasca', '=', 'tasques.id') - ->where(['treballador' => Auth::id()])->orderBy('activitats.id','desc')->take(10)->get();//agafo els 10 ultims - - return view('activities.comandes',compact('user','pedidos','tasques')); - } - - - /* accio inutil ara mateix */ - public function getTasques(Request $request){ - - $tasks = Tasca::select('id','tasca')->get(); - - return response()->json($tasks,200); - } - } diff --git a/app/Http/Controllers/InventariController.php b/app/Http/Controllers/InventariController.php index aa300fd..5774fae 100644 --- a/app/Http/Controllers/InventariController.php +++ b/app/Http/Controllers/InventariController.php @@ -22,11 +22,6 @@ public function index() { $user = Auth::user(); - /* Suposo que la taula de "comandes" hauria de canviar de nom per a englobar totes les tasques - i d'esta forma a cada tasca posar un camp de tipus de tasca per a aixi imprimir lo que toca a cada una. - Aixi, quan s'hagi de comprovar si hi ha alguna tasca inacabada, sera dins de la mateixa taula, i no se - tindra que mirar a cadascuna de les probables taules (comandes, recepcions, reoperacions, inventari) */ - /* task type */ $tipus = TaskType::where(['tipus' => 'Inventario'])->get(); $tipus = $tipus[0]->id; @@ -37,10 +32,6 @@ public function index() ->orderBy('activitats.id','desc')->take(10)->get(); return view('activities.inventari',compact('user','tasques')); - - //jaseando - $tot = Inventari::all(); - return response()->json($tot, 200); } /** diff --git a/app/Http/Controllers/RecepcioController.php b/app/Http/Controllers/RecepcioController.php index 13650a2..7477edb 100644 --- a/app/Http/Controllers/RecepcioController.php +++ b/app/Http/Controllers/RecepcioController.php @@ -22,11 +22,6 @@ public function index() { $user = Auth::user(); - /* Suposo que la taula de "comandes" hauria de canviar de nom per a englobar totes les tasques - i d'esta forma a cada tasca posar un camp de tipus de tasca per a aixi imprimir lo que toca a cada una. - Aixi, quan s'hagi de comprovar si hi ha alguna tasca inacabada, sera dins de la mateixa taula, i no se - tindra que mirar a cadascuna de les probables taules (comandes, recepcions, reoperacions, inventari) */ - /* task type */ $tipus = TaskType::where(['tipus' => 'Recepciones'])->get(); $tipus = $tipus[0]->id; @@ -37,10 +32,6 @@ public function index() ->orderBy('activitats.id','desc')->take(10)->get(); return view('activities.recepcions',compact('user','tasques')); - - //jaseando - $tot = Recepcio::all(); - return response()->json($tot, 200); } /** diff --git a/app/Http/Controllers/ReoperacionsController.php b/app/Http/Controllers/ReoperacionsController.php index 47195bf..27ee7d4 100644 --- a/app/Http/Controllers/ReoperacionsController.php +++ b/app/Http/Controllers/ReoperacionsController.php @@ -22,11 +22,6 @@ public function index() { $user = Auth::user(); - /* Suposo que la taula de "comandes" hauria de canviar de nom per a englobar totes les tasques - i d'esta forma a cada tasca posar un camp de tipus de tasca per a aixi imprimir lo que toca a cada una. - Aixi, quan s'hagi de comprovar si hi ha alguna tasca inacabada, sera dins de la mateixa taula, i no se - tindra que mirar a cadascuna de les probables taules (comandes, recepcions, reoperacions, inventari) */ - /* task type */ $tipus = TaskType::where(['tipus' => 'Reoperaciones'])->get(); $tipus = $tipus[0]->id; @@ -37,10 +32,6 @@ public function index() ->orderBy('activitats.id','desc')->take(10)->get(); return view('activities.reoperacions',compact('user','tasques')); - - //jaseando - $tot = Reoperacio::all(); - return response()->json($tot, 200); } diff --git a/app/Http/Controllers/ReportsController.php b/app/Http/Controllers/ReportsController.php index 13f9777..c07beb9 100644 --- a/app/Http/Controllers/ReportsController.php +++ b/app/Http/Controllers/ReportsController.php @@ -170,7 +170,7 @@ public function createUser(Request $request){ $lastUser = User::where(['username'=> $request->username])->latest()->first(); if ($lastUser != NULL || $lastUser != '[]') { - return response()->json('OK'); + return response()->json(true); } else { return response()->json(['message' => 'error message'], 500); } @@ -182,15 +182,15 @@ public function deleteUser($user){ if ($u->administrador==1){//if administrador $allUsers = User::where(['administrador'=> 1])->get();//all admins if (count($allUsers)<2) {//if only 1 admin, its you and can't delete yourself - return response()->json('no admins'); + return response()->json(false); } else {//if more than one, so you can delete other admin $u->delete(); - return response()->json('OK'); + return response()->json(true); } } else { $u->delete(); - return response()->json('OK'); + return response()->json(true); } diff --git a/package-lock.json b/package-lock.json index 8df4b61..dd7d4eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nath", - "version": "0.9.8", + "version": "0.9.9", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nath", - "version": "0.9.8", + "version": "0.9.9", "dependencies": { "@fortawesome/fontawesome-free": "^5.15.4", "moment": "^2.29.1" diff --git a/package.json b/package.json index 9451e7e..98bcca5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nath", - "version": "0.9.8", + "version": "0.9.9", "private": true, "license" : "MIT License", "scripts": { diff --git a/public/js/AdminUsers.js b/public/js/AdminUsers.js index 8ead8ae..8710e4e 100644 --- a/public/js/AdminUsers.js +++ b/public/js/AdminUsers.js @@ -200,7 +200,7 @@ function modalCreateUser(){ data: $('#createUser').serialize(), success: function( response ) { - if (response == 'OK'){ + if (response == true){ $("#alert-message-create-user").text(msgUserCreated); $("#alert-success-create") @@ -262,7 +262,7 @@ function modalDeleteUser(user) { url: "/deleteUser/"+id, data: {id: id}, success: function( response ) { - if (response == 'OK'){ + if (response == true){ $("#alert-message-delete-user").text(msgUserDeleted); $("#alert-success-delete") .fadeTo(4000, 1000) @@ -274,7 +274,7 @@ function modalDeleteUser(user) { setInterval(function(){ window.location.reload(); }, 500) - } else if (response == 'no admins'){ + } else if (response == false){ $("#alert-danger-message-delete").text(msgUserDeleteAdminError); $("#alert-danger-delete") .fadeTo(4000, 1000) diff --git a/public/js/Comandes.js b/public/js/Comandes.js index 8581945..4fcfba1 100644 --- a/public/js/Comandes.js +++ b/public/js/Comandes.js @@ -62,7 +62,7 @@ function ordersOnLoad(){ /* funcions de COMANDES */ function startPrepComanda() { translateAlerts(); - var c = document.getElementById('o1').value; + var c = document.getElementById('o1').value;//on es guardaran les coordenades $.ajaxSetup({ headers: { @@ -99,10 +99,7 @@ function ordersOnLoad(){ $('.msgNoTask')[0].innerHTML= ''; } $("#tableComandes").load(" #tableComandes"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ prepPedidoCheck.classList.toggle('btn-danger'); var revPedido = document.getElementById("Order2").disabled; @@ -159,9 +156,7 @@ function ordersOnLoad(){ $('.msgNoTask')[0].innerHTML= ''; } $("#tableComandes").load(" #tableComandes"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ revPedidoCheck.classList.toggle('btn-danger'); var prepPedido = document.getElementById("Order1").disabled; @@ -215,9 +210,7 @@ function ordersOnLoad(){ $('.msgNoTask')[0].innerHTML= ''; } $("#tableComandes").load(" #tableComandes"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ expedPedidoCheck.classList.toggle('btn-danger'); var prepPedido = document.getElementById("Order1").disabled; @@ -270,9 +263,7 @@ function ordersOnLoad(){ $('.msgNoTask')[0].innerHTML= ''; } $("#tableComandes").load(" #tableComandes"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ SAFPedidoCheck.classList.toggle('btn-danger'); var prepPedido = document.getElementById("Order1").disabled; @@ -287,52 +278,3 @@ function ordersOnLoad(){ } ) }; - - /** - * funcio que NO S'ESTA UTILITZANT ara mateix - * ja que les tasques es paren amb el mateix boto, - * de moment la deixo per si de cas es necessita en un futur - * @return [type] - */ - function stopComandes(){ - - $.ajax( - { - type: "POST", - url: "/comandes/stop", - data:$('#formStopComandes').serialize(), - success: function( data ) { - - if (document.getElementsByTagName("td")[1].innerHTML.includes("circle-notch")){ - $("#task-message-inici").text("S'ha parat amb èxit."); - $("#alert-success") - .fadeTo(4000, 1000) - .slideUp(1000, function () { - $("#alert-success").slideUp(1000); - }); - $("#tableComandes").load(" #tableComandes"); - window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - } else { - $("#alert-danger-message-final").text("No hi ha cap tasca per a parar."); - $(".cronometro").hide(); - $("#alert-danger") - .fadeTo(4000, 1000) - .slideUp(1000, function () { - $("#alert-danger").slideUp(1000); - }); - } - },//si no s'ha trobat cap registre, retornara error amb alert - error: function(xhr, textStatus, error){ - $("#alert-danger-message-final").text("No hi ha cap tasca per a parar."); - $(".cronometro").hide(); - $("#alert-danger") - .fadeTo(4000, 1000) - .slideUp(1000, function () { - $("#alert-danger").slideUp(1000); - }); - } - } - ) - }; \ No newline at end of file diff --git a/public/js/Inventari.js b/public/js/Inventari.js index 28d2eae..caf0490 100644 --- a/public/js/Inventari.js +++ b/public/js/Inventari.js @@ -96,10 +96,7 @@ function ordersOnLoad(){ $('.msgNoTask')[0].innerHTML= ''; } $("#tableInv").load(" #tableInv"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ compactarCheck.classList.toggle('btn-danger'); var inventariar = document.getElementById("Inv14").disabled @@ -153,10 +150,7 @@ function startInventariar() { $('.msgNoTask')[0].innerHTML= ''; } $("#tableInv").load(" #tableInv"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ inventariarCheck.classList.toggle('btn-danger'); var compactar = document.getElementById("Inv13").disabled diff --git a/public/js/Jornada.js b/public/js/Jornada.js index 8172592..08ddc90 100644 --- a/public/js/Jornada.js +++ b/public/js/Jornada.js @@ -169,19 +169,3 @@ function checkLastTorn(){ }); } - - - - - - - -/* function checkLastTorn(){ - if (document.getElementsByTagName('td')[1] == undefined){ - inic.disabled = !inic; - } else if (document.getElementsByTagName('td')[1].innerHTML == ""){//si no s'ha acabat el torn (i no hi ha total) - f.disabled = !f; - } else if (document.getElementsByTagName('td')[1].innerText.length > 0) { - inic.disabled = !inic; - } -} */ \ No newline at end of file diff --git a/public/js/Recepcions.js b/public/js/Recepcions.js index 14449b6..7d5d0e2 100644 --- a/public/js/Recepcions.js +++ b/public/js/Recepcions.js @@ -103,10 +103,7 @@ function ordersOnLoad(){ $('.msgNoTask')[0].innerHTML= ''; } $("#tableRecep").load(" #tableRecep"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ descargaCheck.classList.toggle('btn-danger'); var entrada = document.getElementById("Recp6").disabled @@ -164,10 +161,7 @@ function ordersOnLoad(){ $('.msgNoTask')[0].innerHTML= ''; } $("#tableRecep").load(" #tableRecep"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ entradaCheck.classList.toggle('btn-danger'); var descarga = document.getElementById("Recp5").disabled @@ -228,10 +222,7 @@ function startControlCalidad() { $('.msgNoTask')[0].innerHTML= ''; } $("#tableRecep").load(" #tableRecep"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ calidadCheck.classList.toggle('btn-danger'); var descarga = document.getElementById("Recp5").disabled @@ -292,10 +283,7 @@ function startUbicar() { $('.msgNoTask')[0].innerHTML= ''; } $("#tableRecep").load(" #tableRecep"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ ubicarCheck.classList.toggle('btn-danger'); var descarga = document.getElementById("Recp5").disabled diff --git a/public/js/Reoperacions.js b/public/js/Reoperacions.js index d92cfe9..c2f0fd9 100644 --- a/public/js/Reoperacions.js +++ b/public/js/Reoperacions.js @@ -102,10 +102,7 @@ function ordersOnLoad(){ $('.msgNoTask')[0].innerHTML= ''; } $("#tableReop").load(" #tableReop"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ lecturaCheck.classList.toggle('btn-danger'); var embolsar = document.getElementById("Reop10").disabled @@ -164,10 +161,7 @@ function startEmbolso() { $('.msgNoTask')[0].innerHTML= ''; } $("#tableReop").load(" #tableReop"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ embolsarCheck.classList.toggle('btn-danger'); var lectura = document.getElementById("Reop9").disabled @@ -226,10 +220,7 @@ function startEtiq() { $('.msgNoTask')[0].innerHTML= ''; } $("#tableReop").load(" #tableReop"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ etiquetarCheck.classList.toggle('btn-danger'); var lectura = document.getElementById("Reop9").disabled @@ -288,10 +279,7 @@ function startOtrosReop() { $('.msgNoTask')[0].innerHTML= ''; } $("#tableReop").load(" #tableReop"); - /* window.setTimeout(function(){ - window.location = "/comandes"; - }, 1500); - */ + /* comprovant si els botons estan disabled o no per a deshabilitarlos o no */ otrosCheck.classList.toggle('btn-danger'); var lectura = document.getElementById("Reop9").disabled diff --git a/public/js/Reports.js b/public/js/Reports.js index 9754883..78f93b1 100644 --- a/public/js/Reports.js +++ b/public/js/Reports.js @@ -24,7 +24,7 @@ $(document).ready(function() { $(this).html( '' ); } ); var table = $('#reports').DataTable( { - dom: 'lBfrtip', //https://datatables.net/examples/basic_init/dom.html + dom: 'lBfrtip', buttons: [ 'copy', 'csv', 'excel', 'pdf', 'print' ], @@ -127,8 +127,6 @@ $(document).ready(function() { } ); - //new $.fn.dataTable.FixedHeader( table ); - $('#btn-reload').on('click', function(){ $('#icon-reload').toggleClass("down"); @@ -626,22 +624,3 @@ function exportTableToExcel(tableID, filename = ''){ downloadLink.click(); } } - - - -/* function html_table_to_excel(div) - { - var data = document.getElementById(div); - - var file = XLSX.utils.table_to_book(data, {sheet: "sheet1"}); - - XLSX.write(file, { bookType: 'xlsx', bookSST: true, 'xlsx': 'base64' }); - - XLSX.writeFile(file, 'file.' + 'xlsx'); - } */ - - /* const export_button = document.getElementById('export_button'); - - export_button.addEventListener('click', () => { - html_table_to_excel('xlsx',div); - }); */ diff --git a/resources/views/admin/usuaris.blade.php b/resources/views/admin/usuaris.blade.php index de5ef84..ca79aa7 100644 --- a/resources/views/admin/usuaris.blade.php +++ b/resources/views/admin/usuaris.blade.php @@ -203,16 +203,6 @@ @enderror - -
- -
- -
- -
-
-
@@ -234,6 +224,16 @@
+
+ +
+ +
+ +
+
+
+ diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index bf8280c..ff9a22c 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -42,7 +42,7 @@
--}} - {{-- deixo la password per si de cas pero ja es pot loguejar sense ella --}} + diff --git a/routes/web.php b/routes/web.php index 0f63394..d69c3a6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -32,7 +32,6 @@ //el home redirigeix al login si no s'està loguejat Route::get('/',[ HomeController::class, 'index']); //HOME -//Route::view('/home','inici'); Route::get('/home', [HomeController::class, 'index'])->name('home'); Route::group(['middleware' => ['auth:sanctum','verified']], function() { //JORNADA @@ -49,8 +48,6 @@ Route::post('/comandes',[ComandaController::class,'store'])->name('comandes.store'); //store Revisio pedido Route::post('/comandes/revisio',[ComandaController::class,'storeRevPedido'])->name('revComandes.store'); -//stop pedidos -Route::post('/comandes/stop',[ComandaController::class,'stopPedidos'])->name('stop.pedidos'); //store expedicio pedidos Route::post('/comandes/expedicio',[ComandaController::class,'storeExpedPedido'])->name('expedComandes.store'); //store saf pedidos @@ -59,8 +56,6 @@ Route::get('/comandes/check',[ComandaController::class,'checkTasques'])->name('check.comandes'); //check torns Route::get('/jornada/check',[TornController::class,'checkTorn'])->name('check.torns'); -//llistar totes les tasques disponibles -Route::get('/tasques',[ComandaController::class, 'getTasques'])->name('get.tasques'); //RECEPCIONS Route::get('/recepcions',[RecepcioController::class,'index'])->name('recepcions.form'); @@ -105,11 +100,6 @@ //delete user Route::delete('/deleteUser/{user}',[ReportsController::class, 'deleteUser'])->name('delete.user'); - -//activities -Route::post('/activity/store',[ActivityController::class,'storeActivity'])->name('activity.store'); - +//language Route::get('/set_language/{lang}', [App\Http\Controllers\Controller::class, 'set_language'])->name('set_language'); App::setLocale("es"); - -//https://www.youtube.com/watch?v=eRYz62Cx0Wg&ab_channel=Inform%C3%A1ticaDP \ No newline at end of file