Added the new player and made some major security improvements.

This commit is contained in:
Llewellyn van der Merwe 2016-07-02 18:49:17 +01:00
parent f6cde40d97
commit abfa31df70
263 changed files with 2335 additions and 2321 deletions

View File

@ -1,4 +1,4 @@
# Sermon Distributor (1.3.2)
# Sermon Distributor (1.3.3)
![Sermon Distributor image] (https://raw.githubusercontent.com/SermonDistributor/Joomla-3-Component/master/admin/assets/images/component-300.jpg "The Sermon Distributor")
@ -23,8 +23,8 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe] (mailto:llewellyn@vdm.io)
+ *Name*: [Sermon Distributor] (https://www.vdm.io/)
+ *First Build*: 22nd October, 2015
+ *Last Build*: 24th June, 2016
+ *Version*: 1.3.2
+ *Last Build*: 2nd July, 2016
+ *Version*: 1.3.3
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -36,8 +36,8 @@ due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builde
> (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*: **49030**
+ *File count*: **354**
+ *Line count*: **49061**
+ *File count*: **355**
+ *Folder count*: **80**
**90 Hours** or **11 Eight Hour Days** (the actual time the author spent)

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage admin.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage dashboard.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_documents.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preachers.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series_list.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistic.css

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistics.css

View File

@ -357,7 +357,7 @@
description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_LOAD_DESC"
class="btn-group btn-group-yesno"
default="">
<!-- [Interpretation 12031] Option Set. -->
<!-- [Interpretation 12144] Option Set. -->
<option value="">
COM_SERMONDISTRIBUTOR_CONFIG_AUTO_LOAD</option>"
<option value="1">
@ -373,7 +373,7 @@
description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_MIN_DESC"
class="btn-group btn-group-yesno"
default="">
<!-- [Interpretation 12056] Option Set. -->
<!-- [Interpretation 12169] Option Set. -->
<option value="">
COM_SERMONDISTRIBUTOR_CONFIG_NO</option>"
<option value=".min">
@ -385,7 +385,7 @@
description="COM_SERMONDISTRIBUTOR_CONFIG_UIKIT_STYLE_DESC"
class="btn-group btn-group-yesno"
default="">
<!-- [Interpretation 12077] Option Set. -->
<!-- [Interpretation 12190] Option Set. -->
<option value="">
COM_SERMONDISTRIBUTOR_CONFIG_FLAT_LOAD</option>"
<option value=".almost-flat">

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage controller.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage ajax.json.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.php
@ -60,13 +60,13 @@ class SermondistributorControllerHelp_document extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 9081] Access check.
// [Interpretation 9111] Access check.
$access = JFactory::getUser()->authorise('help_document.access', 'com_sermondistributor');
if (!$access)
{
return false;
}
// [Interpretation 9092] In the absense of better information, revert to the component permissions.
// [Interpretation 9122] In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('help_document.create', $this->option);
}
@ -82,13 +82,13 @@ class SermondistributorControllerHelp_document extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9235] get user object.
// [Interpretation 9265] get user object.
$user = JFactory::getUser();
// [Interpretation 9237] get record id.
// [Interpretation 9267] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 9244] Access check.
// [Interpretation 9274] Access check.
$access = ($user->authorise('help_document.access', 'com_sermondistributor.help_document.' . (int) $recordId) && $user->authorise('help_document.access', 'com_sermondistributor'));
if (!$access)
{
@ -97,17 +97,17 @@ class SermondistributorControllerHelp_document extends JControllerForm
if ($recordId)
{
// [Interpretation 9253] The record has been set. Check the record permissions.
// [Interpretation 9283] The record has been set. Check the record permissions.
$permission = $user->authorise('help_document.edit', 'com_sermondistributor.help_document.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('help_document.edit.own', 'com_sermondistributor.help_document.' . $recordId))
{
// [Interpretation 9275] Now test the owner is the user.
// [Interpretation 9305] Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 9279] Need to do a lookup from the model.
// [Interpretation 9309] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerHelp_document extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 9287] If the owner matches 'me' then allow.
// [Interpretation 9317] If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('help_document.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerHelp_document extends JControllerForm
return false;
}
}
// [Interpretation 9309] Since there is no permission, revert to the component permissions.
// [Interpretation 9339] Since there is no permission, revert to the component permissions.
return $user->authorise('help_document.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_documents.php
@ -48,29 +48,29 @@ class SermondistributorControllerHelp_documents extends JControllerAdmin
public function exportData()
{
// [Interpretation 7013] Check for request forgeries
// [Interpretation 7043] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7015] check if export is allowed for this user.
// [Interpretation 7045] check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('help_document.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 7019] Get the input
// [Interpretation 7049] Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 7022] Sanitize the input
// [Interpretation 7052] Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 7024] Get the model
// [Interpretation 7054] Get the model
$model = $this->getModel('Help_documents');
// [Interpretation 7026] get the data to export
// [Interpretation 7056] get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 7030] now set the data to the spreadsheet
// [Interpretation 7060] now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Help_documents_'.$date->format('jS_F_Y'),'Help documents exported ('.$date->format('jS F, Y').')','help documents');
}
}
// [Interpretation 7035] Redirect to the list screen with error.
// [Interpretation 7065] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=help_documents', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerHelp_documents extends JControllerAdmin
public function importData()
{
// [Interpretation 7044] Check for request forgeries
// [Interpretation 7074] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7046] check if import is allowed for this user.
// [Interpretation 7076] check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('help_document.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 7050] Get the import model
// [Interpretation 7080] Get the import model
$model = $this->getModel('Help_documents');
// [Interpretation 7052] get the headers to import
// [Interpretation 7082] get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 7056] Load headers to session.
// [Interpretation 7086] Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('help_document_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'help_documents');
$session->set('dataType_VDM_IMPORTINTO', 'help_document');
// [Interpretation 7062] Redirect to import view.
// [Interpretation 7092] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_HELP_DOCUMENTS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 7082] Redirect to the list screen with error.
// [Interpretation 7112] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=help_documents', false), $message, 'error');
return;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage import.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.php
@ -60,13 +60,13 @@ class SermondistributorControllerPreacher extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 9081] Access check.
// [Interpretation 9111] Access check.
$access = JFactory::getUser()->authorise('preacher.access', 'com_sermondistributor');
if (!$access)
{
return false;
}
// [Interpretation 9092] In the absense of better information, revert to the component permissions.
// [Interpretation 9122] In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('preacher.create', $this->option);
}
@ -82,13 +82,13 @@ class SermondistributorControllerPreacher extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9235] get user object.
// [Interpretation 9265] get user object.
$user = JFactory::getUser();
// [Interpretation 9237] get record id.
// [Interpretation 9267] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 9244] Access check.
// [Interpretation 9274] Access check.
$access = ($user->authorise('preacher.access', 'com_sermondistributor.preacher.' . (int) $recordId) && $user->authorise('preacher.access', 'com_sermondistributor'));
if (!$access)
{
@ -97,17 +97,17 @@ class SermondistributorControllerPreacher extends JControllerForm
if ($recordId)
{
// [Interpretation 9253] The record has been set. Check the record permissions.
// [Interpretation 9283] The record has been set. Check the record permissions.
$permission = $user->authorise('preacher.edit', 'com_sermondistributor.preacher.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('preacher.edit.own', 'com_sermondistributor.preacher.' . $recordId))
{
// [Interpretation 9275] Now test the owner is the user.
// [Interpretation 9305] Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 9279] Need to do a lookup from the model.
// [Interpretation 9309] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerPreacher extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 9287] If the owner matches 'me' then allow.
// [Interpretation 9317] If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('preacher.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerPreacher extends JControllerForm
return false;
}
}
// [Interpretation 9309] Since there is no permission, revert to the component permissions.
// [Interpretation 9339] Since there is no permission, revert to the component permissions.
return $user->authorise('preacher.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preachers.php
@ -48,29 +48,29 @@ class SermondistributorControllerPreachers extends JControllerAdmin
public function exportData()
{
// [Interpretation 7013] Check for request forgeries
// [Interpretation 7043] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7015] check if export is allowed for this user.
// [Interpretation 7045] check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('preacher.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 7019] Get the input
// [Interpretation 7049] Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 7022] Sanitize the input
// [Interpretation 7052] Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 7024] Get the model
// [Interpretation 7054] Get the model
$model = $this->getModel('Preachers');
// [Interpretation 7026] get the data to export
// [Interpretation 7056] get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 7030] now set the data to the spreadsheet
// [Interpretation 7060] now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Preachers_'.$date->format('jS_F_Y'),'Preachers exported ('.$date->format('jS F, Y').')','preachers');
}
}
// [Interpretation 7035] Redirect to the list screen with error.
// [Interpretation 7065] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=preachers', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerPreachers extends JControllerAdmin
public function importData()
{
// [Interpretation 7044] Check for request forgeries
// [Interpretation 7074] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7046] check if import is allowed for this user.
// [Interpretation 7076] check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('preacher.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 7050] Get the import model
// [Interpretation 7080] Get the import model
$model = $this->getModel('Preachers');
// [Interpretation 7052] get the headers to import
// [Interpretation 7082] get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 7056] Load headers to session.
// [Interpretation 7086] Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('preacher_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'preachers');
$session->set('dataType_VDM_IMPORTINTO', 'preacher');
// [Interpretation 7062] Redirect to import view.
// [Interpretation 7092] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_PREACHERS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 7082] Redirect to the list screen with error.
// [Interpretation 7112] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=preachers', false), $message, 'error');
return;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.php
@ -60,13 +60,13 @@ class SermondistributorControllerSeries extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 9081] Access check.
// [Interpretation 9111] Access check.
$access = JFactory::getUser()->authorise('series.access', 'com_sermondistributor');
if (!$access)
{
return false;
}
// [Interpretation 9092] In the absense of better information, revert to the component permissions.
// [Interpretation 9122] In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('series.create', $this->option);
}
@ -82,13 +82,13 @@ class SermondistributorControllerSeries extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9235] get user object.
// [Interpretation 9265] get user object.
$user = JFactory::getUser();
// [Interpretation 9237] get record id.
// [Interpretation 9267] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 9244] Access check.
// [Interpretation 9274] Access check.
$access = ($user->authorise('series.access', 'com_sermondistributor.series.' . (int) $recordId) && $user->authorise('series.access', 'com_sermondistributor'));
if (!$access)
{
@ -97,17 +97,17 @@ class SermondistributorControllerSeries extends JControllerForm
if ($recordId)
{
// [Interpretation 9253] The record has been set. Check the record permissions.
// [Interpretation 9283] The record has been set. Check the record permissions.
$permission = $user->authorise('series.edit', 'com_sermondistributor.series.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('series.edit.own', 'com_sermondistributor.series.' . $recordId))
{
// [Interpretation 9275] Now test the owner is the user.
// [Interpretation 9305] Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 9279] Need to do a lookup from the model.
// [Interpretation 9309] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerSeries extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 9287] If the owner matches 'me' then allow.
// [Interpretation 9317] If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('series.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerSeries extends JControllerForm
return false;
}
}
// [Interpretation 9309] Since there is no permission, revert to the component permissions.
// [Interpretation 9339] Since there is no permission, revert to the component permissions.
return $user->authorise('series.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series_list.php
@ -48,29 +48,29 @@ class SermondistributorControllerSeries_list extends JControllerAdmin
public function exportData()
{
// [Interpretation 7013] Check for request forgeries
// [Interpretation 7043] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7015] check if export is allowed for this user.
// [Interpretation 7045] check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('series.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 7019] Get the input
// [Interpretation 7049] Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 7022] Sanitize the input
// [Interpretation 7052] Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 7024] Get the model
// [Interpretation 7054] Get the model
$model = $this->getModel('Series_list');
// [Interpretation 7026] get the data to export
// [Interpretation 7056] get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 7030] now set the data to the spreadsheet
// [Interpretation 7060] now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Series_list_'.$date->format('jS_F_Y'),'Series list exported ('.$date->format('jS F, Y').')','series list');
}
}
// [Interpretation 7035] Redirect to the list screen with error.
// [Interpretation 7065] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=series_list', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerSeries_list extends JControllerAdmin
public function importData()
{
// [Interpretation 7044] Check for request forgeries
// [Interpretation 7074] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7046] check if import is allowed for this user.
// [Interpretation 7076] check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('series.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 7050] Get the import model
// [Interpretation 7080] Get the import model
$model = $this->getModel('Series_list');
// [Interpretation 7052] get the headers to import
// [Interpretation 7082] get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 7056] Load headers to session.
// [Interpretation 7086] Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('series_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'series_list');
$session->set('dataType_VDM_IMPORTINTO', 'series');
// [Interpretation 7062] Redirect to import view.
// [Interpretation 7092] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_SERIES_LIST');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 7082] Redirect to the list screen with error.
// [Interpretation 7112] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=series_list', false), $message, 'error');
return;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.php
@ -60,10 +60,10 @@ class SermondistributorControllerSermon extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 9036] get the user object
// [Interpretation 9066] get the user object
$user = JFactory::getUser();
// [Interpretation 9041] Access check.
// [Interpretation 9071] Access check.
$access = $user->authorise('sermon.access', 'com_sermondistributor');
if (!$access)
{
@ -74,13 +74,13 @@ class SermondistributorControllerSermon extends JControllerForm
if ($categoryId)
{
// [Interpretation 9052] If the category has been passed in the URL check it.
// [Interpretation 9082] If the category has been passed in the URL check it.
$allow = $user->authorise('core.create', $this->option . '.sermons.category.' . $categoryId);
}
if ($allow === null)
{
// [Interpretation 9061] In the absense of better information, revert to the component permissions.
// [Interpretation 9091] In the absense of better information, revert to the component permissions.
return $user->authorise('sermon.create', $this->option);
}
else
@ -100,13 +100,13 @@ class SermondistributorControllerSermon extends JControllerForm
* @since 1.6
*/
protected function allowEdit($data = array(), $key = 'id')
{ // [Interpretation 9139] get user object.
{ // [Interpretation 9169] get user object.
$user = JFactory::getUser();
// [Interpretation 9141] get record id.
// [Interpretation 9171] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 9148] Access check.
// [Interpretation 9178] Access check.
$access = ($user->authorise('sermon.access', 'com_sermondistributor.sermon.' . (int) $recordId) && $user->authorise('sermon.access', 'com_sermondistributor'));
if (!$access)
{
@ -115,17 +115,17 @@ class SermondistributorControllerSermon extends JControllerForm
if ($recordId)
{
// [Interpretation 9157] The record has been set. Check the record permissions.
// [Interpretation 9187] The record has been set. Check the record permissions.
$permission = $user->authorise('sermon.edit', 'com_sermondistributor.sermon.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('sermon.edit.own', 'com_sermondistributor.sermon.' . $recordId))
{
// [Interpretation 9179] Fallback on edit.own. Now test the owner is the user.
// [Interpretation 9209] Fallback on edit.own. Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 9183] Need to do a lookup from the model.
// [Interpretation 9213] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -135,7 +135,7 @@ class SermondistributorControllerSermon extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 9191] If the owner matches 'me' then do the test.
// [Interpretation 9221] If the owner matches 'me' then do the test.
if ($ownerId == $user->id)
{
if ($user->authorise('sermon.edit.own', 'com_sermondistributor'))
@ -151,7 +151,7 @@ class SermondistributorControllerSermon extends JControllerForm
if ($categoryId)
{
// [Interpretation 9213] The category has been set. Check the category permissions.
// [Interpretation 9243] The category has been set. Check the category permissions.
$catpermission = $user->authorise('core.edit', $this->option . '.sermons.category.' . $categoryId);
if (!$catpermission && !is_null($catpermission))
{
@ -159,7 +159,7 @@ class SermondistributorControllerSermon extends JControllerForm
}
}
}
// [Interpretation 9223] Since there is no permission, revert to the component permissions.
// [Interpretation 9253] Since there is no permission, revert to the component permissions.
return $user->authorise('sermon.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons.php
@ -48,29 +48,29 @@ class SermondistributorControllerSermons extends JControllerAdmin
public function exportData()
{
// [Interpretation 7013] Check for request forgeries
// [Interpretation 7043] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7015] check if export is allowed for this user.
// [Interpretation 7045] check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('sermon.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 7019] Get the input
// [Interpretation 7049] Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 7022] Sanitize the input
// [Interpretation 7052] Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 7024] Get the model
// [Interpretation 7054] Get the model
$model = $this->getModel('Sermons');
// [Interpretation 7026] get the data to export
// [Interpretation 7056] get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 7030] now set the data to the spreadsheet
// [Interpretation 7060] now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Sermons_'.$date->format('jS_F_Y'),'Sermons exported ('.$date->format('jS F, Y').')','sermons');
}
}
// [Interpretation 7035] Redirect to the list screen with error.
// [Interpretation 7065] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=sermons', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerSermons extends JControllerAdmin
public function importData()
{
// [Interpretation 7044] Check for request forgeries
// [Interpretation 7074] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7046] check if import is allowed for this user.
// [Interpretation 7076] check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('sermon.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 7050] Get the import model
// [Interpretation 7080] Get the import model
$model = $this->getModel('Sermons');
// [Interpretation 7052] get the headers to import
// [Interpretation 7082] get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 7056] Load headers to session.
// [Interpretation 7086] Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('sermon_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'sermons');
$session->set('dataType_VDM_IMPORTINTO', 'sermon');
// [Interpretation 7062] Redirect to import view.
// [Interpretation 7092] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_SERMONS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 7082] Redirect to the list screen with error.
// [Interpretation 7112] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=sermons', false), $message, 'error');
return;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistic.php
@ -60,13 +60,13 @@ class SermondistributorControllerStatistic extends JControllerForm
*/
protected function allowAdd($data = array())
{
// [Interpretation 9081] Access check.
// [Interpretation 9111] Access check.
$access = JFactory::getUser()->authorise('statistic.access', 'com_sermondistributor');
if (!$access)
{
return false;
}
// [Interpretation 9092] In the absense of better information, revert to the component permissions.
// [Interpretation 9122] In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('statistic.create', $this->option);
}
@ -82,13 +82,13 @@ class SermondistributorControllerStatistic extends JControllerForm
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9235] get user object.
// [Interpretation 9265] get user object.
$user = JFactory::getUser();
// [Interpretation 9237] get record id.
// [Interpretation 9267] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [Interpretation 9244] Access check.
// [Interpretation 9274] Access check.
$access = ($user->authorise('statistic.access', 'com_sermondistributor.statistic.' . (int) $recordId) && $user->authorise('statistic.access', 'com_sermondistributor'));
if (!$access)
{
@ -97,17 +97,17 @@ class SermondistributorControllerStatistic extends JControllerForm
if ($recordId)
{
// [Interpretation 9253] The record has been set. Check the record permissions.
// [Interpretation 9283] The record has been set. Check the record permissions.
$permission = $user->authorise('statistic.edit', 'com_sermondistributor.statistic.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
if ($user->authorise('statistic.edit.own', 'com_sermondistributor.statistic.' . $recordId))
{
// [Interpretation 9275] Now test the owner is the user.
// [Interpretation 9305] Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId))
{
// [Interpretation 9279] Need to do a lookup from the model.
// [Interpretation 9309] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId);
if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerStatistic extends JControllerForm
$ownerId = $record->created_by;
}
// [Interpretation 9287] If the owner matches 'me' then allow.
// [Interpretation 9317] If the owner matches 'me' then allow.
if ($ownerId == $user->id)
{
if ($user->authorise('statistic.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerStatistic extends JControllerForm
return false;
}
}
// [Interpretation 9309] Since there is no permission, revert to the component permissions.
// [Interpretation 9339] Since there is no permission, revert to the component permissions.
return $user->authorise('statistic.edit', $this->option);
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistics.php
@ -48,29 +48,29 @@ class SermondistributorControllerStatistics extends JControllerAdmin
public function exportData()
{
// [Interpretation 7013] Check for request forgeries
// [Interpretation 7043] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7015] check if export is allowed for this user.
// [Interpretation 7045] check if export is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('statistic.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{
// [Interpretation 7019] Get the input
// [Interpretation 7049] Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
// [Interpretation 7022] Sanitize the input
// [Interpretation 7052] Sanitize the input
JArrayHelper::toInteger($pks);
// [Interpretation 7024] Get the model
// [Interpretation 7054] Get the model
$model = $this->getModel('Statistics');
// [Interpretation 7026] get the data to export
// [Interpretation 7056] get the data to export
$data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data))
{
// [Interpretation 7030] now set the data to the spreadsheet
// [Interpretation 7060] now set the data to the spreadsheet
$date = JFactory::getDate();
SermondistributorHelper::xls($data,'Statistics_'.$date->format('jS_F_Y'),'Statistics exported ('.$date->format('jS F, Y').')','statistics');
}
}
// [Interpretation 7035] Redirect to the list screen with error.
// [Interpretation 7065] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=statistics', false), $message, 'error');
return;
@ -79,31 +79,31 @@ class SermondistributorControllerStatistics extends JControllerAdmin
public function importData()
{
// [Interpretation 7044] Check for request forgeries
// [Interpretation 7074] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [Interpretation 7046] check if import is allowed for this user.
// [Interpretation 7076] check if import is allowed for this user.
$user = JFactory::getUser();
if ($user->authorise('statistic.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{
// [Interpretation 7050] Get the import model
// [Interpretation 7080] Get the import model
$model = $this->getModel('Statistics');
// [Interpretation 7052] get the headers to import
// [Interpretation 7082] get the headers to import
$headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
// [Interpretation 7056] Load headers to session.
// [Interpretation 7086] Load headers to session.
$session = JFactory::getSession();
$headers = json_encode($headers);
$session->set('statistic_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'statistics');
$session->set('dataType_VDM_IMPORTINTO', 'statistic');
// [Interpretation 7062] Redirect to import view.
// [Interpretation 7092] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_STATISTICS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return;
}
}
// [Interpretation 7082] Redirect to the list screen with error.
// [Interpretation 7112] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=statistics', false), $message, 'error');
return;

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage batch_.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php
@ -553,23 +553,23 @@ abstract class SermondistributorHelper
$targetgroups = json_decode($help->groups, true);
if (!array_intersect($targetgroups, $groups))
{
// [Interpretation 675] if user not in those target groups then remove the item
// [Interpretation 676] if user not in those target groups then remove the item
unset($helps[$nr]);
continue;
}
}
// [Interpretation 680] set the return type
// [Interpretation 681] set the return type
switch ($help->type)
{
// [Interpretation 683] set joomla article
// [Interpretation 684] set joomla article
case 1:
return self::loadArticleLink($help->article);
break;
// [Interpretation 687] set help text
// [Interpretation 688] set help text
case 2:
return self::loadHelpTextLink($help->id);
break;
// [Interpretation 691] set Link
// [Interpretation 692] set Link
case 3:
return $help->url;
break;
@ -698,7 +698,7 @@ abstract class SermondistributorHelper
{
if (strpos($content,'class="uk-') !== false)
{
// [Interpretation 1989] reset
// [Interpretation 1991] reset
$temp = array();
foreach (self::$uk_components as $looking => $add)
{
@ -707,15 +707,15 @@ abstract class SermondistributorHelper
$temp[] = $looking;
}
}
// [Interpretation 1998] make sure uikit is loaded to config
// [Interpretation 2000] make sure uikit is loaded to config
if (strpos($content,'class="uk-') !== false)
{
self::$uikit = true;
}
// [Interpretation 2003] sorter
// [Interpretation 2005] sorter
if (self::checkArray($temp))
{
// [Interpretation 2006] merger
// [Interpretation 2008] merger
if (self::checkArray($classes))
{
$newTemp = array_merge($temp,$classes);
@ -736,37 +736,37 @@ abstract class SermondistributorHelper
*/
public static function xls($rows,$fileName = null,$title = null,$subjectTab = null,$creator = 'Vast Development Method',$description = null,$category = null,$keywords = null,$modified = null)
{
// [Interpretation 730] set the user
// [Interpretation 731] set the user
$user = JFactory::getUser();
// [Interpretation 733] set fieldname if not set
// [Interpretation 734] set fieldname if not set
if (!$fileName)
{
$fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y');
}
// [Interpretation 738] set modiefied if not set
// [Interpretation 739] set modiefied if not set
if (!$modified)
{
$modified = $user->name;
}
// [Interpretation 743] set title if not set
// [Interpretation 744] set title if not set
if (!$title)
{
$title = 'Book1';
}
// [Interpretation 748] set tab name if not set
// [Interpretation 749] set tab name if not set
if (!$subjectTab)
{
$subjectTab = 'Sheet1';
}
// [Interpretation 754] make sure the file is loaded
// [Interpretation 755] make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// [Interpretation 757] Create new PHPExcel object
// [Interpretation 758] Create new PHPExcel object
$objPHPExcel = new PHPExcel();
// [Interpretation 760] Set document properties
// [Interpretation 761] Set document properties
$objPHPExcel->getProperties()->setCreator($creator)
->setCompany('Vast Development Method')
->setLastModifiedBy($modified)
@ -785,7 +785,7 @@ abstract class SermondistributorHelper
$objPHPExcel->getProperties()->setCategory($category);
}
// [Interpretation 779] Some styles
// [Interpretation 780] Some styles
$headerStyles = array(
'font' => array(
'bold' => true,
@ -807,7 +807,7 @@ abstract class SermondistributorHelper
'name' => 'Verdana'
));
// [Interpretation 801] Add some data
// [Interpretation 802] Add some data
if (self::checkArray($rows))
{
$i = 1;
@ -834,20 +834,20 @@ abstract class SermondistributorHelper
return false;
}
// [Interpretation 828] Rename worksheet
// [Interpretation 829] Rename worksheet
$objPHPExcel->getActiveSheet()->setTitle($subjectTab);
// [Interpretation 831] Set active sheet index to the first sheet, so Excel opens this as the first sheet
// [Interpretation 832] Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0);
// [Interpretation 834] Redirect output to a client's web browser (Excel5)
// [Interpretation 835] Redirect output to a client's web browser (Excel5)
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$fileName.'.xls"');
header('Cache-Control: max-age=0');
// [Interpretation 838] If you're serving to IE 9, then the following may be needed
// [Interpretation 839] If you're serving to IE 9, then the following may be needed
header('Cache-Control: max-age=1');
// [Interpretation 841] If you're serving to IE over SSL, then the following may be needed
// [Interpretation 842] If you're serving to IE over SSL, then the following may be needed
header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
@ -863,27 +863,27 @@ abstract class SermondistributorHelper
*/
public static function getFileHeaders($dataType)
{
// [Interpretation 857] make sure these files are loaded
// [Interpretation 858] make sure these files are loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
JLoader::import('ChunkReadFilter', JPATH_COMPONENT_ADMINISTRATOR . '/helpers/PHPExcel/Reader');
// [Interpretation 860] get session object
// [Interpretation 861] get session object
$session = JFactory::getSession();
$package = $session->get('package', null);
$package = json_decode($package, true);
// [Interpretation 864] set the headers
// [Interpretation 865] set the headers
if(isset($package['dir']))
{
$chunkFilter = new PHPExcel_Reader_chunkReadFilter();
// [Interpretation 868] only load first three rows
// [Interpretation 869] only load first three rows
$chunkFilter->setRows(2,1);
// [Interpretation 870] identify the file type
// [Interpretation 871] identify the file type
$inputFileType = PHPExcel_IOFactory::identify($package['dir']);
// [Interpretation 872] create the reader for this file type
// [Interpretation 873] create the reader for this file type
$excelReader = PHPExcel_IOFactory::createReader($inputFileType);
// [Interpretation 874] load the limiting filter
// [Interpretation 875] load the limiting filter
$excelReader->setReadFilter($chunkFilter);
$excelReader->setReadDataOnly(true);
// [Interpretation 877] load the rows (only first three)
// [Interpretation 878] load the rows (only first three)
$excelObj = $excelReader->load($package['dir']);
$headers = array();
foreach ($excelObj->getActiveSheet()->getRowIterator() as $row)
@ -1303,7 +1303,7 @@ abstract class SermondistributorHelper
if (!$asset->check() || !$asset->store())
{
JError::raiseWarning(500, $asset->getError());
JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
return false;
}
else

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage batchselection.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_under.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_under.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage files_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage stastics_fullwidth.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage metadata.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage ajax.php
@ -43,7 +43,7 @@ class SermondistributorModelAjax extends JModelList
}
// [Interpretation 8673] Used in sermon
// [Interpretation 8703] Used in sermon
/**
* Check and Set Dropbox local listing
**/

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage articles.php
@ -50,37 +50,37 @@ class JFormFieldArticles extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7370] see if we should add buttons
// [Interpretation 7400] see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7372] get html
// [Interpretation 7402] get html
$html = parent::getInput();
// [Interpretation 7374] if true set button
// [Interpretation 7404] if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// [Interpretation 7380] get the input from url
// [Interpretation 7410] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7382] get the view name & id
// [Interpretation 7412] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7387] check if new item
// [Interpretation 7417] check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7392] only load referal if not new item.
// [Interpretation 7422] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7397] only add if user allowed to create article
// [Interpretation 7427] only add if user allowed to create article
if ($user->authorise('core.create', 'com_sermondistributor'))
{
// [Interpretation 7415] build Create button
// [Interpretation 7445] build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -90,10 +90,10 @@ class JFormFieldArticles extends JFormFieldList
href="index.php?option=com_sermondistributor&amp;view=article&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// [Interpretation 7425] only add if user allowed to edit article
// [Interpretation 7455] only add if user allowed to edit article
if (($buttonName == 'article' || $buttonName == 'articles') && $user->authorise('core.edit', 'com_sermondistributor'))
{
// [Interpretation 7436] build edit button
// [Interpretation 7466] build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -101,7 +101,7 @@ class JFormFieldArticles extends JFormFieldList
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// [Interpretation 7444] build script
// [Interpretation 7474] build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
@ -128,18 +128,18 @@ class JFormFieldArticles extends JFormFieldList
}
}";
}
// [Interpretation 7471] check if button was created for article field.
// [Interpretation 7501] check if button was created for article field.
if (is_array($button) && count($button) > 0)
{
// [Interpretation 7474] Add some final script
// [Interpretation 7504] Add some final script
$script[] = "
jQuery(document).ready(function() {
jQuery('#jform_".$buttonName."').closest('.control-group').addClass('input-append');
});";
// [Interpretation 7479] Load the needed script.
// [Interpretation 7509] Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// [Interpretation 7482] return the button attached to input field.
// [Interpretation 7512] return the button attached to input field.
return $html . implode('',$button);
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage dropboxfiles.php
@ -50,37 +50,37 @@ class JFormFieldDropboxfiles extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7370] see if we should add buttons
// [Interpretation 7400] see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7372] get html
// [Interpretation 7402] get html
$html = parent::getInput();
// [Interpretation 7374] if true set button
// [Interpretation 7404] if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// [Interpretation 7380] get the input from url
// [Interpretation 7410] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7382] get the view name & id
// [Interpretation 7412] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7387] check if new item
// [Interpretation 7417] check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7392] only load referal if not new item.
// [Interpretation 7422] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7397] only add if user allowed to create
// [Interpretation 7427] only add if user allowed to create
if ($user->authorise('core.create', 'com_sermondistributor'))
{
// [Interpretation 7415] build Create button
// [Interpretation 7445] build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -90,10 +90,10 @@ class JFormFieldDropboxfiles extends JFormFieldList
href="index.php?option=com_sermondistributor&amp;view=&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// [Interpretation 7425] only add if user allowed to edit
// [Interpretation 7455] only add if user allowed to edit
if (($buttonName == '' || $buttonName == '') && $user->authorise('core.edit', 'com_sermondistributor'))
{
// [Interpretation 7436] build edit button
// [Interpretation 7466] build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -101,7 +101,7 @@ class JFormFieldDropboxfiles extends JFormFieldList
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// [Interpretation 7444] build script
// [Interpretation 7474] build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
@ -128,18 +128,18 @@ class JFormFieldDropboxfiles extends JFormFieldList
}
}";
}
// [Interpretation 7471] check if button was created for field.
// [Interpretation 7501] check if button was created for field.
if (is_array($button) && count($button) > 0)
{
// [Interpretation 7474] Add some final script
// [Interpretation 7504] Add some final script
$script[] = "
jQuery(document).ready(function() {
jQuery('#jform_".$buttonName."').closest('.control-group').addClass('input-append');
});";
// [Interpretation 7479] Load the needed script.
// [Interpretation 7509] Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// [Interpretation 7482] return the button attached to input field.
// [Interpretation 7512] return the button attached to input field.
return $html . implode('',$button);
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage localfiles.php
@ -50,37 +50,37 @@ class JFormFieldLocalfiles extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7370] see if we should add buttons
// [Interpretation 7400] see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7372] get html
// [Interpretation 7402] get html
$html = parent::getInput();
// [Interpretation 7374] if true set button
// [Interpretation 7404] if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// [Interpretation 7380] get the input from url
// [Interpretation 7410] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7382] get the view name & id
// [Interpretation 7412] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7387] check if new item
// [Interpretation 7417] check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7392] only load referal if not new item.
// [Interpretation 7422] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7397] only add if user allowed to create
// [Interpretation 7427] only add if user allowed to create
if ($user->authorise('core.create', 'com_sermondistributor'))
{
// [Interpretation 7415] build Create button
// [Interpretation 7445] build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -90,10 +90,10 @@ class JFormFieldLocalfiles extends JFormFieldList
href="index.php?option=com_sermondistributor&amp;view=&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// [Interpretation 7425] only add if user allowed to edit
// [Interpretation 7455] only add if user allowed to edit
if (($buttonName == '' || $buttonName == '') && $user->authorise('core.edit', 'com_sermondistributor'))
{
// [Interpretation 7436] build edit button
// [Interpretation 7466] build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -101,7 +101,7 @@ class JFormFieldLocalfiles extends JFormFieldList
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// [Interpretation 7444] build script
// [Interpretation 7474] build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
@ -128,18 +128,18 @@ class JFormFieldLocalfiles extends JFormFieldList
}
}";
}
// [Interpretation 7471] check if button was created for field.
// [Interpretation 7501] check if button was created for field.
if (is_array($button) && count($button) > 0)
{
// [Interpretation 7474] Add some final script
// [Interpretation 7504] Add some final script
$script[] = "
jQuery(document).ready(function() {
jQuery('#jform_".$buttonName."').closest('.control-group').addClass('input-append');
});";
// [Interpretation 7479] Load the needed script.
// [Interpretation 7509] Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// [Interpretation 7482] return the button attached to input field.
// [Interpretation 7512] return the button attached to input field.
return $html . implode('',$button);
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preachers.php
@ -50,37 +50,37 @@ class JFormFieldPreachers extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7370] see if we should add buttons
// [Interpretation 7400] see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7372] get html
// [Interpretation 7402] get html
$html = parent::getInput();
// [Interpretation 7374] if true set button
// [Interpretation 7404] if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// [Interpretation 7380] get the input from url
// [Interpretation 7410] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7382] get the view name & id
// [Interpretation 7412] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7387] check if new item
// [Interpretation 7417] check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7392] only load referal if not new item.
// [Interpretation 7422] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7397] only add if user allowed to create preacher
// [Interpretation 7427] only add if user allowed to create preacher
if ($user->authorise('preacher.create', 'com_sermondistributor'))
{
// [Interpretation 7415] build Create button
// [Interpretation 7445] build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -90,10 +90,10 @@ class JFormFieldPreachers extends JFormFieldList
href="index.php?option=com_sermondistributor&amp;view=preacher&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// [Interpretation 7425] only add if user allowed to edit preacher
// [Interpretation 7455] only add if user allowed to edit preacher
if (($buttonName == 'preacher' || $buttonName == 'preachers') && $user->authorise('preacher.edit', 'com_sermondistributor'))
{
// [Interpretation 7436] build edit button
// [Interpretation 7466] build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -101,7 +101,7 @@ class JFormFieldPreachers extends JFormFieldList
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// [Interpretation 7444] build script
// [Interpretation 7474] build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
@ -128,18 +128,18 @@ class JFormFieldPreachers extends JFormFieldList
}
}";
}
// [Interpretation 7471] check if button was created for preacher field.
// [Interpretation 7501] check if button was created for preacher field.
if (is_array($button) && count($button) > 0)
{
// [Interpretation 7474] Add some final script
// [Interpretation 7504] Add some final script
$script[] = "
jQuery(document).ready(function() {
jQuery('#jform_".$buttonName."').closest('.control-group').addClass('input-append');
});";
// [Interpretation 7479] Load the needed script.
// [Interpretation 7509] Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// [Interpretation 7482] return the button attached to input field.
// [Interpretation 7512] return the button attached to input field.
return $html . implode('',$button);
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.php
@ -50,37 +50,37 @@ class JFormFieldSeries extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7370] see if we should add buttons
// [Interpretation 7400] see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7372] get html
// [Interpretation 7402] get html
$html = parent::getInput();
// [Interpretation 7374] if true set button
// [Interpretation 7404] if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// [Interpretation 7380] get the input from url
// [Interpretation 7410] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7382] get the view name & id
// [Interpretation 7412] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7387] check if new item
// [Interpretation 7417] check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7392] only load referal if not new item.
// [Interpretation 7422] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7397] only add if user allowed to create series
// [Interpretation 7427] only add if user allowed to create series
if ($user->authorise('series.create', 'com_sermondistributor'))
{
// [Interpretation 7415] build Create button
// [Interpretation 7445] build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -90,10 +90,10 @@ class JFormFieldSeries extends JFormFieldList
href="index.php?option=com_sermondistributor&amp;view=series&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// [Interpretation 7425] only add if user allowed to edit series
// [Interpretation 7455] only add if user allowed to edit series
if (($buttonName == 'series' || $buttonName == 'all_series') && $user->authorise('series.edit', 'com_sermondistributor'))
{
// [Interpretation 7436] build edit button
// [Interpretation 7466] build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -101,7 +101,7 @@ class JFormFieldSeries extends JFormFieldList
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// [Interpretation 7444] build script
// [Interpretation 7474] build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
@ -128,18 +128,18 @@ class JFormFieldSeries extends JFormFieldList
}
}";
}
// [Interpretation 7471] check if button was created for series field.
// [Interpretation 7501] check if button was created for series field.
if (is_array($button) && count($button) > 0)
{
// [Interpretation 7474] Add some final script
// [Interpretation 7504] Add some final script
$script[] = "
jQuery(document).ready(function() {
jQuery('#jform_".$buttonName."').closest('.control-group').addClass('input-append');
});";
// [Interpretation 7479] Load the needed script.
// [Interpretation 7509] Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// [Interpretation 7482] return the button attached to input field.
// [Interpretation 7512] return the button attached to input field.
return $html . implode('',$button);
}
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.php
@ -50,37 +50,37 @@ class JFormFieldSermon extends JFormFieldList
*/
protected function getInput()
{
// [Interpretation 7370] see if we should add buttons
// [Interpretation 7400] see if we should add buttons
$setButton = $this->getAttribute('button');
// [Interpretation 7372] get html
// [Interpretation 7402] get html
$html = parent::getInput();
// [Interpretation 7374] if true set button
// [Interpretation 7404] if true set button
if ($setButton === 'true')
{
$button = array();
$script = array();
$buttonName = $this->getAttribute('name');
// [Interpretation 7380] get the input from url
// [Interpretation 7410] get the input from url
$jinput = JFactory::getApplication()->input;
// [Interpretation 7382] get the view name & id
// [Interpretation 7412] get the view name & id
$values = $jinput->getArray(array(
'id' => 'int',
'view' => 'word'
));
// [Interpretation 7387] check if new item
// [Interpretation 7417] check if new item
$ref = '';
$refJ = '';
if (!is_null($values['id']) && strlen($values['view']))
{
// [Interpretation 7392] only load referal if not new item.
// [Interpretation 7422] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
$refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
}
$user = JFactory::getUser();
// [Interpretation 7397] only add if user allowed to create sermon
// [Interpretation 7427] only add if user allowed to create sermon
if ($user->authorise('sermon.create', 'com_sermondistributor'))
{
// [Interpretation 7415] build Create button
// [Interpretation 7445] build Create button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -90,10 +90,10 @@ class JFormFieldSermon extends JFormFieldList
href="index.php?option=com_sermondistributor&amp;view=sermon&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// [Interpretation 7425] only add if user allowed to edit sermon
// [Interpretation 7455] only add if user allowed to edit sermon
if (($buttonName == 'sermon' || $buttonName == 'sermons') && $user->authorise('sermon.edit', 'com_sermondistributor'))
{
// [Interpretation 7436] build edit button
// [Interpretation 7466] build edit button
$buttonNamee = trim($buttonName);
$buttonNamee = preg_replace('/_+/', ' ', $buttonNamee);
$buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee);
@ -101,7 +101,7 @@ class JFormFieldSermon extends JFormFieldList
$buttonNamee = ucfirst(strtolower($buttonNamee));
$button[] = '<a id="'.$buttonName.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('COM_SERMONDISTRIBUTOR_EDIT_S', $buttonNamee).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// [Interpretation 7444] build script
// [Interpretation 7474] build script
$script[] = "
jQuery(document).ready(function() {
jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) {
@ -128,18 +128,18 @@ class JFormFieldSermon extends JFormFieldList
}
}";
}
// [Interpretation 7471] check if button was created for sermon field.
// [Interpretation 7501] check if button was created for sermon field.
if (is_array($button) && count($button) > 0)
{
// [Interpretation 7474] Add some final script
// [Interpretation 7504] Add some final script
$script[] = "
jQuery(document).ready(function() {
jQuery('#jform_".$buttonName."').closest('.control-group').addClass('input-append');
});";
// [Interpretation 7479] Load the needed script.
// [Interpretation 7509] Load the needed script.
$document = JFactory::getDocument();
$document->addScriptDeclaration(implode(' ',$script));
// [Interpretation 7482] return the button attached to input field.
// [Interpretation 7512] return the button attached to input field.
return $html . implode('',$button);
}
}

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.js
@ -53,7 +53,7 @@ jQuery(document).ready(function()
// the vvvvvwe function
function vvvvvwe(location_vvvvvwe)
{
// [Interpretation 7755] set the function logic
// [Interpretation 7785] set the function logic
if (location_vvvvvwe == 1)
{
jQuery('#jform_admin_view').closest('.control-group').show();
@ -67,7 +67,7 @@ function vvvvvwe(location_vvvvvwe)
// the vvvvvwf function
function vvvvvwf(location_vvvvvwf)
{
// [Interpretation 7755] set the function logic
// [Interpretation 7785] set the function logic
if (location_vvvvvwf == 2)
{
jQuery('#jform_site_view').closest('.control-group').show();
@ -94,7 +94,7 @@ function vvvvvwg(type_vvvvvwg)
var type = type_vvvvvwg.some(type_vvvvvwg_SomeFunc);
// [Interpretation 7733] set this function logic
// [Interpretation 7763] set this function logic
if (type)
{
jQuery('#jform_url').closest('.control-group').show();
@ -125,7 +125,7 @@ function vvvvvwg(type_vvvvvwg)
// the vvvvvwg Some function
function type_vvvvvwg_SomeFunc(type_vvvvvwg)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (type_vvvvvwg == 3)
{
return true;
@ -149,7 +149,7 @@ function vvvvvwh(type_vvvvvwh)
var type = type_vvvvvwh.some(type_vvvvvwh_SomeFunc);
// [Interpretation 7733] set this function logic
// [Interpretation 7763] set this function logic
if (type)
{
jQuery('#jform_article').closest('.control-group').show();
@ -180,7 +180,7 @@ function vvvvvwh(type_vvvvvwh)
// the vvvvvwh Some function
function type_vvvvvwh_SomeFunc(type_vvvvvwh)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (type_vvvvvwh == 1)
{
return true;
@ -204,7 +204,7 @@ function vvvvvwi(type_vvvvvwi)
var type = type_vvvvvwi.some(type_vvvvvwi_SomeFunc);
// [Interpretation 7733] set this function logic
// [Interpretation 7763] set this function logic
if (type)
{
jQuery('#jform_content-lbl').closest('.control-group').show();
@ -235,7 +235,7 @@ function vvvvvwi(type_vvvvvwi)
// the vvvvvwi Some function
function type_vvvvvwi_SomeFunc(type_vvvvvwi)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (type_vvvvvwi == 2)
{
return true;
@ -246,7 +246,7 @@ function type_vvvvvwi_SomeFunc(type_vvvvvwi)
// the vvvvvwj function
function vvvvvwj(target_vvvvvwj)
{
// [Interpretation 7755] set the function logic
// [Interpretation 7785] set the function logic
if (target_vvvvvwj == 1)
{
jQuery('#jform_groups').closest('.control-group').show();

View File

@ -282,15 +282,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9838] Access Control Fields. -->
<!-- [Interpretation 9868] Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9840] Asset Id Field. Type: Hidden (joomla) -->
<!-- [Interpretation 9870] Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9846] Rules Field. Type: Rules (joomla) -->
<!-- [Interpretation 9876] Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.js

View File

@ -213,15 +213,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9838] Access Control Fields. -->
<!-- [Interpretation 9868] Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9840] Asset Id Field. Type: Hidden (joomla) -->
<!-- [Interpretation 9870] Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9846] Rules Field. Type: Rules (joomla) -->
<!-- [Interpretation 9876] Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.js

View File

@ -200,15 +200,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9838] Access Control Fields. -->
<!-- [Interpretation 9868] Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9840] Asset Id Field. Type: Hidden (joomla) -->
<!-- [Interpretation 9870] Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9846] Rules Field. Type: Rules (joomla) -->
<!-- [Interpretation 9876] Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.js
@ -76,7 +76,7 @@ function vvvvvvv(source_vvvvvvv)
var source = source_vvvvvvv.some(source_vvvvvvv_SomeFunc);
// [Interpretation 7733] set this function logic
// [Interpretation 7763] set this function logic
if (source)
{
jQuery('#jform_build').closest('.control-group').show();
@ -107,7 +107,7 @@ function vvvvvvv(source_vvvvvvv)
// the vvvvvvv Some function
function source_vvvvvvv_SomeFunc(source_vvvvvvv)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (source_vvvvvvv == 2)
{
return true;
@ -143,7 +143,7 @@ function vvvvvvw(source_vvvvvvw,build_vvvvvvw)
var build = build_vvvvvvw.some(build_vvvvvvw_SomeFunc);
// [Interpretation 7733] set this function logic
// [Interpretation 7763] set this function logic
if (source && build)
{
jQuery('.note_auto_dropbox').closest('.control-group').show();
@ -157,7 +157,7 @@ function vvvvvvw(source_vvvvvvw,build_vvvvvvw)
// the vvvvvvw Some function
function source_vvvvvvw_SomeFunc(source_vvvvvvw)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (source_vvvvvvw == 2)
{
return true;
@ -168,7 +168,7 @@ function source_vvvvvvw_SomeFunc(source_vvvvvvw)
// the vvvvvvw Some function
function build_vvvvvvw_SomeFunc(build_vvvvvvw)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (build_vvvvvvw == 2)
{
return true;
@ -204,7 +204,7 @@ function vvvvvvy(source_vvvvvvy,build_vvvvvvy)
var build = build_vvvvvvy.some(build_vvvvvvy_SomeFunc);
// [Interpretation 7733] set this function logic
// [Interpretation 7763] set this function logic
if (source && build)
{
jQuery('#jform_manual_files').closest('.control-group').show();
@ -237,7 +237,7 @@ function vvvvvvy(source_vvvvvvy,build_vvvvvvy)
// the vvvvvvy Some function
function source_vvvvvvy_SomeFunc(source_vvvvvvy)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (source_vvvvvvy == 2)
{
return true;
@ -248,7 +248,7 @@ function source_vvvvvvy_SomeFunc(source_vvvvvvy)
// the vvvvvvy Some function
function build_vvvvvvy_SomeFunc(build_vvvvvvy)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (build_vvvvvvy == 1)
{
return true;
@ -284,7 +284,7 @@ function vvvvvvz(build_vvvvvvz,source_vvvvvvz)
var source = source_vvvvvvz.some(source_vvvvvvz_SomeFunc);
// [Interpretation 7733] set this function logic
// [Interpretation 7763] set this function logic
if (build && source)
{
jQuery('#jform_manual_files').closest('.control-group').show();
@ -317,7 +317,7 @@ function vvvvvvz(build_vvvvvvz,source_vvvvvvz)
// the vvvvvvz Some function
function build_vvvvvvz_SomeFunc(build_vvvvvvz)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (build_vvvvvvz == 1)
{
return true;
@ -328,7 +328,7 @@ function build_vvvvvvz_SomeFunc(build_vvvvvvz)
// the vvvvvvz Some function
function source_vvvvvvz_SomeFunc(source_vvvvvvz)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (source_vvvvvvz == 2)
{
return true;
@ -352,7 +352,7 @@ function vvvvvwa(source_vvvvvwa)
var source = source_vvvvvwa.some(source_vvvvvwa_SomeFunc);
// [Interpretation 7733] set this function logic
// [Interpretation 7763] set this function logic
if (source)
{
jQuery('#jform_local_files').closest('.control-group').show();
@ -383,7 +383,7 @@ function vvvvvwa(source_vvvvvwa)
// the vvvvvwa Some function
function source_vvvvvwa_SomeFunc(source_vvvvvwa)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (source_vvvvvwa == 1)
{
return true;
@ -407,7 +407,7 @@ function vvvvvwb(source_vvvvvwb)
var source = source_vvvvvwb.some(source_vvvvvwb_SomeFunc);
// [Interpretation 7733] set this function logic
// [Interpretation 7763] set this function logic
if (source)
{
jQuery('#jform_url').closest('.control-group').show();
@ -438,7 +438,7 @@ function vvvvvwb(source_vvvvvwb)
// the vvvvvwb Some function
function source_vvvvvwb_SomeFunc(source_vvvvvwb)
{
// [Interpretation 7720] set the function logic
// [Interpretation 7750] set the function logic
if (source_vvvvvwb == 3)
{
return true;
@ -449,7 +449,7 @@ function source_vvvvvwb_SomeFunc(source_vvvvvwb)
// the vvvvvwc function
function vvvvvwc(link_type_vvvvvwc)
{
// [Interpretation 7755] set the function logic
// [Interpretation 7785] set the function logic
if (link_type_vvvvvwc == 2)
{
jQuery('.note_link_directed').closest('.control-group').show();
@ -463,7 +463,7 @@ function vvvvvwc(link_type_vvvvvwc)
// the vvvvvwd function
function vvvvvwd(link_type_vvvvvwd)
{
// [Interpretation 7755] set the function logic
// [Interpretation 7785] set the function logic
if (link_type_vvvvvwd == 1)
{
jQuery('.note_link_encrypted').closest('.control-group').show();

View File

@ -366,15 +366,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9838] Access Control Fields. -->
<!-- [Interpretation 9868] Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9840] Asset Id Field. Type: Hidden (joomla) -->
<!-- [Interpretation 9870] Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9846] Rules Field. Type: Rules (joomla) -->
<!-- [Interpretation 9876] Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -9,8 +9,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistic.js

View File

@ -200,15 +200,15 @@
</fieldset>
</fields>
<!-- [Interpretation 9838] Access Control Fields. -->
<!-- [Interpretation 9868] Access Control Fields. -->
<fieldset name="accesscontrol">
<!-- [Interpretation 9840] Asset Id Field. Type: Hidden (joomla) -->
<!-- [Interpretation 9870] Asset Id Field. Type: Hidden (joomla) -->
<field
name="asset_id"
type="hidden"
filter="unset"
/>
<!-- [Interpretation 9846] Rules Field. Type: Rules (joomla) -->
<!-- [Interpretation 9876] Rules Field. Type: Rules (joomla) -->
<field
name="rules"
type="rules"

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.php
@ -97,7 +97,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
if (!empty($item->groups))
{
// [Interpretation 3267] JSON Decode groups.
// [Interpretation 3297] JSON Decode groups.
$item->groups = json_decode($item->groups,true);
}
@ -122,7 +122,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 9328] Get the form.
{ // [Interpretation 9358] Get the form.
$form = $this->loadForm('com_sermondistributor.help_document', 'help_document', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -132,12 +132,12 @@ class SermondistributorModelHelp_document extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 9413] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// [Interpretation 9443] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 9418] The back end uses id so we use that the rest of the time and set it to 0 by default.
// [Interpretation 9448] The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
@ -145,52 +145,52 @@ class SermondistributorModelHelp_document extends JModelAdmin
$user = JFactory::getUser();
// [Interpretation 9424] Check for existing item.
// [Interpretation 9425] Modify the form based on Edit State access controls.
// [Interpretation 9454] Check for existing item.
// [Interpretation 9455] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('help_document.edit.state', 'com_sermondistributor.help_document.' . (int) $id))
|| ($id == 0 && !$user->authorise('help_document.edit.state', 'com_sermondistributor')))
{
// [Interpretation 9438] Disable fields for display.
// [Interpretation 9468] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 9441] Disable fields while saving.
// [Interpretation 9471] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9446] If this is a new item insure the greated by is set.
// [Interpretation 9476] If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9449] Set the created_by to this user
// [Interpretation 9479] Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9452] Modify the form based on Edit Creaded By access controls.
// [Interpretation 9482] Modify the form based on Edit Creaded By access controls.
if (!$user->authorise('core.edit.created_by', 'com_sermondistributor'))
{
// [Interpretation 9464] Disable fields for display.
// [Interpretation 9494] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9466] Disable fields for display.
// [Interpretation 9496] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9468] Disable fields while saving.
// [Interpretation 9498] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9471] Modify the form based on Edit Creaded Date access controls.
// [Interpretation 9501] Modify the form based on Edit Creaded Date access controls.
if (!$user->authorise('core.edit.created', 'com_sermondistributor'))
{
// [Interpretation 9483] Disable fields for display.
// [Interpretation 9513] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9485] Disable fields while saving.
// [Interpretation 9515] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9518] Only load these values if no id is found
// [Interpretation 9548] Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9521] Set redirected field name
// [Interpretation 9551] Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9523] Set redirected field value
// [Interpretation 9553] Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9527] Now set the local-redirected field default value
// [Interpretation 9557] Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -227,7 +227,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
$user = JFactory::getUser();
// [Interpretation 9649] The record has been set. Check the record permissions.
// [Interpretation 9679] The record has been set. Check the record permissions.
return $user->authorise('help_document.delete', 'com_sermondistributor.help_document.' . (int) $record->id);
}
return false;
@ -249,14 +249,14 @@ class SermondistributorModelHelp_document extends JModelAdmin
if ($recordId)
{
// [Interpretation 9736] The record has been set. Check the record permissions.
// [Interpretation 9766] The record has been set. Check the record permissions.
$permission = $user->authorise('help_document.edit.state', 'com_sermondistributor.help_document.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9753] In the absense of better information, revert to the component permissions.
// [Interpretation 9783] In the absense of better information, revert to the component permissions.
return $user->authorise('help_document.edit.state', 'com_sermondistributor');
}
@ -271,7 +271,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9561] Check specific edit permission then general edit permission.
// [Interpretation 9591] Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('help_document.edit', 'com_sermondistributor.help_document.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('help_document.edit', 'com_sermondistributor');
@ -370,20 +370,20 @@ class SermondistributorModelHelp_document extends JModelAdmin
*/
public function validate($form, $data, $group = null)
{
// [Interpretation 8522] check if the not_required field is set
// [Interpretation 8552] check if the not_required field is set
if (SermondistributorHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
// [Interpretation 8527] now change the required field attributes value
// [Interpretation 8557] now change the required field attributes value
foreach ($requiredFields as $requiredField)
{
// [Interpretation 8530] make sure there is a string value
// [Interpretation 8560] make sure there is a string value
if (SermondistributorHelper::checkString($requiredField))
{
// [Interpretation 8533] change to false
// [Interpretation 8563] change to false
$form->setFieldAttribute($requiredField, 'required', 'false');
// [Interpretation 8535] also clear the data set
// [Interpretation 8565] also clear the data set
$data[$requiredField] = '';
}
}
@ -533,7 +533,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4263] Set some needed variables.
// [Interpretation 4293] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -547,12 +547,12 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false;
}
// [Interpretation 4283] get list of uniqe fields
// [Interpretation 4313] get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4285] remove move_copy from array
// [Interpretation 4315] remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4288] make sure published is set
// [Interpretation 4318] make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -564,21 +564,21 @@ class SermondistributorModelHelp_document extends JModelAdmin
$newIds = array();
// [Interpretation 4325] Parent exists so let's proceed
// [Interpretation 4355] Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4328] Pop the first ID off the stack
// [Interpretation 4358] Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4333] only allow copy if user may edit this item.
// [Interpretation 4363] only allow copy if user may edit this item.
if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
{
// [Interpretation 4343] Not fatal error
// [Interpretation 4373] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -586,19 +586,19 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
// [Interpretation 4348] Check that the row actually exists
// [Interpretation 4378] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4353] Fatal error
// [Interpretation 4383] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4360] Not fatal error
// [Interpretation 4390] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -606,7 +606,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
list($this->table->title, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->title);
// [Interpretation 4396] insert all set values
// [Interpretation 4426] insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -618,7 +618,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
}
// [Interpretation 4408] update all uniqe fields
// [Interpretation 4438] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -627,13 +627,13 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
}
// [Interpretation 4417] Reset the ID because we are making a copy
// [Interpretation 4447] Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4420] TODO: Deal with ordering?
// [Interpretation 4421] $this->table->ordering = 1;
// [Interpretation 4450] TODO: Deal with ordering?
// [Interpretation 4451] $this->table->ordering = 1;
// [Interpretation 4423] Check the row.
// [Interpretation 4453] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -646,7 +646,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4436] Store the row.
// [Interpretation 4466] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -654,14 +654,14 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false;
}
// [Interpretation 4444] Get the new item ID
// [Interpretation 4474] Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4447] Add the new ID to the array
// [Interpretation 4477] Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4451] Clean the cache
// [Interpretation 4481] Clean the cache
$this->cleanCache();
return $newIds;
@ -682,7 +682,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4065] Set some needed variables.
// [Interpretation 4095] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -697,15 +697,15 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false;
}
// [Interpretation 4087] make sure published only updates if user has the permission.
// [Interpretation 4117] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('help_document.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4100] remove move_copy from array
// [Interpretation 4130] remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4121] Parent exists so we proceed
// [Interpretation 4151] Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
@ -715,30 +715,30 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false;
}
// [Interpretation 4138] Check that the row actually exists
// [Interpretation 4168] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4143] Fatal error
// [Interpretation 4173] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4150] Not fatal error
// [Interpretation 4180] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4156] insert all set values.
// [Interpretation 4186] insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4161] Do special action for access.
// [Interpretation 4191] Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -751,7 +751,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
// [Interpretation 4173] Check the row.
// [Interpretation 4203] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -764,7 +764,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4186] Store the row.
// [Interpretation 4216] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -773,7 +773,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
}
// [Interpretation 4195] Clean the cache
// [Interpretation 4225] Clean the cache
$this->cleanCache();
return true;
@ -803,7 +803,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// [Interpretation 3377] Set the groups string to JSON string.
// [Interpretation 3407] Set the groups string to JSON string.
if (isset($data['groups']))
{
$data['groups'] = (string) json_encode($data['groups']);
@ -817,7 +817,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4477] Alter the title for save as copy
// [Interpretation 4507] Alter the title for save as copy
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
@ -840,7 +840,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$data['published'] = 0;
}
// [Interpretation 4504] Automatic handling of alias for empty fields
// [Interpretation 4534] Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{
if ($data['alias'] == null)
@ -871,10 +871,10 @@ class SermondistributorModelHelp_document extends JModelAdmin
}
}
// [Interpretation 4543] Alter the uniqe field for save as copy
// [Interpretation 4573] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4546] Automatic handling of other uniqe fields
// [Interpretation 4576] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -928,7 +928,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
protected function _generateNewTitle($alias, $title)
{
// [Interpretation 4577] Alter the title & alias
// [Interpretation 4607] Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_documents.php
@ -113,16 +113,16 @@ class SermondistributorModelHelp_documents extends JModelList
*/
public function getItems()
{
// [Interpretation 10327] check in items
// [Interpretation 10357] check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -133,7 +133,7 @@ class SermondistributorModelHelp_documents extends JModelList
continue;
}
// [Interpretation 10473] decode groups
// [Interpretation 10503] decode groups
$groupsArray = json_decode($item->groups, true);
if (SermondistributorHelper::checkArray($groupsArray))
{
@ -156,14 +156,14 @@ class SermondistributorModelHelp_documents extends JModelList
}
}
// [Interpretation 10674] set selection value to a translatable value
// [Interpretation 10704] set selection value to a translatable value
if (SermondistributorHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// [Interpretation 10681] convert type
// [Interpretation 10711] convert type
$item->type = $this->selectionTranslation($item->type, 'type');
// [Interpretation 10681] convert location
// [Interpretation 10711] convert location
$item->location = $this->selectionTranslation($item->location, 'location');
}
}
@ -180,7 +180,7 @@ class SermondistributorModelHelp_documents extends JModelList
*/
public function selectionTranslation($value,$name)
{
// [Interpretation 10707] Array of type language strings
// [Interpretation 10737] Array of type language strings
if ($name == 'type')
{
$typeArray = array(
@ -189,20 +189,20 @@ class SermondistributorModelHelp_documents extends JModelList
2 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TEXT',
3 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL'
);
// [Interpretation 10738] Now check if value is found in this array
// [Interpretation 10768] Now check if value is found in this array
if (isset($typeArray[$value]) && SermondistributorHelper::checkString($typeArray[$value]))
{
return $typeArray[$value];
}
}
// [Interpretation 10707] Array of location language strings
// [Interpretation 10737] Array of location language strings
if ($name == 'location')
{
$locationArray = array(
1 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN',
2 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SITE'
);
// [Interpretation 10738] Now check if value is found in this array
// [Interpretation 10768] Now check if value is found in this array
if (isset($locationArray[$value]) && SermondistributorHelper::checkString($locationArray[$value]))
{
return $locationArray[$value];
@ -218,19 +218,19 @@ class SermondistributorModelHelp_documents extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 7194] Get the user object.
// [Interpretation 7224] Get the user object.
$user = JFactory::getUser();
// [Interpretation 7196] Create a new query object.
// [Interpretation 7226] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 7199] Select some fields
// [Interpretation 7229] Select some fields
$query->select('a.*');
// [Interpretation 7206] From the sermondistributor_item table
// [Interpretation 7236] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_help_document', 'a'));
// [Interpretation 7220] Filter by published state
// [Interpretation 7250] Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -241,21 +241,21 @@ class SermondistributorModelHelp_documents extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 7232] Join over the asset groups.
// [Interpretation 7262] Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 7235] Filter by access level.
// [Interpretation 7265] Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 7240] Implement View Level Access
// [Interpretation 7270] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 7317] Filter by search.
// [Interpretation 7347] Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -270,28 +270,28 @@ class SermondistributorModelHelp_documents extends JModelList
}
}
// [Interpretation 7510] Filter by Type.
// [Interpretation 7540] Filter by Type.
if ($type = $this->getState('filter.type'))
{
$query->where('a.type = ' . $db->quote($db->escape($type, true)));
}
// [Interpretation 7510] Filter by Location.
// [Interpretation 7540] Filter by Location.
if ($location = $this->getState('filter.location'))
{
$query->where('a.location = ' . $db->quote($db->escape($location, true)));
}
// [Interpretation 7510] Filter by Admin_view.
// [Interpretation 7540] Filter by Admin_view.
if ($admin_view = $this->getState('filter.admin_view'))
{
$query->where('a.admin_view = ' . $db->quote($db->escape($admin_view, true)));
}
// [Interpretation 7510] Filter by Site_view.
// [Interpretation 7540] Filter by Site_view.
if ($site_view = $this->getState('filter.site_view'))
{
$query->where('a.site_view = ' . $db->quote($db->escape($site_view, true)));
}
// [Interpretation 7276] Add the list ordering clause.
// [Interpretation 7306] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -309,44 +309,44 @@ class SermondistributorModelHelp_documents extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6929] setup the query
// [Interpretation 6959] setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6932] Set a value to know this is exporting method.
// [Interpretation 6962] Set a value to know this is exporting method.
$_export = true;
// [Interpretation 6934] Get the user object.
// [Interpretation 6964] Get the user object.
$user = JFactory::getUser();
// [Interpretation 6936] Create a new query object.
// [Interpretation 6966] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6939] Select some fields
// [Interpretation 6969] Select some fields
$query->select('a.*');
// [Interpretation 6941] From the sermondistributor_help_document table
// [Interpretation 6971] From the sermondistributor_help_document table
$query->from($db->quoteName('#__sermondistributor_help_document', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6951] Implement View Level Access
// [Interpretation 6981] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6958] Order the results by ordering
// [Interpretation 6988] Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6960] Load the items
// [Interpretation 6990] Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -357,13 +357,13 @@ class SermondistributorModelHelp_documents extends JModelList
continue;
}
// [Interpretation 10621] unset the values we don't want exported.
// [Interpretation 10651] unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10630] Add headers to items array.
// [Interpretation 10660] Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -382,13 +382,13 @@ class SermondistributorModelHelp_documents extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6980] Get a db connection.
// [Interpretation 7010] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6982] get the columns
// [Interpretation 7012] get the columns
$columns = $db->getTableColumns("#__sermondistributor_help_document");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6986] remove the headers you don't import/export.
// [Interpretation 7016] remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -410,7 +410,7 @@ class SermondistributorModelHelp_documents extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9945] Compile the store id.
// [Interpretation 9975] Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -434,15 +434,15 @@ class SermondistributorModelHelp_documents extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 10343] Get set check in time
// [Interpretation 10373] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 10348] Get a db connection.
// [Interpretation 10378] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 10350] reset query
// [Interpretation 10380] reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_help_document'));
@ -450,24 +450,24 @@ class SermondistributorModelHelp_documents extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 10358] Get Yesterdays date
// [Interpretation 10388] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 10360] reset query
// [Interpretation 10390] reset query
$query = $db->getQuery(true);
// [Interpretation 10362] Fields to update.
// [Interpretation 10392] Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 10367] Conditions for which records should be updated.
// [Interpretation 10397] Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 10372] Check table
// [Interpretation 10402] Check table
$query->update($db->quoteName('#__sermondistributor_help_document'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage import.php
@ -198,7 +198,8 @@ class SermondistributorModelImport extends JModelLegacy
protected function _getPackageFromUpload()
{
// Get the uploaded file information
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
$userfile = $input->files->get('import_package', null, 'raw');
@ -206,21 +207,21 @@ class SermondistributorModelImport extends JModelLegacy
// Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads'))
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_WARNIMPORTFILE'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
return false;
}
// If there is no uploaded file, we have a problem...
if (!is_array($userfile))
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_NO_FILE_SELECTED'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
return false;
}
// Check if there was a problem uploading the file.
if ($userfile['error'] || $userfile['size'] < 1)
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_WARNIMPORTUPLOADERROR'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
return false;
}
@ -258,7 +259,8 @@ class SermondistributorModelImport extends JModelLegacy
*/
protected function _getPackageFromFolder()
{
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Get the path to the package to import
$p_dir = $input->getString('import_directory');
@ -266,7 +268,7 @@ class SermondistributorModelImport extends JModelLegacy
// Did you give us a valid path?
if (!file_exists($p_dir))
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
return false;
}
@ -276,7 +278,7 @@ class SermondistributorModelImport extends JModelLegacy
// Did you give us a valid package?
if (!$type)
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
}
// check the extention
@ -287,7 +289,7 @@ class SermondistributorModelImport extends JModelLegacy
break;
default:
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}
@ -307,15 +309,16 @@ class SermondistributorModelImport extends JModelLegacy
*/
protected function _getPackageFromUrl()
{
$input = JFactory::getApplication()->input;
$app = JFactory::getApplication();
$input = $app->input;
// Get the URL of the package to import
$url = $input->getString('import_url');
// Did you give us a URL?
if (!$url)
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_ENTER_A_URL'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_ENTER_A_URL'), 'warning');
return false;
}
@ -325,7 +328,7 @@ class SermondistributorModelImport extends JModelLegacy
// Was the package downloaded?
if (!$p_file)
{
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_INVALID_URL'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_INVALID_URL'), 'warning');
return false;
}
@ -346,6 +349,7 @@ class SermondistributorModelImport extends JModelLegacy
*/
protected function check($archivename)
{
$app = JFactory::getApplication();
// Clean the name
$archivename = JPath::clean($archivename);
@ -359,7 +363,7 @@ class SermondistributorModelImport extends JModelLegacy
default:
// Cleanup the import files
$this->remove($archivename);
JError::raiseWarning('', JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
$app->enqueueMessage(JText::_('COM_SERMONDISTRIBUTOR_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
break;
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.php
@ -113,29 +113,29 @@ class SermondistributorModelPreacher extends JModelAdmin
*/
public function getVvvsermons()
{
// [Interpretation 6643] Get the user object.
// [Interpretation 6673] Get the user object.
$user = JFactory::getUser();
// [Interpretation 6645] Create a new query object.
// [Interpretation 6675] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6648] Select some fields
// [Interpretation 6678] Select some fields
$query->select('a.*');
$query->select($db->quoteName('c.title','category_title'));
// [Interpretation 6655] From the sermondistributor_sermon table
// [Interpretation 6685] From the sermondistributor_sermon table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
// [Interpretation 7347] From the sermondistributor_preacher table.
// [Interpretation 7377] From the sermondistributor_preacher table.
$query->select($db->quoteName('g.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'g') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 7347] From the sermondistributor_series table.
// [Interpretation 7377] From the sermondistributor_series table.
$query->select($db->quoteName('h.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'h') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 6671] Filter by preachervvvv global.
// [Interpretation 6701] Filter by preachervvvv global.
$preachervvvv = $this->preachervvvv;
if (is_numeric($preachervvvv ))
{
@ -150,36 +150,36 @@ class SermondistributorModelPreacher extends JModelAdmin
$query->where('a.preacher = -5');
}
// [Interpretation 6688] Join over the asset groups.
// [Interpretation 6718] Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6691] Filter by access level.
// [Interpretation 6721] Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6696] Implement View Level Access
// [Interpretation 6726] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6703] Order the results by ordering
// [Interpretation 6733] Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');
// [Interpretation 6705] Load the items
// [Interpretation 6735] Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -193,14 +193,14 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 10674] set selection value to a translatable value
// [Interpretation 10704] set selection value to a translatable value
if (SermondistributorHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// [Interpretation 10681] convert link_type
// [Interpretation 10711] convert link_type
$item->link_type = $this->selectionTranslationVvvsermons($item->link_type, 'link_type');
// [Interpretation 10681] convert source
// [Interpretation 10711] convert source
$item->source = $this->selectionTranslationVvvsermons($item->source, 'source');
}
}
@ -217,20 +217,20 @@ class SermondistributorModelPreacher extends JModelAdmin
*/
public function selectionTranslationVvvsermons($value,$name)
{
// [Interpretation 10707] Array of link_type language strings
// [Interpretation 10737] Array of link_type language strings
if ($name == 'link_type')
{
$link_typeArray = array(
1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED',
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT'
);
// [Interpretation 10738] Now check if value is found in this array
// [Interpretation 10768] Now check if value is found in this array
if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value]))
{
return $link_typeArray[$value];
}
}
// [Interpretation 10707] Array of source language strings
// [Interpretation 10737] Array of source language strings
if ($name == 'source')
{
$sourceArray = array(
@ -239,7 +239,7 @@ class SermondistributorModelPreacher extends JModelAdmin
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX',
3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL'
);
// [Interpretation 10738] Now check if value is found in this array
// [Interpretation 10768] Now check if value is found in this array
if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value]))
{
return $sourceArray[$value];
@ -259,7 +259,7 @@ class SermondistributorModelPreacher extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 9328] Get the form.
{ // [Interpretation 9358] Get the form.
$form = $this->loadForm('com_sermondistributor.preacher', 'preacher', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -269,12 +269,12 @@ class SermondistributorModelPreacher extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 9413] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// [Interpretation 9443] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 9418] The back end uses id so we use that the rest of the time and set it to 0 by default.
// [Interpretation 9448] The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
@ -282,54 +282,54 @@ class SermondistributorModelPreacher extends JModelAdmin
$user = JFactory::getUser();
// [Interpretation 9424] Check for existing item.
// [Interpretation 9425] Modify the form based on Edit State access controls.
// [Interpretation 9454] Check for existing item.
// [Interpretation 9455] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('preacher.edit.state', 'com_sermondistributor.preacher.' . (int) $id))
|| ($id == 0 && !$user->authorise('preacher.edit.state', 'com_sermondistributor')))
{
// [Interpretation 9438] Disable fields for display.
// [Interpretation 9468] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 9441] Disable fields while saving.
// [Interpretation 9471] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9446] If this is a new item insure the greated by is set.
// [Interpretation 9476] If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9449] Set the created_by to this user
// [Interpretation 9479] Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9452] Modify the form based on Edit Creaded By access controls.
// [Interpretation 9482] Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('preacher.edit.created_by', 'com_sermondistributor.preacher.' . (int) $id))
|| ($id == 0 && !$user->authorise('preacher.edit.created_by', 'com_sermondistributor')))
{
// [Interpretation 9464] Disable fields for display.
// [Interpretation 9494] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9466] Disable fields for display.
// [Interpretation 9496] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9468] Disable fields while saving.
// [Interpretation 9498] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9471] Modify the form based on Edit Creaded Date access controls.
// [Interpretation 9501] Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('preacher.edit.created', 'com_sermondistributor.preacher.' . (int) $id))
|| ($id == 0 && !$user->authorise('preacher.edit.created', 'com_sermondistributor')))
{
// [Interpretation 9483] Disable fields for display.
// [Interpretation 9513] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9485] Disable fields while saving.
// [Interpretation 9515] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9518] Only load these values if no id is found
// [Interpretation 9548] Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9521] Set redirected field name
// [Interpretation 9551] Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9523] Set redirected field value
// [Interpretation 9553] Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9527] Now set the local-redirected field default value
// [Interpretation 9557] Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -366,7 +366,7 @@ class SermondistributorModelPreacher extends JModelAdmin
}
$user = JFactory::getUser();
// [Interpretation 9649] The record has been set. Check the record permissions.
// [Interpretation 9679] The record has been set. Check the record permissions.
return $user->authorise('preacher.delete', 'com_sermondistributor.preacher.' . (int) $record->id);
}
return false;
@ -388,14 +388,14 @@ class SermondistributorModelPreacher extends JModelAdmin
if ($recordId)
{
// [Interpretation 9736] The record has been set. Check the record permissions.
// [Interpretation 9766] The record has been set. Check the record permissions.
$permission = $user->authorise('preacher.edit.state', 'com_sermondistributor.preacher.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9753] In the absense of better information, revert to the component permissions.
// [Interpretation 9783] In the absense of better information, revert to the component permissions.
return $user->authorise('preacher.edit.state', 'com_sermondistributor');
}
@ -410,7 +410,7 @@ class SermondistributorModelPreacher extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9561] Check specific edit permission then general edit permission.
// [Interpretation 9591] Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('preacher.edit', 'com_sermondistributor.preacher.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('preacher.edit', 'com_sermondistributor');
@ -636,7 +636,7 @@ class SermondistributorModelPreacher extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4263] Set some needed variables.
// [Interpretation 4293] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -650,12 +650,12 @@ class SermondistributorModelPreacher extends JModelAdmin
return false;
}
// [Interpretation 4283] get list of uniqe fields
// [Interpretation 4313] get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4285] remove move_copy from array
// [Interpretation 4315] remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4288] make sure published is set
// [Interpretation 4318] make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -667,21 +667,21 @@ class SermondistributorModelPreacher extends JModelAdmin
$newIds = array();
// [Interpretation 4325] Parent exists so let's proceed
// [Interpretation 4355] Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4328] Pop the first ID off the stack
// [Interpretation 4358] Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4333] only allow copy if user may edit this item.
// [Interpretation 4363] only allow copy if user may edit this item.
if (!$this->user->authorise('preacher.edit', $contexts[$pk]))
{
// [Interpretation 4343] Not fatal error
// [Interpretation 4373] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -689,19 +689,19 @@ class SermondistributorModelPreacher extends JModelAdmin
}
// [Interpretation 4348] Check that the row actually exists
// [Interpretation 4378] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4353] Fatal error
// [Interpretation 4383] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4360] Not fatal error
// [Interpretation 4390] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -709,7 +709,7 @@ class SermondistributorModelPreacher extends JModelAdmin
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// [Interpretation 4396] insert all set values
// [Interpretation 4426] insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -721,7 +721,7 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 4408] update all uniqe fields
// [Interpretation 4438] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -730,13 +730,13 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 4417] Reset the ID because we are making a copy
// [Interpretation 4447] Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4420] TODO: Deal with ordering?
// [Interpretation 4421] $this->table->ordering = 1;
// [Interpretation 4450] TODO: Deal with ordering?
// [Interpretation 4451] $this->table->ordering = 1;
// [Interpretation 4423] Check the row.
// [Interpretation 4453] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -749,7 +749,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4436] Store the row.
// [Interpretation 4466] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -757,14 +757,14 @@ class SermondistributorModelPreacher extends JModelAdmin
return false;
}
// [Interpretation 4444] Get the new item ID
// [Interpretation 4474] Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4447] Add the new ID to the array
// [Interpretation 4477] Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4451] Clean the cache
// [Interpretation 4481] Clean the cache
$this->cleanCache();
return $newIds;
@ -785,7 +785,7 @@ class SermondistributorModelPreacher extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4065] Set some needed variables.
// [Interpretation 4095] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -800,15 +800,15 @@ class SermondistributorModelPreacher extends JModelAdmin
return false;
}
// [Interpretation 4087] make sure published only updates if user has the permission.
// [Interpretation 4117] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('preacher.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4100] remove move_copy from array
// [Interpretation 4130] remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4121] Parent exists so we proceed
// [Interpretation 4151] Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('preacher.edit', $contexts[$pk]))
@ -818,30 +818,30 @@ class SermondistributorModelPreacher extends JModelAdmin
return false;
}
// [Interpretation 4138] Check that the row actually exists
// [Interpretation 4168] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4143] Fatal error
// [Interpretation 4173] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4150] Not fatal error
// [Interpretation 4180] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4156] insert all set values.
// [Interpretation 4186] insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4161] Do special action for access.
// [Interpretation 4191] Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -854,7 +854,7 @@ class SermondistributorModelPreacher extends JModelAdmin
}
// [Interpretation 4173] Check the row.
// [Interpretation 4203] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -867,7 +867,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4186] Store the row.
// [Interpretation 4216] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -876,7 +876,7 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 4195] Clean the cache
// [Interpretation 4225] Clean the cache
$this->cleanCache();
return true;
@ -914,7 +914,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4477] Alter the name for save as copy
// [Interpretation 4507] Alter the name for save as copy
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
@ -937,7 +937,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$data['published'] = 0;
}
// [Interpretation 4504] Automatic handling of alias for empty fields
// [Interpretation 4534] Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{
if ($data['alias'] == null)
@ -968,10 +968,10 @@ class SermondistributorModelPreacher extends JModelAdmin
}
}
// [Interpretation 4543] Alter the uniqe field for save as copy
// [Interpretation 4573] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4546] Automatic handling of other uniqe fields
// [Interpretation 4576] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -1025,7 +1025,7 @@ class SermondistributorModelPreacher extends JModelAdmin
protected function _generateNewTitle($alias, $title)
{
// [Interpretation 4577] Alter the title & alias
// [Interpretation 4607] Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preachers.php
@ -101,16 +101,16 @@ class SermondistributorModelPreachers extends JModelList
*/
public function getItems()
{
// [Interpretation 10327] check in items
// [Interpretation 10357] check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -135,19 +135,19 @@ class SermondistributorModelPreachers extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 7194] Get the user object.
// [Interpretation 7224] Get the user object.
$user = JFactory::getUser();
// [Interpretation 7196] Create a new query object.
// [Interpretation 7226] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 7199] Select some fields
// [Interpretation 7229] Select some fields
$query->select('a.*');
// [Interpretation 7206] From the sermondistributor_item table
// [Interpretation 7236] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_preacher', 'a'));
// [Interpretation 7220] Filter by published state
// [Interpretation 7250] Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -158,21 +158,21 @@ class SermondistributorModelPreachers extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 7232] Join over the asset groups.
// [Interpretation 7262] Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 7235] Filter by access level.
// [Interpretation 7265] Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 7240] Implement View Level Access
// [Interpretation 7270] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 7317] Filter by search.
// [Interpretation 7347] Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -188,7 +188,7 @@ class SermondistributorModelPreachers extends JModelList
}
// [Interpretation 7276] Add the list ordering clause.
// [Interpretation 7306] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -206,44 +206,44 @@ class SermondistributorModelPreachers extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6929] setup the query
// [Interpretation 6959] setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6932] Set a value to know this is exporting method.
// [Interpretation 6962] Set a value to know this is exporting method.
$_export = true;
// [Interpretation 6934] Get the user object.
// [Interpretation 6964] Get the user object.
$user = JFactory::getUser();
// [Interpretation 6936] Create a new query object.
// [Interpretation 6966] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6939] Select some fields
// [Interpretation 6969] Select some fields
$query->select('a.*');
// [Interpretation 6941] From the sermondistributor_preacher table
// [Interpretation 6971] From the sermondistributor_preacher table
$query->from($db->quoteName('#__sermondistributor_preacher', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6951] Implement View Level Access
// [Interpretation 6981] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6958] Order the results by ordering
// [Interpretation 6988] Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6960] Load the items
// [Interpretation 6990] Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -254,13 +254,13 @@ class SermondistributorModelPreachers extends JModelList
continue;
}
// [Interpretation 10621] unset the values we don't want exported.
// [Interpretation 10651] unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10630] Add headers to items array.
// [Interpretation 10660] Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -279,13 +279,13 @@ class SermondistributorModelPreachers extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6980] Get a db connection.
// [Interpretation 7010] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6982] get the columns
// [Interpretation 7012] get the columns
$columns = $db->getTableColumns("#__sermondistributor_preacher");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6986] remove the headers you don't import/export.
// [Interpretation 7016] remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -307,7 +307,7 @@ class SermondistributorModelPreachers extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9945] Compile the store id.
// [Interpretation 9975] Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -328,15 +328,15 @@ class SermondistributorModelPreachers extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 10343] Get set check in time
// [Interpretation 10373] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 10348] Get a db connection.
// [Interpretation 10378] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 10350] reset query
// [Interpretation 10380] reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_preacher'));
@ -344,24 +344,24 @@ class SermondistributorModelPreachers extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 10358] Get Yesterdays date
// [Interpretation 10388] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 10360] reset query
// [Interpretation 10390] reset query
$query = $db->getQuery(true);
// [Interpretation 10362] Fields to update.
// [Interpretation 10392] Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 10367] Conditions for which records should be updated.
// [Interpretation 10397] Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 10372] Check table
// [Interpretation 10402] Check table
$query->update($db->quoteName('#__sermondistributor_preacher'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series.php
@ -113,29 +113,29 @@ class SermondistributorModelSeries extends JModelAdmin
*/
public function getVwcsermons()
{
// [Interpretation 6643] Get the user object.
// [Interpretation 6673] Get the user object.
$user = JFactory::getUser();
// [Interpretation 6645] Create a new query object.
// [Interpretation 6675] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6648] Select some fields
// [Interpretation 6678] Select some fields
$query->select('a.*');
$query->select($db->quoteName('c.title','category_title'));
// [Interpretation 6655] From the sermondistributor_sermon table
// [Interpretation 6685] From the sermondistributor_sermon table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
// [Interpretation 7347] From the sermondistributor_preacher table.
// [Interpretation 7377] From the sermondistributor_preacher table.
$query->select($db->quoteName('g.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'g') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 7347] From the sermondistributor_series table.
// [Interpretation 7377] From the sermondistributor_series table.
$query->select($db->quoteName('h.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'h') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 6671] Filter by seriesvvvx global.
// [Interpretation 6701] Filter by seriesvvvx global.
$seriesvvvx = $this->seriesvvvx;
if (is_numeric($seriesvvvx ))
{
@ -150,36 +150,36 @@ class SermondistributorModelSeries extends JModelAdmin
$query->where('a.series = -5');
}
// [Interpretation 6688] Join over the asset groups.
// [Interpretation 6718] Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6691] Filter by access level.
// [Interpretation 6721] Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6696] Implement View Level Access
// [Interpretation 6726] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6703] Order the results by ordering
// [Interpretation 6733] Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');
// [Interpretation 6705] Load the items
// [Interpretation 6735] Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -193,14 +193,14 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 10674] set selection value to a translatable value
// [Interpretation 10704] set selection value to a translatable value
if (SermondistributorHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// [Interpretation 10681] convert link_type
// [Interpretation 10711] convert link_type
$item->link_type = $this->selectionTranslationVwcsermons($item->link_type, 'link_type');
// [Interpretation 10681] convert source
// [Interpretation 10711] convert source
$item->source = $this->selectionTranslationVwcsermons($item->source, 'source');
}
}
@ -217,20 +217,20 @@ class SermondistributorModelSeries extends JModelAdmin
*/
public function selectionTranslationVwcsermons($value,$name)
{
// [Interpretation 10707] Array of link_type language strings
// [Interpretation 10737] Array of link_type language strings
if ($name == 'link_type')
{
$link_typeArray = array(
1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED',
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT'
);
// [Interpretation 10738] Now check if value is found in this array
// [Interpretation 10768] Now check if value is found in this array
if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value]))
{
return $link_typeArray[$value];
}
}
// [Interpretation 10707] Array of source language strings
// [Interpretation 10737] Array of source language strings
if ($name == 'source')
{
$sourceArray = array(
@ -239,7 +239,7 @@ class SermondistributorModelSeries extends JModelAdmin
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX',
3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL'
);
// [Interpretation 10738] Now check if value is found in this array
// [Interpretation 10768] Now check if value is found in this array
if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value]))
{
return $sourceArray[$value];
@ -259,7 +259,7 @@ class SermondistributorModelSeries extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 9328] Get the form.
{ // [Interpretation 9358] Get the form.
$form = $this->loadForm('com_sermondistributor.series', 'series', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -269,12 +269,12 @@ class SermondistributorModelSeries extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 9413] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// [Interpretation 9443] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 9418] The back end uses id so we use that the rest of the time and set it to 0 by default.
// [Interpretation 9448] The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
@ -282,54 +282,54 @@ class SermondistributorModelSeries extends JModelAdmin
$user = JFactory::getUser();
// [Interpretation 9424] Check for existing item.
// [Interpretation 9425] Modify the form based on Edit State access controls.
// [Interpretation 9454] Check for existing item.
// [Interpretation 9455] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('series.edit.state', 'com_sermondistributor.series.' . (int) $id))
|| ($id == 0 && !$user->authorise('series.edit.state', 'com_sermondistributor')))
{
// [Interpretation 9438] Disable fields for display.
// [Interpretation 9468] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 9441] Disable fields while saving.
// [Interpretation 9471] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9446] If this is a new item insure the greated by is set.
// [Interpretation 9476] If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9449] Set the created_by to this user
// [Interpretation 9479] Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9452] Modify the form based on Edit Creaded By access controls.
// [Interpretation 9482] Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('series.edit.created_by', 'com_sermondistributor.series.' . (int) $id))
|| ($id == 0 && !$user->authorise('series.edit.created_by', 'com_sermondistributor')))
{
// [Interpretation 9464] Disable fields for display.
// [Interpretation 9494] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9466] Disable fields for display.
// [Interpretation 9496] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9468] Disable fields while saving.
// [Interpretation 9498] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9471] Modify the form based on Edit Creaded Date access controls.
// [Interpretation 9501] Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('series.edit.created', 'com_sermondistributor.series.' . (int) $id))
|| ($id == 0 && !$user->authorise('series.edit.created', 'com_sermondistributor')))
{
// [Interpretation 9483] Disable fields for display.
// [Interpretation 9513] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9485] Disable fields while saving.
// [Interpretation 9515] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9518] Only load these values if no id is found
// [Interpretation 9548] Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9521] Set redirected field name
// [Interpretation 9551] Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9523] Set redirected field value
// [Interpretation 9553] Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9527] Now set the local-redirected field default value
// [Interpretation 9557] Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -366,7 +366,7 @@ class SermondistributorModelSeries extends JModelAdmin
}
$user = JFactory::getUser();
// [Interpretation 9649] The record has been set. Check the record permissions.
// [Interpretation 9679] The record has been set. Check the record permissions.
return $user->authorise('series.delete', 'com_sermondistributor.series.' . (int) $record->id);
}
return false;
@ -388,14 +388,14 @@ class SermondistributorModelSeries extends JModelAdmin
if ($recordId)
{
// [Interpretation 9736] The record has been set. Check the record permissions.
// [Interpretation 9766] The record has been set. Check the record permissions.
$permission = $user->authorise('series.edit.state', 'com_sermondistributor.series.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9753] In the absense of better information, revert to the component permissions.
// [Interpretation 9783] In the absense of better information, revert to the component permissions.
return $user->authorise('series.edit.state', 'com_sermondistributor');
}
@ -410,7 +410,7 @@ class SermondistributorModelSeries extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9561] Check specific edit permission then general edit permission.
// [Interpretation 9591] Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('series.edit', 'com_sermondistributor.series.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('series.edit', 'com_sermondistributor');
@ -636,7 +636,7 @@ class SermondistributorModelSeries extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4263] Set some needed variables.
// [Interpretation 4293] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -650,12 +650,12 @@ class SermondistributorModelSeries extends JModelAdmin
return false;
}
// [Interpretation 4283] get list of uniqe fields
// [Interpretation 4313] get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4285] remove move_copy from array
// [Interpretation 4315] remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4288] make sure published is set
// [Interpretation 4318] make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -667,21 +667,21 @@ class SermondistributorModelSeries extends JModelAdmin
$newIds = array();
// [Interpretation 4325] Parent exists so let's proceed
// [Interpretation 4355] Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4328] Pop the first ID off the stack
// [Interpretation 4358] Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4333] only allow copy if user may edit this item.
// [Interpretation 4363] only allow copy if user may edit this item.
if (!$this->user->authorise('series.edit', $contexts[$pk]))
{
// [Interpretation 4343] Not fatal error
// [Interpretation 4373] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -689,19 +689,19 @@ class SermondistributorModelSeries extends JModelAdmin
}
// [Interpretation 4348] Check that the row actually exists
// [Interpretation 4378] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4353] Fatal error
// [Interpretation 4383] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4360] Not fatal error
// [Interpretation 4390] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -709,7 +709,7 @@ class SermondistributorModelSeries extends JModelAdmin
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// [Interpretation 4396] insert all set values
// [Interpretation 4426] insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -721,7 +721,7 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 4408] update all uniqe fields
// [Interpretation 4438] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -730,13 +730,13 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 4417] Reset the ID because we are making a copy
// [Interpretation 4447] Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4420] TODO: Deal with ordering?
// [Interpretation 4421] $this->table->ordering = 1;
// [Interpretation 4450] TODO: Deal with ordering?
// [Interpretation 4451] $this->table->ordering = 1;
// [Interpretation 4423] Check the row.
// [Interpretation 4453] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -749,7 +749,7 @@ class SermondistributorModelSeries extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4436] Store the row.
// [Interpretation 4466] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -757,14 +757,14 @@ class SermondistributorModelSeries extends JModelAdmin
return false;
}
// [Interpretation 4444] Get the new item ID
// [Interpretation 4474] Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4447] Add the new ID to the array
// [Interpretation 4477] Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4451] Clean the cache
// [Interpretation 4481] Clean the cache
$this->cleanCache();
return $newIds;
@ -785,7 +785,7 @@ class SermondistributorModelSeries extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4065] Set some needed variables.
// [Interpretation 4095] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -800,15 +800,15 @@ class SermondistributorModelSeries extends JModelAdmin
return false;
}
// [Interpretation 4087] make sure published only updates if user has the permission.
// [Interpretation 4117] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('series.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4100] remove move_copy from array
// [Interpretation 4130] remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4121] Parent exists so we proceed
// [Interpretation 4151] Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('series.edit', $contexts[$pk]))
@ -818,30 +818,30 @@ class SermondistributorModelSeries extends JModelAdmin
return false;
}
// [Interpretation 4138] Check that the row actually exists
// [Interpretation 4168] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4143] Fatal error
// [Interpretation 4173] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4150] Not fatal error
// [Interpretation 4180] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4156] insert all set values.
// [Interpretation 4186] insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4161] Do special action for access.
// [Interpretation 4191] Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -854,7 +854,7 @@ class SermondistributorModelSeries extends JModelAdmin
}
// [Interpretation 4173] Check the row.
// [Interpretation 4203] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -867,7 +867,7 @@ class SermondistributorModelSeries extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4186] Store the row.
// [Interpretation 4216] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -876,7 +876,7 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 4195] Clean the cache
// [Interpretation 4225] Clean the cache
$this->cleanCache();
return true;
@ -914,7 +914,7 @@ class SermondistributorModelSeries extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4477] Alter the name for save as copy
// [Interpretation 4507] Alter the name for save as copy
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
@ -937,7 +937,7 @@ class SermondistributorModelSeries extends JModelAdmin
$data['published'] = 0;
}
// [Interpretation 4504] Automatic handling of alias for empty fields
// [Interpretation 4534] Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{
if ($data['alias'] == null)
@ -968,10 +968,10 @@ class SermondistributorModelSeries extends JModelAdmin
}
}
// [Interpretation 4543] Alter the uniqe field for save as copy
// [Interpretation 4573] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4546] Automatic handling of other uniqe fields
// [Interpretation 4576] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -1025,7 +1025,7 @@ class SermondistributorModelSeries extends JModelAdmin
protected function _generateNewTitle($alias, $title)
{
// [Interpretation 4577] Alter the title & alias
// [Interpretation 4607] Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage series_list.php
@ -97,16 +97,16 @@ class SermondistributorModelSeries_list extends JModelList
*/
public function getItems()
{
// [Interpretation 10327] check in items
// [Interpretation 10357] check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -131,19 +131,19 @@ class SermondistributorModelSeries_list extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 7194] Get the user object.
// [Interpretation 7224] Get the user object.
$user = JFactory::getUser();
// [Interpretation 7196] Create a new query object.
// [Interpretation 7226] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 7199] Select some fields
// [Interpretation 7229] Select some fields
$query->select('a.*');
// [Interpretation 7206] From the sermondistributor_item table
// [Interpretation 7236] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_series', 'a'));
// [Interpretation 7220] Filter by published state
// [Interpretation 7250] Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -154,21 +154,21 @@ class SermondistributorModelSeries_list extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 7232] Join over the asset groups.
// [Interpretation 7262] Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 7235] Filter by access level.
// [Interpretation 7265] Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 7240] Implement View Level Access
// [Interpretation 7270] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 7317] Filter by search.
// [Interpretation 7347] Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -184,7 +184,7 @@ class SermondistributorModelSeries_list extends JModelList
}
// [Interpretation 7276] Add the list ordering clause.
// [Interpretation 7306] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -202,44 +202,44 @@ class SermondistributorModelSeries_list extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6929] setup the query
// [Interpretation 6959] setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6932] Set a value to know this is exporting method.
// [Interpretation 6962] Set a value to know this is exporting method.
$_export = true;
// [Interpretation 6934] Get the user object.
// [Interpretation 6964] Get the user object.
$user = JFactory::getUser();
// [Interpretation 6936] Create a new query object.
// [Interpretation 6966] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6939] Select some fields
// [Interpretation 6969] Select some fields
$query->select('a.*');
// [Interpretation 6941] From the sermondistributor_series table
// [Interpretation 6971] From the sermondistributor_series table
$query->from($db->quoteName('#__sermondistributor_series', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6951] Implement View Level Access
// [Interpretation 6981] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6958] Order the results by ordering
// [Interpretation 6988] Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6960] Load the items
// [Interpretation 6990] Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -250,13 +250,13 @@ class SermondistributorModelSeries_list extends JModelList
continue;
}
// [Interpretation 10621] unset the values we don't want exported.
// [Interpretation 10651] unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10630] Add headers to items array.
// [Interpretation 10660] Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -275,13 +275,13 @@ class SermondistributorModelSeries_list extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6980] Get a db connection.
// [Interpretation 7010] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6982] get the columns
// [Interpretation 7012] get the columns
$columns = $db->getTableColumns("#__sermondistributor_series");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6986] remove the headers you don't import/export.
// [Interpretation 7016] remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -303,7 +303,7 @@ class SermondistributorModelSeries_list extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9945] Compile the store id.
// [Interpretation 9975] Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -323,15 +323,15 @@ class SermondistributorModelSeries_list extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 10343] Get set check in time
// [Interpretation 10373] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 10348] Get a db connection.
// [Interpretation 10378] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 10350] reset query
// [Interpretation 10380] reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_series'));
@ -339,24 +339,24 @@ class SermondistributorModelSeries_list extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 10358] Get Yesterdays date
// [Interpretation 10388] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 10360] reset query
// [Interpretation 10390] reset query
$query = $db->getQuery(true);
// [Interpretation 10362] Fields to update.
// [Interpretation 10392] Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 10367] Conditions for which records should be updated.
// [Interpretation 10397] Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 10372] Check table
// [Interpretation 10402] Check table
$query->update($db->quoteName('#__sermondistributor_series'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermon.php
@ -97,13 +97,13 @@ class SermondistributorModelSermon extends JModelAdmin
if (!empty($item->local_files))
{
// [Interpretation 3267] JSON Decode local_files.
// [Interpretation 3297] JSON Decode local_files.
$item->local_files = json_decode($item->local_files);
}
if (!empty($item->manual_files))
{
// [Interpretation 3267] JSON Decode manual_files.
// [Interpretation 3297] JSON Decode manual_files.
$item->manual_files = json_decode($item->manual_files);
}
@ -125,31 +125,31 @@ class SermondistributorModelSermon extends JModelAdmin
*/
public function getVwbstastics()
{
// [Interpretation 6643] Get the user object.
// [Interpretation 6673] Get the user object.
$user = JFactory::getUser();
// [Interpretation 6645] Create a new query object.
// [Interpretation 6675] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6648] Select some fields
// [Interpretation 6678] Select some fields
$query->select('a.*');
// [Interpretation 6655] From the sermondistributor_statistic table
// [Interpretation 6685] From the sermondistributor_statistic table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
// [Interpretation 7347] From the sermondistributor_sermon table.
// [Interpretation 7377] From the sermondistributor_sermon table.
$query->select($db->quoteName('g.name','sermon_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_sermon', 'g') . ' ON (' . $db->quoteName('a.sermon') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 7347] From the sermondistributor_preacher table.
// [Interpretation 7377] From the sermondistributor_preacher table.
$query->select($db->quoteName('h.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'h') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 7347] From the sermondistributor_series table.
// [Interpretation 7377] From the sermondistributor_series table.
$query->select($db->quoteName('i.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'i') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('i.id') . ')');
// [Interpretation 6671] Filter by sermonvvvw global.
// [Interpretation 6701] Filter by sermonvvvw global.
$sermonvvvw = $this->sermonvvvw;
if (is_numeric($sermonvvvw ))
{
@ -164,36 +164,36 @@ class SermondistributorModelSermon extends JModelAdmin
$query->where('a.sermon = -5');
}
// [Interpretation 6688] Join over the asset groups.
// [Interpretation 6718] Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 6691] Filter by access level.
// [Interpretation 6721] Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 6696] Implement View Level Access
// [Interpretation 6726] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6703] Order the results by ordering
// [Interpretation 6733] Order the results by ordering
$query->order('a.published ASC');
$query->order('a.ordering ASC');
// [Interpretation 6705] Load the items
// [Interpretation 6735] Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -222,7 +222,7 @@ class SermondistributorModelSermon extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 9328] Get the form.
{ // [Interpretation 9358] Get the form.
$form = $this->loadForm('com_sermondistributor.sermon', 'sermon', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -232,17 +232,17 @@ class SermondistributorModelSermon extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 9355] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// [Interpretation 9385] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 9360] The back end uses id so we use that the rest of the time and set it to 0 by default.
// [Interpretation 9390] The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
}
// [Interpretation 9365] Determine correct permissions to check.
// [Interpretation 9395] Determine correct permissions to check.
if ($this->getState('sermon.id'))
{
$id = $this->getState('sermon.id');
@ -250,74 +250,74 @@ class SermondistributorModelSermon extends JModelAdmin
$catid = 0;
if (isset($this->getItem($id)->catid))
{
// [Interpretation 9372] set catagory id
// [Interpretation 9402] set catagory id
$catid = $this->getItem($id)->catid;
// [Interpretation 9374] Existing record. Can only edit in selected categories.
// [Interpretation 9404] Existing record. Can only edit in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.edit');
// [Interpretation 9376] Existing record. Can only edit own items in selected categories.
// [Interpretation 9406] Existing record. Can only edit own items in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.edit.own');
}
}
else
{
// [Interpretation 9382] New record. Can only create in selected categories.
// [Interpretation 9412] New record. Can only create in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.create');
}
$user = JFactory::getUser();
// [Interpretation 9386] Check for existing item.
// [Interpretation 9387] Modify the form based on Edit State access controls.
// [Interpretation 9416] Check for existing item.
// [Interpretation 9417] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('sermon.edit.state', 'com_sermondistributor.sermon.' . (int) $id))
|| (isset($catid) && $catid != 0 && !$user->authorise('core.edit.state', 'com_sermondistributor.sermons.category.' . (int) $catid))
|| ($id == 0 && !$user->authorise('sermon.edit.state', 'com_sermondistributor')))
{
// [Interpretation 9402] Disable fields for display.
// [Interpretation 9432] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 9405] Disable fields while saving.
// [Interpretation 9435] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9446] If this is a new item insure the greated by is set.
// [Interpretation 9476] If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9449] Set the created_by to this user
// [Interpretation 9479] Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9452] Modify the form based on Edit Creaded By access controls.
// [Interpretation 9482] Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('sermon.edit.created_by', 'com_sermondistributor.sermon.' . (int) $id))
|| ($id == 0 && !$user->authorise('sermon.edit.created_by', 'com_sermondistributor')))
{
// [Interpretation 9464] Disable fields for display.
// [Interpretation 9494] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9466] Disable fields for display.
// [Interpretation 9496] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9468] Disable fields while saving.
// [Interpretation 9498] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9471] Modify the form based on Edit Creaded Date access controls.
// [Interpretation 9501] Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('sermon.edit.created', 'com_sermondistributor.sermon.' . (int) $id))
|| ($id == 0 && !$user->authorise('sermon.edit.created', 'com_sermondistributor')))
{
// [Interpretation 9483] Disable fields for display.
// [Interpretation 9513] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9485] Disable fields while saving.
// [Interpretation 9515] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9518] Only load these values if no id is found
// [Interpretation 9548] Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9521] Set redirected field name
// [Interpretation 9551] Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9523] Set redirected field value
// [Interpretation 9553] Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9527] Now set the local-redirected field default value
// [Interpretation 9557] Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -358,7 +358,7 @@ class SermondistributorModelSermon extends JModelAdmin
if ($allow)
{
// [Interpretation 9620] The record has been set. Check the record permissions.
// [Interpretation 9650] The record has been set. Check the record permissions.
return $user->authorise('sermon.delete', 'com_sermondistributor.sermon.' . (int) $record->id);
}
return $allow;
@ -382,14 +382,14 @@ class SermondistributorModelSermon extends JModelAdmin
if ($recordId)
{
// [Interpretation 9693] The record has been set. Check the record permissions.
// [Interpretation 9723] The record has been set. Check the record permissions.
$permission = $user->authorise('sermon.edit.state', 'com_sermondistributor.sermon.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9709] Check against the category.
// [Interpretation 9739] Check against the category.
if (!empty($record->catid))
{
$catpermission = $user->authorise('core.edit.state', 'com_sermondistributor.sermons.category.' . (int) $record->catid);
@ -398,7 +398,7 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
}
// [Interpretation 9720] In the absense of better information, revert to the component permissions.
// [Interpretation 9750] In the absense of better information, revert to the component permissions.
return $user->authorise('sermon.edit.state', 'com_sermondistributor');
}
@ -413,7 +413,7 @@ class SermondistributorModelSermon extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9561] Check specific edit permission then general edit permission.
// [Interpretation 9591] Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('sermon.edit', 'com_sermondistributor.sermon.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('sermon.edit', 'com_sermondistributor');
@ -512,20 +512,20 @@ class SermondistributorModelSermon extends JModelAdmin
*/
public function validate($form, $data, $group = null)
{
// [Interpretation 8522] check if the not_required field is set
// [Interpretation 8552] check if the not_required field is set
if (SermondistributorHelper::checkString($data['not_required']))
{
$requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields);
// [Interpretation 8527] now change the required field attributes value
// [Interpretation 8557] now change the required field attributes value
foreach ($requiredFields as $requiredField)
{
// [Interpretation 8530] make sure there is a string value
// [Interpretation 8560] make sure there is a string value
if (SermondistributorHelper::checkString($requiredField))
{
// [Interpretation 8533] change to false
// [Interpretation 8563] change to false
$form->setFieldAttribute($requiredField, 'required', 'false');
// [Interpretation 8535] also clear the data set
// [Interpretation 8565] also clear the data set
$data[$requiredField] = '';
}
}
@ -675,7 +675,7 @@ class SermondistributorModelSermon extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4263] Set some needed variables.
// [Interpretation 4293] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -689,12 +689,12 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
// [Interpretation 4283] get list of uniqe fields
// [Interpretation 4313] get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4285] remove move_copy from array
// [Interpretation 4315] remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4288] make sure published is set
// [Interpretation 4318] make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -710,7 +710,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
elseif (isset($values['category']) && (int) $values['category'] > 0)
{
// [Interpretation 4313] move the category value to correct field name
// [Interpretation 4343] move the category value to correct field name
$values['catid'] = $values['category'];
unset($values['category']);
}
@ -721,21 +721,21 @@ class SermondistributorModelSermon extends JModelAdmin
$newIds = array();
// [Interpretation 4325] Parent exists so let's proceed
// [Interpretation 4355] Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4328] Pop the first ID off the stack
// [Interpretation 4358] Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4333] only allow copy if user may edit this item.
// [Interpretation 4363] only allow copy if user may edit this item.
if (!$this->user->authorise('sermon.edit', $contexts[$pk]))
{
// [Interpretation 4343] Not fatal error
// [Interpretation 4373] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -743,19 +743,19 @@ class SermondistributorModelSermon extends JModelAdmin
}
// [Interpretation 4348] Check that the row actually exists
// [Interpretation 4378] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4353] Fatal error
// [Interpretation 4383] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4360] Not fatal error
// [Interpretation 4390] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -770,7 +770,7 @@ class SermondistributorModelSermon extends JModelAdmin
list($this->table->name, $this->table->alias) = $this->generateNewTitle($this->table->catid, $this->table->alias, $this->table->name);
}
// [Interpretation 4396] insert all set values
// [Interpretation 4426] insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -782,7 +782,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
}
// [Interpretation 4408] update all uniqe fields
// [Interpretation 4438] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -791,13 +791,13 @@ class SermondistributorModelSermon extends JModelAdmin
}
}
// [Interpretation 4417] Reset the ID because we are making a copy
// [Interpretation 4447] Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4420] TODO: Deal with ordering?
// [Interpretation 4421] $this->table->ordering = 1;
// [Interpretation 4450] TODO: Deal with ordering?
// [Interpretation 4451] $this->table->ordering = 1;
// [Interpretation 4423] Check the row.
// [Interpretation 4453] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -810,7 +810,7 @@ class SermondistributorModelSermon extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4436] Store the row.
// [Interpretation 4466] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -818,14 +818,14 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
// [Interpretation 4444] Get the new item ID
// [Interpretation 4474] Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4447] Add the new ID to the array
// [Interpretation 4477] Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4451] Clean the cache
// [Interpretation 4481] Clean the cache
$this->cleanCache();
return $newIds;
@ -846,7 +846,7 @@ class SermondistributorModelSermon extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4065] Set some needed variables.
// [Interpretation 4095] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -861,12 +861,12 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
// [Interpretation 4087] make sure published only updates if user has the permission.
// [Interpretation 4117] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('sermon.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4100] remove move_copy from array
// [Interpretation 4130] remove move_copy from array
unset($values['move_copy']);
if (isset($values['category']) && (int) $values['category'] > 0 && !static::checkCategoryId($values['category']))
@ -875,7 +875,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
elseif (isset($values['category']) && (int) $values['category'] > 0)
{
// [Interpretation 4111] move the category value to correct field name
// [Interpretation 4141] move the category value to correct field name
$values['catid'] = $values['category'];
unset($values['category']);
}
@ -885,7 +885,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
// [Interpretation 4121] Parent exists so we proceed
// [Interpretation 4151] Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('sermon.edit', $contexts[$pk]))
@ -895,30 +895,30 @@ class SermondistributorModelSermon extends JModelAdmin
return false;
}
// [Interpretation 4138] Check that the row actually exists
// [Interpretation 4168] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4143] Fatal error
// [Interpretation 4173] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4150] Not fatal error
// [Interpretation 4180] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4156] insert all set values.
// [Interpretation 4186] insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4161] Do special action for access.
// [Interpretation 4191] Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -931,7 +931,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
// [Interpretation 4173] Check the row.
// [Interpretation 4203] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -944,7 +944,7 @@ class SermondistributorModelSermon extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4186] Store the row.
// [Interpretation 4216] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -953,7 +953,7 @@ class SermondistributorModelSermon extends JModelAdmin
}
}
// [Interpretation 4195] Clean the cache
// [Interpretation 4225] Clean the cache
$this->cleanCache();
return true;
@ -983,13 +983,13 @@ class SermondistributorModelSermon extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// [Interpretation 3377] Set the local_files string to JSON string.
// [Interpretation 3407] Set the local_files string to JSON string.
if (isset($data['local_files']))
{
$data['local_files'] = (string) json_encode($data['local_files']);
}
// [Interpretation 3377] Set the manual_files string to JSON string.
// [Interpretation 3407] Set the manual_files string to JSON string.
if (isset($data['manual_files']))
{
$data['manual_files'] = (string) json_encode($data['manual_files']);
@ -1003,7 +1003,7 @@ class SermondistributorModelSermon extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4477] Alter the name for save as copy
// [Interpretation 4507] Alter the name for save as copy
if ($input->get('task') == 'save2copy')
{
$origTable = clone $this->getTable();
@ -1026,7 +1026,7 @@ class SermondistributorModelSermon extends JModelAdmin
$data['published'] = 0;
}
// [Interpretation 4504] Automatic handling of alias for empty fields
// [Interpretation 4534] Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{
if ($data['alias'] == null)
@ -1057,10 +1057,10 @@ class SermondistributorModelSermon extends JModelAdmin
}
}
// [Interpretation 4543] Alter the uniqe field for save as copy
// [Interpretation 4573] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4546] Automatic handling of other uniqe fields
// [Interpretation 4576] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -1114,7 +1114,7 @@ class SermondistributorModelSermon extends JModelAdmin
protected function _generateNewTitle($alias, $title)
{
// [Interpretation 4577] Alter the title & alias
// [Interpretation 4607] Alter the title & alias
$table = $this->getTable();
while ($table->load(array('alias' => $alias)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php
@ -45,7 +45,7 @@ class SermondistributorModelSermondistributor extends JModelList
$viewGroups = array(
'main' => array('png.preacher.add', 'png.preachers', 'png.sermon.add', 'png.sermons', 'png.sermons.catid', 'png.series.add', 'png.series_list', 'png.statistics', 'png.help_documents')
);
// [Interpretation 10790] view access array
// [Interpretation 10820] view access array
$viewAccess = array(
'preacher.create' => 'preacher.create',
'preachers.access' => 'preacher.access',

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermons.php
@ -129,16 +129,16 @@ class SermondistributorModelSermons extends JModelList
*/
public function getItems()
{
// [Interpretation 10327] check in items
// [Interpretation 10357] check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -152,14 +152,14 @@ class SermondistributorModelSermons extends JModelList
}
}
// [Interpretation 10674] set selection value to a translatable value
// [Interpretation 10704] set selection value to a translatable value
if (SermondistributorHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{
// [Interpretation 10681] convert link_type
// [Interpretation 10711] convert link_type
$item->link_type = $this->selectionTranslation($item->link_type, 'link_type');
// [Interpretation 10681] convert source
// [Interpretation 10711] convert source
$item->source = $this->selectionTranslation($item->source, 'source');
}
}
@ -176,20 +176,20 @@ class SermondistributorModelSermons extends JModelList
*/
public function selectionTranslation($value,$name)
{
// [Interpretation 10707] Array of link_type language strings
// [Interpretation 10737] Array of link_type language strings
if ($name == 'link_type')
{
$link_typeArray = array(
1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED',
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT'
);
// [Interpretation 10738] Now check if value is found in this array
// [Interpretation 10768] Now check if value is found in this array
if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value]))
{
return $link_typeArray[$value];
}
}
// [Interpretation 10707] Array of source language strings
// [Interpretation 10737] Array of source language strings
if ($name == 'source')
{
$sourceArray = array(
@ -198,7 +198,7 @@ class SermondistributorModelSermons extends JModelList
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX',
3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL'
);
// [Interpretation 10738] Now check if value is found in this array
// [Interpretation 10768] Now check if value is found in this array
if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value]))
{
return $sourceArray[$value];
@ -214,29 +214,29 @@ class SermondistributorModelSermons extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 7194] Get the user object.
// [Interpretation 7224] Get the user object.
$user = JFactory::getUser();
// [Interpretation 7196] Create a new query object.
// [Interpretation 7226] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 7199] Select some fields
// [Interpretation 7229] Select some fields
$query->select('a.*');
$query->select($db->quoteName('c.title','category_title'));
// [Interpretation 7206] From the sermondistributor_item table
// [Interpretation 7236] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
// [Interpretation 7347] From the sermondistributor_preacher table.
// [Interpretation 7377] From the sermondistributor_preacher table.
$query->select($db->quoteName('g.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'g') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 7347] From the sermondistributor_series table.
// [Interpretation 7377] From the sermondistributor_series table.
$query->select($db->quoteName('h.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'h') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 7220] Filter by published state
// [Interpretation 7250] Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -247,21 +247,21 @@ class SermondistributorModelSermons extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 7232] Join over the asset groups.
// [Interpretation 7262] Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 7235] Filter by access level.
// [Interpretation 7265] Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 7240] Implement View Level Access
// [Interpretation 7270] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 7317] Filter by search.
// [Interpretation 7347] Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -276,28 +276,28 @@ class SermondistributorModelSermons extends JModelList
}
}
// [Interpretation 7501] Filter by preacher.
// [Interpretation 7531] Filter by preacher.
if ($preacher = $this->getState('filter.preacher'))
{
$query->where('a.preacher = ' . $db->quote($db->escape($preacher, true)));
}
// [Interpretation 7501] Filter by series.
// [Interpretation 7531] Filter by series.
if ($series = $this->getState('filter.series'))
{
$query->where('a.series = ' . $db->quote($db->escape($series, true)));
}
// [Interpretation 7510] Filter by Link_type.
// [Interpretation 7540] Filter by Link_type.
if ($link_type = $this->getState('filter.link_type'))
{
$query->where('a.link_type = ' . $db->quote($db->escape($link_type, true)));
}
// [Interpretation 7510] Filter by Source.
// [Interpretation 7540] Filter by Source.
if ($source = $this->getState('filter.source'))
{
$query->where('a.source = ' . $db->quote($db->escape($source, true)));
}
// [Interpretation 7254] Filter by a single or group of categories.
// [Interpretation 7284] Filter by a single or group of categories.
$baselevel = 1;
$categoryId = $this->getState('filter.category_id');
@ -319,7 +319,7 @@ class SermondistributorModelSermons extends JModelList
}
// [Interpretation 7276] Add the list ordering clause.
// [Interpretation 7306] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -337,44 +337,44 @@ class SermondistributorModelSermons extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6929] setup the query
// [Interpretation 6959] setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6932] Set a value to know this is exporting method.
// [Interpretation 6962] Set a value to know this is exporting method.
$_export = true;
// [Interpretation 6934] Get the user object.
// [Interpretation 6964] Get the user object.
$user = JFactory::getUser();
// [Interpretation 6936] Create a new query object.
// [Interpretation 6966] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6939] Select some fields
// [Interpretation 6969] Select some fields
$query->select('a.*');
// [Interpretation 6941] From the sermondistributor_sermon table
// [Interpretation 6971] From the sermondistributor_sermon table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6951] Implement View Level Access
// [Interpretation 6981] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6958] Order the results by ordering
// [Interpretation 6988] Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6960] Load the items
// [Interpretation 6990] Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -385,13 +385,13 @@ class SermondistributorModelSermons extends JModelList
continue;
}
// [Interpretation 10621] unset the values we don't want exported.
// [Interpretation 10651] unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10630] Add headers to items array.
// [Interpretation 10660] Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -410,13 +410,13 @@ class SermondistributorModelSermons extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6980] Get a db connection.
// [Interpretation 7010] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6982] get the columns
// [Interpretation 7012] get the columns
$columns = $db->getTableColumns("#__sermondistributor_sermon");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6986] remove the headers you don't import/export.
// [Interpretation 7016] remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -438,7 +438,7 @@ class SermondistributorModelSermons extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9945] Compile the store id.
// [Interpretation 9975] Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -466,15 +466,15 @@ class SermondistributorModelSermons extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 10343] Get set check in time
// [Interpretation 10373] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 10348] Get a db connection.
// [Interpretation 10378] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 10350] reset query
// [Interpretation 10380] reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_sermon'));
@ -482,24 +482,24 @@ class SermondistributorModelSermons extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 10358] Get Yesterdays date
// [Interpretation 10388] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 10360] reset query
// [Interpretation 10390] reset query
$query = $db->getQuery(true);
// [Interpretation 10362] Fields to update.
// [Interpretation 10392] Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 10367] Conditions for which records should be updated.
// [Interpretation 10397] Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 10372] Check table
// [Interpretation 10402] Check table
$query->update($db->quoteName('#__sermondistributor_sermon'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistic.php
@ -116,7 +116,7 @@ class SermondistributorModelStatistic extends JModelAdmin
* @since 1.6
*/
public function getForm($data = array(), $loadData = true)
{ // [Interpretation 9328] Get the form.
{ // [Interpretation 9358] Get the form.
$form = $this->loadForm('com_sermondistributor.statistic', 'statistic', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form))
@ -126,12 +126,12 @@ class SermondistributorModelStatistic extends JModelAdmin
$jinput = JFactory::getApplication()->input;
// [Interpretation 9413] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
// [Interpretation 9443] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first.
if ($jinput->get('a_id'))
{
$id = $jinput->get('a_id', 0, 'INT');
}
// [Interpretation 9418] The back end uses id so we use that the rest of the time and set it to 0 by default.
// [Interpretation 9448] The back end uses id so we use that the rest of the time and set it to 0 by default.
else
{
$id = $jinput->get('id', 0, 'INT');
@ -139,54 +139,54 @@ class SermondistributorModelStatistic extends JModelAdmin
$user = JFactory::getUser();
// [Interpretation 9424] Check for existing item.
// [Interpretation 9425] Modify the form based on Edit State access controls.
// [Interpretation 9454] Check for existing item.
// [Interpretation 9455] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('statistic.edit.state', 'com_sermondistributor.statistic.' . (int) $id))
|| ($id == 0 && !$user->authorise('statistic.edit.state', 'com_sermondistributor')))
{
// [Interpretation 9438] Disable fields for display.
// [Interpretation 9468] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true');
// [Interpretation 9441] Disable fields while saving.
// [Interpretation 9471] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset');
}
// [Interpretation 9446] If this is a new item insure the greated by is set.
// [Interpretation 9476] If this is a new item insure the greated by is set.
if (0 == $id)
{
// [Interpretation 9449] Set the created_by to this user
// [Interpretation 9479] Set the created_by to this user
$form->setValue('created_by', null, $user->id);
}
// [Interpretation 9452] Modify the form based on Edit Creaded By access controls.
// [Interpretation 9482] Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('statistic.edit.created_by', 'com_sermondistributor.statistic.' . (int) $id))
|| ($id == 0 && !$user->authorise('statistic.edit.created_by', 'com_sermondistributor')))
{
// [Interpretation 9464] Disable fields for display.
// [Interpretation 9494] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true');
// [Interpretation 9466] Disable fields for display.
// [Interpretation 9496] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true');
// [Interpretation 9468] Disable fields while saving.
// [Interpretation 9498] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset');
}
// [Interpretation 9471] Modify the form based on Edit Creaded Date access controls.
// [Interpretation 9501] Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('statistic.edit.created', 'com_sermondistributor.statistic.' . (int) $id))
|| ($id == 0 && !$user->authorise('statistic.edit.created', 'com_sermondistributor')))
{
// [Interpretation 9483] Disable fields for display.
// [Interpretation 9513] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true');
// [Interpretation 9485] Disable fields while saving.
// [Interpretation 9515] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset');
}
// [Interpretation 9518] Only load these values if no id is found
// [Interpretation 9548] Only load these values if no id is found
if (0 == $id)
{
// [Interpretation 9521] Set redirected field name
// [Interpretation 9551] Set redirected field name
$redirectedField = $jinput->get('ref', null, 'STRING');
// [Interpretation 9523] Set redirected field value
// [Interpretation 9553] Set redirected field value
$redirectedValue = $jinput->get('refid', 0, 'INT');
if (0 != $redirectedValue && $redirectedField)
{
// [Interpretation 9527] Now set the local-redirected field default value
// [Interpretation 9557] Now set the local-redirected field default value
$form->setValue($redirectedField, null, $redirectedValue);
}
}
@ -223,7 +223,7 @@ class SermondistributorModelStatistic extends JModelAdmin
}
$user = JFactory::getUser();
// [Interpretation 9649] The record has been set. Check the record permissions.
// [Interpretation 9679] The record has been set. Check the record permissions.
return $user->authorise('statistic.delete', 'com_sermondistributor.statistic.' . (int) $record->id);
}
return false;
@ -245,14 +245,14 @@ class SermondistributorModelStatistic extends JModelAdmin
if ($recordId)
{
// [Interpretation 9736] The record has been set. Check the record permissions.
// [Interpretation 9766] The record has been set. Check the record permissions.
$permission = $user->authorise('statistic.edit.state', 'com_sermondistributor.statistic.' . (int) $recordId);
if (!$permission && !is_null($permission))
{
return false;
}
}
// [Interpretation 9753] In the absense of better information, revert to the component permissions.
// [Interpretation 9783] In the absense of better information, revert to the component permissions.
return $user->authorise('statistic.edit.state', 'com_sermondistributor');
}
@ -267,7 +267,7 @@ class SermondistributorModelStatistic extends JModelAdmin
*/
protected function allowEdit($data = array(), $key = 'id')
{
// [Interpretation 9561] Check specific edit permission then general edit permission.
// [Interpretation 9591] Check specific edit permission then general edit permission.
$user = JFactory::getUser();
return $user->authorise('statistic.edit', 'com_sermondistributor.statistic.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('statistic.edit', 'com_sermondistributor');
@ -493,7 +493,7 @@ class SermondistributorModelStatistic extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4263] Set some needed variables.
// [Interpretation 4293] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -507,12 +507,12 @@ class SermondistributorModelStatistic extends JModelAdmin
return false;
}
// [Interpretation 4283] get list of uniqe fields
// [Interpretation 4313] get list of uniqe fields
$uniqeFields = $this->getUniqeFields();
// [Interpretation 4285] remove move_copy from array
// [Interpretation 4315] remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4288] make sure published is set
// [Interpretation 4318] make sure published is set
if (!isset($values['published']))
{
$values['published'] = 0;
@ -524,21 +524,21 @@ class SermondistributorModelStatistic extends JModelAdmin
$newIds = array();
// [Interpretation 4325] Parent exists so let's proceed
// [Interpretation 4355] Parent exists so let's proceed
while (!empty($pks))
{
// [Interpretation 4328] Pop the first ID off the stack
// [Interpretation 4358] Pop the first ID off the stack
$pk = array_shift($pks);
$this->table->reset();
// [Interpretation 4333] only allow copy if user may edit this item.
// [Interpretation 4363] only allow copy if user may edit this item.
if (!$this->user->authorise('statistic.edit', $contexts[$pk]))
{
// [Interpretation 4343] Not fatal error
// [Interpretation 4373] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -546,19 +546,19 @@ class SermondistributorModelStatistic extends JModelAdmin
}
// [Interpretation 4348] Check that the row actually exists
// [Interpretation 4378] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4353] Fatal error
// [Interpretation 4383] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4360] Not fatal error
// [Interpretation 4390] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
@ -566,7 +566,7 @@ class SermondistributorModelStatistic extends JModelAdmin
$this->table->filename = $this->generateUniqe('filename',$this->table->filename);
// [Interpretation 4396] insert all set values
// [Interpretation 4426] insert all set values
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
@ -578,7 +578,7 @@ class SermondistributorModelStatistic extends JModelAdmin
}
}
// [Interpretation 4408] update all uniqe fields
// [Interpretation 4438] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields))
{
foreach ($uniqeFields as $uniqeField)
@ -587,13 +587,13 @@ class SermondistributorModelStatistic extends JModelAdmin
}
}
// [Interpretation 4417] Reset the ID because we are making a copy
// [Interpretation 4447] Reset the ID because we are making a copy
$this->table->id = 0;
// [Interpretation 4420] TODO: Deal with ordering?
// [Interpretation 4421] $this->table->ordering = 1;
// [Interpretation 4450] TODO: Deal with ordering?
// [Interpretation 4451] $this->table->ordering = 1;
// [Interpretation 4423] Check the row.
// [Interpretation 4453] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -606,7 +606,7 @@ class SermondistributorModelStatistic extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4436] Store the row.
// [Interpretation 4466] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -614,14 +614,14 @@ class SermondistributorModelStatistic extends JModelAdmin
return false;
}
// [Interpretation 4444] Get the new item ID
// [Interpretation 4474] Get the new item ID
$newId = $this->table->get('id');
// [Interpretation 4447] Add the new ID to the array
// [Interpretation 4477] Add the new ID to the array
$newIds[$pk] = $newId;
}
// [Interpretation 4451] Clean the cache
// [Interpretation 4481] Clean the cache
$this->cleanCache();
return $newIds;
@ -642,7 +642,7 @@ class SermondistributorModelStatistic extends JModelAdmin
{
if (empty($this->batchSet))
{
// [Interpretation 4065] Set some needed variables.
// [Interpretation 4095] Set some needed variables.
$this->user = JFactory::getUser();
$this->table = $this->getTable();
$this->tableClassName = get_class($this->table);
@ -657,15 +657,15 @@ class SermondistributorModelStatistic extends JModelAdmin
return false;
}
// [Interpretation 4087] make sure published only updates if user has the permission.
// [Interpretation 4117] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('statistic.edit.state'))
{
unset($values['published']);
}
// [Interpretation 4100] remove move_copy from array
// [Interpretation 4130] remove move_copy from array
unset($values['move_copy']);
// [Interpretation 4121] Parent exists so we proceed
// [Interpretation 4151] Parent exists so we proceed
foreach ($pks as $pk)
{
if (!$this->user->authorise('statistic.edit', $contexts[$pk]))
@ -675,30 +675,30 @@ class SermondistributorModelStatistic extends JModelAdmin
return false;
}
// [Interpretation 4138] Check that the row actually exists
// [Interpretation 4168] Check that the row actually exists
if (!$this->table->load($pk))
{
if ($error = $this->table->getError())
{
// [Interpretation 4143] Fatal error
// [Interpretation 4173] Fatal error
$this->setError($error);
return false;
}
else
{
// [Interpretation 4150] Not fatal error
// [Interpretation 4180] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue;
}
}
// [Interpretation 4156] insert all set values.
// [Interpretation 4186] insert all set values.
if (SermondistributorHelper::checkArray($values))
{
foreach ($values as $key => $value)
{
// [Interpretation 4161] Do special action for access.
// [Interpretation 4191] Do special action for access.
if ('access' == $key && strlen($value) > 0)
{
$this->table->$key = $value;
@ -711,7 +711,7 @@ class SermondistributorModelStatistic extends JModelAdmin
}
// [Interpretation 4173] Check the row.
// [Interpretation 4203] Check the row.
if (!$this->table->check())
{
$this->setError($this->table->getError());
@ -724,7 +724,7 @@ class SermondistributorModelStatistic extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
}
// [Interpretation 4186] Store the row.
// [Interpretation 4216] Store the row.
if (!$this->table->store())
{
$this->setError($this->table->getError());
@ -733,7 +733,7 @@ class SermondistributorModelStatistic extends JModelAdmin
}
}
// [Interpretation 4195] Clean the cache
// [Interpretation 4225] Clean the cache
$this->cleanCache();
return true;
@ -771,10 +771,10 @@ class SermondistributorModelStatistic extends JModelAdmin
$data['params'] = (string) $params;
}
// [Interpretation 4543] Alter the uniqe field for save as copy
// [Interpretation 4573] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy')
{
// [Interpretation 4546] Automatic handling of other uniqe fields
// [Interpretation 4576] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields))
{
@ -827,7 +827,7 @@ class SermondistributorModelStatistic extends JModelAdmin
protected function _generateNewTitle($title)
{
// [Interpretation 4601] Alter the title
// [Interpretation 4631] Alter the title
$table = $this->getTable();
while ($table->load(array('title' => $title)))

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage statistics.php
@ -113,16 +113,16 @@ class SermondistributorModelStatistics extends JModelList
*/
public function getItems()
{
// [Interpretation 10327] check in items
// [Interpretation 10357] check in items
$this->checkInNow();
// load parent items
$items = parent::getItems();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -147,31 +147,31 @@ class SermondistributorModelStatistics extends JModelList
*/
protected function getListQuery()
{
// [Interpretation 7194] Get the user object.
// [Interpretation 7224] Get the user object.
$user = JFactory::getUser();
// [Interpretation 7196] Create a new query object.
// [Interpretation 7226] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 7199] Select some fields
// [Interpretation 7229] Select some fields
$query->select('a.*');
// [Interpretation 7206] From the sermondistributor_item table
// [Interpretation 7236] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
// [Interpretation 7347] From the sermondistributor_sermon table.
// [Interpretation 7377] From the sermondistributor_sermon table.
$query->select($db->quoteName('g.name','sermon_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_sermon', 'g') . ' ON (' . $db->quoteName('a.sermon') . ' = ' . $db->quoteName('g.id') . ')');
// [Interpretation 7347] From the sermondistributor_preacher table.
// [Interpretation 7377] From the sermondistributor_preacher table.
$query->select($db->quoteName('h.name','preacher_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'h') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('h.id') . ')');
// [Interpretation 7347] From the sermondistributor_series table.
// [Interpretation 7377] From the sermondistributor_series table.
$query->select($db->quoteName('i.name','series_name'));
$query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'i') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('i.id') . ')');
// [Interpretation 7220] Filter by published state
// [Interpretation 7250] Filter by published state
$published = $this->getState('filter.published');
if (is_numeric($published))
{
@ -182,21 +182,21 @@ class SermondistributorModelStatistics extends JModelList
$query->where('(a.published = 0 OR a.published = 1)');
}
// [Interpretation 7232] Join over the asset groups.
// [Interpretation 7262] Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [Interpretation 7235] Filter by access level.
// [Interpretation 7265] Filter by access level.
if ($access = $this->getState('filter.access'))
{
$query->where('a.access = ' . (int) $access);
}
// [Interpretation 7240] Implement View Level Access
// [Interpretation 7270] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 7317] Filter by search.
// [Interpretation 7347] Filter by search.
$search = $this->getState('filter.search');
if (!empty($search))
{
@ -211,23 +211,23 @@ class SermondistributorModelStatistics extends JModelList
}
}
// [Interpretation 7501] Filter by sermon.
// [Interpretation 7531] Filter by sermon.
if ($sermon = $this->getState('filter.sermon'))
{
$query->where('a.sermon = ' . $db->quote($db->escape($sermon, true)));
}
// [Interpretation 7501] Filter by preacher.
// [Interpretation 7531] Filter by preacher.
if ($preacher = $this->getState('filter.preacher'))
{
$query->where('a.preacher = ' . $db->quote($db->escape($preacher, true)));
}
// [Interpretation 7501] Filter by series.
// [Interpretation 7531] Filter by series.
if ($series = $this->getState('filter.series'))
{
$query->where('a.series = ' . $db->quote($db->escape($series, true)));
}
// [Interpretation 7276] Add the list ordering clause.
// [Interpretation 7306] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '')
@ -245,44 +245,44 @@ class SermondistributorModelStatistics extends JModelList
*/
public function getExportData($pks)
{
// [Interpretation 6929] setup the query
// [Interpretation 6959] setup the query
if (SermondistributorHelper::checkArray($pks))
{
// [Interpretation 6932] Set a value to know this is exporting method.
// [Interpretation 6962] Set a value to know this is exporting method.
$_export = true;
// [Interpretation 6934] Get the user object.
// [Interpretation 6964] Get the user object.
$user = JFactory::getUser();
// [Interpretation 6936] Create a new query object.
// [Interpretation 6966] Create a new query object.
$db = JFactory::getDBO();
$query = $db->getQuery(true);
// [Interpretation 6939] Select some fields
// [Interpretation 6969] Select some fields
$query->select('a.*');
// [Interpretation 6941] From the sermondistributor_statistic table
// [Interpretation 6971] From the sermondistributor_statistic table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')');
// [Interpretation 6951] Implement View Level Access
// [Interpretation 6981] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor'))
{
$groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')');
}
// [Interpretation 6958] Order the results by ordering
// [Interpretation 6988] Order the results by ordering
$query->order('a.ordering ASC');
// [Interpretation 6960] Load the items
// [Interpretation 6990] Load the items
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$items = $db->loadObjectList();
// [Interpretation 10402] set values to display correctly.
// [Interpretation 10432] set values to display correctly.
if (SermondistributorHelper::checkArray($items))
{
// [Interpretation 10405] get user object.
// [Interpretation 10435] get user object.
$user = JFactory::getUser();
foreach ($items as $nr => &$item)
{
@ -293,13 +293,13 @@ class SermondistributorModelStatistics extends JModelList
continue;
}
// [Interpretation 10621] unset the values we don't want exported.
// [Interpretation 10651] unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
unset($item->checked_out_time);
}
}
// [Interpretation 10630] Add headers to items array.
// [Interpretation 10660] Add headers to items array.
$headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers))
{
@ -318,13 +318,13 @@ class SermondistributorModelStatistics extends JModelList
*/
public function getExImPortHeaders()
{
// [Interpretation 6980] Get a db connection.
// [Interpretation 7010] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 6982] get the columns
// [Interpretation 7012] get the columns
$columns = $db->getTableColumns("#__sermondistributor_statistic");
if (SermondistributorHelper::checkArray($columns))
{
// [Interpretation 6986] remove the headers you don't import/export.
// [Interpretation 7016] remove the headers you don't import/export.
unset($columns['asset_id']);
unset($columns['checked_out']);
unset($columns['checked_out_time']);
@ -346,7 +346,7 @@ class SermondistributorModelStatistics extends JModelList
*/
protected function getStoreId($id = '')
{
// [Interpretation 9945] Compile the store id.
// [Interpretation 9975] Compile the store id.
$id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published');
@ -370,15 +370,15 @@ class SermondistributorModelStatistics extends JModelList
*/
protected function checkInNow()
{
// [Interpretation 10343] Get set check in time
// [Interpretation 10373] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time)
{
// [Interpretation 10348] Get a db connection.
// [Interpretation 10378] Get a db connection.
$db = JFactory::getDbo();
// [Interpretation 10350] reset query
// [Interpretation 10380] reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__sermondistributor_statistic'));
@ -386,24 +386,24 @@ class SermondistributorModelStatistics extends JModelList
$db->execute();
if ($db->getNumRows())
{
// [Interpretation 10358] Get Yesterdays date
// [Interpretation 10388] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// [Interpretation 10360] reset query
// [Interpretation 10390] reset query
$query = $db->getQuery(true);
// [Interpretation 10362] Fields to update.
// [Interpretation 10392] Fields to update.
$fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0'
);
// [Interpretation 10367] Conditions for which records should be updated.
// [Interpretation 10397] Conditions for which records should be updated.
$conditions = array(
$db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// [Interpretation 10372] Check table
// [Interpretation 10402] Check table
$query->update($db->quoteName('#__sermondistributor_statistic'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage sermondistributor.php
@ -29,7 +29,7 @@ defined('_JEXEC') or die('Restricted access');
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_sermondistributor'))
{
return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
return JError::raiseWaring(404, JText::_('JERROR_ALERTNOAUTHOR'));
};
// Load cms libraries

View File

@ -0,0 +1 @@

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage help_document.php
@ -53,7 +53,7 @@ class SermondistributorTableHelp_document extends JTable
{
parent::__construct('#__sermondistributor_help_document', 'id', $db);
// [Interpretation 3485] Adding History Options
// [Interpretation 3515] Adding History Options
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.help_document'));
}

View File

@ -10,8 +10,8 @@
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 24th June, 2016
@version 1.3.3
@build 2nd July, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage preacher.php
@ -53,7 +53,7 @@ class SermondistributorTablePreacher extends JTable
{
parent::__construct('#__sermondistributor_preacher', 'id', $db);
// [Interpretation 3485] Adding History Options
// [Interpretation 3515] Adding History Options
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.preacher'));
}

Some files were not shown because too many files have changed in this diff Show More