diff options
| author | Daniel Schmitzer <noreply@maennchen1.de> | 2016-11-17 10:21:15 +0000 |
|---|---|---|
| committer | Daniel Schmitzer <noreply@maennchen1.de> | 2016-11-17 10:21:15 +0000 |
| commit | 8904e0b77c9cd896fa0b0f75987a6d22be59c7de (patch) | |
| tree | fbc398b63daed7e529980fd028ca36a12a5a9c33 | |
| parent | 6111f04f6412b723f35fa844119ed31644531940 (diff) | |
- Zubehörprodukte Produktauswahl in Produktverwaltung schön gemacht
git-svn-id: https://[internal]/wordpress/plugins/wpsg4@5916 0d5edaf7-2b12-4e95-93f4-047927463d4b
| -rw-r--r-- | views/admin/form/select.phtml | 6 | ||||
| -rw-r--r-- | views/mods/mod_relatedproducts/list.phtml | 11 | ||||
| -rw-r--r-- | views/mods/mod_relatedproducts/produkt_addedit_sidebar.phtml | 92 | ||||
| -rw-r--r-- | views/produkt/select.phtml | 5 |
4 files changed, 61 insertions, 53 deletions
diff --git a/views/admin/form/select.phtml b/views/admin/form/select.phtml index 1816945..89a811e 100644 --- a/views/admin/form/select.phtml +++ b/views/admin/form/select.phtml @@ -1,4 +1,4 @@ -<div class="form-group form-group-sm form-select <?php echo ((wpsg_isSizedString($this->view['field_config']['help']))?'has-feedback':''); ?>">
+<div class="form-group form-group-sm form-select <?php echo ((wpsg_isSizedString($this->view['field_config']['help']) || wpsg_isSizedString($this->view['field_config']['icon']))?'has-feedback':''); ?>">
<label class="col-sm-6 control-label" for="<?php echo $this->view['field_id']; ?>"><?php echo $this->view['field_label']; ?></label>
@@ -83,6 +83,10 @@ <a href="#" data-wpsg-tip="<?php echo $this->view['field_config']['help']; ?>" rel="?page=wpsg-Admin&subaction=loadHelp&noheader=1&field=<?php echo $this->view['field_config']['help']; ?>" class="glyphicon glyphicon glyphicon-info-sign form-control-feedback" aria-hidden="true"></a>
<?php } ?>
+ <?php if (wpsg_isSizedString($this->view['field_config']['icon'])) { ?>
+ <a href="#" class="<?php echo $this->view['field_config']['icon']; ?> form-control-feedback" aria-hidden="true"></a>
+ <?php } ?>
+
</div>
</div>
diff --git a/views/mods/mod_relatedproducts/list.phtml b/views/mods/mod_relatedproducts/list.phtml index e123559..9299683 100644 --- a/views/mods/mod_relatedproducts/list.phtml +++ b/views/mods/mod_relatedproducts/list.phtml @@ -11,16 +11,7 @@ <?php } else { ?>
<?php foreach ($this->view['wpsg_mod_relatedproducts']['data'] as $p) { ?>
<span id="wpsg_rp_<?php echo $p['id']; ?>">
- <?php if (!wpsg_isSizedString($this->get_option('wpsg_mod_relatedproducts_template')) || $this->get_option('wpsg_mod_relatedproducts_template') == '0') { ?>
- <?php echo wpsg_drawForm_Select('wpsg_mod_relatedproduct['.$p['id'].']', $p['name'], $this->view['wpsg_mod_relatedproducts']['arTemplates'], $p['template'], array('remove' => __('Zuordnung löschen', 'wpsg'), 'labellink' => WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id='.$p['id'])); ?>
- <?php } else { ?>
- <a class="wpsg_icon wpsg_icon_right wpsg_icon_remove" href="#" title="<?php echo __('Zuordnung löschen', 'wpsg'); ?>"></a>
- <span style="line-height:25px;">
- <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Produkt&action=edit&edit_id=<?php echo $p['id']; ?>">
- <?php echo wpsg_hspc($p['name']); ?>
- </a>
- </span>
- <?php } ?>
+ <?php echo wpsg_drawForm_Select('wpsg_mod_relatedproduct['.$p['id'].']', $p['name'], $this->view['wpsg_mod_relatedproducts']['arTemplates'], $p['template'], array('icon' => 'wpsg_icon_remove glyphicon glyphicon-trash')); ?>
</span>
<div class="wpsg_clear"></div>
<?php } ?>
diff --git a/views/mods/mod_relatedproducts/produkt_addedit_sidebar.phtml b/views/mods/mod_relatedproducts/produkt_addedit_sidebar.phtml index 96c4b6f..ed87073 100644 --- a/views/mods/mod_relatedproducts/produkt_addedit_sidebar.phtml +++ b/views/mods/mod_relatedproducts/produkt_addedit_sidebar.phtml @@ -5,54 +5,70 @@ */
?>
+<div id="wpsg_mod_relatedproducts_dialog" class="modal fade" tabindex="-1" role="dialog">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal" aria-label="<?php echo __('Abbrechen', 'wpsg'); ?>"><span aria-hidden="true">×</span></button>
+ <h4 class="modal-title"><?php echo __('Produktauswahl', 'wpsg'); ?></h4>
+ </div>
+ <div class="modal-body">
+
+ </div>
+ <div class="modal-footer">
+
+ <button type="button" class="btn-sm btn btn-default" data-dismiss="modal"><?php echo __('Abbrechen', 'wpsg'); ?></button>
+ <button type="button" class="btn-sm btn btn-primary" onclick="return insertProdukt();"><?php echo __('Einfügen', 'wpsg'); ?></button>
+ <button type="button" class="btn-sm btn btn-primary" onclick="return insertProduktClose();"><?php echo __('Einfügen und schließen', 'wpsg'); ?></button>
+
+ </div>
+
+ </div>
+ </div>
+</div>
+
<div id="wpsg_relatedproducts" class="panel panel-default">
<div class="panel-heading clearfix">
<h3 class="panel-title">
<?php echo __('Zubehörprodukte', 'wpsg'); ?>
</h3>
</div>
- <div class="panel-body">
- <a title="<?php echo __('Neuens Produkt zuordnen', 'wpsg'); ?>" href="" class="wpsg_icon wpsg_icon_right wpsg_icon_add" onclick="return wpsg_relatedproducts_add();"></a>
- <div class="wpsg_clear"></div>
+ <div class="panel-body">
<div id="relatedproducts_list"><?php echo $this->callMod('wpsg_mod_relatedproducts', 'drawList', array($this->view['data']['id'])); ?></div>
-<script type="text/javascript">
-
- /**
- * Wird aufgerufen wenn ein Produkt zugeordnet werden soll
- */
- function wpsg_relatedproducts_add()
- {
-
- jQuery('#wpsg_relatedproducts_produktauswahl').html('<img style="margin:15px;" src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+ <script type="text/javascript">
- jQuery('#wpsg_relatedproducts_produktauswahl').dialog( {
- 'dialogClass': 'wp-dialog',
- 'modal': true,
- 'width': 390,
- 'height': 350,
- 'title': '<?php echo __('Produktauswahl', 'wpsg'); ?>',
- 'open': function() {
-
- jQuery.ajax( {
- url: 'admin.php?page=wpsg-Produkt&action=select&noheader=1&wpsg_mode=wpsg_mod_relatedproducts&edit_id=<?php echo $this->view['data']['id']; ?>',
- success: function(data) {
- jQuery('#wpsg_relatedproducts_produktauswahl').html(data);
- }
- } );
-
- }
- } );
-
- return false;
-
- } // function wpsg_relatedproducts_add()
-
-</script>
-
- <br /><br />
+ /**
+ * Wird aufgerufen wenn ein Produkt zugeordnet werden soll
+ */
+ function wpsg_relatedproducts_add()
+ {
+
+ jQuery('#wpsg_mod_relatedproducts_dialog .modal-body').html('<img src="<?php echo WPSG_URL; ?>views/gfx/ajax-loader.gif" alt="<?php echo __('Bitte warten ...', 'wpsg'); ?>" />');
+ jQuery('#wpsg_mod_relatedproducts_dialog').modal( { } ).modal('show');
+
+ jQuery.ajax( {
+ url: 'admin.php?page=wpsg-Produkt&action=select&noheader=1&wpsg_mode=wpsg_mod_relatedproducts&edit_id=<?php echo $this->view['data']['id']; ?>',
+ success: function(data) {
+
+ jQuery('#wpsg_mod_relatedproducts_dialog .modal-body').html(data);
+
+ }
+ } );
+
+ return false;
+
+ } // function wpsg_relatedproducts_add()
+
+ </script>
+
+ <br />
+
+ <a title="<?php echo __('Neuens Produkt zuordnen', 'wpsg'); ?>" href="" onclick="return wpsg_relatedproducts_add();"><span class="wpsg-glyphicon glyphicon glyphicon-plus"></span><?php echo __('Produkt zuordnen', 'wpsg'); ?></a>
+
+ <br /><br />
- <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_relatedproducts"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Zubehörprodukte', 'wpsg'); ?></a>
+ <a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_relatedproducts"><span class="wpsg-glyphicon glyphicon glyphicon-wrench"></span><?php echo __('Zur Konfiguration der Zubehörprodukte', 'wpsg'); ?></a>
</div>
</div>
\ No newline at end of file diff --git a/views/produkt/select.phtml b/views/produkt/select.phtml index 4fd93b5..1edac16 100644 --- a/views/produkt/select.phtml +++ b/views/produkt/select.phtml @@ -138,10 +138,7 @@ <?php echo wpsg_drawForm_Select('produkt', __('Produkt', 'wpsg'), $this->view['arProdukte'], false); ?>
<?php echo wpsg_drawForm_Select('template', __('Template', 'wpsg'), $this->view['arTemplates'], false); ?>
- <?php if ($_REQUEST['wpsg_mode'] == 'wpsg_mod_relatedproducts') { ?>
- <input class="button" type="button" style="float:right; padding:2px 10px 2px 10px;" value="<?php echo __('Einfügen und schließen', 'wpsg'); ?>" onclick="return insertProduktClose();" />
- <input class="button" type="button" style="float:right; padding:2px 10px 2px 10px; margin-right:5px;" value="<?php echo __('Einfügen', 'wpsg'); ?>" onclick="return insertProdukt();" />
- <?php } else { ?>
+ <?php if ($_REQUEST['wpsg_mode'] != 'wpsg_mod_relatedproducts') { ?>
<input type="button" style="float:right; padding:2px;" value="<?php echo __('Einfügen', 'wpsg'); ?>" onclick="return insertProdukt();" />
<?php } ?>
|
