Skip to content

Commit

Permalink
Added the new trash helper layout. Improves the access filter array s…
Browse files Browse the repository at this point in the history
…tate control. Adds the empty hidden title field for the permissions fix in the views, that fixes the ajax call for permissions change/save in the back-end. Moves the filter empty option outside the result loop, so that an empty option will show even if there is not items found. Fixes the database adaptation of the assets table. Removes empty access control tabs.
  • Loading branch information
Llewellynvdm committed Dec 31, 2020
1 parent 152026d commit 1b5191d
Show file tree
Hide file tree
Showing 66 changed files with 415 additions and 163 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe](mailto:[email protected])
+ *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015
+ *Last Build*: 4th December, 2020
+ *Last Build*: 31st December, 2020
+ *Version*: 2.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

## Build Time :hourglass:

**203 Hours** or **25 Eight Hour Days** (actual time the author saved -
**204 Hours** or **26 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder))

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **72798**
+ *File count*: **459**
+ *Line count*: **73050**
+ *File count*: **460**
+ *Folder count*: **93**

**134 Hours** or **17 Eight Hour Days** (the actual time the author spent)
**134 Hours** or **16 Eight Hour Days** (the actual time the author spent)

> (with the following break down:
> **debugging @51hours** = codingtime / 4;
> **planning @29hours** = codingtime / 7;
> **mapping @20hours** = codingtime / 10;
> **office @34hours** = codingtime / 6;)
**337 Hours** or **42 Eight Hour Days**
**338 Hours** or **42 Eight Hour Days**
(a total of the realistic time frame for this project)

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
Expand Down
12 changes: 6 additions & 6 deletions admin/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,32 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe](mailto:[email protected])
+ *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015
+ *Last Build*: 4th December, 2020
+ *Last Build*: 31st December, 2020
+ *Version*: 2.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html

## Build Time :hourglass:

**203 Hours** or **25 Eight Hour Days** (actual time the author saved -
**204 Hours** or **26 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder))

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)

+ *Line count*: **72798**
+ *File count*: **459**
+ *Line count*: **73050**
+ *File count*: **460**
+ *Folder count*: **93**

**134 Hours** or **17 Eight Hour Days** (the actual time the author spent)
**134 Hours** or **16 Eight Hour Days** (the actual time the author spent)

> (with the following break down:
> **debugging @51hours** = codingtime / 4;
> **planning @29hours** = codingtime / 7;
> **mapping @20hours** = codingtime / 10;
> **office @34hours** = codingtime / 6;)

**337 Hours** or **42 Eight Hour Days**
**338 Hours** or **42 Eight Hour Days**
(a total of the realistic time frame for this project)

> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
Expand Down
6 changes: 3 additions & 3 deletions admin/helpers/sermondistributor.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
Expand Down
6 changes: 5 additions & 1 deletion admin/language/en-GB/en-GB.com_sermondistributor.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ COM_SERMONDISTRIBUTOR_ADD_TOKEN_HERE="ADD TOKEN HERE!"
COM_SERMONDISTRIBUTOR_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER="All is good, please check again latter."
COM_SERMONDISTRIBUTOR_ALWAYS_BETTER_TO_ADD_THE_FILES_TO_EXTERNAL_SOURCE_AND_LET_THE_SYSTEM_CREATE_THE_SERMON_FOR_YOU_PLEASE_READ_INSTRUCTIONS_BELOW_CAREFULLY="Always better to add the files to External Source and let the system create the sermon for you. Please read instructions below carefully."
COM_SERMONDISTRIBUTOR_ARCHIVED="Archived"
COM_SERMONDISTRIBUTOR_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS="Are you sure you want to delete? Confirming will permanently delete the selected item(s)!"
COM_SERMONDISTRIBUTOR_AUTHOR="Author"
COM_SERMONDISTRIBUTOR_A_FEW_CLOSED_ISSUES_FROM_GITHUB_IS_LOADING="A few closed issues from Github is loading"
COM_SERMONDISTRIBUTOR_A_FEW_OPEN_ISSUES_FROM_GITHUB_IS_LOADING="A few open issues from Github is loading"
Expand Down Expand Up @@ -356,6 +357,8 @@ COM_SERMONDISTRIBUTOR_EDIT_CREATED_DATE_DESC="Allows users in this group to edit
COM_SERMONDISTRIBUTOR_EDIT_S="Edit %s"
COM_SERMONDISTRIBUTOR_EDIT_VERSIONS="Edit Version"
COM_SERMONDISTRIBUTOR_EDIT_VERSIONS_DESC="Allows users in this group to edit versions."
COM_SERMONDISTRIBUTOR_EMPTY_TRASH="Empty trash"
COM_SERMONDISTRIBUTOR_EXIT_TRASH="Exit trash"
COM_SERMONDISTRIBUTOR_EXPORT_DATA="Export Data"
COM_SERMONDISTRIBUTOR_EXPORT_DATA_DESC="Allows users in this group to export data."
COM_SERMONDISTRIBUTOR_EXPORT_FAILED="Export Failed"
Expand Down Expand Up @@ -815,7 +818,6 @@ COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_MODIFIED_DATE_LABEL="Modified Date"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_NEW="A New Help Document"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_NOT_REQUIRED="Not Required"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ORDERING_LABEL="Ordering"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_PERMISSION="Permissions"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_PUBLISHING="Publishing"
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Help Document to customise the alias."
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SELECT_AN_OPTION="Select an option"
Expand Down Expand Up @@ -1592,6 +1594,7 @@ COM_SERMONDISTRIBUTOR_THE_WIKI_IS_LOADING="The wiki is loading"
COM_SERMONDISTRIBUTOR_THIS_SOURCE_HAS_NO_LOCAL_LISTING_SET="This source has no local listing set."
COM_SERMONDISTRIBUTOR_TOTAL_DOWNLOADS="total downloads"
COM_SERMONDISTRIBUTOR_TRASHED="Trashed"
COM_SERMONDISTRIBUTOR_TRASHED_ITEMS="Trashed items"
COM_SERMONDISTRIBUTOR_TYPE_EXTERNAL_SOURCE="External Source"
COM_SERMONDISTRIBUTOR_TYPE_HELP_DOCUMENT="Help Document"
COM_SERMONDISTRIBUTOR_TYPE_LOCAL_LISTING="Local Listing"
Expand All @@ -1610,5 +1613,6 @@ COM_SERMONDISTRIBUTOR_VIEW_MORE_ISSUES_ON_GITHUB="View more issues on Github"
COM_SERMONDISTRIBUTOR_VIEW_MORE_RELEASES_ON_GITHUB="View more releases on Github"
COM_SERMONDISTRIBUTOR_VIEW_UPDATE_STATUS="View Update Status"
COM_SERMONDISTRIBUTOR_WEBSITE="Website"
COM_SERMONDISTRIBUTOR_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items."
COM_SERMONDISTRIBUTOR_YOU_DO_NOT_HAVE_PERMISSION_TO_CLEAR_LOCAL_LISTING="You do not have permission to clear local listing."
COM_SERMONDISTRIBUTOR_YOU_DO_NOT_HAVE_PERMISSION_TO_RESET_UPDATE_STATUS="You do not have permission to reset update status."
1 change: 1 addition & 0 deletions admin/layouts/external_source/publishing.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'title',
'created',
'created_by',
'modified',
Expand Down
1 change: 1 addition & 0 deletions admin/layouts/local_listing/publishing.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'title',
'created',
'created_by',
'modified',
Expand Down
1 change: 1 addition & 0 deletions admin/layouts/preacher/publishing.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'title',
'created',
'created_by',
'modified',
Expand Down
1 change: 1 addition & 0 deletions admin/layouts/series/publishing.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'title',
'created',
'created_by',
'modified',
Expand Down
1 change: 1 addition & 0 deletions admin/layouts/sermon/publishing.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'title',
'created',
'created_by',
'modified',
Expand Down
1 change: 1 addition & 0 deletions admin/layouts/statistic/publishing.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

