Plugin Directory

Changeset 2943728

Timestamp:
07/26/2023 02:00:36 PM (12 months ago)
Author:
renzotejada
Message:

fix:v0.1.8

Location:
libro-de-reclamaciones-y-quejas
Files:
748 added
4 edited

Legend:

Unmodified
Added
Removed
  • libro-de-reclamaciones-y-quejas/trunk/README.txt

    r2829501 r2943728  
    11=== Libro de Reclamaciones y Quejas ===
    2 Contributors: renzotejada, drplugins
     2Contributors: renzotejada
    33Tags: libro de reclamaciones, libro de reclamaciones peru, libro de reclamaciones wordpress, libro de reclamaciones plugin
    44Requires at least: 5.2
    5 Tested up to: 6.1.1
     5Tested up to: 6.
    66Stable tag: trunk
    77Requires PHP: 5.6
     
    7979== Changelog ==
    8080
     81
     82
     83
     84
     85
     86
    8187= 0.1.7 (06/12/2022) =
    8288Fix: validando versión WC 7.1.0
  • libro-de-reclamaciones-y-quejas/trunk/libro_admin.php

    r2500273 r2943728  
    4545    <?php
    4646    $listado = rt_libro_lrq_get_all_reclamos(1);
     47
     48
     49
    4750
    4851    if ($listado) {
     
    6063        print "<th style='text-align:center'>".__('Clients order', 'rt-libro')."</th>";
    6164        print "<th style='text-align:center'>".__('Reclaimed amount', 'rt-libro')."</th>";
     65
    6266        print "</tr>";
    6367        print "</thead>";
     
    7680            print "<td style='text-align:center'><button class='button button-primary' onclick=\"jQuery('#detallesolicitud_texto').val('" . str_replace("\r", "", str_replace("\n", '\n', str_replace('"', '&quot;', str_replace("'", '\x27', $row['pedido_cliente'])))) . "');jQuery('#detallesolicitud').show();\">Ver</button></td>";
    7781            print "<td style='text-align:center'>" . $row['monto_reclamado'] . "</td>";
     82
     83
     84
     85
     86
    7887            print "</tr>";
    7988        }
     
    437446
    438447        <h2 class="nav-tab-wrapper">
    439             <a href="?page=libro_settings&tab=home" class="nav-tab <?php
     448            <a href="?page=libro_settings" class="nav-tab <?php
    440449            if ((!isset($_REQUEST['tab'])) || ($_REQUEST['tab'] == "home")) {
    441450                print " nav-tab-active";
  • libro-de-reclamaciones-y-quejas/trunk/libro_shortcode.php

    r2815410 r2943728  
    11<?php
     2
     3
     4
     5
     6
     7
     8
    29add_filter('template_include', 'rt_libro_lrq_reclamacion_template');
    310
     
    2532
    2633    if ($libro_id) {
    27         rt_libro_lrq_enviar_mail_libro_reclamacion($libro_data);
     34        $filepath = rt_libro_lrq_crear_pdf_libro_reclamacion($libro_data, $libro_id);
     35        rt_libro_lrq_enviar_mail_libro_reclamacion($libro_data, $libro_id, $filepath);
    2836    } else {
    2937        $libro_id = 0;
     
    5260}
    5361
    54 function rt_libro_lrq_enviar_mail_libro_reclamacion($libro_data)
    55 {
    56     // Email para el administradora
    57     $subject = __('Claim sent from', 'rt-libro') .' ' . get_option('blogname');
    58     $subject = __('Claims Book Registry', 'rt-libro');
    59     $message = __('A new complaint / complaint was registered.', 'rt-libro');
    60     $headers = __('From: ', 'rt-libro') .' '. $libro_data['nombre'] . ' <' . $libro_data['email'] . '>' . "\r\n";
    61     $mailResult = wp_mail(get_option('admin_email'), $subject, $message, $headers);
    62     // Email para el usuario
     62function rt_libro_lrq_crear_pdf_libro_reclamacion($libro_data, $libro_id)
     63{
     64    $dompdf = new Dompdf();
     65    $wp_upload_dir = wp_upload_dir() ;
     66    $upload_dir = $wp_upload_dir['basedir'] . '/libro-pdfs';
     67    ob_start();
     68    include ( WP_PLUGIN_DIR . '/libro-de-reclamaciones-y-quejas/template/rt-libro-pdf.php');
     69    $view = ob_get_contents();
     70    ob_get_clean();
     71    $dompdf->loadHtml($view);
     72    $dompdf->render();
     73    $pdf = $dompdf->output();
     74    wp_mkdir_p($upload_dir);
     75    $filename = $upload_dir . '/libro-' . $libro_id . ".pdf";
     76    file_put_contents($filename, $pdf);
     77    return $filename;
     78}
     79
     80function rt_libro_lrq_enviar_mail_libro_reclamacion($libro_data, $libro_id, $filename)
     81{
     82    // Email para el usuario y admin
    6383    $message_user = __('Dear:', 'rt-libro') . " " ." {$libro_data['nombre']}  {$libro_data['apellido_paterno']} ,\r\n\r\n".__('Thank you very much for leaving us your opinion about our services.', 'rt-libro')."\r\n\r\n".__('Your claim has been successfully received.', 'rt-libro');
     84
    6485    $message_user .= "\r\n\r\n".__('Name', 'rt-libro') .": ". $libro_data['nombre'];
    6586    $message_user .= "\r\n\r\n".__('First Lastname', 'rt-libro') .": ". $libro_data['apellido_paterno'];
     
    95116
    96117    $message_user .= "\r\n\r\n".__('Atte.', 'rt-libro')." \r\n\r\n". get_option('blogname');
    97     $headers = __('From: ', 'rt-libro') .' '. get_option('blogname') . ' <'.get_option('admin_email').'>' . "\r\n";
    98     wp_mail($libro_data['email'], __('We have received your claim', 'rt-libro'), $message_user, $headers);
     118    $headers[] = __('From: ', 'rt-libro') .' '. get_option('blogname') . ' <'.get_option('admin_email').'>' . "\r\n";
     119    $headers[] = 'Cc: <'.get_option('admin_email').'>' . "\r\n";
     120    wp_mail($libro_data['email'], __('We have received your claim', 'rt-libro'), $message_user, $headers,$filename);
    99121}
    100122
  • libro-de-reclamaciones-y-quejas/trunk/rt-libro-reclamaciones.php

    r2829501 r2943728  
    1010 * Plugin URI:      https://renzotejada.com/libro-de-reclamaciones-y-quejas/
    1111 * Description:     Online complaints book is a document through which a consumer can record a complaint regarding a product or service that he has purchased.
    12  * Version:         0.1.7
     12 * Version:         0.1.
    1313 * Author:          Renzo Tejada
    1414 * Author URI:      https://renzotejada.com/
     
    1919 * Requires at least: 5.6
    2020 * Requires PHP:      5.6.20
    21  * WC tested up to:   7.1.0
     21 * WC tested up to:   7.
    2222 * WC requires at least: 2.6
    2323 */
     
    7474 * ADMIN
    7575 */
    76 
    7776require dirname(__FILE__) . "/libro_admin.php";
    7877
     
    8079 * SHORTCODE
    8180 */
    82 
    8381require dirname(__FILE__) . "/libro_shortcode.php";
    8482
Note: See TracChangeset for help on using the changeset viewer.