Subversion Repositories wpShopGermany4

Rev

Rev 7258 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
        
        /**
         * Template für die Integration des Anschreiben Moduls in die Bestellverwaltung
         */

?>
        
<?php echo wpsg_drawForm_AdminboxStart(__('Anschreiben', 'wpsg'));?>

        <?php if (sizeof($this->view['mod_coverletter']['arCoverLetter']) == 0 ) { ?>
           
                <p><?php echo __('Bisher kein Anschreiben für diese Bestellung geschrieben.', 'wpsg'); ?></p>
           
        <?php } else { ?>

                <?php foreach ($this->view['mod_coverletter']['arCoverLetter'] as $a) { ?>
        
                        <div class="wpsg_flex wpsg_flex_justify_content_space_between">
                                <span>
                                        <?php echo wpsg_translate(__('#2#: Anschreiben ##1#', 'wpsg'), $a['id'], wpsg_formatTimestamp(strtotime($a['cdate']))); ?>: <?php echo ((strlen($a['text']) > 50)?substr($a['text'],0,50).' ...':$a['text']); ?>
                                </span>
                                <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_coverletter&noheader=1&action=ajax&order_id=<?php echo $a['order_id']; ?>&cl_id=<?php echo $a['id']; ?>&wpsg_mod_coverletter_get" target="_new">
                                        <?php echo __('Download', 'wpsg'); ?>
                                </a>
                        </div>
                
                <?php } ?>
                
        <?php } ?>
                
        <br />
        
        <div class="wpsg_clear"></div>
        
        <hr />
        
        <div class="inside">                                            
                <div>
                        
                        <form target="_blank" method="post" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&mod=wpsg_mod_coverletter&edit_id=<?php echo $this->view['data']['id']; ?>&action=ajax&noheader=1" id="wpsg_mod_coverletter_form">      

                                <?php $arShopLocations = $this->getShopLocations(); ?>
                                <?php $arShopLocationLabels = []; foreach ($arShopLocations as $l_id => $l) $arShopLocationLabels[$l_id] = $l['label']; ?>
                                
                                <?php if (sizeof($arShopLocations) > 1) { ?>
                                        
                                        <?php echo wpsg_drawForm_Select('target', __('Shop Adresse', 'wpsg'), $arShopLocationLabels, '1'); ?>
                                        
                                <?php } else { ?>
                                        
                                        <input type="hidden" name="target" value="1" />
                                        
                                <?php } ?>

                                <?php echo wpsg_drawForm_Textarea('text', __('Text', 'wpsg'),'', ['noLabel' => true, 'fullLabel' => __('Text für das Anschreiben', 'wpsg'), 'style' => 'height:200px']); ?>
                                
                                <br />
                                
                                <input type="submit" name="wpsg_mod_coverletter_write" value="<?php echo __("Speichern & Drucken", "wpsg"); ?>" style="float:left;" class="button button-primary" />
                                <input type="submit" name="wpsg_mod_coverletter_preview" onclick="wpsg_form_refresh = false;" value="<?php echo __('Vorschau', 'wpsg'); ?>" style="float:left; margin-left:15px;" class="button" />
                                
                                <div class="wpsg_clear"></div>
                                
                        </form>
                        
                </div>
        </div>

<?php echo wpsg_drawForm_AdminboxEnd(); ?>

<script>
        
        var wpsg_form_refresh = true;
        
        jQuery('#wpsg_mod_coverletter_form').on('submit', function() {
                
                if (wpsg_form_refresh) {
                
                        setTimeout(function() {
                        
                                location.reload();
                                
                        }, 1000);
                        
                }

                wpsg_form_refresh = true;
                                
        } );
        
</script>