// get the fields
$fields = $displayData->get($fields_tab_layout) ?: array(
'title',
'created',
'created_by',
'modified',
Expand Down
78 changes: 78 additions & 0 deletions admin/layouts/trashhelper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?php
/*-------------------------------------------------------------------------------------------------------------| www.vdm.io |------/
____ ____ __ __ __
/\ _`\ /\ _`\ __ /\ \__ __/\ \ /\ \__
\ \,\L\_\ __ _ __ ___ ___ ___ ___ \ \ \/\ \/\_\ ____\ \ ,_\ _ __ /\_\ \ \____ __ __\ \ ,_\ ___ _ __
\/_\__ \ /'__`\/\`'__\/' __` __`\ / __`\ /' _ `\ \ \ \ \ \/\ \ /',__\\ \ \/ /\`'__\/\ \ \ '__`\/\ \/\ \\ \ \/ / __`\/\`'__\
/\ \L\ \/\ __/\ \ \/ /\ \/\ \/\ \/\ \L\ \/\ \/\ \ \ \ \_\ \ \ \/\__, `\\ \ \_\ \ \/ \ \ \ \ \L\ \ \ \_\ \\ \ \_/\ \L\ \ \ \/
\ `\____\ \____\\ \_\ \ \_\ \_\ \_\ \____/\ \_\ \_\ \ \____/\ \_\/\____/ \ \__\\ \_\ \ \_\ \_,__/\ \____/ \ \__\ \____/\ \_\
\/_____/\/____/ \/_/ \/_/\/_/\/_/\/___/ \/_/\/_/ \/___/ \/_/\/___/ \/__/ \/_/ \/_/\/___/ \/___/ \/__/\/___/ \/_/
/------------------------------------------------------------------------------------------------------------------------------------/
@version 2.0.x
@created 22nd October, 2015
@package Sermon Distributor
@subpackage trashhelper.php
@author Llewellyn van der Merwe <https://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
A sermon distributor that links to Dropbox.
/----------------------------------------------------------------------------------------------------------------------------------*/

// No direct access to this file
defined('JPATH_BASE') or die('Restricted access');



?>
<?php if ($displayData->state->get('filter.published') == -2 && ($displayData->canState && $displayData->canDelete)) : ?>
<script>
// change the class of the delete button
jQuery("#toolbar-delete button").toggleClass("btn-danger");
// function to empty the trash
function emptyTrash() {
if (document.adminForm.boxchecked.value == 0) {
// select all the items visable
document.adminForm.elements['checkall-toggle'].checked=1;
Joomla.checkAll(document.adminForm.elements['checkall-toggle']);
// check to confirm the deletion
if(confirm('<?= JText::_("COM_SERMONDISTRIBUTOR_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS") ?>')) {
Joomla.submitbutton('<?= $displayData->get("name") ?>.delete');
} else {
document.adminForm.elements['checkall-toggle'].checked=0;
Joomla.checkAll(document.adminForm.elements['checkall-toggle']);
}
} else {
// confirm deletion of those selected
if (confirm('<?= JText::_("COM_SERMONDISTRIBUTOR_ARE_YOU_SURE_YOU_WANT_TO_DELETE_CONFIRMING_WILL_PERMANENTLY_DELETE_THE_SELECTED_ITEMS") ?>')) {
Joomla.submitbutton('<?= $displayData->get("name") ?>.delete');
};
}
return false;
}
// function to exit the tash state
function exitTrash() {
document.adminForm.filter_published.selectedIndex = 0;
document.adminForm.submit();
return false;
}
</script>
<div class="alert alert-error">
<h4 class="alert-heading">
<span class="icon-trash"></span>
<?= JText::_("COM_SERMONDISTRIBUTOR_TRASHED_ITEMS") ?>
</h4>
<p><?= JText::_("COM_SERMONDISTRIBUTOR_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS") ?></p>
<button onclick="emptyTrash();" class="btn btn-small btn-danger">
<span class="icon-delete" aria-hidden="true"></span>
<?= JText::_("COM_SERMONDISTRIBUTOR_EMPTY_TRASH") ?>
</button>
<button onclick="exitTrash();" class="btn btn-small">
<span class="icon-back" aria-hidden="true"></span>
<?= JText::_("COM_SERMONDISTRIBUTOR_EXIT_TRASH") ?>
</button>
</div>
<?php endif; ?>
7 changes: 3 additions & 4 deletions admin/models/fields/externalsourcesfilterbuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,22 @@ protected function getOptions()
$db->setQuery($query);

$results = $db->loadColumn();
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_BUILD') . ' -');

if ($results)
{
// get external_sourcesmodel
$model = SermondistributorHelper::getModel('external_sources');
$results = array_unique($results);
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_BUILD') . ' -');
foreach ($results as $build)
{
// Translate the build selection
$text = $model->selectionTranslation($build,'build');
// Now add the build and its text to the options array
$_filter[] = JHtml::_('select.option', $build, JText::_($text));
}
return $_filter;
}
return false;
return $_filter;
}
}
7 changes: 3 additions & 4 deletions admin/models/fields/externalsourcesfilterexternalsources.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,22 @@ protected function getOptions()
$db->setQuery($query);

