Skip to content
Permalink
Browse files

4.7.8 enhancement

  • Loading branch information...
Theophilix committed Sep 19, 2019
1 parent 28fd44d commit 12ce4da9eb1cc2a99e5b38b1f9c25c8a2dc964b6
Showing with 152 additions and 13 deletions.
  1. +9 −1 README.md
  2. +3 −3 eventtableedit.xml
  3. +7 −4 script.php
  4. +2 −2 site/models/etetable.php
  5. +128 −1 site/views/etetable/tmpl/default.php
  6. +3 −2 site/views/etetable/view.html.php
@@ -7,7 +7,7 @@ As it is based on a CSS-template, the layout of the table can be changed easily.

Try all the functions (including backend) on the demo site: https://demo.eventtableedit.com. Log in as user or admin with the given login credentials.

**Download latest version 4.7.6** (release date: 05.05.2019): https://github.com/Theophilix/event-table-edit/archive/master.zip.
**Download latest version 4.7.8** (release date: 19.09.2019): https://github.com/Theophilix/event-table-edit/archive/master.zip.

Download older versions here: https://github.com/Theophilix/event-table-edit/releases.

@@ -18,6 +18,7 @@ Version history: scroll down to "II".
- Editable table (insert pictures, BBCode...)
- Sorting options (A-Z, Z-A, natural sorting is used)
- Choice of layout mode (stack, swipe, toggle) for enhanced responsiveness
- Istant filter / search
- Multiple appointment booking function with confirmation email and ICAL calendar (.ics file) attachment
- Complete rights management (Joomla ACL: add/delete rows, edit cells, rearrange rows, administer table from frontend)
- Multilingual (currently available: DE, EN)
@@ -76,6 +77,13 @@ Please post all feature requests in the issues tab.
## II Version history


*For version 4.7.8:**

[1] Normal mode

- enhancement: Frontend: Join both filters into one instant filter again https://github.com/Theophilix/event-table-edit/issues/151


*For version 4.7.7:**

[1] Normal mode
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<extension type="component" version="4.7.7" method="upgrade">
<extension type="component" version="4.7.8" method="upgrade">
<name>com_eventtableedit</name>
<creationDate>05-09-2019</creationDate>
<creationDate>19-09-2019</creationDate>
<author>Manuel Kaspar and Theophilix</author>
<license>GNU/GPL</license>
<copyright>2007 - 2019 Manuel Kaspar and Theophilix</copyright>
<authorEmail>webmaster@eventtableedit.com</authorEmail>
<authorUrl>http://www.eventtableedit.com</authorUrl>
<version>4.7.7</version>
<version>4.7.8</version>
<description>COM_EVENTTABLEEDIT_DESCRIPTION</description>

