From 3f5bf8d7f7165791399744f85667039ec644ba3c Mon Sep 17 00:00:00 2001
From: Reinhold Kainhofer <reinhold@kainhofer.com>
Date: Sun, 8 Mar 2015 18:38:25 +0100
Subject: [PATCH] Code cleanup; Fix selectbox width

---
 controllers/eurecap.php        | 16 ----------------
 models/eurecap.php             |  6 +++---
 views/eurecap/tmpl/default.php | 20 +++++++++-----------
 3 files changed, 12 insertions(+), 30 deletions(-)

diff --git a/controllers/eurecap.php b/controllers/eurecap.php
index 52a9f85..1cd499e 100644
--- a/controllers/eurecap.php
+++ b/controllers/eurecap.php
@@ -67,25 +67,9 @@ class VirtuemartControllerEuRecap extends VmController {
 		vRequest::setVar('task', $layout);
 // 		vRequest::setVar('format', 'raw');
 
-// $japp = &JApplication::getInstance("site"); // fetches the current application
-// $japp->setTemplate("", null); // sets an empty template, disables the default one
-// $document = &JFactory::getDocument(); // gets the document, that the user wants
-// $document->setType("raw"); // sets its type to raw
-// JRequest::setVar("format", "raw"); // this one is not obligatory, but my component uses this in the view later
-		
-// 		$document = JDocument::getInstance('raw');  //this new instance is a raw document object
-// 		$viewType = $document->getType();
-// 		// $viewname below is set in jinput or as you named it
-// 		$view = $this->getView($viewName, $viewType);
-// // 		$this->input->set('view', $viewName);
-// 		$this->input->set('view', $viewName);
-
 		$document = JFactory::getDocument();
-// 		$document->setType('raw');
 		$viewType = $document->getType();
 		$view = $this->getView($viewName, $viewType);
-
-JFactory::getApplication()->enqueueMessage("Export function in controller", 'warning');
 		$view->setLayout($layout);
 
 		$this->display();
diff --git a/models/eurecap.php b/models/eurecap.php
index c90e240..e84d87b 100644
--- a/models/eurecap.php
+++ b/models/eurecap.php
@@ -235,7 +235,7 @@ class VirtuemartModelEuRecap extends VmModel {
 		foreach ($vals as $month=>$label) {
 			$options[] = JHtml::_ ('select.option', $label, $month);
 		}
-		$listHTML = JHtml::_ ('select.genericlist', $options, 'month', 'size="7" class="inputbox" onchange="this.form.submit();" ', 'text', 'value', $selected);
+		$listHTML = JHtml::_ ('select.genericlist', $options, 'month', 'class="inputbox" style="width: inherit" onchange="this.form.submit();" ', 'text', 'value', $selected);
 
 		return $listHTML;
 	}
@@ -245,7 +245,7 @@ class VirtuemartModelEuRecap extends VmModel {
 		foreach (range(2010, 2020) as $year) {
 			$options[] = JHtml::_ ('select.option', $year, $year);
 		}
-		$listHTML = JHtml::_ ('select.genericlist', $options, 'year', 'size="7" class="inputbox" onchange="this.form.submit();" ', 'text', 'value', $selected);
+		$listHTML = JHtml::_ ('select.genericlist', $options, 'year', 'class="inputbox" style="width: inherit" onchange="this.form.submit();" ', 'text', 'value', $selected);
 		return $listHTML;
 	}
 	
@@ -263,7 +263,7 @@ class VirtuemartModelEuRecap extends VmModel {
 			$value = substr($tmpl, 7, -4); // Cut off export_ and .php
 			$options[] = JHtml::_('select.option', vmText::_('VMEXT_EU_RECAP_EXPORT_' . strtoupper($value)), $value);
         }
-        $listHTML = JHtml::_ ('select.genericlist', $options, 'export_format', 'size="7" class="inputbox" ', 'text', 'value', $selected);
+        $listHTML = JHtml::_ ('select.genericlist', $options, 'export_format', 'size="7" class="inputbox"', 'text', 'value', $selected);
         return $listHTML;
 	}
 
diff --git a/views/eurecap/tmpl/default.php b/views/eurecap/tmpl/default.php
index 13b1584..71c21c1 100644
--- a/views/eurecap/tmpl/default.php
+++ b/views/eurecap/tmpl/default.php
@@ -26,7 +26,7 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance();
 
 
 ?>
-<pre><?php print_r(vRequest::getRequest()); ?></pre>
+
 <form action="index.php" method="post" name="adminForm" id="adminForm">
 	<?php echo $this->addStandardHiddenToForm(); ?>
 
@@ -37,6 +37,7 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance();
             <table width="100%">
                 <tr width="100%">
                     <td align="left">
+						<div style="float: left">
 						<?php 
 						echo vmText::_('VMEXT_EU_RECAP_LIST_PERIOD');
 						if ($this->frequency<12) {
@@ -48,17 +49,14 @@ $myCurrencyDisplay = CurrencyDisplay::getInstance();
                             $vendorId = vRequest::getInt('virtuemart_vendor_id',1);
                             echo ShopFunctions::renderVendorList($vendorId,false);
                         } ?><br>
-                        <label><input type="checkbox" <?php if ($this->include_taxed_orders) { ?>checked <?php } ?> name="include_taxed_orders" value="true" style="    vertical-align: middle; position: relative; bottom: 1px;">&nbsp;&nbsp;&nbsp;<?php echo vmText::_('VMEXT_EU_RECAP_INCLUDE_TAXED'); ?></label>
-                        
-					</td>
-					<td align="left" width="5%">
-                        <button class="btn btn-small" name="Go" onclick="this.form.task.value=''; this.form.submit();"><?php echo vmText::_('COM_VIRTUEMART_GO'); ?></button>
+                        <label><input type="checkbox" <?php if ($this->include_taxed_orders) { ?>checked <?php } ?> name="include_taxed_orders" value="true" style="vertical-align: top; position: relative; bottom: 1px;">&nbsp;<?php echo vmText::_('VMEXT_EU_RECAP_INCLUDE_TAXED'); ?></label>
+                        </div>
+                        <span><button class="btn btn-small" name="Go" onclick="this.form.task.value=''; this.form.submit();"><?php echo vmText::_('COM_VIRTUEMART_GO'); ?></button></span>
                     </td>
-                    <td width="30%"></td>
-					<td align="right" width>
-						<?php echo $this->export_format_list; ?>
-                        <button class="btn btn-small" name="format" value="raw" onclick="this.form.task.value='export'; this.form.submit();"><?php echo vmText::_('VMEXT_EU_RECAP_EXPORT'); ?>
-                        </button>
+                    <td align="right" style="vertical-align: top">
+						<div style="float: right"><?php echo $this->export_format_list; ?>
+                        <button class="btn btn-small" name="format" value="raw" onclick="this.form.task.value='export'; this.form.submit();" style="vertical-align: top;"><?php echo vmText::_('VMEXT_EU_RECAP_EXPORT'); ?>
+                        </button></div>
                     </td>
                 </tr>
             </table>
-- 
GitLab