Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
caleeli committed Sep 6, 2019
1 parent 669a946 commit 7ef19e1
Show file tree
Hide file tree
Showing 41 changed files with 62,815 additions and 134 deletions.
2 changes: 1 addition & 1 deletion app/Evaluator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Description of Evaluator
*
* @author davidcallizaya
* @author angela
*/
class Evaluator
{
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/InvalidApiCall.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Description of InvalidApiCall
*
* @author davidcallizaya
* @author angela
*/
class InvalidApiCall extends Exception
{
Expand Down
2 changes: 1 addition & 1 deletion app/Exceptions/NotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* Description of NotFoundException
*
* @author davidcallizaya
* @author angela
*/
class NotFoundException extends Exception
{
Expand Down
2 changes: 1 addition & 1 deletion app/GDrive.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* Description of GDrive
*
* @author davidcallizaya
* @author angela
*/
class GDrive {

Expand Down
2 changes: 1 addition & 1 deletion app/GTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Convierte un documento google docs en una pagina dinamica con vuejs
*
* @author davidcallizaya
* @author angela
*/
class GTemplate
{
Expand Down
50 changes: 50 additions & 0 deletions app/Http/Controllers/DescargaDocumentosController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php

namespace App\Http\Controllers;

use Illuminate\Support\Facades\Storage;

class DescargaDocumentosController extends Controller
{
public function index($tarea)
{
$drive = Storage::drive('tareas');
$list = $drive->allFiles($tarea);
$files = [];
foreach ($list as $file) {
$name = basename($file);
$url = '/documentacion/tareas/' . $file;
if (substr($name, 0, 1) === '.') {
continue;
}
if (substr($file, -5) === '.link') {
$link = json_decode($drive->get($file));
if ($link && $link->url) {
$url = '/descarga_documentos/print?url=' . urlencode($link->url);
} else {
continue;
}
}
$files[] = [
'name' => $name,
'url' => $url,
];
}
return view('descarga_documentos', compact('files'));
}

public function file($fileKey)
{
$file = decrypt($fileKey);
return \Storage::drive('tareas')->download($file);
}

public function printPDF()
{
$path = request('url');
$url = url($path);
$pdf = uniqid(public_path('/storage/', true)) . '.pdf';
exec(env('NODE', 'node') . ' '.base_path('/node_modules/chrome-headless-render-pdf/dist/cli/chrome-headless-render-pdf.js'). ' --url='. escapeshellarg($url) . ' --pdf=' . $pdf);
return redirect('/storage/' . basename($pdf));
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Description of ReportController
*
* @author davidcallizaya
* @author angela
*/
class ReportController extends Controller
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/ReporteFinalHRController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Description of ReporteFinalHRController
*
* @author David Callizaya <davidcallizaya@gmail.com>
* @author angela
*/
class ReporteFinalHRController
{
Expand Down
6 changes: 1 addition & 5 deletions app/Listeners/UserAdministration/TareaSavedListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use App\Models\UserAdministration\Tarea;
use App\Events\UserAdministration\TareaSaved;
use Illuminate\Support\Facades\Storage;

class TareaSavedListener
{
Expand All @@ -29,14 +28,11 @@ public function handle($event)
$hoja = $event->tarea->datos['data'][$paso][$hojaTrabajo];
$titulo = $hoja['titulo'];
$filename = $event->tarea->id . '/' . ($paso + 1) . '/' . $titulo . '.link';
$url = "/vue-editor/download/" . $hoja['templeta'] . "/" . $event->tarea->id . "/" . $paso . "/" . rawurlencode($hojaNombre);
$link = [
"mime" => "application/msword",
"url" => $url,
"url" => "/vue-editor/download/" . $hoja['templeta'] . "/" . $event->tarea->id . "/" . $paso . "/" . rawurlencode($hojaNombre),
];
\App\Http\Controllers\FolderController::saveLink('tareas', $filename, $link);
//$path = Storage::disk('tareas')->getDriver()->getAdapter()->applyPathPrefix($filename);
//\App\ToPDF::toPDF(env('APP_URL') . $url, substr($path, 0, -4) . 'pdf');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Xls2Csv2Db.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description of Xls2Csv2Db
* Require pyton
*
* @author davidcallizaya
* @author angela
*/
class Xls2Csv2Db
{
Expand Down
2 changes: 1 addition & 1 deletion app/Xls2Csv2Db2.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Description of Xls2Csv2Db
* Require pyton
*
* @author davidcallizaya
* @author angela
*/
class Xls2Csv2Db2
{
Expand Down
Loading

0 comments on commit 7ef19e1

Please sign in to comment.