Added update server fix, 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-05 09:05:55 +02:00
parent 2b470a7979
commit 7c3d365507
261 changed files with 2747 additions and 2937 deletions

View File

@ -12,9 +12,8 @@ The best way to see all your options is to install this component on you Joomla
### Some Video Demonstrations ### Some Video Demonstrations
+ [Setup overview] (https://youtu.be/yMPp1Cp3W_0?t=20m) + [Setup overview] (https://youtu.be/yMPp1Cp3W_0?t=20m8s)
+ [Setup Dropbox] (https://youtu.be/btpKFDk0-dI) + [Setup Dropbox] (https://youtu.be/btpKFDk0-dI)
+ [Component Build] (https://youtu.be/yMPp1Cp3W_0)
# Build Details # Build Details
@ -22,7 +21,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*: 23rd December, 2015 + *Last Build*: 5th 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
@ -35,8 +34,8 @@ due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builde
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > (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*: **46561** + *Line count*: **46546**
+ *File count*: **350** + *File count*: **349**
+ *Folder count*: **79** + *Folder count*: **79**
**86 Hours** or **11 Eight Hour Days** (the actual time the author spent) **86 Hours** or **11 Eight Hour Days** (the actual time the author spent)

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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())
{ {
// [9571] Access check. // [9580] 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;
} }
// [9582] In the absense of better information, revert to the component permissions. // [9591] 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')
{ {
// [9725] get user object. // [9734] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9727] get record id. // [9736] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9734] Access check. // [9743] 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)
{ {
// [9743] The record has been set. Check the record permissions. // [9752] 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))
{ {
// [9765] Now test the owner is the user. // [9774] 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))
{ {
// [9769] Need to do a lookup from the model. // [9778] 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;
} }
// [9777] If the owner matches 'me' then allow. // [9786] 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;
} }
} }
// [9799] Since there is no permission, revert to the component permissions. // [9808] 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 23rd December, 2015 @build 5th 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()
{ {
// [7521] Check for request forgeries // [7530] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7523] check if export is allowed for this user. // [7532] 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'))
{ {
// [7527] Get the input // [7536] 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');
// [7530] Sanitize the input // [7539] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7532] Get the model // [7541] Get the model
$model = $this->getModel('Help_documents'); $model = $this->getModel('Help_documents');
// [7534] get the data to export // [7543] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7538] now set the data to the spreadsheet // [7547] 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');
} }
} }
// [7543] Redirect to the list screen with error. // [7552] 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()
{ {
// [7552] Check for request forgeries // [7561] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7554] check if import is allowed for this user. // [7563] 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'))
{ {
// [7558] Get the import model // [7567] Get the import model
$model = $this->getModel('Help_documents'); $model = $this->getModel('Help_documents');
// [7560] get the headers to import // [7569] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7564] Load headers to session. // [7573] 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');
// [7570] Redirect to import view. // [7579] 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;
} }
} }
// [7582] Redirect to the list screen with error. // [7591] 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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())
{ {
// [9571] Access check. // [9580] 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;
} }
// [9582] In the absense of better information, revert to the component permissions. // [9591] 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')
{ {
// [9725] get user object. // [9734] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9727] get record id. // [9736] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9734] Access check. // [9743] 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)
{ {
// [9743] The record has been set. Check the record permissions. // [9752] 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))
{ {
// [9765] Now test the owner is the user. // [9774] 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))
{ {
// [9769] Need to do a lookup from the model. // [9778] 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;
} }
// [9777] If the owner matches 'me' then allow. // [9786] 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;
} }
} }
// [9799] Since there is no permission, revert to the component permissions. // [9808] 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 23rd December, 2015 @build 5th 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()
{ {
// [7521] Check for request forgeries // [7530] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7523] check if export is allowed for this user. // [7532] 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'))
{ {
// [7527] Get the input // [7536] 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');
// [7530] Sanitize the input // [7539] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7532] Get the model // [7541] Get the model
$model = $this->getModel('Preachers'); $model = $this->getModel('Preachers');
// [7534] get the data to export // [7543] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7538] now set the data to the spreadsheet // [7547] 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');
} }
} }
// [7543] Redirect to the list screen with error. // [7552] 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()
{ {
// [7552] Check for request forgeries // [7561] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7554] check if import is allowed for this user. // [7563] 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'))
{ {
// [7558] Get the import model // [7567] Get the import model
$model = $this->getModel('Preachers'); $model = $this->getModel('Preachers');
// [7560] get the headers to import // [7569] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7564] Load headers to session. // [7573] 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');
// [7570] Redirect to import view. // [7579] 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;
} }
} }
// [7582] Redirect to the list screen with error. // [7591] 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 23rd December, 2015 @build 5th 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())
{ {
// [9571] Access check. // [9580] 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;
} }
// [9582] In the absense of better information, revert to the component permissions. // [9591] 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')
{ {
// [9725] get user object. // [9734] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9727] get record id. // [9736] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9734] Access check. // [9743] 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)
{ {
// [9743] The record has been set. Check the record permissions. // [9752] 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))
{ {
// [9765] Now test the owner is the user. // [9774] 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))
{ {
// [9769] Need to do a lookup from the model. // [9778] 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;
} }
// [9777] If the owner matches 'me' then allow. // [9786] 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;
} }
} }
// [9799] Since there is no permission, revert to the component permissions. // [9808] 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 23rd December, 2015 @build 5th 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()
{ {
// [7521] Check for request forgeries // [7530] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7523] check if export is allowed for this user. // [7532] 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'))
{ {
// [7527] Get the input // [7536] 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');
// [7530] Sanitize the input // [7539] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7532] Get the model // [7541] Get the model
$model = $this->getModel('Series_list'); $model = $this->getModel('Series_list');
// [7534] get the data to export // [7543] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7538] now set the data to the spreadsheet // [7547] 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');
} }
} }
// [7543] Redirect to the list screen with error. // [7552] 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()
{ {
// [7552] Check for request forgeries // [7561] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7554] check if import is allowed for this user. // [7563] 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'))
{ {
// [7558] Get the import model // [7567] Get the import model
$model = $this->getModel('Series_list'); $model = $this->getModel('Series_list');
// [7560] get the headers to import // [7569] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7564] Load headers to session. // [7573] 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');
// [7570] Redirect to import view. // [7579] 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;
} }
} }
// [7582] Redirect to the list screen with error. // [7591] 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 23rd December, 2015 @build 5th 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())
{ {
// [9526] get the user object // [9535] get the user object
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9531] Access check. // [9540] 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)
{ {
// [9542] If the category has been passed in the URL check it. // [9551] 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)
{ {
// [9551] In the absense of better information, revert to the component permissions. // [9560] 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')
{ // [9629] get user object. { // [9638] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9631] get record id. // [9640] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9638] Access check. // [9647] 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)
{ {
// [9647] The record has been set. Check the record permissions. // [9656] 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))
{ {
// [9669] Fallback on edit.own. Now test the owner is the user. // [9678] 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))
{ {
// [9673] Need to do a lookup from the model. // [9682] 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;
} }
// [9681] If the owner matches 'me' then do the test. // [9690] 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)
{ {
// [9703] The category has been set. Check the category permissions. // [9712] 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
} }
} }
} }
// [9713] Since there is no permission, revert to the component permissions. // [9722] 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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()
{ {
// [7521] Check for request forgeries // [7530] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7523] check if export is allowed for this user. // [7532] 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'))
{ {
// [7527] Get the input // [7536] 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');
// [7530] Sanitize the input // [7539] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7532] Get the model // [7541] Get the model
$model = $this->getModel('Sermons'); $model = $this->getModel('Sermons');
// [7534] get the data to export // [7543] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7538] now set the data to the spreadsheet // [7547] 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');
} }
} }
// [7543] Redirect to the list screen with error. // [7552] 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()
{ {
// [7552] Check for request forgeries // [7561] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7554] check if import is allowed for this user. // [7563] 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'))
{ {
// [7558] Get the import model // [7567] Get the import model
$model = $this->getModel('Sermons'); $model = $this->getModel('Sermons');
// [7560] get the headers to import // [7569] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7564] Load headers to session. // [7573] 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');
// [7570] Redirect to import view. // [7579] 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;
} }
} }
// [7582] Redirect to the list screen with error. // [7591] 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 23rd December, 2015 @build 5th 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())
{ {
// [9571] Access check. // [9580] 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;
} }
// [9582] In the absense of better information, revert to the component permissions. // [9591] 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')
{ {
// [9725] get user object. // [9734] get user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [9727] get record id. // [9736] get record id.
$recordId = (int) isset($data[$key]) ? $data[$key] : 0; $recordId = (int) isset($data[$key]) ? $data[$key] : 0;
// [9734] Access check. // [9743] 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)
{ {
// [9743] The record has been set. Check the record permissions. // [9752] 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))
{ {
// [9765] Now test the owner is the user. // [9774] 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))
{ {
// [9769] Need to do a lookup from the model. // [9778] 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;
} }
// [9777] If the owner matches 'me' then allow. // [9786] 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;
} }
} }
// [9799] Since there is no permission, revert to the component permissions. // [9808] 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 23rd December, 2015 @build 5th 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()
{ {
// [7521] Check for request forgeries // [7530] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7523] check if export is allowed for this user. // [7532] 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'))
{ {
// [7527] Get the input // [7536] 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');
// [7530] Sanitize the input // [7539] Sanitize the input
JArrayHelper::toInteger($pks); JArrayHelper::toInteger($pks);
// [7532] Get the model // [7541] Get the model
$model = $this->getModel('Statistics'); $model = $this->getModel('Statistics');
// [7534] get the data to export // [7543] get the data to export
$data = $model->getExportData($pks); $data = $model->getExportData($pks);
if (SermondistributorHelper::checkArray($data)) if (SermondistributorHelper::checkArray($data))
{ {
// [7538] now set the data to the spreadsheet // [7547] 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');
} }
} }
// [7543] Redirect to the list screen with error. // [7552] 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()
{ {
// [7552] Check for request forgeries // [7561] Check for request forgeries
JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); JSession::checkToken() or die(JText::_('JINVALID_TOKEN'));
// [7554] check if import is allowed for this user. // [7563] 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'))
{ {
// [7558] Get the import model // [7567] Get the import model
$model = $this->getModel('Statistics'); $model = $this->getModel('Statistics');
// [7560] get the headers to import // [7569] get the headers to import
$headers = $model->getExImPortHeaders(); $headers = $model->getExImPortHeaders();
if (SermondistributorHelper::checkObject($headers)) if (SermondistributorHelper::checkObject($headers))
{ {
// [7564] Load headers to session. // [7573] 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');
// [7570] Redirect to import view. // [7579] 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;
} }
} }
// [7582] Redirect to the list screen with error. // [7591] 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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))
{ {
// [1482] if user not in those target groups then remove the item // [1487] if user not in those target groups then remove the item
unset($helps[$nr]); unset($helps[$nr]);
continue; continue;
} }
} }
// [1487] set the return type // [1492] set the return type
switch ($help->type) switch ($help->type)
{ {
// [1490] set joomla article // [1495] set joomla article
case 1: case 1:
return self::loadArticleLink($help->article); return self::loadArticleLink($help->article);
break; break;
// [1494] set help text // [1499] set help text
case 2: case 2:
return self::loadHelpTextLink($help->id); return self::loadHelpTextLink($help->id);
break; break;
// [1498] set Link // [1503] 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)
{ {
// [2726] reset // [2731] 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;
} }
} }
// [2735] make sure uikit is loaded to config // [2740] 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;
} }
// [2740] sorter // [2745] sorter
if (self::checkArray($temp)) if (self::checkArray($temp))
{ {
// [2743] merger // [2748] 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)
{ {
// [1537] set the user // [1542] set the user
$user = JFactory::getUser(); $user = JFactory::getUser();
// [1540] set fieldname if not set // [1545] 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');
} }
// [1545] set modiefied if not set // [1550] set modiefied if not set
if (!$modified) if (!$modified)
{ {
$modified = $user->name; $modified = $user->name;
} }
// [1550] set title if not set // [1555] set title if not set
if (!$title) if (!$title)
{ {
$title = 'Book1'; $title = 'Book1';
} }
// [1555] set tab name if not set // [1560] set tab name if not set
if (!$subjectTab) if (!$subjectTab)
{ {
$subjectTab = 'Sheet1'; $subjectTab = 'Sheet1';
} }
// [1561] make sure the file is loaded // [1566] make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// [1564] Create new PHPExcel object // [1569] Create new PHPExcel object
$objPHPExcel = new PHPExcel(); $objPHPExcel = new PHPExcel();
// [1567] Set document properties // [1572] 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);
} }
// [1586] Some styles // [1591] 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'
)); ));
// [1608] Add some data // [1613] 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;
} }
// [1635] Rename worksheet // [1640] Rename worksheet
$objPHPExcel->getActiveSheet()->setTitle($subjectTab); $objPHPExcel->getActiveSheet()->setTitle($subjectTab);
// [1638] Set active sheet index to the first sheet, so Excel opens this as the first sheet // [1643] Set active sheet index to the first sheet, so Excel opens this as the first sheet
$objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->setActiveSheetIndex(0);
// [1641] Redirect output to a client's web browser (Excel5) // [1646] 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');
// [1645] If you're serving to IE 9, then the following may be needed // [1650] 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');
// [1648] If you're serving to IE over SSL, then the following may be needed // [1653] 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)
{ {
// [1664] make sure the file is loaded // [1669] make sure the file is loaded
JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers'); JLoader::import('PHPExcel', JPATH_COMPONENT_ADMINISTRATOR . '/helpers');
// [1666] get session object // [1671] 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);
// [1670] set the headers // [1675] 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

@ -148,10 +148,6 @@ COM_SERMONDISTRIBUTOR_CONFIG_GRID="Grid"
COM_SERMONDISTRIBUTOR_CONFIG_JPEG=".jpeg" COM_SERMONDISTRIBUTOR_CONFIG_JPEG=".jpeg"
COM_SERMONDISTRIBUTOR_CONFIG_JPG=".jpg" COM_SERMONDISTRIBUTOR_CONFIG_JPG=".jpg"
COM_SERMONDISTRIBUTOR_CONFIG_LEGACY="Legacy" COM_SERMONDISTRIBUTOR_CONFIG_LEGACY="Legacy"
COM_SERMONDISTRIBUTOR_CONFIG_LICENSE_KEY_DESC="Add your license key here."
COM_SERMONDISTRIBUTOR_CONFIG_LICENSE_KEY_LABEL="License Key"
COM_SERMONDISTRIBUTOR_CONFIG_LICENSE_KEY_NOTE_DESC="To get updates you must add the license key here that you recieved from Vast Development Method"
COM_SERMONDISTRIBUTOR_CONFIG_LICENSE_KEY_NOTE_LABEL="Your License Key"
COM_SERMONDISTRIBUTOR_CONFIG_LINES="Lines" COM_SERMONDISTRIBUTOR_CONFIG_LINES="Lines"
COM_SERMONDISTRIBUTOR_CONFIG_LINK_ENCRYPTION_DESCRIPTION="Add the key to use when download link option is set to encrypted." COM_SERMONDISTRIBUTOR_CONFIG_LINK_ENCRYPTION_DESCRIPTION="Add the key to use when download link option is set to encrypted."
COM_SERMONDISTRIBUTOR_CONFIG_LINK_ENCRYPTION_HINT="DBwAHPAqoFWZfDWZo6sd)E3cv2oMTG^r" COM_SERMONDISTRIBUTOR_CONFIG_LINK_ENCRYPTION_HINT="DBwAHPAqoFWZfDWZo6sd)E3cv2oMTG^r"

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.0 @version 1.3.0
@build 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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->pblsermons; $items = $displayData->nassermons;
$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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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->skxsermons; $items = $displayData->zswsermons;
$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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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->pomstastics; $items = $displayData->vrfstastics;
$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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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
} }
// [9168] Used in sermon // [9177] 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 23rd December, 2015 @build 5th 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()
{ {
// [7943] see if we should add buttons // [7952] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7945] get html // [7954] get html
$html = parent::getInput(); $html = parent::getInput();
// [7947] if true set button // [7956] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7951] only add if user allowed to create article // [7960] only add if user allowed to create article
if ($user->authorise('core.create', 'com_sermondistributor')) if ($user->authorise('core.create', 'com_sermondistributor'))
{ {
// [7969] get the input from url // [7978] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7971] get the view name & id // [7980] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7976] check if new item // [7985] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7980] only load referal if not new item. // [7989] only load referal if not new item.
$ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; $ref = '&ref=' . $values['view'] . '&refid=' . $values['id'];
} }
// [7983] build the button // [7992] 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>';
// [7987] return the button attached to input field // [7996] 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 23rd December, 2015 @build 5th 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()
{ {
// [7943] see if we should add buttons // [7952] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7945] get html // [7954] get html
$html = parent::getInput(); $html = parent::getInput();
// [7947] if true set button // [7956] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7951] only add if user allowed to create // [7960] only add if user allowed to create
if ($user->authorise('core.create', 'com_sermondistributor')) if ($user->authorise('core.create', 'com_sermondistributor'))
{ {
// [7969] get the input from url // [7978] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7971] get the view name & id // [7980] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7976] check if new item // [7985] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7980] only load referal if not new item. // [7989] 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'];
} }
// [7983] build the button // [7992] 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>';
// [7987] return the button attached to input field // [7996] 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 23rd December, 2015 @build 5th 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()
{ {
// [7943] see if we should add buttons // [7952] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7945] get html // [7954] get html
$html = parent::getInput(); $html = parent::getInput();
// [7947] if true set button // [7956] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7951] only add if user allowed to create // [7960] only add if user allowed to create
if ($user->authorise('core.create', 'com_sermondistributor')) if ($user->authorise('core.create', 'com_sermondistributor'))
{ {
// [7969] get the input from url // [7978] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7971] get the view name & id // [7980] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7976] check if new item // [7985] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7980] only load referal if not new item. // [7989] 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'];
} }
// [7983] build the button // [7992] 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>';
// [7987] return the button attached to input field // [7996] 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 23rd December, 2015 @build 5th 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()
{ {
// [7943] see if we should add buttons // [7952] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7945] get html // [7954] get html
$html = parent::getInput(); $html = parent::getInput();
// [7947] if true set button // [7956] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7951] only add if user allowed to create preacher // [7960] only add if user allowed to create preacher
if ($user->authorise('preacher.create', 'com_sermondistributor')) if ($user->authorise('preacher.create', 'com_sermondistributor'))
{ {
// [7969] get the input from url // [7978] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7971] get the view name & id // [7980] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7976] check if new item // [7985] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7980] only load referal if not new item. // [7989] 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'];
} }
// [7983] build the button // [7992] 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>';
// [7987] return the button attached to input field // [7996] 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 23rd December, 2015 @build 5th 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()
{ {
// [7943] see if we should add buttons // [7952] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7945] get html // [7954] get html
$html = parent::getInput(); $html = parent::getInput();
// [7947] if true set button // [7956] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7951] only add if user allowed to create series // [7960] only add if user allowed to create series
if ($user->authorise('series.create', 'com_sermondistributor')) if ($user->authorise('series.create', 'com_sermondistributor'))
{ {
// [7969] get the input from url // [7978] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7971] get the view name & id // [7980] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7976] check if new item // [7985] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7980] only load referal if not new item. // [7989] 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'];
} }
// [7983] build the button // [7992] 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>';
// [7987] return the button attached to input field // [7996] 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 23rd December, 2015 @build 5th 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()
{ {
// [7943] see if we should add buttons // [7952] see if we should add buttons
$setButton = $this->getAttribute('button'); $setButton = $this->getAttribute('button');
// [7945] get html // [7954] get html
$html = parent::getInput(); $html = parent::getInput();
// [7947] if true set button // [7956] if true set button
if ($setButton === 'true') if ($setButton === 'true')
{ {
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7951] only add if user allowed to create sermon // [7960] only add if user allowed to create sermon
if ($user->authorise('sermon.create', 'com_sermondistributor')) if ($user->authorise('sermon.create', 'com_sermondistributor'))
{ {
// [7969] get the input from url // [7978] get the input from url
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
// [7971] get the view name & id // [7980] get the view name & id
$values = $jinput->getArray(array( $values = $jinput->getArray(array(
'id' => 'int', 'id' => 'int',
'view' => 'word' 'view' => 'word'
)); ));
// [7976] check if new item // [7985] check if new item
$ref = ''; $ref = '';
if (!is_null($values['id']) && strlen($values['view'])) if (!is_null($values['id']) && strlen($values['view']))
{ {
// [7980] only load referal if not new item. // [7989] 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'];
} }
// [7983] build the button // [7992] 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>';
// [7987] return the button attached to input field // [7996] 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 23rd December, 2015 @build 5th 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_KVFJfFjKLp_required = false; jform_yDXLKGLYQj_required = false;
jform_PVcvKoRLlz_required = false; jform_vHHglafOKE_required = false;
jform_RaenoglczP_required = false; jform_iTgyasQeff_required = false;
jform_roNdXRBgDs_required = false; jform_txHrnuSUsE_required = false;
// Initial Script // Initial Script
jQuery(document).ready(function() jQuery(document).ready(function()
{ {
var location_VcFiOMv = jQuery("#jform_location input[type='radio']:checked").val(); var location_wJBqozs = jQuery("#jform_location input[type='radio']:checked").val();
VcFiOMv(location_VcFiOMv); wJBqozs(location_wJBqozs);
var location_nbWIzGw = jQuery("#jform_location input[type='radio']:checked").val(); var location_gkleSmj = jQuery("#jform_location input[type='radio']:checked").val();
nbWIzGw(location_nbWIzGw); gkleSmj(location_gkleSmj);
var type_KVFJfFj = jQuery("#jform_type").val(); var type_yDXLKGL = jQuery("#jform_type").val();
KVFJfFj(type_KVFJfFj); yDXLKGL(type_yDXLKGL);
var type_PVcvKoR = jQuery("#jform_type").val(); var type_vHHglaf = jQuery("#jform_type").val();
PVcvKoR(type_PVcvKoR); vHHglaf(type_vHHglaf);
var type_Raenogl = jQuery("#jform_type").val(); var type_iTgyasQ = jQuery("#jform_type").val();
Raenogl(type_Raenogl); iTgyasQ(type_iTgyasQ);
var target_roNdXRB = jQuery("#jform_target input[type='radio']:checked").val(); var target_txHrnuS = jQuery("#jform_target input[type='radio']:checked").val();
roNdXRB(target_roNdXRB); txHrnuS(target_txHrnuS);
}); });
// the VcFiOMv function // the wJBqozs function
function VcFiOMv(location_VcFiOMv) function wJBqozs(location_wJBqozs)
{ {
// [8260] set the function logic // [8269] set the function logic
if (location_VcFiOMv == 1) if (location_wJBqozs == 1)
{ {
jQuery('#jform_admin_view').closest('.control-group').show(); jQuery('#jform_admin_view').closest('.control-group').show();
} }
@ -64,11 +64,11 @@ function VcFiOMv(location_VcFiOMv)
} }
} }
// the nbWIzGw function // the gkleSmj function
function nbWIzGw(location_nbWIzGw) function gkleSmj(location_gkleSmj)
{ {
// [8260] set the function logic // [8269] set the function logic
if (location_nbWIzGw == 2) if (location_gkleSmj == 2)
{ {
jQuery('#jform_site_view').closest('.control-group').show(); jQuery('#jform_site_view').closest('.control-group').show();
} }
@ -78,198 +78,198 @@ function nbWIzGw(location_nbWIzGw)
} }
} }
// the KVFJfFj function // the yDXLKGL function
function KVFJfFj(type_KVFJfFj) function yDXLKGL(type_yDXLKGL)
{ {
if (isSet(type_KVFJfFj) && type_KVFJfFj.constructor !== Array) if (isSet(type_yDXLKGL) && type_yDXLKGL.constructor !== Array)
{ {
var temp_KVFJfFj = type_KVFJfFj; var temp_yDXLKGL = type_yDXLKGL;
var type_KVFJfFj = []; var type_yDXLKGL = [];
type_KVFJfFj.push(temp_KVFJfFj); type_yDXLKGL.push(temp_yDXLKGL);
} }
else if (!isSet(type_KVFJfFj)) else if (!isSet(type_yDXLKGL))
{ {
var type_KVFJfFj = []; var type_yDXLKGL = [];
} }
var type = type_KVFJfFj.some(type_KVFJfFj_SomeFunc); var type = type_yDXLKGL.some(type_yDXLKGL_SomeFunc);
// [8238] set this function logic // [8247] set this function logic
if (type) if (type)
{ {
jQuery('#jform_url').closest('.control-group').show(); jQuery('#jform_url').closest('.control-group').show();
if (jform_KVFJfFjKLp_required) if (jform_yDXLKGLYQj_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_KVFJfFjKLp_required = false; jform_yDXLKGLYQj_required = false;
} }
} }
else else
{ {
jQuery('#jform_url').closest('.control-group').hide(); jQuery('#jform_url').closest('.control-group').hide();
if (!jform_KVFJfFjKLp_required) if (!jform_yDXLKGLYQj_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_KVFJfFjKLp_required = true; jform_yDXLKGLYQj_required = true;
} }
} }
} }
// the KVFJfFj Some function // the yDXLKGL Some function
function type_KVFJfFj_SomeFunc(type_KVFJfFj) function type_yDXLKGL_SomeFunc(type_yDXLKGL)
{ {
// [8225] set the function logic // [8234] set the function logic
if (type_KVFJfFj == 3) if (type_yDXLKGL == 3)
{ {
return true; return true;
} }
return false; return false;
} }
// the PVcvKoR function // the vHHglaf function
function PVcvKoR(type_PVcvKoR) function vHHglaf(type_vHHglaf)
{ {
if (isSet(type_PVcvKoR) && type_PVcvKoR.constructor !== Array) if (isSet(type_vHHglaf) && type_vHHglaf.constructor !== Array)
{ {
var temp_PVcvKoR = type_PVcvKoR; var temp_vHHglaf = type_vHHglaf;
var type_PVcvKoR = []; var type_vHHglaf = [];
type_PVcvKoR.push(temp_PVcvKoR); type_vHHglaf.push(temp_vHHglaf);
} }
else if (!isSet(type_PVcvKoR)) else if (!isSet(type_vHHglaf))
{ {
var type_PVcvKoR = []; var type_vHHglaf = [];
} }
var type = type_PVcvKoR.some(type_PVcvKoR_SomeFunc); var type = type_vHHglaf.some(type_vHHglaf_SomeFunc);
// [8238] set this function logic // [8247] set this function logic
if (type) if (type)
{ {
jQuery('#jform_article').closest('.control-group').show(); jQuery('#jform_article').closest('.control-group').show();
if (jform_PVcvKoRLlz_required) if (jform_vHHglafOKE_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_PVcvKoRLlz_required = false; jform_vHHglafOKE_required = false;
} }
} }
else else
{ {
jQuery('#jform_article').closest('.control-group').hide(); jQuery('#jform_article').closest('.control-group').hide();
if (!jform_PVcvKoRLlz_required) if (!jform_vHHglafOKE_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_PVcvKoRLlz_required = true; jform_vHHglafOKE_required = true;
} }
} }
} }
// the PVcvKoR Some function // the vHHglaf Some function
function type_PVcvKoR_SomeFunc(type_PVcvKoR) function type_vHHglaf_SomeFunc(type_vHHglaf)
{ {
// [8225] set the function logic // [8234] set the function logic
if (type_PVcvKoR == 1) if (type_vHHglaf == 1)
{ {
return true; return true;
} }
return false; return false;
} }
// the Raenogl function // the iTgyasQ function
function Raenogl(type_Raenogl) function iTgyasQ(type_iTgyasQ)
{ {
if (isSet(type_Raenogl) && type_Raenogl.constructor !== Array) if (isSet(type_iTgyasQ) && type_iTgyasQ.constructor !== Array)
{ {
var temp_Raenogl = type_Raenogl; var temp_iTgyasQ = type_iTgyasQ;
var type_Raenogl = []; var type_iTgyasQ = [];
type_Raenogl.push(temp_Raenogl); type_iTgyasQ.push(temp_iTgyasQ);
} }
else if (!isSet(type_Raenogl)) else if (!isSet(type_iTgyasQ))
{ {
var type_Raenogl = []; var type_iTgyasQ = [];
} }
var type = type_Raenogl.some(type_Raenogl_SomeFunc); var type = type_iTgyasQ.some(type_iTgyasQ_SomeFunc);
// [8238] set this function logic // [8247] 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_RaenoglczP_required) if (jform_iTgyasQeff_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_RaenoglczP_required = false; jform_iTgyasQeff_required = false;
} }
} }
else else
{ {
jQuery('#jform_content-lbl').closest('.control-group').hide(); jQuery('#jform_content-lbl').closest('.control-group').hide();
if (!jform_RaenoglczP_required) if (!jform_iTgyasQeff_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_RaenoglczP_required = true; jform_iTgyasQeff_required = true;
} }
} }
} }
// the Raenogl Some function // the iTgyasQ Some function
function type_Raenogl_SomeFunc(type_Raenogl) function type_iTgyasQ_SomeFunc(type_iTgyasQ)
{ {
// [8225] set the function logic // [8234] set the function logic
if (type_Raenogl == 2) if (type_iTgyasQ == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the roNdXRB function // the txHrnuS function
function roNdXRB(target_roNdXRB) function txHrnuS(target_txHrnuS)
{ {
// [8260] set the function logic // [8269] set the function logic
if (target_roNdXRB == 1) if (target_txHrnuS == 1)
{ {
jQuery('#jform_groups').closest('.control-group').show(); jQuery('#jform_groups').closest('.control-group').show();
if (jform_roNdXRBgDs_required) if (jform_txHrnuSUsE_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_roNdXRBgDs_required = false; jform_txHrnuSUsE_required = false;
} }
} }
else else
{ {
jQuery('#jform_groups').closest('.control-group').hide(); jQuery('#jform_groups').closest('.control-group').hide();
if (!jform_roNdXRBgDs_required) if (!jform_txHrnuSUsE_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_roNdXRBgDs_required = true; jform_txHrnuSUsE_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">
<!-- [11275] Default Fields. --> <!-- [11284] Default Fields. -->
<!-- [11276] Id Field. Type: Text (joomla) --> <!-- [11285] 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"
/> />
<!-- [11283] Date Created Field. Type: Calendar (joomla) --> <!-- [11292] 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"
/> />
<!-- [11294] User Created Field. Type: User (joomla) --> <!-- [11303] 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"
/> />
<!-- [11302] Published Field. Type: List (joomla) --> <!-- [11311] 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>
<!-- [11317] Date Modified Field. Type: Calendar (joomla) --> <!-- [11326] 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" />
<!-- [11321] User Modified Field. Type: User (joomla) --> <!-- [11330] 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"
/> />
<!-- [11331] Access Field. Type: Accesslevel (joomla) --> <!-- [11340] 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"
/> />
<!-- [11341] Ordering Field. Type: Numbers (joomla) --> <!-- [11350] 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"
/> />
<!-- [11353] Version Field. Type: Text (joomla) --> <!-- [11362] 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"
/> />
<!-- [11367] Metakey Field. Type: Textarea (joomla) --> <!-- [11376] 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"
/> />
<!-- [11376] Metadesc Field. Type: Textarea (joomla) --> <!-- [11385] 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"
/> />
<!-- [11386] Dynamic Fields. --> <!-- [11395] Dynamic Fields. -->
<!-- [11622] Title Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11536] Type Field. Type: List. (joomla) --> <!-- [11545] 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">
<!-- [11608] Option Set. --> <!-- [11617] 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>
<!-- [11622] Groups Field. Type: Usergroup. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11536] Location Field. Type: Radio. (joomla) --> <!-- [11545] 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">
<!-- [11608] Option Set. --> <!-- [11617] 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>
<!-- [11622] Admin_view Field. Type: Folderlist. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Site_view Field. Type: Folderlist. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11536] Target Field. Type: Radio. (joomla) --> <!-- [11545] 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">
<!-- [11608] Option Set. --> <!-- [11617] 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>
<!-- [11622] Content Field. Type: Editor. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Alias Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11743] Article Field. Type: Articles. (custom) --> <!-- [11752] 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"
/> />
<!-- [11622] Url Field. Type: Url. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Not_required Field. Type: Hidden. (joomla) --> <!-- [11631] Not_required Field. Type: Hidden. (joomla) -->
<field <field
type="hidden" type="hidden"
name="not_required" name="not_required"
@ -247,11 +247,11 @@
/> />
</fieldset> </fieldset>
<!-- [11405] Metadata Fields. --> <!-- [11414] 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">
<!-- [11409] Robots Field. Type: List (joomla) --> <!-- [11418] 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>
<!-- [11420] Author Field. Type: Text (joomla) --> <!-- [11429] 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"
/> />
<!-- [11426] Rights Field. Type: Textarea (joomla) --> <!-- [11435] 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>
<!-- [10308] Access Control Fields. --> <!-- [10317] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10310] Asset Id Field. Type: Hidden (joomla) --> <!-- [10319] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10316] Rules Field. Type: Rules (joomla) --> <!-- [10325] 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 23rd December, 2015 @build 5th 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">
<!-- [11275] Default Fields. --> <!-- [11284] Default Fields. -->
<!-- [11276] Id Field. Type: Text (joomla) --> <!-- [11285] 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"
/> />
<!-- [11283] Date Created Field. Type: Calendar (joomla) --> <!-- [11292] 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"
/> />
<!-- [11294] User Created Field. Type: User (joomla) --> <!-- [11303] 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"
/> />
<!-- [11302] Published Field. Type: List (joomla) --> <!-- [11311] 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>
<!-- [11317] Date Modified Field. Type: Calendar (joomla) --> <!-- [11326] 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" />
<!-- [11321] User Modified Field. Type: User (joomla) --> <!-- [11330] 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"
/> />
<!-- [11331] Access Field. Type: Accesslevel (joomla) --> <!-- [11340] 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"
/> />
<!-- [11341] Ordering Field. Type: Numbers (joomla) --> <!-- [11350] 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"
/> />
<!-- [11353] Version Field. Type: Text (joomla) --> <!-- [11362] 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"
/> />
<!-- [11367] Metakey Field. Type: Textarea (joomla) --> <!-- [11376] 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"
/> />
<!-- [11376] Metadesc Field. Type: Textarea (joomla) --> <!-- [11385] 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"
/> />
<!-- [11386] Dynamic Fields. --> <!-- [11395] Dynamic Fields. -->
<!-- [11622] Name Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Description Field. Type: Editor. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Alias Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Email Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Website Field. Type: Url. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Icon Field. Type: Media. (joomla) --> <!-- [11631] Icon Field. Type: Media. (joomla) -->
<field <field
type="media" type="media"
name="icon" name="icon"
@ -178,11 +178,11 @@
/> />
</fieldset> </fieldset>
<!-- [11405] Metadata Fields. --> <!-- [11414] 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">
<!-- [11409] Robots Field. Type: List (joomla) --> <!-- [11418] 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>
<!-- [11420] Author Field. Type: Text (joomla) --> <!-- [11429] 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"
/> />
<!-- [11426] Rights Field. Type: Textarea (joomla) --> <!-- [11435] 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>
<!-- [10308] Access Control Fields. --> <!-- [10317] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10310] Asset Id Field. Type: Hidden (joomla) --> <!-- [10319] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10316] Rules Field. Type: Rules (joomla) --> <!-- [10325] 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 23rd December, 2015 @build 5th 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">
<!-- [11275] Default Fields. --> <!-- [11284] Default Fields. -->
<!-- [11276] Id Field. Type: Text (joomla) --> <!-- [11285] 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"
/> />
<!-- [11283] Date Created Field. Type: Calendar (joomla) --> <!-- [11292] 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"
/> />
<!-- [11294] User Created Field. Type: User (joomla) --> <!-- [11303] 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"
/> />
<!-- [11302] Published Field. Type: List (joomla) --> <!-- [11311] 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>
<!-- [11317] Date Modified Field. Type: Calendar (joomla) --> <!-- [11326] 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" />
<!-- [11321] User Modified Field. Type: User (joomla) --> <!-- [11330] 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"
/> />
<!-- [11331] Access Field. Type: Accesslevel (joomla) --> <!-- [11340] 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"
/> />
<!-- [11341] Ordering Field. Type: Numbers (joomla) --> <!-- [11350] 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"
/> />
<!-- [11353] Version Field. Type: Text (joomla) --> <!-- [11362] 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"
/> />
<!-- [11367] Metakey Field. Type: Textarea (joomla) --> <!-- [11376] 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"
/> />
<!-- [11376] Metadesc Field. Type: Textarea (joomla) --> <!-- [11385] 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"
/> />
<!-- [11386] Dynamic Fields. --> <!-- [11395] Dynamic Fields. -->
<!-- [11622] Name Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Description Field. Type: Editor. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Alias Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Icon Field. Type: Media. (joomla) --> <!-- [11631] 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=""
/> />
<!-- [11622] Scripture Field. Type: Text. (joomla) --> <!-- [11631] Scripture Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="scripture" name="scripture"
@ -165,11 +165,11 @@
/> />
</fieldset> </fieldset>
<!-- [11405] Metadata Fields. --> <!-- [11414] 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">
<!-- [11409] Robots Field. Type: List (joomla) --> <!-- [11418] 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>
<!-- [11420] Author Field. Type: Text (joomla) --> <!-- [11429] 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"
/> />
<!-- [11426] Rights Field. Type: Textarea (joomla) --> <!-- [11435] 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>
<!-- [10308] Access Control Fields. --> <!-- [10317] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10310] Asset Id Field. Type: Hidden (joomla) --> <!-- [10319] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10316] Rules Field. Type: Rules (joomla) --> <!-- [10325] 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 23rd December, 2015 @build 5th 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_iZRZzQyybj_required = false; jform_FEFzgVWDPW_required = false;
jform_EnSYbTjjQc_required = false; jform_pXwBipvOab_required = false;
jform_jqQIKTSzxn_required = false; jform_njVgKMfRGW_required = false;
jform_lAIfOHIxFe_required = false; jform_BGnLThLamW_required = false;
jform_UkrHisGoCy_required = false; jform_kwSAfbWIQX_required = false;
// Initial Script // Initial Script
jQuery(document).ready(function() jQuery(document).ready(function()
{ {
var source_iZRZzQy = jQuery("#jform_source").val(); var source_FEFzgVW = jQuery("#jform_source").val();
iZRZzQy(source_iZRZzQy); FEFzgVW(source_FEFzgVW);
var source_WwtGkmR = jQuery("#jform_source").val(); var source_kXSJVyd = jQuery("#jform_source").val();
var build_WwtGkmR = jQuery("#jform_build input[type='radio']:checked").val(); var build_kXSJVyd = jQuery("#jform_build input[type='radio']:checked").val();
WwtGkmR(source_WwtGkmR,build_WwtGkmR); kXSJVyd(source_kXSJVyd,build_kXSJVyd);
var source_EnSYbTj = jQuery("#jform_source").val(); var source_pXwBipv = jQuery("#jform_source").val();
var build_EnSYbTj = jQuery("#jform_build input[type='radio']:checked").val(); var build_pXwBipv = jQuery("#jform_build input[type='radio']:checked").val();
EnSYbTj(source_EnSYbTj,build_EnSYbTj); pXwBipv(source_pXwBipv,build_pXwBipv);
var build_jqQIKTS = jQuery("#jform_build input[type='radio']:checked").val(); var build_njVgKMf = jQuery("#jform_build input[type='radio']:checked").val();
var source_jqQIKTS = jQuery("#jform_source").val(); var source_njVgKMf = jQuery("#jform_source").val();
jqQIKTS(build_jqQIKTS,source_jqQIKTS); njVgKMf(build_njVgKMf,source_njVgKMf);
var source_lAIfOHI = jQuery("#jform_source").val(); var source_BGnLThL = jQuery("#jform_source").val();
lAIfOHI(source_lAIfOHI); BGnLThL(source_BGnLThL);
var source_UkrHisG = jQuery("#jform_source").val(); var source_kwSAfbW = jQuery("#jform_source").val();
UkrHisG(source_UkrHisG); kwSAfbW(source_kwSAfbW);
var link_type_xJKoumd = jQuery("#jform_link_type input[type='radio']:checked").val(); var link_type_KcgziOs = jQuery("#jform_link_type input[type='radio']:checked").val();
xJKoumd(link_type_xJKoumd); KcgziOs(link_type_KcgziOs);
var link_type_oUuxich = jQuery("#jform_link_type input[type='radio']:checked").val(); var link_type_mIYnoFx = jQuery("#jform_link_type input[type='radio']:checked").val();
oUuxich(link_type_oUuxich); mIYnoFx(link_type_mIYnoFx);
}); });
// the iZRZzQy function // the FEFzgVW function
function iZRZzQy(source_iZRZzQy) function FEFzgVW(source_FEFzgVW)
{ {
if (isSet(source_iZRZzQy) && source_iZRZzQy.constructor !== Array) if (isSet(source_FEFzgVW) && source_FEFzgVW.constructor !== Array)
{ {
var temp_iZRZzQy = source_iZRZzQy; var temp_FEFzgVW = source_FEFzgVW;
var source_iZRZzQy = []; var source_FEFzgVW = [];
source_iZRZzQy.push(temp_iZRZzQy); source_FEFzgVW.push(temp_FEFzgVW);
} }
else if (!isSet(source_iZRZzQy)) else if (!isSet(source_FEFzgVW))
{ {
var source_iZRZzQy = []; var source_FEFzgVW = [];
} }
var source = source_iZRZzQy.some(source_iZRZzQy_SomeFunc); var source = source_FEFzgVW.some(source_FEFzgVW_SomeFunc);
// [8238] set this function logic // [8247] set this function logic
if (source) if (source)
{ {
jQuery('#jform_build').closest('.control-group').show(); jQuery('#jform_build').closest('.control-group').show();
if (jform_iZRZzQyybj_required) if (jform_FEFzgVWDPW_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_iZRZzQyybj_required = false; jform_FEFzgVWDPW_required = false;
} }
} }
else else
{ {
jQuery('#jform_build').closest('.control-group').hide(); jQuery('#jform_build').closest('.control-group').hide();
if (!jform_iZRZzQyybj_required) if (!jform_FEFzgVWDPW_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_iZRZzQyybj_required = true; jform_FEFzgVWDPW_required = true;
} }
} }
} }
// the iZRZzQy Some function // the FEFzgVW Some function
function source_iZRZzQy_SomeFunc(source_iZRZzQy) function source_FEFzgVW_SomeFunc(source_FEFzgVW)
{ {
// [8225] set the function logic // [8234] set the function logic
if (source_iZRZzQy == 2) if (source_FEFzgVW == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the WwtGkmR function // the kXSJVyd function
function WwtGkmR(source_WwtGkmR,build_WwtGkmR) function kXSJVyd(source_kXSJVyd,build_kXSJVyd)
{ {
if (isSet(source_WwtGkmR) && source_WwtGkmR.constructor !== Array) if (isSet(source_kXSJVyd) && source_kXSJVyd.constructor !== Array)
{ {
var temp_WwtGkmR = source_WwtGkmR; var temp_kXSJVyd = source_kXSJVyd;
var source_WwtGkmR = []; var source_kXSJVyd = [];
source_WwtGkmR.push(temp_WwtGkmR); source_kXSJVyd.push(temp_kXSJVyd);
} }
else if (!isSet(source_WwtGkmR)) else if (!isSet(source_kXSJVyd))
{ {
var source_WwtGkmR = []; var source_kXSJVyd = [];
} }
var source = source_WwtGkmR.some(source_WwtGkmR_SomeFunc); var source = source_kXSJVyd.some(source_kXSJVyd_SomeFunc);
if (isSet(build_WwtGkmR) && build_WwtGkmR.constructor !== Array) if (isSet(build_kXSJVyd) && build_kXSJVyd.constructor !== Array)
{ {
var temp_WwtGkmR = build_WwtGkmR; var temp_kXSJVyd = build_kXSJVyd;
var build_WwtGkmR = []; var build_kXSJVyd = [];
build_WwtGkmR.push(temp_WwtGkmR); build_kXSJVyd.push(temp_kXSJVyd);
} }
else if (!isSet(build_WwtGkmR)) else if (!isSet(build_kXSJVyd))
{ {
var build_WwtGkmR = []; var build_kXSJVyd = [];
} }
var build = build_WwtGkmR.some(build_WwtGkmR_SomeFunc); var build = build_kXSJVyd.some(build_kXSJVyd_SomeFunc);
// [8238] set this function logic // [8247] 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 WwtGkmR(source_WwtGkmR,build_WwtGkmR)
} }
} }
// the WwtGkmR Some function // the kXSJVyd Some function
function source_WwtGkmR_SomeFunc(source_WwtGkmR) function source_kXSJVyd_SomeFunc(source_kXSJVyd)
{ {
// [8225] set the function logic // [8234] set the function logic
if (source_WwtGkmR == 2) if (source_kXSJVyd == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the WwtGkmR Some function // the kXSJVyd Some function
function build_WwtGkmR_SomeFunc(build_WwtGkmR) function build_kXSJVyd_SomeFunc(build_kXSJVyd)
{ {
// [8225] set the function logic // [8234] set the function logic
if (build_WwtGkmR == 2) if (build_kXSJVyd == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the EnSYbTj function // the pXwBipv function
function EnSYbTj(source_EnSYbTj,build_EnSYbTj) function pXwBipv(source_pXwBipv,build_pXwBipv)
{ {
if (isSet(source_EnSYbTj) && source_EnSYbTj.constructor !== Array) if (isSet(source_pXwBipv) && source_pXwBipv.constructor !== Array)
{ {
var temp_EnSYbTj = source_EnSYbTj; var temp_pXwBipv = source_pXwBipv;
var source_EnSYbTj = []; var source_pXwBipv = [];
source_EnSYbTj.push(temp_EnSYbTj); source_pXwBipv.push(temp_pXwBipv);
} }
else if (!isSet(source_EnSYbTj)) else if (!isSet(source_pXwBipv))
{ {
var source_EnSYbTj = []; var source_pXwBipv = [];
} }
var source = source_EnSYbTj.some(source_EnSYbTj_SomeFunc); var source = source_pXwBipv.some(source_pXwBipv_SomeFunc);
if (isSet(build_EnSYbTj) && build_EnSYbTj.constructor !== Array) if (isSet(build_pXwBipv) && build_pXwBipv.constructor !== Array)
{ {
var temp_EnSYbTj = build_EnSYbTj; var temp_pXwBipv = build_pXwBipv;
var build_EnSYbTj = []; var build_pXwBipv = [];
build_EnSYbTj.push(temp_EnSYbTj); build_pXwBipv.push(temp_pXwBipv);
} }
else if (!isSet(build_EnSYbTj)) else if (!isSet(build_pXwBipv))
{ {
var build_EnSYbTj = []; var build_pXwBipv = [];
} }
var build = build_EnSYbTj.some(build_EnSYbTj_SomeFunc); var build = build_pXwBipv.some(build_pXwBipv_SomeFunc);
// [8238] set this function logic // [8247] 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_EnSYbTjjQc_required) if (jform_pXwBipvOab_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_EnSYbTjjQc_required = false; jform_pXwBipvOab_required = false;
} }
jQuery('.note_manual_dropbox').closest('.control-group').show(); jQuery('.note_manual_dropbox').closest('.control-group').show();
@ -222,79 +222,79 @@ function EnSYbTj(source_EnSYbTj,build_EnSYbTj)
else else
{ {
jQuery('#jform_manual_files').closest('.control-group').hide(); jQuery('#jform_manual_files').closest('.control-group').hide();
if (!jform_EnSYbTjjQc_required) if (!jform_pXwBipvOab_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_EnSYbTjjQc_required = true; jform_pXwBipvOab_required = true;
} }
jQuery('.note_manual_dropbox').closest('.control-group').hide(); jQuery('.note_manual_dropbox').closest('.control-group').hide();
} }
} }
// the EnSYbTj Some function // the pXwBipv Some function
function source_EnSYbTj_SomeFunc(source_EnSYbTj) function source_pXwBipv_SomeFunc(source_pXwBipv)
{ {
// [8225] set the function logic // [8234] set the function logic
if (source_EnSYbTj == 2) if (source_pXwBipv == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the EnSYbTj Some function // the pXwBipv Some function
function build_EnSYbTj_SomeFunc(build_EnSYbTj) function build_pXwBipv_SomeFunc(build_pXwBipv)
{ {
// [8225] set the function logic // [8234] set the function logic
if (build_EnSYbTj == 1) if (build_pXwBipv == 1)
{ {
return true; return true;
} }
return false; return false;
} }
// the jqQIKTS function // the njVgKMf function
function jqQIKTS(build_jqQIKTS,source_jqQIKTS) function njVgKMf(build_njVgKMf,source_njVgKMf)
{ {
if (isSet(build_jqQIKTS) && build_jqQIKTS.constructor !== Array) if (isSet(build_njVgKMf) && build_njVgKMf.constructor !== Array)
{ {
var temp_jqQIKTS = build_jqQIKTS; var temp_njVgKMf = build_njVgKMf;
var build_jqQIKTS = []; var build_njVgKMf = [];
build_jqQIKTS.push(temp_jqQIKTS); build_njVgKMf.push(temp_njVgKMf);
} }
else if (!isSet(build_jqQIKTS)) else if (!isSet(build_njVgKMf))
{ {
var build_jqQIKTS = []; var build_njVgKMf = [];
} }
var build = build_jqQIKTS.some(build_jqQIKTS_SomeFunc); var build = build_njVgKMf.some(build_njVgKMf_SomeFunc);
if (isSet(source_jqQIKTS) && source_jqQIKTS.constructor !== Array) if (isSet(source_njVgKMf) && source_njVgKMf.constructor !== Array)
{ {
var temp_jqQIKTS = source_jqQIKTS; var temp_njVgKMf = source_njVgKMf;
var source_jqQIKTS = []; var source_njVgKMf = [];
source_jqQIKTS.push(temp_jqQIKTS); source_njVgKMf.push(temp_njVgKMf);
} }
else if (!isSet(source_jqQIKTS)) else if (!isSet(source_njVgKMf))
{ {
var source_jqQIKTS = []; var source_njVgKMf = [];
} }
var source = source_jqQIKTS.some(source_jqQIKTS_SomeFunc); var source = source_njVgKMf.some(source_njVgKMf_SomeFunc);
// [8238] set this function logic // [8247] 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_jqQIKTSzxn_required) if (jform_njVgKMfRGW_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_jqQIKTSzxn_required = false; jform_njVgKMfRGW_required = false;
} }
jQuery('.note_manual_dropbox').closest('.control-group').show(); jQuery('.note_manual_dropbox').closest('.control-group').show();
@ -302,155 +302,155 @@ function jqQIKTS(build_jqQIKTS,source_jqQIKTS)
else else
{ {
jQuery('#jform_manual_files').closest('.control-group').hide(); jQuery('#jform_manual_files').closest('.control-group').hide();
if (!jform_jqQIKTSzxn_required) if (!jform_njVgKMfRGW_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_jqQIKTSzxn_required = true; jform_njVgKMfRGW_required = true;
} }
jQuery('.note_manual_dropbox').closest('.control-group').hide(); jQuery('.note_manual_dropbox').closest('.control-group').hide();
} }
} }
// the jqQIKTS Some function // the njVgKMf Some function
function build_jqQIKTS_SomeFunc(build_jqQIKTS) function build_njVgKMf_SomeFunc(build_njVgKMf)
{ {
// [8225] set the function logic // [8234] set the function logic
if (build_jqQIKTS == 1) if (build_njVgKMf == 1)
{ {
return true; return true;
} }
return false; return false;
} }
// the jqQIKTS Some function // the njVgKMf Some function
function source_jqQIKTS_SomeFunc(source_jqQIKTS) function source_njVgKMf_SomeFunc(source_njVgKMf)
{ {
// [8225] set the function logic // [8234] set the function logic
if (source_jqQIKTS == 2) if (source_njVgKMf == 2)
{ {
return true; return true;
} }
return false; return false;
} }
// the lAIfOHI function // the BGnLThL function
function lAIfOHI(source_lAIfOHI) function BGnLThL(source_BGnLThL)
{ {
if (isSet(source_lAIfOHI) && source_lAIfOHI.constructor !== Array) if (isSet(source_BGnLThL) && source_BGnLThL.constructor !== Array)
{ {
var temp_lAIfOHI = source_lAIfOHI; var temp_BGnLThL = source_BGnLThL;
var source_lAIfOHI = []; var source_BGnLThL = [];
source_lAIfOHI.push(temp_lAIfOHI); source_BGnLThL.push(temp_BGnLThL);
} }
else if (!isSet(source_lAIfOHI)) else if (!isSet(source_BGnLThL))
{ {
var source_lAIfOHI = []; var source_BGnLThL = [];
} }
var source = source_lAIfOHI.some(source_lAIfOHI_SomeFunc); var source = source_BGnLThL.some(source_BGnLThL_SomeFunc);
// [8238] set this function logic // [8247] 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_lAIfOHIxFe_required) if (jform_BGnLThLamW_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_lAIfOHIxFe_required = false; jform_BGnLThLamW_required = false;
} }
} }
else else
{ {
jQuery('#jform_local_files').closest('.control-group').hide(); jQuery('#jform_local_files').closest('.control-group').hide();
if (!jform_lAIfOHIxFe_required) if (!jform_BGnLThLamW_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_lAIfOHIxFe_required = true; jform_BGnLThLamW_required = true;
} }
} }
} }
// the lAIfOHI Some function // the BGnLThL Some function
function source_lAIfOHI_SomeFunc(source_lAIfOHI) function source_BGnLThL_SomeFunc(source_BGnLThL)
{ {
// [8225] set the function logic // [8234] set the function logic
if (source_lAIfOHI == 1) if (source_BGnLThL == 1)
{ {
return true; return true;
} }
return false; return false;
} }
// the UkrHisG function // the kwSAfbW function
function UkrHisG(source_UkrHisG) function kwSAfbW(source_kwSAfbW)
{ {
if (isSet(source_UkrHisG) && source_UkrHisG.constructor !== Array) if (isSet(source_kwSAfbW) && source_kwSAfbW.constructor !== Array)
{ {
var temp_UkrHisG = source_UkrHisG; var temp_kwSAfbW = source_kwSAfbW;
var source_UkrHisG = []; var source_kwSAfbW = [];
source_UkrHisG.push(temp_UkrHisG); source_kwSAfbW.push(temp_kwSAfbW);
} }
else if (!isSet(source_UkrHisG)) else if (!isSet(source_kwSAfbW))
{ {
var source_UkrHisG = []; var source_kwSAfbW = [];
} }
var source = source_UkrHisG.some(source_UkrHisG_SomeFunc); var source = source_kwSAfbW.some(source_kwSAfbW_SomeFunc);
// [8238] set this function logic // [8247] set this function logic
if (source) if (source)
{ {
jQuery('#jform_url').closest('.control-group').show(); jQuery('#jform_url').closest('.control-group').show();
if (jform_UkrHisGoCy_required) if (jform_kwSAfbWIQX_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_UkrHisGoCy_required = false; jform_kwSAfbWIQX_required = false;
} }
} }
else else
{ {
jQuery('#jform_url').closest('.control-group').hide(); jQuery('#jform_url').closest('.control-group').hide();
if (!jform_UkrHisGoCy_required) if (!jform_kwSAfbWIQX_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_UkrHisGoCy_required = true; jform_kwSAfbWIQX_required = true;
} }
} }
} }
// the UkrHisG Some function // the kwSAfbW Some function
function source_UkrHisG_SomeFunc(source_UkrHisG) function source_kwSAfbW_SomeFunc(source_kwSAfbW)
{ {
// [8225] set the function logic // [8234] set the function logic
if (source_UkrHisG == 3) if (source_kwSAfbW == 3)
{ {
return true; return true;
} }
return false; return false;
} }
// the xJKoumd function // the KcgziOs function
function xJKoumd(link_type_xJKoumd) function KcgziOs(link_type_KcgziOs)
{ {
// [8260] set the function logic // [8269] set the function logic
if (link_type_xJKoumd == 2) if (link_type_KcgziOs == 2)
{ {
jQuery('.note_link_directed').closest('.control-group').show(); jQuery('.note_link_directed').closest('.control-group').show();
} }
@ -460,11 +460,11 @@ function xJKoumd(link_type_xJKoumd)
} }
} }
// the oUuxich function // the mIYnoFx function
function oUuxich(link_type_oUuxich) function mIYnoFx(link_type_mIYnoFx)
{ {
// [8260] set the function logic // [8269] set the function logic
if (link_type_oUuxich == 1) if (link_type_mIYnoFx == 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">
<!-- [11275] Default Fields. --> <!-- [11284] Default Fields. -->
<!-- [11276] Id Field. Type: Text (joomla) --> <!-- [11285] 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"
/> />
<!-- [11283] Date Created Field. Type: Calendar (joomla) --> <!-- [11292] 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"
/> />
<!-- [11294] User Created Field. Type: User (joomla) --> <!-- [11303] 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"
/> />
<!-- [11302] Published Field. Type: List (joomla) --> <!-- [11311] 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>
<!-- [11317] Date Modified Field. Type: Calendar (joomla) --> <!-- [11326] 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" />
<!-- [11321] User Modified Field. Type: User (joomla) --> <!-- [11330] 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"
/> />
<!-- [11331] Access Field. Type: Accesslevel (joomla) --> <!-- [11340] 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"
/> />
<!-- [11341] Ordering Field. Type: Numbers (joomla) --> <!-- [11350] 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"
/> />
<!-- [11353] Version Field. Type: Text (joomla) --> <!-- [11362] 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"
/> />
<!-- [11367] Metakey Field. Type: Textarea (joomla) --> <!-- [11376] 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"
/> />
<!-- [11376] Metadesc Field. Type: Textarea (joomla) --> <!-- [11385] 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"
/> />
<!-- [11386] Dynamic Fields. --> <!-- [11395] Dynamic Fields. -->
<!-- [11622] Name Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11743] Preacher Field. Type: Preachers. (custom) --> <!-- [11752] 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"
/> />
<!-- [11743] Series Field. Type: Series. (custom) --> <!-- [11752] 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"
/> />
<!-- [11622] Short_description Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Catid Field. Type: Category. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11536] Link_type Field. Type: Radio. (joomla) --> <!-- [11545] 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">
<!-- [11608] Option Set. --> <!-- [11617] 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>
<!-- [11536] Source Field. Type: List. (joomla) --> <!-- [11545] 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">
<!-- [11608] Option Set. --> <!-- [11617] 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>
<!-- [11622] Icon Field. Type: Media. (joomla) --> <!-- [11631] 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=""
/> />
<!-- [11622] Tags Field. Type: Tag. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11743] Local_files Field. Type: Localfiles. (custom) --> <!-- [11752] 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"
/> />
<!-- [11622] Description Field. Type: Editor. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11636] Note_auto_dropbox Field. Type: Note. A None Database Field. (joomla) --> <!-- [11645] 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" />
<!-- [11622] Alias Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Not_required Field. Type: Hidden. (joomla) --> <!-- [11631] Not_required Field. Type: Hidden. (joomla) -->
<field <field
type="hidden" type="hidden"
name="not_required" name="not_required"
default="[]" default="[]"
/> />
<!-- [11636] Note_link_directed Field. Type: Note. A None Database Field. (joomla) --> <!-- [11645] 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" />
<!-- [11636] Note_manual_dropbox Field. Type: Note. A None Database Field. (joomla) --> <!-- [11645] 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" />
<!-- [11636] Note_link_encrypted Field. Type: Note. A None Database Field. (joomla) --> <!-- [11645] 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" />
<!-- [11743] Manual_files Field. Type: Dropboxfiles. (custom) --> <!-- [11752] 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"
/> />
<!-- [11622] Scripture Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11622] Url Field. Type: Url. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11536] Build Field. Type: Radio. (joomla) --> <!-- [11545] 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">
<!-- [11608] Option Set. --> <!-- [11617] 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>
<!-- [11622] Auto_sermons Field. Type: Hidden. (joomla) --> <!-- [11631] Auto_sermons Field. Type: Hidden. (joomla) -->
<field <field
type="hidden" type="hidden"
name="auto_sermons" name="auto_sermons"
@ -331,11 +331,11 @@
/> />
</fieldset> </fieldset>
<!-- [11405] Metadata Fields. --> <!-- [11414] 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">
<!-- [11409] Robots Field. Type: List (joomla) --> <!-- [11418] 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>
<!-- [11420] Author Field. Type: Text (joomla) --> <!-- [11429] 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"
/> />
<!-- [11426] Rights Field. Type: Textarea (joomla) --> <!-- [11435] 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>
<!-- [10308] Access Control Fields. --> <!-- [10317] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10310] Asset Id Field. Type: Hidden (joomla) --> <!-- [10319] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10316] Rules Field. Type: Rules (joomla) --> <!-- [10325] 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 23rd December, 2015 @build 5th 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">
<!-- [11275] Default Fields. --> <!-- [11284] Default Fields. -->
<!-- [11276] Id Field. Type: Text (joomla) --> <!-- [11285] 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"
/> />
<!-- [11283] Date Created Field. Type: Calendar (joomla) --> <!-- [11292] 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"
/> />
<!-- [11294] User Created Field. Type: User (joomla) --> <!-- [11303] 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"
/> />
<!-- [11302] Published Field. Type: List (joomla) --> <!-- [11311] 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>
<!-- [11317] Date Modified Field. Type: Calendar (joomla) --> <!-- [11326] 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" />
<!-- [11321] User Modified Field. Type: User (joomla) --> <!-- [11330] 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"
/> />
<!-- [11331] Access Field. Type: Accesslevel (joomla) --> <!-- [11340] 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"
/> />
<!-- [11341] Ordering Field. Type: Numbers (joomla) --> <!-- [11350] 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"
/> />
<!-- [11353] Version Field. Type: Text (joomla) --> <!-- [11362] 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"
/> />
<!-- [11367] Metakey Field. Type: Textarea (joomla) --> <!-- [11376] 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"
/> />
<!-- [11376] Metadesc Field. Type: Textarea (joomla) --> <!-- [11385] 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"
/> />
<!-- [11386] Dynamic Fields. --> <!-- [11395] Dynamic Fields. -->
<!-- [11622] Filename Field. Type: Text. (joomla) --> <!-- [11631] 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"
/> />
<!-- [11743] Sermon Field. Type: Sermon. (custom) --> <!-- [11752] 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"
/> />
<!-- [11743] Preacher Field. Type: Preachers. (custom) --> <!-- [11752] 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"
/> />
<!-- [11743] Series Field. Type: Series. (custom) --> <!-- [11752] 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"
/> />
<!-- [11622] Counter Field. Type: Text. (joomla) --> <!-- [11631] Counter Field. Type: Text. (joomla) -->
<field <field
type="text" type="text"
name="counter" name="counter"
@ -165,11 +165,11 @@
/> />
</fieldset> </fieldset>
<!-- [11405] Metadata Fields. --> <!-- [11414] 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">
<!-- [11409] Robots Field. Type: List (joomla) --> <!-- [11418] 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>
<!-- [11420] Author Field. Type: Text (joomla) --> <!-- [11429] 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"
/> />
<!-- [11426] Rights Field. Type: Textarea (joomla) --> <!-- [11435] 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>
<!-- [10308] Access Control Fields. --> <!-- [10317] Access Control Fields. -->
<fieldset name="accesscontrol"> <fieldset name="accesscontrol">
<!-- [10310] Asset Id Field. Type: Hidden (joomla) --> <!-- [10319] Asset Id Field. Type: Hidden (joomla) -->
<field <field
name="asset_id" name="asset_id"
type="hidden" type="hidden"
filter="unset" filter="unset"
/> />
<!-- [10316] Rules Field. Type: Rules (joomla) --> <!-- [10325] 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 23rd December, 2015 @build 5th 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))
{ {
// [4223] JSON Decode groups. // [4232] 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)
{ // [9818] Get the form. { // [9827] 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;
// [9903] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9912] 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');
} }
// [9908] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9917] 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();
// [9914] Check for existing item. // [9923] Check for existing item.
// [9915] Modify the form based on Edit State access controls. // [9924] 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')))
{ {
// [9928] Disable fields for display. // [9937] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9931] Disable fields while saving. // [9940] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9936] Modify the form based on Edit Creaded By access controls. // [9945] 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'))
{ {
// [9948] Disable fields for display. // [9957] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9950] Disable fields for display. // [9959] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9952] Disable fields while saving. // [9961] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9955] Modify the form based on Edit Creaded Date access controls. // [9964] 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'))
{ {
// [9967] Disable fields for display. // [9976] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9969] Disable fields while saving. // [9978] 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();
// [10119] The record has been set. Check the record permissions. // [10128] 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)
{ {
// [10206] The record has been set. Check the record permissions. // [10215] 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;
} }
} }
// [10223] In the absense of better information, revert to the component permissions. // [10232] 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')
{ {
// [10031] Check specific edit permission then general edit permission. // [10040] 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)
{ {
// [9022] check if the not_required field is set // [9031] 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);
// [9027] now change the required field attributes value // [9036] now change the required field attributes value
foreach ($requiredFields as $requiredField) foreach ($requiredFields as $requiredField)
{ {
// [9030] make sure there is a string value // [9039] make sure there is a string value
if (SermondistributorHelper::checkString($requiredField)) if (SermondistributorHelper::checkString($requiredField))
{ {
// [9033] change to false // [9042] change to false
$form->setFieldAttribute($requiredField, 'required', 'false'); $form->setFieldAttribute($requiredField, 'required', 'false');
// [9035] also clear the data set // [9044] 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))
{ {
// [5179] Set some needed variables. // [5188] 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;
} }
// [5199] get list of uniqe fields // [5208] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5201] remove move_copy from array // [5210] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5204] make sure published is set // [5213] 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();
// [5241] Parent exists so let's proceed // [5250] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5244] Pop the first ID off the stack // [5253] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5249] only allow copy if user may edit this item. // [5258] 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]))
{ {
// [5259] Not fatal error // [5268] 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
} }
// [5264] Check that the row actually exists // [5273] 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())
{ {
// [5269] Fatal error // [5278] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5276] Not fatal error // [5285] 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);
// [5312] insert all set values // [5321] 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
} }
} }
// [5324] update all uniqe fields // [5333] 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
} }
} }
// [5333] Reset the ID because we are making a copy // [5342] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5336] TODO: Deal with ordering? // [5345] TODO: Deal with ordering?
// [5337] $this->table->ordering = 1; // [5346] $this->table->ordering = 1;
// [5339] Check the row. // [5348] 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);
} }
// [5352] Store the row. // [5361] 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;
} }
// [5360] Get the new item ID // [5369] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5363] Add the new ID to the array // [5372] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5367] Clean the cache // [5376] 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))
{ {
// [4981] Set some needed variables. // [4990] 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;
} }
// [5003] make sure published only updates if user has the permission. // [5012] 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']);
} }
// [5016] remove move_copy from array // [5025] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5037] Parent exists so we proceed // [5046] 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;
} }
// [5054] Check that the row actually exists // [5063] 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())
{ {
// [5059] Fatal error // [5068] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5066] Not fatal error // [5075] 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;
} }
} }
// [5072] insert all set values. // [5081] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5077] Do special action for access. // [5086] 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
} }
// [5089] Check the row. // [5098] 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);
} }
// [5102] Store the row. // [5111] 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
} }
} }
// [5111] Clean the cache // [5120] 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;
} }
// [4333] Set the groups string to JSON string. // [4342] 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;
} }
// [5393] Alter the title for save as copy // [5402] 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;
} }
// [5420] Automatic handling of alias for empty fields // [5429] 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
} }
} }
// [5459] Alter the uniqe field for save as copy // [5468] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5462] Automatic handling of other uniqe fields // [5471] 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)
{ {
// [5493] Alter the title & alias // [5502] 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 23rd December, 2015 @build 5th 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()
{ {
// [10792] check in items // [10801] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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;
} }
// [10938] decode groups // [10947] 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
} }
} }
// [11133] set selection value to a translatable value // [11142] 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)
{ {
// [11140] convert type // [11149] convert type
$item->type = $this->selectionTranslation($item->type, 'type'); $item->type = $this->selectionTranslation($item->type, 'type');
// [11140] convert location // [11149] 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)
{ {
// [11166] Array of type language strings // [11175] 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'
); );
// [11197] Now check if value is found in this array // [11206] 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];
} }
} }
// [11166] Array of location language strings // [11175] 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'
); );
// [11197] Now check if value is found in this array // [11206] 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()
{ {
// [7649] Get the user object. // [7658] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7651] Create a new query object. // [7660] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7654] Select some fields // [7663] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7661] From the sermondistributor_item table // [7670] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_help_document', 'a')); $query->from($db->quoteName('#__sermondistributor_help_document', 'a'));
// [7675] Filter by published state // [7684] 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)');
} }
// [7687] Join over the asset groups. // [7696] 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');
// [7690] Filter by access level. // [7699] 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);
} }
// [7695] Implement View Level Access // [7704] 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 . ')');
} }
// [7772] Filter by search. // [7781] 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
} }
} }
// [8015] Filter by Type. // [8024] 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)));
} }
// [8015] Filter by Location. // [8024] 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)));
} }
// [8015] Filter by Admin_view. // [8024] 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)));
} }
// [8015] Filter by Site_view. // [8024] 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)));
} }
// [7731] Add the list ordering clause. // [7740] 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)
{ {
// [7439] setup the query // [7448] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7442] Get the user object. // [7451] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7444] Create a new query object. // [7453] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7447] Select some fields // [7456] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7449] From the sermondistributor_help_document table // [7458] 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) . ')');
// [7459] Implement View Level Access // [7468] 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 . ')');
} }
// [7466] Order the results by ordering // [7475] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7468] Load the items // [7477] 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();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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;
} }
// [11080] unset the values we don't want exported. // [11089] 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);
} }
} }
// [11089] Add headers to items array. // [11098] 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()
{ {
// [7488] Get a db connection. // [7497] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7490] get the columns // [7499] get the columns
$columns = $db->getTableColumns("#__sermondistributor_help_document"); $columns = $db->getTableColumns("#__sermondistributor_help_document");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7494] remove the headers you don't import/export. // [7503] 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 = '')
{ {
// [10415] Compile the store id. // [10424] 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()
{ {
// [10808] Get set check in time // [10817] 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)
{ {
// [10813] Get a db connection. // [10822] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10815] reset query // [10824] 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())
{ {
// [10823] Get Yesterdays date // [10832] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10825] reset query // [10834] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10827] Fields to update. // [10836] 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'
); );
// [10832] Conditions for which records should be updated. // [10841] 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.'\''
); );
// [10837] Check table // [10846] 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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->preacherrmkt = $item->id; $this->preachereool = $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 getPblsermons() public function getNassermons()
{ {
// [7197] Get the user object. // [7206] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7199] Create a new query object. // [7208] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7202] Select some fields // [7211] 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'));
// [7209] From the sermondistributor_sermon table // [7218] 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') . ')');
// [7802] From the sermondistributor_preacher table. // [7811] 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') . ')');
// [7802] From the sermondistributor_series table. // [7811] 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') . ')');
// [7225] Filter by preacherrmkt global. // [7234] Filter by preachereool global.
$preacherrmkt = $this->preacherrmkt; $preachereool = $this->preachereool;
if (is_numeric($preacherrmkt )) if (is_numeric($preachereool ))
{ {
$query->where('a.preacher = ' . (int) $preacherrmkt ); $query->where('a.preacher = ' . (int) $preachereool );
} }
elseif (is_string($preacherrmkt)) elseif (is_string($preachereool))
{ {
$query->where('a.preacher = ' . $db->quote($preacherrmkt)); $query->where('a.preacher = ' . $db->quote($preachereool));
} }
else else
{ {
$query->where('a.preacher = -5'); $query->where('a.preacher = -5');
} }
// [7242] Join over the asset groups. // [7251] 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');
// [7245] Filter by access level. // [7254] 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);
} }
// [7250] Implement View Level Access // [7259] 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 . ')');
} }
// [7257] Order the results by ordering // [7266] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7259] Load the items // [7268] 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();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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
} }
} }
// [11133] set selection value to a translatable value // [11142] 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)
{ {
// [11140] convert link_type // [11149] convert link_type
$item->link_type = $this->selectionTranslationPblsermons($item->link_type, 'link_type'); $item->link_type = $this->selectionTranslationNassermons($item->link_type, 'link_type');
// [11140] convert source // [11149] convert source
$item->source = $this->selectionTranslationPblsermons($item->source, 'source'); $item->source = $this->selectionTranslationNassermons($item->source, 'source');
} }
} }
@ -214,22 +214,22 @@ class SermondistributorModelPreacher extends JModelAdmin
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslationPblsermons($value,$name) public function selectionTranslationNassermons($value,$name)
{ {
// [11166] Array of link_type language strings // [11175] 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'
); );
// [11197] Now check if value is found in this array // [11206] 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];
} }
} }
// [11166] Array of source language strings // [11175] 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'
); );
// [11197] Now check if value is found in this array // [11206] 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)
{ // [9818] Get the form. { // [9827] 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;
// [9903] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9912] 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');
} }
// [9908] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9917] 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();
// [9914] Check for existing item. // [9923] Check for existing item.
// [9915] Modify the form based on Edit State access controls. // [9924] 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')))
{ {
// [9928] Disable fields for display. // [9937] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9931] Disable fields while saving. // [9940] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9936] Modify the form based on Edit Creaded By access controls. // [9945] 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')))
{ {
// [9948] Disable fields for display. // [9957] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9950] Disable fields for display. // [9959] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9952] Disable fields while saving. // [9961] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9955] Modify the form based on Edit Creaded Date access controls. // [9964] 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')))
{ {
// [9967] Disable fields for display. // [9976] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9969] Disable fields while saving. // [9978] 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();
// [10119] The record has been set. Check the record permissions. // [10128] 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)
{ {
// [10206] The record has been set. Check the record permissions. // [10215] 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;
} }
} }
// [10223] In the absense of better information, revert to the component permissions. // [10232] 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')
{ {
// [10031] Check specific edit permission then general edit permission. // [10040] 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))
{ {
// [5179] Set some needed variables. // [5188] 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;
} }
// [5199] get list of uniqe fields // [5208] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5201] remove move_copy from array // [5210] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5204] make sure published is set // [5213] 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();
// [5241] Parent exists so let's proceed // [5250] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5244] Pop the first ID off the stack // [5253] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5249] only allow copy if user may edit this item. // [5258] 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]))
{ {
// [5259] Not fatal error // [5268] 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
} }
// [5264] Check that the row actually exists // [5273] 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())
{ {
// [5269] Fatal error // [5278] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5276] Not fatal error // [5285] 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);
// [5312] insert all set values // [5321] 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
} }
} }
// [5324] update all uniqe fields // [5333] 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
} }
} }
// [5333] Reset the ID because we are making a copy // [5342] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5336] TODO: Deal with ordering? // [5345] TODO: Deal with ordering?
// [5337] $this->table->ordering = 1; // [5346] $this->table->ordering = 1;
// [5339] Check the row. // [5348] 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);
} }
// [5352] Store the row. // [5361] 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;
} }
// [5360] Get the new item ID // [5369] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5363] Add the new ID to the array // [5372] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5367] Clean the cache // [5376] 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))
{ {
// [4981] Set some needed variables. // [4990] 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;
} }
// [5003] make sure published only updates if user has the permission. // [5012] 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']);
} }
// [5016] remove move_copy from array // [5025] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5037] Parent exists so we proceed // [5046] 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;
} }
// [5054] Check that the row actually exists // [5063] 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())
{ {
// [5059] Fatal error // [5068] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5066] Not fatal error // [5075] 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;
} }
} }
// [5072] insert all set values. // [5081] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5077] Do special action for access. // [5086] 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
} }
// [5089] Check the row. // [5098] 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);
} }
// [5102] Store the row. // [5111] 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
} }
} }
// [5111] Clean the cache // [5120] 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;
} }
// [5393] Alter the name for save as copy // [5402] 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;
} }
// [5420] Automatic handling of alias for empty fields // [5429] 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
} }
} }
// [5459] Alter the uniqe field for save as copy // [5468] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5462] Automatic handling of other uniqe fields // [5471] 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)
{ {
// [5493] Alter the title & alias // [5502] 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 23rd December, 2015 @build 5th 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()
{ {
// [10792] check in items // [10801] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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()
{ {
// [7649] Get the user object. // [7658] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7651] Create a new query object. // [7660] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7654] Select some fields // [7663] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7661] From the sermondistributor_item table // [7670] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_preacher', 'a')); $query->from($db->quoteName('#__sermondistributor_preacher', 'a'));
// [7675] Filter by published state // [7684] 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)');
} }
// [7687] Join over the asset groups. // [7696] 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');
// [7690] Filter by access level. // [7699] 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);
} }
// [7695] Implement View Level Access // [7704] 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 . ')');
} }
// [7772] Filter by search. // [7781] 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
} }
// [7731] Add the list ordering clause. // [7740] 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)
{ {
// [7439] setup the query // [7448] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7442] Get the user object. // [7451] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7444] Create a new query object. // [7453] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7447] Select some fields // [7456] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7449] From the sermondistributor_preacher table // [7458] 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) . ')');
// [7459] Implement View Level Access // [7468] 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 . ')');
} }
// [7466] Order the results by ordering // [7475] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7468] Load the items // [7477] 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();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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;
} }
// [11080] unset the values we don't want exported. // [11089] 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);
} }
} }
// [11089] Add headers to items array. // [11098] 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()
{ {
// [7488] Get a db connection. // [7497] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7490] get the columns // [7499] get the columns
$columns = $db->getTableColumns("#__sermondistributor_preacher"); $columns = $db->getTableColumns("#__sermondistributor_preacher");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7494] remove the headers you don't import/export. // [7503] 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 = '')
{ {
// [10415] Compile the store id. // [10424] 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()
{ {
// [10808] Get set check in time // [10817] 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)
{ {
// [10813] Get a db connection. // [10822] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10815] reset query // [10824] 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())
{ {
// [10823] Get Yesterdays date // [10832] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10825] reset query // [10834] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10827] Fields to update. // [10836] 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'
); );
// [10832] Conditions for which records should be updated. // [10841] 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.'\''
); );
// [10837] Check table // [10846] 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 23rd December, 2015 @build 5th 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->seriesevcv = $item->id; $this->seriespmzw = $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 getSkxsermons() public function getZswsermons()
{ {
// [7197] Get the user object. // [7206] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7199] Create a new query object. // [7208] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7202] Select some fields // [7211] 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'));
// [7209] From the sermondistributor_sermon table // [7218] 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') . ')');
// [7802] From the sermondistributor_preacher table. // [7811] 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') . ')');
// [7802] From the sermondistributor_series table. // [7811] 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') . ')');
// [7225] Filter by seriesevcv global. // [7234] Filter by seriespmzw global.
$seriesevcv = $this->seriesevcv; $seriespmzw = $this->seriespmzw;
if (is_numeric($seriesevcv )) if (is_numeric($seriespmzw ))
{ {
$query->where('a.series = ' . (int) $seriesevcv ); $query->where('a.series = ' . (int) $seriespmzw );
} }
elseif (is_string($seriesevcv)) elseif (is_string($seriespmzw))
{ {
$query->where('a.series = ' . $db->quote($seriesevcv)); $query->where('a.series = ' . $db->quote($seriespmzw));
} }
else else
{ {
$query->where('a.series = -5'); $query->where('a.series = -5');
} }
// [7242] Join over the asset groups. // [7251] 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');
// [7245] Filter by access level. // [7254] 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);
} }
// [7250] Implement View Level Access // [7259] 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 . ')');
} }
// [7257] Order the results by ordering // [7266] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7259] Load the items // [7268] 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();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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
} }
} }
// [11133] set selection value to a translatable value // [11142] 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)
{ {
// [11140] convert link_type // [11149] convert link_type
$item->link_type = $this->selectionTranslationSkxsermons($item->link_type, 'link_type'); $item->link_type = $this->selectionTranslationZswsermons($item->link_type, 'link_type');
// [11140] convert source // [11149] convert source
$item->source = $this->selectionTranslationSkxsermons($item->source, 'source'); $item->source = $this->selectionTranslationZswsermons($item->source, 'source');
} }
} }
@ -214,22 +214,22 @@ class SermondistributorModelSeries extends JModelAdmin
* *
* @return translatable string * @return translatable string
*/ */
public function selectionTranslationSkxsermons($value,$name) public function selectionTranslationZswsermons($value,$name)
{ {
// [11166] Array of link_type language strings // [11175] 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'
); );
// [11197] Now check if value is found in this array // [11206] 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];
} }
} }
// [11166] Array of source language strings // [11175] 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'
); );
// [11197] Now check if value is found in this array // [11206] 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)
{ // [9818] Get the form. { // [9827] 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;
// [9903] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9912] 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');
} }
// [9908] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9917] 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();
// [9914] Check for existing item. // [9923] Check for existing item.
// [9915] Modify the form based on Edit State access controls. // [9924] 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')))
{ {
// [9928] Disable fields for display. // [9937] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9931] Disable fields while saving. // [9940] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9936] Modify the form based on Edit Creaded By access controls. // [9945] 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')))
{ {
// [9948] Disable fields for display. // [9957] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9950] Disable fields for display. // [9959] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9952] Disable fields while saving. // [9961] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9955] Modify the form based on Edit Creaded Date access controls. // [9964] 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')))
{ {
// [9967] Disable fields for display. // [9976] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9969] Disable fields while saving. // [9978] 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();
// [10119] The record has been set. Check the record permissions. // [10128] 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)
{ {
// [10206] The record has been set. Check the record permissions. // [10215] 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;
} }
} }
// [10223] In the absense of better information, revert to the component permissions. // [10232] 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')
{ {
// [10031] Check specific edit permission then general edit permission. // [10040] 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))
{ {
// [5179] Set some needed variables. // [5188] 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;
} }
// [5199] get list of uniqe fields // [5208] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5201] remove move_copy from array // [5210] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5204] make sure published is set // [5213] 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();
// [5241] Parent exists so let's proceed // [5250] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5244] Pop the first ID off the stack // [5253] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5249] only allow copy if user may edit this item. // [5258] 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]))
{ {
// [5259] Not fatal error // [5268] 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
} }
// [5264] Check that the row actually exists // [5273] 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())
{ {
// [5269] Fatal error // [5278] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5276] Not fatal error // [5285] 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);
// [5312] insert all set values // [5321] 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
} }
} }
// [5324] update all uniqe fields // [5333] 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
} }
} }
// [5333] Reset the ID because we are making a copy // [5342] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5336] TODO: Deal with ordering? // [5345] TODO: Deal with ordering?
// [5337] $this->table->ordering = 1; // [5346] $this->table->ordering = 1;
// [5339] Check the row. // [5348] 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);
} }
// [5352] Store the row. // [5361] 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;
} }
// [5360] Get the new item ID // [5369] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5363] Add the new ID to the array // [5372] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5367] Clean the cache // [5376] 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))
{ {
// [4981] Set some needed variables. // [4990] 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;
} }
// [5003] make sure published only updates if user has the permission. // [5012] 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']);
} }
// [5016] remove move_copy from array // [5025] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5037] Parent exists so we proceed // [5046] 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;
} }
// [5054] Check that the row actually exists // [5063] 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())
{ {
// [5059] Fatal error // [5068] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5066] Not fatal error // [5075] 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;
} }
} }
// [5072] insert all set values. // [5081] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5077] Do special action for access. // [5086] 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
} }
// [5089] Check the row. // [5098] 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);
} }
// [5102] Store the row. // [5111] 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
} }
} }
// [5111] Clean the cache // [5120] 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;
} }
// [5393] Alter the name for save as copy // [5402] 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;
} }
// [5420] Automatic handling of alias for empty fields // [5429] 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
} }
} }
// [5459] Alter the uniqe field for save as copy // [5468] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5462] Automatic handling of other uniqe fields // [5471] 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)
{ {
// [5493] Alter the title & alias // [5502] 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 23rd December, 2015 @build 5th 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()
{ {
// [10792] check in items // [10801] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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()
{ {
// [7649] Get the user object. // [7658] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7651] Create a new query object. // [7660] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7654] Select some fields // [7663] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7661] From the sermondistributor_item table // [7670] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_series', 'a')); $query->from($db->quoteName('#__sermondistributor_series', 'a'));
// [7675] Filter by published state // [7684] 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)');
} }
// [7687] Join over the asset groups. // [7696] 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');
// [7690] Filter by access level. // [7699] 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);
} }
// [7695] Implement View Level Access // [7704] 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 . ')');
} }
// [7772] Filter by search. // [7781] 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
} }
// [7731] Add the list ordering clause. // [7740] 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)
{ {
// [7439] setup the query // [7448] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7442] Get the user object. // [7451] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7444] Create a new query object. // [7453] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7447] Select some fields // [7456] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7449] From the sermondistributor_series table // [7458] 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) . ')');
// [7459] Implement View Level Access // [7468] 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 . ')');
} }
// [7466] Order the results by ordering // [7475] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7468] Load the items // [7477] 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();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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;
} }
// [11080] unset the values we don't want exported. // [11089] 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);
} }
} }
// [11089] Add headers to items array. // [11098] 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()
{ {
// [7488] Get a db connection. // [7497] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7490] get the columns // [7499] get the columns
$columns = $db->getTableColumns("#__sermondistributor_series"); $columns = $db->getTableColumns("#__sermondistributor_series");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7494] remove the headers you don't import/export. // [7503] 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 = '')
{ {
// [10415] Compile the store id. // [10424] 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()
{ {
// [10808] Get set check in time // [10817] 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)
{ {
// [10813] Get a db connection. // [10822] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10815] reset query // [10824] 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())
{ {
// [10823] Get Yesterdays date // [10832] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10825] reset query // [10834] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10827] Fields to update. // [10836] 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'
); );
// [10832] Conditions for which records should be updated. // [10841] 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.'\''
); );
// [10837] Check table // [10846] 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 23rd December, 2015 @build 5th 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))
{ {
// [4223] JSON Decode local_files. // [4232] 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))
{ {
// [4223] JSON Decode manual_files. // [4232] 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->sermonpyek = $item->id; $this->sermonxhlb = $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 getPomstastics() public function getVrfstastics()
{ {
// [7197] Get the user object. // [7206] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7199] Create a new query object. // [7208] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7202] Select some fields // [7211] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7209] From the sermondistributor_statistic table // [7218] From the sermondistributor_statistic table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a')); $query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
// [7802] From the sermondistributor_sermon table. // [7811] 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') . ')');
// [7802] From the sermondistributor_preacher table. // [7811] 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') . ')');
// [7802] From the sermondistributor_series table. // [7811] 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') . ')');
// [7225] Filter by sermonpyek global. // [7234] Filter by sermonxhlb global.
$sermonpyek = $this->sermonpyek; $sermonxhlb = $this->sermonxhlb;
if (is_numeric($sermonpyek )) if (is_numeric($sermonxhlb ))
{ {
$query->where('a.sermon = ' . (int) $sermonpyek ); $query->where('a.sermon = ' . (int) $sermonxhlb );
} }
elseif (is_string($sermonpyek)) elseif (is_string($sermonxhlb))
{ {
$query->where('a.sermon = ' . $db->quote($sermonpyek)); $query->where('a.sermon = ' . $db->quote($sermonxhlb));
} }
else else
{ {
$query->where('a.sermon = -5'); $query->where('a.sermon = -5');
} }
// [7242] Join over the asset groups. // [7251] 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');
// [7245] Filter by access level. // [7254] 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);
} }
// [7250] Implement View Level Access // [7259] 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 . ')');
} }
// [7257] Order the results by ordering // [7266] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7259] Load the items // [7268] 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();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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)
{ // [9818] Get the form. { // [9827] 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;
// [9845] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9854] 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');
} }
// [9850] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9859] 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');
} }
// [9855] Determine correct permissions to check. // [9864] 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))
{ {
// [9862] set catagory id // [9871] set catagory id
$catid = $this->getItem($id)->catid; $catid = $this->getItem($id)->catid;
// [9864] Existing record. Can only edit in selected categories. // [9873] Existing record. Can only edit in selected categories.
$form->setFieldAttribute('catid', 'action', 'core.edit'); $form->setFieldAttribute('catid', 'action', 'core.edit');
// [9866] Existing record. Can only edit own items in selected categories. // [9875] 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
{ {
// [9872] New record. Can only create in selected categories. // [9881] 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();
// [9876] Check for existing item. // [9885] Check for existing item.
// [9877] Modify the form based on Edit State access controls. // [9886] 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')))
{ {
// [9892] Disable fields for display. // [9901] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9895] Disable fields while saving. // [9904] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9936] Modify the form based on Edit Creaded By access controls. // [9945] 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')))
{ {
// [9948] Disable fields for display. // [9957] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9950] Disable fields for display. // [9959] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9952] Disable fields while saving. // [9961] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9955] Modify the form based on Edit Creaded Date access controls. // [9964] 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')))
{ {
// [9967] Disable fields for display. // [9976] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9969] Disable fields while saving. // [9978] 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)
{ {
// [10090] The record has been set. Check the record permissions. // [10099] 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)
{ {
// [10163] The record has been set. Check the record permissions. // [10172] 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;
} }
} }
// [10179] Check against the category. // [10188] 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;
} }
} }
// [10190] In the absense of better information, revert to the component permissions. // [10199] 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')
{ {
// [10031] Check specific edit permission then general edit permission. // [10040] 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)
{ {
// [9022] check if the not_required field is set // [9031] 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);
// [9027] now change the required field attributes value // [9036] now change the required field attributes value
foreach ($requiredFields as $requiredField) foreach ($requiredFields as $requiredField)
{ {
// [9030] make sure there is a string value // [9039] make sure there is a string value
if (SermondistributorHelper::checkString($requiredField)) if (SermondistributorHelper::checkString($requiredField))
{ {
// [9033] change to false // [9042] change to false
$form->setFieldAttribute($requiredField, 'required', 'false'); $form->setFieldAttribute($requiredField, 'required', 'false');
// [9035] also clear the data set // [9044] 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))
{ {
// [5179] Set some needed variables. // [5188] 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;
} }
// [5199] get list of uniqe fields // [5208] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5201] remove move_copy from array // [5210] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5204] make sure published is set // [5213] 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)
{ {
// [5229] move the category value to correct field name // [5238] 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();
// [5241] Parent exists so let's proceed // [5250] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5244] Pop the first ID off the stack // [5253] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5249] only allow copy if user may edit this item. // [5258] 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]))
{ {
// [5259] Not fatal error // [5268] 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
} }
// [5264] Check that the row actually exists // [5273] 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())
{ {
// [5269] Fatal error // [5278] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5276] Not fatal error // [5285] 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);
} }
// [5312] insert all set values // [5321] 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
} }
} }
// [5324] update all uniqe fields // [5333] 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
} }
} }
// [5333] Reset the ID because we are making a copy // [5342] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5336] TODO: Deal with ordering? // [5345] TODO: Deal with ordering?
// [5337] $this->table->ordering = 1; // [5346] $this->table->ordering = 1;
// [5339] Check the row. // [5348] 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);
} }
// [5352] Store the row. // [5361] 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;
} }
// [5360] Get the new item ID // [5369] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5363] Add the new ID to the array // [5372] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5367] Clean the cache // [5376] 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))
{ {
// [4981] Set some needed variables. // [4990] 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;
} }
// [5003] make sure published only updates if user has the permission. // [5012] 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']);
} }
// [5016] remove move_copy from array // [5025] 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)
{ {
// [5027] move the category value to correct field name // [5036] 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
} }
// [5037] Parent exists so we proceed // [5046] 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;
} }
// [5054] Check that the row actually exists // [5063] 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())
{ {
// [5059] Fatal error // [5068] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5066] Not fatal error // [5075] 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;
} }
} }
// [5072] insert all set values. // [5081] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5077] Do special action for access. // [5086] 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
} }
// [5089] Check the row. // [5098] 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);
} }
// [5102] Store the row. // [5111] 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
} }
} }
// [5111] Clean the cache // [5120] 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;
} }
// [4333] Set the local_files string to JSON string. // [4342] 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']);
} }
// [4333] Set the manual_files string to JSON string. // [4342] 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;
} }
// [5393] Alter the name for save as copy // [5402] 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;
} }
// [5420] Automatic handling of alias for empty fields // [5429] 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
} }
} }
// [5459] Alter the uniqe field for save as copy // [5468] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5462] Automatic handling of other uniqe fields // [5471] 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)
{ {
// [5493] Alter the title & alias // [5502] 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 23rd December, 2015 @build 5th 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')
); );
// [12438] view access array // [12447] 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 23rd December, 2015 @build 5th 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()
{ {
// [10792] check in items // [10801] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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
} }
} }
// [11133] set selection value to a translatable value // [11142] 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)
{ {
// [11140] convert link_type // [11149] convert link_type
$item->link_type = $this->selectionTranslation($item->link_type, 'link_type'); $item->link_type = $this->selectionTranslation($item->link_type, 'link_type');
// [11140] convert source // [11149] 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)
{ {
// [11166] Array of link_type language strings // [11175] 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'
); );
// [11197] Now check if value is found in this array // [11206] 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];
} }
} }
// [11166] Array of source language strings // [11175] 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'
); );
// [11197] Now check if value is found in this array // [11206] 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()
{ {
// [7649] Get the user object. // [7658] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7651] Create a new query object. // [7660] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7654] Select some fields // [7663] 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'));
// [7661] From the sermondistributor_item table // [7670] 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') . ')');
// [7802] From the sermondistributor_preacher table. // [7811] 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') . ')');
// [7802] From the sermondistributor_series table. // [7811] 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') . ')');
// [7675] Filter by published state // [7684] 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)');
} }
// [7687] Join over the asset groups. // [7696] 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');
// [7690] Filter by access level. // [7699] 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);
} }
// [7695] Implement View Level Access // [7704] 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 . ')');
} }
// [7772] Filter by search. // [7781] 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
} }
} }
// [8006] Filter by preacher. // [8015] 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)));
} }
// [8006] Filter by series. // [8015] 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)));
} }
// [8015] Filter by Link_type. // [8024] 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)));
} }
// [8015] Filter by Source. // [8024] 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)));
} }
// [7709] Filter by a single or group of categories. // [7718] 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
} }
// [7731] Add the list ordering clause. // [7740] 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)
{ {
// [7439] setup the query // [7448] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7442] Get the user object. // [7451] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7444] Create a new query object. // [7453] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7447] Select some fields // [7456] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7449] From the sermondistributor_sermon table // [7458] 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) . ')');
// [7459] Implement View Level Access // [7468] 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 . ')');
} }
// [7466] Order the results by ordering // [7475] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7468] Load the items // [7477] 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();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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;
} }
// [11080] unset the values we don't want exported. // [11089] 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);
} }
} }
// [11089] Add headers to items array. // [11098] 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()
{ {
// [7488] Get a db connection. // [7497] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7490] get the columns // [7499] get the columns
$columns = $db->getTableColumns("#__sermondistributor_sermon"); $columns = $db->getTableColumns("#__sermondistributor_sermon");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7494] remove the headers you don't import/export. // [7503] 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 = '')
{ {
// [10415] Compile the store id. // [10424] 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()
{ {
// [10808] Get set check in time // [10817] 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)
{ {
// [10813] Get a db connection. // [10822] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10815] reset query // [10824] 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())
{ {
// [10823] Get Yesterdays date // [10832] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10825] reset query // [10834] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10827] Fields to update. // [10836] 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'
); );
// [10832] Conditions for which records should be updated. // [10841] 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.'\''
); );
// [10837] Check table // [10846] 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 23rd December, 2015 @build 5th 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)
{ // [9818] Get the form. { // [9827] 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;
// [9903] The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. // [9912] 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');
} }
// [9908] The back end uses id so we use that the rest of the time and set it to 0 by default. // [9917] 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();
// [9914] Check for existing item. // [9923] Check for existing item.
// [9915] Modify the form based on Edit State access controls. // [9924] 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')))
{ {
// [9928] Disable fields for display. // [9937] Disable fields for display.
$form->setFieldAttribute('ordering', 'disabled', 'true'); $form->setFieldAttribute('ordering', 'disabled', 'true');
$form->setFieldAttribute('published', 'disabled', 'true'); $form->setFieldAttribute('published', 'disabled', 'true');
// [9931] Disable fields while saving. // [9940] Disable fields while saving.
$form->setFieldAttribute('ordering', 'filter', 'unset'); $form->setFieldAttribute('ordering', 'filter', 'unset');
$form->setFieldAttribute('published', 'filter', 'unset'); $form->setFieldAttribute('published', 'filter', 'unset');
} }
// [9936] Modify the form based on Edit Creaded By access controls. // [9945] 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')))
{ {
// [9948] Disable fields for display. // [9957] Disable fields for display.
$form->setFieldAttribute('created_by', 'disabled', 'true'); $form->setFieldAttribute('created_by', 'disabled', 'true');
// [9950] Disable fields for display. // [9959] Disable fields for display.
$form->setFieldAttribute('created_by', 'readonly', 'true'); $form->setFieldAttribute('created_by', 'readonly', 'true');
// [9952] Disable fields while saving. // [9961] Disable fields while saving.
$form->setFieldAttribute('created_by', 'filter', 'unset'); $form->setFieldAttribute('created_by', 'filter', 'unset');
} }
// [9955] Modify the form based on Edit Creaded Date access controls. // [9964] 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')))
{ {
// [9967] Disable fields for display. // [9976] Disable fields for display.
$form->setFieldAttribute('created', 'disabled', 'true'); $form->setFieldAttribute('created', 'disabled', 'true');
// [9969] Disable fields while saving. // [9978] 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();
// [10119] The record has been set. Check the record permissions. // [10128] 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)
{ {
// [10206] The record has been set. Check the record permissions. // [10215] 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;
} }
} }
// [10223] In the absense of better information, revert to the component permissions. // [10232] 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')
{ {
// [10031] Check specific edit permission then general edit permission. // [10040] 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))
{ {
// [5179] Set some needed variables. // [5188] 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;
} }
// [5199] get list of uniqe fields // [5208] get list of uniqe fields
$uniqeFields = $this->getUniqeFields(); $uniqeFields = $this->getUniqeFields();
// [5201] remove move_copy from array // [5210] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5204] make sure published is set // [5213] 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();
// [5241] Parent exists so let's proceed // [5250] Parent exists so let's proceed
while (!empty($pks)) while (!empty($pks))
{ {
// [5244] Pop the first ID off the stack // [5253] Pop the first ID off the stack
$pk = array_shift($pks); $pk = array_shift($pks);
$this->table->reset(); $this->table->reset();
// [5249] only allow copy if user may edit this item. // [5258] 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]))
{ {
// [5259] Not fatal error // [5268] 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
} }
// [5264] Check that the row actually exists // [5273] 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())
{ {
// [5269] Fatal error // [5278] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5276] Not fatal error // [5285] 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);
// [5312] insert all set values // [5321] 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
} }
} }
// [5324] update all uniqe fields // [5333] 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
} }
} }
// [5333] Reset the ID because we are making a copy // [5342] Reset the ID because we are making a copy
$this->table->id = 0; $this->table->id = 0;
// [5336] TODO: Deal with ordering? // [5345] TODO: Deal with ordering?
// [5337] $this->table->ordering = 1; // [5346] $this->table->ordering = 1;
// [5339] Check the row. // [5348] 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);
} }
// [5352] Store the row. // [5361] 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;
} }
// [5360] Get the new item ID // [5369] Get the new item ID
$newId = $this->table->get('id'); $newId = $this->table->get('id');
// [5363] Add the new ID to the array // [5372] Add the new ID to the array
$newIds[$pk] = $newId; $newIds[$pk] = $newId;
} }
// [5367] Clean the cache // [5376] 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))
{ {
// [4981] Set some needed variables. // [4990] 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;
} }
// [5003] make sure published only updates if user has the permission. // [5012] 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']);
} }
// [5016] remove move_copy from array // [5025] remove move_copy from array
unset($values['move_copy']); unset($values['move_copy']);
// [5037] Parent exists so we proceed // [5046] 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;
} }
// [5054] Check that the row actually exists // [5063] 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())
{ {
// [5059] Fatal error // [5068] Fatal error
$this->setError($error); $this->setError($error);
return false; return false;
} }
else else
{ {
// [5066] Not fatal error // [5075] 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;
} }
} }
// [5072] insert all set values. // [5081] insert all set values.
if (SermondistributorHelper::checkArray($values)) if (SermondistributorHelper::checkArray($values))
{ {
foreach ($values as $key => $value) foreach ($values as $key => $value)
{ {
// [5077] Do special action for access. // [5086] 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
} }
// [5089] Check the row. // [5098] 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);
} }
// [5102] Store the row. // [5111] 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
} }
} }
// [5111] Clean the cache // [5120] 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;
} }
// [5459] Alter the uniqe field for save as copy // [5468] Alter the uniqe field for save as copy
if ($input->get('task') == 'save2copy') if ($input->get('task') == 'save2copy')
{ {
// [5462] Automatic handling of other uniqe fields // [5471] 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)
{ {
// [5517] Alter the title // [5526] 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 23rd December, 2015 @build 5th 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()
{ {
// [10792] check in items // [10801] check in items
$this->checkInNow(); $this->checkInNow();
// load parent items // load parent items
$items = parent::getItems(); $items = parent::getItems();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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()
{ {
// [7649] Get the user object. // [7658] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7651] Create a new query object. // [7660] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7654] Select some fields // [7663] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7661] From the sermondistributor_item table // [7670] From the sermondistributor_item table
$query->from($db->quoteName('#__sermondistributor_statistic', 'a')); $query->from($db->quoteName('#__sermondistributor_statistic', 'a'));
// [7802] From the sermondistributor_sermon table. // [7811] 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') . ')');
// [7802] From the sermondistributor_preacher table. // [7811] 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') . ')');
// [7802] From the sermondistributor_series table. // [7811] 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') . ')');
// [7675] Filter by published state // [7684] 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)');
} }
// [7687] Join over the asset groups. // [7696] 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');
// [7690] Filter by access level. // [7699] 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);
} }
// [7695] Implement View Level Access // [7704] 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 . ')');
} }
// [7772] Filter by search. // [7781] 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
} }
} }
// [8006] Filter by sermon. // [8015] 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)));
} }
// [8006] Filter by preacher. // [8015] 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)));
} }
// [8006] Filter by series. // [8015] 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)));
} }
// [7731] Add the list ordering clause. // [7740] 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)
{ {
// [7439] setup the query // [7448] setup the query
if (SermondistributorHelper::checkArray($pks)) if (SermondistributorHelper::checkArray($pks))
{ {
// [7442] Get the user object. // [7451] Get the user object.
$user = JFactory::getUser(); $user = JFactory::getUser();
// [7444] Create a new query object. // [7453] Create a new query object.
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [7447] Select some fields // [7456] Select some fields
$query->select('a.*'); $query->select('a.*');
// [7449] From the sermondistributor_statistic table // [7458] 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) . ')');
// [7459] Implement View Level Access // [7468] 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 . ')');
} }
// [7466] Order the results by ordering // [7475] Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
// [7468] Load the items // [7477] 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();
// [10867] set values to display correctly. // [10876] set values to display correctly.
if (SermondistributorHelper::checkArray($items)) if (SermondistributorHelper::checkArray($items))
{ {
// [10870] get user object. // [10879] 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;
} }
// [11080] unset the values we don't want exported. // [11089] 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);
} }
} }
// [11089] Add headers to items array. // [11098] 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()
{ {
// [7488] Get a db connection. // [7497] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [7490] get the columns // [7499] get the columns
$columns = $db->getTableColumns("#__sermondistributor_statistic"); $columns = $db->getTableColumns("#__sermondistributor_statistic");
if (SermondistributorHelper::checkArray($columns)) if (SermondistributorHelper::checkArray($columns))
{ {
// [7494] remove the headers you don't import/export. // [7503] 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 = '')
{ {
// [10415] Compile the store id. // [10424] 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()
{ {
// [10808] Get set check in time // [10817] 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)
{ {
// [10813] Get a db connection. // [10822] Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// [10815] reset query // [10824] 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())
{ {
// [10823] Get Yesterdays date // [10832] Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql(); $date = JFactory::getDate()->modify($time)->toSql();
// [10825] reset query // [10834] reset query
$query = $db->getQuery(true); $query = $db->getQuery(true);
// [10827] Fields to update. // [10836] 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'
); );
// [10832] Conditions for which records should be updated. // [10841] 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.'\''
); );
// [10837] Check table // [10846] 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 23rd December, 2015 @build 5th 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 23rd December, 2015 @build 5th 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);
// [4441] Adding History Options // [4450] 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 23rd December, 2015 @build 5th 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);
// [4441] Adding History Options // [4450] Adding History Options
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.preacher')); JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_sermondistributor.preacher'));
} }

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