<scriptfile>script.php</scriptfile>
@@ -122,11 +122,14 @@ function update($parent)
$db->setQuery($query);
$db->query();
}
$query = 'ALTER TABLE `#__eventtableedit_details` ADD `standardlayout` varchar(255) NOT NULL;';
$query = "SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = '".$prefix."eventtableedit_details' AND COLUMN_NAME = 'standardlayout'";
$db->setQuery($query);
$db->query();
$data = $db->loadObject();
if(empty($data)){
$query = 'ALTER TABLE `#__eventtableedit_details` ADD `standardlayout` varchar(255) NOT NULL;';
$db->setQuery($query);
$db->query();
}
echo '<p>' . JText::_('COM_EVENTTABLEEDIT_UPDATE_TEXT') . '</p>';
}
@@ -177,7 +177,7 @@ public function &getItem($pk = null)
// Settings for pagination
// Default Pagebreak if not set
$limit = $data->pagebreak;
/* $limit = $data->pagebreak;
if($data->show_pagination==1){
if ($limit == '') {
$limit = 100;
@@ -187,7 +187,7 @@ public function &getItem($pk = null)
}else{
//$limit = $app->getUserStateFromRequest('com_eventtableedit.etetable.list.' . $pk . '.limit', 'limit', $limit);
$this->setState('list.limit', '');
}
} */
$this->getACL($data);
@@ -83,6 +83,14 @@ function naturalSort (a, b) {
</script>
<style>
<?php if($this->item->show_pagination) { ?>
#etetable-table{display: none;}
<?php } ?>
span.filter-head{display: none;}
div.field-calendar{display: none;}
div.etetable-button{display: none;}
</style>
<?php
foreach ($this->heads as $headSort) {
@@ -280,4 +288,123 @@ function naturalSort (a, b) {
}
</style>
<?php } ?>
<?php } ?>
<?php if($this->item->show_pagination) { ?>
<div>
<a href="#" class="paginate" id="previous">&laquo;</a> <a href="#" class="paginate" id="next">&raquo;</a>
</div>
<?php } ?>
<style>
.paginate{
width: 20px;
height: 20px;
text-align: center;
border: solid 1px #ccc;
margin: 10px 5px 0 0;
float: left;
color: #000;
text-decoration: none;
}
.paginate:hover, .paginate:active, .paginate:focus{
text-decoration: none;
}
</style>
<script type='text/javascript'>
// Selectors for future use
var myTable = "#etetable-table";
var myTableBody = myTable + " tbody";
var myTableRows = myTableBody + " tr";
var myTableColumn = myTable + " th";
// Starting table state
function initTable(size=4) {
jQuery(myTableBody).attr("data-pageSize", size);
jQuery(myTableBody).attr("data-firstRecord", 0);
jQuery('#previous').hide();
jQuery('#next').show();
// Increment the table width for sort icon support
// Start the pagination
paginate(parseInt(jQuery(myTableBody).attr("data-firstRecord"), 10),
parseInt(jQuery(myTableBody).attr("data-pageSize"), 10));
}
// Heading click
jQuery(myTableColumn).click(function () {
// Start the pagination
paginate(parseInt(jQuery(myTableBody).attr("data-firstRecord"), 10),
parseInt(jQuery(myTableBody).attr("data-pageSize"), 10));
});
// Pager click
jQuery("a.paginate").click(function (e) {
e.preventDefault();
var tableRows = jQuery(myTableRows);
var tmpRec = parseInt(jQuery(myTableBody).attr("data-firstRecord"), 10);
var pageSize = parseInt(jQuery(myTableBody).attr("data-pageSize"), 10);
// Define the new first record
if (jQuery(this).attr("id") == "next") {
tmpRec += pageSize;
} else {
tmpRec -= pageSize;
}
// The first record is < of 0 or > of total rows
if (tmpRec < 0 || tmpRec > tableRows.length) return
jQuery(myTableBody).attr("data-firstRecord", tmpRec);
paginate(tmpRec, pageSize);
});
// Paging function
var paginate = function (start, size) {
var tableRows = jQuery(myTableRows).not('.musthide');
var end = start + size;
// Hide all the rows
tableRows.hide();
// Show a reduced set of rows using a range of indices.
tableRows.slice(start, end).show();
jQuery(myTable).show();
// Show the pager
jQuery(".paginate").show();
jQuery('.paginate').removeAttr('disabled');
// If the first row is visible hide prev
if (tableRows.eq(0).is(":visible")) jQuery('#previous').hide();
// If the last row is visible hide next
if (tableRows.eq(tableRows.length - 1).is(":visible")) jQuery('#next').hide();
}
jQuery(function () {
<?php if($this->item->show_pagination) { ?>
initTable('<?php echo $this->item->pagebreak;?>');
<?php } ?>
});
</script>

<script>
var $rows = jQuery('#etetable-table tbody tr');
jQuery(document).ready(function() {
jQuery('.filterstring').keyup(function() {
var val = jQuery.trim(jQuery(this).val()).replace(/ +/g, ' ').toLowerCase();
$rows.show().removeClass('musthide').filter(function() {
var text = jQuery(this).find('td:visible').text().replace(/\s+/g, ' ').toLowerCase();
//console.log(jQuery(this).find('td:visible').text());
return !~text.indexOf(val);
}).hide().addClass('musthide');
//initTable(5);
<?php if($this->item->show_pagination) { ?>
initTable('<?php echo $this->item->pagebreak;?>');
<?php } ?>
});
});
</script>
@@ -264,9 +264,10 @@ private function getVariableStyles($cellspacing, $cellpadding, $linecolor0, $lin
}
// If Pagination must not be shown
if (!$this->item->show_pagination) {
/* if (!$this->item->show_pagination) {
$style[] = ".eventtableedit .limit {display: none;}";
}
} */
$style[] = ".eventtableedit .limit {display: none;}";
if ($this->item->rowsort == 0) {
$style[] = ".eventtableedit .sort_col {display: none !important;}";
//$style[] = ".eventtableedit .tablesaw-priority-50 {display: none !important;}";

0 comments on commit 12ce4da

Please sign in to comment.
You can’t perform that action at this time.