RequerimientoAclaracionController.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <?php
  2. namespace pdf\controllers;
  3. use app\models\OficialiaPartesManifiestoDocumento;
  4. use pdf\web\Controller;
  5. use v1\models\Aclaracion;
  6. use v1\models\FondoLegislativo;
  7. use v1\models\OficialiaPartesDocumento;
  8. use v1\models\OficialiaPartesDocumentoResponsable;
  9. use v1\models\OficialiaPartesManifiesto;
  10. use v1\models\RequisicionResponsable;
  11. use v1\models\Usuario;
  12. use yii\web\HttpException;
  13. use yii\web\NotFoundHttpException;
  14. class RequerimientoAclaracionController extends Controller {
  15. public function actionIndex() {
  16. }
  17. public function actionFormato() {
  18. //$request = \Yii::$app->request;
  19. $configuracion = [
  20. 'mode' => 'utf-8',
  21. 'format' => 'letter',
  22. 'margin_top' => '36',
  23. ];
  24. $view = new \yii\web\View();
  25. $htmlPDF = $view->render("@app/modules/pdf/views/requerimiento-aclaracion/formato", [
  26. "recursoRevision" => [],
  27. ]);
  28. $header = $view->render("@app/modules/pdf/views/header/formato", [
  29. "titulo" => "ACUSE DE SOLICITUD DE INFORMACIÓN PÚBLICA",
  30. ]);
  31. $pdf = self::crearPDF(
  32. 'RA-ISTAIAS-02',
  33. $htmlPDF,
  34. $configuracion,
  35. false,
  36. $header,
  37. '',
  38. ''
  39. );
  40. }
  41. public function actionRespuesta() {
  42. $idAclaracion = trim($this->req->get('aclaracion', ''));
  43. $aclaracion = null;
  44. if ($idAclaracion === '') {
  45. throw new HttpException(400, 'Es necesario proporcionar un ID de aclaración.');
  46. }
  47. $aclaracion = Aclaracion::find()
  48. ->andWhere(["id" => $idAclaracion])
  49. ->andWhere(['eliminado' => null])
  50. ->with('solicitud', 'media')
  51. ->one();
  52. if ($aclaracion === null) {
  53. throw new NotFoundHttpException('No se encontró la aclaración.');
  54. }
  55. $solicitante = Usuario::find()
  56. ->andWhere(['id' => $aclaracion->idSolicitaAclaracion])
  57. ->andWhere(['eliminado' => null])
  58. ->one();
  59. $configuracion = [
  60. 'mode' => 'utf-8',
  61. 'format' => 'letter',
  62. 'margin_top' => '36',
  63. ];
  64. $view = new \yii\web\View();
  65. $htmlPDF = $view->render("@app/modules/pdf/views/requerimiento-aclaracion/respuesta", [
  66. "aclaracion" => $aclaracion,
  67. "solicitante" => $solicitante
  68. ]);
  69. $header = $view->render("@app/modules/pdf/views/header/formato", [
  70. "titulo" => "RESPUESTA DE REQUERIMIENTO DE ACLARACIÓN",
  71. ]);
  72. $pdf = self::crearPDF(
  73. 'RA-ISTAIAS-06',
  74. $htmlPDF,
  75. $configuracion,
  76. false,
  77. $header,
  78. '',
  79. ''
  80. );
  81. }
  82. public function actionOficio() {
  83. $request = \Yii::$app->request;
  84. $configuracion = [
  85. 'mode' => 'utf-8',
  86. 'format' => 'letter',
  87. 'margin_top' => '50',
  88. ];
  89. $view = new \yii\web\View();
  90. $htmlPDF = $view->render("@app/modules/pdf/views/requerimiento-aclaracion/oficio", [
  91. "recursoRevision" => [],
  92. ]);
  93. if ($request->get('header'))
  94. $header = $view->render("@app/modules/pdf/views/header/oficio-landing", [
  95. "titulo" => "ACUSE DE SOLICITUD DE INFORMACIÓN PÚBLICA",
  96. ]);
  97. else
  98. $header = $view->render("@app/modules/pdf/views/header/oficio", [
  99. "titulo" => "ACUSE DE SOLICITUD DE INFORMACIÓN PÚBLICA",
  100. ]);
  101. $pdf = self::crearPDF(
  102. 'AS-ISTAIAS-03',
  103. $htmlPDF,
  104. $configuracion,
  105. false,
  106. $header,
  107. '',
  108. ''
  109. );
  110. }
  111. }