Updated the readme, all other changes are only random variable name and date changes (due to automation sorry)

This commit is contained in:
Llewellyn van der Merwe 2016-01-11 22:06:18 +02:00
parent 1f5cf994fa
commit 6bf8abb6e4
259 changed files with 2746 additions and 2744 deletions

View File

@ -6,6 +6,8 @@ Distributor is a highly advanced sermon distributor that runs on the [Joomla 3.x
The best way to see all your options is to install this component on you Joomla website and test all features yourself. Here is a [direct download link] (https://github.com/SermonDistributor/Joomla-3-Component/archive/master.zip) The best way to see all your options is to install this component on you Joomla website and test all features yourself. Here is a [direct download link] (https://github.com/SermonDistributor/Joomla-3-Component/archive/master.zip)
### If you like our component please rate it on the [Joomla Index] (http://extensions.joomla.org/extensions/extension/living/religion/sermon-distributor)
### Example Website, That Has Over 6000 Audio Files ### Example Website, That Has Over 6000 Audio Files
[LoudVoice.org] (http://www.loudvoice.org) [LoudVoice.org] (http://www.loudvoice.org)
@ -21,7 +23,7 @@ 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) + *Author*: [Llewellyn van der Merwe] (mailto:llewellyn@vdm.io)
+ *Name*: [Sermon Distributor] (https://www.vdm.io/) + *Name*: [Sermon Distributor] (https://www.vdm.io/)
+ *First Build*: 22nd October, 2015 + *First Build*: 22nd October, 2015
+ *Last Build*: 6th January, 2016 + *Last Build*: 11th January, 2016
+ *Version*: 1.3.0 + *Version*: 1.3.0
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -34,7 +36,7 @@ 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**, > (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.) > never making one mistake or taking any coffee break.)
+ *Line count*: **46550** + *Line count*: **46552**
+ *File count*: **349** + *File count*: **349**
+ *Folder count*: **79** + *Folder count*: **79**

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage admin.css @subpackage admin.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage dashboard.css @subpackage dashboard.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage help_document.css @subpackage help_document.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage help_documents.css @subpackage help_documents.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage preacher.css @subpackage preacher.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage preachers.css @subpackage preachers.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage series.css @subpackage series.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage series_list.css @subpackage series_list.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermon.css @subpackage sermon.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermons.css @subpackage sermons.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage statistic.css @subpackage statistic.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage statistics.css @subpackage statistics.css

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage controller.php @subpackage controller.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage ajax.json.php @subpackage ajax.json.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage help.php @subpackage help.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage help_document.php @subpackage help_document.php
@ -60,13 +60,13 @@ class SermondistributorControllerHelp_document extends JControllerForm
*/ */
protected function allowAdd($data = array()) protected function allowAdd($data = array())
{ {
// [9580] Access check. // [9618] Access check.
$access = JFactory::getUser()->authorise('help_document.access', 'com_sermondistributor'); $access = JFactory::getUser()->authorise('help_document.access', 'com_sermondistributor');
if (!$access) if (!$access)
{ {
return false; return false;
} }
// [9591] In the absense of better information, revert to the component permissions. // [9629] In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('help_document.create', $this->option); 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') protected function allowEdit($data = array(), $key = 'id')
{ {
// [9734] get user object. // [9772] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9736] get record id. // [9774] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9743] Access check. // [9781] Access check.
$access = ($user->authorise('help_document.access', 'com_sermondistributor.help_document.' . (int) $recordId) && $user->authorise('help_document.access', 'com_sermondistributor')); $access = ($user->authorise('help_document.access', 'com_sermondistributor.help_document.' . (int) $recordId) && $user->authorise('help_document.access', 'com_sermondistributor'));
if (!$access) if (!$access)
{ {
@ -97,17 +97,17 @@ class SermondistributorControllerHelp_document extends JControllerForm
if ($recordId) if ($recordId)
{ {
// [9752] The record has been set. Check the record permissions. // [9790] The record has been set. Check the record permissions.
$permission = $user->authorise('help_document.edit', 'com_sermondistributor.help_document.' . (int) $recordId); $permission = $user->authorise('help_document.edit', 'com_sermondistributor.help_document.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
if ($user->authorise('help_document.edit.own', 'com_sermondistributor.help_document.' . $recordId)) if ($user->authorise('help_document.edit.own', 'com_sermondistributor.help_document.' . $recordId))
{ {
// [9774] Now test the owner is the user. // [9812] Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId)) if (empty($ownerId))
{ {
// [9778] Need to do a lookup from the model. // [9816] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId); $record = $this->getModel()->getItem($recordId);
if (empty($record)) if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerHelp_document extends JControllerForm
$ownerId = $record->created_by; $ownerId = $record->created_by;
} }
// [9786] If the owner matches 'me' then allow. // [9824] If the owner matches 'me' then allow.
if ($ownerId == $user->id) if ($ownerId == $user->id)
{ {
if ($user->authorise('help_document.edit.own', 'com_sermondistributor')) if ($user->authorise('help_document.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerHelp_document extends JControllerForm
return false; return false;
} }
} }
// [9808] Since there is no permission, revert to the component permissions. // [9846] Since there is no permission, revert to the component permissions.
return $user->authorise('help_document.edit', $this->option); return $user->authorise('help_document.edit', $this->option);
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage help_documents.php @subpackage help_documents.php
@ -48,29 +48,29 @@ class SermondistributorControllerHelp_documents extends JControllerAdmin
public function exportData() public function exportData()
{ {
// [7530] Check for request forgeries // [7568] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7532] check if export is allowed for this user. // [7570] check if export is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('help_document.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor')) if ($user->authorise('help_document.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{ {
// [7536] Get the input // [7574] Get the input
$input = JFactory::getApplication()->input; $input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array'); $pks = $input->post->get('cid', array(), 'array');
// [7539] Sanitize the input // [7577] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7541] Get the model // [7579] Get the model
$model = $this->getModel('Help_documents'); $model = $this->getModel('Help_documents');
// [7543] get the data to export // [7581] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7547] now set the data to the spreadsheet // [7585] now set the data to the spreadsheet
$date = JFactory::getDate(); $date = JFactory::getDate();
SermondistributorHelper::xls($data,'Help_documents_'.$date->format('jS_F_Y'),'Help documents exported ('.$date->format('jS F, Y').')','help documents'); SermondistributorHelper::xls($data,'Help_documents_'.$date->format('jS_F_Y'),'Help documents exported ('.$date->format('jS F, Y').')','help documents');
} }
} }
// [7552] Redirect to the list screen with error. // [7590] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=help_documents', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=help_documents', false), $message, 'error');
return; return;
@ -79,31 +79,31 @@ class SermondistributorControllerHelp_documents extends JControllerAdmin
public function importData() public function importData()
{ {
// [7561] Check for request forgeries // [7599] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7563] check if import is allowed for this user. // [7601] check if import is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('help_document.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor')) if ($user->authorise('help_document.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{ {
// [7567] Get the import model // [7605] Get the import model
$model = $this->getModel('Help_documents'); $model = $this->getModel('Help_documents');
// [7569] get the headers to import // [7607] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7573] Load headers to session. // [7611] Load headers to session.
$session = JFactory::getSession(); $session = JFactory::getSession();
$headers = json_encode($headers); $headers = json_encode($headers);
$session->set('help_document_VDM_IMPORTHEADERS', $headers); $session->set('help_document_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'help_documents'); $session->set('backto_VDM_IMPORT', 'help_documents');
$session->set('dataType_VDM_IMPORTINTO', 'help_document'); $session->set('dataType_VDM_IMPORTINTO', 'help_document');
// [7579] Redirect to import view. // [7617] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_HELP_DOCUMENTS'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_HELP_DOCUMENTS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return; return;
} }
} }
// [7591] Redirect to the list screen with error. // [7629] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=help_documents', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=help_documents', false), $message, 'error');
return; return;

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage import.php @subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage preacher.php @subpackage preacher.php
@ -60,13 +60,13 @@ class SermondistributorControllerPreacher extends JControllerForm
*/ */
protected function allowAdd($data = array()) protected function allowAdd($data = array())
{ {
// [9580] Access check. // [9618] Access check.
$access = JFactory::getUser()->authorise('preacher.access', 'com_sermondistributor'); $access = JFactory::getUser()->authorise('preacher.access', 'com_sermondistributor');
if (!$access) if (!$access)
{ {
return false; return false;
} }
// [9591] In the absense of better information, revert to the component permissions. // [9629] In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('preacher.create', $this->option); return JFactory::getUser()->authorise('preacher.create', $this->option);
} }
@ -82,13 +82,13 @@ class SermondistributorControllerPreacher extends JControllerForm
*/ */
protected function allowEdit($data = array(), $key = 'id') protected function allowEdit($data = array(), $key = 'id')
{ {
// [9734] get user object. // [9772] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9736] get record id. // [9774] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9743] Access check. // [9781] Access check.
$access = ($user->authorise('preacher.access', 'com_sermondistributor.preacher.' . (int) $recordId) && $user->authorise('preacher.access', 'com_sermondistributor')); $access = ($user->authorise('preacher.access', 'com_sermondistributor.preacher.' . (int) $recordId) && $user->authorise('preacher.access', 'com_sermondistributor'));
if (!$access) if (!$access)
{ {
@ -97,17 +97,17 @@ class SermondistributorControllerPreacher extends JControllerForm
if ($recordId) if ($recordId)
{ {
// [9752] The record has been set. Check the record permissions. // [9790] The record has been set. Check the record permissions.
$permission = $user->authorise('preacher.edit', 'com_sermondistributor.preacher.' . (int) $recordId); $permission = $user->authorise('preacher.edit', 'com_sermondistributor.preacher.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
if ($user->authorise('preacher.edit.own', 'com_sermondistributor.preacher.' . $recordId)) if ($user->authorise('preacher.edit.own', 'com_sermondistributor.preacher.' . $recordId))
{ {
// [9774] Now test the owner is the user. // [9812] Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId)) if (empty($ownerId))
{ {
// [9778] Need to do a lookup from the model. // [9816] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId); $record = $this->getModel()->getItem($recordId);
if (empty($record)) if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerPreacher extends JControllerForm
$ownerId = $record->created_by; $ownerId = $record->created_by;
} }
// [9786] If the owner matches 'me' then allow. // [9824] If the owner matches 'me' then allow.
if ($ownerId == $user->id) if ($ownerId == $user->id)
{ {
if ($user->authorise('preacher.edit.own', 'com_sermondistributor')) if ($user->authorise('preacher.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerPreacher extends JControllerForm
return false; return false;
} }
} }
// [9808] Since there is no permission, revert to the component permissions. // [9846] Since there is no permission, revert to the component permissions.
return $user->authorise('preacher.edit', $this->option); return $user->authorise('preacher.edit', $this->option);
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage preachers.php @subpackage preachers.php
@ -48,29 +48,29 @@ class SermondistributorControllerPreachers extends JControllerAdmin
public function exportData() public function exportData()
{ {
// [7530] Check for request forgeries // [7568] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7532] check if export is allowed for this user. // [7570] check if export is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('preacher.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor')) if ($user->authorise('preacher.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{ {
// [7536] Get the input // [7574] Get the input
$input = JFactory::getApplication()->input; $input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array'); $pks = $input->post->get('cid', array(), 'array');
// [7539] Sanitize the input // [7577] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7541] Get the model // [7579] Get the model
$model = $this->getModel('Preachers'); $model = $this->getModel('Preachers');
// [7543] get the data to export // [7581] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7547] now set the data to the spreadsheet // [7585] now set the data to the spreadsheet
$date = JFactory::getDate(); $date = JFactory::getDate();
SermondistributorHelper::xls($data,'Preachers_'.$date->format('jS_F_Y'),'Preachers exported ('.$date->format('jS F, Y').')','preachers'); SermondistributorHelper::xls($data,'Preachers_'.$date->format('jS_F_Y'),'Preachers exported ('.$date->format('jS F, Y').')','preachers');
} }
} }
// [7552] Redirect to the list screen with error. // [7590] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=preachers', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=preachers', false), $message, 'error');
return; return;
@ -79,31 +79,31 @@ class SermondistributorControllerPreachers extends JControllerAdmin
public function importData() public function importData()
{ {
// [7561] Check for request forgeries // [7599] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7563] check if import is allowed for this user. // [7601] check if import is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('preacher.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor')) if ($user->authorise('preacher.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{ {
// [7567] Get the import model // [7605] Get the import model
$model = $this->getModel('Preachers'); $model = $this->getModel('Preachers');
// [7569] get the headers to import // [7607] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7573] Load headers to session. // [7611] Load headers to session.
$session = JFactory::getSession(); $session = JFactory::getSession();
$headers = json_encode($headers); $headers = json_encode($headers);
$session->set('preacher_VDM_IMPORTHEADERS', $headers); $session->set('preacher_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'preachers'); $session->set('backto_VDM_IMPORT', 'preachers');
$session->set('dataType_VDM_IMPORTINTO', 'preacher'); $session->set('dataType_VDM_IMPORTINTO', 'preacher');
// [7579] Redirect to import view. // [7617] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_PREACHERS'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_PREACHERS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return; return;
} }
} }
// [7591] Redirect to the list screen with error. // [7629] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=preachers', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=preachers', false), $message, 'error');
return; return;

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage series.php @subpackage series.php
@ -60,13 +60,13 @@ class SermondistributorControllerSeries extends JControllerForm
*/ */
protected function allowAdd($data = array()) protected function allowAdd($data = array())
{ {
// [9580] Access check. // [9618] Access check.
$access = JFactory::getUser()->authorise('series.access', 'com_sermondistributor'); $access = JFactory::getUser()->authorise('series.access', 'com_sermondistributor');
if (!$access) if (!$access)
{ {
return false; return false;
} }
// [9591] In the absense of better information, revert to the component permissions. // [9629] In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('series.create', $this->option); return JFactory::getUser()->authorise('series.create', $this->option);
} }
@ -82,13 +82,13 @@ class SermondistributorControllerSeries extends JControllerForm
*/ */
protected function allowEdit($data = array(), $key = 'id') protected function allowEdit($data = array(), $key = 'id')
{ {
// [9734] get user object. // [9772] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9736] get record id. // [9774] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9743] Access check. // [9781] Access check.
$access = ($user->authorise('series.access', 'com_sermondistributor.series.' . (int) $recordId) && $user->authorise('series.access', 'com_sermondistributor')); $access = ($user->authorise('series.access', 'com_sermondistributor.series.' . (int) $recordId) && $user->authorise('series.access', 'com_sermondistributor'));
if (!$access) if (!$access)
{ {
@ -97,17 +97,17 @@ class SermondistributorControllerSeries extends JControllerForm
if ($recordId) if ($recordId)
{ {
// [9752] The record has been set. Check the record permissions. // [9790] The record has been set. Check the record permissions.
$permission = $user->authorise('series.edit', 'com_sermondistributor.series.' . (int) $recordId); $permission = $user->authorise('series.edit', 'com_sermondistributor.series.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
if ($user->authorise('series.edit.own', 'com_sermondistributor.series.' . $recordId)) if ($user->authorise('series.edit.own', 'com_sermondistributor.series.' . $recordId))
{ {
// [9774] Now test the owner is the user. // [9812] Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId)) if (empty($ownerId))
{ {
// [9778] Need to do a lookup from the model. // [9816] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId); $record = $this->getModel()->getItem($recordId);
if (empty($record)) if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerSeries extends JControllerForm
$ownerId = $record->created_by; $ownerId = $record->created_by;
} }
// [9786] If the owner matches 'me' then allow. // [9824] If the owner matches 'me' then allow.
if ($ownerId == $user->id) if ($ownerId == $user->id)
{ {
if ($user->authorise('series.edit.own', 'com_sermondistributor')) if ($user->authorise('series.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerSeries extends JControllerForm
return false; return false;
} }
} }
// [9808] Since there is no permission, revert to the component permissions. // [9846] Since there is no permission, revert to the component permissions.
return $user->authorise('series.edit', $this->option); return $user->authorise('series.edit', $this->option);
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage series_list.php @subpackage series_list.php
@ -48,29 +48,29 @@ class SermondistributorControllerSeries_list extends JControllerAdmin
public function exportData() public function exportData()
{ {
// [7530] Check for request forgeries // [7568] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7532] check if export is allowed for this user. // [7570] check if export is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('series.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor')) if ($user->authorise('series.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{ {
// [7536] Get the input // [7574] Get the input
$input = JFactory::getApplication()->input; $input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array'); $pks = $input->post->get('cid', array(), 'array');
// [7539] Sanitize the input // [7577] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7541] Get the model // [7579] Get the model
$model = $this->getModel('Series_list'); $model = $this->getModel('Series_list');
// [7543] get the data to export // [7581] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7547] now set the data to the spreadsheet // [7585] now set the data to the spreadsheet
$date = JFactory::getDate(); $date = JFactory::getDate();
SermondistributorHelper::xls($data,'Series_list_'.$date->format('jS_F_Y'),'Series list exported ('.$date->format('jS F, Y').')','series list'); SermondistributorHelper::xls($data,'Series_list_'.$date->format('jS_F_Y'),'Series list exported ('.$date->format('jS F, Y').')','series list');
} }
} }
// [7552] Redirect to the list screen with error. // [7590] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=series_list', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=series_list', false), $message, 'error');
return; return;
@ -79,31 +79,31 @@ class SermondistributorControllerSeries_list extends JControllerAdmin
public function importData() public function importData()
{ {
// [7561] Check for request forgeries // [7599] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7563] check if import is allowed for this user. // [7601] check if import is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('series.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor')) if ($user->authorise('series.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{ {
// [7567] Get the import model // [7605] Get the import model
$model = $this->getModel('Series_list'); $model = $this->getModel('Series_list');
// [7569] get the headers to import // [7607] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7573] Load headers to session. // [7611] Load headers to session.
$session = JFactory::getSession(); $session = JFactory::getSession();
$headers = json_encode($headers); $headers = json_encode($headers);
$session->set('series_VDM_IMPORTHEADERS', $headers); $session->set('series_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'series_list'); $session->set('backto_VDM_IMPORT', 'series_list');
$session->set('dataType_VDM_IMPORTINTO', 'series'); $session->set('dataType_VDM_IMPORTINTO', 'series');
// [7579] Redirect to import view. // [7617] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_SERIES_LIST'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_SERIES_LIST');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return; return;
} }
} }
// [7591] Redirect to the list screen with error. // [7629] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=series_list', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=series_list', false), $message, 'error');
return; return;

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermon.php @subpackage sermon.php
@ -60,10 +60,10 @@ class SermondistributorControllerSermon extends JControllerForm
*/ */
protected function allowAdd($data = array()) protected function allowAdd($data = array())
{ {
// [9535] get the user object // [9573] get the user object
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9540] Access check. // [9578] Access check.
$access = $user->authorise('sermon.access', 'com_sermondistributor'); $access = $user->authorise('sermon.access', 'com_sermondistributor');
if (!$access) if (!$access)
{ {
@ -74,13 +74,13 @@ class SermondistributorControllerSermon extends JControllerForm
if ($categoryId) if ($categoryId)
{ {
// [9551] If the category has been passed in the URL check it. // [9589] If the category has been passed in the URL check it.
$allow = $user->authorise('core.create', $this->option . '.sermons.category.' . $categoryId); $allow = $user->authorise('core.create', $this->option . '.sermons.category.' . $categoryId);
} }
if ($allow === null) if ($allow === null)
{ {
// [9560] In the absense of better information, revert to the component permissions. // [9598] In the absense of better information, revert to the component permissions.
return $user->authorise('sermon.create', $this->option); return $user->authorise('sermon.create', $this->option);
} }
else else
@ -100,13 +100,13 @@ class SermondistributorControllerSermon extends JControllerForm
* @since 1.6 * @since 1.6
*/ */
protected function allowEdit($data = array(), $key = 'id') protected function allowEdit($data = array(), $key = 'id')
{ // [9638] get user object. { // [9676] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9640] get record id. // [9678] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9647] Access check. // [9685] Access check.
$access = ($user->authorise('sermon.access', 'com_sermondistributor.sermon.' . (int) $recordId) && $user->authorise('sermon.access', 'com_sermondistributor')); $access = ($user->authorise('sermon.access', 'com_sermondistributor.sermon.' . (int) $recordId) && $user->authorise('sermon.access', 'com_sermondistributor'));
if (!$access) if (!$access)
{ {
@ -115,17 +115,17 @@ class SermondistributorControllerSermon extends JControllerForm
if ($recordId) if ($recordId)
{ {
// [9656] The record has been set. Check the record permissions. // [9694] The record has been set. Check the record permissions.
$permission = $user->authorise('sermon.edit', 'com_sermondistributor.sermon.' . (int) $recordId); $permission = $user->authorise('sermon.edit', 'com_sermondistributor.sermon.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
if ($user->authorise('sermon.edit.own', 'com_sermondistributor.sermon.' . $recordId)) if ($user->authorise('sermon.edit.own', 'com_sermondistributor.sermon.' . $recordId))
{ {
// [9678] Fallback on edit.own. Now test the owner is the user. // [9716] Fallback on edit.own. Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId)) if (empty($ownerId))
{ {
// [9682] Need to do a lookup from the model. // [9720] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId); $record = $this->getModel()->getItem($recordId);
if (empty($record)) if (empty($record))
@ -135,7 +135,7 @@ class SermondistributorControllerSermon extends JControllerForm
$ownerId = $record->created_by; $ownerId = $record->created_by;
} }
// [9690] If the owner matches 'me' then do the test. // [9728] If the owner matches 'me' then do the test.
if ($ownerId == $user->id) if ($ownerId == $user->id)
{ {
if ($user->authorise('sermon.edit.own', 'com_sermondistributor')) if ($user->authorise('sermon.edit.own', 'com_sermondistributor'))
@ -151,7 +151,7 @@ class SermondistributorControllerSermon extends JControllerForm
if ($categoryId) if ($categoryId)
{ {
// [9712] The category has been set. Check the category permissions. // [9750] The category has been set. Check the category permissions.
$catpermission = $user->authorise('core.edit', $this->option . '.sermons.category.' . $categoryId); $catpermission = $user->authorise('core.edit', $this->option . '.sermons.category.' . $categoryId);
if (!$catpermission && !is_null($catpermission)) if (!$catpermission && !is_null($catpermission))
{ {
@ -159,7 +159,7 @@ class SermondistributorControllerSermon extends JControllerForm
} }
} }
} }
// [9722] Since there is no permission, revert to the component permissions. // [9760] Since there is no permission, revert to the component permissions.
return $user->authorise('sermon.edit', $this->option); return $user->authorise('sermon.edit', $this->option);
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermondistributor.php @subpackage sermondistributor.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermons.php @subpackage sermons.php
@ -48,29 +48,29 @@ class SermondistributorControllerSermons extends JControllerAdmin
public function exportData() public function exportData()
{ {
// [7530] Check for request forgeries // [7568] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7532] check if export is allowed for this user. // [7570] check if export is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('sermon.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor')) if ($user->authorise('sermon.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{ {
// [7536] Get the input // [7574] Get the input
$input = JFactory::getApplication()->input; $input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array'); $pks = $input->post->get('cid', array(), 'array');
// [7539] Sanitize the input // [7577] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7541] Get the model // [7579] Get the model
$model = $this->getModel('Sermons'); $model = $this->getModel('Sermons');
// [7543] get the data to export // [7581] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7547] now set the data to the spreadsheet // [7585] now set the data to the spreadsheet
$date = JFactory::getDate(); $date = JFactory::getDate();
SermondistributorHelper::xls($data,'Sermons_'.$date->format('jS_F_Y'),'Sermons exported ('.$date->format('jS F, Y').')','sermons'); SermondistributorHelper::xls($data,'Sermons_'.$date->format('jS_F_Y'),'Sermons exported ('.$date->format('jS F, Y').')','sermons');
} }
} }
// [7552] Redirect to the list screen with error. // [7590] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=sermons', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=sermons', false), $message, 'error');
return; return;
@ -79,31 +79,31 @@ class SermondistributorControllerSermons extends JControllerAdmin
public function importData() public function importData()
{ {
// [7561] Check for request forgeries // [7599] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7563] check if import is allowed for this user. // [7601] check if import is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('sermon.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor')) if ($user->authorise('sermon.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{ {
// [7567] Get the import model // [7605] Get the import model
$model = $this->getModel('Sermons'); $model = $this->getModel('Sermons');
// [7569] get the headers to import // [7607] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7573] Load headers to session. // [7611] Load headers to session.
$session = JFactory::getSession(); $session = JFactory::getSession();
$headers = json_encode($headers); $headers = json_encode($headers);
$session->set('sermon_VDM_IMPORTHEADERS', $headers); $session->set('sermon_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'sermons'); $session->set('backto_VDM_IMPORT', 'sermons');
$session->set('dataType_VDM_IMPORTINTO', 'sermon'); $session->set('dataType_VDM_IMPORTINTO', 'sermon');
// [7579] Redirect to import view. // [7617] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_SERMONS'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_SERMONS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return; return;
} }
} }
// [7591] Redirect to the list screen with error. // [7629] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=sermons', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=sermons', false), $message, 'error');
return; return;

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage statistic.php @subpackage statistic.php
@ -60,13 +60,13 @@ class SermondistributorControllerStatistic extends JControllerForm
*/ */
protected function allowAdd($data = array()) protected function allowAdd($data = array())
{ {
// [9580] Access check. // [9618] Access check.
$access = JFactory::getUser()->authorise('statistic.access', 'com_sermondistributor'); $access = JFactory::getUser()->authorise('statistic.access', 'com_sermondistributor');
if (!$access) if (!$access)
{ {
return false; return false;
} }
// [9591] In the absense of better information, revert to the component permissions. // [9629] In the absense of better information, revert to the component permissions.
return JFactory::getUser()->authorise('statistic.create', $this->option); return JFactory::getUser()->authorise('statistic.create', $this->option);
} }
@ -82,13 +82,13 @@ class SermondistributorControllerStatistic extends JControllerForm
*/ */
protected function allowEdit($data = array(), $key = 'id') protected function allowEdit($data = array(), $key = 'id')
{ {
// [9734] get user object. // [9772] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9736] get record id. // [9774] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9743] Access check. // [9781] Access check.
$access = ($user->authorise('statistic.access', 'com_sermondistributor.statistic.' . (int) $recordId) && $user->authorise('statistic.access', 'com_sermondistributor')); $access = ($user->authorise('statistic.access', 'com_sermondistributor.statistic.' . (int) $recordId) && $user->authorise('statistic.access', 'com_sermondistributor'));
if (!$access) if (!$access)
{ {
@ -97,17 +97,17 @@ class SermondistributorControllerStatistic extends JControllerForm
if ($recordId) if ($recordId)
{ {
// [9752] The record has been set. Check the record permissions. // [9790] The record has been set. Check the record permissions.
$permission = $user->authorise('statistic.edit', 'com_sermondistributor.statistic.' . (int) $recordId); $permission = $user->authorise('statistic.edit', 'com_sermondistributor.statistic.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
if ($user->authorise('statistic.edit.own', 'com_sermondistributor.statistic.' . $recordId)) if ($user->authorise('statistic.edit.own', 'com_sermondistributor.statistic.' . $recordId))
{ {
// [9774] Now test the owner is the user. // [9812] Now test the owner is the user.
$ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0;
if (empty($ownerId)) if (empty($ownerId))
{ {
// [9778] Need to do a lookup from the model. // [9816] Need to do a lookup from the model.
$record = $this->getModel()->getItem($recordId); $record = $this->getModel()->getItem($recordId);
if (empty($record)) if (empty($record))
@ -117,7 +117,7 @@ class SermondistributorControllerStatistic extends JControllerForm
$ownerId = $record->created_by; $ownerId = $record->created_by;
} }
// [9786] If the owner matches 'me' then allow. // [9824] If the owner matches 'me' then allow.
if ($ownerId == $user->id) if ($ownerId == $user->id)
{ {
if ($user->authorise('statistic.edit.own', 'com_sermondistributor')) if ($user->authorise('statistic.edit.own', 'com_sermondistributor'))
@ -129,7 +129,7 @@ class SermondistributorControllerStatistic extends JControllerForm
return false; return false;
} }
} }
// [9808] Since there is no permission, revert to the component permissions. // [9846] Since there is no permission, revert to the component permissions.
return $user->authorise('statistic.edit', $this->option); return $user->authorise('statistic.edit', $this->option);
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage statistics.php @subpackage statistics.php
@ -48,29 +48,29 @@ class SermondistributorControllerStatistics extends JControllerAdmin
public function exportData() public function exportData()
{ {
// [7530] Check for request forgeries // [7568] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7532] check if export is allowed for this user. // [7570] check if export is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('statistic.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor')) if ($user->authorise('statistic.export', 'com_sermondistributor') && $user->authorise('core.export', 'com_sermondistributor'))
{ {
// [7536] Get the input // [7574] Get the input
$input = JFactory::getApplication()->input; $input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array'); $pks = $input->post->get('cid', array(), 'array');
// [7539] Sanitize the input // [7577] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7541] Get the model // [7579] Get the model
$model = $this->getModel('Statistics'); $model = $this->getModel('Statistics');
// [7543] get the data to export // [7581] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7547] now set the data to the spreadsheet // [7585] now set the data to the spreadsheet
$date = JFactory::getDate(); $date = JFactory::getDate();
SermondistributorHelper::xls($data,'Statistics_'.$date->format('jS_F_Y'),'Statistics exported ('.$date->format('jS F, Y').')','statistics'); SermondistributorHelper::xls($data,'Statistics_'.$date->format('jS_F_Y'),'Statistics exported ('.$date->format('jS F, Y').')','statistics');
} }
} }
// [7552] Redirect to the list screen with error. // [7590] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_EXPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=statistics', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=statistics', false), $message, 'error');
return; return;
@ -79,31 +79,31 @@ class SermondistributorControllerStatistics extends JControllerAdmin
public function importData() public function importData()
{ {
// [7561] Check for request forgeries // [7599] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7563] check if import is allowed for this user. // [7601] check if import is allowed for this user.
$user = JFactory::getUser(); $user = JFactory::getUser();
if ($user->authorise('statistic.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor')) if ($user->authorise('statistic.import', 'com_sermondistributor') && $user->authorise('core.import', 'com_sermondistributor'))
{ {
// [7567] Get the import model // [7605] Get the import model
$model = $this->getModel('Statistics'); $model = $this->getModel('Statistics');
// [7569] get the headers to import // [7607] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7573] Load headers to session. // [7611] Load headers to session.
$session = JFactory::getSession(); $session = JFactory::getSession();
$headers = json_encode($headers); $headers = json_encode($headers);
$session->set('statistic_VDM_IMPORTHEADERS', $headers); $session->set('statistic_VDM_IMPORTHEADERS', $headers);
$session->set('backto_VDM_IMPORT', 'statistics'); $session->set('backto_VDM_IMPORT', 'statistics');
$session->set('dataType_VDM_IMPORTINTO', 'statistic'); $session->set('dataType_VDM_IMPORTINTO', 'statistic');
// [7579] Redirect to import view. // [7617] Redirect to import view.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_STATISTICS'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_SELECT_FILE_FOR_STATISTICS');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=import', false), $message);
return; return;
} }
} }
// [7591] Redirect to the list screen with error. // [7629] Redirect to the list screen with error.
$message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED'); $message = JText::_('COM_SERMONDISTRIBUTOR_IMPORT_FAILED');
$this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=statistics', false), $message, 'error'); $this->setRedirect(JRoute::_('index.php?option=com_sermondistributor&view=statistics', false), $message, 'error');
return; return;

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage batch_.php @subpackage batch_.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermondistributor.php @subpackage sermondistributor.php
@ -553,23 +553,23 @@ abstract class SermondistributorHelper
$targetgroups = json_decode($help->groups, true); $targetgroups = json_decode($help->groups, true);
if (!array_intersect($targetgroups, $groups)) if (!array_intersect($targetgroups, $groups))
{ {
// [1487] if user not in those target groups then remove the item // [1497] if user not in those target groups then remove the item
unset($helps[$nr]); unset($helps[$nr]);
continue; continue;
} }
} }
// [1492] set the return type // [1502] set the return type
switch ($help->type) switch ($help->type)
{ {
// [1495] set joomla article // [1505] set joomla article
case 1: case 1:
return self::loadArticleLink($help->article); return self::loadArticleLink($help->article);
break; break;
// [1499] set help text // [1509] set help text
case 2: case 2:
return self::loadHelpTextLink($help->id); return self::loadHelpTextLink($help->id);
break; break;
// [1503] set Link // [1513] set Link
case 3: case 3:
return $help->url; return $help->url;
break; break;
@ -698,7 +698,7 @@ abstract class SermondistributorHelper
{ {
if (strpos($content,'class="uk-') !== false) if (strpos($content,'class="uk-') !== false)
{ {
// [2731] reset // [2741] reset
$temp = array(); $temp = array();
foreach (self::$uk_components as $looking => $add) foreach (self::$uk_components as $looking => $add)
{ {
@ -707,15 +707,15 @@ abstract class SermondistributorHelper
$temp[] = $looking; $temp[] = $looking;
} }
} }
// [2740] make sure uikit is loaded to config // [2750] make sure uikit is loaded to config
if (strpos($content,'class="uk-') !== false) if (strpos($content,'class="uk-') !== false)
{ {
self::$uikit = true; self::$uikit = true;
} }
// [2745] sorter // [2755] sorter
if (self::checkArray($temp)) if (self::checkArray($temp))
{ {
// [2748] merger // [2758] merger
if (self::checkArray($classes)) if (self::checkArray($classes))
{ {
$newTemp = array_merge($temp,$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) public static function xls($rows,$fileName = null,$title = null,$subjectTab = null,$creator = 'Vast Development Method',$description = null,$category = null,$keywords = null,$modified = null)
{ {
// [1542] set the user // [1552] set the user
$user = JFactory::getUser(); $user = JFactory::getUser();
// [1545] set fieldname if not set // [1555] set fieldname if not set
if (!$fileName) if (!$fileName)
{ {
$fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y'); $fileName = 'exported_'.JFactory::getDate()->format('jS_F_Y');
} }
// [1550] set modiefied if not set // [1560] set modiefied if not set
if (!$modified) if (!$modified)
{ {
$modified = $user->name; $modified = $user->name;
} }
// [1555] set title if not set // [1565] set title if not set
if (!$title) if (!$title)
{ {
$title = 'Book1'; $title = 'Book1';
} }
// [1560] set tab name if not set // [1570] set tab name if not set
if (!$subjectTab) if (!$subjectTab)
{ {
$subjectTab = 'Sheet1'; $subjectTab = 'Sheet1';
} }
// [1566] make sure the file is loaded // [1576] make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// [1569] Create new PHPExcel object // [1579] Create new PHPExcel object
$objPHPExcel = new PHPExcel(); $objPHPExcel = new PHPExcel();
// [1572] Set document properties // [1582] Set document properties
$objPHPExcel->getProperties()->setCreator($creator) $objPHPExcel->getProperties()->setCreator($creator)
->setCompany('Vast Development Method') ->setCompany('Vast Development Method')
->setLastModifiedBy($modified) ->setLastModifiedBy($modified)
@ -785,7 +785,7 @@ abstract class SermondistributorHelper
$objPHPExcel->getProperties()->setCategory($category); $objPHPExcel->getProperties()->setCategory($category);
} }
// [1591] Some styles // [1601] Some styles
$headerStyles = array( $headerStyles = array(
'font' => array( 'font' => array(
'bold' => true, 'bold' => true,
@ -807,7 +807,7 @@ abstract class SermondistributorHelper
'name' => 'Verdana' 'name' => 'Verdana'
)); ));
// [1613] Add some data // [1623] Add some data
if (self::checkArray($rows)) if (self::checkArray($rows))
{ {
$i = 1; $i = 1;
@ -834,20 +834,20 @@ abstract class SermondistributorHelper
return false; return false;
} }
// [1640] Rename worksheet // [1650] Rename worksheet
$objPHPExcel->getActiveSheet()->setTitle($subjectTab); $objPHPExcel->getActiveSheet()->setTitle($subjectTab);
// [1643] Set active sheet index to the first sheet, so Excel opens this as the first sheet // [1653] Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->setActiveSheetIndex(0);
// [1646] Redirect output to a client's web browser (Excel5) // [1656] Redirect output to a client's web browser (Excel5)
header('Content-Type: application/vnd.ms-excel'); header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$fileName.'.xls"'); header('Content-Disposition: attachment;filename="'.$fileName.'.xls"');
header('Cache-Control: max-age=0'); header('Cache-Control: max-age=0');
// [1650] If you're serving to IE 9, then the following may be needed // [1660] If you're serving to IE 9, then the following may be needed
header('Cache-Control: max-age=1'); header('Cache-Control: max-age=1');
// [1653] If you're serving to IE over SSL, then the following may be needed // [1663] 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 ('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 ('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); // always modified
header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
@ -863,13 +863,13 @@ abstract class SermondistributorHelper
*/ */
public static function getFileHeaders($dataType) public static function getFileHeaders($dataType)
{ {
// [1669] make sure the file is loaded // [1679] make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// [1671] get session object // [1681] get session object
$session = JFactory::getSession(); $session = JFactory::getSession();
$package = $session->get('package', null); $package = $session->get('package', null);
$package = json_decode($package, true); $package = json_decode($package, true);
// [1675] set the headers // [1685] set the headers
if(isset($package['dir'])) if(isset($package['dir']))
{ {
$inputFileType = PHPExcel_IOFactory::identify($package['dir']); $inputFileType = PHPExcel_IOFactory::identify($package['dir']);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage batchselection.php @subpackage batchselection.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_above.php @subpackage details_above.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_fullwidth.php @subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_left.php @subpackage details_left.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_right.php @subpackage details_right.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_under.php @subpackage details_under.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage metadata.php @subpackage metadata.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage publishing.php @subpackage publishing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_above.php @subpackage details_above.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_fullwidth.php @subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_left.php @subpackage details_left.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_right.php @subpackage details_right.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage metadata.php @subpackage metadata.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage publishing.php @subpackage publishing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermons_fullwidth.php @subpackage sermons_fullwidth.php
@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// set the defaults // set the defaults
$items = $displayData->fyusermons; $items = $displayData->bzfsermons;
$user = JFactory::getUser(); $user = JFactory::getUser();
$id = $displayData->item->id; $id = $displayData->item->id;
$edit = "index.php?option=com_sermondistributor&view=sermons&task=sermon.edit"; $edit = "index.php?option=com_sermondistributor&view=sermons&task=sermon.edit";

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_above.php @subpackage details_above.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_fullwidth.php @subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_left.php @subpackage details_left.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_right.php @subpackage details_right.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage metadata.php @subpackage metadata.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage publishing.php @subpackage publishing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermons_fullwidth.php @subpackage sermons_fullwidth.php
@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// set the defaults // set the defaults
$items = $displayData->etssermons; $items = $displayData->bxtsermons;
$user = JFactory::getUser(); $user = JFactory::getUser();
$id = $displayData->item->id; $id = $displayData->item->id;
$edit = "index.php?option=com_sermondistributor&view=sermons&task=sermon.edit"; $edit = "index.php?option=com_sermondistributor&view=sermons&task=sermon.edit";

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_above.php @subpackage details_above.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_fullwidth.php @subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_left.php @subpackage details_left.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_right.php @subpackage details_right.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_under.php @subpackage details_under.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage files_fullwidth.php @subpackage files_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage metadata.php @subpackage metadata.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage publishing.php @subpackage publishing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage stastics_fullwidth.php @subpackage stastics_fullwidth.php
@ -28,7 +28,7 @@
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// set the defaults // set the defaults
$items = $displayData->uqbstastics; $items = $displayData->uhxstastics;
$user = JFactory::getUser(); $user = JFactory::getUser();
$id = $displayData->item->id; $id = $displayData->item->id;
$edit = "index.php?option=com_sermondistributor&view=statistics&task=statistic.edit"; $edit = "index.php?option=com_sermondistributor&view=statistics&task=statistic.edit";

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_above.php @subpackage details_above.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_left.php @subpackage details_left.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage details_right.php @subpackage details_right.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage metadata.php @subpackage metadata.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage publishing.php @subpackage publishing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage ajax.php @subpackage ajax.php
@ -43,7 +43,7 @@ class SermondistributorModelAjax extends JModelList
} }
// [9177] Used in sermon // [9215] Used in sermon
/** /**
* Check and Set Dropbox local listing * Check and Set Dropbox local listing
**/ **/

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage articles.php @subpackage articles.php
@ -50,36 +50,36 @@ class JFormFieldArticles extends JFormFieldList
*/ */
protected function getInput() protected function getInput()
{ {
// [7952] see if we should add buttons // [7990] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7954] get html // [7992] get html
$html = parent::getInput(); $html = parent::getInput();
// [7956] if true set button // [7994] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7960] only add if user allowed to create article // [7998] only add if user allowed to create article
if ($user->authorise('core.create', 'com_sermondistributor')) if ($user->authorise('core.create', 'com_sermondistributor'))
{ {
// [7978] get the input from url // [8016] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7980] get the view name & id // [8018] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7985] check if new item // [8023] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7989] only load referal if not new item. // [8027] only load referal if not new item.
$ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; $ref = '&ref=' . $values['view'] . '&refid=' . $values['id'];
} }
// [7992] build the button // [8030] build the button
$button = '<a class="btn btn-small btn-success" $button = '<a class="btn btn-small btn-success"
href="index.php?option=com_sermondistributor&amp;view=article&amp;layout=edit'.$ref.'" > href="index.php?option=com_sermondistributor&amp;view=article&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>'; <span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [7996] return the button attached to input field // [8034] return the button attached to input field
return $html . $button; return $html . $button;
} }
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage dropboxfiles.php @subpackage dropboxfiles.php
@ -50,36 +50,36 @@ class JFormFieldDropboxfiles extends JFormFieldList
*/ */
protected function getInput() protected function getInput()
{ {
// [7952] see if we should add buttons // [7990] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7954] get html // [7992] get html
$html = parent::getInput(); $html = parent::getInput();
// [7956] if true set button // [7994] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7960] only add if user allowed to create // [7998] only add if user allowed to create
if ($user->authorise('core.create', 'com_sermondistributor')) if ($user->authorise('core.create', 'com_sermondistributor'))
{ {
// [7978] get the input from url // [8016] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7980] get the view name & id // [8018] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7985] check if new item // [8023] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7989] only load referal if not new item. // [8027] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
} }
// [7992] build the button // [8030] build the button
$button = '<a class="btn btn-small btn-success" $button = '<a class="btn btn-small btn-success"
href="index.php?option=com_sermondistributor&amp;view=&amp;layout=edit'.$ref.'" > href="index.php?option=com_sermondistributor&amp;view=&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>'; <span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [7996] return the button attached to input field // [8034] return the button attached to input field
return $html . $button; return $html . $button;
} }
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage localfiles.php @subpackage localfiles.php
@ -50,36 +50,36 @@ class JFormFieldLocalfiles extends JFormFieldList
*/ */
protected function getInput() protected function getInput()
{ {
// [7952] see if we should add buttons // [7990] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7954] get html // [7992] get html
$html = parent::getInput(); $html = parent::getInput();
// [7956] if true set button // [7994] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7960] only add if user allowed to create // [7998] only add if user allowed to create
if ($user->authorise('core.create', 'com_sermondistributor')) if ($user->authorise('core.create', 'com_sermondistributor'))
{ {
// [7978] get the input from url // [8016] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7980] get the view name & id // [8018] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7985] check if new item // [8023] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7989] only load referal if not new item. // [8027] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
} }
// [7992] build the button // [8030] build the button
$button = '<a class="btn btn-small btn-success" $button = '<a class="btn btn-small btn-success"
href="index.php?option=com_sermondistributor&amp;view=&amp;layout=edit'.$ref.'" > href="index.php?option=com_sermondistributor&amp;view=&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>'; <span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [7996] return the button attached to input field // [8034] return the button attached to input field
return $html . $button; return $html . $button;
} }
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage preachers.php @subpackage preachers.php
@ -50,36 +50,36 @@ class JFormFieldPreachers extends JFormFieldList
*/ */
protected function getInput() protected function getInput()
{ {
// [7952] see if we should add buttons // [7990] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7954] get html // [7992] get html
$html = parent::getInput(); $html = parent::getInput();
// [7956] if true set button // [7994] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7960] only add if user allowed to create preacher // [7998] only add if user allowed to create preacher
if ($user->authorise('preacher.create', 'com_sermondistributor')) if ($user->authorise('preacher.create', 'com_sermondistributor'))
{ {
// [7978] get the input from url // [8016] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7980] get the view name & id // [8018] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7985] check if new item // [8023] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7989] only load referal if not new item. // [8027] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
} }
// [7992] build the button // [8030] build the button
$button = '<a class="btn btn-small btn-success" $button = '<a class="btn btn-small btn-success"
href="index.php?option=com_sermondistributor&amp;view=preacher&amp;layout=edit'.$ref.'" > href="index.php?option=com_sermondistributor&amp;view=preacher&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>'; <span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [7996] return the button attached to input field // [8034] return the button attached to input field
return $html . $button; return $html . $button;
} }
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage series.php @subpackage series.php
@ -50,36 +50,36 @@ class JFormFieldSeries extends JFormFieldList
*/ */
protected function getInput() protected function getInput()
{ {
// [7952] see if we should add buttons // [7990] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7954] get html // [7992] get html
$html = parent::getInput(); $html = parent::getInput();
// [7956] if true set button // [7994] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7960] only add if user allowed to create series // [7998] only add if user allowed to create series
if ($user->authorise('series.create', 'com_sermondistributor')) if ($user->authorise('series.create', 'com_sermondistributor'))
{ {
// [7978] get the input from url // [8016] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7980] get the view name & id // [8018] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7985] check if new item // [8023] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7989] only load referal if not new item. // [8027] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
} }
// [7992] build the button // [8030] build the button
$button = '<a class="btn btn-small btn-success" $button = '<a class="btn btn-small btn-success"
href="index.php?option=com_sermondistributor&amp;view=series&amp;layout=edit'.$ref.'" > href="index.php?option=com_sermondistributor&amp;view=series&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>'; <span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [7996] return the button attached to input field // [8034] return the button attached to input field
return $html . $button; return $html . $button;
} }
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermon.php @subpackage sermon.php
@ -50,36 +50,36 @@ class JFormFieldSermon extends JFormFieldList
*/ */
protected function getInput() protected function getInput()
{ {
// [7952] see if we should add buttons // [7990] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7954] get html // [7992] get html
$html = parent::getInput(); $html = parent::getInput();
// [7956] if true set button // [7994] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7960] only add if user allowed to create sermon // [7998] only add if user allowed to create sermon
if ($user->authorise('sermon.create', 'com_sermondistributor')) if ($user->authorise('sermon.create', 'com_sermondistributor'))
{ {
// [7978] get the input from url // [8016] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7980] get the view name & id // [8018] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7985] check if new item // [8023] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7989] only load referal if not new item. // [8027] only load referal if not new item.
$ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id']; $ref = '&amp;ref=' . $values['view'] . '&amp;refid=' . $values['id'];
} }
// [7992] build the button // [8030] build the button
$button = '<a class="btn btn-small btn-success" $button = '<a class="btn btn-small btn-success"
href="index.php?option=com_sermondistributor&amp;view=sermon&amp;layout=edit'.$ref.'" > href="index.php?option=com_sermondistributor&amp;view=sermon&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>'; <span class="icon-new icon-white"></span>' . JText::_('COM_SERMONDISTRIBUTOR_NEW') . '</a>';
// [7996] return the button attached to input field // [8034] return the button attached to input field
return $html . $button; return $html . $button;
} }
} }

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage help_document.js @subpackage help_document.js
@ -23,38 +23,38 @@
/-----------------------------------------------------------------------------------------------------------------------------*/ /-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values // Some Global Values
jform_AfASZHxduZ_required = false; jform_tEOArjdilp_required = false;
jform_MNpsVGIzeT_required = false; jform_risVnXlByL_required = false;
jform_tmgJZVUxWG_required = false; jform_FQgiSipwQJ_required = false;
jform_sDQSpOzUUb_required = false; jform_OlgATsKWIb_required = false;
// Initial Script // Initial Script
jQuery(document).ready(function() jQuery(document).ready(function()
{ {
var location_LsqSkrj = jQuery("#jform_location input[type='radio']:checked").val(); var location_qusgtuA = jQuery("#jform_location input[type='radio']:checked").val();
LsqSkrj(location_LsqSkrj); qusgtuA(location_qusgtuA);
var location_IKmEbKP = jQuery("#jform_location input[type='radio']:checked").val(); var location_acgwGxu = jQuery("#jform_location input[type='radio']:checked").val();
IKmEbKP(location_IKmEbKP); acgwGxu(location_acgwGxu);
var type_AfASZHx = jQuery("#jform_type").val(); var type_tEOArjd = jQuery("#jform_type").val();
AfASZHx(type_AfASZHx); tEOArjd(type_tEOArjd);
var type_MNpsVGI = jQuery("#jform_type").val(); var type_risVnXl = jQuery("#jform_type").val();
MNpsVGI(type_MNpsVGI); risVnXl(type_risVnXl);
var type_tmgJZVU = jQuery("#jform_type").val(); var type_FQgiSip = jQuery("#jform_type").val();
tmgJZVU(type_tmgJZVU); FQgiSip(type_FQgiSip);
var target_sDQSpOz = jQuery("#jform_target input[type='radio']:checked").val(); var target_OlgATsK = jQuery("#jform_target input[type='radio']:checked").val();
sDQSpOz(target_sDQSpOz); OlgATsK(target_OlgATsK);
}); });
// the LsqSkrj function // the qusgtuA function
function LsqSkrj(location_LsqSkrj) function qusgtuA(location_qusgtuA)
{ {
// [8269] set the function logic // [8307] set the function logic
if (location_LsqSkrj == 1) if (location_qusgtuA == 1)
{ {
jQuery('#jform_admin_view').closest('.control-group').show(); jQuery('#jform_admin_view').closest('.control-group').show();
} }
@ -64,11 +64,11 @@ function LsqSkrj(location_LsqSkrj)
} }
} }
// the IKmEbKP function // the acgwGxu function
function IKmEbKP(location_IKmEbKP) function acgwGxu(location_acgwGxu)
{ {
// [8269] set the function logic // [8307] set the function logic
if (location_IKmEbKP == 2) if (location_acgwGxu == 2)
{ {
jQuery('#jform_site_view').closest('.control-group').show(); jQuery('#jform_site_view').closest('.control-group').show();
} }
@ -78,198 +78,198 @@ function IKmEbKP(location_IKmEbKP)
} }
} }
// the AfASZHx function // the tEOArjd function
function AfASZHx(type_AfASZHx) function tEOArjd(type_tEOArjd)
{ {
if (isSet(type_AfASZHx) && type_AfASZHx.constructor !== Array) if (isSet(type_tEOArjd) && type_tEOArjd.constructor !== Array)
{ {
var temp_AfASZHx = type_AfASZHx; var temp_tEOArjd = type_tEOArjd;
var type_AfASZHx = []; var type_tEOArjd = [];
type_AfASZHx.push(temp_AfASZHx); type_tEOArjd.push(temp_tEOArjd);
} }
else if (!isSet(type_AfASZHx)) else if (!isSet(type_tEOArjd))
{ {
var type_AfASZHx = []; var type_tEOArjd = [];
} }
var type = type_AfASZHx.some(type_AfASZHx_SomeFunc); var type = type_tEOArjd.some(type_tEOArjd_SomeFunc);
// [8247] set this function logic // [8285] set this function logic
if (type) if (type)
{ {
jQuery('#jform_url').closest('.control-group').show(); jQuery('#jform_url').closest('.control-group').show();
if (jform_AfASZHxduZ_required) if (jform_tEOArjdilp_required)
{ {
updateFieldRequired('url',0); updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required'); jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true); jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('required'); jQuery('#jform_url').addClass('required');
jform_AfASZHxduZ_required = false; jform_tEOArjdilp_required = false;
} }
} }
else else
{ {
jQuery('#jform_url').closest('.control-group').hide(); jQuery('#jform_url').closest('.control-group').hide();
if (!jform_AfASZHxduZ_required) if (!jform_tEOArjdilp_required)
{ {
updateFieldRequired('url',1); updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required'); jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required'); jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('required'); jQuery('#jform_url').removeClass('required');
jform_AfASZHxduZ_required = true; jform_tEOArjdilp_required = true;
} }
} }
} }
// the AfASZHx Some function // the tEOArjd Some function
function type_AfASZHx_SomeFunc(type_AfASZHx) function type_tEOArjd_SomeFunc(type_tEOArjd)
{ {
// [8234] set the function logic // [8272] set the function logic
if (type_AfASZHx == 3) if (type_tEOArjd == 3)
{ {
return true; return true;
} }
return false; return false;
} }
// the MNpsVGI function // the risVnXl function
function MNpsVGI(type_MNpsVGI) function risVnXl(type_risVnXl)
{ {
if (isSet(type_MNpsVGI) && type_MNpsVGI.constructor !== Array) if (isSet(type_risVnXl) && type_risVnXl.constructor !== Array)
{ {
var temp_MNpsVGI = type_MNpsVGI; var temp_risVnXl = type_risVnXl;
var type_MNpsVGI = []; var type_risVnXl = [];
type_MNpsVGI.push(temp_MNpsVGI); type_risVnXl.push(temp_risVnXl);
} }
else if (!isSet(type_MNpsVGI)) else if (!isSet(type_risVnXl))
{ {
var type_MNpsVGI = []; var type_risVnXl = [];
} }
var type = type_MNpsVGI.some(type_MNpsVGI_SomeFunc); var type = type_risVnXl.some(type_risVnXl_SomeFunc);
// [8247] set this function logic // [8285] set this function logic
if (type) if (type)
{ {
jQuery('#jform_article').closest('.control-group').show(); jQuery('#jform_article').closest('.control-group').show();
if (jform_MNpsVGIzeT_required) if (jform_risVnXlByL_required)
{ {
updateFieldRequired('article',0); updateFieldRequired('article',0);
jQuery('#jform_article').prop('required','required'); jQuery('#jform_article').prop('required','required');
jQuery('#jform_article').attr('aria-required',true); jQuery('#jform_article').attr('aria-required',true);
jQuery('#jform_article').addClass('required'); jQuery('#jform_article').addClass('required');
jform_MNpsVGIzeT_required = false; jform_risVnXlByL_required = false;
} }
} }
else else
{ {
jQuery('#jform_article').closest('.control-group').hide(); jQuery('#jform_article').closest('.control-group').hide();
if (!jform_MNpsVGIzeT_required) if (!jform_risVnXlByL_required)
{ {
updateFieldRequired('article',1); updateFieldRequired('article',1);
jQuery('#jform_article').removeAttr('required'); jQuery('#jform_article').removeAttr('required');
jQuery('#jform_article').removeAttr('aria-required'); jQuery('#jform_article').removeAttr('aria-required');
jQuery('#jform_article').removeClass('required'); jQuery('#jform_article').removeClass('required');
jform_MNpsVGIzeT_required = true; jform_risVnXlByL_required = true;
} }
} }
} }
// the MNpsVGI Some function // the risVnXl Some function
function type_MNpsVGI_SomeFunc(type_MNpsVGI) function type_risVnXl_SomeFunc(type_risVnXl)
{ {
// [8234] set the function logic // [8272] set the function logic
if (type_MNpsVGI == 1) if (type_risVnXl == 1)
{ {
return true; return true;
} }
return false; return false;
} }
// the tmgJZVU function // the FQgiSip function
function tmgJZVU(type_tmgJZVU) function FQgiSip(type_FQgiSip)
{ {
if (isSet(type_tmgJZVU) && type_tmgJZVU.constructor !== Array) if (isSet(type_FQgiSip) && type_FQgiSip.constructor !== Array)
{ {
var temp_tmgJZVU = type_tmgJZVU; var temp_FQgiSip = type_FQgiSip;
var type_tmgJZVU = []; var type_FQgiSip = [];
type_tmgJZVU.push(temp_tmgJZVU); type_FQgiSip.push(temp_FQgiSip);
} }
else if (!isSet(type_tmgJZVU)) else if (!isSet(type_FQgiSip))
{ {
var type_tmgJZVU = []; var type_FQgiSip = [];
} }
var type = type_tmgJZVU.some(type_tmgJZVU_SomeFunc); var type = type_FQgiSip.some(type_FQgiSip_SomeFunc);
// [8247] set this function logic // [8285] set this function logic
if (type) if (type)
{ {
jQuery('#jform_content-lbl').closest('.control-group').show(); jQuery('#jform_content-lbl').closest('.control-group').show();
if (jform_tmgJZVUxWG_required) if (jform_FQgiSipwQJ_required)
{ {
updateFieldRequired('content',0); updateFieldRequired('content',0);
jQuery('#jform_content').prop('required','required'); jQuery('#jform_content').prop('required','required');
jQuery('#jform_content').attr('aria-required',true); jQuery('#jform_content').attr('aria-required',true);
jQuery('#jform_content').addClass('required'); jQuery('#jform_content').addClass('required');
jform_tmgJZVUxWG_required = false; jform_FQgiSipwQJ_required = false;
} }
} }
else else
{ {
jQuery('#jform_content-lbl').closest('.control-group').hide(); jQuery('#jform_content-lbl').closest('.control-group').hide();
if (!jform_tmgJZVUxWG_required) if (!jform_FQgiSipwQJ_required)
{ {
updateFieldRequired('content',1); updateFieldRequired('content',1);
jQuery('#jform_content').removeAttr('required'); jQuery('#jform_content').removeAttr('required');
jQuery('#jform_content').removeAttr('aria-required'); jQuery('#jform_content').removeAttr('aria-required');
jQuery('#jform_content').removeClass('required'); jQuery('#jform_content').removeClass('required');
jform_tmgJZVUxWG_required = true; jform_FQgiSipwQJ_required = true;
} }
} }
} }
// the tmgJZVU Some function // the FQgiSip Some function
function type_tmgJZVU_SomeFunc(type_tmgJZVU) function type_FQgiSip_SomeFunc(type_FQgiSip)
{ {
// [8234] set the function logic // [8272] set the function logic
if (type_tmgJZVU == 2) if (type_FQgiSip == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the sDQSpOz function // the OlgATsK function
function sDQSpOz(target_sDQSpOz) function OlgATsK(target_OlgATsK)
{ {
// [8269] set the function logic // [8307] set the function logic
if (target_sDQSpOz == 1) if (target_OlgATsK == 1)
{ {
jQuery('#jform_groups').closest('.control-group').show(); jQuery('#jform_groups').closest('.control-group').show();
if (jform_sDQSpOzUUb_required) if (jform_OlgATsKWIb_required)
{ {
updateFieldRequired('groups',0); updateFieldRequired('groups',0);
jQuery('#jform_groups').prop('required','required'); jQuery('#jform_groups').prop('required','required');
jQuery('#jform_groups').attr('aria-required',true); jQuery('#jform_groups').attr('aria-required',true);
jQuery('#jform_groups').addClass('required'); jQuery('#jform_groups').addClass('required');
jform_sDQSpOzUUb_required = false; jform_OlgATsKWIb_required = false;
} }
} }
else else
{ {
jQuery('#jform_groups').closest('.control-group').hide(); jQuery('#jform_groups').closest('.control-group').hide();
if (!jform_sDQSpOzUUb_required) if (!jform_OlgATsKWIb_required)
{ {
updateFieldRequired('groups',1); updateFieldRequired('groups',1);
jQuery('#jform_groups').removeAttr('required'); jQuery('#jform_groups').removeAttr('required');
jQuery('#jform_groups').removeAttr('aria-required'); jQuery('#jform_groups').removeAttr('aria-required');
jQuery('#jform_groups').removeClass('required'); jQuery('#jform_groups').removeClass('required');
jform_sDQSpOzUUb_required = true; jform_OlgATsKWIb_required = true;
} }
} }
} }

View File

@ -4,15 +4,15 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields" addfieldpath="/administrator/components/com_sermondistributor/models/fields"
> >
<fieldset name="details"> <fieldset name="details">
<!-- [11284] Default Fields. --> <!-- [11322] Default Fields. -->
<!-- [11285] Id Field. Type: Text (joomla) --> <!-- [11323] Id Field. Type: Text (joomla) -->
<field <field
name="id" name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL" type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0" description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true" readonly="true"
/> />
<!-- [11292] Date Created Field. Type: Calendar (joomla) --> <!-- [11330] Date Created Field. Type: Calendar (joomla) -->
<field <field
name="created" name="created"
type="calendar" type="calendar"
@ -22,14 +22,14 @@
format="%Y-%m-%d %H:%M:%S" format="%Y-%m-%d %H:%M:%S"
filter="user_utc" filter="user_utc"
/> />
<!-- [11303] User Created Field. Type: User (joomla) --> <!-- [11341] User Created Field. Type: User (joomla) -->
<field <field
name="created_by" name="created_by"
type="user" type="user"
label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_LABEL" label="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_DESC" description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_CREATED_BY_DESC"
/> />
<!-- [11311] Published Field. Type: List (joomla) --> <!-- [11349] Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS" <field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state" description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" > filter="intval" size="1" default="1" >
@ -42,18 +42,18 @@
<option value="-2"> <option value="-2">
JTRASHED</option> JTRASHED</option>
</field> </field>
<!-- [11326] Date Modified Field. Type: Calendar (joomla) --> <!-- [11364] Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly" <field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC" label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" /> size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [11330] User Modified Field. Type: User (joomla) --> <!-- [11368] User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user" <field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
class="readonly" class="readonly"
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11340] Access Field. Type: Accesslevel (joomla) --> <!-- [11378] Access Field. Type: Accesslevel (joomla) -->
<field name="access" <field name="access"
type="accesslevel" type="accesslevel"
label="JFIELD_ACCESS_LABEL" label="JFIELD_ACCESS_LABEL"
@ -61,7 +61,7 @@
default="1" default="1"
required="false" required="false"
/> />
<!-- [11350] Ordering Field. Type: Numbers (joomla) --> <!-- [11388] Ordering Field. Type: Numbers (joomla) -->
<field <field
name="ordering" name="ordering"
type="number" type="number"
@ -72,7 +72,7 @@
size="6" size="6"
required="false" required="false"
/> />
<!-- [11362] Version Field. Type: Text (joomla) --> <!-- [11400] Version Field. Type: Text (joomla) -->
<field <field
name="version" name="version"
type="text" type="text"
@ -83,7 +83,7 @@
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11376] Metakey Field. Type: Textarea (joomla) --> <!-- [11414] Metakey Field. Type: Textarea (joomla) -->
<field <field
name="metakey" name="metakey"
type="textarea" type="textarea"
@ -92,7 +92,7 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11385] Metadesc Field. Type: Textarea (joomla) --> <!-- [11423] Metadesc Field. Type: Textarea (joomla) -->
<field <field
name="metadesc" name="metadesc"
type="textarea" type="textarea"
@ -101,8 +101,8 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11395] Dynamic Fields. --> <!-- [11433] Dynamic Fields. -->
<!-- [11631] Title Field. Type: Text. (joomla) --> <!-- [11669] Title Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="title" name="title"
@ -118,7 +118,7 @@
message="Error! Please add title here." message="Error! Please add title here."
hint="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TITLE_HINT" hint="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TITLE_HINT"
/> />
<!-- [11545] Type Field. Type: List. (joomla) --> <!-- [11583] Type Field. Type: List. (joomla) -->
<field <field
type="list" type="list"
name="type" name="type"
@ -127,7 +127,7 @@
class="list_class" class="list_class"
multiple="false" multiple="false"
required="true"> required="true">
<!-- [11617] Option Set. --> <!-- [11655] Option Set. -->
<option value=""> <option value="">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SELECT_AN_OPTION</option> COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SELECT_AN_OPTION</option>
<option value="1"> <option value="1">
@ -137,7 +137,7 @@
<option value="3"> <option value="3">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL</option> COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL</option>
</field> </field>
<!-- [11631] Groups Field. Type: Usergroup. (joomla) --> <!-- [11669] Groups Field. Type: Usergroup. (joomla) -->
<field <field
type="usergroup" type="usergroup"
name="groups" name="groups"
@ -146,7 +146,7 @@
required="true" required="true"
multiple="true" multiple="true"
/> />
<!-- [11545] Location Field. Type: Radio. (joomla) --> <!-- [11583] Location Field. Type: Radio. (joomla) -->
<field <field
type="radio" type="radio"
name="location" name="location"
@ -154,13 +154,13 @@
description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_LOCATION_DESCRIPTION" description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_LOCATION_DESCRIPTION"
class="btn-group" class="btn-group"
required="true"> required="true">
<!-- [11617] Option Set. --> <!-- [11655] Option Set. -->
<option value="1"> <option value="1">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN</option> COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN</option>
<option value="2"> <option value="2">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SITE</option> COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SITE</option>
</field> </field>
<!-- [11631] Admin_view Field. Type: Folderlist. (joomla) --> <!-- [11669] Admin_view Field. Type: Folderlist. (joomla) -->
<field <field
type="folderlist" type="folderlist"
name="admin_view" name="admin_view"
@ -170,7 +170,7 @@
hide_none="true" hide_none="true"
hide_default="true" hide_default="true"
/> />
<!-- [11631] Site_view Field. Type: Folderlist. (joomla) --> <!-- [11669] Site_view Field. Type: Folderlist. (joomla) -->
<field <field
type="folderlist" type="folderlist"
name="site_view" name="site_view"
@ -180,7 +180,7 @@
hide_none="true" hide_none="true"
hide_default="true" hide_default="true"
/> />
<!-- [11545] Target Field. Type: Radio. (joomla) --> <!-- [11583] Target Field. Type: Radio. (joomla) -->
<field <field
type="radio" type="radio"
name="target" name="target"
@ -188,13 +188,13 @@
description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TARGET_DESCRIPTION" description="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TARGET_DESCRIPTION"
class="btn-group" class="btn-group"
required="true"> required="true">
<!-- [11617] Option Set. --> <!-- [11655] Option Set. -->
<option value="1"> <option value="1">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SOME</option> COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SOME</option>
<option value="2"> <option value="2">
COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALL</option> COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALL</option>
</field> </field>
<!-- [11631] Content Field. Type: Editor. (joomla) --> <!-- [11669] Content Field. Type: Editor. (joomla) -->
<field <field
type="editor" type="editor"
name="content" name="content"
@ -205,7 +205,7 @@
filter="safehtml" filter="safehtml"
required="true" required="true"
/> />
<!-- [11631] Alias Field. Type: Text. (joomla) --> <!-- [11669] Alias Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="alias" name="alias"
@ -214,7 +214,7 @@
filter="STRING" filter="STRING"
hint="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALIAS_HINT" hint="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ALIAS_HINT"
/> />
<!-- [11752] Article Field. Type: Articles. (custom) --> <!-- [11790] Article Field. Type: Articles. (custom) -->
<field <field
type="articles" type="articles"
name="article" name="article"
@ -224,7 +224,7 @@
default="0" default="0"
required="true" required="true"
/> />
<!-- [11631] Url Field. Type: Url. (joomla) --> <!-- [11669] Url Field. Type: Url. (joomla) -->
<field <field
type="url" type="url"
name="url" name="url"
@ -239,7 +239,7 @@
message="Error! Please add url here." message="Error! Please add url here."
hint="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_HINT" hint="COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL_HINT"
/> />
<!-- [11631] Not_required Field. Type: Hidden. (joomla) --> <!-- [11669] Not_required Field. Type: Hidden. (joomla) -->
<field <field
type="hidden" type="hidden"
name="not_required" name="not_required"
@ -247,11 +247,11 @@
/> />
</fieldset> </fieldset>
<!-- [11414] Metadata Fields. --> <!-- [11452] Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> <fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata" <fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [11418] Robots Field. Type: List (joomla) --> <!-- [11456] Robots Field. Type: List (joomla) -->
<field name="robots" <field name="robots"
type="list" type="list"
label="JFIELD_METADATA_ROBOTS_LABEL" label="JFIELD_METADATA_ROBOTS_LABEL"
@ -262,13 +262,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option> <option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option> <option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field> </field>
<!-- [11429] Author Field. Type: Text (joomla) --> <!-- [11467] Author Field. Type: Text (joomla) -->
<field name="author" <field name="author"
type="text" type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC" label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20" size="20"
/> />
<!-- [11435] Rights Field. Type: Textarea (joomla) --> <!-- [11473] Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL" <field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string" description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2" cols="30" rows="2"
@ -276,15 +276,15 @@
</fieldset> </fieldset>
</fields> </fields>
<!-- [10317] Access Control Fields. --> <!-- [10355] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10319] Asset Id Field. Type: Hidden (joomla) --> <!-- [10357] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10325] Rules Field. Type: Rules (joomla) --> <!-- [10363] Rules Field. Type: Rules (joomla) -->
<field <field
name="rules" name="rules"
type="rules" type="rules"

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage preacher.js @subpackage preacher.js

View File

@ -4,15 +4,15 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields" addfieldpath="/administrator/components/com_sermondistributor/models/fields"
> >
<fieldset name="details"> <fieldset name="details">
<!-- [11284] Default Fields. --> <!-- [11322] Default Fields. -->
<!-- [11285] Id Field. Type: Text (joomla) --> <!-- [11323] Id Field. Type: Text (joomla) -->
<field <field
name="id" name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL" type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0" description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true" readonly="true"
/> />
<!-- [11292] Date Created Field. Type: Calendar (joomla) --> <!-- [11330] Date Created Field. Type: Calendar (joomla) -->
<field <field
name="created" name="created"
type="calendar" type="calendar"
@ -22,14 +22,14 @@
format="%Y-%m-%d %H:%M:%S" format="%Y-%m-%d %H:%M:%S"
filter="user_utc" filter="user_utc"
/> />
<!-- [11303] User Created Field. Type: User (joomla) --> <!-- [11341] User Created Field. Type: User (joomla) -->
<field <field
name="created_by" name="created_by"
type="user" type="user"
label="COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_LABEL" label="COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_DESC" description="COM_SERMONDISTRIBUTOR_PREACHER_CREATED_BY_DESC"
/> />
<!-- [11311] Published Field. Type: List (joomla) --> <!-- [11349] Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS" <field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state" description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" > filter="intval" size="1" default="1" >
@ -42,18 +42,18 @@
<option value="-2"> <option value="-2">
JTRASHED</option> JTRASHED</option>
</field> </field>
<!-- [11326] Date Modified Field. Type: Calendar (joomla) --> <!-- [11364] Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly" <field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC" label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" /> size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [11330] User Modified Field. Type: User (joomla) --> <!-- [11368] User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user" <field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
class="readonly" class="readonly"
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11340] Access Field. Type: Accesslevel (joomla) --> <!-- [11378] Access Field. Type: Accesslevel (joomla) -->
<field name="access" <field name="access"
type="accesslevel" type="accesslevel"
label="JFIELD_ACCESS_LABEL" label="JFIELD_ACCESS_LABEL"
@ -61,7 +61,7 @@
default="1" default="1"
required="false" required="false"
/> />
<!-- [11350] Ordering Field. Type: Numbers (joomla) --> <!-- [11388] Ordering Field. Type: Numbers (joomla) -->
<field <field
name="ordering" name="ordering"
type="number" type="number"
@ -72,7 +72,7 @@
size="6" size="6"
required="false" required="false"
/> />
<!-- [11362] Version Field. Type: Text (joomla) --> <!-- [11400] Version Field. Type: Text (joomla) -->
<field <field
name="version" name="version"
type="text" type="text"
@ -83,7 +83,7 @@
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11376] Metakey Field. Type: Textarea (joomla) --> <!-- [11414] Metakey Field. Type: Textarea (joomla) -->
<field <field
name="metakey" name="metakey"
type="textarea" type="textarea"
@ -92,7 +92,7 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11385] Metadesc Field. Type: Textarea (joomla) --> <!-- [11423] Metadesc Field. Type: Textarea (joomla) -->
<field <field
name="metadesc" name="metadesc"
type="textarea" type="textarea"
@ -101,8 +101,8 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11395] Dynamic Fields. --> <!-- [11433] Dynamic Fields. -->
<!-- [11631] Name Field. Type: Text. (joomla) --> <!-- [11669] Name Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="name" name="name"
@ -118,7 +118,7 @@
message="Error! Please add name here." message="Error! Please add name here."
hint="COM_SERMONDISTRIBUTOR_PREACHER_NAME_HINT" hint="COM_SERMONDISTRIBUTOR_PREACHER_NAME_HINT"
/> />
<!-- [11631] Description Field. Type: Editor. (joomla) --> <!-- [11669] Description Field. Type: Editor. (joomla) -->
<field <field
type="editor" type="editor"
name="description" name="description"
@ -130,7 +130,7 @@
buttons="false" buttons="false"
filter="safehtml" filter="safehtml"
/> />
<!-- [11631] Alias Field. Type: Text. (joomla) --> <!-- [11669] Alias Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="alias" name="alias"
@ -139,7 +139,7 @@
filter="STRING" filter="STRING"
hint="COM_SERMONDISTRIBUTOR_PREACHER_ALIAS_HINT" hint="COM_SERMONDISTRIBUTOR_PREACHER_ALIAS_HINT"
/> />
<!-- [11631] Email Field. Type: Text. (joomla) --> <!-- [11669] Email Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="email" name="email"
@ -154,7 +154,7 @@
message="Error! Please add email address here." message="Error! Please add email address here."
hint="COM_SERMONDISTRIBUTOR_PREACHER_EMAIL_HINT" hint="COM_SERMONDISTRIBUTOR_PREACHER_EMAIL_HINT"
/> />
<!-- [11631] Website Field. Type: Url. (joomla) --> <!-- [11669] Website Field. Type: Url. (joomla) -->
<field <field
type="url" type="url"
name="website" name="website"
@ -168,7 +168,7 @@
message="Error! Please add website here." message="Error! Please add website here."
hint="COM_SERMONDISTRIBUTOR_PREACHER_WEBSITE_HINT" hint="COM_SERMONDISTRIBUTOR_PREACHER_WEBSITE_HINT"
/> />
<!-- [11631] Icon Field. Type: Media. (joomla) --> <!-- [11669] Icon Field. Type: Media. (joomla) -->
<field <field
type="media" type="media"
name="icon" name="icon"
@ -178,11 +178,11 @@
/> />
</fieldset> </fieldset>
<!-- [11414] Metadata Fields. --> <!-- [11452] Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> <fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata" <fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [11418] Robots Field. Type: List (joomla) --> <!-- [11456] Robots Field. Type: List (joomla) -->
<field name="robots" <field name="robots"
type="list" type="list"
label="JFIELD_METADATA_ROBOTS_LABEL" label="JFIELD_METADATA_ROBOTS_LABEL"
@ -193,13 +193,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option> <option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option> <option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field> </field>
<!-- [11429] Author Field. Type: Text (joomla) --> <!-- [11467] Author Field. Type: Text (joomla) -->
<field name="author" <field name="author"
type="text" type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC" label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20" size="20"
/> />
<!-- [11435] Rights Field. Type: Textarea (joomla) --> <!-- [11473] Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL" <field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string" description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2" cols="30" rows="2"
@ -207,15 +207,15 @@
</fieldset> </fieldset>
</fields> </fields>
<!-- [10317] Access Control Fields. --> <!-- [10355] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10319] Asset Id Field. Type: Hidden (joomla) --> <!-- [10357] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10325] Rules Field. Type: Rules (joomla) --> <!-- [10363] Rules Field. Type: Rules (joomla) -->
<field <field
name="rules" name="rules"
type="rules" type="rules"

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage series.js @subpackage series.js

View File

@ -4,15 +4,15 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields" addfieldpath="/administrator/components/com_sermondistributor/models/fields"
> >
<fieldset name="details"> <fieldset name="details">
<!-- [11284] Default Fields. --> <!-- [11322] Default Fields. -->
<!-- [11285] Id Field. Type: Text (joomla) --> <!-- [11323] Id Field. Type: Text (joomla) -->
<field <field
name="id" name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL" type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0" description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true" readonly="true"
/> />
<!-- [11292] Date Created Field. Type: Calendar (joomla) --> <!-- [11330] Date Created Field. Type: Calendar (joomla) -->
<field <field
name="created" name="created"
type="calendar" type="calendar"
@ -22,14 +22,14 @@
format="%Y-%m-%d %H:%M:%S" format="%Y-%m-%d %H:%M:%S"
filter="user_utc" filter="user_utc"
/> />
<!-- [11303] User Created Field. Type: User (joomla) --> <!-- [11341] User Created Field. Type: User (joomla) -->
<field <field
name="created_by" name="created_by"
type="user" type="user"
label="COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_LABEL" label="COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_DESC" description="COM_SERMONDISTRIBUTOR_SERIES_CREATED_BY_DESC"
/> />
<!-- [11311] Published Field. Type: List (joomla) --> <!-- [11349] Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS" <field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state" description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" > filter="intval" size="1" default="1" >
@ -42,18 +42,18 @@
<option value="-2"> <option value="-2">
JTRASHED</option> JTRASHED</option>
</field> </field>
<!-- [11326] Date Modified Field. Type: Calendar (joomla) --> <!-- [11364] Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly" <field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC" label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" /> size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [11330] User Modified Field. Type: User (joomla) --> <!-- [11368] User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user" <field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
class="readonly" class="readonly"
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11340] Access Field. Type: Accesslevel (joomla) --> <!-- [11378] Access Field. Type: Accesslevel (joomla) -->
<field name="access" <field name="access"
type="accesslevel" type="accesslevel"
label="JFIELD_ACCESS_LABEL" label="JFIELD_ACCESS_LABEL"
@ -61,7 +61,7 @@
default="1" default="1"
required="false" required="false"
/> />
<!-- [11350] Ordering Field. Type: Numbers (joomla) --> <!-- [11388] Ordering Field. Type: Numbers (joomla) -->
<field <field
name="ordering" name="ordering"
type="number" type="number"
@ -72,7 +72,7 @@
size="6" size="6"
required="false" required="false"
/> />
<!-- [11362] Version Field. Type: Text (joomla) --> <!-- [11400] Version Field. Type: Text (joomla) -->
<field <field
name="version" name="version"
type="text" type="text"
@ -83,7 +83,7 @@
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11376] Metakey Field. Type: Textarea (joomla) --> <!-- [11414] Metakey Field. Type: Textarea (joomla) -->
<field <field
name="metakey" name="metakey"
type="textarea" type="textarea"
@ -92,7 +92,7 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11385] Metadesc Field. Type: Textarea (joomla) --> <!-- [11423] Metadesc Field. Type: Textarea (joomla) -->
<field <field
name="metadesc" name="metadesc"
type="textarea" type="textarea"
@ -101,8 +101,8 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11395] Dynamic Fields. --> <!-- [11433] Dynamic Fields. -->
<!-- [11631] Name Field. Type: Text. (joomla) --> <!-- [11669] Name Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="name" name="name"
@ -118,7 +118,7 @@
message="Error! Please add name here." message="Error! Please add name here."
hint="COM_SERMONDISTRIBUTOR_SERIES_NAME_HINT" hint="COM_SERMONDISTRIBUTOR_SERIES_NAME_HINT"
/> />
<!-- [11631] Description Field. Type: Editor. (joomla) --> <!-- [11669] Description Field. Type: Editor. (joomla) -->
<field <field
type="editor" type="editor"
name="description" name="description"
@ -130,7 +130,7 @@
buttons="false" buttons="false"
filter="safehtml" filter="safehtml"
/> />
<!-- [11631] Alias Field. Type: Text. (joomla) --> <!-- [11669] Alias Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="alias" name="alias"
@ -139,7 +139,7 @@
filter="STRING" filter="STRING"
hint="COM_SERMONDISTRIBUTOR_SERIES_ALIAS_HINT" hint="COM_SERMONDISTRIBUTOR_SERIES_ALIAS_HINT"
/> />
<!-- [11631] Icon Field. Type: Media. (joomla) --> <!-- [11669] Icon Field. Type: Media. (joomla) -->
<field <field
type="media" type="media"
name="icon" name="icon"
@ -147,7 +147,7 @@
description="COM_SERMONDISTRIBUTOR_SERIES_ICON_DESCRIPTION" description="COM_SERMONDISTRIBUTOR_SERIES_ICON_DESCRIPTION"
directory="" directory=""
/> />
<!-- [11631] Scripture Field. Type: Text. (joomla) --> <!-- [11669] Scripture Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="scripture" name="scripture"
@ -165,11 +165,11 @@
/> />
</fieldset> </fieldset>
<!-- [11414] Metadata Fields. --> <!-- [11452] Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> <fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata" <fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [11418] Robots Field. Type: List (joomla) --> <!-- [11456] Robots Field. Type: List (joomla) -->
<field name="robots" <field name="robots"
type="list" type="list"
label="JFIELD_METADATA_ROBOTS_LABEL" label="JFIELD_METADATA_ROBOTS_LABEL"
@ -180,13 +180,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option> <option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option> <option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field> </field>
<!-- [11429] Author Field. Type: Text (joomla) --> <!-- [11467] Author Field. Type: Text (joomla) -->
<field name="author" <field name="author"
type="text" type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC" label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20" size="20"
/> />
<!-- [11435] Rights Field. Type: Textarea (joomla) --> <!-- [11473] Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL" <field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string" description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2" cols="30" rows="2"
@ -194,15 +194,15 @@
</fieldset> </fieldset>
</fields> </fields>
<!-- [10317] Access Control Fields. --> <!-- [10355] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10319] Asset Id Field. Type: Hidden (joomla) --> <!-- [10357] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10325] Rules Field. Type: Rules (joomla) --> <!-- [10363] Rules Field. Type: Rules (joomla) -->
<field <field
name="rules" name="rules"
type="rules" type="rules"

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermon.js @subpackage sermon.js
@ -23,127 +23,127 @@
/-----------------------------------------------------------------------------------------------------------------------------*/ /-----------------------------------------------------------------------------------------------------------------------------*/
// Some Global Values // Some Global Values
jform_JEmAiDFgAz_required = false; jform_qnBNDdgYsI_required = false;
jform_mBQbiOvPmP_required = false; jform_tIcVEBHbWb_required = false;
jform_wsmVGIDntn_required = false; jform_KtgSzzAboh_required = false;
jform_ENzGNYPiLA_required = false; jform_MEmRboexQl_required = false;
jform_YYiOanxvgR_required = false; jform_UeQYbvAIDD_required = false;
// Initial Script // Initial Script
jQuery(document).ready(function() jQuery(document).ready(function()
{ {
var source_JEmAiDF = jQuery("#jform_source").val(); var source_qnBNDdg = jQuery("#jform_source").val();
JEmAiDF(source_JEmAiDF); qnBNDdg(source_qnBNDdg);
var source_NIIuwpV = jQuery("#jform_source").val(); var source_CWzLshf = jQuery("#jform_source").val();
var build_NIIuwpV = jQuery("#jform_build input[type='radio']:checked").val(); var build_CWzLshf = jQuery("#jform_build input[type='radio']:checked").val();
NIIuwpV(source_NIIuwpV,build_NIIuwpV); CWzLshf(source_CWzLshf,build_CWzLshf);
var source_mBQbiOv = jQuery("#jform_source").val(); var source_tIcVEBH = jQuery("#jform_source").val();
var build_mBQbiOv = jQuery("#jform_build input[type='radio']:checked").val(); var build_tIcVEBH = jQuery("#jform_build input[type='radio']:checked").val();
mBQbiOv(source_mBQbiOv,build_mBQbiOv); tIcVEBH(source_tIcVEBH,build_tIcVEBH);
var build_wsmVGID = jQuery("#jform_build input[type='radio']:checked").val(); var build_KtgSzzA = jQuery("#jform_build input[type='radio']:checked").val();
var source_wsmVGID = jQuery("#jform_source").val(); var source_KtgSzzA = jQuery("#jform_source").val();
wsmVGID(build_wsmVGID,source_wsmVGID); KtgSzzA(build_KtgSzzA,source_KtgSzzA);
var source_ENzGNYP = jQuery("#jform_source").val(); var source_MEmRboe = jQuery("#jform_source").val();
ENzGNYP(source_ENzGNYP); MEmRboe(source_MEmRboe);
var source_YYiOanx = jQuery("#jform_source").val(); var source_UeQYbvA = jQuery("#jform_source").val();
YYiOanx(source_YYiOanx); UeQYbvA(source_UeQYbvA);
var link_type_rCpyqQl = jQuery("#jform_link_type input[type='radio']:checked").val(); var link_type_CrWJiuj = jQuery("#jform_link_type input[type='radio']:checked").val();
rCpyqQl(link_type_rCpyqQl); CrWJiuj(link_type_CrWJiuj);
var link_type_RgLeKCE = jQuery("#jform_link_type input[type='radio']:checked").val(); var link_type_JxwVegn = jQuery("#jform_link_type input[type='radio']:checked").val();
RgLeKCE(link_type_RgLeKCE); JxwVegn(link_type_JxwVegn);
}); });
// the JEmAiDF function // the qnBNDdg function
function JEmAiDF(source_JEmAiDF) function qnBNDdg(source_qnBNDdg)
{ {
if (isSet(source_JEmAiDF) && source_JEmAiDF.constructor !== Array) if (isSet(source_qnBNDdg) && source_qnBNDdg.constructor !== Array)
{ {
var temp_JEmAiDF = source_JEmAiDF; var temp_qnBNDdg = source_qnBNDdg;
var source_JEmAiDF = []; var source_qnBNDdg = [];
source_JEmAiDF.push(temp_JEmAiDF); source_qnBNDdg.push(temp_qnBNDdg);
} }
else if (!isSet(source_JEmAiDF)) else if (!isSet(source_qnBNDdg))
{ {
var source_JEmAiDF = []; var source_qnBNDdg = [];
} }
var source = source_JEmAiDF.some(source_JEmAiDF_SomeFunc); var source = source_qnBNDdg.some(source_qnBNDdg_SomeFunc);
// [8247] set this function logic // [8285] set this function logic
if (source) if (source)
{ {
jQuery('#jform_build').closest('.control-group').show(); jQuery('#jform_build').closest('.control-group').show();
if (jform_JEmAiDFgAz_required) if (jform_qnBNDdgYsI_required)
{ {
updateFieldRequired('build',0); updateFieldRequired('build',0);
jQuery('#jform_build').prop('required','required'); jQuery('#jform_build').prop('required','required');
jQuery('#jform_build').attr('aria-required',true); jQuery('#jform_build').attr('aria-required',true);
jQuery('#jform_build').addClass('required'); jQuery('#jform_build').addClass('required');
jform_JEmAiDFgAz_required = false; jform_qnBNDdgYsI_required = false;
} }
} }
else else
{ {
jQuery('#jform_build').closest('.control-group').hide(); jQuery('#jform_build').closest('.control-group').hide();
if (!jform_JEmAiDFgAz_required) if (!jform_qnBNDdgYsI_required)
{ {
updateFieldRequired('build',1); updateFieldRequired('build',1);
jQuery('#jform_build').removeAttr('required'); jQuery('#jform_build').removeAttr('required');
jQuery('#jform_build').removeAttr('aria-required'); jQuery('#jform_build').removeAttr('aria-required');
jQuery('#jform_build').removeClass('required'); jQuery('#jform_build').removeClass('required');
jform_JEmAiDFgAz_required = true; jform_qnBNDdgYsI_required = true;
} }
} }
} }
// the JEmAiDF Some function // the qnBNDdg Some function
function source_JEmAiDF_SomeFunc(source_JEmAiDF) function source_qnBNDdg_SomeFunc(source_qnBNDdg)
{ {
// [8234] set the function logic // [8272] set the function logic
if (source_JEmAiDF == 2) if (source_qnBNDdg == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the NIIuwpV function // the CWzLshf function
function NIIuwpV(source_NIIuwpV,build_NIIuwpV) function CWzLshf(source_CWzLshf,build_CWzLshf)
{ {
if (isSet(source_NIIuwpV) && source_NIIuwpV.constructor !== Array) if (isSet(source_CWzLshf) && source_CWzLshf.constructor !== Array)
{ {
var temp_NIIuwpV = source_NIIuwpV; var temp_CWzLshf = source_CWzLshf;
var source_NIIuwpV = []; var source_CWzLshf = [];
source_NIIuwpV.push(temp_NIIuwpV); source_CWzLshf.push(temp_CWzLshf);
} }
else if (!isSet(source_NIIuwpV)) else if (!isSet(source_CWzLshf))
{ {
var source_NIIuwpV = []; var source_CWzLshf = [];
} }
var source = source_NIIuwpV.some(source_NIIuwpV_SomeFunc); var source = source_CWzLshf.some(source_CWzLshf_SomeFunc);
if (isSet(build_NIIuwpV) && build_NIIuwpV.constructor !== Array) if (isSet(build_CWzLshf) && build_CWzLshf.constructor !== Array)
{ {
var temp_NIIuwpV = build_NIIuwpV; var temp_CWzLshf = build_CWzLshf;
var build_NIIuwpV = []; var build_CWzLshf = [];
build_NIIuwpV.push(temp_NIIuwpV); build_CWzLshf.push(temp_CWzLshf);
} }
else if (!isSet(build_NIIuwpV)) else if (!isSet(build_CWzLshf))
{ {
var build_NIIuwpV = []; var build_CWzLshf = [];
} }
var build = build_NIIuwpV.some(build_NIIuwpV_SomeFunc); var build = build_CWzLshf.some(build_CWzLshf_SomeFunc);
// [8247] set this function logic // [8285] set this function logic
if (source && build) if (source && build)
{ {
jQuery('.note_auto_dropbox').closest('.control-group').show(); jQuery('.note_auto_dropbox').closest('.control-group').show();
@ -154,67 +154,67 @@ function NIIuwpV(source_NIIuwpV,build_NIIuwpV)
} }
} }
// the NIIuwpV Some function // the CWzLshf Some function
function source_NIIuwpV_SomeFunc(source_NIIuwpV) function source_CWzLshf_SomeFunc(source_CWzLshf)
{ {
// [8234] set the function logic // [8272] set the function logic
if (source_NIIuwpV == 2) if (source_CWzLshf == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the NIIuwpV Some function // the CWzLshf Some function
function build_NIIuwpV_SomeFunc(build_NIIuwpV) function build_CWzLshf_SomeFunc(build_CWzLshf)
{ {
// [8234] set the function logic // [8272] set the function logic
if (build_NIIuwpV == 2) if (build_CWzLshf == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the mBQbiOv function // the tIcVEBH function
function mBQbiOv(source_mBQbiOv,build_mBQbiOv) function tIcVEBH(source_tIcVEBH,build_tIcVEBH)
{ {
if (isSet(source_mBQbiOv) && source_mBQbiOv.constructor !== Array) if (isSet(source_tIcVEBH) && source_tIcVEBH.constructor !== Array)
{ {
var temp_mBQbiOv = source_mBQbiOv; var temp_tIcVEBH = source_tIcVEBH;
var source_mBQbiOv = []; var source_tIcVEBH = [];
source_mBQbiOv.push(temp_mBQbiOv); source_tIcVEBH.push(temp_tIcVEBH);
} }
else if (!isSet(source_mBQbiOv)) else if (!isSet(source_tIcVEBH))
{ {
var source_mBQbiOv = []; var source_tIcVEBH = [];
} }
var source = source_mBQbiOv.some(source_mBQbiOv_SomeFunc); var source = source_tIcVEBH.some(source_tIcVEBH_SomeFunc);
if (isSet(build_mBQbiOv) && build_mBQbiOv.constructor !== Array) if (isSet(build_tIcVEBH) && build_tIcVEBH.constructor !== Array)
{ {
var temp_mBQbiOv = build_mBQbiOv; var temp_tIcVEBH = build_tIcVEBH;
var build_mBQbiOv = []; var build_tIcVEBH = [];
build_mBQbiOv.push(temp_mBQbiOv); build_tIcVEBH.push(temp_tIcVEBH);
} }
else if (!isSet(build_mBQbiOv)) else if (!isSet(build_tIcVEBH))
{ {
var build_mBQbiOv = []; var build_tIcVEBH = [];
} }
var build = build_mBQbiOv.some(build_mBQbiOv_SomeFunc); var build = build_tIcVEBH.some(build_tIcVEBH_SomeFunc);
// [8247] set this function logic // [8285] set this function logic
if (source && build) if (source && build)
{ {
jQuery('#jform_manual_files').closest('.control-group').show(); jQuery('#jform_manual_files').closest('.control-group').show();
if (jform_mBQbiOvPmP_required) if (jform_tIcVEBHbWb_required)
{ {
updateFieldRequired('manual_files',0); updateFieldRequired('manual_files',0);
jQuery('#jform_manual_files').prop('required','required'); jQuery('#jform_manual_files').prop('required','required');
jQuery('#jform_manual_files').attr('aria-required',true); jQuery('#jform_manual_files').attr('aria-required',true);
jQuery('#jform_manual_files').addClass('required'); jQuery('#jform_manual_files').addClass('required');
jform_mBQbiOvPmP_required = false; jform_tIcVEBHbWb_required = false;
} }
jQuery('.note_manual_dropbox').closest('.control-group').show(); jQuery('.note_manual_dropbox').closest('.control-group').show();
@ -222,79 +222,79 @@ function mBQbiOv(source_mBQbiOv,build_mBQbiOv)
else else
{ {
jQuery('#jform_manual_files').closest('.control-group').hide(); jQuery('#jform_manual_files').closest('.control-group').hide();
if (!jform_mBQbiOvPmP_required) if (!jform_tIcVEBHbWb_required)
{ {
updateFieldRequired('manual_files',1); updateFieldRequired('manual_files',1);
jQuery('#jform_manual_files').removeAttr('required'); jQuery('#jform_manual_files').removeAttr('required');
jQuery('#jform_manual_files').removeAttr('aria-required'); jQuery('#jform_manual_files').removeAttr('aria-required');
jQuery('#jform_manual_files').removeClass('required'); jQuery('#jform_manual_files').removeClass('required');
jform_mBQbiOvPmP_required = true; jform_tIcVEBHbWb_required = true;
} }
jQuery('.note_manual_dropbox').closest('.control-group').hide(); jQuery('.note_manual_dropbox').closest('.control-group').hide();
} }
} }
// the mBQbiOv Some function // the tIcVEBH Some function
function source_mBQbiOv_SomeFunc(source_mBQbiOv) function source_tIcVEBH_SomeFunc(source_tIcVEBH)
{ {
// [8234] set the function logic // [8272] set the function logic
if (source_mBQbiOv == 2) if (source_tIcVEBH == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the mBQbiOv Some function // the tIcVEBH Some function
function build_mBQbiOv_SomeFunc(build_mBQbiOv) function build_tIcVEBH_SomeFunc(build_tIcVEBH)
{ {
// [8234] set the function logic // [8272] set the function logic
if (build_mBQbiOv == 1) if (build_tIcVEBH == 1)
{ {
return true; return true;
} }
return false; return false;
} }
// the wsmVGID function // the KtgSzzA function
function wsmVGID(build_wsmVGID,source_wsmVGID) function KtgSzzA(build_KtgSzzA,source_KtgSzzA)
{ {
if (isSet(build_wsmVGID) && build_wsmVGID.constructor !== Array) if (isSet(build_KtgSzzA) && build_KtgSzzA.constructor !== Array)
{ {
var temp_wsmVGID = build_wsmVGID; var temp_KtgSzzA = build_KtgSzzA;
var build_wsmVGID = []; var build_KtgSzzA = [];
build_wsmVGID.push(temp_wsmVGID); build_KtgSzzA.push(temp_KtgSzzA);
} }
else if (!isSet(build_wsmVGID)) else if (!isSet(build_KtgSzzA))
{ {
var build_wsmVGID = []; var build_KtgSzzA = [];
} }
var build = build_wsmVGID.some(build_wsmVGID_SomeFunc); var build = build_KtgSzzA.some(build_KtgSzzA_SomeFunc);
if (isSet(source_wsmVGID) && source_wsmVGID.constructor !== Array) if (isSet(source_KtgSzzA) && source_KtgSzzA.constructor !== Array)
{ {
var temp_wsmVGID = source_wsmVGID; var temp_KtgSzzA = source_KtgSzzA;
var source_wsmVGID = []; var source_KtgSzzA = [];
source_wsmVGID.push(temp_wsmVGID); source_KtgSzzA.push(temp_KtgSzzA);
} }
else if (!isSet(source_wsmVGID)) else if (!isSet(source_KtgSzzA))
{ {
var source_wsmVGID = []; var source_KtgSzzA = [];
} }
var source = source_wsmVGID.some(source_wsmVGID_SomeFunc); var source = source_KtgSzzA.some(source_KtgSzzA_SomeFunc);
// [8247] set this function logic // [8285] set this function logic
if (build && source) if (build && source)
{ {
jQuery('#jform_manual_files').closest('.control-group').show(); jQuery('#jform_manual_files').closest('.control-group').show();
if (jform_wsmVGIDntn_required) if (jform_KtgSzzAboh_required)
{ {
updateFieldRequired('manual_files',0); updateFieldRequired('manual_files',0);
jQuery('#jform_manual_files').prop('required','required'); jQuery('#jform_manual_files').prop('required','required');
jQuery('#jform_manual_files').attr('aria-required',true); jQuery('#jform_manual_files').attr('aria-required',true);
jQuery('#jform_manual_files').addClass('required'); jQuery('#jform_manual_files').addClass('required');
jform_wsmVGIDntn_required = false; jform_KtgSzzAboh_required = false;
} }
jQuery('.note_manual_dropbox').closest('.control-group').show(); jQuery('.note_manual_dropbox').closest('.control-group').show();
@ -302,155 +302,155 @@ function wsmVGID(build_wsmVGID,source_wsmVGID)
else else
{ {
jQuery('#jform_manual_files').closest('.control-group').hide(); jQuery('#jform_manual_files').closest('.control-group').hide();
if (!jform_wsmVGIDntn_required) if (!jform_KtgSzzAboh_required)
{ {
updateFieldRequired('manual_files',1); updateFieldRequired('manual_files',1);
jQuery('#jform_manual_files').removeAttr('required'); jQuery('#jform_manual_files').removeAttr('required');
jQuery('#jform_manual_files').removeAttr('aria-required'); jQuery('#jform_manual_files').removeAttr('aria-required');
jQuery('#jform_manual_files').removeClass('required'); jQuery('#jform_manual_files').removeClass('required');
jform_wsmVGIDntn_required = true; jform_KtgSzzAboh_required = true;
} }
jQuery('.note_manual_dropbox').closest('.control-group').hide(); jQuery('.note_manual_dropbox').closest('.control-group').hide();
} }
} }
// the wsmVGID Some function // the KtgSzzA Some function
function build_wsmVGID_SomeFunc(build_wsmVGID) function build_KtgSzzA_SomeFunc(build_KtgSzzA)
{ {
// [8234] set the function logic // [8272] set the function logic
if (build_wsmVGID == 1) if (build_KtgSzzA == 1)
{ {
return true; return true;
} }
return false; return false;
} }
// the wsmVGID Some function // the KtgSzzA Some function
function source_wsmVGID_SomeFunc(source_wsmVGID) function source_KtgSzzA_SomeFunc(source_KtgSzzA)
{ {
// [8234] set the function logic // [8272] set the function logic
if (source_wsmVGID == 2) if (source_KtgSzzA == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the ENzGNYP function // the MEmRboe function
function ENzGNYP(source_ENzGNYP) function MEmRboe(source_MEmRboe)
{ {
if (isSet(source_ENzGNYP) && source_ENzGNYP.constructor !== Array) if (isSet(source_MEmRboe) && source_MEmRboe.constructor !== Array)
{ {
var temp_ENzGNYP = source_ENzGNYP; var temp_MEmRboe = source_MEmRboe;
var source_ENzGNYP = []; var source_MEmRboe = [];
source_ENzGNYP.push(temp_ENzGNYP); source_MEmRboe.push(temp_MEmRboe);
} }
else if (!isSet(source_ENzGNYP)) else if (!isSet(source_MEmRboe))
{ {
var source_ENzGNYP = []; var source_MEmRboe = [];
} }
var source = source_ENzGNYP.some(source_ENzGNYP_SomeFunc); var source = source_MEmRboe.some(source_MEmRboe_SomeFunc);
// [8247] set this function logic // [8285] set this function logic
if (source) if (source)
{ {
jQuery('#jform_local_files').closest('.control-group').show(); jQuery('#jform_local_files').closest('.control-group').show();
if (jform_ENzGNYPiLA_required) if (jform_MEmRboexQl_required)
{ {
updateFieldRequired('local_files',0); updateFieldRequired('local_files',0);
jQuery('#jform_local_files').prop('required','required'); jQuery('#jform_local_files').prop('required','required');
jQuery('#jform_local_files').attr('aria-required',true); jQuery('#jform_local_files').attr('aria-required',true);
jQuery('#jform_local_files').addClass('required'); jQuery('#jform_local_files').addClass('required');
jform_ENzGNYPiLA_required = false; jform_MEmRboexQl_required = false;
} }
} }
else else
{ {
jQuery('#jform_local_files').closest('.control-group').hide(); jQuery('#jform_local_files').closest('.control-group').hide();
if (!jform_ENzGNYPiLA_required) if (!jform_MEmRboexQl_required)
{ {
updateFieldRequired('local_files',1); updateFieldRequired('local_files',1);
jQuery('#jform_local_files').removeAttr('required'); jQuery('#jform_local_files').removeAttr('required');
jQuery('#jform_local_files').removeAttr('aria-required'); jQuery('#jform_local_files').removeAttr('aria-required');
jQuery('#jform_local_files').removeClass('required'); jQuery('#jform_local_files').removeClass('required');
jform_ENzGNYPiLA_required = true; jform_MEmRboexQl_required = true;
} }
} }
} }
// the ENzGNYP Some function // the MEmRboe Some function
function source_ENzGNYP_SomeFunc(source_ENzGNYP) function source_MEmRboe_SomeFunc(source_MEmRboe)
{ {
// [8234] set the function logic // [8272] set the function logic
if (source_ENzGNYP == 1) if (source_MEmRboe == 1)
{ {
return true; return true;
} }
return false; return false;
} }
// the YYiOanx function // the UeQYbvA function
function YYiOanx(source_YYiOanx) function UeQYbvA(source_UeQYbvA)
{ {
if (isSet(source_YYiOanx) && source_YYiOanx.constructor !== Array) if (isSet(source_UeQYbvA) && source_UeQYbvA.constructor !== Array)
{ {
var temp_YYiOanx = source_YYiOanx; var temp_UeQYbvA = source_UeQYbvA;
var source_YYiOanx = []; var source_UeQYbvA = [];
source_YYiOanx.push(temp_YYiOanx); source_UeQYbvA.push(temp_UeQYbvA);
} }
else if (!isSet(source_YYiOanx)) else if (!isSet(source_UeQYbvA))
{ {
var source_YYiOanx = []; var source_UeQYbvA = [];
} }
var source = source_YYiOanx.some(source_YYiOanx_SomeFunc); var source = source_UeQYbvA.some(source_UeQYbvA_SomeFunc);
// [8247] set this function logic // [8285] set this function logic
if (source) if (source)
{ {
jQuery('#jform_url').closest('.control-group').show(); jQuery('#jform_url').closest('.control-group').show();
if (jform_YYiOanxvgR_required) if (jform_UeQYbvAIDD_required)
{ {
updateFieldRequired('url',0); updateFieldRequired('url',0);
jQuery('#jform_url').prop('required','required'); jQuery('#jform_url').prop('required','required');
jQuery('#jform_url').attr('aria-required',true); jQuery('#jform_url').attr('aria-required',true);
jQuery('#jform_url').addClass('required'); jQuery('#jform_url').addClass('required');
jform_YYiOanxvgR_required = false; jform_UeQYbvAIDD_required = false;
} }
} }
else else
{ {
jQuery('#jform_url').closest('.control-group').hide(); jQuery('#jform_url').closest('.control-group').hide();
if (!jform_YYiOanxvgR_required) if (!jform_UeQYbvAIDD_required)
{ {
updateFieldRequired('url',1); updateFieldRequired('url',1);
jQuery('#jform_url').removeAttr('required'); jQuery('#jform_url').removeAttr('required');
jQuery('#jform_url').removeAttr('aria-required'); jQuery('#jform_url').removeAttr('aria-required');
jQuery('#jform_url').removeClass('required'); jQuery('#jform_url').removeClass('required');
jform_YYiOanxvgR_required = true; jform_UeQYbvAIDD_required = true;
} }
} }
} }
// the YYiOanx Some function // the UeQYbvA Some function
function source_YYiOanx_SomeFunc(source_YYiOanx) function source_UeQYbvA_SomeFunc(source_UeQYbvA)
{ {
// [8234] set the function logic // [8272] set the function logic
if (source_YYiOanx == 3) if (source_UeQYbvA == 3)
{ {
return true; return true;
} }
return false; return false;
} }
// the rCpyqQl function // the CrWJiuj function
function rCpyqQl(link_type_rCpyqQl) function CrWJiuj(link_type_CrWJiuj)
{ {
// [8269] set the function logic // [8307] set the function logic
if (link_type_rCpyqQl == 2) if (link_type_CrWJiuj == 2)
{ {
jQuery('.note_link_directed').closest('.control-group').show(); jQuery('.note_link_directed').closest('.control-group').show();
} }
@ -460,11 +460,11 @@ function rCpyqQl(link_type_rCpyqQl)
} }
} }
// the RgLeKCE function // the JxwVegn function
function RgLeKCE(link_type_RgLeKCE) function JxwVegn(link_type_JxwVegn)
{ {
// [8269] set the function logic // [8307] set the function logic
if (link_type_RgLeKCE == 1) if (link_type_JxwVegn == 1)
{ {
jQuery('.note_link_encrypted').closest('.control-group').show(); jQuery('.note_link_encrypted').closest('.control-group').show();
} }

View File

@ -4,15 +4,15 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields" addfieldpath="/administrator/components/com_sermondistributor/models/fields"
> >
<fieldset name="details"> <fieldset name="details">
<!-- [11284] Default Fields. --> <!-- [11322] Default Fields. -->
<!-- [11285] Id Field. Type: Text (joomla) --> <!-- [11323] Id Field. Type: Text (joomla) -->
<field <field
name="id" name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL" type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0" description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true" readonly="true"
/> />
<!-- [11292] Date Created Field. Type: Calendar (joomla) --> <!-- [11330] Date Created Field. Type: Calendar (joomla) -->
<field <field
name="created" name="created"
type="calendar" type="calendar"
@ -22,14 +22,14 @@
format="%Y-%m-%d %H:%M:%S" format="%Y-%m-%d %H:%M:%S"
filter="user_utc" filter="user_utc"
/> />
<!-- [11303] User Created Field. Type: User (joomla) --> <!-- [11341] User Created Field. Type: User (joomla) -->
<field <field
name="created_by" name="created_by"
type="user" type="user"
label="COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_LABEL" label="COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_DESC" description="COM_SERMONDISTRIBUTOR_SERMON_CREATED_BY_DESC"
/> />
<!-- [11311] Published Field. Type: List (joomla) --> <!-- [11349] Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS" <field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state" description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" > filter="intval" size="1" default="1" >
@ -42,18 +42,18 @@
<option value="-2"> <option value="-2">
JTRASHED</option> JTRASHED</option>
</field> </field>
<!-- [11326] Date Modified Field. Type: Calendar (joomla) --> <!-- [11364] Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly" <field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC" label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" /> size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [11330] User Modified Field. Type: User (joomla) --> <!-- [11368] User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user" <field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
class="readonly" class="readonly"
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11340] Access Field. Type: Accesslevel (joomla) --> <!-- [11378] Access Field. Type: Accesslevel (joomla) -->
<field name="access" <field name="access"
type="accesslevel" type="accesslevel"
label="JFIELD_ACCESS_LABEL" label="JFIELD_ACCESS_LABEL"
@ -61,7 +61,7 @@
default="1" default="1"
required="false" required="false"
/> />
<!-- [11350] Ordering Field. Type: Numbers (joomla) --> <!-- [11388] Ordering Field. Type: Numbers (joomla) -->
<field <field
name="ordering" name="ordering"
type="number" type="number"
@ -72,7 +72,7 @@
size="6" size="6"
required="false" required="false"
/> />
<!-- [11362] Version Field. Type: Text (joomla) --> <!-- [11400] Version Field. Type: Text (joomla) -->
<field <field
name="version" name="version"
type="text" type="text"
@ -83,7 +83,7 @@
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11376] Metakey Field. Type: Textarea (joomla) --> <!-- [11414] Metakey Field. Type: Textarea (joomla) -->
<field <field
name="metakey" name="metakey"
type="textarea" type="textarea"
@ -92,7 +92,7 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11385] Metadesc Field. Type: Textarea (joomla) --> <!-- [11423] Metadesc Field. Type: Textarea (joomla) -->
<field <field
name="metadesc" name="metadesc"
type="textarea" type="textarea"
@ -101,8 +101,8 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11395] Dynamic Fields. --> <!-- [11433] Dynamic Fields. -->
<!-- [11631] Name Field. Type: Text. (joomla) --> <!-- [11669] Name Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="name" name="name"
@ -118,7 +118,7 @@
message="Error! Please add name here." message="Error! Please add name here."
hint="COM_SERMONDISTRIBUTOR_SERMON_NAME_HINT" hint="COM_SERMONDISTRIBUTOR_SERMON_NAME_HINT"
/> />
<!-- [11752] Preacher Field. Type: Preachers. (custom) --> <!-- [11790] Preacher Field. Type: Preachers. (custom) -->
<field <field
type="preachers" type="preachers"
name="preacher" name="preacher"
@ -129,7 +129,7 @@
default="0" default="0"
button="true" button="true"
/> />
<!-- [11752] Series Field. Type: Series. (custom) --> <!-- [11790] Series Field. Type: Series. (custom) -->
<field <field
type="series" type="series"
name="series" name="series"
@ -140,7 +140,7 @@
default="0" default="0"
button="true" button="true"
/> />
<!-- [11631] Short_description Field. Type: Text. (joomla) --> <!-- [11669] Short_description Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="short_description" name="short_description"
@ -154,7 +154,7 @@
message="Error! Please add some short description here." message="Error! Please add some short description here."
hint="COM_SERMONDISTRIBUTOR_SERMON_SHORT_DESCRIPTION_HINT" hint="COM_SERMONDISTRIBUTOR_SERMON_SHORT_DESCRIPTION_HINT"
/> />
<!-- [11631] Catid Field. Type: Category. (joomla) --> <!-- [11669] Catid Field. Type: Category. (joomla) -->
<field <field
type="category" type="category"
name="catid" name="catid"
@ -164,7 +164,7 @@
description="COM_SERMONDISTRIBUTOR_SERMON_CATID_DESCRIPTION" description="COM_SERMONDISTRIBUTOR_SERMON_CATID_DESCRIPTION"
class="inputbox" class="inputbox"
/> />
<!-- [11545] Link_type Field. Type: Radio. (joomla) --> <!-- [11583] Link_type Field. Type: Radio. (joomla) -->
<field <field
type="radio" type="radio"
name="link_type" name="link_type"
@ -173,13 +173,13 @@
class="btn-group btn-group-yesno" class="btn-group btn-group-yesno"
default="1" default="1"
required="true"> required="true">
<!-- [11617] Option Set. --> <!-- [11655] Option Set. -->
<option value="1"> <option value="1">
COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED</option> COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED</option>
<option value="2"> <option value="2">
COM_SERMONDISTRIBUTOR_SERMON_DIRECT</option> COM_SERMONDISTRIBUTOR_SERMON_DIRECT</option>
</field> </field>
<!-- [11545] Source Field. Type: List. (joomla) --> <!-- [11583] Source Field. Type: List. (joomla) -->
<field <field
type="list" type="list"
name="source" name="source"
@ -189,7 +189,7 @@
multiple="false" multiple="false"
filter="INT" filter="INT"
required="true"> required="true">
<!-- [11617] Option Set. --> <!-- [11655] Option Set. -->
<option value=""> <option value="">
COM_SERMONDISTRIBUTOR_SERMON_SELECT_SOURCE</option> COM_SERMONDISTRIBUTOR_SERMON_SELECT_SOURCE</option>
<option value="1"> <option value="1">
@ -199,7 +199,7 @@
<option value="3"> <option value="3">
COM_SERMONDISTRIBUTOR_SERMON_URL</option> COM_SERMONDISTRIBUTOR_SERMON_URL</option>
</field> </field>
<!-- [11631] Icon Field. Type: Media. (joomla) --> <!-- [11669] Icon Field. Type: Media. (joomla) -->
<field <field
type="media" type="media"
name="icon" name="icon"
@ -207,7 +207,7 @@
description="COM_SERMONDISTRIBUTOR_SERMON_ICON_DESCRIPTION" description="COM_SERMONDISTRIBUTOR_SERMON_ICON_DESCRIPTION"
directory="" directory=""
/> />
<!-- [11631] Tags Field. Type: Tag. (joomla) --> <!-- [11669] Tags Field. Type: Tag. (joomla) -->
<field <field
type="tag" type="tag"
name="tags" name="tags"
@ -218,7 +218,7 @@
published="true" published="true"
multiple="true" multiple="true"
/> />
<!-- [11752] Local_files Field. Type: Localfiles. (custom) --> <!-- [11790] Local_files Field. Type: Localfiles. (custom) -->
<field <field
type="localfiles" type="localfiles"
name="local_files" name="local_files"
@ -230,7 +230,7 @@
required="true" required="true"
button="false" button="false"
/> />
<!-- [11631] Description Field. Type: Editor. (joomla) --> <!-- [11669] Description Field. Type: Editor. (joomla) -->
<field <field
type="editor" type="editor"
name="description" name="description"
@ -242,9 +242,9 @@
buttons="false" buttons="false"
filter="safehtml" filter="safehtml"
/> />
<!-- [11645] Note_auto_dropbox Field. Type: Note. A None Database Field. (joomla) --> <!-- [11683] Note_auto_dropbox Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_auto_dropbox" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_AUTO_DROPBOX_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_AUTO_DROPBOX_DESCRIPTION" heading="h4" class="alert alert-info note_auto_dropbox" /> <field type="note" name="note_auto_dropbox" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_AUTO_DROPBOX_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_AUTO_DROPBOX_DESCRIPTION" heading="h4" class="alert alert-info note_auto_dropbox" />
<!-- [11631] Alias Field. Type: Text. (joomla) --> <!-- [11669] Alias Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="alias" name="alias"
@ -253,19 +253,19 @@
filter="STRING" filter="STRING"
hint="COM_SERMONDISTRIBUTOR_SERMON_ALIAS_HINT" hint="COM_SERMONDISTRIBUTOR_SERMON_ALIAS_HINT"
/> />
<!-- [11631] Not_required Field. Type: Hidden. (joomla) --> <!-- [11669] Not_required Field. Type: Hidden. (joomla) -->
<field <field
type="hidden" type="hidden"
name="not_required" name="not_required"
default="[]" default="[]"
/> />
<!-- [11645] Note_link_directed Field. Type: Note. A None Database Field. (joomla) --> <!-- [11683] Note_link_directed Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_link_directed" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_DIRECTED_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_DIRECTED_DESCRIPTION" heading="h4" class="alert alert-info note_link_directed" close="true" /> <field type="note" name="note_link_directed" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_DIRECTED_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_DIRECTED_DESCRIPTION" heading="h4" class="alert alert-info note_link_directed" close="true" />
<!-- [11645] Note_manual_dropbox Field. Type: Note. A None Database Field. (joomla) --> <!-- [11683] Note_manual_dropbox Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_manual_dropbox" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_MANUAL_DROPBOX_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_MANUAL_DROPBOX_DESCRIPTION" heading="h4" class="alert alert-info note_manual_dropbox" /> <field type="note" name="note_manual_dropbox" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_MANUAL_DROPBOX_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_MANUAL_DROPBOX_DESCRIPTION" heading="h4" class="alert alert-info note_manual_dropbox" />
<!-- [11645] Note_link_encrypted Field. Type: Note. A None Database Field. (joomla) --> <!-- [11683] Note_link_encrypted Field. Type: Note. A None Database Field. (joomla) -->
<field type="note" name="note_link_encrypted" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_ENCRYPTED_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_ENCRYPTED_DESCRIPTION" heading="h4" class="alert alert-info note_link_encrypted" close="true" /> <field type="note" name="note_link_encrypted" label="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_ENCRYPTED_LABEL" description="COM_SERMONDISTRIBUTOR_SERMON_NOTE_LINK_ENCRYPTED_DESCRIPTION" heading="h4" class="alert alert-info note_link_encrypted" close="true" />
<!-- [11752] Manual_files Field. Type: Dropboxfiles. (custom) --> <!-- [11790] Manual_files Field. Type: Dropboxfiles. (custom) -->
<field <field
type="dropboxfiles" type="dropboxfiles"
name="manual_files" name="manual_files"
@ -277,7 +277,7 @@
required="true" required="true"
button="false" button="false"
/> />
<!-- [11631] Scripture Field. Type: Text. (joomla) --> <!-- [11669] Scripture Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="scripture" name="scripture"
@ -293,7 +293,7 @@
message="Error! Please add some scripture reference here." message="Error! Please add some scripture reference here."
hint="COM_SERMONDISTRIBUTOR_SERMON_SCRIPTURE_HINT" hint="COM_SERMONDISTRIBUTOR_SERMON_SCRIPTURE_HINT"
/> />
<!-- [11631] Url Field. Type: Url. (joomla) --> <!-- [11669] Url Field. Type: Url. (joomla) -->
<field <field
type="url" type="url"
name="url" name="url"
@ -308,7 +308,7 @@
message="Error! Please add sermon url here." message="Error! Please add sermon url here."
hint="COM_SERMONDISTRIBUTOR_SERMON_URL_HINT" hint="COM_SERMONDISTRIBUTOR_SERMON_URL_HINT"
/> />
<!-- [11545] Build Field. Type: Radio. (joomla) --> <!-- [11583] Build Field. Type: Radio. (joomla) -->
<field <field
type="radio" type="radio"
name="build" name="build"
@ -317,13 +317,13 @@
class="btn-group btn-group-yesno" class="btn-group btn-group-yesno"
default="1" default="1"
required="true"> required="true">
<!-- [11617] Option Set. --> <!-- [11655] Option Set. -->
<option value="1"> <option value="1">
COM_SERMONDISTRIBUTOR_SERMON_MANUAL</option> COM_SERMONDISTRIBUTOR_SERMON_MANUAL</option>
<option value="2"> <option value="2">
COM_SERMONDISTRIBUTOR_SERMON_AUTOMATIC</option> COM_SERMONDISTRIBUTOR_SERMON_AUTOMATIC</option>
</field> </field>
<!-- [11631] Auto_sermons Field. Type: Hidden. (joomla) --> <!-- [11669] Auto_sermons Field. Type: Hidden. (joomla) -->
<field <field
type="hidden" type="hidden"
name="auto_sermons" name="auto_sermons"
@ -331,11 +331,11 @@
/> />
</fieldset> </fieldset>
<!-- [11414] Metadata Fields. --> <!-- [11452] Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> <fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata" <fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [11418] Robots Field. Type: List (joomla) --> <!-- [11456] Robots Field. Type: List (joomla) -->
<field name="robots" <field name="robots"
type="list" type="list"
label="JFIELD_METADATA_ROBOTS_LABEL" label="JFIELD_METADATA_ROBOTS_LABEL"
@ -346,13 +346,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option> <option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option> <option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field> </field>
<!-- [11429] Author Field. Type: Text (joomla) --> <!-- [11467] Author Field. Type: Text (joomla) -->
<field name="author" <field name="author"
type="text" type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC" label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20" size="20"
/> />
<!-- [11435] Rights Field. Type: Textarea (joomla) --> <!-- [11473] Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL" <field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string" description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2" cols="30" rows="2"
@ -360,15 +360,15 @@
</fieldset> </fieldset>
</fields> </fields>
<!-- [10317] Access Control Fields. --> <!-- [10355] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10319] Asset Id Field. Type: Hidden (joomla) --> <!-- [10357] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10325] Rules Field. Type: Rules (joomla) --> <!-- [10363] Rules Field. Type: Rules (joomla) -->
<field <field
name="rules" name="rules"
type="rules" type="rules"

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage statistic.js @subpackage statistic.js

View File

@ -4,15 +4,15 @@
addfieldpath="/administrator/components/com_sermondistributor/models/fields" addfieldpath="/administrator/components/com_sermondistributor/models/fields"
> >
<fieldset name="details"> <fieldset name="details">
<!-- [11284] Default Fields. --> <!-- [11322] Default Fields. -->
<!-- [11285] Id Field. Type: Text (joomla) --> <!-- [11323] Id Field. Type: Text (joomla) -->
<field <field
name="id" name="id"
type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL" type="text" class="readonly" label="JGLOBAL_FIELD_ID_LABEL"
description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0" description ="JGLOBAL_FIELD_ID_DESC" size="10" default="0"
readonly="true" readonly="true"
/> />
<!-- [11292] Date Created Field. Type: Calendar (joomla) --> <!-- [11330] Date Created Field. Type: Calendar (joomla) -->
<field <field
name="created" name="created"
type="calendar" type="calendar"
@ -22,14 +22,14 @@
format="%Y-%m-%d %H:%M:%S" format="%Y-%m-%d %H:%M:%S"
filter="user_utc" filter="user_utc"
/> />
<!-- [11303] User Created Field. Type: User (joomla) --> <!-- [11341] User Created Field. Type: User (joomla) -->
<field <field
name="created_by" name="created_by"
type="user" type="user"
label="COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_LABEL" label="COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_LABEL"
description="COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_DESC" description="COM_SERMONDISTRIBUTOR_STATISTIC_CREATED_BY_DESC"
/> />
<!-- [11311] Published Field. Type: List (joomla) --> <!-- [11349] Published Field. Type: List (joomla) -->
<field name="published" type="list" label="JSTATUS" <field name="published" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="chzn-color-state" description="JFIELD_PUBLISHED_DESC" class="chzn-color-state"
filter="intval" size="1" default="1" > filter="intval" size="1" default="1" >
@ -42,18 +42,18 @@
<option value="-2"> <option value="-2">
JTRASHED</option> JTRASHED</option>
</field> </field>
<!-- [11326] Date Modified Field. Type: Calendar (joomla) --> <!-- [11364] Date Modified Field. Type: Calendar (joomla) -->
<field name="modified" type="calendar" class="readonly" <field name="modified" type="calendar" class="readonly"
label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC" label="JGLOBAL_FIELD_MODIFIED_LABEL" description="COM_CONTENT_FIELD_MODIFIED_DESC"
size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" /> size="22" readonly="true" format="%Y-%m-%d %H:%M:%S" filter="user_utc" />
<!-- [11330] User Modified Field. Type: User (joomla) --> <!-- [11368] User Modified Field. Type: User (joomla) -->
<field name="modified_by" type="user" <field name="modified_by" type="user"
label="JGLOBAL_FIELD_MODIFIED_BY_LABEL" label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
class="readonly" class="readonly"
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11340] Access Field. Type: Accesslevel (joomla) --> <!-- [11378] Access Field. Type: Accesslevel (joomla) -->
<field name="access" <field name="access"
type="accesslevel" type="accesslevel"
label="JFIELD_ACCESS_LABEL" label="JFIELD_ACCESS_LABEL"
@ -61,7 +61,7 @@
default="1" default="1"
required="false" required="false"
/> />
<!-- [11350] Ordering Field. Type: Numbers (joomla) --> <!-- [11388] Ordering Field. Type: Numbers (joomla) -->
<field <field
name="ordering" name="ordering"
type="number" type="number"
@ -72,7 +72,7 @@
size="6" size="6"
required="false" required="false"
/> />
<!-- [11362] Version Field. Type: Text (joomla) --> <!-- [11400] Version Field. Type: Text (joomla) -->
<field <field
name="version" name="version"
type="text" type="text"
@ -83,7 +83,7 @@
readonly="true" readonly="true"
filter="unset" filter="unset"
/> />
<!-- [11376] Metakey Field. Type: Textarea (joomla) --> <!-- [11414] Metakey Field. Type: Textarea (joomla) -->
<field <field
name="metakey" name="metakey"
type="textarea" type="textarea"
@ -92,7 +92,7 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11385] Metadesc Field. Type: Textarea (joomla) --> <!-- [11423] Metadesc Field. Type: Textarea (joomla) -->
<field <field
name="metadesc" name="metadesc"
type="textarea" type="textarea"
@ -101,8 +101,8 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- [11395] Dynamic Fields. --> <!-- [11433] Dynamic Fields. -->
<!-- [11631] Filename Field. Type: Text. (joomla) --> <!-- [11669] Filename Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="filename" name="filename"
@ -116,7 +116,7 @@
message="Error! Please add file name here." message="Error! Please add file name here."
hint="COM_SERMONDISTRIBUTOR_STATISTIC_FILENAME_HINT" hint="COM_SERMONDISTRIBUTOR_STATISTIC_FILENAME_HINT"
/> />
<!-- [11752] Sermon Field. Type: Sermon. (custom) --> <!-- [11790] Sermon Field. Type: Sermon. (custom) -->
<field <field
type="sermon" type="sermon"
name="sermon" name="sermon"
@ -127,7 +127,7 @@
required="true" required="true"
button="true" button="true"
/> />
<!-- [11752] Preacher Field. Type: Preachers. (custom) --> <!-- [11790] Preacher Field. Type: Preachers. (custom) -->
<field <field
type="preachers" type="preachers"
name="preacher" name="preacher"
@ -138,7 +138,7 @@
default="0" default="0"
button="true" button="true"
/> />
<!-- [11752] Series Field. Type: Series. (custom) --> <!-- [11790] Series Field. Type: Series. (custom) -->
<field <field
type="series" type="series"
name="series" name="series"
@ -149,7 +149,7 @@
default="0" default="0"
button="true" button="true"
/> />
<!-- [11631] Counter Field. Type: Text. (joomla) --> <!-- [11669] Counter Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="counter" name="counter"
@ -165,11 +165,11 @@
/> />
</fieldset> </fieldset>
<!-- [11414] Metadata Fields. --> <!-- [11452] Metadata Fields. -->
<fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> <fields name="metadata" label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<fieldset name="vdmmetadata" <fieldset name="vdmmetadata"
label="JGLOBAL_FIELDSET_METADATA_OPTIONS"> label="JGLOBAL_FIELDSET_METADATA_OPTIONS">
<!-- [11418] Robots Field. Type: List (joomla) --> <!-- [11456] Robots Field. Type: List (joomla) -->
<field name="robots" <field name="robots"
type="list" type="list"
label="JFIELD_METADATA_ROBOTS_LABEL" label="JFIELD_METADATA_ROBOTS_LABEL"
@ -180,13 +180,13 @@
<option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option> <option value="index, nofollow">JGLOBAL_INDEX_NOFOLLOW</option>
<option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option> <option value="noindex, nofollow">JGLOBAL_NOINDEX_NOFOLLOW</option>
</field> </field>
<!-- [11429] Author Field. Type: Text (joomla) --> <!-- [11467] Author Field. Type: Text (joomla) -->
<field name="author" <field name="author"
type="text" type="text"
label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC" label="JAUTHOR" description="JFIELD_METADATA_AUTHOR_DESC"
size="20" size="20"
/> />
<!-- [11435] Rights Field. Type: Textarea (joomla) --> <!-- [11473] Rights Field. Type: Textarea (joomla) -->
<field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL" <field name="rights" type="textarea" label="JFIELD_META_RIGHTS_LABEL"
description="JFIELD_META_RIGHTS_DESC" required="false" filter="string" description="JFIELD_META_RIGHTS_DESC" required="false" filter="string"
cols="30" rows="2" cols="30" rows="2"
@ -194,15 +194,15 @@
</fieldset> </fieldset>
</fields> </fields>
<!-- [10317] Access Control Fields. --> <!-- [10355] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10319] Asset Id Field. Type: Hidden (joomla) --> <!-- [10357] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10325] Rules Field. Type: Rules (joomla) --> <!-- [10363] Rules Field. Type: Rules (joomla) -->
<field <field
name="rules" name="rules"
type="rules" type="rules"

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage help_document.php @subpackage help_document.php
@ -97,7 +97,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
if (!empty($item->groups)) if (!empty($item->groups))
{ {
// [4232] JSON Decode groups. // [4270] JSON Decode groups.
$item->groups = json_decode($item->groups,true); $item->groups = json_decode($item->groups,true);
} }
@ -122,7 +122,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
* @since 1.6 * @since 1.6
*/ */
public function getForm($data = array(), $loadData = true) public function getForm($data = array(), $loadData = true)
{ // [9827] Get the form. { // [9865] Get the form.
$form = $this->loadForm('com_sermondistributor.help_document', 'help_document', array('control' => 'jform', 'load_data' => $loadData)); $form = $this->loadForm('com_sermondistributor.help_document', 'help_document', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form)) if (empty($form))
@ -132,12 +132,12 @@ class SermondistributorModelHelp_document extends JModelAdmin
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [9912] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9950] 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')) if ($jinput->get('a_id'))
{ {
$id = $jinput->get('a_id', 0, 'INT'); $id = $jinput->get('a_id', 0, 'INT');
} }
// [9917] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9955] The back end uses id so we use that the rest of the time and set it to 0 by default.
else else
{ {
$id = $jinput->get('id', 0, 'INT'); $id = $jinput->get('id', 0, 'INT');
@ -145,34 +145,34 @@ class SermondistributorModelHelp_document extends JModelAdmin
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9923] Check for existing item. // [9961] Check for existing item.
// [9924] Modify the form based on Edit State access controls. // [9962] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('help_document.edit.state', 'com_sermondistributor.help_document.' . (int) $id)) 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'))) || ($id == 0 && !$user->authorise('help_document.edit.state', 'com_sermondistributor')))
{ {
// [9937] Disable fields for display. // [9975] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9940] Disable fields while saving. // [9978] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9945] Modify the form based on Edit Creaded By access controls. // [9983] Modify the form based on Edit Creaded By access controls.
if (!$user->authorise('core.edit.created_by', 'com_sermondistributor')) if (!$user->authorise('core.edit.created_by', 'com_sermondistributor'))
{ {
// [9957] Disable fields for display. // [9995] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9959] Disable fields for display. // [9997] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9961] Disable fields while saving. // [9999] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9964] Modify the form based on Edit Creaded Date access controls. // [10002] Modify the form based on Edit Creaded Date access controls.
if (!$user->authorise('core.edit.created', 'com_sermondistributor')) if (!$user->authorise('core.edit.created', 'com_sermondistributor'))
{ {
// [9976] Disable fields for display. // [10014] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9978] Disable fields while saving. // [10016] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset'); $form->setFieldAttribute('created', 'filter', 'unset');
} }
@ -208,7 +208,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// [10128] The record has been set. Check the record permissions. // [10166] The record has been set. Check the record permissions.
return $user->authorise('help_document.delete', 'com_sermondistributor.help_document.' . (int) $record->id); return $user->authorise('help_document.delete', 'com_sermondistributor.help_document.' . (int) $record->id);
} }
return false; return false;
@ -230,14 +230,14 @@ class SermondistributorModelHelp_document extends JModelAdmin
if ($recordId) if ($recordId)
{ {
// [10215] The record has been set. Check the record permissions. // [10253] The record has been set. Check the record permissions.
$permission = $user->authorise('help_document.edit.state', 'com_sermondistributor.help_document.' . (int) $recordId); $permission = $user->authorise('help_document.edit.state', 'com_sermondistributor.help_document.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
return false; return false;
} }
} }
// [10232] In the absense of better information, revert to the component permissions. // [10270] In the absense of better information, revert to the component permissions.
return $user->authorise('help_document.edit.state', 'com_sermondistributor'); return $user->authorise('help_document.edit.state', 'com_sermondistributor');
} }
@ -252,7 +252,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
*/ */
protected function allowEdit($data = array(), $key = 'id') protected function allowEdit($data = array(), $key = 'id')
{ {
// [10040] Check specific edit permission then general edit permission. // [10078] Check specific edit permission then general edit permission.
$user = JFactory::getUser(); $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'); 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');
@ -351,20 +351,20 @@ class SermondistributorModelHelp_document extends JModelAdmin
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// [9031] check if the not_required field is set // [9069] check if the not_required field is set
if (SermondistributorHelper::checkString($data['not_required'])) if (SermondistributorHelper::checkString($data['not_required']))
{ {
$requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields); $requiredFields = array_unique($requiredFields);
// [9036] now change the required field attributes value // [9074] now change the required field attributes value
foreach ($requiredFields as $requiredField) foreach ($requiredFields as $requiredField)
{ {
// [9039] make sure there is a string value // [9077] make sure there is a string value
if (SermondistributorHelper::checkString($requiredField)) if (SermondistributorHelper::checkString($requiredField))
{ {
// [9042] change to false // [9080] change to false
$form->setFieldAttribute($requiredField, 'required', 'false'); $form->setFieldAttribute($requiredField, 'required', 'false');
// [9044] also clear the data set // [9082] also clear the data set
$data[$requiredField] = ''; $data[$requiredField] = '';
} }
} }
@ -514,7 +514,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [5188] Set some needed variables. // [5226] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -528,12 +528,12 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false; return false;
} }
// [5208] get list of uniqe fields // [5246] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5210] remove move_copy from array // [5248] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5213] make sure published is set // [5251] make sure published is set
if (!isset($values['published'])) if (!isset($values['published']))
{ {
$values['published'] = 0; $values['published'] = 0;
@ -545,21 +545,21 @@ class SermondistributorModelHelp_document extends JModelAdmin
$newIds = array(); $newIds = array();
// [5250] Parent exists so let's proceed // [5288] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5253] Pop the first ID off the stack // [5291] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5258] only allow copy if user may edit this item. // [5296] only allow copy if user may edit this item.
if (!$this->user->authorise('help_document.edit', $contexts[$pk])) if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
{ {
// [5268] Not fatal error // [5306] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -567,19 +567,19 @@ class SermondistributorModelHelp_document extends JModelAdmin
} }
// [5273] Check that the row actually exists // [5311] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5278] Fatal error // [5316] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5285] Not fatal error // [5323] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
@ -587,7 +587,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
list($this->table->title, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->title); list($this->table->title, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->title);
// [5321] insert all set values // [5359] insert all set values
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
@ -599,7 +599,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
} }
} }
// [5333] update all uniqe fields // [5371] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
foreach ($uniqeFields as $uniqeField) foreach ($uniqeFields as $uniqeField)
@ -608,13 +608,13 @@ class SermondistributorModelHelp_document extends JModelAdmin
} }
} }
// [5342] Reset the ID because we are making a copy // [5380] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5345] TODO: Deal with ordering? // [5383] TODO: Deal with ordering?
// [5346] $this->table->ordering = 1; // [5384] $this->table->ordering = 1;
// [5348] Check the row. // [5386] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -627,7 +627,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5361] Store the row. // [5399] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -635,14 +635,14 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false; return false;
} }
// [5369] Get the new item ID // [5407] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5372] Add the new ID to the array // [5410] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5376] Clean the cache // [5414] Clean the cache
$this->cleanCache(); $this->cleanCache();
return $newIds; return $newIds;
@ -663,7 +663,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [4990] Set some needed variables. // [5028] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -678,15 +678,15 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false; return false;
} }
// [5012] make sure published only updates if user has the permission. // [5050] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('help_document.edit.state')) if (isset($values['published']) && !$this->canDo->get('help_document.edit.state'))
{ {
unset($values['published']); unset($values['published']);
} }
// [5025] remove move_copy from array // [5063] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5046] Parent exists so we proceed // [5084] Parent exists so we proceed
foreach ($pks as $pk) foreach ($pks as $pk)
{ {
if (!$this->user->authorise('help_document.edit', $contexts[$pk])) if (!$this->user->authorise('help_document.edit', $contexts[$pk]))
@ -696,30 +696,30 @@ class SermondistributorModelHelp_document extends JModelAdmin
return false; return false;
} }
// [5063] Check that the row actually exists // [5101] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5068] Fatal error // [5106] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5075] Not fatal error // [5113] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
} }
// [5081] insert all set values. // [5119] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5086] Do special action for access. // [5124] Do special action for access.
if ('access' == $key && strlen($value) > 0) if ('access' == $key && strlen($value) > 0)
{ {
$this->table->$key = $value; $this->table->$key = $value;
@ -732,7 +732,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
} }
// [5098] Check the row. // [5136] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -745,7 +745,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5111] Store the row. // [5149] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -754,7 +754,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
} }
} }
// [5120] Clean the cache // [5158] Clean the cache
$this->cleanCache(); $this->cleanCache();
return true; return true;
@ -784,7 +784,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$data['metadata'] = (string) $metadata; $data['metadata'] = (string) $metadata;
} }
// [4342] Set the groups string to JSON string. // [4380] Set the groups string to JSON string.
if (isset($data['groups'])) if (isset($data['groups']))
{ {
$data['groups'] = (string) json_encode($data['groups']); $data['groups'] = (string) json_encode($data['groups']);
@ -798,7 +798,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$data['params'] = (string) $params; $data['params'] = (string) $params;
} }
// [5402] Alter the title for save as copy // [5440] Alter the title for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
$origTable = clone $this->getTable(); $origTable = clone $this->getTable();
@ -821,7 +821,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
$data['published'] = 0; $data['published'] = 0;
} }
// [5429] Automatic handling of alias for empty fields // [5467] Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0) if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{ {
if ($data['alias'] == null) if ($data['alias'] == null)
@ -852,10 +852,10 @@ class SermondistributorModelHelp_document extends JModelAdmin
} }
} }
// [5468] Alter the uniqe field for save as copy // [5506] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5471] Automatic handling of other uniqe fields // [5509] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
@ -909,7 +909,7 @@ class SermondistributorModelHelp_document extends JModelAdmin
protected function _generateNewTitle($alias, $title) protected function _generateNewTitle($alias, $title)
{ {
// [5502] Alter the title & alias // [5540] Alter the title & alias
$table = $this->getTable(); $table = $this->getTable();
while ($table->load(array('alias' => $alias))) while ($table->load(array('alias' => $alias)))

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage help_documents.php @subpackage help_documents.php
@ -113,16 +113,16 @@ class SermondistributorModelHelp_documents extends JModelList
*/ */
public function getItems() public function getItems()
{ {
// [10801] check in items // [10839] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -133,7 +133,7 @@ class SermondistributorModelHelp_documents extends JModelList
continue; continue;
} }
// [10947] decode groups // [10985] decode groups
$groupsArray = json_decode($item->groups, true); $groupsArray = json_decode($item->groups, true);
if (SermondistributorHelper::checkArray($groupsArray)) if (SermondistributorHelper::checkArray($groupsArray))
{ {
@ -156,14 +156,14 @@ class SermondistributorModelHelp_documents extends JModelList
} }
} }
// [11142] set selection value to a translatable value // [11180] set selection value to a translatable value
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
// [11149] convert type // [11187] convert type
$item->type = $this->selectionTranslation($item->type, 'type'); $item->type = $this->selectionTranslation($item->type, 'type');
// [11149] convert location // [11187] convert location
$item->location = $this->selectionTranslation($item->location, 'location'); $item->location = $this->selectionTranslation($item->location, 'location');
} }
} }
@ -180,7 +180,7 @@ class SermondistributorModelHelp_documents extends JModelList
*/ */
public function selectionTranslation($value,$name) public function selectionTranslation($value,$name)
{ {
// [11175] Array of type language strings // [11213] Array of type language strings
if ($name == 'type') if ($name == 'type')
{ {
$typeArray = array( $typeArray = array(
@ -189,20 +189,20 @@ class SermondistributorModelHelp_documents extends JModelList
2 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TEXT', 2 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_TEXT',
3 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL' 3 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_URL'
); );
// [11206] Now check if value is found in this array // [11244] Now check if value is found in this array
if (isset($typeArray[$value]) && SermondistributorHelper::checkString($typeArray[$value])) if (isset($typeArray[$value]) && SermondistributorHelper::checkString($typeArray[$value]))
{ {
return $typeArray[$value]; return $typeArray[$value];
} }
} }
// [11175] Array of location language strings // [11213] Array of location language strings
if ($name == 'location') if ($name == 'location')
{ {
$locationArray = array( $locationArray = array(
1 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN', 1 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_ADMIN',
2 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SITE' 2 => 'COM_SERMONDISTRIBUTOR_HELP_DOCUMENT_SITE'
); );
// [11206] Now check if value is found in this array // [11244] Now check if value is found in this array
if (isset($locationArray[$value]) && SermondistributorHelper::checkString($locationArray[$value])) if (isset($locationArray[$value]) && SermondistributorHelper::checkString($locationArray[$value]))
{ {
return $locationArray[$value]; return $locationArray[$value];
@ -218,19 +218,19 @@ class SermondistributorModelHelp_documents extends JModelList
*/ */
protected function getListQuery() protected function getListQuery()
{ {
// [7658] Get the user object. // [7696] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7660] Create a new query object. // [7698] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7663] Select some fields // [7701] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7670] From the sermondistributor_item table // [7708] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_help_document', 'a')); $query->from($db->quoteName('#__sermondistributor_help_document', 'a'));
// [7684] Filter by published state // [7722] Filter by published state
$published = $this->getState('filter.published'); $published = $this->getState('filter.published');
if (is_numeric($published)) if (is_numeric($published))
{ {
@ -241,21 +241,21 @@ class SermondistributorModelHelp_documents extends JModelList
$query->where('(a.published = 0 OR a.published = 1)'); $query->where('(a.published = 0 OR a.published = 1)');
} }
// [7696] Join over the asset groups. // [7734] Join over the asset groups.
$query->select('ag.title AS access_level'); $query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [7699] Filter by access level. // [7737] Filter by access level.
if ($access = $this->getState('filter.access')) if ($access = $this->getState('filter.access'))
{ {
$query->where('a.access = ' . (int) $access); $query->where('a.access = ' . (int) $access);
} }
// [7704] Implement View Level Access // [7742] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7781] Filter by search. // [7819] Filter by search.
$search = $this->getState('filter.search'); $search = $this->getState('filter.search');
if (!empty($search)) if (!empty($search))
{ {
@ -270,28 +270,28 @@ class SermondistributorModelHelp_documents extends JModelList
} }
} }
// [8024] Filter by Type. // [8062] Filter by Type.
if ($type = $this->getState('filter.type')) if ($type = $this->getState('filter.type'))
{ {
$query->where('a.type = ' . $db->quote($db->escape($type, true))); $query->where('a.type = ' . $db->quote($db->escape($type, true)));
} }
// [8024] Filter by Location. // [8062] Filter by Location.
if ($location = $this->getState('filter.location')) if ($location = $this->getState('filter.location'))
{ {
$query->where('a.location = ' . $db->quote($db->escape($location, true))); $query->where('a.location = ' . $db->quote($db->escape($location, true)));
} }
// [8024] Filter by Admin_view. // [8062] Filter by Admin_view.
if ($admin_view = $this->getState('filter.admin_view')) if ($admin_view = $this->getState('filter.admin_view'))
{ {
$query->where('a.admin_view = ' . $db->quote($db->escape($admin_view, true))); $query->where('a.admin_view = ' . $db->quote($db->escape($admin_view, true)));
} }
// [8024] Filter by Site_view. // [8062] Filter by Site_view.
if ($site_view = $this->getState('filter.site_view')) if ($site_view = $this->getState('filter.site_view'))
{ {
$query->where('a.site_view = ' . $db->quote($db->escape($site_view, true))); $query->where('a.site_view = ' . $db->quote($db->escape($site_view, true)));
} }
// [7740] Add the list ordering clause. // [7778] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '') if ($orderCol != '')
@ -309,42 +309,42 @@ class SermondistributorModelHelp_documents extends JModelList
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// [7448] setup the query // [7486] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7451] Get the user object. // [7489] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7453] Create a new query object. // [7491] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7456] Select some fields // [7494] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7458] From the sermondistributor_help_document table // [7496] From the sermondistributor_help_document table
$query->from($db->quoteName('#__sermondistributor_help_document', 'a')); $query->from($db->quoteName('#__sermondistributor_help_document', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')'); $query->where('a.id IN (' . implode(',',$pks) . ')');
// [7468] Implement View Level Access // [7506] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7475] Order the results by ordering // [7513] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7477] Load the items // [7515] Load the items
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
$items = $db->loadObjectList(); $items = $db->loadObjectList();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -355,13 +355,13 @@ class SermondistributorModelHelp_documents extends JModelList
continue; continue;
} }
// [11089] unset the values we don't want exported. // [11127] unset the values we don't want exported.
unset($item->asset_id); unset($item->asset_id);
unset($item->checked_out); unset($item->checked_out);
unset($item->checked_out_time); unset($item->checked_out_time);
} }
} }
// [11098] Add headers to items array. // [11136] Add headers to items array.
$headers = $this->getExImPortHeaders(); $headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
@ -380,13 +380,13 @@ class SermondistributorModelHelp_documents extends JModelList
*/ */
public function getExImPortHeaders() public function getExImPortHeaders()
{ {
// [7497] Get a db connection. // [7535] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7499] get the columns // [7537] get the columns
$columns = $db->getTableColumns("#__sermondistributor_help_document"); $columns = $db->getTableColumns("#__sermondistributor_help_document");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7503] remove the headers you don't import/export. // [7541] remove the headers you don't import/export.
unset($columns['asset_id']); unset($columns['asset_id']);
unset($columns['checked_out']); unset($columns['checked_out']);
unset($columns['checked_out_time']); unset($columns['checked_out_time']);
@ -408,7 +408,7 @@ class SermondistributorModelHelp_documents extends JModelList
*/ */
protected function getStoreId($id = '') protected function getStoreId($id = '')
{ {
// [10424] Compile the store id. // [10462] Compile the store id.
$id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published'); $id .= ':' . $this->getState('filter.published');
@ -432,15 +432,15 @@ class SermondistributorModelHelp_documents extends JModelList
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// [10817] Get set check in time // [10855] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in'); $time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time) if ($time)
{ {
// [10822] Get a db connection. // [10860] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10824] reset query // [10862] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select('*'); $query->select('*');
$query->from($db->quoteName('#__sermondistributor_help_document')); $query->from($db->quoteName('#__sermondistributor_help_document'));
@ -448,24 +448,24 @@ class SermondistributorModelHelp_documents extends JModelList
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
// [10832] Get Yesterdays date // [10870] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10834] reset query // [10872] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10836] Fields to update. // [10874] Fields to update.
$fields = array( $fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0' $db->quoteName('checked_out') . '=0'
); );
// [10841] Conditions for which records should be updated. // [10879] Conditions for which records should be updated.
$conditions = array( $conditions = array(
$db->quoteName('checked_out') . '!=0', $db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\'' $db->quoteName('checked_out_time') . '<\''.$date.'\''
); );
// [10846] Check table // [10884] Check table
$query->update($db->quoteName('#__sermondistributor_help_document'))->set($fields)->where($conditions); $query->update($db->quoteName('#__sermondistributor_help_document'))->set($fields)->where($conditions);
$db->setQuery($query); $db->setQuery($query);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage import.php @subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage preacher.php @subpackage preacher.php
@ -101,7 +101,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$item->tags->getTagIds($item->id, 'com_sermondistributor.preacher'); $item->tags->getTagIds($item->id, 'com_sermondistributor.preacher');
} }
} }
$this->preachertzre = $item->id; $this->preacherkzna = $item->id;
return $item; return $item;
} }
@ -111,74 +111,74 @@ class SermondistributorModelPreacher extends JModelAdmin
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getFyusermons() public function getBzfsermons()
{ {
// [7206] Get the user object. // [7244] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7208] Create a new query object. // [7246] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7211] Select some fields // [7249] Select some fields
$query->select('a.*'); $query->select('a.*');
$query->select($db->quoteName('c.title','category_title')); $query->select($db->quoteName('c.title','category_title'));
// [7218] From the sermondistributor_sermon table // [7256] From the sermondistributor_sermon table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a')); $query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')'); $query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
// [7811] From the sermondistributor_preacher table. // [7849] From the sermondistributor_preacher table.
$query->select($db->quoteName('g.name','preacher_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'g') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('g.id') . ')');
// [7811] From the sermondistributor_series table. // [7849] From the sermondistributor_series table.
$query->select($db->quoteName('h.name','series_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'h') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('h.id') . ')');
// [7234] Filter by preachertzre global. // [7272] Filter by preacherkzna global.
$preachertzre = $this->preachertzre; $preacherkzna = $this->preacherkzna;
if (is_numeric($preachertzre )) if (is_numeric($preacherkzna ))
{ {
$query->where('a.preacher = ' . (int) $preachertzre ); $query->where('a.preacher = ' . (int) $preacherkzna );
} }
elseif (is_string($preachertzre)) elseif (is_string($preacherkzna))
{ {
$query->where('a.preacher = ' . $db->quote($preachertzre)); $query->where('a.preacher = ' . $db->quote($preacherkzna));
} }
else else
{ {
$query->where('a.preacher = -5'); $query->where('a.preacher = -5');
} }
// [7251] Join over the asset groups. // [7289] Join over the asset groups.
$query->select('ag.title AS access_level'); $query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [7254] Filter by access level. // [7292] Filter by access level.
if ($access = $this->getState('filter.access')) if ($access = $this->getState('filter.access'))
{ {
$query->where('a.access = ' . (int) $access); $query->where('a.access = ' . (int) $access);
} }
// [7259] Implement View Level Access // [7297] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7266] Order the results by ordering // [7304] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7268] Load the items // [7306] Load the items
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
$items = $db->loadObjectList(); $items = $db->loadObjectList();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -192,15 +192,15 @@ class SermondistributorModelPreacher extends JModelAdmin
} }
} }
// [11142] set selection value to a translatable value // [11180] set selection value to a translatable value
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
// [11149] convert link_type // [11187] convert link_type
$item->link_type = $this->selectionTranslationFyusermons($item->link_type, 'link_type'); $item->link_type = $this->selectionTranslationBzfsermons($item->link_type, 'link_type');
// [11149] convert source // [11187] convert source
$item->source = $this->selectionTranslationFyusermons($item->source, 'source'); $item->source = $this->selectionTranslationBzfsermons($item->source, 'source');
} }
} }
@ -214,22 +214,22 @@ class SermondistributorModelPreacher extends JModelAdmin
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslationFyusermons($value,$name) public function selectionTranslationBzfsermons($value,$name)
{ {
// [11175] Array of link_type language strings // [11213] Array of link_type language strings
if ($name == 'link_type') if ($name == 'link_type')
{ {
$link_typeArray = array( $link_typeArray = array(
1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED', 1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED',
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT' 2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT'
); );
// [11206] Now check if value is found in this array // [11244] Now check if value is found in this array
if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value])) if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value]))
{ {
return $link_typeArray[$value]; return $link_typeArray[$value];
} }
} }
// [11175] Array of source language strings // [11213] Array of source language strings
if ($name == 'source') if ($name == 'source')
{ {
$sourceArray = array( $sourceArray = array(
@ -238,7 +238,7 @@ class SermondistributorModelPreacher extends JModelAdmin
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX', 2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX',
3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL' 3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL'
); );
// [11206] Now check if value is found in this array // [11244] Now check if value is found in this array
if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value])) if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value]))
{ {
return $sourceArray[$value]; return $sourceArray[$value];
@ -258,7 +258,7 @@ class SermondistributorModelPreacher extends JModelAdmin
* @since 1.6 * @since 1.6
*/ */
public function getForm($data = array(), $loadData = true) public function getForm($data = array(), $loadData = true)
{ // [9827] Get the form. { // [9865] Get the form.
$form = $this->loadForm('com_sermondistributor.preacher', 'preacher', array('control' => 'jform', 'load_data' => $loadData)); $form = $this->loadForm('com_sermondistributor.preacher', 'preacher', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form)) if (empty($form))
@ -268,12 +268,12 @@ class SermondistributorModelPreacher extends JModelAdmin
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [9912] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9950] 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')) if ($jinput->get('a_id'))
{ {
$id = $jinput->get('a_id', 0, 'INT'); $id = $jinput->get('a_id', 0, 'INT');
} }
// [9917] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9955] The back end uses id so we use that the rest of the time and set it to 0 by default.
else else
{ {
$id = $jinput->get('id', 0, 'INT'); $id = $jinput->get('id', 0, 'INT');
@ -281,36 +281,36 @@ class SermondistributorModelPreacher extends JModelAdmin
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9923] Check for existing item. // [9961] Check for existing item.
// [9924] Modify the form based on Edit State access controls. // [9962] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('preacher.edit.state', 'com_sermondistributor.preacher.' . (int) $id)) if ($id != 0 && (!$user->authorise('preacher.edit.state', 'com_sermondistributor.preacher.' . (int) $id))
|| ($id == 0 && !$user->authorise('preacher.edit.state', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('preacher.edit.state', 'com_sermondistributor')))
{ {
// [9937] Disable fields for display. // [9975] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9940] Disable fields while saving. // [9978] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9945] Modify the form based on Edit Creaded By access controls. // [9983] Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('preacher.edit.created_by', 'com_sermondistributor.preacher.' . (int) $id)) if ($id != 0 && (!$user->authorise('preacher.edit.created_by', 'com_sermondistributor.preacher.' . (int) $id))
|| ($id == 0 && !$user->authorise('preacher.edit.created_by', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('preacher.edit.created_by', 'com_sermondistributor')))
{ {
// [9957] Disable fields for display. // [9995] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9959] Disable fields for display. // [9997] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9961] Disable fields while saving. // [9999] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9964] Modify the form based on Edit Creaded Date access controls. // [10002] Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('preacher.edit.created', 'com_sermondistributor.preacher.' . (int) $id)) if ($id != 0 && (!$user->authorise('preacher.edit.created', 'com_sermondistributor.preacher.' . (int) $id))
|| ($id == 0 && !$user->authorise('preacher.edit.created', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('preacher.edit.created', 'com_sermondistributor')))
{ {
// [9976] Disable fields for display. // [10014] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9978] Disable fields while saving. // [10016] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset'); $form->setFieldAttribute('created', 'filter', 'unset');
} }
@ -346,7 +346,7 @@ class SermondistributorModelPreacher extends JModelAdmin
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// [10128] The record has been set. Check the record permissions. // [10166] The record has been set. Check the record permissions.
return $user->authorise('preacher.delete', 'com_sermondistributor.preacher.' . (int) $record->id); return $user->authorise('preacher.delete', 'com_sermondistributor.preacher.' . (int) $record->id);
} }
return false; return false;
@ -368,14 +368,14 @@ class SermondistributorModelPreacher extends JModelAdmin
if ($recordId) if ($recordId)
{ {
// [10215] The record has been set. Check the record permissions. // [10253] The record has been set. Check the record permissions.
$permission = $user->authorise('preacher.edit.state', 'com_sermondistributor.preacher.' . (int) $recordId); $permission = $user->authorise('preacher.edit.state', 'com_sermondistributor.preacher.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
return false; return false;
} }
} }
// [10232] In the absense of better information, revert to the component permissions. // [10270] In the absense of better information, revert to the component permissions.
return $user->authorise('preacher.edit.state', 'com_sermondistributor'); return $user->authorise('preacher.edit.state', 'com_sermondistributor');
} }
@ -390,7 +390,7 @@ class SermondistributorModelPreacher extends JModelAdmin
*/ */
protected function allowEdit($data = array(), $key = 'id') protected function allowEdit($data = array(), $key = 'id')
{ {
// [10040] Check specific edit permission then general edit permission. // [10078] Check specific edit permission then general edit permission.
$user = JFactory::getUser(); $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'); return $user->authorise('preacher.edit', 'com_sermondistributor.preacher.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('preacher.edit', 'com_sermondistributor');
@ -616,7 +616,7 @@ class SermondistributorModelPreacher extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [5188] Set some needed variables. // [5226] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -630,12 +630,12 @@ class SermondistributorModelPreacher extends JModelAdmin
return false; return false;
} }
// [5208] get list of uniqe fields // [5246] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5210] remove move_copy from array // [5248] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5213] make sure published is set // [5251] make sure published is set
if (!isset($values['published'])) if (!isset($values['published']))
{ {
$values['published'] = 0; $values['published'] = 0;
@ -647,21 +647,21 @@ class SermondistributorModelPreacher extends JModelAdmin
$newIds = array(); $newIds = array();
// [5250] Parent exists so let's proceed // [5288] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5253] Pop the first ID off the stack // [5291] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5258] only allow copy if user may edit this item. // [5296] only allow copy if user may edit this item.
if (!$this->user->authorise('preacher.edit', $contexts[$pk])) if (!$this->user->authorise('preacher.edit', $contexts[$pk]))
{ {
// [5268] Not fatal error // [5306] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -669,19 +669,19 @@ class SermondistributorModelPreacher extends JModelAdmin
} }
// [5273] Check that the row actually exists // [5311] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5278] Fatal error // [5316] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5285] Not fatal error // [5323] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
@ -689,7 +689,7 @@ class SermondistributorModelPreacher extends JModelAdmin
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name); list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// [5321] insert all set values // [5359] insert all set values
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
@ -701,7 +701,7 @@ class SermondistributorModelPreacher extends JModelAdmin
} }
} }
// [5333] update all uniqe fields // [5371] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
foreach ($uniqeFields as $uniqeField) foreach ($uniqeFields as $uniqeField)
@ -710,13 +710,13 @@ class SermondistributorModelPreacher extends JModelAdmin
} }
} }
// [5342] Reset the ID because we are making a copy // [5380] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5345] TODO: Deal with ordering? // [5383] TODO: Deal with ordering?
// [5346] $this->table->ordering = 1; // [5384] $this->table->ordering = 1;
// [5348] Check the row. // [5386] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -729,7 +729,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5361] Store the row. // [5399] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -737,14 +737,14 @@ class SermondistributorModelPreacher extends JModelAdmin
return false; return false;
} }
// [5369] Get the new item ID // [5407] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5372] Add the new ID to the array // [5410] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5376] Clean the cache // [5414] Clean the cache
$this->cleanCache(); $this->cleanCache();
return $newIds; return $newIds;
@ -765,7 +765,7 @@ class SermondistributorModelPreacher extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [4990] Set some needed variables. // [5028] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -780,15 +780,15 @@ class SermondistributorModelPreacher extends JModelAdmin
return false; return false;
} }
// [5012] make sure published only updates if user has the permission. // [5050] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('preacher.edit.state')) if (isset($values['published']) && !$this->canDo->get('preacher.edit.state'))
{ {
unset($values['published']); unset($values['published']);
} }
// [5025] remove move_copy from array // [5063] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5046] Parent exists so we proceed // [5084] Parent exists so we proceed
foreach ($pks as $pk) foreach ($pks as $pk)
{ {
if (!$this->user->authorise('preacher.edit', $contexts[$pk])) if (!$this->user->authorise('preacher.edit', $contexts[$pk]))
@ -798,30 +798,30 @@ class SermondistributorModelPreacher extends JModelAdmin
return false; return false;
} }
// [5063] Check that the row actually exists // [5101] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5068] Fatal error // [5106] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5075] Not fatal error // [5113] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
} }
// [5081] insert all set values. // [5119] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5086] Do special action for access. // [5124] Do special action for access.
if ('access' == $key && strlen($value) > 0) if ('access' == $key && strlen($value) > 0)
{ {
$this->table->$key = $value; $this->table->$key = $value;
@ -834,7 +834,7 @@ class SermondistributorModelPreacher extends JModelAdmin
} }
// [5098] Check the row. // [5136] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -847,7 +847,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5111] Store the row. // [5149] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -856,7 +856,7 @@ class SermondistributorModelPreacher extends JModelAdmin
} }
} }
// [5120] Clean the cache // [5158] Clean the cache
$this->cleanCache(); $this->cleanCache();
return true; return true;
@ -894,7 +894,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$data['params'] = (string) $params; $data['params'] = (string) $params;
} }
// [5402] Alter the name for save as copy // [5440] Alter the name for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
$origTable = clone $this->getTable(); $origTable = clone $this->getTable();
@ -917,7 +917,7 @@ class SermondistributorModelPreacher extends JModelAdmin
$data['published'] = 0; $data['published'] = 0;
} }
// [5429] Automatic handling of alias for empty fields // [5467] Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0) if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{ {
if ($data['alias'] == null) if ($data['alias'] == null)
@ -948,10 +948,10 @@ class SermondistributorModelPreacher extends JModelAdmin
} }
} }
// [5468] Alter the uniqe field for save as copy // [5506] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5471] Automatic handling of other uniqe fields // [5509] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
@ -1005,7 +1005,7 @@ class SermondistributorModelPreacher extends JModelAdmin
protected function _generateNewTitle($alias, $title) protected function _generateNewTitle($alias, $title)
{ {
// [5502] Alter the title & alias // [5540] Alter the title & alias
$table = $this->getTable(); $table = $this->getTable();
while ($table->load(array('alias' => $alias))) while ($table->load(array('alias' => $alias)))

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage preachers.php @subpackage preachers.php
@ -101,16 +101,16 @@ class SermondistributorModelPreachers extends JModelList
*/ */
public function getItems() public function getItems()
{ {
// [10801] check in items // [10839] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -135,19 +135,19 @@ class SermondistributorModelPreachers extends JModelList
*/ */
protected function getListQuery() protected function getListQuery()
{ {
// [7658] Get the user object. // [7696] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7660] Create a new query object. // [7698] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7663] Select some fields // [7701] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7670] From the sermondistributor_item table // [7708] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_preacher', 'a')); $query->from($db->quoteName('#__sermondistributor_preacher', 'a'));
// [7684] Filter by published state // [7722] Filter by published state
$published = $this->getState('filter.published'); $published = $this->getState('filter.published');
if (is_numeric($published)) if (is_numeric($published))
{ {
@ -158,21 +158,21 @@ class SermondistributorModelPreachers extends JModelList
$query->where('(a.published = 0 OR a.published = 1)'); $query->where('(a.published = 0 OR a.published = 1)');
} }
// [7696] Join over the asset groups. // [7734] Join over the asset groups.
$query->select('ag.title AS access_level'); $query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [7699] Filter by access level. // [7737] Filter by access level.
if ($access = $this->getState('filter.access')) if ($access = $this->getState('filter.access'))
{ {
$query->where('a.access = ' . (int) $access); $query->where('a.access = ' . (int) $access);
} }
// [7704] Implement View Level Access // [7742] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7781] Filter by search. // [7819] Filter by search.
$search = $this->getState('filter.search'); $search = $this->getState('filter.search');
if (!empty($search)) if (!empty($search))
{ {
@ -188,7 +188,7 @@ class SermondistributorModelPreachers extends JModelList
} }
// [7740] Add the list ordering clause. // [7778] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '') if ($orderCol != '')
@ -206,42 +206,42 @@ class SermondistributorModelPreachers extends JModelList
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// [7448] setup the query // [7486] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7451] Get the user object. // [7489] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7453] Create a new query object. // [7491] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7456] Select some fields // [7494] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7458] From the sermondistributor_preacher table // [7496] From the sermondistributor_preacher table
$query->from($db->quoteName('#__sermondistributor_preacher', 'a')); $query->from($db->quoteName('#__sermondistributor_preacher', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')'); $query->where('a.id IN (' . implode(',',$pks) . ')');
// [7468] Implement View Level Access // [7506] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7475] Order the results by ordering // [7513] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7477] Load the items // [7515] Load the items
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
$items = $db->loadObjectList(); $items = $db->loadObjectList();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -252,13 +252,13 @@ class SermondistributorModelPreachers extends JModelList
continue; continue;
} }
// [11089] unset the values we don't want exported. // [11127] unset the values we don't want exported.
unset($item->asset_id); unset($item->asset_id);
unset($item->checked_out); unset($item->checked_out);
unset($item->checked_out_time); unset($item->checked_out_time);
} }
} }
// [11098] Add headers to items array. // [11136] Add headers to items array.
$headers = $this->getExImPortHeaders(); $headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
@ -277,13 +277,13 @@ class SermondistributorModelPreachers extends JModelList
*/ */
public function getExImPortHeaders() public function getExImPortHeaders()
{ {
// [7497] Get a db connection. // [7535] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7499] get the columns // [7537] get the columns
$columns = $db->getTableColumns("#__sermondistributor_preacher"); $columns = $db->getTableColumns("#__sermondistributor_preacher");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7503] remove the headers you don't import/export. // [7541] remove the headers you don't import/export.
unset($columns['asset_id']); unset($columns['asset_id']);
unset($columns['checked_out']); unset($columns['checked_out']);
unset($columns['checked_out_time']); unset($columns['checked_out_time']);
@ -305,7 +305,7 @@ class SermondistributorModelPreachers extends JModelList
*/ */
protected function getStoreId($id = '') protected function getStoreId($id = '')
{ {
// [10424] Compile the store id. // [10462] Compile the store id.
$id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published'); $id .= ':' . $this->getState('filter.published');
@ -326,15 +326,15 @@ class SermondistributorModelPreachers extends JModelList
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// [10817] Get set check in time // [10855] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in'); $time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time) if ($time)
{ {
// [10822] Get a db connection. // [10860] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10824] reset query // [10862] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select('*'); $query->select('*');
$query->from($db->quoteName('#__sermondistributor_preacher')); $query->from($db->quoteName('#__sermondistributor_preacher'));
@ -342,24 +342,24 @@ class SermondistributorModelPreachers extends JModelList
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
// [10832] Get Yesterdays date // [10870] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10834] reset query // [10872] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10836] Fields to update. // [10874] Fields to update.
$fields = array( $fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0' $db->quoteName('checked_out') . '=0'
); );
// [10841] Conditions for which records should be updated. // [10879] Conditions for which records should be updated.
$conditions = array( $conditions = array(
$db->quoteName('checked_out') . '!=0', $db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\'' $db->quoteName('checked_out_time') . '<\''.$date.'\''
); );
// [10846] Check table // [10884] Check table
$query->update($db->quoteName('#__sermondistributor_preacher'))->set($fields)->where($conditions); $query->update($db->quoteName('#__sermondistributor_preacher'))->set($fields)->where($conditions);
$db->setQuery($query); $db->setQuery($query);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage series.php @subpackage series.php
@ -101,7 +101,7 @@ class SermondistributorModelSeries extends JModelAdmin
$item->tags->getTagIds($item->id, 'com_sermondistributor.series'); $item->tags->getTagIds($item->id, 'com_sermondistributor.series');
} }
} }
$this->serieslsom = $item->id; $this->seriestwqr = $item->id;
return $item; return $item;
} }
@ -111,74 +111,74 @@ class SermondistributorModelSeries extends JModelAdmin
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getEtssermons() public function getBxtsermons()
{ {
// [7206] Get the user object. // [7244] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7208] Create a new query object. // [7246] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7211] Select some fields // [7249] Select some fields
$query->select('a.*'); $query->select('a.*');
$query->select($db->quoteName('c.title','category_title')); $query->select($db->quoteName('c.title','category_title'));
// [7218] From the sermondistributor_sermon table // [7256] From the sermondistributor_sermon table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a')); $query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')'); $query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
// [7811] From the sermondistributor_preacher table. // [7849] From the sermondistributor_preacher table.
$query->select($db->quoteName('g.name','preacher_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'g') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('g.id') . ')');
// [7811] From the sermondistributor_series table. // [7849] From the sermondistributor_series table.
$query->select($db->quoteName('h.name','series_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'h') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('h.id') . ')');
// [7234] Filter by serieslsom global. // [7272] Filter by seriestwqr global.
$serieslsom = $this->serieslsom; $seriestwqr = $this->seriestwqr;
if (is_numeric($serieslsom )) if (is_numeric($seriestwqr ))
{ {
$query->where('a.series = ' . (int) $serieslsom ); $query->where('a.series = ' . (int) $seriestwqr );
} }
elseif (is_string($serieslsom)) elseif (is_string($seriestwqr))
{ {
$query->where('a.series = ' . $db->quote($serieslsom)); $query->where('a.series = ' . $db->quote($seriestwqr));
} }
else else
{ {
$query->where('a.series = -5'); $query->where('a.series = -5');
} }
// [7251] Join over the asset groups. // [7289] Join over the asset groups.
$query->select('ag.title AS access_level'); $query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [7254] Filter by access level. // [7292] Filter by access level.
if ($access = $this->getState('filter.access')) if ($access = $this->getState('filter.access'))
{ {
$query->where('a.access = ' . (int) $access); $query->where('a.access = ' . (int) $access);
} }
// [7259] Implement View Level Access // [7297] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7266] Order the results by ordering // [7304] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7268] Load the items // [7306] Load the items
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
$items = $db->loadObjectList(); $items = $db->loadObjectList();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -192,15 +192,15 @@ class SermondistributorModelSeries extends JModelAdmin
} }
} }
// [11142] set selection value to a translatable value // [11180] set selection value to a translatable value
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
// [11149] convert link_type // [11187] convert link_type
$item->link_type = $this->selectionTranslationEtssermons($item->link_type, 'link_type'); $item->link_type = $this->selectionTranslationBxtsermons($item->link_type, 'link_type');
// [11149] convert source // [11187] convert source
$item->source = $this->selectionTranslationEtssermons($item->source, 'source'); $item->source = $this->selectionTranslationBxtsermons($item->source, 'source');
} }
} }
@ -214,22 +214,22 @@ class SermondistributorModelSeries extends JModelAdmin
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslationEtssermons($value,$name) public function selectionTranslationBxtsermons($value,$name)
{ {
// [11175] Array of link_type language strings // [11213] Array of link_type language strings
if ($name == 'link_type') if ($name == 'link_type')
{ {
$link_typeArray = array( $link_typeArray = array(
1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED', 1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED',
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT' 2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT'
); );
// [11206] Now check if value is found in this array // [11244] Now check if value is found in this array
if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value])) if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value]))
{ {
return $link_typeArray[$value]; return $link_typeArray[$value];
} }
} }
// [11175] Array of source language strings // [11213] Array of source language strings
if ($name == 'source') if ($name == 'source')
{ {
$sourceArray = array( $sourceArray = array(
@ -238,7 +238,7 @@ class SermondistributorModelSeries extends JModelAdmin
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX', 2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX',
3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL' 3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL'
); );
// [11206] Now check if value is found in this array // [11244] Now check if value is found in this array
if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value])) if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value]))
{ {
return $sourceArray[$value]; return $sourceArray[$value];
@ -258,7 +258,7 @@ class SermondistributorModelSeries extends JModelAdmin
* @since 1.6 * @since 1.6
*/ */
public function getForm($data = array(), $loadData = true) public function getForm($data = array(), $loadData = true)
{ // [9827] Get the form. { // [9865] Get the form.
$form = $this->loadForm('com_sermondistributor.series', 'series', array('control' => 'jform', 'load_data' => $loadData)); $form = $this->loadForm('com_sermondistributor.series', 'series', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form)) if (empty($form))
@ -268,12 +268,12 @@ class SermondistributorModelSeries extends JModelAdmin
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [9912] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9950] 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')) if ($jinput->get('a_id'))
{ {
$id = $jinput->get('a_id', 0, 'INT'); $id = $jinput->get('a_id', 0, 'INT');
} }
// [9917] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9955] The back end uses id so we use that the rest of the time and set it to 0 by default.
else else
{ {
$id = $jinput->get('id', 0, 'INT'); $id = $jinput->get('id', 0, 'INT');
@ -281,36 +281,36 @@ class SermondistributorModelSeries extends JModelAdmin
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9923] Check for existing item. // [9961] Check for existing item.
// [9924] Modify the form based on Edit State access controls. // [9962] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('series.edit.state', 'com_sermondistributor.series.' . (int) $id)) if ($id != 0 && (!$user->authorise('series.edit.state', 'com_sermondistributor.series.' . (int) $id))
|| ($id == 0 && !$user->authorise('series.edit.state', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('series.edit.state', 'com_sermondistributor')))
{ {
// [9937] Disable fields for display. // [9975] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9940] Disable fields while saving. // [9978] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9945] Modify the form based on Edit Creaded By access controls. // [9983] Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('series.edit.created_by', 'com_sermondistributor.series.' . (int) $id)) if ($id != 0 && (!$user->authorise('series.edit.created_by', 'com_sermondistributor.series.' . (int) $id))
|| ($id == 0 && !$user->authorise('series.edit.created_by', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('series.edit.created_by', 'com_sermondistributor')))
{ {
// [9957] Disable fields for display. // [9995] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9959] Disable fields for display. // [9997] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9961] Disable fields while saving. // [9999] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9964] Modify the form based on Edit Creaded Date access controls. // [10002] Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('series.edit.created', 'com_sermondistributor.series.' . (int) $id)) if ($id != 0 && (!$user->authorise('series.edit.created', 'com_sermondistributor.series.' . (int) $id))
|| ($id == 0 && !$user->authorise('series.edit.created', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('series.edit.created', 'com_sermondistributor')))
{ {
// [9976] Disable fields for display. // [10014] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9978] Disable fields while saving. // [10016] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset'); $form->setFieldAttribute('created', 'filter', 'unset');
} }
@ -346,7 +346,7 @@ class SermondistributorModelSeries extends JModelAdmin
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// [10128] The record has been set. Check the record permissions. // [10166] The record has been set. Check the record permissions.
return $user->authorise('series.delete', 'com_sermondistributor.series.' . (int) $record->id); return $user->authorise('series.delete', 'com_sermondistributor.series.' . (int) $record->id);
} }
return false; return false;
@ -368,14 +368,14 @@ class SermondistributorModelSeries extends JModelAdmin
if ($recordId) if ($recordId)
{ {
// [10215] The record has been set. Check the record permissions. // [10253] The record has been set. Check the record permissions.
$permission = $user->authorise('series.edit.state', 'com_sermondistributor.series.' . (int) $recordId); $permission = $user->authorise('series.edit.state', 'com_sermondistributor.series.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
return false; return false;
} }
} }
// [10232] In the absense of better information, revert to the component permissions. // [10270] In the absense of better information, revert to the component permissions.
return $user->authorise('series.edit.state', 'com_sermondistributor'); return $user->authorise('series.edit.state', 'com_sermondistributor');
} }
@ -390,7 +390,7 @@ class SermondistributorModelSeries extends JModelAdmin
*/ */
protected function allowEdit($data = array(), $key = 'id') protected function allowEdit($data = array(), $key = 'id')
{ {
// [10040] Check specific edit permission then general edit permission. // [10078] Check specific edit permission then general edit permission.
$user = JFactory::getUser(); $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'); return $user->authorise('series.edit', 'com_sermondistributor.series.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('series.edit', 'com_sermondistributor');
@ -616,7 +616,7 @@ class SermondistributorModelSeries extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [5188] Set some needed variables. // [5226] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -630,12 +630,12 @@ class SermondistributorModelSeries extends JModelAdmin
return false; return false;
} }
// [5208] get list of uniqe fields // [5246] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5210] remove move_copy from array // [5248] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5213] make sure published is set // [5251] make sure published is set
if (!isset($values['published'])) if (!isset($values['published']))
{ {
$values['published'] = 0; $values['published'] = 0;
@ -647,21 +647,21 @@ class SermondistributorModelSeries extends JModelAdmin
$newIds = array(); $newIds = array();
// [5250] Parent exists so let's proceed // [5288] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5253] Pop the first ID off the stack // [5291] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5258] only allow copy if user may edit this item. // [5296] only allow copy if user may edit this item.
if (!$this->user->authorise('series.edit', $contexts[$pk])) if (!$this->user->authorise('series.edit', $contexts[$pk]))
{ {
// [5268] Not fatal error // [5306] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -669,19 +669,19 @@ class SermondistributorModelSeries extends JModelAdmin
} }
// [5273] Check that the row actually exists // [5311] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5278] Fatal error // [5316] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5285] Not fatal error // [5323] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
@ -689,7 +689,7 @@ class SermondistributorModelSeries extends JModelAdmin
list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name); list($this->table->name, $this->table->alias) = $this->_generateNewTitle($this->table->alias, $this->table->name);
// [5321] insert all set values // [5359] insert all set values
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
@ -701,7 +701,7 @@ class SermondistributorModelSeries extends JModelAdmin
} }
} }
// [5333] update all uniqe fields // [5371] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
foreach ($uniqeFields as $uniqeField) foreach ($uniqeFields as $uniqeField)
@ -710,13 +710,13 @@ class SermondistributorModelSeries extends JModelAdmin
} }
} }
// [5342] Reset the ID because we are making a copy // [5380] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5345] TODO: Deal with ordering? // [5383] TODO: Deal with ordering?
// [5346] $this->table->ordering = 1; // [5384] $this->table->ordering = 1;
// [5348] Check the row. // [5386] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -729,7 +729,7 @@ class SermondistributorModelSeries extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5361] Store the row. // [5399] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -737,14 +737,14 @@ class SermondistributorModelSeries extends JModelAdmin
return false; return false;
} }
// [5369] Get the new item ID // [5407] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5372] Add the new ID to the array // [5410] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5376] Clean the cache // [5414] Clean the cache
$this->cleanCache(); $this->cleanCache();
return $newIds; return $newIds;
@ -765,7 +765,7 @@ class SermondistributorModelSeries extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [4990] Set some needed variables. // [5028] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -780,15 +780,15 @@ class SermondistributorModelSeries extends JModelAdmin
return false; return false;
} }
// [5012] make sure published only updates if user has the permission. // [5050] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('series.edit.state')) if (isset($values['published']) && !$this->canDo->get('series.edit.state'))
{ {
unset($values['published']); unset($values['published']);
} }
// [5025] remove move_copy from array // [5063] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5046] Parent exists so we proceed // [5084] Parent exists so we proceed
foreach ($pks as $pk) foreach ($pks as $pk)
{ {
if (!$this->user->authorise('series.edit', $contexts[$pk])) if (!$this->user->authorise('series.edit', $contexts[$pk]))
@ -798,30 +798,30 @@ class SermondistributorModelSeries extends JModelAdmin
return false; return false;
} }
// [5063] Check that the row actually exists // [5101] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5068] Fatal error // [5106] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5075] Not fatal error // [5113] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
} }
// [5081] insert all set values. // [5119] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5086] Do special action for access. // [5124] Do special action for access.
if ('access' == $key && strlen($value) > 0) if ('access' == $key && strlen($value) > 0)
{ {
$this->table->$key = $value; $this->table->$key = $value;
@ -834,7 +834,7 @@ class SermondistributorModelSeries extends JModelAdmin
} }
// [5098] Check the row. // [5136] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -847,7 +847,7 @@ class SermondistributorModelSeries extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5111] Store the row. // [5149] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -856,7 +856,7 @@ class SermondistributorModelSeries extends JModelAdmin
} }
} }
// [5120] Clean the cache // [5158] Clean the cache
$this->cleanCache(); $this->cleanCache();
return true; return true;
@ -894,7 +894,7 @@ class SermondistributorModelSeries extends JModelAdmin
$data['params'] = (string) $params; $data['params'] = (string) $params;
} }
// [5402] Alter the name for save as copy // [5440] Alter the name for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
$origTable = clone $this->getTable(); $origTable = clone $this->getTable();
@ -917,7 +917,7 @@ class SermondistributorModelSeries extends JModelAdmin
$data['published'] = 0; $data['published'] = 0;
} }
// [5429] Automatic handling of alias for empty fields // [5467] Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0) if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{ {
if ($data['alias'] == null) if ($data['alias'] == null)
@ -948,10 +948,10 @@ class SermondistributorModelSeries extends JModelAdmin
} }
} }
// [5468] Alter the uniqe field for save as copy // [5506] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5471] Automatic handling of other uniqe fields // [5509] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
@ -1005,7 +1005,7 @@ class SermondistributorModelSeries extends JModelAdmin
protected function _generateNewTitle($alias, $title) protected function _generateNewTitle($alias, $title)
{ {
// [5502] Alter the title & alias // [5540] Alter the title & alias
$table = $this->getTable(); $table = $this->getTable();
while ($table->load(array('alias' => $alias))) while ($table->load(array('alias' => $alias)))

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage series_list.php @subpackage series_list.php
@ -97,16 +97,16 @@ class SermondistributorModelSeries_list extends JModelList
*/ */
public function getItems() public function getItems()
{ {
// [10801] check in items // [10839] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -131,19 +131,19 @@ class SermondistributorModelSeries_list extends JModelList
*/ */
protected function getListQuery() protected function getListQuery()
{ {
// [7658] Get the user object. // [7696] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7660] Create a new query object. // [7698] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7663] Select some fields // [7701] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7670] From the sermondistributor_item table // [7708] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_series', 'a')); $query->from($db->quoteName('#__sermondistributor_series', 'a'));
// [7684] Filter by published state // [7722] Filter by published state
$published = $this->getState('filter.published'); $published = $this->getState('filter.published');
if (is_numeric($published)) if (is_numeric($published))
{ {
@ -154,21 +154,21 @@ class SermondistributorModelSeries_list extends JModelList
$query->where('(a.published = 0 OR a.published = 1)'); $query->where('(a.published = 0 OR a.published = 1)');
} }
// [7696] Join over the asset groups. // [7734] Join over the asset groups.
$query->select('ag.title AS access_level'); $query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [7699] Filter by access level. // [7737] Filter by access level.
if ($access = $this->getState('filter.access')) if ($access = $this->getState('filter.access'))
{ {
$query->where('a.access = ' . (int) $access); $query->where('a.access = ' . (int) $access);
} }
// [7704] Implement View Level Access // [7742] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7781] Filter by search. // [7819] Filter by search.
$search = $this->getState('filter.search'); $search = $this->getState('filter.search');
if (!empty($search)) if (!empty($search))
{ {
@ -184,7 +184,7 @@ class SermondistributorModelSeries_list extends JModelList
} }
// [7740] Add the list ordering clause. // [7778] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '') if ($orderCol != '')
@ -202,42 +202,42 @@ class SermondistributorModelSeries_list extends JModelList
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// [7448] setup the query // [7486] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7451] Get the user object. // [7489] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7453] Create a new query object. // [7491] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7456] Select some fields // [7494] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7458] From the sermondistributor_series table // [7496] From the sermondistributor_series table
$query->from($db->quoteName('#__sermondistributor_series', 'a')); $query->from($db->quoteName('#__sermondistributor_series', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')'); $query->where('a.id IN (' . implode(',',$pks) . ')');
// [7468] Implement View Level Access // [7506] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7475] Order the results by ordering // [7513] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7477] Load the items // [7515] Load the items
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
$items = $db->loadObjectList(); $items = $db->loadObjectList();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -248,13 +248,13 @@ class SermondistributorModelSeries_list extends JModelList
continue; continue;
} }
// [11089] unset the values we don't want exported. // [11127] unset the values we don't want exported.
unset($item->asset_id); unset($item->asset_id);
unset($item->checked_out); unset($item->checked_out);
unset($item->checked_out_time); unset($item->checked_out_time);
} }
} }
// [11098] Add headers to items array. // [11136] Add headers to items array.
$headers = $this->getExImPortHeaders(); $headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
@ -273,13 +273,13 @@ class SermondistributorModelSeries_list extends JModelList
*/ */
public function getExImPortHeaders() public function getExImPortHeaders()
{ {
// [7497] Get a db connection. // [7535] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7499] get the columns // [7537] get the columns
$columns = $db->getTableColumns("#__sermondistributor_series"); $columns = $db->getTableColumns("#__sermondistributor_series");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7503] remove the headers you don't import/export. // [7541] remove the headers you don't import/export.
unset($columns['asset_id']); unset($columns['asset_id']);
unset($columns['checked_out']); unset($columns['checked_out']);
unset($columns['checked_out_time']); unset($columns['checked_out_time']);
@ -301,7 +301,7 @@ class SermondistributorModelSeries_list extends JModelList
*/ */
protected function getStoreId($id = '') protected function getStoreId($id = '')
{ {
// [10424] Compile the store id. // [10462] Compile the store id.
$id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published'); $id .= ':' . $this->getState('filter.published');
@ -321,15 +321,15 @@ class SermondistributorModelSeries_list extends JModelList
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// [10817] Get set check in time // [10855] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in'); $time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time) if ($time)
{ {
// [10822] Get a db connection. // [10860] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10824] reset query // [10862] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select('*'); $query->select('*');
$query->from($db->quoteName('#__sermondistributor_series')); $query->from($db->quoteName('#__sermondistributor_series'));
@ -337,24 +337,24 @@ class SermondistributorModelSeries_list extends JModelList
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
// [10832] Get Yesterdays date // [10870] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10834] reset query // [10872] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10836] Fields to update. // [10874] Fields to update.
$fields = array( $fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0' $db->quoteName('checked_out') . '=0'
); );
// [10841] Conditions for which records should be updated. // [10879] Conditions for which records should be updated.
$conditions = array( $conditions = array(
$db->quoteName('checked_out') . '!=0', $db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\'' $db->quoteName('checked_out_time') . '<\''.$date.'\''
); );
// [10846] Check table // [10884] Check table
$query->update($db->quoteName('#__sermondistributor_series'))->set($fields)->where($conditions); $query->update($db->quoteName('#__sermondistributor_series'))->set($fields)->where($conditions);
$db->setQuery($query); $db->setQuery($query);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermon.php @subpackage sermon.php
@ -97,13 +97,13 @@ class SermondistributorModelSermon extends JModelAdmin
if (!empty($item->local_files)) if (!empty($item->local_files))
{ {
// [4232] JSON Decode local_files. // [4270] JSON Decode local_files.
$item->local_files = json_decode($item->local_files); $item->local_files = json_decode($item->local_files);
} }
if (!empty($item->manual_files)) if (!empty($item->manual_files))
{ {
// [4232] JSON Decode manual_files. // [4270] JSON Decode manual_files.
$item->manual_files = json_decode($item->manual_files); $item->manual_files = json_decode($item->manual_files);
} }
@ -113,7 +113,7 @@ class SermondistributorModelSermon extends JModelAdmin
$item->tags->getTagIds($item->id, 'com_sermondistributor.sermon'); $item->tags->getTagIds($item->id, 'com_sermondistributor.sermon');
} }
} }
$this->sermonshpc = $item->id; $this->sermonvyei = $item->id;
return $item; return $item;
} }
@ -123,76 +123,76 @@ class SermondistributorModelSermon extends JModelAdmin
* *
* @return mixed An array of data items on success, false on failure. * @return mixed An array of data items on success, false on failure.
*/ */
public function getUqbstastics() public function getUhxstastics()
{ {
// [7206] Get the user object. // [7244] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7208] Create a new query object. // [7246] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7211] Select some fields // [7249] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7218] From the sermondistributor_statistic table // [7256] From the sermondistributor_statistic table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a')); $query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
// [7811] From the sermondistributor_sermon table. // [7849] From the sermondistributor_sermon table.
$query->select($db->quoteName('g.name','sermon_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_sermon', 'g') . ' ON (' . $db->quoteName('a.sermon') . ' = ' . $db->quoteName('g.id') . ')');
// [7811] From the sermondistributor_preacher table. // [7849] From the sermondistributor_preacher table.
$query->select($db->quoteName('h.name','preacher_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'h') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('h.id') . ')');
// [7811] From the sermondistributor_series table. // [7849] From the sermondistributor_series table.
$query->select($db->quoteName('i.name','series_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'i') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('i.id') . ')');
// [7234] Filter by sermonshpc global. // [7272] Filter by sermonvyei global.
$sermonshpc = $this->sermonshpc; $sermonvyei = $this->sermonvyei;
if (is_numeric($sermonshpc )) if (is_numeric($sermonvyei ))
{ {
$query->where('a.sermon = ' . (int) $sermonshpc ); $query->where('a.sermon = ' . (int) $sermonvyei );
} }
elseif (is_string($sermonshpc)) elseif (is_string($sermonvyei))
{ {
$query->where('a.sermon = ' . $db->quote($sermonshpc)); $query->where('a.sermon = ' . $db->quote($sermonvyei));
} }
else else
{ {
$query->where('a.sermon = -5'); $query->where('a.sermon = -5');
} }
// [7251] Join over the asset groups. // [7289] Join over the asset groups.
$query->select('ag.title AS access_level'); $query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [7254] Filter by access level. // [7292] Filter by access level.
if ($access = $this->getState('filter.access')) if ($access = $this->getState('filter.access'))
{ {
$query->where('a.access = ' . (int) $access); $query->where('a.access = ' . (int) $access);
} }
// [7259] Implement View Level Access // [7297] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7266] Order the results by ordering // [7304] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7268] Load the items // [7306] Load the items
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
$items = $db->loadObjectList(); $items = $db->loadObjectList();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -221,7 +221,7 @@ class SermondistributorModelSermon extends JModelAdmin
* @since 1.6 * @since 1.6
*/ */
public function getForm($data = array(), $loadData = true) public function getForm($data = array(), $loadData = true)
{ // [9827] Get the form. { // [9865] Get the form.
$form = $this->loadForm('com_sermondistributor.sermon', 'sermon', array('control' => 'jform', 'load_data' => $loadData)); $form = $this->loadForm('com_sermondistributor.sermon', 'sermon', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form)) if (empty($form))
@ -231,17 +231,17 @@ class SermondistributorModelSermon extends JModelAdmin
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [9854] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9892] 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')) if ($jinput->get('a_id'))
{ {
$id = $jinput->get('a_id', 0, 'INT'); $id = $jinput->get('a_id', 0, 'INT');
} }
// [9859] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9897] The back end uses id so we use that the rest of the time and set it to 0 by default.
else else
{ {
$id = $jinput->get('id', 0, 'INT'); $id = $jinput->get('id', 0, 'INT');
} }
// [9864] Determine correct permissions to check. // [9902] Determine correct permissions to check.
if ($this->getState('sermon.id')) if ($this->getState('sermon.id'))
{ {
$id = $this->getState('sermon.id'); $id = $this->getState('sermon.id');
@ -249,56 +249,56 @@ class SermondistributorModelSermon extends JModelAdmin
$catid = 0; $catid = 0;
if (isset($this->getItem($id)->catid)) if (isset($this->getItem($id)->catid))
{ {
// [9871] set catagory id // [9909] set catagory id
$catid = $this->getItem($id)->catid; $catid = $this->getItem($id)->catid;
// [9873] Existing record. Can only edit in selected categories. // [9911] Existing record. Can only edit in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.edit'); $form->setFieldAttribute('catid', 'action', 'core.edit');
// [9875] Existing record. Can only edit own items in selected categories. // [9913] Existing record. Can only edit own items in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.edit.own'); $form->setFieldAttribute('catid', 'action', 'core.edit.own');
} }
} }
else else
{ {
// [9881] New record. Can only create in selected categories. // [9919] New record. Can only create in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.create'); $form->setFieldAttribute('catid', 'action', 'core.create');
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9885] Check for existing item. // [9923] Check for existing item.
// [9886] Modify the form based on Edit State access controls. // [9924] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('sermon.edit.state', 'com_sermondistributor.sermon.' . (int) $id)) 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)) || (isset($catid) && $catid != 0 && !$user->authorise('core.edit.state', 'com_sermondistributor.sermons.category.' . (int) $catid))
|| ($id == 0 && !$user->authorise('sermon.edit.state', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('sermon.edit.state', 'com_sermondistributor')))
{ {
// [9901] Disable fields for display. // [9939] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9904] Disable fields while saving. // [9942] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9945] Modify the form based on Edit Creaded By access controls. // [9983] Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('sermon.edit.created_by', 'com_sermondistributor.sermon.' . (int) $id)) if ($id != 0 && (!$user->authorise('sermon.edit.created_by', 'com_sermondistributor.sermon.' . (int) $id))
|| ($id == 0 && !$user->authorise('sermon.edit.created_by', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('sermon.edit.created_by', 'com_sermondistributor')))
{ {
// [9957] Disable fields for display. // [9995] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9959] Disable fields for display. // [9997] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9961] Disable fields while saving. // [9999] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9964] Modify the form based on Edit Creaded Date access controls. // [10002] Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('sermon.edit.created', 'com_sermondistributor.sermon.' . (int) $id)) if ($id != 0 && (!$user->authorise('sermon.edit.created', 'com_sermondistributor.sermon.' . (int) $id))
|| ($id == 0 && !$user->authorise('sermon.edit.created', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('sermon.edit.created', 'com_sermondistributor')))
{ {
// [9976] Disable fields for display. // [10014] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9978] Disable fields while saving. // [10016] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset'); $form->setFieldAttribute('created', 'filter', 'unset');
} }
@ -338,7 +338,7 @@ class SermondistributorModelSermon extends JModelAdmin
if ($allow) if ($allow)
{ {
// [10099] The record has been set. Check the record permissions. // [10137] The record has been set. Check the record permissions.
return $user->authorise('sermon.delete', 'com_sermondistributor.sermon.' . (int) $record->id); return $user->authorise('sermon.delete', 'com_sermondistributor.sermon.' . (int) $record->id);
} }
return $allow; return $allow;
@ -362,14 +362,14 @@ class SermondistributorModelSermon extends JModelAdmin
if ($recordId) if ($recordId)
{ {
// [10172] The record has been set. Check the record permissions. // [10210] The record has been set. Check the record permissions.
$permission = $user->authorise('sermon.edit.state', 'com_sermondistributor.sermon.' . (int) $recordId); $permission = $user->authorise('sermon.edit.state', 'com_sermondistributor.sermon.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
return false; return false;
} }
} }
// [10188] Check against the category. // [10226] Check against the category.
if (!empty($record->catid)) if (!empty($record->catid))
{ {
$catpermission = $user->authorise('core.edit.state', 'com_sermondistributor.sermons.category.' . (int) $record->catid); $catpermission = $user->authorise('core.edit.state', 'com_sermondistributor.sermons.category.' . (int) $record->catid);
@ -378,7 +378,7 @@ class SermondistributorModelSermon extends JModelAdmin
return false; return false;
} }
} }
// [10199] In the absense of better information, revert to the component permissions. // [10237] In the absense of better information, revert to the component permissions.
return $user->authorise('sermon.edit.state', 'com_sermondistributor'); return $user->authorise('sermon.edit.state', 'com_sermondistributor');
} }
@ -393,7 +393,7 @@ class SermondistributorModelSermon extends JModelAdmin
*/ */
protected function allowEdit($data = array(), $key = 'id') protected function allowEdit($data = array(), $key = 'id')
{ {
// [10040] Check specific edit permission then general edit permission. // [10078] Check specific edit permission then general edit permission.
$user = JFactory::getUser(); $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'); return $user->authorise('sermon.edit', 'com_sermondistributor.sermon.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('sermon.edit', 'com_sermondistributor');
@ -492,20 +492,20 @@ class SermondistributorModelSermon extends JModelAdmin
*/ */
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// [9031] check if the not_required field is set // [9069] check if the not_required field is set
if (SermondistributorHelper::checkString($data['not_required'])) if (SermondistributorHelper::checkString($data['not_required']))
{ {
$requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields); $requiredFields = array_unique($requiredFields);
// [9036] now change the required field attributes value // [9074] now change the required field attributes value
foreach ($requiredFields as $requiredField) foreach ($requiredFields as $requiredField)
{ {
// [9039] make sure there is a string value // [9077] make sure there is a string value
if (SermondistributorHelper::checkString($requiredField)) if (SermondistributorHelper::checkString($requiredField))
{ {
// [9042] change to false // [9080] change to false
$form->setFieldAttribute($requiredField, 'required', 'false'); $form->setFieldAttribute($requiredField, 'required', 'false');
// [9044] also clear the data set // [9082] also clear the data set
$data[$requiredField] = ''; $data[$requiredField] = '';
} }
} }
@ -655,7 +655,7 @@ class SermondistributorModelSermon extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [5188] Set some needed variables. // [5226] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -669,12 +669,12 @@ class SermondistributorModelSermon extends JModelAdmin
return false; return false;
} }
// [5208] get list of uniqe fields // [5246] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5210] remove move_copy from array // [5248] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5213] make sure published is set // [5251] make sure published is set
if (!isset($values['published'])) if (!isset($values['published']))
{ {
$values['published'] = 0; $values['published'] = 0;
@ -690,7 +690,7 @@ class SermondistributorModelSermon extends JModelAdmin
} }
elseif (isset($values['category']) && (int) $values['category'] > 0) elseif (isset($values['category']) && (int) $values['category'] > 0)
{ {
// [5238] move the category value to correct field name // [5276] move the category value to correct field name
$values['catid'] = $values['category']; $values['catid'] = $values['category'];
unset($values['category']); unset($values['category']);
} }
@ -701,21 +701,21 @@ class SermondistributorModelSermon extends JModelAdmin
$newIds = array(); $newIds = array();
// [5250] Parent exists so let's proceed // [5288] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5253] Pop the first ID off the stack // [5291] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5258] only allow copy if user may edit this item. // [5296] only allow copy if user may edit this item.
if (!$this->user->authorise('sermon.edit', $contexts[$pk])) if (!$this->user->authorise('sermon.edit', $contexts[$pk]))
{ {
// [5268] Not fatal error // [5306] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -723,19 +723,19 @@ class SermondistributorModelSermon extends JModelAdmin
} }
// [5273] Check that the row actually exists // [5311] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5278] Fatal error // [5316] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5285] Not fatal error // [5323] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
@ -750,7 +750,7 @@ class SermondistributorModelSermon extends JModelAdmin
list($this->table->name, $this->table->alias) = $this->generateNewTitle($this->table->catid, $this->table->alias, $this->table->name); list($this->table->name, $this->table->alias) = $this->generateNewTitle($this->table->catid, $this->table->alias, $this->table->name);
} }
// [5321] insert all set values // [5359] insert all set values
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
@ -762,7 +762,7 @@ class SermondistributorModelSermon extends JModelAdmin
} }
} }
// [5333] update all uniqe fields // [5371] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
foreach ($uniqeFields as $uniqeField) foreach ($uniqeFields as $uniqeField)
@ -771,13 +771,13 @@ class SermondistributorModelSermon extends JModelAdmin
} }
} }
// [5342] Reset the ID because we are making a copy // [5380] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5345] TODO: Deal with ordering? // [5383] TODO: Deal with ordering?
// [5346] $this->table->ordering = 1; // [5384] $this->table->ordering = 1;
// [5348] Check the row. // [5386] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -790,7 +790,7 @@ class SermondistributorModelSermon extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5361] Store the row. // [5399] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -798,14 +798,14 @@ class SermondistributorModelSermon extends JModelAdmin
return false; return false;
} }
// [5369] Get the new item ID // [5407] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5372] Add the new ID to the array // [5410] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5376] Clean the cache // [5414] Clean the cache
$this->cleanCache(); $this->cleanCache();
return $newIds; return $newIds;
@ -826,7 +826,7 @@ class SermondistributorModelSermon extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [4990] Set some needed variables. // [5028] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -841,12 +841,12 @@ class SermondistributorModelSermon extends JModelAdmin
return false; return false;
} }
// [5012] make sure published only updates if user has the permission. // [5050] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('sermon.edit.state')) if (isset($values['published']) && !$this->canDo->get('sermon.edit.state'))
{ {
unset($values['published']); unset($values['published']);
} }
// [5025] remove move_copy from array // [5063] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
if (isset($values['category']) && (int) $values['category'] > 0 && !static::checkCategoryId($values['category'])) if (isset($values['category']) && (int) $values['category'] > 0 && !static::checkCategoryId($values['category']))
@ -855,7 +855,7 @@ class SermondistributorModelSermon extends JModelAdmin
} }
elseif (isset($values['category']) && (int) $values['category'] > 0) elseif (isset($values['category']) && (int) $values['category'] > 0)
{ {
// [5036] move the category value to correct field name // [5074] move the category value to correct field name
$values['catid'] = $values['category']; $values['catid'] = $values['category'];
unset($values['category']); unset($values['category']);
} }
@ -865,7 +865,7 @@ class SermondistributorModelSermon extends JModelAdmin
} }
// [5046] Parent exists so we proceed // [5084] Parent exists so we proceed
foreach ($pks as $pk) foreach ($pks as $pk)
{ {
if (!$this->user->authorise('sermon.edit', $contexts[$pk])) if (!$this->user->authorise('sermon.edit', $contexts[$pk]))
@ -875,30 +875,30 @@ class SermondistributorModelSermon extends JModelAdmin
return false; return false;
} }
// [5063] Check that the row actually exists // [5101] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5068] Fatal error // [5106] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5075] Not fatal error // [5113] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
} }
// [5081] insert all set values. // [5119] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5086] Do special action for access. // [5124] Do special action for access.
if ('access' == $key && strlen($value) > 0) if ('access' == $key && strlen($value) > 0)
{ {
$this->table->$key = $value; $this->table->$key = $value;
@ -911,7 +911,7 @@ class SermondistributorModelSermon extends JModelAdmin
} }
// [5098] Check the row. // [5136] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -924,7 +924,7 @@ class SermondistributorModelSermon extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5111] Store the row. // [5149] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -933,7 +933,7 @@ class SermondistributorModelSermon extends JModelAdmin
} }
} }
// [5120] Clean the cache // [5158] Clean the cache
$this->cleanCache(); $this->cleanCache();
return true; return true;
@ -963,13 +963,13 @@ class SermondistributorModelSermon extends JModelAdmin
$data['metadata'] = (string) $metadata; $data['metadata'] = (string) $metadata;
} }
// [4342] Set the local_files string to JSON string. // [4380] Set the local_files string to JSON string.
if (isset($data['local_files'])) if (isset($data['local_files']))
{ {
$data['local_files'] = (string) json_encode($data['local_files']); $data['local_files'] = (string) json_encode($data['local_files']);
} }
// [4342] Set the manual_files string to JSON string. // [4380] Set the manual_files string to JSON string.
if (isset($data['manual_files'])) if (isset($data['manual_files']))
{ {
$data['manual_files'] = (string) json_encode($data['manual_files']); $data['manual_files'] = (string) json_encode($data['manual_files']);
@ -983,7 +983,7 @@ class SermondistributorModelSermon extends JModelAdmin
$data['params'] = (string) $params; $data['params'] = (string) $params;
} }
// [5402] Alter the name for save as copy // [5440] Alter the name for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
$origTable = clone $this->getTable(); $origTable = clone $this->getTable();
@ -1006,7 +1006,7 @@ class SermondistributorModelSermon extends JModelAdmin
$data['published'] = 0; $data['published'] = 0;
} }
// [5429] Automatic handling of alias for empty fields // [5467] Automatic handling of alias for empty fields
if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0) if (in_array($input->get('task'), array('apply', 'save', 'save2new')) && (int) $input->get('id') == 0)
{ {
if ($data['alias'] == null) if ($data['alias'] == null)
@ -1037,10 +1037,10 @@ class SermondistributorModelSermon extends JModelAdmin
} }
} }
// [5468] Alter the uniqe field for save as copy // [5506] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5471] Automatic handling of other uniqe fields // [5509] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
@ -1094,7 +1094,7 @@ class SermondistributorModelSermon extends JModelAdmin
protected function _generateNewTitle($alias, $title) protected function _generateNewTitle($alias, $title)
{ {
// [5502] Alter the title & alias // [5540] Alter the title & alias
$table = $this->getTable(); $table = $this->getTable();
while ($table->load(array('alias' => $alias))) while ($table->load(array('alias' => $alias)))

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermondistributor.php @subpackage sermondistributor.php
@ -45,7 +45,7 @@ class SermondistributorModelSermondistributor extends JModelList
$viewGroups = array( $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') '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')
); );
// [12447] view access array // [12485] view access array
$viewAccess = array( $viewAccess = array(
'preacher.create' => 'preacher.create', 'preacher.create' => 'preacher.create',
'preachers.access' => 'preacher.access', 'preachers.access' => 'preacher.access',

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermons.php @subpackage sermons.php
@ -129,16 +129,16 @@ class SermondistributorModelSermons extends JModelList
*/ */
public function getItems() public function getItems()
{ {
// [10801] check in items // [10839] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -152,14 +152,14 @@ class SermondistributorModelSermons extends JModelList
} }
} }
// [11142] set selection value to a translatable value // [11180] set selection value to a translatable value
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
// [11149] convert link_type // [11187] convert link_type
$item->link_type = $this->selectionTranslation($item->link_type, 'link_type'); $item->link_type = $this->selectionTranslation($item->link_type, 'link_type');
// [11149] convert source // [11187] convert source
$item->source = $this->selectionTranslation($item->source, 'source'); $item->source = $this->selectionTranslation($item->source, 'source');
} }
} }
@ -176,20 +176,20 @@ class SermondistributorModelSermons extends JModelList
*/ */
public function selectionTranslation($value,$name) public function selectionTranslation($value,$name)
{ {
// [11175] Array of link_type language strings // [11213] Array of link_type language strings
if ($name == 'link_type') if ($name == 'link_type')
{ {
$link_typeArray = array( $link_typeArray = array(
1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED', 1 => 'COM_SERMONDISTRIBUTOR_SERMON_ENCRYPTED',
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT' 2 => 'COM_SERMONDISTRIBUTOR_SERMON_DIRECT'
); );
// [11206] Now check if value is found in this array // [11244] Now check if value is found in this array
if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value])) if (isset($link_typeArray[$value]) && SermondistributorHelper::checkString($link_typeArray[$value]))
{ {
return $link_typeArray[$value]; return $link_typeArray[$value];
} }
} }
// [11175] Array of source language strings // [11213] Array of source language strings
if ($name == 'source') if ($name == 'source')
{ {
$sourceArray = array( $sourceArray = array(
@ -198,7 +198,7 @@ class SermondistributorModelSermons extends JModelList
2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX', 2 => 'COM_SERMONDISTRIBUTOR_SERMON_DROPBOX',
3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL' 3 => 'COM_SERMONDISTRIBUTOR_SERMON_URL'
); );
// [11206] Now check if value is found in this array // [11244] Now check if value is found in this array
if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value])) if (isset($sourceArray[$value]) && SermondistributorHelper::checkString($sourceArray[$value]))
{ {
return $sourceArray[$value]; return $sourceArray[$value];
@ -214,29 +214,29 @@ class SermondistributorModelSermons extends JModelList
*/ */
protected function getListQuery() protected function getListQuery()
{ {
// [7658] Get the user object. // [7696] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7660] Create a new query object. // [7698] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7663] Select some fields // [7701] Select some fields
$query->select('a.*'); $query->select('a.*');
$query->select($db->quoteName('c.title','category_title')); $query->select($db->quoteName('c.title','category_title'));
// [7670] From the sermondistributor_item table // [7708] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a')); $query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')'); $query->join('LEFT', $db->quoteName('#__categories', 'c') . ' ON (' . $db->quoteName('a.catid') . ' = ' . $db->quoteName('c.id') . ')');
// [7811] From the sermondistributor_preacher table. // [7849] From the sermondistributor_preacher table.
$query->select($db->quoteName('g.name','preacher_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'g') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('g.id') . ')');
// [7811] From the sermondistributor_series table. // [7849] From the sermondistributor_series table.
$query->select($db->quoteName('h.name','series_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'h') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('h.id') . ')');
// [7684] Filter by published state // [7722] Filter by published state
$published = $this->getState('filter.published'); $published = $this->getState('filter.published');
if (is_numeric($published)) if (is_numeric($published))
{ {
@ -247,21 +247,21 @@ class SermondistributorModelSermons extends JModelList
$query->where('(a.published = 0 OR a.published = 1)'); $query->where('(a.published = 0 OR a.published = 1)');
} }
// [7696] Join over the asset groups. // [7734] Join over the asset groups.
$query->select('ag.title AS access_level'); $query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [7699] Filter by access level. // [7737] Filter by access level.
if ($access = $this->getState('filter.access')) if ($access = $this->getState('filter.access'))
{ {
$query->where('a.access = ' . (int) $access); $query->where('a.access = ' . (int) $access);
} }
// [7704] Implement View Level Access // [7742] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7781] Filter by search. // [7819] Filter by search.
$search = $this->getState('filter.search'); $search = $this->getState('filter.search');
if (!empty($search)) if (!empty($search))
{ {
@ -276,28 +276,28 @@ class SermondistributorModelSermons extends JModelList
} }
} }
// [8015] Filter by preacher. // [8053] Filter by preacher.
if ($preacher = $this->getState('filter.preacher')) if ($preacher = $this->getState('filter.preacher'))
{ {
$query->where('a.preacher = ' . $db->quote($db->escape($preacher, true))); $query->where('a.preacher = ' . $db->quote($db->escape($preacher, true)));
} }
// [8015] Filter by series. // [8053] Filter by series.
if ($series = $this->getState('filter.series')) if ($series = $this->getState('filter.series'))
{ {
$query->where('a.series = ' . $db->quote($db->escape($series, true))); $query->where('a.series = ' . $db->quote($db->escape($series, true)));
} }
// [8024] Filter by Link_type. // [8062] Filter by Link_type.
if ($link_type = $this->getState('filter.link_type')) if ($link_type = $this->getState('filter.link_type'))
{ {
$query->where('a.link_type = ' . $db->quote($db->escape($link_type, true))); $query->where('a.link_type = ' . $db->quote($db->escape($link_type, true)));
} }
// [8024] Filter by Source. // [8062] Filter by Source.
if ($source = $this->getState('filter.source')) if ($source = $this->getState('filter.source'))
{ {
$query->where('a.source = ' . $db->quote($db->escape($source, true))); $query->where('a.source = ' . $db->quote($db->escape($source, true)));
} }
// [7718] Filter by a single or group of categories. // [7756] Filter by a single or group of categories.
$baselevel = 1; $baselevel = 1;
$categoryId = $this->getState('filter.category_id'); $categoryId = $this->getState('filter.category_id');
@ -319,7 +319,7 @@ class SermondistributorModelSermons extends JModelList
} }
// [7740] Add the list ordering clause. // [7778] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '') if ($orderCol != '')
@ -337,42 +337,42 @@ class SermondistributorModelSermons extends JModelList
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// [7448] setup the query // [7486] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7451] Get the user object. // [7489] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7453] Create a new query object. // [7491] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7456] Select some fields // [7494] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7458] From the sermondistributor_sermon table // [7496] From the sermondistributor_sermon table
$query->from($db->quoteName('#__sermondistributor_sermon', 'a')); $query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')'); $query->where('a.id IN (' . implode(',',$pks) . ')');
// [7468] Implement View Level Access // [7506] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7475] Order the results by ordering // [7513] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7477] Load the items // [7515] Load the items
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
$items = $db->loadObjectList(); $items = $db->loadObjectList();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -383,13 +383,13 @@ class SermondistributorModelSermons extends JModelList
continue; continue;
} }
// [11089] unset the values we don't want exported. // [11127] unset the values we don't want exported.
unset($item->asset_id); unset($item->asset_id);
unset($item->checked_out); unset($item->checked_out);
unset($item->checked_out_time); unset($item->checked_out_time);
} }
} }
// [11098] Add headers to items array. // [11136] Add headers to items array.
$headers = $this->getExImPortHeaders(); $headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
@ -408,13 +408,13 @@ class SermondistributorModelSermons extends JModelList
*/ */
public function getExImPortHeaders() public function getExImPortHeaders()
{ {
// [7497] Get a db connection. // [7535] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7499] get the columns // [7537] get the columns
$columns = $db->getTableColumns("#__sermondistributor_sermon"); $columns = $db->getTableColumns("#__sermondistributor_sermon");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7503] remove the headers you don't import/export. // [7541] remove the headers you don't import/export.
unset($columns['asset_id']); unset($columns['asset_id']);
unset($columns['checked_out']); unset($columns['checked_out']);
unset($columns['checked_out_time']); unset($columns['checked_out_time']);
@ -436,7 +436,7 @@ class SermondistributorModelSermons extends JModelList
*/ */
protected function getStoreId($id = '') protected function getStoreId($id = '')
{ {
// [10424] Compile the store id. // [10462] Compile the store id.
$id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published'); $id .= ':' . $this->getState('filter.published');
@ -464,15 +464,15 @@ class SermondistributorModelSermons extends JModelList
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// [10817] Get set check in time // [10855] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in'); $time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time) if ($time)
{ {
// [10822] Get a db connection. // [10860] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10824] reset query // [10862] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select('*'); $query->select('*');
$query->from($db->quoteName('#__sermondistributor_sermon')); $query->from($db->quoteName('#__sermondistributor_sermon'));
@ -480,24 +480,24 @@ class SermondistributorModelSermons extends JModelList
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
// [10832] Get Yesterdays date // [10870] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10834] reset query // [10872] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10836] Fields to update. // [10874] Fields to update.
$fields = array( $fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0' $db->quoteName('checked_out') . '=0'
); );
// [10841] Conditions for which records should be updated. // [10879] Conditions for which records should be updated.
$conditions = array( $conditions = array(
$db->quoteName('checked_out') . '!=0', $db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\'' $db->quoteName('checked_out_time') . '<\''.$date.'\''
); );
// [10846] Check table // [10884] Check table
$query->update($db->quoteName('#__sermondistributor_sermon'))->set($fields)->where($conditions); $query->update($db->quoteName('#__sermondistributor_sermon'))->set($fields)->where($conditions);
$db->setQuery($query); $db->setQuery($query);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage statistic.php @subpackage statistic.php
@ -116,7 +116,7 @@ class SermondistributorModelStatistic extends JModelAdmin
* @since 1.6 * @since 1.6
*/ */
public function getForm($data = array(), $loadData = true) public function getForm($data = array(), $loadData = true)
{ // [9827] Get the form. { // [9865] Get the form.
$form = $this->loadForm('com_sermondistributor.statistic', 'statistic', array('control' => 'jform', 'load_data' => $loadData)); $form = $this->loadForm('com_sermondistributor.statistic', 'statistic', array('control' => 'jform', 'load_data' => $loadData));
if (empty($form)) if (empty($form))
@ -126,12 +126,12 @@ class SermondistributorModelStatistic extends JModelAdmin
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [9912] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9950] 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')) if ($jinput->get('a_id'))
{ {
$id = $jinput->get('a_id', 0, 'INT'); $id = $jinput->get('a_id', 0, 'INT');
} }
// [9917] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9955] The back end uses id so we use that the rest of the time and set it to 0 by default.
else else
{ {
$id = $jinput->get('id', 0, 'INT'); $id = $jinput->get('id', 0, 'INT');
@ -139,36 +139,36 @@ class SermondistributorModelStatistic extends JModelAdmin
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9923] Check for existing item. // [9961] Check for existing item.
// [9924] Modify the form based on Edit State access controls. // [9962] Modify the form based on Edit State access controls.
if ($id != 0 && (!$user->authorise('statistic.edit.state', 'com_sermondistributor.statistic.' . (int) $id)) if ($id != 0 && (!$user->authorise('statistic.edit.state', 'com_sermondistributor.statistic.' . (int) $id))
|| ($id == 0 && !$user->authorise('statistic.edit.state', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('statistic.edit.state', 'com_sermondistributor')))
{ {
// [9937] Disable fields for display. // [9975] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9940] Disable fields while saving. // [9978] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9945] Modify the form based on Edit Creaded By access controls. // [9983] Modify the form based on Edit Creaded By access controls.
if ($id != 0 && (!$user->authorise('statistic.edit.created_by', 'com_sermondistributor.statistic.' . (int) $id)) if ($id != 0 && (!$user->authorise('statistic.edit.created_by', 'com_sermondistributor.statistic.' . (int) $id))
|| ($id == 0 && !$user->authorise('statistic.edit.created_by', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('statistic.edit.created_by', 'com_sermondistributor')))
{ {
// [9957] Disable fields for display. // [9995] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9959] Disable fields for display. // [9997] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9961] Disable fields while saving. // [9999] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9964] Modify the form based on Edit Creaded Date access controls. // [10002] Modify the form based on Edit Creaded Date access controls.
if ($id != 0 && (!$user->authorise('statistic.edit.created', 'com_sermondistributor.statistic.' . (int) $id)) if ($id != 0 && (!$user->authorise('statistic.edit.created', 'com_sermondistributor.statistic.' . (int) $id))
|| ($id == 0 && !$user->authorise('statistic.edit.created', 'com_sermondistributor'))) || ($id == 0 && !$user->authorise('statistic.edit.created', 'com_sermondistributor')))
{ {
// [9976] Disable fields for display. // [10014] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9978] Disable fields while saving. // [10016] Disable fields while saving.
$form->setFieldAttribute('created', 'filter', 'unset'); $form->setFieldAttribute('created', 'filter', 'unset');
} }
@ -204,7 +204,7 @@ class SermondistributorModelStatistic extends JModelAdmin
} }
$user = JFactory::getUser(); $user = JFactory::getUser();
// [10128] The record has been set. Check the record permissions. // [10166] The record has been set. Check the record permissions.
return $user->authorise('statistic.delete', 'com_sermondistributor.statistic.' . (int) $record->id); return $user->authorise('statistic.delete', 'com_sermondistributor.statistic.' . (int) $record->id);
} }
return false; return false;
@ -226,14 +226,14 @@ class SermondistributorModelStatistic extends JModelAdmin
if ($recordId) if ($recordId)
{ {
// [10215] The record has been set. Check the record permissions. // [10253] The record has been set. Check the record permissions.
$permission = $user->authorise('statistic.edit.state', 'com_sermondistributor.statistic.' . (int) $recordId); $permission = $user->authorise('statistic.edit.state', 'com_sermondistributor.statistic.' . (int) $recordId);
if (!$permission && !is_null($permission)) if (!$permission && !is_null($permission))
{ {
return false; return false;
} }
} }
// [10232] In the absense of better information, revert to the component permissions. // [10270] In the absense of better information, revert to the component permissions.
return $user->authorise('statistic.edit.state', 'com_sermondistributor'); return $user->authorise('statistic.edit.state', 'com_sermondistributor');
} }
@ -248,7 +248,7 @@ class SermondistributorModelStatistic extends JModelAdmin
*/ */
protected function allowEdit($data = array(), $key = 'id') protected function allowEdit($data = array(), $key = 'id')
{ {
// [10040] Check specific edit permission then general edit permission. // [10078] Check specific edit permission then general edit permission.
$user = JFactory::getUser(); $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'); return $user->authorise('statistic.edit', 'com_sermondistributor.statistic.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('statistic.edit', 'com_sermondistributor');
@ -474,7 +474,7 @@ class SermondistributorModelStatistic extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [5188] Set some needed variables. // [5226] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -488,12 +488,12 @@ class SermondistributorModelStatistic extends JModelAdmin
return false; return false;
} }
// [5208] get list of uniqe fields // [5246] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5210] remove move_copy from array // [5248] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5213] make sure published is set // [5251] make sure published is set
if (!isset($values['published'])) if (!isset($values['published']))
{ {
$values['published'] = 0; $values['published'] = 0;
@ -505,21 +505,21 @@ class SermondistributorModelStatistic extends JModelAdmin
$newIds = array(); $newIds = array();
// [5250] Parent exists so let's proceed // [5288] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5253] Pop the first ID off the stack // [5291] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5258] only allow copy if user may edit this item. // [5296] only allow copy if user may edit this item.
if (!$this->user->authorise('statistic.edit', $contexts[$pk])) if (!$this->user->authorise('statistic.edit', $contexts[$pk]))
{ {
// [5268] Not fatal error // [5306] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
@ -527,19 +527,19 @@ class SermondistributorModelStatistic extends JModelAdmin
} }
// [5273] Check that the row actually exists // [5311] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5278] Fatal error // [5316] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5285] Not fatal error // [5323] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
@ -547,7 +547,7 @@ class SermondistributorModelStatistic extends JModelAdmin
$this->table->filename = $this->generateUniqe('filename',$this->table->filename); $this->table->filename = $this->generateUniqe('filename',$this->table->filename);
// [5321] insert all set values // [5359] insert all set values
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
@ -559,7 +559,7 @@ class SermondistributorModelStatistic extends JModelAdmin
} }
} }
// [5333] update all uniqe fields // [5371] update all uniqe fields
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
foreach ($uniqeFields as $uniqeField) foreach ($uniqeFields as $uniqeField)
@ -568,13 +568,13 @@ class SermondistributorModelStatistic extends JModelAdmin
} }
} }
// [5342] Reset the ID because we are making a copy // [5380] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5345] TODO: Deal with ordering? // [5383] TODO: Deal with ordering?
// [5346] $this->table->ordering = 1; // [5384] $this->table->ordering = 1;
// [5348] Check the row. // [5386] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -587,7 +587,7 @@ class SermondistributorModelStatistic extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5361] Store the row. // [5399] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -595,14 +595,14 @@ class SermondistributorModelStatistic extends JModelAdmin
return false; return false;
} }
// [5369] Get the new item ID // [5407] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5372] Add the new ID to the array // [5410] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5376] Clean the cache // [5414] Clean the cache
$this->cleanCache(); $this->cleanCache();
return $newIds; return $newIds;
@ -623,7 +623,7 @@ class SermondistributorModelStatistic extends JModelAdmin
{ {
if (empty($this->batchSet)) if (empty($this->batchSet))
{ {
// [4990] Set some needed variables. // [5028] Set some needed variables.
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
$this->table = $this->getTable(); $this->table = $this->getTable();
$this->tableClassName = get_class($this->table); $this->tableClassName = get_class($this->table);
@ -638,15 +638,15 @@ class SermondistributorModelStatistic extends JModelAdmin
return false; return false;
} }
// [5012] make sure published only updates if user has the permission. // [5050] make sure published only updates if user has the permission.
if (isset($values['published']) && !$this->canDo->get('statistic.edit.state')) if (isset($values['published']) && !$this->canDo->get('statistic.edit.state'))
{ {
unset($values['published']); unset($values['published']);
} }
// [5025] remove move_copy from array // [5063] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5046] Parent exists so we proceed // [5084] Parent exists so we proceed
foreach ($pks as $pk) foreach ($pks as $pk)
{ {
if (!$this->user->authorise('statistic.edit', $contexts[$pk])) if (!$this->user->authorise('statistic.edit', $contexts[$pk]))
@ -656,30 +656,30 @@ class SermondistributorModelStatistic extends JModelAdmin
return false; return false;
} }
// [5063] Check that the row actually exists // [5101] Check that the row actually exists
if (!$this->table->load($pk)) if (!$this->table->load($pk))
{ {
if ($error = $this->table->getError()) if ($error = $this->table->getError())
{ {
// [5068] Fatal error // [5106] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5075] Not fatal error // [5113] Not fatal error
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk));
continue; continue;
} }
} }
// [5081] insert all set values. // [5119] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5086] Do special action for access. // [5124] Do special action for access.
if ('access' == $key && strlen($value) > 0) if ('access' == $key && strlen($value) > 0)
{ {
$this->table->$key = $value; $this->table->$key = $value;
@ -692,7 +692,7 @@ class SermondistributorModelStatistic extends JModelAdmin
} }
// [5098] Check the row. // [5136] Check the row.
if (!$this->table->check()) if (!$this->table->check())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -705,7 +705,7 @@ class SermondistributorModelStatistic extends JModelAdmin
$this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table);
} }
// [5111] Store the row. // [5149] Store the row.
if (!$this->table->store()) if (!$this->table->store())
{ {
$this->setError($this->table->getError()); $this->setError($this->table->getError());
@ -714,7 +714,7 @@ class SermondistributorModelStatistic extends JModelAdmin
} }
} }
// [5120] Clean the cache // [5158] Clean the cache
$this->cleanCache(); $this->cleanCache();
return true; return true;
@ -752,10 +752,10 @@ class SermondistributorModelStatistic extends JModelAdmin
$data['params'] = (string) $params; $data['params'] = (string) $params;
} }
// [5468] Alter the uniqe field for save as copy // [5506] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5471] Automatic handling of other uniqe fields // [5509] Automatic handling of other uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
if (SermondistributorHelper::checkArray($uniqeFields)) if (SermondistributorHelper::checkArray($uniqeFields))
{ {
@ -808,7 +808,7 @@ class SermondistributorModelStatistic extends JModelAdmin
protected function _generateNewTitle($title) protected function _generateNewTitle($title)
{ {
// [5526] Alter the title // [5564] Alter the title
$table = $this->getTable(); $table = $this->getTable();
while ($table->load(array('title' => $title))) while ($table->load(array('title' => $title)))

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage statistics.php @subpackage statistics.php
@ -113,16 +113,16 @@ class SermondistributorModelStatistics extends JModelList
*/ */
public function getItems() public function getItems()
{ {
// [10801] check in items // [10839] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -147,31 +147,31 @@ class SermondistributorModelStatistics extends JModelList
*/ */
protected function getListQuery() protected function getListQuery()
{ {
// [7658] Get the user object. // [7696] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7660] Create a new query object. // [7698] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7663] Select some fields // [7701] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7670] From the sermondistributor_item table // [7708] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a')); $query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
// [7811] From the sermondistributor_sermon table. // [7849] From the sermondistributor_sermon table.
$query->select($db->quoteName('g.name','sermon_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_sermon', 'g') . ' ON (' . $db->quoteName('a.sermon') . ' = ' . $db->quoteName('g.id') . ')');
// [7811] From the sermondistributor_preacher table. // [7849] From the sermondistributor_preacher table.
$query->select($db->quoteName('h.name','preacher_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_preacher', 'h') . ' ON (' . $db->quoteName('a.preacher') . ' = ' . $db->quoteName('h.id') . ')');
// [7811] From the sermondistributor_series table. // [7849] From the sermondistributor_series table.
$query->select($db->quoteName('i.name','series_name')); $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') . ')'); $query->join('LEFT', $db->quoteName('#__sermondistributor_series', 'i') . ' ON (' . $db->quoteName('a.series') . ' = ' . $db->quoteName('i.id') . ')');
// [7684] Filter by published state // [7722] Filter by published state
$published = $this->getState('filter.published'); $published = $this->getState('filter.published');
if (is_numeric($published)) if (is_numeric($published))
{ {
@ -182,21 +182,21 @@ class SermondistributorModelStatistics extends JModelList
$query->where('(a.published = 0 OR a.published = 1)'); $query->where('(a.published = 0 OR a.published = 1)');
} }
// [7696] Join over the asset groups. // [7734] Join over the asset groups.
$query->select('ag.title AS access_level'); $query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// [7699] Filter by access level. // [7737] Filter by access level.
if ($access = $this->getState('filter.access')) if ($access = $this->getState('filter.access'))
{ {
$query->where('a.access = ' . (int) $access); $query->where('a.access = ' . (int) $access);
} }
// [7704] Implement View Level Access // [7742] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7781] Filter by search. // [7819] Filter by search.
$search = $this->getState('filter.search'); $search = $this->getState('filter.search');
if (!empty($search)) if (!empty($search))
{ {
@ -211,23 +211,23 @@ class SermondistributorModelStatistics extends JModelList
} }
} }
// [8015] Filter by sermon. // [8053] Filter by sermon.
if ($sermon = $this->getState('filter.sermon')) if ($sermon = $this->getState('filter.sermon'))
{ {
$query->where('a.sermon = ' . $db->quote($db->escape($sermon, true))); $query->where('a.sermon = ' . $db->quote($db->escape($sermon, true)));
} }
// [8015] Filter by preacher. // [8053] Filter by preacher.
if ($preacher = $this->getState('filter.preacher')) if ($preacher = $this->getState('filter.preacher'))
{ {
$query->where('a.preacher = ' . $db->quote($db->escape($preacher, true))); $query->where('a.preacher = ' . $db->quote($db->escape($preacher, true)));
} }
// [8015] Filter by series. // [8053] Filter by series.
if ($series = $this->getState('filter.series')) if ($series = $this->getState('filter.series'))
{ {
$query->where('a.series = ' . $db->quote($db->escape($series, true))); $query->where('a.series = ' . $db->quote($db->escape($series, true)));
} }
// [7740] Add the list ordering clause. // [7778] Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'asc');
if ($orderCol != '') if ($orderCol != '')
@ -245,42 +245,42 @@ class SermondistributorModelStatistics extends JModelList
*/ */
public function getExportData($pks) public function getExportData($pks)
{ {
// [7448] setup the query // [7486] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7451] Get the user object. // [7489] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7453] Create a new query object. // [7491] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7456] Select some fields // [7494] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7458] From the sermondistributor_statistic table // [7496] From the sermondistributor_statistic table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a')); $query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
$query->where('a.id IN (' . implode(',',$pks) . ')'); $query->where('a.id IN (' . implode(',',$pks) . ')');
// [7468] Implement View Level Access // [7506] Implement View Level Access
if (!$user->authorise('core.options', 'com_sermondistributor')) if (!$user->authorise('core.options', 'com_sermondistributor'))
{ {
$groups = implode(',', $user->getAuthorisedViewLevels()); $groups = implode(',', $user->getAuthorisedViewLevels());
$query->where('a.access IN (' . $groups . ')'); $query->where('a.access IN (' . $groups . ')');
} }
// [7475] Order the results by ordering // [7513] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7477] Load the items // [7515] Load the items
$db->setQuery($query); $db->setQuery($query);
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
$items = $db->loadObjectList(); $items = $db->loadObjectList();
// [10876] set values to display correctly. // [10914] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10879] get user object. // [10917] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
foreach ($items as $nr => &$item) foreach ($items as $nr => &$item)
{ {
@ -291,13 +291,13 @@ class SermondistributorModelStatistics extends JModelList
continue; continue;
} }
// [11089] unset the values we don't want exported. // [11127] unset the values we don't want exported.
unset($item->asset_id); unset($item->asset_id);
unset($item->checked_out); unset($item->checked_out);
unset($item->checked_out_time); unset($item->checked_out_time);
} }
} }
// [11098] Add headers to items array. // [11136] Add headers to items array.
$headers = $this->getExImPortHeaders(); $headers = $this->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
@ -316,13 +316,13 @@ class SermondistributorModelStatistics extends JModelList
*/ */
public function getExImPortHeaders() public function getExImPortHeaders()
{ {
// [7497] Get a db connection. // [7535] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7499] get the columns // [7537] get the columns
$columns = $db->getTableColumns("#__sermondistributor_statistic"); $columns = $db->getTableColumns("#__sermondistributor_statistic");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7503] remove the headers you don't import/export. // [7541] remove the headers you don't import/export.
unset($columns['asset_id']); unset($columns['asset_id']);
unset($columns['checked_out']); unset($columns['checked_out']);
unset($columns['checked_out_time']); unset($columns['checked_out_time']);
@ -344,7 +344,7 @@ class SermondistributorModelStatistics extends JModelList
*/ */
protected function getStoreId($id = '') protected function getStoreId($id = '')
{ {
// [10424] Compile the store id. // [10462] Compile the store id.
$id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published'); $id .= ':' . $this->getState('filter.published');
@ -368,15 +368,15 @@ class SermondistributorModelStatistics extends JModelList
*/ */
protected function checkInNow() protected function checkInNow()
{ {
// [10817] Get set check in time // [10855] Get set check in time
$time = JComponentHelper::getParams('com_sermondistributor')->get('check_in'); $time = JComponentHelper::getParams('com_sermondistributor')->get('check_in');
if ($time) if ($time)
{ {
// [10822] Get a db connection. // [10860] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10824] reset query // [10862] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select('*'); $query->select('*');
$query->from($db->quoteName('#__sermondistributor_statistic')); $query->from($db->quoteName('#__sermondistributor_statistic'));
@ -384,24 +384,24 @@ class SermondistributorModelStatistics extends JModelList
$db->execute(); $db->execute();
if ($db->getNumRows()) if ($db->getNumRows())
{ {
// [10832] Get Yesterdays date // [10870] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10834] reset query // [10872] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10836] Fields to update. // [10874] Fields to update.
$fields = array( $fields = array(
$db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'',
$db->quoteName('checked_out') . '=0' $db->quoteName('checked_out') . '=0'
); );
// [10841] Conditions for which records should be updated. // [10879] Conditions for which records should be updated.
$conditions = array( $conditions = array(
$db->quoteName('checked_out') . '!=0', $db->quoteName('checked_out') . '!=0',
$db->quoteName('checked_out_time') . '<\''.$date.'\'' $db->quoteName('checked_out_time') . '<\''.$date.'\''
); );
// [10846] Check table // [10884] Check table
$query->update($db->quoteName('#__sermondistributor_statistic'))->set($fields)->where($conditions); $query->update($db->quoteName('#__sermondistributor_statistic'))->set($fields)->where($conditions);
$db->setQuery($query); $db->setQuery($query);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage sermondistributor.php @subpackage sermondistributor.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage help_document.php @subpackage help_document.php
@ -53,7 +53,7 @@ class SermondistributorTableHelp_document extends JTable
{ {
parent::__construct('#__sermondistributor_help_document', 'id', $db); parent::__construct('#__sermondistributor_help_document', 'id', $db);
// [4450] Adding History Options // [4488] Adding History Options
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.help_document')); JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.help_document'));
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage preacher.php @subpackage preacher.php
@ -53,7 +53,7 @@ class SermondistributorTablePreacher extends JTable
{ {
parent::__construct('#__sermondistributor_preacher', 'id', $db); parent::__construct('#__sermondistributor_preacher', 'id', $db);
// [4450] Adding History Options // [4488] Adding History Options
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.preacher')); JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.preacher'));
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 6th January, 2016 @build 11th January, 2016
@created 22nd October, 2015 @created 22nd October, 2015
@package Sermon Distributor @package Sermon Distributor
@subpackage series.php @subpackage series.php
@ -53,7 +53,7 @@ class SermondistributorTableSeries extends JTable
{ {
parent::__construct('#__sermondistributor_series', 'id', $db); parent::__construct('#__sermondistributor_series', 'id', $db);
// [4450] Adding History Options // [4488] Adding History Options
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.series')); JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.series'));
} }

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