$results = $db->loadColumn();
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_EXTERNALSOURCES') . ' -');

if ($results)
{
// get external_sourcesmodel
$model = SermondistributorHelper::getModel('external_sources');
$results = array_unique($results);
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_EXTERNALSOURCES') . ' -');
foreach ($results as $externalsources)
{
// Translate the externalsources selection
$text = $model->selectionTranslation($externalsources,'externalsources');
// Now add the externalsources and its text to the options array
$_filter[] = JHtml::_('select.option', $externalsources, JText::_($text));
}
return $_filter;
}
return false;
return $_filter;
}
}
7 changes: 3 additions & 4 deletions admin/models/fields/externalsourcesfilterupdatemethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,22 @@ protected function getOptions()
$db->setQuery($query);

$results = $db->loadColumn();
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_UPDATE_METHOD') . ' -');

if ($results)
{
// get external_sourcesmodel
$model = SermondistributorHelper::getModel('external_sources');
$results = array_unique($results);
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_UPDATE_METHOD') . ' -');
foreach ($results as $update_method)
{
// Translate the update_method selection
$text = $model->selectionTranslation($update_method,'update_method');
// Now add the update_method and its text to the options array
$_filter[] = JHtml::_('select.option', $update_method, JText::_($text));
}
return $_filter;
}
return false;
return $_filter;
}
}
7 changes: 3 additions & 4 deletions admin/models/fields/helpdocumentsfilterlocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,22 @@ protected function getOptions()
$db->setQuery($query);

$results = $db->loadColumn();
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_LOCATION') . ' -');

if ($results)
{
// get help_documentsmodel
$model = SermondistributorHelper::getModel('help_documents');
$results = array_unique($results);
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_LOCATION') . ' -');
foreach ($results as $location)
{
// Translate the location selection
$text = $model->selectionTranslation($location,'location');
// Now add the location and its text to the options array
$_filter[] = JHtml::_('select.option', $location, JText::_($text));
}
return $_filter;
}
return false;
return $_filter;
}
}
7 changes: 3 additions & 4 deletions admin/models/fields/helpdocumentsfiltertype.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,22 @@ protected function getOptions()
$db->setQuery($query);

$results = $db->loadColumn();
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_TYPE') . ' -');

if ($results)
{
// get help_documentsmodel
$model = SermondistributorHelper::getModel('help_documents');
$results = array_unique($results);
$_filter = array();
$_filter[] = JHtml::_('select.option', '', '- ' . JText::_('COM_SERMONDISTRIBUTOR_FILTER_SELECT_TYPE') . ' -');
foreach ($results as $type)
{
// Translate the type selection
$text = $model->selectionTranslation($type,'type');
// Now add the type and its text to the options array
$_filter[] = JHtml::_('select.option', $type, JText::_($text));
}
return $_filter;
}
return false;
return $_filter;
}
}
Loading

0 comments on commit 1b5191d

Please sign in to comment.