summaryrefslogtreecommitdiff
path: root/views/mods
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods')
-rw-r--r--views/mods/mod_downloadplus/filelist.phtml26
-rw-r--r--views/mods/mod_downloadplus/order_view_sidebar.phtml37
-rw-r--r--views/mods/mod_downloadplus/order_view_sidebar_renderlist.phtml29
-rw-r--r--views/mods/mod_downloadplus/produkt_addedit_sidebar.phtml153
-rw-r--r--views/mods/mod_downloadplus/settings_edit.phtml107
-rw-r--r--views/mods/mod_downloadplus/settings_edit_templates.phtml343
-rw-r--r--views/mods/mod_productvars/basket_row.phtml12
-rw-r--r--views/mods/mod_productvars/order_view_row.phtml15
-rw-r--r--views/mods/mod_productvars/overview_row.phtml2
-rw-r--r--views/mods/mod_productvars/renderTemplate.phtml4
10 files changed, 561 insertions, 167 deletions
diff --git a/views/mods/mod_downloadplus/filelist.phtml b/views/mods/mod_downloadplus/filelist.phtml
index b151177..7cce569 100644
--- a/views/mods/mod_downloadplus/filelist.phtml
+++ b/views/mods/mod_downloadplus/filelist.phtml
@@ -5,17 +5,25 @@
*/
?>
+
<?php if (!wpsg_isSizedArray($this->view['files'])) { ?>
-<p><?php echo __('Bisher keine PDFs hochgeladen.', 'wpsg'); ?></p>
+
+ <p><?php echo __('Bisher keine PDFs hochgeladen.', 'wpsg'); ?></p>
+
<?php } else { ?>
+
<ul>
- <?php foreach ($this->view['files'] as $v) { ?>
- <li>
- <a target="_blank" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_downloadplus&noheader=1&cmd=download_file&file=<?php echo rawurlencode($v); ?>&edit_id=<?php echo $_REQUEST['edit_id']; ?>" title="<?php echo wpsg_hspc($v); ?>"><?php echo wpsg_hspc(substr($v, 0, 50)); ?></a>
- (<?php echo wpsg_formatSize($this->callMod('wpsg_mod_downloadplus', 'getPDFPath', array($_REQUEST['edit_id'])).'/'.$v); ?>)
- <div class="wpsg_glyphicon_right glyphicon glyphicon-trash" title="<?php echo __('PDF löschen', 'wpsg'); ?>" onclick="return wpsg_pdfdownload_removePDF('<?php echo rawurlencode($v); ?>');"></div>
-
- </li>
- <?php } ?>
+
+ <?php foreach ($this->view['files'] as $v) { ?>
+ <li>
+
+ <a target="_blank" href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=ajax&mod=wpsg_mod_downloadplus&noheader=1&cmd=download_file&file=<?php echo rawurlencode($v); ?>&edit_id=<?php echo $_REQUEST['edit_id']; ?>" title="<?php echo wpsg_hspc($v); ?>"><?php echo wpsg_hspc(substr($v, 0, 50)); ?></a>
+ (<?php echo wpsg_formatSize($this->callMod('wpsg_mod_downloadplus', 'getPDFPath', array($_REQUEST['edit_id'])).'/'.$v); ?>)
+ <div class="wpsg_glyphicon_right glyphicon glyphicon-trash" title="<?php echo __('PDF löschen', 'wpsg'); ?>" onclick="return wpsg_pdfdownload_removePDF('<?php echo rawurlencode($v); ?>');"></div>
+
+ </li>
+ <?php } ?>
+
</ul>
+
<?php } ?> \ No newline at end of file
diff --git a/views/mods/mod_downloadplus/order_view_sidebar.phtml b/views/mods/mod_downloadplus/order_view_sidebar.phtml
index d100189..c829451 100644
--- a/views/mods/mod_downloadplus/order_view_sidebar.phtml
+++ b/views/mods/mod_downloadplus/order_view_sidebar.phtml
@@ -6,8 +6,7 @@
*/
?>
-<script type="text/javascript">
-/* <![CDATA[ */
+<script>
function wpsg_mod_downloadplus_schedule(product_key, file, product_index)
{
@@ -25,8 +24,7 @@
} // function wpsg_mod_downloadplus_schedule(file)
- function wpsg_mod_downloadplus_reindiv()
- {
+ function wpsg_mod_downloadplus_reindiv() {
jQuery('#wpsg_mod_downloadplus_target').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
@@ -61,8 +59,7 @@
} // function wpsg_mod_downloadplus_reset()
- function wpsg_mod_downloadplus_send()
- {
+ function wpsg_mod_downloadplus_send() {
jQuery('#wpsg_mod_downloadplus_target').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
@@ -95,16 +92,24 @@
return false;
} // function wpsg_mod_downloadplus_cangelschedule(file)
-
-/* ]]> */
+
</script>
-<div class="postbox" id="wpsg_pdfdownload">
- <h3 class="wpsg_handlediv">
- <span title="<?php echo __('Zum Ein/Ausklappen hier klicken', 'wpsg'); ?>" class="handlediv"><br /></span>
- <span><?php echo __('Downloadplus', 'wpsg'); ?></span>
- </h3>
- <div class="inside" id="wpsg_mod_downloadplus_target">
- <?php echo $this->callMod('wpsg_mod_downloadplus', 'order_view_sidebar_renderList', array($this->view['order_id'])); ?>
+<div class="panel panel-default" id="wpsg_pdfdownload">
+ <div class="panel-heading clearfix">
+ <h3 class="panel-title">
+ <?php echo __('Downloadplus', 'wpsg'); ?>
+ </h3>
</div>
-</div> \ No newline at end of file
+ <div class="panel-body">
+
+ <div id="wpsg_mod_downloadplus_target">
+ <?php echo $this->callMod('wpsg_mod_downloadplus', 'order_view_sidebar_renderList', array($this->view['order_id'])); ?>
+ </div>
+
+ <br /><br />
+
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_downloadplus"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration des Abo-Moduls', 'wpsg'); ?></a>
+
+ </div>
+</div>
diff --git a/views/mods/mod_downloadplus/order_view_sidebar_renderlist.phtml b/views/mods/mod_downloadplus/order_view_sidebar_renderlist.phtml
index 834c7c6..95f43dc 100644
--- a/views/mods/mod_downloadplus/order_view_sidebar_renderlist.phtml
+++ b/views/mods/mod_downloadplus/order_view_sidebar_renderlist.phtml
@@ -25,11 +25,13 @@
<?php foreach ($this->view['arFiles'] as $f) { ?>
<tr class="<?php echo (($f[3] !== false && $f[3]['raid'] === true)?'row_raid':''); ?>">
<td class="col_file">
-
+
<?php if ($f[3] !== false && wpsg_isSizedArray($f[3]) && strtotime($f[3]['done']) > 0) { ?>
- <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_downloadplus&cmd=download_indivfile&edit_id=<?php echo $f[3]['o_id']; ?>&product_id=<?php echo $f[0]; ?>&file=<?php echo rawurlencode($f[3]['out_file']); ?>&noheader=1">
+
+ <a target="_blank" href="<?php echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_downloadplus&cmd=download_indivfile&edit_id='.$f[3]['o_id'].'&product_key='.$f[0].'&file='.rawurlencode($f[3]['out_file']).'&noheader=1', 'wpsg-dp-download-'.$f[3]['o_id'].'-'.$f[0]); ?>">
+
<?php } ?>
-
+
<?php if ($f[3] === false) { ?>
<?php echo $f[1]; ?>
<?php } else { ?>
@@ -39,6 +41,17 @@
<?php if ($f[3] !== false && wpsg_isSizedArray($f[3]) && strtotime($f[3]['done']) > 0) { ?>
</a>
<?php } ?>
+
+ <?php if (isset($f[3]['clear_file']) && $f[3]['clear_file']) { ?>
+
+ <br />
+
+ <a target="_blank" href="<?php echo wp_nonce_url(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_downloadplus&cmd=download_indivfile&edit_id='.$f[3]['o_id'].'&clear=1&product_key='.$f[0].'&file='.rawurlencode($f[3]['out_file']).'&noheader=1', 'wpsg-dp-download-'.$f[3]['o_id'].'-'.$f[0]); ?>">
+ <?php echo $f[3]['out_file'].' ('.__('Ohne Hintergrund', 'wpsg').')'; ?>
+ </a>
+
+ <?php } ?>
+
</td>
<td class="col_status">
<?php if ($f[3] === false) { ?>
@@ -53,14 +66,16 @@
<td class="col_action">
<?php if ($f[3] === false) { ?>
<a href="#" onclick="return wpsg_mod_downloadplus_schedule('<?php echo $f[0]; ?>', '<?php echo rawurldecode($f[1]); ?>', '<?php echo $f[2]; ?>');"><?php echo __('Planen', 'wpsg'); ?></a>
- <?php } else if (strtotime($f[2]['scheduled']) > 0 && strtotime($f[3]['done']) <= 0) { ?>
+ <?php } else if (strtotime($f[3]['scheduled']) > 0 && strtotime($f[3]['done']) <= 0) { ?>
<a href="#" onclick="return wpsg_mod_downloadplus_cangelschedule('<?php echo $f[0]; ?>', '<?php echo rawurldecode($f[1]); ?>');"><?php echo __('Abbrechen', 'wpsg'); ?></a>
<?php } ?>
</td>
</tr>
<?php } ?>
</table>
+
<br />
-<input type="button" onclick="return wpsg_mod_downloadplus_send();" value="<?php echo __('Fertige Downloads an Kunden senden', 'wpsg'); ?>" /><br />
-<input type="button" onclick="return wpsg_mod_downloadplus_reindiv();" value="<?php echo __('Alle Dokumente neu planen', 'wpsg'); ?>" />
-<input type="button" onclick="return wpsg_mod_downloadplus_reset();" value="<?php echo __('Zähler zurücksetzen', 'wpsg'); ?>" /> \ No newline at end of file
+
+<a href="#" class="button" onclick="return wpsg_mod_downloadplus_send();"><?php echo __('Fertige Downloads an Kunden senden', 'wpsg'); ?></a>
+<a href="#" class="button" onclick="return wpsg_mod_downloadplus_reindiv();"><?php echo __('Alle Dokumente neu planen', 'wpsg'); ?></a>
+<a href="#" class="button" onclick="return wpsg_mod_downloadplus_reset();"><?php echo __('Zähler zurücksetzen', 'wpsg'); ?></a> \ No newline at end of file
diff --git a/views/mods/mod_downloadplus/produkt_addedit_sidebar.phtml b/views/mods/mod_downloadplus/produkt_addedit_sidebar.phtml
index 81214ff..61735ee 100644
--- a/views/mods/mod_downloadplus/produkt_addedit_sidebar.phtml
+++ b/views/mods/mod_downloadplus/produkt_addedit_sidebar.phtml
@@ -5,12 +5,12 @@
* sollte nicht verändert werden
*/
+ $view = $this->view['wpsg_mod_downloadplus']??[];
+
?>
-<script type="text/javascript">
-/* <![CDATA[ */
+<script>
- function wpsg_pdfdownload_removePDF(file)
- {
+ function wpsg_pdfdownload_removePDF(file) {
if (!confirm('<?php echo __('Sind sie sich sicher, dass sie die Datei löschen möchten?', 'wpsg'); ?>')) return false;
@@ -37,7 +37,7 @@
return false;
- } // function wpsg_pdfdownload_removePDF($pdf)
+ }
jQuery(document).ready(function() {
@@ -70,8 +70,7 @@
<?php } ?>
});
-
-/* ]]> */
+
</script>
<div id="wpsg_pdfdownload" class="panel panel-default">
@@ -81,31 +80,121 @@
</h3>
</div>
<div class="panel-body">
- <div id="wpsg_mod_downloadplus_files"><?php echo $this->view['filesList']; ?></div>
-
- <?php if ($this->get_option('wpsg_classicupload') == '1') { ?>
- <input type="file" name="wpsg_mod_downloadplus_file" />
- <?php } else { ?>
- <input value="<?php echo __("Upload", "wpsg"); ?>" type="text" style="text-align:center;" size="10" id="wpsg_mod_downloadplus_upload" />
- <?php } ?>
-
- <div class="wpsg_clear"></div><br />
- <div class="wpsg_form_field">
- <div class="wpsg_form_left" style="width:75px;">
- <label for="feinheit"><?php echo __('FTP Pfad', 'wpsg'); ?>:</label>
- </div>
- <div class="wpsg_form_right">
- <p>
- <a href="#" onclick="alert('<?php echo addslashes($this->callMod('wpsg_mod_downloadplus', 'getPDFPath', array($this->view['data']['id'], true))); ?>'); return false;"><?php echo __('Anzeigen', 'wpsg'); ?></a>
- </p>
- </div>
- <div class="wpsg_clear"></div>
- </div>
-
- <br /><br />
-
- <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_downloadplus"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration des DownloadPlus-Moduls', 'wpsg'); ?></a>
-
+
+ <?php echo wpsg_drawForm_Checkbox('mod_downloadplus_set', __('Produkt ist ein Downloadprodukt', 'wpsg'), $view['set']); ?>
+
+ <div id="mod_downloadplus_set_1" style="display:none;">
+
+ <?php if (sizeof($view['arTemplates']) > 0) { ?>
+ <?php echo wpsg_drawForm_Select('mod_downloadplus_template', __('Template', 'wpsg'), ['0' => __('Standard Template', 'wpsg')] + $view['arTemplates'], $view['template']); ?>
+ <?php } else { ?>
+ <?php echo wpsg_drawForm_Text(__('Template', 'wpsg'), __('Keine Templates definiert', 'wpsg')); ?>
+ <?php } ?>
+
+ <?php echo wpsg_drawForm_Select('mod_downloadplus_mode', __('Modus', 'wpsg'), [
+ '0' => __('Individuelle Datei(en)', 'wpsg'),
+ '1' => __('Datei aus Template', 'wpsg')
+ ], $view['mode']); ?>
+
+ <div class="mod_downloadplus_mode mod_downloadplus_mode_0">
+
+ <div id="wpsg_mod_downloadplus_files"><?php echo $view['filesList']; ?></div>
+
+ <?php if ($this->get_option('wpsg_classicupload') == '1') { ?>
+ <input type="file" name="wpsg_mod_downloadplus_file" />
+ <?php } else { ?>
+ <input value="<?php echo __("Upload", "wpsg"); ?>" type="text" style="text-align:center;" size="10" id="wpsg_mod_downloadplus_upload" />
+ <?php } ?>
+
+ <div class="wpsg_clear"></div><br />
+
+ <div class="wpsg_form_field">
+ <div class="wpsg_form_left" style="width:75px;">
+ <label for="feinheit"><?php echo __('FTP Pfad', 'wpsg'); ?>:</label>
+ </div>
+ <div class="wpsg_form_right">
+ <p>
+ <a href="#" onclick="alert('<?php echo addslashes($this->callMod('wpsg_mod_downloadplus', 'getPDFPath', array($this->view['data']['id'], true))); ?>'); return false;"><?php echo __('Anzeigen', 'wpsg'); ?></a>
+ </p>
+ </div>
+ <div class="wpsg_clear"></div>
+ </div>
+
+ </div>
+
+ <script>
+
+ let mod_downloadplus_mode = document.getElementById('mod_downloadplus_mode');
+
+ mod_downloadplus_mode.addEventListener('change', () => {
+
+ console.log(mod_downloadplus_mode.value);
+
+ Array.from(document.getElementsByClassName('mod_downloadplus_mode')).forEach((el) => { el.style.display = 'none'; } );
+ Array.from(document.getElementsByClassName('mod_downloadplus_mode_' + mod_downloadplus_mode.value)).forEach((el) => { el.style.display = 'block'; } );
+
+ });
+
+ mod_downloadplus_mode.dispatchEvent(new Event('change'));
+
+ </script>
+
+ <?php if ($this->hasMod('wpsg_mod_productvariants')) { $arVarInfo = $this->callMod('wpsg_mod_productvariants', 'getVariants', [$this->view['data']['id'], true, true]); ?>
+
+ <?php if (sizeof($arVarInfo) > 0) { ?>
+
+ <br />
+
+ <p class="info" style="margin-bottom:1rem;"><?php echo __('Sie verwenden Varianten, sie können das Template in jeder Variation verändern. Sie sollten es aber nur in einer Variante verändern, sonst wird das letzte Template genommen.', 'wpsg'); ?></p>
+
+ <?php foreach ($arVarInfo as $var) { $arVari = $this->callMod('wpsg_mod_productvariants', 'getVariationOfVariant', [$var['id'], $this->view['data']['id']]); ?>
+
+ <strong><?php echo wpsg_translate(__('Variante "#1#"', 'wpsg'), $var['name']); ?></strong>
+
+ <?php foreach ($arVari as $vari) { ?>
+
+ <?php if (!$vari['deleted'] && $vari['active']) { ?>
+
+ <?php echo wpsg_drawForm_Select('vari_template['.$var['id'].'_'.$vari['id'].']', wpsg_translate(__('Template für Variation "#1#"', 'wpsg'), $vari['name']), [0 => __('Unverändert', 'wpsg')] + $view['arTemplates'], $view['vari_template'][$var['id'].'_'.$vari['id']]??'0'); ?>
+
+ <?php } ?>
+
+ <?php } ?>
+
+ <?php } ?>
+
+ <?php } ?>
+
+ <?php } ?>
+
+ <br /><br />
+
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_downloadplus"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration des DownloadPlus-Moduls', 'wpsg'); ?></a>
+
+ </div>
+
+ <script>
+
+ let mod_downloadplus_set = document.getElementById('mod_downloadplus_set');
+
+ mod_downloadplus_set.addEventListener('change', () => {
+
+ if (mod_downloadplus_set.checked) {
+
+ document.getElementById('mod_downloadplus_set_1').style.display = 'block';
+
+ } else {
+
+ document.getElementById('mod_downloadplus_set_1').style.display = 'none';
+
+ }
+
+ });
+
+ mod_downloadplus_set.dispatchEvent(new Event('change'));
+
+ </script>
+
</div>
<div class="clear"></div>
</div> \ No newline at end of file
diff --git a/views/mods/mod_downloadplus/settings_edit.phtml b/views/mods/mod_downloadplus/settings_edit.phtml
index c59f635..f30f3ff 100644
--- a/views/mods/mod_downloadplus/settings_edit.phtml
+++ b/views/mods/mod_downloadplus/settings_edit.phtml
@@ -9,7 +9,8 @@
<div>
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#tab1" role="tab" data-toggle="tab"><?php echo __('Einstellungen', 'wpsg'); ?></a></li>
- <li role="presentation"><a href="#tab2" role="tab" data-toggle="tab"><?php echo __('Textfelder', 'wpsg'); ?></a></li>
+ <li role="presentation"><a href="#tab5" role="tab" data-toggle="tab"><?php echo __('Templates', 'wpsg'); ?></a></li>
+ <li role="presentation"></li>
<li role="presentation"><a href="#tab3" role="tab" data-toggle="tab"><?php echo __('Erweitert', 'wpsg'); ?></a></li>
<li role="presentation" style="float:right;"><a href="#tab4" role="tab" data-toggle="tab"><?php echo __('Info / Hilfe', 'wpsg'); ?></a></li>
</ul>
@@ -67,102 +68,10 @@
</div>
- <div role="tabpanel" class="tab-pane" id="tab2">
-
- <table class="table table-body-striped wpsg_mod_downloadplus_fieldtable">
- <thead>
- <tr>
- <th class="col_bezeichnung"></th>
- <th class="col_x"><?php echo __('X', 'wpsg'); ?></th>
- <th class="col_y"><?php echo __('Y', 'wpsg'); ?></th>
- <th class="col_align"><?php echo __('Zentriert', 'wpsg'); ?></th>
- <th class="col_bg"><?php echo __('Hintergrund', 'wpsg'); ?></th>
- <th class="col_color"><?php echo __('Farbe', 'wpsg'); ?></th>
- <th class="col_alpha"><?php echo __('Deckkraft', 'wpsg'); ?></th>
- <th class="col_angle"><?php echo __('Winkel', 'wpsg'); ?></th>
- <th class="col_groesse"><?php echo __('Größe', 'wpsg'); ?></th>
- <th class="col_action"></th>
- </tr>
- </thead>
- <?php for ($i = 0; $i < 10; $i ++) { ?>
- <tbody>
- <tr>
- <td><?php echo '#'.($i + 1); ?></td>
- <td>
- <input type="text" style="width:100%;" name="text[<?php echo $i; ?>][x]" value="<?php echo wpsg_hspc($this->view['arTexte'][$i]['x']); ?>" />
- </td>
- <td>
- <input type="text" style="width:100%;" name="text[<?php echo $i; ?>][y]" value="<?php echo wpsg_hspc($this->view['arTexte'][$i]['y']); ?>" />
- </td>
- <td class="col_align">
- <input type="hidden" name="text[<?php echo $i; ?>][align]" value="0" />
- <input class="wpsg_hideBarcode" type="checkbox" name="text[<?php echo $i; ?>][align]" value="1" <?php echo (($this->view['arTexte'][$i]['align'] == '1')?'checked="checked"':''); ?> />
- </td>
- <td class="col_bg">
- <input type="hidden" name="text[<?php echo $i; ?>][bg]" value="0" />
- <input class="wpsg_hideBarcode" type="checkbox" name="text[<?php echo $i; ?>][bg]" value="1" <?php echo (($this->view['arTexte'][$i]['bg'] == '1')?'checked="checked"':''); ?> />
- </td>
- <td>
- <input class="wpsg_hideBarcode" type="text" style="width:100%;" name="text[<?php echo $i; ?>][color]" value="<?php echo wpsg_hspc($this->view['arTexte'][$i]['color']); ?>" />
- </td>
- <td>
- <input class="wpsg_hideBarcode" type="text" style="width:100%;" name="text[<?php echo $i; ?>][alpha]" value="<?php echo wpsg_hspc($this->view['arTexte'][$i]['alpha']); ?>" />
- </td>
- <td>
- <input class="wpsg_hideBarcode" type="text" style="width:100%;" name="text[<?php echo $i; ?>][angle]" value="<?php echo wpsg_hspc($this->view['arTexte'][$i]['angle']); ?>" />
- </td>
- <td>
- <select name="text[<?php echo $i; ?>][fontsize]" style="width:100%;">
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "4")?'selected="selected"':''); ?> value="4">4</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "5")?'selected="selected"':''); ?> value="5">5</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "6")?'selected="selected"':''); ?> value="6">6</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "7")?'selected="selected"':''); ?> value="7">7</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "8")?'selected="selected"':''); ?> value="8">8</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "9")?'selected="selected"':''); ?> value="9">9</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "10")?'selected="selected"':''); ?> value="10">10</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "11")?'selected="selected"':''); ?> value="11">11</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "12")?'selected="selected"':''); ?> value="12">12</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "13")?'selected="selected"':''); ?> value="13">13</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "14")?'selected="selected"':''); ?> value="14">14</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "16")?'selected="selected"':''); ?> value="16">16</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "18")?'selected="selected"':''); ?> value="18">18</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "20")?'selected="selected"':''); ?> value="20">20</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "22")?'selected="selected"':''); ?> value="22">22</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "24")?'selected="selected"':''); ?> value="24">24</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "26")?'selected="selected"':''); ?> value="26">26</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "28")?'selected="selected"':''); ?> value="28">28</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "30")?'selected="selected"':''); ?> value="30">30</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "32")?'selected="selected"':''); ?> value="32">32</option>
- <option <?php echo (($this->view['arTexte'][$i]['fontsize'] == "34")?'selected="selected"':''); ?> value="34">34</option>
- </select>
- </td>
- <td>
- <input type="checkbox" title="<?php echo __('Hier können Sie die Zeile deaktivieren/aktivieren.', 'wpsg'); ?>" value="1" name="text[<?php echo $i; ?>][aktiv]" <?php echo ((@$this->view['arTexte'][$i]['aktiv'] == 1)?'checked="checked"':''); ?> />&nbsp
- </td>
- </tr>
- <tr>
- <td></td>
- <td class="col_freitext_label"><?php echo __('Freitext', 'wpsg'); ?>:</td>
- <td colspan="6" class="col_freitext">
- <input type="text" style="width:100%;" name="text[<?php echo $i; ?>][text]" value="<?php echo wpsg_hspc($this->view['arTexte'][$i]['text']); ?>" />
- </td>
- <td colspan="2">
- <select class="fontselect" name="text[<?php echo $i; ?>][font]" style="width:100%;">
- <?php foreach ($this->view['wpsg_mod_downloadplus']['arFonts'] as $k => $v) { ?>
- <option value="<?php echo wpsg_hspc($k); ?>" <?php echo (($k == $this->view['arTexte'][$i]['font'])?'selected="selected"':''); ?>><?php echo wpsg_hspc($v); ?></option>
- <?php } ?>
- </select>
- </td>
- </tr>
- </tbody>
- <?php } ?>
- </table>
-
- </div>
-
<div role="tabpanel" class="tab-pane" id="tab3">
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_memorylimit', __('Versuche Speicherlimit hochzusetzen', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_memorylimit'), array('help' => 'wpsg_mod_downloadplus_memorylimit')); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_emptypdf', __('Zusätzlich leeres PDF individualisieren', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_emptypdf'), ['help' => 'wpsg_mod_downloadplus_emptypdf']); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_downloadplus_timelimit', __('Versuche die Ausführungszeit hochzusetzen', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_timelimit'), array('help' => 'wpsg_mod_downloadplus_timelimit')); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_downloadplus_numberformat', __('Format der Downloadnummer', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_numberformat'), array('help' => 'wpsg_mod_downloadplus_numberformat')); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_downloadplus_startnumber', __('Downloadnummer Startnummer', 'wpsg'), $this->get_option('wpsg_mod_downloadplus_startnumber'), array('help' => 'wpsg_mod_downloadplus_startnumber')); ?>
@@ -170,6 +79,12 @@
</div>
+ <div role="tabpanel" class="tab-pane" id="tab5">
+
+ <?php echo $this->render(WPSG_PATH_VIEW.'/mods/mod_downloadplus/settings_edit_templates.phtml'); ?>
+
+ </div>
+
<div role="tabpanel" class="tab-pane" id="tab4">
<p>
@@ -195,7 +110,7 @@
</div>
</div>
-<script type="text/javascript">/* <![CDATA[ */
+<script>
jQuery(document).ready(function() {
@@ -208,4 +123,4 @@
} );
-/* ]]> */</script> \ No newline at end of file
+</script> \ No newline at end of file
diff --git a/views/mods/mod_downloadplus/settings_edit_templates.phtml b/views/mods/mod_downloadplus/settings_edit_templates.phtml
new file mode 100644
index 0000000..498aed4
--- /dev/null
+++ b/views/mods/mod_downloadplus/settings_edit_templates.phtml
@@ -0,0 +1,343 @@
+<?php
+
+ namespace wpsg;
+
+ $arTemplates = array_values($this->callMod('wpsg_mod_downloadplus', 'getTemplate'));
+
+ $arFontVue = [];
+ foreach ($this->view['wpsg_mod_downloadplus']['arFonts'] as $font_code => $font_label) {
+
+ $arFontVue[] = ['code' => $font_code, 'label' => $font_label];
+
+ }
+
+?>
+
+<div id="wpsg_dp_templates_app">
+
+ <div class="head">
+
+ <a href="#" @click.prevent="addTemplate" title="<?php echo __('Neues Template anlegen', 'wpsg'); ?>">
+ <span class="wpsg-glyphicon glyphicon glyphicon-plus"></span>
+ </a>
+
+ <div v-if="arTemplates.length > 0">
+
+ <select v-model="template">
+ <option :value="null"><?php echo __('Bitte auswählen', 'wpsg'); ?></option>
+ <option v-for="(template, index) in arTemplates" :value="template">
+ {{template.name}} ({{template.arField.length}} <?php echo __('Felder', 'wpsg'); ?><template v-if="template.defaulttemplate">, <?php echo __('Standard', 'wpsg'); ?></template>)
+ </option>
+ </select>
+
+ </div>
+ <div v-else>
+
+ <?php echo __('Keine Templates vorhanden', 'wpsg'); ?>
+
+ </div>
+
+ <a v-if="template" href="#" @click.prevent="removeTemplate" title="<?php echo __('Template löschen', 'wpsg'); ?>">
+ <span class="wpsg-glyphicon glyphicon glyphicon-trash"></span>
+ </a>
+
+ </div>
+
+ <div v-if="template" class="template">
+
+ <div class="form-group form-group-sm has-feedback">
+ <label class="col-sm-6 control-label" for="wpsg_mod_downloadplus_filename"><?php echo __('Name des Templates', 'wpsg'); ?></label>
+ <div class="col-sm-6">
+ <div class="wpsg_field_wrap wpsg_field_wrap_template_name">
+ <input type="text" v-model="template.name" />
+ <div>
+ <label class="control-label"><?php echo __('Standard: ', 'wpsg'); ?></label>
+ <input type="checkbox" :checked="template.defaulttemplate" @click="setDefaultTemplate" />
+ </div>
+ </div>
+ </div>
+ <div class="clearfix wpsg_clear"></div>
+ </div>
+
+ <table class="table table-body-striped wpsg_mod_downloadplus_fieldtable">
+ <thead>
+ <tr>
+ <th class="col_bezeichnung">
+ <a href="#" @click.prevent="addField" title="<?php echo __('Neues Feld', 'wpsg'); ?>">
+ <span class="wpsg-glyphicon glyphicon glyphicon-plus"></span>
+ </a>
+ </th>
+ <th class="col_x"><?php echo __('X', 'wpsg'); ?></th>
+ <th class="col_y"><?php echo __('Y', 'wpsg'); ?></th>
+ <th class="col_align"><?php echo __('Zentriert', 'wpsg'); ?></th>
+ <th class="col_bg"><?php echo __('Hintergrund', 'wpsg'); ?></th>
+ <th class="col_color"><?php echo __('Farbe', 'wpsg'); ?></th>
+ <th class="col_alpha"><?php echo __('Deckkraft', 'wpsg'); ?></th>
+ <th class="col_angle"><?php echo __('Winkel', 'wpsg'); ?></th>
+ <th class="col_groesse"><?php echo __('Größe', 'wpsg'); ?></th>
+ <th class="col_action"></th>
+ </tr>
+ </thead>
+ <tbody v-for="(field, field_index) in template.arField">
+ <tr>
+ <td>#{{field_index + 1}}</td>
+ <td>
+ <input type="text" style="width:50px;" v-model="field.x" />
+ </td>
+ <td>
+ <input type="text" style="width:50px;" v-model="field.y" />
+ </td>
+ <td class="col_align">
+ <input class="wpsg_hideBarcode" type="checkbox" v-model="field.align" />
+ </td>
+ <td class="col_bg">
+ <input class="wpsg_hideBarcode" type="checkbox" v-model="field.bg" />
+ </td>
+ <td class="col_color">
+ <input class="wpsg_hideBarcode" type="text" style="width:75px;" v-model="field.color" />
+ </td>
+ <td class="col_alpha">
+ <input class="wpsg_hideBarcode" type="text" style="width:50px;" v-model="field.alpha" />
+ </td>
+ <td>
+ <input class="wpsg_hideBarcode" type="text" style="width:50px;" v-model="field.angle" />
+ </td>
+ <td>
+ <select v-model="field.fontsize" style="width:100%;">
+ <option v-for="size in [4,5,6,7,8,9,10,11,12,13,14,16,18,20,22,24,26,28,30,32,34]" :value="size">{{size}}</option>
+ </select>
+ </td>
+ <td>
+ <input type="checkbox" title="<?php echo __('Hier können Sie die Zeile deaktivieren/aktivieren.', 'wpsg'); ?>" value="1" v-model="field.aktiv" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <a href="#" @click.prevent="addField(field_index)" title="<?php echo __('Neues Feld davor einfügen', 'wpsg'); ?>">
+ <span class="wpsg-glyphicon glyphicon glyphicon-plus"></span>
+ </a>
+ </td>
+ <td class="col_freitext_label"><?php echo __('Freitext', 'wpsg'); ?>:</td>
+ <td colspan="5" class="col_freitext">
+ <input type="text" style="width:100%;" v-model="field.text" />
+ </td>
+ <td colspan="2">
+ <select class="fontselect" v-model="field.font" style="width:100%;">
+ <option v-for="(font, index_font) in arFont" :value="font.code">{{font.label}}</option>
+ </select>
+ </td>
+ <td>
+ <a href="#" @click.prevent="removeField(field_index)" title="<?php echo __('Feld löschen', 'wpsg'); ?>">
+ <span class="wpsg-glyphicon glyphicon glyphicon-trash"></span>
+ </a>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <div class="file_wrap">
+
+ <div class="uploadstate">
+ <template v-if="uploadstate.run">
+ <img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />
+ <span><?php echo __('Bitte warten', 'wpsg'); ?> ... <template v-if="uploadstate.proz">{{uploadstate.proz}} %</template></span>
+ </template>
+ <input v-else type="file" v-on:change="upload" />
+ </div>
+
+ <div v-if="template.file" class="file">
+ <span>{{template.file}}</span>
+ <a href="#" @click.prevent="removeFile" title="<?php echo __('Datei löschen', 'wpsg'); ?>">
+ <span class="wpsg-glyphicon glyphicon glyphicon-trash"></span>
+ </a>
+ </div>
+
+ </div>
+
+ </div>
+
+ <textarea style="display:none;" name="template">{{arTemplates}}</textarea>
+
+ <br />
+
+</div>
+
+<style>
+
+ #wpsg_dp_templates_app .head { width:100%; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #DDDDDD; margin-bottom:1rem; padding-bottom:1rem; }
+ #wpsg_dp_templates_app .head select { width:300px; }
+ #wpsg_dp_templates_app .head div { flex-grow:1; }
+ #wpsg_dp_templates_app .wpsg_field_wrap_template_name { display:flex; justify-content:space-between; align-items:center; padding-right:10px !important; }
+ #wpsg_dp_templates_app .wpsg_field_wrap_template_name > div { gap:1rem; display:flex; justify-content:flex-start; align-items:center; }
+ #wpsg_dp_templates_app .template td.col_bg,
+ #wpsg_dp_templates_app .template td.col_align { width:50px; text-align:center; }
+ #wpsg_dp_templates_app .template tr td { vertical-align:middle; }
+ #wpsg_dp_templates_app .template tr td:last-child { text-align:right; }
+ #wpsg_dp_templates_app .template tr td:last-child .wpsg-glyphicon { margin-right:0; }
+ #wpsg_dp_templates_app .uploadstate { display:flex; justify-content:flex-start; align-items:center; }
+ #wpsg_dp_templates_app .uploadstate > img { margin-right:1rem; }
+ #wpsg_dp_templates_app .file_wrap { display:flex; justify-content:space-between; align-items:center; }
+ #wpsg_dp_templates_app .file_wrap .file { display:flex; gap:1rem; justify-content:flex-end; align-items:center; }
+ #wpsg_dp_templates_app .file_wrap .file .wpsg-glyphicon { margin-right:8px; }
+
+</style>
+
+<script src="<?php echo WPSG_URL_CONTENT.'plugins/'.WPSG_FOLDERNAME.'/views/js/vue3.js'; ?>"></script>
+<script>
+
+ const Counter = {
+ data() {
+ return {
+ arFont: <?php echo json_encode($arFontVue); ?>,
+ arTemplates: <?php echo json_encode($arTemplates); ?>,
+ template: null,
+ uploadstate: {
+ run: false,
+ proz: null
+ }
+ }
+ },
+ methods: {
+
+ addTemplate: function() {
+
+ let new_template = {
+ id: 0,
+ name: '<?php echo __('Template', 'wpsg'); ?>' + (this.arTemplates.length + 1),
+ arField: [
+ {
+ id: 0, x: 0, y:0, align:false, bg:false, color:'000000', alpha:1, angle:0, fontsize:22, aktiv:true,
+ text: '', font: '', defaulttemplate: false, file: null, file_data: null
+ }
+ ],
+ file: null,
+ file_delete: false,
+ file_data: false
+ };
+
+ this.arTemplates.push(new_template);
+ this.template = new_template;
+
+ },
+
+ removeTemplate: function() {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher? Das ganze Template und alle Felder werden gelöscht.', 'wpsg'); ?>')) return;
+
+ for (let i = 0; i < this.arTemplates.length; i ++) {
+
+ if (this.arTemplates[i] === this.template) {
+
+ this.arTemplates.splice(i, 1);
+
+ }
+
+ }
+
+ if (this.arTemplates.length > 0) this.template = this.arTemplates[0];
+ else this.template = null;
+
+ },
+
+ addField: function(field_index) {
+
+ if (field_index === undefined) field_index = this.template.arField.length;
+
+ this.template.arField.splice(field_index, 0, {
+ id: 0, x: 0, y:0, align:false, bg:false, color:'000000', alpha:1, angle:0, fontsize:22, aktiv:true,
+ text: '', font: ''
+ })
+
+ },
+
+ removeField: function(field_index) {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher, dass sie das Feld löschen möchten?', 'wpsg'); ?>')) return;
+
+ this.template.arField.splice(field_index, 1);
+
+ },
+
+ setDefaultTemplate: function() {
+
+ for (let i = 0; i < this.arTemplates.length; i ++) {
+
+ this.arTemplates[i].defaulttemplate = false;
+
+ }
+
+ this.template.defaulttemplate = true;
+
+ },
+
+ removeFile: function() {
+
+ if (!confirm('<?php echo __('Sind Sie sich sicher?', 'wpsg'); ?>')) return;
+
+ this.template.file_data = null;
+ this.template.file = null;
+ this.template.file_delete = true;
+
+ },
+
+ upload: function(e) {
+
+ const files = e.target.files || e.dataTransfer.files;
+ if (!files.length) return;
+
+ if (files[0].type !== 'application/pdf') {
+
+ alert('<?php echo __('Ungültier Dateityp', 'wpsg'); ?>');
+ return;
+
+ }
+
+ this.uploadstate.run = true;
+ this.uploadstate.proz = null;
+
+ const reader = new FileReader();
+
+ reader.addEventListener("load", () => {
+
+ this.template.file = files[0].name
+ this.template.file_data = reader.result;
+ this.template.file_delete = false;
+
+ this.uploadstate.run = false;
+
+ e.target.value = '';
+
+ }, false);
+
+ reader.addEventListener('progress', (event) => {
+
+ if (event.lengthComputable) this.uploadstate.proz = Math.round((event.loaded / event.total) * 100);
+
+ });
+
+ reader.readAsDataURL(files[0]);
+
+ }
+
+ },
+ mounted() {
+
+ for (let i = 0; i < this.arTemplates.length; i ++) {
+
+ if (this.arTemplates[i].defaulttemplate === true) this.template = this.arTemplates[i];
+
+ }
+
+ },
+ watch: {
+ 'template.file': function(newValue, oldValue) {
+
+ console.log(newValue);
+
+ }
+ }
+ }
+
+ Vue.createApp(Counter).mount('#wpsg_dp_templates_app');
+
+</script>
diff --git a/views/mods/mod_productvars/basket_row.phtml b/views/mods/mod_productvars/basket_row.phtml
index dead306..95cbd8e 100644
--- a/views/mods/mod_productvars/basket_row.phtml
+++ b/views/mods/mod_productvars/basket_row.phtml
@@ -25,11 +25,13 @@
<?php } else if ($pv['typ'] == '3') { // Checkbox ?>
<input type="hidden" value="0" name="wpsg_mod_productvars[<?php echo $pv['id']; ?>][<?php echo $this->view['wpsg_mod_productvars']['p']['product_index']; ?>]" />
<input <?php echo ((@wpsg_hspc($this->view['wpsg_mod_productvars']['p']['wpsg_mod_productvars'][$pv['id']]) == '1')?'checked="checked"':''); ?> class="<?php echo ((in_array("wpsg_mod_productvars_".$pv['id']."_".$this->view['wpsg_mod_productvars']['p']['product_index'], (array)$this->view['error']))?'wpsg_error':''); ?>" type="checkbox" value="1" name="wpsg_mod_productvars[<?php echo $pv['id']; ?>][<?php echo $this->view['wpsg_mod_productvars']['p']['product_index']; ?>]" />
- <?php } ?>
+ <?php } else if ($pv['typ'] == '4') { // Textfeld mehrzeilig ?>
+ <textarea
+ rows="5"
+ name="wpsg_mod_productvars[<?php echo $pv['id']; ?>][<?php echo $this->view['wpsg_mod_productvars']['p']['product_index']; ?>]"
+ class="<?php echo ((in_array("wpsg_mod_productvars_".$pv['id']."_".$this->view['wpsg_mod_productvars']['p']['product_index'], (array)$this->view['error']))?'wpsg_error':''); ?>"><?php echo @wpsg_hspc($this->view['wpsg_mod_productvars']['p']['wpsg_mod_productvars'][$pv['id']]); ?></textarea>
+ <?php } ?>
</div>
- <div class="dummyr">
- <?php echo __('&nbsp;'); ?>
- </div>
-
+
</div>
<?php } ?> \ No newline at end of file
diff --git a/views/mods/mod_productvars/order_view_row.phtml b/views/mods/mod_productvars/order_view_row.phtml
index b4a22a4..4abda08 100644
--- a/views/mods/mod_productvars/order_view_row.phtml
+++ b/views/mods/mod_productvars/order_view_row.phtml
@@ -56,7 +56,20 @@
indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
});
- <?php } ?>
+ <?php } else if ($pv['typ'] == 4) { /* mehrzeiliges Textfeld */ ?>
+ jQuery('#wpsg_productvar_<?php echo $k.'_'.$product_index; ?>').wpsg_editable('<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&mod=wpsg_mod_productvars&do=inlinedit&noheader=1', {
+ submitdata: {
+ order_id: <?php echo $_REQUEST['edit_id']; ?>,
+ pv_id: '<?php echo $k; ?>',
+ p_id: '<?php echo $this->view['wpsg_mod_productvars']['p']['product_index']; ?>'
+ },
+ submit: '<?php echo __('Speichern', 'wpsg'); ?>',
+ type: 'textarea',
+ placeholder: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>',
+ indicator: '<?php echo __('Speicher ...', 'wpsg'); ?>',
+ tooltip: '<?php echo __('Zum Bearbeiten anklicken ...', 'wpsg'); ?>'
+ });
+ <?php }?>
</script>
diff --git a/views/mods/mod_productvars/overview_row.phtml b/views/mods/mod_productvars/overview_row.phtml
index 7499b5a..99d020f 100644
--- a/views/mods/mod_productvars/overview_row.phtml
+++ b/views/mods/mod_productvars/overview_row.phtml
@@ -28,6 +28,8 @@
<?php } else { ?>
<?php echo __('Nein', 'wpsg'); ?>
<?php } ?>
+ <?php } else if ($pv['typ'] == '4') { // mehrzeiliges Textfeld ?>
+ <?php echo nl2br(wpsg_hspc($this->view['wpsg_mod_productvars']['p']['wpsg_mod_productvars'][$pv['id']])); ?>
<?php } ?>
</div>
<div class="dummyr">
diff --git a/views/mods/mod_productvars/renderTemplate.phtml b/views/mods/mod_productvars/renderTemplate.phtml
index 871e6a9..bea2820 100644
--- a/views/mods/mod_productvars/renderTemplate.phtml
+++ b/views/mods/mod_productvars/renderTemplate.phtml
@@ -25,7 +25,9 @@
<?php } else if ($pv['typ'] == '3') { // Checkbox ?>
<input type="hidden" value="0" name="wpsg_mod_productvars[<?php echo $pv['id']; ?>]" />
<input <?php echo ((wpsg_isSizedString($pv['value'], '1'))?'checked="checked"':''); ?> type="checkbox" value="1" name="wpsg_mod_productvars[<?php echo $pv['id']; ?>]" />
- <?php } ?>
+ <?php } else if ($pv['typ'] == '4') { // Mehrzeiliges Textfeld ?>
+ <textarea rows="5" name="wpsg_mod_productvars[<?php echo $pv['id']; ?>]"><?php echo wpsg_hspc(wpsg_getStr($pv['value'])); ?></textarea>
+ <?php } ?>
</div>
</div>
<?php } ?>