diff --git a/README.md b/README.md index 0da94a7e..8bdab87f 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,12 @@ max_input_vars = 5000 + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Cost Benefit Projection](https://www.staffhealthcbp.com/) + *First Build*: 15th June, 2012 -+ *Last Build*: 30th May, 2020 ++ *Last Build*: 6th January, 2021 + *Version*: 3.4.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **85996** -+ *File count*: **585** ++ *Line count*: **86905** ++ *File count*: **587** + *Folder count*: **103** > This **component** was build with a Joomla [Automated Component Builder](https://www.vdm.io/joomla-component-builder). diff --git a/admin/README.txt b/admin/README.txt index 0da94a7e..8bdab87f 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -22,12 +22,12 @@ max_input_vars = 5000 + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Cost Benefit Projection](https://www.staffhealthcbp.com/) + *First Build*: 15th June, 2012 -+ *Last Build*: 30th May, 2020 ++ *Last Build*: 6th January, 2021 + *Version*: 3.4.x + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **85996** -+ *File count*: **585** ++ *Line count*: **86905** ++ *File count*: **587** + *Folder count*: **103** > This **component** was build with a Joomla [Automated Component Builder](https://www.vdm.io/joomla-component-builder). diff --git a/admin/access.xml b/admin/access.xml index 787b9954..de8ec395 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -87,6 +87,7 @@ + diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index 233daabf..11ffa753 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage admin.css diff --git a/admin/assets/css/causerisk.css b/admin/assets/css/causerisk.css index 6153244f..335b8501 100644 --- a/admin/assets/css/causerisk.css +++ b/admin/assets/css/causerisk.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk.css diff --git a/admin/assets/css/causesrisks.css b/admin/assets/css/causesrisks.css index af21c555..547b2d47 100644 --- a/admin/assets/css/causesrisks.css +++ b/admin/assets/css/causesrisks.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesrisks.css diff --git a/admin/assets/css/combinedresults.css b/admin/assets/css/combinedresults.css index 6515ea5e..13d39e83 100644 --- a/admin/assets/css/combinedresults.css +++ b/admin/assets/css/combinedresults.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage combinedresults.css diff --git a/admin/assets/css/companies.css b/admin/assets/css/companies.css index 587c41ff..8d76fe0e 100644 --- a/admin/assets/css/companies.css +++ b/admin/assets/css/companies.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies.css diff --git a/admin/assets/css/company.css b/admin/assets/css/company.css index e8c5cf13..c6d44fe5 100644 --- a/admin/assets/css/company.css +++ b/admin/assets/css/company.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.css diff --git a/admin/assets/css/companyresults.css b/admin/assets/css/companyresults.css index 8d18d5c6..52cc27d0 100644 --- a/admin/assets/css/companyresults.css +++ b/admin/assets/css/companyresults.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companyresults.css diff --git a/admin/assets/css/countries.css b/admin/assets/css/countries.css index d3a555e7..fd80d90f 100644 --- a/admin/assets/css/countries.css +++ b/admin/assets/css/countries.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage countries.css diff --git a/admin/assets/css/country.css b/admin/assets/css/country.css index 6d6ba4e4..53cf8645 100644 --- a/admin/assets/css/country.css +++ b/admin/assets/css/country.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage country.css diff --git a/admin/assets/css/currencies.css b/admin/assets/css/currencies.css index 953e2a02..b70848cf 100644 --- a/admin/assets/css/currencies.css +++ b/admin/assets/css/currencies.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage currencies.css diff --git a/admin/assets/css/currency.css b/admin/assets/css/currency.css index a2f48e2d..0f03cab9 100644 --- a/admin/assets/css/currency.css +++ b/admin/assets/css/currency.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.css diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 39200570..0ead9a50 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage dashboard.css diff --git a/admin/assets/css/health_data.css b/admin/assets/css/health_data.css index 55fb2869..86b7ff52 100644 --- a/admin/assets/css/health_data.css +++ b/admin/assets/css/health_data.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data.css diff --git a/admin/assets/css/health_data_sets.css b/admin/assets/css/health_data_sets.css index f402f4b2..701c9b26 100644 --- a/admin/assets/css/health_data_sets.css +++ b/admin/assets/css/health_data_sets.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data_sets.css diff --git a/admin/assets/css/help_document.css b/admin/assets/css/help_document.css index af4ba2e4..1b08eb11 100644 --- a/admin/assets/css/help_document.css +++ b/admin/assets/css/help_document.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_document.css diff --git a/admin/assets/css/help_documents.css b/admin/assets/css/help_documents.css index a5a8526e..376957b7 100644 --- a/admin/assets/css/help_documents.css +++ b/admin/assets/css/help_documents.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_documents.css diff --git a/admin/assets/css/intervention.css b/admin/assets/css/intervention.css index 3fd50474..db5ab5ca 100644 --- a/admin/assets/css/intervention.css +++ b/admin/assets/css/intervention.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage intervention.css diff --git a/admin/assets/css/interventions.css b/admin/assets/css/interventions.css index b8ac8d16..a87f0825 100644 --- a/admin/assets/css/interventions.css +++ b/admin/assets/css/interventions.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions.css diff --git a/admin/assets/css/scaling_factor.css b/admin/assets/css/scaling_factor.css index 9de72689..75c6711a 100644 --- a/admin/assets/css/scaling_factor.css +++ b/admin/assets/css/scaling_factor.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factor.css diff --git a/admin/assets/css/scaling_factors.css b/admin/assets/css/scaling_factors.css index 78f46bf5..39dda439 100644 --- a/admin/assets/css/scaling_factors.css +++ b/admin/assets/css/scaling_factors.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factors.css diff --git a/admin/assets/css/service_provider.css b/admin/assets/css/service_provider.css index 7ee492f1..b527e723 100644 --- a/admin/assets/css/service_provider.css +++ b/admin/assets/css/service_provider.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_provider.css diff --git a/admin/assets/css/service_providers.css b/admin/assets/css/service_providers.css index 42d9a922..f79f5c76 100644 --- a/admin/assets/css/service_providers.css +++ b/admin/assets/css/service_providers.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_providers.css diff --git a/admin/assets/js/admin.js b/admin/assets/js/admin.js index 2b8665e6..e2094e9d 100644 --- a/admin/assets/js/admin.js +++ b/admin/assets/js/admin.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage admin.js diff --git a/admin/controller.php b/admin/controller.php index b4fae228..cb661641 100644 --- a/admin/controller.php +++ b/admin/controller.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage controller.php diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 542373ac..832d614e 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage ajax.json.php diff --git a/admin/controllers/causerisk.php b/admin/controllers/causerisk.php index a58db773..d120018b 100644 --- a/admin/controllers/causerisk.php +++ b/admin/controllers/causerisk.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk.php diff --git a/admin/controllers/causesrisks.php b/admin/controllers/causesrisks.php index 2bb69d9e..a9b95615 100644 --- a/admin/controllers/causesrisks.php +++ b/admin/controllers/causesrisks.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesrisks.php @@ -63,7 +63,7 @@ class CostbenefitprojectionControllerCausesrisks extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Causesrisks'); // get the data to export diff --git a/admin/controllers/combinedresults.php b/admin/controllers/combinedresults.php index 3b7d6173..fb33445b 100644 --- a/admin/controllers/combinedresults.php +++ b/admin/controllers/combinedresults.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage combinedresults.php diff --git a/admin/controllers/companies.php b/admin/controllers/companies.php index 3760ee0d..a7ddc502 100644 --- a/admin/controllers/companies.php +++ b/admin/controllers/companies.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies.php @@ -63,7 +63,7 @@ class CostbenefitprojectionControllerCompanies extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Companies'); // get the data to export @@ -126,7 +126,7 @@ class CostbenefitprojectionControllerCompanies extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // convert to string $ids = implode('_', $pks); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=combinedresults&cid='.$ids, false)); diff --git a/admin/controllers/company.php b/admin/controllers/company.php index ead85c7c..71cd8b64 100644 --- a/admin/controllers/company.php +++ b/admin/controllers/company.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.php diff --git a/admin/controllers/companyresults.php b/admin/controllers/companyresults.php index d1371d9d..fc33146f 100644 --- a/admin/controllers/companyresults.php +++ b/admin/controllers/companyresults.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companyresults.php diff --git a/admin/controllers/costbenefitprojection.php b/admin/controllers/costbenefitprojection.php index cb5315d9..d47716f0 100644 --- a/admin/controllers/costbenefitprojection.php +++ b/admin/controllers/costbenefitprojection.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php diff --git a/admin/controllers/countries.php b/admin/controllers/countries.php index 8cd27279..fdd6ffa4 100644 --- a/admin/controllers/countries.php +++ b/admin/controllers/countries.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage countries.php @@ -63,7 +63,7 @@ class CostbenefitprojectionControllerCountries extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Countries'); // get the data to export diff --git a/admin/controllers/country.php b/admin/controllers/country.php index 4b3fc4f1..2fd0f593 100644 --- a/admin/controllers/country.php +++ b/admin/controllers/country.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage country.php diff --git a/admin/controllers/currencies.php b/admin/controllers/currencies.php index a26c8d26..166a9471 100644 --- a/admin/controllers/currencies.php +++ b/admin/controllers/currencies.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage currencies.php @@ -63,7 +63,7 @@ class CostbenefitprojectionControllerCurrencies extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Currencies'); // get the data to export diff --git a/admin/controllers/currency.php b/admin/controllers/currency.php index 58427a72..0e8ba5a8 100644 --- a/admin/controllers/currency.php +++ b/admin/controllers/currency.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.php diff --git a/admin/controllers/health_data.php b/admin/controllers/health_data.php index db5c4ee3..7436d27c 100644 --- a/admin/controllers/health_data.php +++ b/admin/controllers/health_data.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data.php diff --git a/admin/controllers/health_data_sets.php b/admin/controllers/health_data_sets.php index e68a0ae0..c4265ada 100644 --- a/admin/controllers/health_data_sets.php +++ b/admin/controllers/health_data_sets.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data_sets.php @@ -63,7 +63,7 @@ class CostbenefitprojectionControllerHealth_data_sets extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Health_data_sets'); // get the data to export @@ -112,5 +112,48 @@ class CostbenefitprojectionControllerHealth_data_sets extends JControllerAdmin $message = JText::_('COM_COSTBENEFITPROJECTION_IMPORT_FAILED'); $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=health_data_sets', false), $message, 'error'); return; + } + + + /** + * get a bulk export of health_data_sets + */ + public function getBulkExport() + { + // Check for request forgeries + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + // check if export is allowed for this user. + $user = JFactory::getUser(); + $status = 'error'; + if ($user->authorise('health_data.bulk_export', 'com_costbenefitprojection')) + { + // Get the model + $model = $this->getModel('Health_data_sets'); + // get the data + if (($data = $model->getBulkExport()) !== false) + { + // now set the data to the spreadsheet + $date = JFactory::getDate(); + try + { + CostbenefitprojectionHelper::xls($data, 'Health_data_sets_' . $date->format('jS_F_Y'), 'Health_data_sets exported (' . $date->format('jS F, Y') . ')', 'health_data_sets'); + } + catch (\RuntimeException $e) + { + jexit('Error: ' . $e->getMessage()); + } + } + else + { + // Set error message + $message = JText::_('COM_COSTBENEFITPROJECTION_BULK_EXPORT_OF_HEALTH_DATA_SETS_FAILED_SHOULD_THIS_ISSUE_CONTINUE_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR'); + } + } + else + { + // Set error message + $message = JText::_('COM_COSTBENEFITPROJECTION_YOU_DO_NOT_HAVE_PERMISSION_TO_DO_A_BULK_EXPORT_OF_HEALTH_DATA_SETS'); + } + $this->setRedirect(JRoute::_('index.php?option=com_costbenefitprojection&view=health_data_sets', false), $message, $status); } } diff --git a/admin/controllers/help.php b/admin/controllers/help.php index c98b4b88..f5f25255 100644 --- a/admin/controllers/help.php +++ b/admin/controllers/help.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help.php diff --git a/admin/controllers/help_document.php b/admin/controllers/help_document.php index bff58743..353be0dc 100644 --- a/admin/controllers/help_document.php +++ b/admin/controllers/help_document.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_document.php diff --git a/admin/controllers/help_documents.php b/admin/controllers/help_documents.php index d39f63b0..bda5b150 100644 --- a/admin/controllers/help_documents.php +++ b/admin/controllers/help_documents.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_documents.php @@ -63,7 +63,7 @@ class CostbenefitprojectionControllerHelp_documents extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Help_documents'); // get the data to export diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 5fc28fe1..8feaa1aa 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage import.php diff --git a/admin/controllers/import_health_data_sets.php b/admin/controllers/import_health_data_sets.php index 9aaf045d..3f92573e 100644 --- a/admin/controllers/import_health_data_sets.php +++ b/admin/controllers/import_health_data_sets.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage import_health_data_sets.php diff --git a/admin/controllers/intervention.php b/admin/controllers/intervention.php index d17ecea5..8edc77d0 100644 --- a/admin/controllers/intervention.php +++ b/admin/controllers/intervention.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage intervention.php diff --git a/admin/controllers/interventions.php b/admin/controllers/interventions.php index 18846530..e80560d6 100644 --- a/admin/controllers/interventions.php +++ b/admin/controllers/interventions.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions.php @@ -63,7 +63,7 @@ class CostbenefitprojectionControllerInterventions extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Interventions'); // get the data to export diff --git a/admin/controllers/scaling_factor.php b/admin/controllers/scaling_factor.php index 1d062050..3232a018 100644 --- a/admin/controllers/scaling_factor.php +++ b/admin/controllers/scaling_factor.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factor.php diff --git a/admin/controllers/scaling_factors.php b/admin/controllers/scaling_factors.php index 72f23426..78e2b136 100644 --- a/admin/controllers/scaling_factors.php +++ b/admin/controllers/scaling_factors.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factors.php @@ -63,7 +63,7 @@ class CostbenefitprojectionControllerScaling_factors extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Scaling_factors'); // get the data to export diff --git a/admin/controllers/service_provider.php b/admin/controllers/service_provider.php index d43fca57..2b92e85b 100644 --- a/admin/controllers/service_provider.php +++ b/admin/controllers/service_provider.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_provider.php diff --git a/admin/controllers/service_providers.php b/admin/controllers/service_providers.php index b3adf5bb..ccf822d4 100644 --- a/admin/controllers/service_providers.php +++ b/admin/controllers/service_providers.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_providers.php @@ -63,7 +63,7 @@ class CostbenefitprojectionControllerService_providers extends JControllerAdmin $input = JFactory::getApplication()->input; $pks = $input->post->get('cid', array(), 'array'); // Sanitize the input - ArrayHelper::toInteger($pks); + $pks = ArrayHelper::toInteger($pks); // Get the model $model = $this->getModel('Service_providers'); // get the data to export diff --git a/admin/costbenefitprojection.php b/admin/costbenefitprojection.php index e7ff585b..2e10cc29 100644 --- a/admin/costbenefitprojection.php +++ b/admin/costbenefitprojection.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php @@ -19,6 +19,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + JHtml::_('behavior.tabstate'); // Access check. diff --git a/admin/helpers/costbenefitprojection.php b/admin/helpers/costbenefitprojection.php index 19266726..ae450231 100644 --- a/admin/helpers/costbenefitprojection.php +++ b/admin/helpers/costbenefitprojection.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php @@ -20,8 +20,9 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\CMS\Language\Language; -use Joomla\String\StringHelper; +use Joomla\CMS\Language\Language; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\Spreadsheet; @@ -982,9 +983,33 @@ abstract class CostbenefitprojectionHelper /** * Greate user and update given table + * + * @param array $credentials Array('name' => string, 'username' => string, 'email' => string, 'password' => string, 'password2' => string) + * @param int $autologin + * @param array $params Array('useractivation' => int, 'sendpassword' => int, 'allowUserRegistration' => int) + * @param array $mode 1 = Site Registrations; 0 = Admin Registration; 2 = Custom Helper Method Called registerUser + * + * @return int|Error User ID on success, or an error. */ - public static function createUser($new) + public static function createUser($credentials, $autologin = 0, + $params = array( + 'useractivation' => 0, 'sendpassword' => 1 + ), $mode = 1 + ) { + // Override mode + if ($mode == 2 && method_exists(__CLASS__, 'registerUser')) + { + // Update params + $params['autologin'] = $autologin; + // Now Register User + return self::registerUser($credentials, $params); + } + elseif ($mode == 2) + { + // Fallback to Site Registrations + $mode = 1; + } // load the user component language files if there is an error. $lang = JFactory::getLanguage(); $extension = 'com_users'; @@ -992,53 +1017,113 @@ abstract class CostbenefitprojectionHelper $language_tag = 'en-GB'; $reload = true; $lang->load($extension, $base_dir, $language_tag, $reload); - // load the user regestration model - $model = self::getModel('registration', JPATH_ROOT. '/components/com_users', 'Users'); - // make sure no activation is needed - $useractivation = self::setParams('com_users','useractivation',0); - // make sure password is send - $sendpassword = self::setParams('com_users','sendpassword',1); - // Check if password was set - if (isset($new['password']) && isset($new['password2']) && self::checkString($new['password']) && self::checkString($new['password2'])) + // Load the correct user model. + if ($mode == 1) // 1 = Site Registrations { - // Use the users passwords - $password = $new['password']; - $password2 = $new['password2']; + // Load the user site-registration model + $model = self::getModel('registration', $base_dir . '/components/' . $extension, 'Users'); } - else + else // 0 = Admin Registration { - // Set random password - $password = self::randomkey(8); - $password2 = $password; + // Load the backend-user model + $model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/' . $extension, 'Users'); } - // set username if not set - if (!isset($new['username']) || !self::checkString($new['username'])) + // Check if we have params/config + if (self::checkArray($params)) { - $new['username'] = self::safeString($new['name']); + // Make changes to user config + foreach ($params as $param => $set) + { + // If you know of a better path, let me know + $params[$param] = self::setParams($extension, $param, $set); + } } - // linup new user data + // Set username to email if not set + if (!isset($credentials['username']) || !self::checkString($credentials['username'])) + { + $credentials['username'] = $credentials['email']; + } + // Lineup new user data array $data = array( - 'username' => $new['username'], - 'name' => $new['name'], - 'email1' => $new['email'], - 'password1' => $password, // First password field - 'password2' => $password2, // Confirm password field + 'username' => $credentials['username'], + 'name' => $credentials['name'], 'block' => 0 ); - // register the new user - $userId = $model->register($data); - // set activation back to default - self::setParams('com_users','useractivation',$useractivation); - // set send password back to default - self::setParams('com_users','sendpassword',$sendpassword); + // Added details based on mode + if ($mode == 1) // 1 = Site-registration mode + { + $data['email1'] = $credentials['email']; + } + else // 0 = Admin-registration mode + { + $data['email'] = $credentials['email']; + $data['registerDate'] = JFactory::getDate()->toSql(); + } + // Check if password was set + if ($mode == 1 && (!isset($credentials['password']) || !isset($credentials['password2']) || !self::checkString($credentials['password']) || !self::checkString($credentials['password2']))) + { + // Set random password when empty password was submitted, + // when using the 1 = site-registration mode + $credentials['password'] = self::randomkey(8); + $credentials['password2'] = $credentials['password']; + } + // Now Add password if set + if (isset($credentials['password']) && isset($credentials['password2']) && self::checkString($credentials['password']) && self::checkString($credentials['password2'])) + { + if ($mode == 1) // 1 = Site-registration mode + { + $data['password1'] = $credentials['password']; + } + else // 0 = Admin-registration mode + { + $data['password'] = $credentials['password']; + } + $data['password2'] = $credentials['password2']; + } + // Load the group/s value if set, only for Admin Registration ($mode == 0) + if ($mode == 0 && isset($credentials['groups']) && self::checkArray($credentials['groups'])) + { + $data['groups'] = $credentials['groups']; + } + // Create the new user + if ($mode == 1) // 1 = Site-registration mode + { + $userId = $model->register($data); + } + else // 0 = Admin-registration mode + { + $model->save($data); + $userId = $model->getState('user.id', 0); + } + // Check if we have params + if (self::checkArray($params)) + { + // Change user params/config back + foreach ($params as $param => $set) + { + // If you know of a better path, let me know + self::setParams($extension, $param, $set); + } + } // if user is created if ($userId > 0) { + // Auto Login if Needed + if ($autologin && isset($credentials['password'])) + { + // Try to login + try{ + JFactory::getApplication()->login($credentials); + } catch (Exception $exception){ + // Do noting for now, may want to set redirect. + } + } + // Return ID return $userId; } return $model->getError(); } - protected static function setParams($component,$target,$value) + public static function setParams($component,$target,$value) { // Get the params and set the new values $params = JComponentHelper::getParams($component); @@ -1056,7 +1141,7 @@ abstract class CostbenefitprojectionHelper // Execute the query $db->setQuery($query); - $db->query(); + $db->execute(); } return $was; } @@ -1083,21 +1168,17 @@ abstract class CostbenefitprojectionHelper $password2 = $new['password2']; } // set username - if (isset($new['username']) && self::checkString($new['username'])) + if (!isset($new['username']) || !self::checkString($new['username'])) { - $new['username'] = self::safeString($new['username']); + $new['username'] = $new['email']; } - else - { - $new['username'] = self::safeString($new['name']); - } - // linup update user data + // lineup update user data $data = array( 'id' => $new['id'], 'username' => $new['username'], 'name' => $new['name'], 'email' => $new['email'], - 'password1' => $password, // First password field + 'password' => $password, // First password field 'password2' => $password2, // Confirm password field 'block' => 0 ); // set groups if found @@ -1258,6 +1339,8 @@ abstract class CostbenefitprojectionHelper ->setLastModifiedBy($modified) ->setTitle($title) ->setSubject($subjectTab); + // The file type + $file_type = 'Xls'; // set description if ($description) { @@ -1297,21 +1380,46 @@ abstract class CostbenefitprojectionHelper )); // Add some data - if (self::checkArray($rows)) + if (($size = self::checkArray($rows)) !== false) { $i = 1; - foreach ($rows as $array){ + + // Based on data size we adapt the behaviour. + $xls_mode = 1; + if ($size > 3000) + { + $xls_mode = 3; + $file_type = 'Csv'; + } + elseif ($size > 2000) + { + $xls_mode = 2; + } + + // Set active sheet and get it. + $active_sheet = $spreadsheet->setActiveSheetIndex(0); + foreach ($rows as $array) + { $a = 'A'; - foreach ($array as $value){ - $spreadsheet->setActiveSheetIndex(0)->setCellValue($a.$i, $value); - if ($i == 1){ - $spreadsheet->getActiveSheet()->getColumnDimension($a)->setAutoSize(true); - $spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($headerStyles); - $spreadsheet->getActiveSheet()->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); - } elseif ($a === 'A'){ - $spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($sideStyles); - } else { - $spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($normalStyles); + foreach ($array as $value) + { + $active_sheet->setCellValue($a.$i, $value); + if ($xls_mode != 3) + { + if ($i == 1) + { + $active_sheet->getColumnDimension($a)->setAutoSize(true); + $active_sheet->getStyle($a.$i)->applyFromArray($headerStyles); + $active_sheet->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); + } + elseif ($a === 'A') + { + $active_sheet->getStyle($a.$i)->applyFromArray($sideStyles); + } + elseif ($xls_mode == 1) + { + $active_sheet->getStyle($a.$i)->applyFromArray($normalStyles); + } } $a++; } @@ -1331,7 +1439,7 @@ abstract class CostbenefitprojectionHelper // Redirect output to a client's web browser (Excel5) header('Content-Type: application/vnd.ms-excel'); - header('Content-Disposition: attachment;filename="'.$fileName.'.xls"'); + header('Content-Disposition: attachment;filename="' . $fileName . '.' . strtolower($file_type) .'"'); header('Cache-Control: max-age=0'); // If you're serving to IE 9, then the following may be needed header('Cache-Control: max-age=1'); @@ -1342,7 +1450,7 @@ abstract class CostbenefitprojectionHelper header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header ('Pragma: public'); // HTTP/1.0 - $writer = IOFactory::createWriter($spreadsheet, 'Xls'); + $writer = IOFactory::createWriter($spreadsheet, $file_type); $writer->save('php://output'); jexit(); } diff --git a/admin/helpers/headercheck.php b/admin/helpers/headercheck.php index 6d926d64..8ccb273a 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage headercheck.php diff --git a/admin/helpers/html/batch_.php b/admin/helpers/html/batch_.php index b1ad262d..11c39b19 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage batch_.php diff --git a/admin/helpers/sum.php b/admin/helpers/sum.php index 982b4912..657bad0b 100644 --- a/admin/helpers/sum.php +++ b/admin/helpers/sum.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage sum.php diff --git a/admin/helpers/sumcombine.php b/admin/helpers/sumcombine.php index c8a5fe38..dd508072 100644 --- a/admin/helpers/sumcombine.php +++ b/admin/helpers/sumcombine.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage sumcombine.php diff --git a/admin/language/en-GB/en-GB.com_costbenefitprojection.ini b/admin/language/en-GB/en-GB.com_costbenefitprojection.ini index 7a0d386a..1d91647d 100644 --- a/admin/language/en-GB/en-GB.com_costbenefitprojection.ini +++ b/admin/language/en-GB/en-GB.com_costbenefitprojection.ini @@ -14,6 +14,9 @@ COM_COSTBENEFITPROJECTION_A_FEW_OPEN_ISSUES_FROM_GITHUB_IS_LOADING="A few open i COM_COSTBENEFITPROJECTION_BACK="Back" COM_COSTBENEFITPROJECTION_BASIC_METHOD="Basic Method" COM_COSTBENEFITPROJECTION_BENEFIT="Benefit" +COM_COSTBENEFITPROJECTION_BETA_RELEASE="Beta Release" +COM_COSTBENEFITPROJECTION_BULK_EXPORT="Bulk Export" +COM_COSTBENEFITPROJECTION_BULK_EXPORT_OF_HEALTH_DATA_SETS_FAILED_SHOULD_THIS_ISSUE_CONTINUE_PLEASE_INFORM_YOUR_SYSTEM_ADMINISTRATOR="Bulk export of health_data_sets failed should this issue continue, please inform your system administrator." COM_COSTBENEFITPROJECTION_CALCULATED_COSTS_IN_DETAIL="Calculated Costs in Detail" COM_COSTBENEFITPROJECTION_CAUSERISK="Cause/Risk" COM_COSTBENEFITPROJECTION_CAUSERISK_ALIAS="Alias" @@ -97,6 +100,8 @@ COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_CHECKED_IN_1="%d Cause/Risk succes COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_CHECKED_IN_MORE="%d Causes/Risks successfully checked in." COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_DELETED="%s Causes/Risks deleted." COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_DELETED_1="%s Cause/Risk deleted." +COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_FAILED_PUBLISHING="%s Causes/Risks failed publishing." +COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_FAILED_PUBLISHING_1="%s Cause/Risk failed publishing." COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_FEATURED="%s Causes/Risks featured." COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_FEATURED_1="%s Cause/Risk featured." COM_COSTBENEFITPROJECTION_CAUSESRISKS_N_ITEMS_PUBLISHED="%s Causes/Risks published." @@ -183,6 +188,8 @@ COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_CHECKED_IN_1="%d Company successfull COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_CHECKED_IN_MORE="%d Companies successfully checked in." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_DELETED="%s Companies deleted." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_DELETED_1="%s Company deleted." +COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_FAILED_PUBLISHING="%s Companies failed publishing." +COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_FAILED_PUBLISHING_1="%s Company failed publishing." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_FEATURED="%s Companies featured." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_FEATURED_1="%s Company featured." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_PUBLISHED="%s Companies published." @@ -497,6 +504,8 @@ COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_CHECKED_IN_1="%d Country successfull COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_CHECKED_IN_MORE="%d Countries successfully checked in." COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_DELETED="%s Countries deleted." COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_DELETED_1="%s Country deleted." +COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_FAILED_PUBLISHING="%s Countries failed publishing." +COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_FAILED_PUBLISHING_1="%s Country failed publishing." COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_FEATURED="%s Countries featured." COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_FEATURED_1="%s Country featured." COM_COSTBENEFITPROJECTION_COUNTRIES_N_ITEMS_PUBLISHED="%s Countries published." @@ -712,6 +721,8 @@ COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_CHECKED_IN_1="%d Currency successfu COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_CHECKED_IN_MORE="%d Currencies successfully checked in." COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_DELETED="%s Currencies deleted." COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_DELETED_1="%s Currency deleted." +COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_FAILED_PUBLISHING="%s Currencies failed publishing." +COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_FAILED_PUBLISHING_1="%s Currency failed publishing." COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_FEATURED="%s Currencies featured." COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_FEATURED_1="%s Currency featured." COM_COSTBENEFITPROJECTION_CURRENCIES_N_ITEMS_PUBLISHED="%s Currencies published." @@ -819,6 +830,7 @@ COM_COSTBENEFITPROJECTION_DAYS_LOST_MORTALITY="Days Lost Mortality" COM_COSTBENEFITPROJECTION_DAYS_LOST_PRESENTEEISM_DUE_TO_MORBIDITY="Days Lost Presenteeism (due to morbidity)" COM_COSTBENEFITPROJECTION_DEBUG_MENU="Debug Menu" COM_COSTBENEFITPROJECTION_DISEASERISK_FACTOR="Disease/Risk Factor" +COM_COSTBENEFITPROJECTION_DOWNLOAD="download" COM_COSTBENEFITPROJECTION_DURATION_S_YEAR="Duration: %s year" COM_COSTBENEFITPROJECTION_DURATION_S_YEARS="Duration: %s years" COM_COSTBENEFITPROJECTION_EDIT="Edit" @@ -837,6 +849,8 @@ COM_COSTBENEFITPROJECTION_GENDER_ID="Gender id" COM_COSTBENEFITPROJECTION_GENDER_NAME="Gender name" COM_COSTBENEFITPROJECTION_HEALTH_DATA="Health Data" COM_COSTBENEFITPROJECTION_HEALTH_DATA_AGE_LABEL="Age Group" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_BULK_EXPORT_BUTTON_ACCESS="Health Data Bulk Export Button Access" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_BULK_EXPORT_BUTTON_ACCESS_DESC="Allows the users in this group to access the bulk export button." COM_COSTBENEFITPROJECTION_HEALTH_DATA_CAUSERISK="Causerisk" COM_COSTBENEFITPROJECTION_HEALTH_DATA_CAUSERISK_LABEL="Cause/Risk" COM_COSTBENEFITPROJECTION_HEALTH_DATA_COUNTRY="Country" @@ -930,6 +944,8 @@ COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_CHECKED_IN_1="%d Health Data COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_CHECKED_IN_MORE="%d Health Data Sets successfully checked in." COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_DELETED="%s Health Data Sets deleted." COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_DELETED_1="%s Health Data deleted." +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_FAILED_PUBLISHING="%s Health Data Sets failed publishing." +COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_FAILED_PUBLISHING_1="%s Health Data failed publishing." COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_FEATURED="%s Health Data Sets featured." COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_FEATURED_1="%s Health Data featured." COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_N_ITEMS_PUBLISHED="%s Health Data Sets published." @@ -1000,6 +1016,8 @@ COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_CHECKED_IN_1="%d Help Document COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_CHECKED_IN_MORE="%d Help Documents successfully checked in." COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_DELETED="%s Help Documents deleted." COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_DELETED_1="%s Help Document deleted." +COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_FAILED_PUBLISHING="%s Help Documents failed publishing." +COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_FAILED_PUBLISHING_1="%s Help Document failed publishing." COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_FEATURED="%s Help Documents featured." COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_FEATURED_1="%s Help Document featured." COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_N_ITEMS_PUBLISHED="%s Help Documents published." @@ -1046,7 +1064,6 @@ COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_MODIFIED_DATE_LABEL="Modified Date" COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_NEW="A New Help Document" COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_NOT_REQUIRED="Not Required" COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_ORDERING_LABEL="Ordering" -COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_PERMISSION="Permissions" COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_PUBLISHING="Publishing" COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Help Document to customise the alias." COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_SELECT_AN_OPTION="Select an option" @@ -1158,6 +1175,8 @@ COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_CHECKED_IN_1="%d Intervention su COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_CHECKED_IN_MORE="%d Interventions successfully checked in." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_DELETED="%s Interventions deleted." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_DELETED_1="%s Intervention deleted." +COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_FAILED_PUBLISHING="%s Interventions failed publishing." +COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_FAILED_PUBLISHING_1="%s Intervention failed publishing." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_FEATURED="%s Interventions featured." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_FEATURED_1="%s Intervention featured." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_PUBLISHED="%s Interventions published." @@ -1243,9 +1262,12 @@ COM_COSTBENEFITPROJECTION_INTERVENTION_TYPE_DESCRIPTION="Select the intervention COM_COSTBENEFITPROJECTION_INTERVENTION_TYPE_LABEL="Type" COM_COSTBENEFITPROJECTION_INTERVENTION_VERSION_DESC="A count of the number of times this Intervention has been revised." COM_COSTBENEFITPROJECTION_INTERVENTION_VERSION_LABEL="Version" +COM_COSTBENEFITPROJECTION_ISSUE="issue" COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS="- Keep Original Access -" COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_CATEGORY="- Keep Original Category -" COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE="- Keep Original State -" +COM_COSTBENEFITPROJECTION_LAST_FEW_RELEASES_FROM_GITHUB_IS_LOADING="Last few releases from Github is loading" +COM_COSTBENEFITPROJECTION_LATEST_RELEASE="Latest Release" COM_COSTBENEFITPROJECTION_LICENSE="License" COM_COSTBENEFITPROJECTION_LOCATION_NAME="Location name" COM_COSTBENEFITPROJECTION_MAIN_MENU="Main Menu" @@ -1269,7 +1291,12 @@ COM_COSTBENEFITPROJECTION_NO_DISEASERISK_SELECTED="No Disease/Risk Selected" COM_COSTBENEFITPROJECTION_NO_INTERVENTION_SELECTED="No Intervention Selected" COM_COSTBENEFITPROJECTION_NUMBER_OF_WORK_DAYS_LOST="Number of work days lost" COM_COSTBENEFITPROJECTION_ONLY_USE_THE_ADVANCED_IMPORT_WHEN_IMPORTING_THE_CSV_FILES_FROM_HTTPGHDXHEALTHDATAORG="Only use the advanced import when importing the CSV files from http://ghdx.healthdata.org" -COM_COSTBENEFITPROJECTION_OPENED_BY="opened by" +COM_COSTBENEFITPROJECTION_ON_GITHUB="on Github" +COM_COSTBENEFITPROJECTION_OPEN="Open" +COM_COSTBENEFITPROJECTION_OPENED="opened" +COM_COSTBENEFITPROJECTION_OPENED_THIS="opened this" +COM_COSTBENEFITPROJECTION_OPEN_ON_GITHUB="Open on Github" +COM_COSTBENEFITPROJECTION_OUT_OF_DATE="Out of date" COM_COSTBENEFITPROJECTION_PERCENT_OF_BESTIMATED_BURDENB_BEING_TARGETED_BY_THIS_DISEASERISK_SELECTION="Percent of Estimated Burden being targeted by this Disease/Risk selection" COM_COSTBENEFITPROJECTION_PERCENT_OF_TOTAL_COST="Percent of Total Cost" COM_COSTBENEFITPROJECTION_PERCENT_OF_TOTAL_DAYS_LOST="Percent of Total Days Lost" @@ -1280,6 +1307,7 @@ COM_COSTBENEFITPROJECTION_PRESENTEEISM_MORBIDITY="Presenteeism (morbidity)" COM_COSTBENEFITPROJECTION_PUBLISHED="Published" COM_COSTBENEFITPROJECTION_REDUCTION_IN_MORBIDITY_COSTS="Reduction in Morbidity Costs" COM_COSTBENEFITPROJECTION_REDUCTION_IN_MORTALITY_COST="Reduction in Mortality Cost" +COM_COSTBENEFITPROJECTION_RELEASED_THIS="released this" COM_COSTBENEFITPROJECTION_RESPOND_TO_THIS_ISSUE_ON_GITHUB="Respond to this issue on Github" COM_COSTBENEFITPROJECTION_RESULTS_MENU="Results Menu" COM_COSTBENEFITPROJECTION_REVIEW_THIS_ISSUE_ON_GITHUB="Review this issue on Github" @@ -1323,6 +1351,8 @@ COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_CHECKED_IN_1="%d Scaling Facto COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_CHECKED_IN_MORE="%d Scaling Factors successfully checked in." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_DELETED="%s Scaling Factors deleted." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_DELETED_1="%s Scaling Factor deleted." +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_FAILED_PUBLISHING="%s Scaling Factors failed publishing." +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_FAILED_PUBLISHING_1="%s Scaling Factor failed publishing." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_FEATURED="%s Scaling Factors featured." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_FEATURED_1="%s Scaling Factor featured." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_PUBLISHED="%s Scaling Factors published." @@ -1436,6 +1466,8 @@ COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_CHECKED_IN_1="%d Service Pro COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_CHECKED_IN_MORE="%d Service Providers successfully checked in." COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_DELETED="%s Service Providers deleted." COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_DELETED_1="%s Service Provider deleted." +COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_FAILED_PUBLISHING="%s Service Providers failed publishing." +COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_FAILED_PUBLISHING_1="%s Service Provider failed publishing." COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_FEATURED="%s Service Providers featured." COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_FEATURED_1="%s Service Provider featured." COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_N_ITEMS_PUBLISHED="%s Service Providers published." @@ -1511,7 +1543,6 @@ COM_COSTBENEFITPROJECTION_TABLES_QUICK_LINKS="Tables ›› Quick Links" COM_COSTBENEFITPROJECTION_THE_NOTICE_BOARD_IS_LOADING="The notice board is loading" COM_COSTBENEFITPROJECTION_THE_README_IS_LOADING="The readme is loading" COM_COSTBENEFITPROJECTION_THE_STATISTICAL_DATA_COULD_NOT_BE_RETURNED_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR="The statistical data could not be returned. Please contact your system administrator." -COM_COSTBENEFITPROJECTION_THE_WIKI_IS_LOADING="The wiki is loading" COM_COSTBENEFITPROJECTION_TOTAL="Total" COM_COSTBENEFITPROJECTION_TOTAL_COST="Total Cost" COM_COSTBENEFITPROJECTION_TOTAL_COSTS="Total Costs" @@ -1520,6 +1551,7 @@ COM_COSTBENEFITPROJECTION_TOTAL_COST_PER_DISEASERISK_FACTOR="Total Cost Per Dise COM_COSTBENEFITPROJECTION_TOTAL_DAYS_LOST="Total Days Lost" COM_COSTBENEFITPROJECTION_TOTAL_DAYS_LOST_AND_CONTRIBUTION_OF_MORBIDITY_MORTALITY_AND_RISK_FACTORS="Total Days Lost and Contribution of Morbidity, Mortality and Risk Factors" COM_COSTBENEFITPROJECTION_TOTAL_DAYS_LOST_PER_DISEASERISK_FACTOR="Total Days Lost Per Disease/Risk Factor" +COM_COSTBENEFITPROJECTION_TOTAL_DOWNLOADS="total downloads" COM_COSTBENEFITPROJECTION_TOTAL_EMPLOYEESBR_IN_RELATION_TO_THIS_NUMBER="total employees
in relation to this number." COM_COSTBENEFITPROJECTION_TOTAL_EMPLOYEESBR_IN_RELATION_TO_THIS_TOTAL="total employees
in relation to this total." COM_COSTBENEFITPROJECTION_TRASHED="Trashed" @@ -1533,6 +1565,7 @@ COM_COSTBENEFITPROJECTION_TYPE_INTERVENTION="Intervention" COM_COSTBENEFITPROJECTION_TYPE_SCALING_FACTOR="Scaling Factor" COM_COSTBENEFITPROJECTION_TYPE_SERVICE_PROVIDER="Service Provider" COM_COSTBENEFITPROJECTION_UNAVAILABLE_AT_THIS_TIME="Unavailable at this time." +COM_COSTBENEFITPROJECTION_UP_TO_DATE="Up to date" COM_COSTBENEFITPROJECTION_USER_COUNTRY_GROUP="User Country Group" COM_COSTBENEFITPROJECTION_USER_MEMBER_GROUP="User Member Group" COM_COSTBENEFITPROJECTION_USER_SERVICE_PROVIDER_GROUP="User Service Provider Group" @@ -1540,6 +1573,7 @@ COM_COSTBENEFITPROJECTION_USE_BATCH="Use Batch" COM_COSTBENEFITPROJECTION_USE_BATCH_DESC="Allows users in this group to use batch copy/update method." COM_COSTBENEFITPROJECTION_VERSION="Version" COM_COSTBENEFITPROJECTION_VIEW_MORE_ISSUES_ON_GITHUB="View more issues on Github" +COM_COSTBENEFITPROJECTION_VIEW_MORE_RELEASES_ON_GITHUB="View more releases on Github" COM_COSTBENEFITPROJECTION_WARNING="Warning" COM_COSTBENEFITPROJECTION_WEBSITE="Website" COM_COSTBENEFITPROJECTION_WORK_DAYS_LOST="Work Days Lost" @@ -1547,5 +1581,6 @@ COM_COSTBENEFITPROJECTION_WORK_DAYS_LOST_PERCENT="Work Days Lost Percent" COM_COSTBENEFITPROJECTION_WORK_DAYS_LOST_SUMMARY="Work Days Lost Summary" COM_COSTBENEFITPROJECTION_WORK_DAY_LOST_PERCENT="Work Day Lost Percent" COM_COSTBENEFITPROJECTION_YEAR="Year" +COM_COSTBENEFITPROJECTION_YOU_DO_NOT_HAVE_PERMISSION_TO_DO_A_BULK_EXPORT_OF_HEALTH_DATA_SETS="You do not have permission to do a bulk export of health_data_sets." COM_COSTBENEFITPROJECTION__OF_ALL_HEALTHCARE_COSTS_CAUSED_BY_THE_CAUSERISK_FACTOR="% of all healthcare costs caused by the cause/risk factor" COM_COSTBENEFITPROJECTION__OF_WORK_DAYS_LOST_DUE_TO_THE_CAUSERISK_FACTOR="% of work days lost due to the cause/risk factor" \ No newline at end of file diff --git a/admin/language/en-GB/en-GB.com_costbenefitprojection.sys.ini b/admin/language/en-GB/en-GB.com_costbenefitprojection.sys.ini index 34d0020b..0889ec26 100644 --- a/admin/language/en-GB/en-GB.com_costbenefitprojection.sys.ini +++ b/admin/language/en-GB/en-GB.com_costbenefitprojection.sys.ini @@ -152,6 +152,8 @@ COM_COSTBENEFITPROJECTION_EDIT_VERSIONS="Edit Version" COM_COSTBENEFITPROJECTION_EDIT_VERSIONS_DESC="Allows users in this group to edit versions." COM_COSTBENEFITPROJECTION_EXPORT_DATA="Export Data" COM_COSTBENEFITPROJECTION_EXPORT_DATA_DESC="Allows users in this group to export data." +COM_COSTBENEFITPROJECTION_HEALTH_DATA_BULK_EXPORT_BUTTON_ACCESS="Health Data Bulk Export Button Access" +COM_COSTBENEFITPROJECTION_HEALTH_DATA_BULK_EXPORT_BUTTON_ACCESS_DESC="Allows the users in this group to access the bulk export button." COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_ACCESS="Health Data Sets Access" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_ACCESS_DESC="Allows the users in this group to access access health data sets" COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_BATCH_USE="Health Data Sets Batch Use" diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 432dc4fd..a7dbecdd 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage batchselection.php diff --git a/admin/layouts/causerisk/details_above.php b/admin/layouts/causerisk/details_above.php index 3d8530fe..57cb29bc 100644 --- a/admin/layouts/causerisk/details_above.php +++ b/admin/layouts/causerisk/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/admin/layouts/causerisk/details_fullwidth.php b/admin/layouts/causerisk/details_fullwidth.php index a58d85ba..981db21a 100644 --- a/admin/layouts/causerisk/details_fullwidth.php +++ b/admin/layouts/causerisk/details_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_fullwidth.php diff --git a/admin/layouts/causerisk/details_left.php b/admin/layouts/causerisk/details_left.php index 7bebf9c1..408dcb80 100644 --- a/admin/layouts/causerisk/details_left.php +++ b/admin/layouts/causerisk/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/admin/layouts/causerisk/details_right.php b/admin/layouts/causerisk/details_right.php index df85c855..0b6356a0 100644 --- a/admin/layouts/causerisk/details_right.php +++ b/admin/layouts/causerisk/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/admin/layouts/causerisk/publishing.php b/admin/layouts/causerisk/publishing.php index 052e3894..1c812463 100644 --- a/admin/layouts/causerisk/publishing.php +++ b/admin/layouts/causerisk/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/causerisk/publlshing.php b/admin/layouts/causerisk/publlshing.php index 459bc81d..f9fb69fd 100644 --- a/admin/layouts/causerisk/publlshing.php +++ b/admin/layouts/causerisk/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/admin/layouts/company/age_groups_percentages_fullwidth.php b/admin/layouts/company/age_groups_percentages_fullwidth.php index 90b12b0e..d84c13b3 100644 --- a/admin/layouts/company/age_groups_percentages_fullwidth.php +++ b/admin/layouts/company/age_groups_percentages_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_fullwidth.php diff --git a/admin/layouts/company/age_groups_percentages_left.php b/admin/layouts/company/age_groups_percentages_left.php index 2228abf9..c4055545 100644 --- a/admin/layouts/company/age_groups_percentages_left.php +++ b/admin/layouts/company/age_groups_percentages_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_left.php diff --git a/admin/layouts/company/age_groups_percentages_right.php b/admin/layouts/company/age_groups_percentages_right.php index 0fff564c..ae238030 100644 --- a/admin/layouts/company/age_groups_percentages_right.php +++ b/admin/layouts/company/age_groups_percentages_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_right.php diff --git a/admin/layouts/company/causerisk_selection_fullwidth.php b/admin/layouts/company/causerisk_selection_fullwidth.php index 1342061c..9e65dd44 100644 --- a/admin/layouts/company/causerisk_selection_fullwidth.php +++ b/admin/layouts/company/causerisk_selection_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk_selection_fullwidth.php diff --git a/admin/layouts/company/details_above.php b/admin/layouts/company/details_above.php index f662a99a..942cbccc 100644 --- a/admin/layouts/company/details_above.php +++ b/admin/layouts/company/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/admin/layouts/company/details_left.php b/admin/layouts/company/details_left.php index 57938987..6ed8e7d8 100644 --- a/admin/layouts/company/details_left.php +++ b/admin/layouts/company/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/admin/layouts/company/details_right.php b/admin/layouts/company/details_right.php index 6c345485..22ccf773 100644 --- a/admin/layouts/company/details_right.php +++ b/admin/layouts/company/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/admin/layouts/company/details_under.php b/admin/layouts/company/details_under.php index 5a6e6ded..0b043c60 100644 --- a/admin/layouts/company/details_under.php +++ b/admin/layouts/company/details_under.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_under.php diff --git a/admin/layouts/company/interventions_fullwidth.php b/admin/layouts/company/interventions_fullwidth.php index 82f96889..7ceb502e 100644 --- a/admin/layouts/company/interventions_fullwidth.php +++ b/admin/layouts/company/interventions_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions_fullwidth.php @@ -117,25 +117,25 @@ $can = CostbenefitprojectionHelper::getActions('intervention'); escape($item->duration); ?> - published == 1):?> + published == 1): ?> - published == 0):?> + published == 0): ?> - published == 2):?> + published == 2): ?> - published == -2):?> + published == -2): ?> diff --git a/admin/layouts/company/publishing.php b/admin/layouts/company/publishing.php index 052e3894..1c812463 100644 --- a/admin/layouts/company/publishing.php +++ b/admin/layouts/company/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/company/publlshing.php b/admin/layouts/company/publlshing.php index 459bc81d..f9fb69fd 100644 --- a/admin/layouts/company/publlshing.php +++ b/admin/layouts/company/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/admin/layouts/company/scaling_factors_fullwidth.php b/admin/layouts/company/scaling_factors_fullwidth.php index bfa4b384..5ce9d3a6 100644 --- a/admin/layouts/company/scaling_factors_fullwidth.php +++ b/admin/layouts/company/scaling_factors_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factors_fullwidth.php @@ -122,25 +122,25 @@ else escape($item->presenteeism_scaling_factor_females); ?> - published == 1):?> + published == 1): ?> - published == 0):?> + published == 0): ?> - published == 2):?> + published == 2): ?> - published == -2):?> + published == -2): ?> diff --git a/admin/layouts/country/age_groups_percentages_left.php b/admin/layouts/country/age_groups_percentages_left.php index 2228abf9..c4055545 100644 --- a/admin/layouts/country/age_groups_percentages_left.php +++ b/admin/layouts/country/age_groups_percentages_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_left.php diff --git a/admin/layouts/country/age_groups_percentages_right.php b/admin/layouts/country/age_groups_percentages_right.php index 0fff564c..ae238030 100644 --- a/admin/layouts/country/age_groups_percentages_right.php +++ b/admin/layouts/country/age_groups_percentages_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_right.php diff --git a/admin/layouts/country/causerisk_selection_fullwidth.php b/admin/layouts/country/causerisk_selection_fullwidth.php index 66c0f4d4..f11d4f9a 100644 --- a/admin/layouts/country/causerisk_selection_fullwidth.php +++ b/admin/layouts/country/causerisk_selection_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk_selection_fullwidth.php diff --git a/admin/layouts/country/companies_fullwidth.php b/admin/layouts/country/companies_fullwidth.php index 944597dd..6f818976 100644 --- a/admin/layouts/country/companies_fullwidth.php +++ b/admin/layouts/country/companies_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies_fullwidth.php @@ -132,25 +132,25 @@ $can = CostbenefitprojectionHelper::getActions('company'); per); ?> - published == 1):?> + published == 1): ?> - published == 0):?> + published == 0): ?> - published == 2):?> + published == 2): ?> - published == -2):?> + published == -2): ?> diff --git a/admin/layouts/country/details_above.php b/admin/layouts/country/details_above.php index cf649ede..b3f83ce4 100644 --- a/admin/layouts/country/details_above.php +++ b/admin/layouts/country/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/admin/layouts/country/details_left.php b/admin/layouts/country/details_left.php index cdd5435a..f4b794dc 100644 --- a/admin/layouts/country/details_left.php +++ b/admin/layouts/country/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/admin/layouts/country/details_right.php b/admin/layouts/country/details_right.php index 7b14f76b..86976d15 100644 --- a/admin/layouts/country/details_right.php +++ b/admin/layouts/country/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/admin/layouts/country/health_data_totals_left.php b/admin/layouts/country/health_data_totals_left.php index 9b302cb8..56b89f74 100644 --- a/admin/layouts/country/health_data_totals_left.php +++ b/admin/layouts/country/health_data_totals_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data_totals_left.php diff --git a/admin/layouts/country/health_data_totals_right.php b/admin/layouts/country/health_data_totals_right.php index b97331a5..c7867ac0 100644 --- a/admin/layouts/country/health_data_totals_right.php +++ b/admin/layouts/country/health_data_totals_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data_totals_right.php diff --git a/admin/layouts/country/interventions_fullwidth.php b/admin/layouts/country/interventions_fullwidth.php index 43ab923f..de3f65fd 100644 --- a/admin/layouts/country/interventions_fullwidth.php +++ b/admin/layouts/country/interventions_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions_fullwidth.php @@ -121,25 +121,25 @@ $can = CostbenefitprojectionHelper::getActions('intervention'); escape($item->duration); ?> - published == 1):?> + published == 1): ?> - published == 0):?> + published == 0): ?> - published == 2):?> + published == 2): ?> - published == -2):?> + published == -2): ?> diff --git a/admin/layouts/country/public_details_fullwidth.php b/admin/layouts/country/public_details_fullwidth.php index e89b2343..9b583915 100644 --- a/admin/layouts/country/public_details_fullwidth.php +++ b/admin/layouts/country/public_details_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage public_details_fullwidth.php diff --git a/admin/layouts/country/publishing.php b/admin/layouts/country/publishing.php index 052e3894..1c812463 100644 --- a/admin/layouts/country/publishing.php +++ b/admin/layouts/country/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/country/publlshing.php b/admin/layouts/country/publlshing.php index 459bc81d..f9fb69fd 100644 --- a/admin/layouts/country/publlshing.php +++ b/admin/layouts/country/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/admin/layouts/country/service_providers_fullwidth.php b/admin/layouts/country/service_providers_fullwidth.php index 5dd90d74..987bcd6c 100644 --- a/admin/layouts/country/service_providers_fullwidth.php +++ b/admin/layouts/country/service_providers_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_providers_fullwidth.php @@ -117,25 +117,25 @@ $can = CostbenefitprojectionHelper::getActions('service_provider'); escape($item->publicaddress); ?> - published == 1):?> + published == 1): ?> - published == 0):?> + published == 0): ?> - published == 2):?> + published == 2): ?> - published == -2):?> + published == -2): ?> diff --git a/admin/layouts/currency/details_above.php b/admin/layouts/currency/details_above.php index d858d563..0d087a82 100644 --- a/admin/layouts/currency/details_above.php +++ b/admin/layouts/currency/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/admin/layouts/currency/details_left.php b/admin/layouts/currency/details_left.php index ebbf4330..ef750b8e 100644 --- a/admin/layouts/currency/details_left.php +++ b/admin/layouts/currency/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/admin/layouts/currency/details_right.php b/admin/layouts/currency/details_right.php index 527e97a1..909437cf 100644 --- a/admin/layouts/currency/details_right.php +++ b/admin/layouts/currency/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/admin/layouts/currency/publishing.php b/admin/layouts/currency/publishing.php index 052e3894..1c812463 100644 --- a/admin/layouts/currency/publishing.php +++ b/admin/layouts/currency/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/currency/publlshing.php b/admin/layouts/currency/publlshing.php index 459bc81d..f9fb69fd 100644 --- a/admin/layouts/currency/publlshing.php +++ b/admin/layouts/currency/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/admin/layouts/databreakdownmalefemale.php b/admin/layouts/databreakdownmalefemale.php index 7388bc43..ede62762 100644 --- a/admin/layouts/databreakdownmalefemale.php +++ b/admin/layouts/databreakdownmalefemale.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage databreakdownmalefemale.php diff --git a/admin/layouts/health_data/details_above.php b/admin/layouts/health_data/details_above.php index 1842b75e..9af8f01f 100644 --- a/admin/layouts/health_data/details_above.php +++ b/admin/layouts/health_data/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/admin/layouts/health_data/details_left.php b/admin/layouts/health_data/details_left.php index d6dbedf1..c85a175d 100644 --- a/admin/layouts/health_data/details_left.php +++ b/admin/layouts/health_data/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/admin/layouts/health_data/details_right.php b/admin/layouts/health_data/details_right.php index d9490014..7d5cfcf1 100644 --- a/admin/layouts/health_data/details_right.php +++ b/admin/layouts/health_data/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/admin/layouts/health_data/details_rightside.php b/admin/layouts/health_data/details_rightside.php index 4303eab3..5ab50b61 100644 --- a/admin/layouts/health_data/details_rightside.php +++ b/admin/layouts/health_data/details_rightside.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_rightside.php diff --git a/admin/layouts/health_data/publishing.php b/admin/layouts/health_data/publishing.php index 052e3894..1c812463 100644 --- a/admin/layouts/health_data/publishing.php +++ b/admin/layouts/health_data/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/health_data/publlshing.php b/admin/layouts/health_data/publlshing.php index 459bc81d..f9fb69fd 100644 --- a/admin/layouts/health_data/publlshing.php +++ b/admin/layouts/health_data/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/admin/layouts/help_document/details_above.php b/admin/layouts/help_document/details_above.php index e5ce9c67..94714eb8 100644 --- a/admin/layouts/help_document/details_above.php +++ b/admin/layouts/help_document/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/admin/layouts/help_document/details_fullwidth.php b/admin/layouts/help_document/details_fullwidth.php index bbeb210f..4e5fc57d 100644 --- a/admin/layouts/help_document/details_fullwidth.php +++ b/admin/layouts/help_document/details_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_fullwidth.php diff --git a/admin/layouts/help_document/details_left.php b/admin/layouts/help_document/details_left.php index 7272a518..c60e7041 100644 --- a/admin/layouts/help_document/details_left.php +++ b/admin/layouts/help_document/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/admin/layouts/help_document/details_right.php b/admin/layouts/help_document/details_right.php index 9ef249a7..c796089d 100644 --- a/admin/layouts/help_document/details_right.php +++ b/admin/layouts/help_document/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/admin/layouts/help_document/details_under.php b/admin/layouts/help_document/details_under.php index 5a6e6ded..0b043c60 100644 --- a/admin/layouts/help_document/details_under.php +++ b/admin/layouts/help_document/details_under.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_under.php diff --git a/admin/layouts/help_document/publishing.php b/admin/layouts/help_document/publishing.php index 052e3894..6af480c4 100644 --- a/admin/layouts/help_document/publishing.php +++ b/admin/layouts/help_document/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php diff --git a/admin/layouts/help_document/publlshing.php b/admin/layouts/help_document/publlshing.php index 9adbd116..7767bba7 100644 --- a/admin/layouts/help_document/publlshing.php +++ b/admin/layouts/help_document/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/admin/layouts/intervention/details_above.php b/admin/layouts/intervention/details_above.php index 6501caa4..824120c6 100644 --- a/admin/layouts/intervention/details_above.php +++ b/admin/layouts/intervention/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/admin/layouts/intervention/details_fullwidth.php b/admin/layouts/intervention/details_fullwidth.php index 1b971196..a684b291 100644 --- a/admin/layouts/intervention/details_fullwidth.php +++ b/admin/layouts/intervention/details_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_fullwidth.php diff --git a/admin/layouts/intervention/details_under.php b/admin/layouts/intervention/details_under.php index 5a6e6ded..0b043c60 100644 --- a/admin/layouts/intervention/details_under.php +++ b/admin/layouts/intervention/details_under.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_under.php diff --git a/admin/layouts/intervention/publishing.php b/admin/layouts/intervention/publishing.php index 052e3894..1c812463 100644 --- a/admin/layouts/intervention/publishing.php +++ b/admin/layouts/intervention/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/intervention/publlshing.php b/admin/layouts/intervention/publlshing.php index 9adbd116..7767bba7 100644 --- a/admin/layouts/intervention/publlshing.php +++ b/admin/layouts/intervention/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/admin/layouts/intervention/settings_fullwidth.php b/admin/layouts/intervention/settings_fullwidth.php index cce94596..ae887369 100644 --- a/admin/layouts/intervention/settings_fullwidth.php +++ b/admin/layouts/intervention/settings_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage settings_fullwidth.php diff --git a/admin/layouts/intervention/settings_left.php b/admin/layouts/intervention/settings_left.php index a234c014..f41c46a9 100644 --- a/admin/layouts/intervention/settings_left.php +++ b/admin/layouts/intervention/settings_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage settings_left.php diff --git a/admin/layouts/scaling_factor/details_above.php b/admin/layouts/scaling_factor/details_above.php index 3436e420..88d019c5 100644 --- a/admin/layouts/scaling_factor/details_above.php +++ b/admin/layouts/scaling_factor/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/admin/layouts/scaling_factor/details_left.php b/admin/layouts/scaling_factor/details_left.php index 73d5ca27..26c411f9 100644 --- a/admin/layouts/scaling_factor/details_left.php +++ b/admin/layouts/scaling_factor/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/admin/layouts/scaling_factor/details_right.php b/admin/layouts/scaling_factor/details_right.php index a5e0c076..6a1160e2 100644 --- a/admin/layouts/scaling_factor/details_right.php +++ b/admin/layouts/scaling_factor/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/admin/layouts/scaling_factor/publishing.php b/admin/layouts/scaling_factor/publishing.php index 052e3894..1c812463 100644 --- a/admin/layouts/scaling_factor/publishing.php +++ b/admin/layouts/scaling_factor/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/scaling_factor/publlshing.php b/admin/layouts/scaling_factor/publlshing.php index 9adbd116..7767bba7 100644 --- a/admin/layouts/scaling_factor/publlshing.php +++ b/admin/layouts/scaling_factor/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/admin/layouts/service_provider/companies_fullwidth.php b/admin/layouts/service_provider/companies_fullwidth.php index 5794f0d3..1a2ba105 100644 --- a/admin/layouts/service_provider/companies_fullwidth.php +++ b/admin/layouts/service_provider/companies_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies_fullwidth.php @@ -132,25 +132,25 @@ $can = CostbenefitprojectionHelper::getActions('company'); per); ?> - published == 1):?> + published == 1): ?> - published == 0):?> + published == 0): ?> - published == 2):?> + published == 2): ?> - published == -2):?> + published == -2): ?> diff --git a/admin/layouts/service_provider/details_above.php b/admin/layouts/service_provider/details_above.php index b26c8b22..6fef302d 100644 --- a/admin/layouts/service_provider/details_above.php +++ b/admin/layouts/service_provider/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/admin/layouts/service_provider/details_left.php b/admin/layouts/service_provider/details_left.php index 58cb5d00..5c40310a 100644 --- a/admin/layouts/service_provider/details_left.php +++ b/admin/layouts/service_provider/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/admin/layouts/service_provider/details_right.php b/admin/layouts/service_provider/details_right.php index 75a9eb0c..0554ad9f 100644 --- a/admin/layouts/service_provider/details_right.php +++ b/admin/layouts/service_provider/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/admin/layouts/service_provider/publishing.php b/admin/layouts/service_provider/publishing.php index 052e3894..1c812463 100644 --- a/admin/layouts/service_provider/publishing.php +++ b/admin/layouts/service_provider/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/admin/layouts/service_provider/publlshing.php b/admin/layouts/service_provider/publlshing.php index 9adbd116..7767bba7 100644 --- a/admin/layouts/service_provider/publlshing.php +++ b/admin/layouts/service_provider/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 3c3d46e6..6c7f95bc 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage ajax.php @@ -235,14 +235,14 @@ public function getInterventionBuildTable($idName,$oject,$cluster) } return $new; } - + /** * Check and if a vdm notice is new (per/user) **/ public function isNew($notice) { // first get the file path - $path_filename = CostbenefitprojectionHelper::getFilePath('user', 'notice', JFactory::getUser()->username, $fileType = '.md', JPATH_COMPONENT_ADMINISTRATOR); + $path_filename = CostbenefitprojectionHelper::getFilePath('path', 'usernotice', 'md', JFactory::getUser()->username, JPATH_COMPONENT_ADMINISTRATOR); // check if the file is set if (($content = @file_get_contents($path_filename)) !== FALSE) { @@ -260,7 +260,7 @@ public function getInterventionBuildTable($idName,$oject,$cluster) public function isRead($notice) { // first get the file path - $path_filename = CostbenefitprojectionHelper::getFilePath('user', 'notice', JFactory::getUser()->username, $fileType = '.md', JPATH_COMPONENT_ADMINISTRATOR); + $path_filename = CostbenefitprojectionHelper::getFilePath('path', 'usernotice', 'md', JFactory::getUser()->username, JPATH_COMPONENT_ADMINISTRATOR); // set as read if not already set if (($content = @file_get_contents($path_filename)) !== FALSE) { diff --git a/admin/models/causerisk.php b/admin/models/causerisk.php index d92e860a..99f20e5c 100644 --- a/admin/models/causerisk.php +++ b/admin/models/causerisk.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** diff --git a/admin/models/causesrisks.php b/admin/models/causesrisks.php index 6a97ed4a..f9feb839 100644 --- a/admin/models/causesrisks.php +++ b/admin/models/causesrisks.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesrisks.php @@ -34,6 +34,7 @@ class CostbenefitprojectionModelCausesrisks extends JModelList $config['filter_fields'] = array( 'a.id','id', 'a.published','published', + 'a.access','access', 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', @@ -44,11 +45,17 @@ class CostbenefitprojectionModelCausesrisks extends JModelList parent::__construct($config); } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -58,30 +65,31 @@ class CostbenefitprojectionModelCausesrisks extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } + } + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); $this->setState('filter.name', $name); $ref = $this->getUserStateFromRequest($this->context . '.filter.ref', 'filter_ref'); $this->setState('filter.ref', $ref); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); // List state information. parent::populateState($ordering, $direction); @@ -159,9 +167,17 @@ class CostbenefitprojectionModelCausesrisks extends JModelList $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. - if ($access = $this->getState('filter.access')) + $_access = $this->getState('filter.access'); + if ($_access && is_numeric($_access)) { - $query->where('a.access = ' . (int) $access); + $query->where('a.access = ' . (int) $_access); + } + elseif (CostbenefitprojectionHelper::checkArray($_access)) + { + // Secure the array for the query + $_access = ArrayHelper::toInteger($_access); + // Filter by the Access Array. + $query->where('a.access IN (' . implode(',', $_access) . ')'); } // Implement View Level Access if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -187,7 +203,7 @@ class CostbenefitprojectionModelCausesrisks extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -207,7 +223,7 @@ class CostbenefitprojectionModelCausesrisks extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (CostbenefitprojectionHelper::checkArray($pks)) + if (($pks_size = CostbenefitprojectionHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -225,7 +241,24 @@ class CostbenefitprojectionModelCausesrisks extends JModelList // From the costbenefitprojection_causerisk table $query->from($db->quoteName('#__costbenefitprojection_causerisk', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_costbenefitprojection')) { @@ -313,6 +346,7 @@ class CostbenefitprojectionModelCausesrisks extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.access'); $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); diff --git a/admin/models/combinedresults.php b/admin/models/combinedresults.php index 9de3ab11..2a40eba1 100644 --- a/admin/models/combinedresults.php +++ b/admin/models/combinedresults.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage combinedresults.php diff --git a/admin/models/companies.php b/admin/models/companies.php index 03b3cfb2..185193ed 100644 --- a/admin/models/companies.php +++ b/admin/models/companies.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companies.php @@ -34,25 +34,32 @@ class CostbenefitprojectionModelCompanies extends JModelList $config['filter_fields'] = array( 'a.id','id', 'a.published','published', + 'a.access','access', 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', - 'g.name', 'a.department','department', - 'h.name', - 'i.user', - 'a.per','per' + 'h.name','country', + 'i.user','service_provider', + 'a.per','per', + 'a.name','name', + 'g.name','user' ); } parent::__construct($config); } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -62,12 +69,25 @@ class CostbenefitprojectionModelCompanies extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } - $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); - $this->setState('filter.name', $name); + } - $user = $this->getUserStateFromRequest($this->context . '.filter.user', 'filter_user'); - $this->setState('filter.user', $user); + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); $department = $this->getUserStateFromRequest($this->context . '.filter.department', 'filter_department'); $this->setState('filter.department', $department); @@ -79,25 +99,13 @@ class CostbenefitprojectionModelCompanies extends JModelList $this->setState('filter.service_provider', $service_provider); $per = $this->getUserStateFromRequest($this->context . '.filter.per', 'filter_per'); - $this->setState('filter.per', $per); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); + $this->setState('filter.per', $per); + + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); + $this->setState('filter.name', $name); + + $user = $this->getUserStateFromRequest($this->context . '.filter.user', 'filter_user'); + $this->setState('filter.user', $user); // List state information. parent::populateState($ordering, $direction); @@ -253,9 +261,17 @@ class CostbenefitprojectionModelCompanies extends JModelList $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. - if ($access = $this->getState('filter.access')) + $_access = $this->getState('filter.access'); + if ($_access && is_numeric($_access)) { - $query->where('a.access = ' . (int) $access); + $query->where('a.access = ' . (int) $_access); + } + elseif (CostbenefitprojectionHelper::checkArray($_access)) + { + // Secure the array for the query + $_access = ArrayHelper::toInteger($_access); + // Filter by the Access Array. + $query->where('a.access IN (' . implode(',', $_access) . ')'); } // Implement View Level Access if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -279,29 +295,77 @@ class CostbenefitprojectionModelCompanies extends JModelList } // Filter by Department. - if ($department = $this->getState('filter.department')) + $_department = $this->getState('filter.department'); + if (is_numeric($_department)) { - $query->where('a.department = ' . $db->quote($db->escape($department))); + if (is_float($_department)) + { + $query->where('a.department = ' . (float) $_department); + } + else + { + $query->where('a.department = ' . (int) $_department); + } } - // Filter by country. - if ($country = $this->getState('filter.country')) + elseif (CostbenefitprojectionHelper::checkString($_department)) { - $query->where('a.country = ' . $db->quote($db->escape($country))); + $query->where('a.department = ' . $db->quote($db->escape($_department))); } - // Filter by service_provider. - if ($service_provider = $this->getState('filter.service_provider')) + // Filter by Country. + $_country = $this->getState('filter.country'); + if (is_numeric($_country)) { - $query->where('a.service_provider = ' . $db->quote($db->escape($service_provider))); + if (is_float($_country)) + { + $query->where('a.country = ' . (float) $_country); + } + else + { + $query->where('a.country = ' . (int) $_country); + } + } + elseif (CostbenefitprojectionHelper::checkString($_country)) + { + $query->where('a.country = ' . $db->quote($db->escape($_country))); + } + // Filter by Service_provider. + $_service_provider = $this->getState('filter.service_provider'); + if (is_numeric($_service_provider)) + { + if (is_float($_service_provider)) + { + $query->where('a.service_provider = ' . (float) $_service_provider); + } + else + { + $query->where('a.service_provider = ' . (int) $_service_provider); + } + } + elseif (CostbenefitprojectionHelper::checkString($_service_provider)) + { + $query->where('a.service_provider = ' . $db->quote($db->escape($_service_provider))); } // Filter by Per. - if ($per = $this->getState('filter.per')) + $_per = $this->getState('filter.per'); + if (is_numeric($_per)) { - $query->where('a.per = ' . $db->quote($db->escape($per))); + if (is_float($_per)) + { + $query->where('a.per = ' . (float) $_per); + } + else + { + $query->where('a.per = ' . (int) $_per); + } + } + elseif (CostbenefitprojectionHelper::checkString($_per)) + { + $query->where('a.per = ' . $db->quote($db->escape($_per))); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -321,7 +385,7 @@ class CostbenefitprojectionModelCompanies extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (CostbenefitprojectionHelper::checkArray($pks)) + if (($pks_size = CostbenefitprojectionHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -339,7 +403,24 @@ class CostbenefitprojectionModelCompanies extends JModelList // From the costbenefitprojection_company table $query->from($db->quoteName('#__costbenefitprojection_company', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Filter by companies (admin sees all) if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -489,15 +570,16 @@ class CostbenefitprojectionModelCompanies extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.access'); $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); - $id .= ':' . $this->getState('filter.user'); $id .= ':' . $this->getState('filter.department'); $id .= ':' . $this->getState('filter.country'); $id .= ':' . $this->getState('filter.service_provider'); - $id .= ':' . $this->getState('filter.per'); + $id .= ':' . $this->getState('filter.per'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.user'); return parent::getStoreId($id); } diff --git a/admin/models/company.php b/admin/models/company.php index a893f2fc..b7fd1932 100644 --- a/admin/models/company.php +++ b/admin/models/company.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -918,7 +918,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin public function validate($form, $data, $group = null) { // check if the not_required field is set - if (CostbenefitprojectionHelper::checkString($data['not_required'])) + if (isset($data['not_required']) && CostbenefitprojectionHelper::checkString($data['not_required'])) { $requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = array_unique($requiredFields); diff --git a/admin/models/companyresults.php b/admin/models/companyresults.php index 02e89438..e157a1bf 100644 --- a/admin/models/companyresults.php +++ b/admin/models/companyresults.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companyresults.php @@ -272,13 +272,13 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem // set data object to item. $this->_item[$pk] = $data; - } + } catch (Exception $e) { if ($e->getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseWaring(404, $e->getMessage()); + JError::raiseWarning(404, $e->getMessage()); } else { diff --git a/admin/models/costbenefitprojection.php b/admin/models/costbenefitprojection.php index 1bc2175a..7ac0b7cb 100644 --- a/admin/models/costbenefitprojection.php +++ b/admin/models/costbenefitprojection.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php @@ -109,8 +109,8 @@ class CostbenefitprojectionModelCostbenefitprojection extends JModelList $viewName = $name; $alt = $name; $url = $url; - $image = $name.'.'.$type; - $name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_'.CostbenefitprojectionHelper::safeString($name,'U'); + $image = $name . '.' . $type; + $name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_' . CostbenefitprojectionHelper::safeString($name,'U'); } } // internal views @@ -132,17 +132,27 @@ class CostbenefitprojectionModelCostbenefitprojection extends JModelList switch($action) { case 'add': - $url = 'index.php?option=com_costbenefitprojection&view='.$name.'&layout=edit'; - $image = $name.'_'.$action.'.'.$type; - $alt = $name.' '.$action; + $url = 'index.php?option=com_costbenefitprojection&view=' . $name . '&layout=edit'; + $image = $name . '_' . $action. '.' . $type; + $alt = $name . ' ' . $action; $name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_'.CostbenefitprojectionHelper::safeString($name,'U').'_ADD'; $add = true; break; default: - $url = 'index.php?option=com_categories&view=categories&extension=com_costbenefitprojection.'.$name; - $image = $name.'_'.$action.'.'.$type; - $alt = $name.' '.$action; - $name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_'.CostbenefitprojectionHelper::safeString($name,'U').'_'.CostbenefitprojectionHelper::safeString($action,'U'); + // check for new convention (more stable) + if (strpos($action, '_qpo0O0oqp_') !== false) + { + list($action, $extension) = (array) explode('_qpo0O0oqp_', $action); + $extension = str_replace('_po0O0oq_', '.', $extension); + } + else + { + $extension = 'com_costbenefitprojection.' . $name; + } + $url = 'index.php?option=com_categories&view=categories&extension=' . $extension; + $image = $name . '_' . $action . '.' . $type; + $alt = $viewName . ' ' . $action; + $name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_' . CostbenefitprojectionHelper::safeString($name,'U') . '_' . CostbenefitprojectionHelper::safeString($action,'U'); break; } } @@ -150,9 +160,9 @@ class CostbenefitprojectionModelCostbenefitprojection extends JModelList { $viewName = $name; $alt = $name; - $url = 'index.php?option=com_costbenefitprojection&view='.$name; - $image = $name.'.'.$type; - $name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_'.CostbenefitprojectionHelper::safeString($name,'U'); + $url = 'index.php?option=com_costbenefitprojection&view=' . $name; + $image = $name . '.' . $type; + $name = 'COM_COSTBENEFITPROJECTION_DASHBOARD_' . CostbenefitprojectionHelper::safeString($name,'U'); $hover = false; } } @@ -160,8 +170,8 @@ class CostbenefitprojectionModelCostbenefitprojection extends JModelList { $viewName = $view; $alt = $view; - $url = 'index.php?option=com_costbenefitprojection&view='.$view; - $image = $view.'.png'; + $url = 'index.php?option=com_costbenefitprojection&view=' . $view; + $image = $view . '.png'; $name = ucwords($view).'

'; $hover = false; } @@ -173,7 +183,7 @@ class CostbenefitprojectionModelCostbenefitprojection extends JModelList $dashboard_list = false; $accessTo = ''; $accessAdd = ''; - // acces checking start + // access checking start $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? CostbenefitprojectionHelper::checkString($viewAccess[$viewName.'.create']):false; $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? CostbenefitprojectionHelper::checkString($viewAccess[$viewName.'.access']):false; // set main controllers @@ -188,7 +198,7 @@ class CostbenefitprojectionModelCostbenefitprojection extends JModelList { $accessAdd = 'core.create'; } - // check if acces to view is set + // check if access to view is set if ($accessAccess) { $accessTo = $viewAccess[$viewName.'.access']; @@ -595,120 +605,108 @@ class CostbenefitprojectionModelCostbenefitprojection extends JModelList } return false; } - + public function getGithub() { + // load jquery (not sure why... but else the timeago breaks) + JHtml::_('jquery.framework'); + // get the document to load the scripts $document = JFactory::getDocument(); - $document->addScript(JURI::root() . "media/com_costbenefitprojection/js/marked.js"); + $document->addScript(JURI::root() . "media/com_costbenefitprojection/js/timeago.js"); $document->addScriptDeclaration(' - var token = "'.JSession::getFormToken().'"; - var urlToGetAllOpenIssues = "https://api.github.com/repos/namibia/CBP-Joomla-3-Component/issues?state=open&page=1&per_page=5"; - var urlToGetAllClosedIssues = "https://api.github.com/repos/namibia/CBP-Joomla-3-Component/issues?state=closed&page=1&per_page=5"; + var urlToGetAllOpenIssues = "https://api.github.com/repos/Llewellynvdm/Joomla-Cost-Benefit-Projection/issues?state=open&page=1&per_page=5"; + var urlToGetAllClosedIssues = "https://api.github.com/repos/Llewellynvdm/Joomla-Cost-Benefit-Projection/issues?state=closed&page=1&per_page=5"; + var urlToGetAllReleases = "https://api.github.com/repos/Llewellynvdm/Joomla-Cost-Benefit-Projection/releases?page=1&per_page=5"; jQuery(document).ready(function () { jQuery.getJSON(urlToGetAllOpenIssues, function (openissues) { jQuery("#openissues").html(""); jQuery.each(openissues, function (i, issue) { + // set time ago + var timeago = jQuery.timeago(new Date(issue.created_at)); jQuery("#openissues") .append("

" + issue.title + "

") - .append("#" + issue.number + " '.JText::_('COM_COSTBENEFITPROJECTION_OPENED_BY').' " + issue.user.login + "") + .append("\"@" ") + .append("" + issue.user.login + " '.JText::_('COM_COSTBENEFITPROJECTION_OPENED_THIS').' '.JText::_('COM_COSTBENEFITPROJECTION_ISSUE').'-" + issue.number + " (" + timeago + ") ") .append(marked(issue.body)) - .append("'.JText::_('COM_COSTBENEFITPROJECTION_RESPOND_TO_THIS_ISSUE_ON_GITHUB').'...
"); + .append("'.JText::_('COM_COSTBENEFITPROJECTION_RESPOND_TO_THIS_ISSUE_ON_GITHUB').'...
"); }); }); jQuery.getJSON(urlToGetAllClosedIssues, function (closedissues) { jQuery("#closedissues").html(""); jQuery.each(closedissues, function (i, issue) { + // set time ago + var timeago = jQuery.timeago(new Date(issue.created_at)); jQuery("#closedissues") .append("

" + issue.title + "

") - .append("#" + issue.number + " '.JText::_('COM_COSTBENEFITPROJECTION_OPENED_BY').' " + issue.user.login + "") + .append("\"@" ") + .append("" + issue.user.login + " '.JText::_('COM_COSTBENEFITPROJECTION_OPENED').' '.JText::_('COM_COSTBENEFITPROJECTION_ISSUE').'-" + issue.number + " (" + timeago + ")") .append(marked(issue.body)) - .append("'.JText::_('COM_COSTBENEFITPROJECTION_REVIEW_THIS_ISSUE_ON_GITHUB').'...
"); + .append("'.JText::_('COM_COSTBENEFITPROJECTION_REVIEW_THIS_ISSUE_ON_GITHUB').'...
"); }); }); - }); - // to check is READ/NEW - function getIS(type,notice){ - if(type == 1){ - var getUrl = "index.php?option=com_costbenefitprojection&task=ajax.isNew&format=json"; - } else if (type == 2) { - var getUrl = "index.php?option=com_costbenefitprojection&task=ajax.isRead&format=json"; - } - if(token.length > 0 && notice.length){ - var request = "token="+token+"¬ice="+notice; - } - return jQuery.ajax({ - type: "POST", - url: getUrl, - dataType: "jsonp", - data: request, - jsonp: "callback" - }); - } - // nice little dot trick :) - jQuery(document).ready( function($) { - var x=0; - setInterval(function() { - var dots = ""; - x++; - for (var y=0; y < x%8; y++) { - dots+="."; + jQuery.getJSON(urlToGetAllReleases, function (tagreleases) { + // set the update notice while we are at it + var activeVersion = tagreleases[0].tag_name.substring(1); + if (activeVersion === manifest.version) { + // local version is in sync with latest release + jQuery(".update-notice").html("'.JText::_('COM_COSTBENEFITPROJECTION_UP_TO_DATE').'"); + } else { + // split versions in to array + var activeVersionArray = activeVersion.split("."); + var localVersionArray = manifest.version.split("."); + if ((+localVersionArray[0] > +activeVersionArray[0]) || + (+localVersionArray[0] == +activeVersionArray[0] && +localVersionArray[1] > +activeVersionArray[1]) || + (+localVersionArray[0] == +activeVersionArray[0] && +localVersionArray[1] == +activeVersionArray[1] && +localVersionArray[2] > +activeVersionArray[2])) { + // local version head latest release + jQuery(".update-notice").html("'.JText::_('COM_COSTBENEFITPROJECTION_BETA_RELEASE').'"); + } else { + // local version behind latest release + jQuery(".update-notice").html("'.JText::_('COM_COSTBENEFITPROJECTION_OUT_OF_DATE').'"); + } } - $(".loading-dots").text(dots); - } , 500); + // set the taged releases + jQuery("#tagreleases").html(""); + jQuery.each(tagreleases, function (i, tagrelease) { + // set active release + var activeNotice = ""; + if (i === 0) { + var activeNotice = " '.JText::_('COM_COSTBENEFITPROJECTION_LATEST_RELEASE').'

"; + } + // set time ago + var timeago = jQuery.timeago(new Date(tagrelease.published_at)); + jQuery("#tagreleases") + .append("

" + tagrelease.name + "

") + .append(activeNotice) + .append("\"@" ") + .append("" + tagrelease.author.login + " '.JText::_('COM_COSTBENEFITPROJECTION_RELEASED_THIS').' " + tagrelease.tag_name+ " (" + timeago + ")") + .append(marked(tagrelease.body)) + .append(" " + tagrelease.assets[0].name + " (" + tagrelease.assets[0].download_count + ") ") + .append("| '.JText::_('COM_COSTBENEFITPROJECTION_OPEN_ON_GITHUB').'...
"); + }); + }); });'); $create = '
'; - $moreopen = ''.JText::_('COM_COSTBENEFITPROJECTION_VIEW_MORE_ISSUES_ON_GITHUB').'...'; - $moreclosed = ''.JText::_('COM_COSTBENEFITPROJECTION_VIEW_MORE_ISSUES_ON_GITHUB').'...'; + $moreopen = ''.JText::_('COM_COSTBENEFITPROJECTION_VIEW_MORE_ISSUES_ON_GITHUB').'... '; + $moreclosed = ''.JText::_('COM_COSTBENEFITPROJECTION_VIEW_MORE_ISSUES_ON_GITHUB').'... '; + $viewissues = ''.JText::_('COM_COSTBENEFITPROJECTION_VIEW_MORE_RELEASES_ON_GITHUB').'... '; return (object) array( 'openissues' => $create.'
'.JText::_('COM_COSTBENEFITPROJECTION_A_FEW_OPEN_ISSUES_FROM_GITHUB_IS_LOADING').'..
'.$moreopen, - 'closedissues' => $create.'
'.JText::_('COM_COSTBENEFITPROJECTION_A_FEW_CLOSED_ISSUES_FROM_GITHUB_IS_LOADING').'..
'.$moreclosed + 'closedissues' => $create.'
'.JText::_('COM_COSTBENEFITPROJECTION_A_FEW_CLOSED_ISSUES_FROM_GITHUB_IS_LOADING').'..
'.$moreclosed, + 'tagreleases' => '
'.JText::_('COM_COSTBENEFITPROJECTION_LAST_FEW_RELEASES_FROM_GITHUB_IS_LOADING').'..
'.$viewissues ); } - - public function getReadme() - { - $document = JFactory::getDocument(); - $document->addScriptDeclaration(' - var getreadme = "'. JURI::root() . 'administrator/components/com_costbenefitprojection/README.txt"; - jQuery(document).ready(function () { - jQuery.get(getreadme) - .success(function(readme) { - jQuery("#readme-md").html(marked(readme)); - }) - .error(function(jqXHR, textStatus, errorThrown) { - jQuery("#readme-md").html("'.JText::_('COM_COSTBENEFITPROJECTION_PLEASE_CHECK_AGAIN_LATTER').'"); - }); - });'); - - return '
'.JText::_('COM_COSTBENEFITPROJECTION_THE_README_IS_LOADING').'..
'; - } - - public function getWiki() - { - $document = JFactory::getDocument(); - $document->addScriptDeclaration(' - var gewiki = "https://raw.githubusercontent.com/wiki/namibia/CBP-Joomla-3-Component/Home.md"; - jQuery(document).ready(function () { - jQuery.get(gewiki) - .success(function(wiki) { - jQuery("#wiki-md").html(marked(wiki)); - }) - .error(function(jqXHR, textStatus, errorThrown) { - jQuery("#wiki-md").html("'.JText::_('COM_COSTBENEFITPROJECTION_PLEASE_CHECK_AGAIN_LATTER').'"); - }); - });'); - - return '
'.JText::_('COM_COSTBENEFITPROJECTION_THE_WIKI_IS_LOADING').'..
'; - } - + public function getNoticeboard() { + // get the document to load the scripts $document = JFactory::getDocument(); + $document->addScript(JURI::root() . "media/com_costbenefitprojection/js/marked.js"); $document->addScriptDeclaration(' - var noticeboard = "https://www.vdm.io/costbenefitprojection-noticeboard-md"; + var token = "'.JSession::getFormToken().'"; + var noticeboard = "https://vdm.bz/costbenefitprojection-noticeboard-md"; jQuery(document).ready(function () { jQuery.get(noticeboard) .success(function(board) { @@ -717,7 +715,7 @@ class CostbenefitprojectionModelCostbenefitprojection extends JModelList getIS(1,board).done(function(result) { if (result){ jQuery("#cpanel_tabTabs a").each(function() { - if (this.href.indexOf("#vast_development_method") >= 0) { + if (this.href.indexOf("#vast_development_method") >= 0 || this.href.indexOf("#notice_board") >= 0) { var textVDM = jQuery(this).text(); jQuery(this).html("1 "+textVDM); jQuery(this).attr("id","vdm-new-notice"); @@ -739,8 +737,57 @@ class CostbenefitprojectionModelCostbenefitprojection extends JModelList .error(function(jqXHR, textStatus, errorThrown) { jQuery("#noticeboard-md").html("'.JText::_('COM_COSTBENEFITPROJECTION_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER').'"); }); - });'); + }); + // to check is READ/NEW + function getIS(type,notice){ + if(type == 1){ + var getUrl = "index.php?option=com_costbenefitprojection&task=ajax.isNew&format=json&raw=true"; + } else if (type == 2) { + var getUrl = "index.php?option=com_costbenefitprojection&task=ajax.isRead&format=json&raw=true"; + } + if(token.length > 0 && notice.length){ + var request = "token="+token+"¬ice="+notice; + } + return jQuery.ajax({ + type: "POST", + url: getUrl, + dataType: "json", + data: request, + jsonp: false + }); + } + +// nice little dot trick :) +jQuery(document).ready( function($) { + var x=0; + setInterval(function() { + var dots = ""; + x++; + for (var y=0; y < x%8; y++) { + dots+="."; + } + $(".loading-dots").text(dots); + } , 500); +});'); return '
'.JText::_('COM_COSTBENEFITPROJECTION_THE_NOTICE_BOARD_IS_LOADING').'..
'; } + + public function getReadme() + { + $document = JFactory::getDocument(); + $document->addScriptDeclaration(' + var getreadme = "'. JURI::root() . 'administrator/components/com_costbenefitprojection/README.txt"; + jQuery(document).ready(function () { + jQuery.get(getreadme) + .success(function(readme) { + jQuery("#readme-md").html(marked(readme)); + }) + .error(function(jqXHR, textStatus, errorThrown) { + jQuery("#readme-md").html("'.JText::_('COM_COSTBENEFITPROJECTION_PLEASE_CHECK_AGAIN_LATTER').'"); + }); + });'); + + return '
'.JText::_('COM_COSTBENEFITPROJECTION_THE_README_IS_LOADING').'..
'; + } } diff --git a/admin/models/countries.php b/admin/models/countries.php index b7a6e7fa..278cc6dd 100644 --- a/admin/models/countries.php +++ b/admin/models/countries.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage countries.php @@ -34,12 +34,13 @@ class CostbenefitprojectionModelCountries extends JModelList $config['filter_fields'] = array( 'a.id','id', 'a.published','published', + 'a.access','access', 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', + 'h.name','currency', 'a.name','name', - 'g.name', - 'h.name', + 'g.name','user', 'a.codethree','codethree', 'a.codetwo','codetwo', 'a.working_days','working_days' @@ -48,11 +49,17 @@ class CostbenefitprojectionModelCountries extends JModelList parent::__construct($config); } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -62,16 +69,35 @@ class CostbenefitprojectionModelCountries extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } + } + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $currency = $this->getUserStateFromRequest($this->context . '.filter.currency', 'filter_currency'); + $this->setState('filter.currency', $currency); + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); $this->setState('filter.name', $name); $user = $this->getUserStateFromRequest($this->context . '.filter.user', 'filter_user'); $this->setState('filter.user', $user); - $currency = $this->getUserStateFromRequest($this->context . '.filter.currency', 'filter_currency'); - $this->setState('filter.currency', $currency); - $codethree = $this->getUserStateFromRequest($this->context . '.filter.codethree', 'filter_codethree'); $this->setState('filter.codethree', $codethree); @@ -80,24 +106,6 @@ class CostbenefitprojectionModelCountries extends JModelList $working_days = $this->getUserStateFromRequest($this->context . '.filter.working_days', 'filter_working_days'); $this->setState('filter.working_days', $working_days); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); // List state information. parent::populateState($ordering, $direction); @@ -199,9 +207,17 @@ class CostbenefitprojectionModelCountries extends JModelList $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. - if ($access = $this->getState('filter.access')) + $_access = $this->getState('filter.access'); + if ($_access && is_numeric($_access)) { - $query->where('a.access = ' . (int) $access); + $query->where('a.access = ' . (int) $_access); + } + elseif (CostbenefitprojectionHelper::checkArray($_access)) + { + // Secure the array for the query + $_access = ArrayHelper::toInteger($_access); + // Filter by the Access Array. + $query->where('a.access IN (' . implode(',', $_access) . ')'); } // Implement View Level Access if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -224,15 +240,27 @@ class CostbenefitprojectionModelCountries extends JModelList } } - // Filter by currency. - if ($currency = $this->getState('filter.currency')) + // Filter by Currency. + $_currency = $this->getState('filter.currency'); + if (is_numeric($_currency)) { - $query->where('a.currency = ' . $db->quote($db->escape($currency))); + if (is_float($_currency)) + { + $query->where('a.currency = ' . (float) $_currency); + } + else + { + $query->where('a.currency = ' . (int) $_currency); + } + } + elseif (CostbenefitprojectionHelper::checkString($_currency)) + { + $query->where('a.currency = ' . $db->quote($db->escape($_currency))); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -252,7 +280,7 @@ class CostbenefitprojectionModelCountries extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (CostbenefitprojectionHelper::checkArray($pks)) + if (($pks_size = CostbenefitprojectionHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -270,7 +298,24 @@ class CostbenefitprojectionModelCountries extends JModelList // From the costbenefitprojection_country table $query->from($db->quoteName('#__costbenefitprojection_country', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Filter the countries (admin sees all) if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -374,12 +419,13 @@ class CostbenefitprojectionModelCountries extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.access'); $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.currency'); $id .= ':' . $this->getState('filter.name'); $id .= ':' . $this->getState('filter.user'); - $id .= ':' . $this->getState('filter.currency'); $id .= ':' . $this->getState('filter.codethree'); $id .= ':' . $this->getState('filter.codetwo'); $id .= ':' . $this->getState('filter.working_days'); diff --git a/admin/models/country.php b/admin/models/country.php index c25a799f..f403f606 100644 --- a/admin/models/country.php +++ b/admin/models/country.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage country.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -471,9 +471,17 @@ class CostbenefitprojectionModelCountry extends JModelAdmin $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. - if ($access = $this->getState('filter.access')) + $_access = $this->getState('filter.access'); + if ($_access && is_numeric($_access)) { - $query->where('a.access = ' . (int) $access); + $query->where('a.access = ' . (int) $_access); + } + elseif (CostbenefitprojectionHelper::checkArray($_access)) + { + // Secure the array for the query + $_access = ArrayHelper::toInteger($_access); + // Filter by the Access Array. + $query->where('a.access IN (' . implode(',', $_access) . ')'); } // Implement View Level Access if (!$user->authorise('core.options', 'com_costbenefitprojection')) diff --git a/admin/models/currencies.php b/admin/models/currencies.php index ece3f73a..cccdf9aa 100644 --- a/admin/models/currencies.php +++ b/admin/models/currencies.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage currencies.php @@ -34,6 +34,7 @@ class CostbenefitprojectionModelCurrencies extends JModelList $config['filter_fields'] = array( 'a.id','id', 'a.published','published', + 'a.access','access', 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', @@ -46,11 +47,17 @@ class CostbenefitprojectionModelCurrencies extends JModelList parent::__construct($config); } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -60,7 +67,26 @@ class CostbenefitprojectionModelCurrencies extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } + } + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); $this->setState('filter.name', $name); @@ -72,24 +98,6 @@ class CostbenefitprojectionModelCurrencies extends JModelList $decimalplace = $this->getUserStateFromRequest($this->context . '.filter.decimalplace', 'filter_decimalplace'); $this->setState('filter.decimalplace', $decimalplace); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); // List state information. parent::populateState($ordering, $direction); @@ -167,9 +175,17 @@ class CostbenefitprojectionModelCurrencies extends JModelList $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. - if ($access = $this->getState('filter.access')) + $_access = $this->getState('filter.access'); + if ($_access && is_numeric($_access)) { - $query->where('a.access = ' . (int) $access); + $query->where('a.access = ' . (int) $_access); + } + elseif (CostbenefitprojectionHelper::checkArray($_access)) + { + // Secure the array for the query + $_access = ArrayHelper::toInteger($_access); + // Filter by the Access Array. + $query->where('a.access IN (' . implode(',', $_access) . ')'); } // Implement View Level Access if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -195,7 +211,7 @@ class CostbenefitprojectionModelCurrencies extends JModelList // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -215,7 +231,7 @@ class CostbenefitprojectionModelCurrencies extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (CostbenefitprojectionHelper::checkArray($pks)) + if (($pks_size = CostbenefitprojectionHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -233,7 +249,24 @@ class CostbenefitprojectionModelCurrencies extends JModelList // From the costbenefitprojection_currency table $query->from($db->quoteName('#__costbenefitprojection_currency', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Implement View Level Access if (!$user->authorise('core.options', 'com_costbenefitprojection')) { @@ -321,6 +354,7 @@ class CostbenefitprojectionModelCurrencies extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.access'); $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); diff --git a/admin/models/currency.php b/admin/models/currency.php index 11fa25c9..9ddf1792 100644 --- a/admin/models/currency.php +++ b/admin/models/currency.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** diff --git a/admin/models/fields/adminviewfolderlist.php b/admin/models/fields/adminviewfolderlist.php index 9af60566..a5b7ab3e 100644 --- a/admin/models/fields/adminviewfolderlist.php +++ b/admin/models/fields/adminviewfolderlist.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage adminviewfolderlist.php diff --git a/admin/models/fields/articles.php b/admin/models/fields/articles.php index 5976641c..51b1ace1 100644 --- a/admin/models/fields/articles.php +++ b/admin/models/fields/articles.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage articles.php diff --git a/admin/models/fields/causesrisks.php b/admin/models/fields/causesrisks.php index 811276f5..53907656 100644 --- a/admin/models/fields/causesrisks.php +++ b/admin/models/fields/causesrisks.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesrisks.php diff --git a/admin/models/fields/causesriskscheck.php b/admin/models/fields/causesriskscheck.php index 7e0efec0..d6dce164 100644 --- a/admin/models/fields/causesriskscheck.php +++ b/admin/models/fields/causesriskscheck.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causesriskscheck.php diff --git a/admin/models/fields/company.php b/admin/models/fields/company.php index 865e87af..00831d70 100644 --- a/admin/models/fields/company.php +++ b/admin/models/fields/company.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.php diff --git a/admin/models/fields/companycheck.php b/admin/models/fields/companycheck.php index bb7b5a26..1a30db50 100644 --- a/admin/models/fields/companycheck.php +++ b/admin/models/fields/companycheck.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companycheck.php diff --git a/admin/models/fields/countries.php b/admin/models/fields/countries.php index 867ddfc5..5a4df561 100644 --- a/admin/models/fields/countries.php +++ b/admin/models/fields/countries.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage countries.php diff --git a/admin/models/fields/countryuser.php b/admin/models/fields/countryuser.php index aa7eb304..050ea8b5 100644 --- a/admin/models/fields/countryuser.php +++ b/admin/models/fields/countryuser.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage countryuser.php diff --git a/admin/models/fields/currency.php b/admin/models/fields/currency.php index c3d2809b..8f7a0772 100644 --- a/admin/models/fields/currency.php +++ b/admin/models/fields/currency.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.php diff --git a/admin/models/fields/datayear.php b/admin/models/fields/datayear.php index 051da43b..d4c96fee 100644 --- a/admin/models/fields/datayear.php +++ b/admin/models/fields/datayear.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage datayear.php diff --git a/admin/models/fields/interventions.php b/admin/models/fields/interventions.php index e83e435c..f7ecf005 100644 --- a/admin/models/fields/interventions.php +++ b/admin/models/fields/interventions.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions.php diff --git a/admin/models/fields/memberuser.php b/admin/models/fields/memberuser.php index 12a3967d..06b6fbe5 100644 --- a/admin/models/fields/memberuser.php +++ b/admin/models/fields/memberuser.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage memberuser.php diff --git a/admin/models/fields/serviceprovider.php b/admin/models/fields/serviceprovider.php index c1c63713..4b46f1d5 100644 --- a/admin/models/fields/serviceprovider.php +++ b/admin/models/fields/serviceprovider.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage serviceprovider.php diff --git a/admin/models/fields/serviceprovideruser.php b/admin/models/fields/serviceprovideruser.php index bd67f993..3224650f 100644 --- a/admin/models/fields/serviceprovideruser.php +++ b/admin/models/fields/serviceprovideruser.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage serviceprovideruser.php diff --git a/admin/models/fields/siteviewfolderlist.php b/admin/models/fields/siteviewfolderlist.php index 82fe7356..14a0d2c3 100644 --- a/admin/models/fields/siteviewfolderlist.php +++ b/admin/models/fields/siteviewfolderlist.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage siteviewfolderlist.php diff --git a/admin/models/forms/causerisk.js b/admin/models/forms/causerisk.js index 61a1cbc9..157893e5 100644 --- a/admin/models/forms/causerisk.js +++ b/admin/models/forms/causerisk.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk.js diff --git a/admin/models/forms/causerisk.xml b/admin/models/forms/causerisk.xml index b700da96..2fecf165 100644 --- a/admin/models/forms/causerisk.xml +++ b/admin/models/forms/causerisk.xml @@ -84,6 +84,14 @@ readonly="true" filter="unset" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/admin/models/health_data.php b/admin/models/health_data.php index fa551bcc..7b6f824b 100644 --- a/admin/models/health_data.php +++ b/admin/models/health_data.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** diff --git a/admin/models/health_data_sets.php b/admin/models/health_data_sets.php index c3d83018..38e1cc7b 100644 --- a/admin/models/health_data_sets.php +++ b/admin/models/health_data_sets.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data_sets.php @@ -34,22 +34,49 @@ class CostbenefitprojectionModelHealth_data_sets extends JModelList $config['filter_fields'] = array( 'a.id','id', 'a.published','published', + 'a.access','access', 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'g.name', + 'g.name','causerisk', 'a.year','year', - 'h.name' + 'h.name','country' ); } parent::__construct($config); + } + + + /** + * Get all the data to do a bulk export + */ + public function getBulkExport() + { + try + { + return $this->getExportData('bulk'); + } + catch (\RuntimeException $e) + { + if (!headers_sent()) + { + header('HTTP/1.1 500 Internal Server Error'); + } + jexit('Database Error: ' . $e->getMessage()); + } } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -59,7 +86,26 @@ class CostbenefitprojectionModelHealth_data_sets extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } + } + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + $causerisk = $this->getUserStateFromRequest($this->context . '.filter.causerisk', 'filter_causerisk'); $this->setState('filter.causerisk', $causerisk); @@ -68,24 +114,6 @@ class CostbenefitprojectionModelHealth_data_sets extends JModelList $country = $this->getUserStateFromRequest($this->context . '.filter.country', 'filter_country'); $this->setState('filter.country', $country); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); // List state information. parent::populateState($ordering, $direction); @@ -237,9 +265,17 @@ class CostbenefitprojectionModelHealth_data_sets extends JModelList $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. - if ($access = $this->getState('filter.access')) + $_access = $this->getState('filter.access'); + if ($_access && is_numeric($_access)) { - $query->where('a.access = ' . (int) $access); + $query->where('a.access = ' . (int) $_access); + } + elseif (CostbenefitprojectionHelper::checkArray($_access)) + { + // Secure the array for the query + $_access = ArrayHelper::toInteger($_access); + // Filter by the Access Array. + $query->where('a.access IN (' . implode(',', $_access) . ')'); } // Implement View Level Access if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -262,25 +298,61 @@ class CostbenefitprojectionModelHealth_data_sets extends JModelList } } - // Filter by causerisk. - if ($causerisk = $this->getState('filter.causerisk')) + // Filter by Causerisk. + $_causerisk = $this->getState('filter.causerisk'); + if (is_numeric($_causerisk)) { - $query->where('a.causerisk = ' . $db->quote($db->escape($causerisk))); + if (is_float($_causerisk)) + { + $query->where('a.causerisk = ' . (float) $_causerisk); + } + else + { + $query->where('a.causerisk = ' . (int) $_causerisk); + } + } + elseif (CostbenefitprojectionHelper::checkString($_causerisk)) + { + $query->where('a.causerisk = ' . $db->quote($db->escape($_causerisk))); } // Filter by Year. - if ($year = $this->getState('filter.year')) + $_year = $this->getState('filter.year'); + if (is_numeric($_year)) { - $query->where('a.year = ' . $db->quote($db->escape($year))); + if (is_float($_year)) + { + $query->where('a.year = ' . (float) $_year); + } + else + { + $query->where('a.year = ' . (int) $_year); + } } - // Filter by country. - if ($country = $this->getState('filter.country')) + elseif (CostbenefitprojectionHelper::checkString($_year)) { - $query->where('a.country = ' . $db->quote($db->escape($country))); + $query->where('a.year = ' . $db->quote($db->escape($_year))); + } + // Filter by Country. + $_country = $this->getState('filter.country'); + if (is_numeric($_country)) + { + if (is_float($_country)) + { + $query->where('a.country = ' . (float) $_country); + } + else + { + $query->where('a.country = ' . (int) $_country); + } + } + elseif (CostbenefitprojectionHelper::checkString($_country)) + { + $query->where('a.country = ' . $db->quote($db->escape($_country))); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -300,7 +372,7 @@ class CostbenefitprojectionModelHealth_data_sets extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (CostbenefitprojectionHelper::checkArray($pks)) + if (($pks_size = CostbenefitprojectionHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -318,7 +390,24 @@ class CostbenefitprojectionModelHealth_data_sets extends JModelList // From the costbenefitprojection_health_data table $query->from($db->quoteName('#__costbenefitprojection_health_data', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Filter by countries (admin sees all) if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -424,6 +513,7 @@ class CostbenefitprojectionModelHealth_data_sets extends JModelList $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.access'); $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); diff --git a/admin/models/help_document.php b/admin/models/help_document.php index 67219a8e..488412f1 100644 --- a/admin/models/help_document.php +++ b/admin/models/help_document.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_document.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -423,7 +423,7 @@ class CostbenefitprojectionModelHelp_document extends JModelAdmin public function validate($form, $data, $group = null) { // check if the not_required field is set - if (CostbenefitprojectionHelper::checkString($data['not_required'])) + if (isset($data['not_required']) && CostbenefitprojectionHelper::checkString($data['not_required'])) { $requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = array_unique($requiredFields); diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index 1c601356..71a843f4 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_documents.php @@ -37,21 +37,27 @@ class CostbenefitprojectionModelHelp_documents extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.title','title', 'a.type','type', 'a.location','location', - 'g.', - 'h.' + 'a.admin_view','admin_view', + 'a.site_view','site_view', + 'a.title','title' ); } parent::__construct($config); } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -61,9 +67,25 @@ class CostbenefitprojectionModelHelp_documents extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } - $title = $this->getUserStateFromRequest($this->context . '.filter.title', 'filter_title'); - $this->setState('filter.title', $title); + } + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); $type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type'); $this->setState('filter.type', $type); @@ -75,25 +97,10 @@ class CostbenefitprojectionModelHelp_documents extends JModelList $this->setState('filter.admin_view', $admin_view); $site_view = $this->getUserStateFromRequest($this->context . '.filter.site_view', 'filter_site_view'); - $this->setState('filter.site_view', $site_view); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); + $this->setState('filter.site_view', $site_view); + + $title = $this->getUserStateFromRequest($this->context . '.filter.title', 'filter_title'); + $this->setState('filter.title', $title); // List state information. parent::populateState($ordering, $direction); @@ -244,29 +251,77 @@ class CostbenefitprojectionModelHelp_documents extends JModelList } // Filter by Type. - if ($type = $this->getState('filter.type')) + $_type = $this->getState('filter.type'); + if (is_numeric($_type)) { - $query->where('a.type = ' . $db->quote($db->escape($type))); + if (is_float($_type)) + { + $query->where('a.type = ' . (float) $_type); + } + else + { + $query->where('a.type = ' . (int) $_type); + } + } + elseif (CostbenefitprojectionHelper::checkString($_type)) + { + $query->where('a.type = ' . $db->quote($db->escape($_type))); } // Filter by Location. - if ($location = $this->getState('filter.location')) + $_location = $this->getState('filter.location'); + if (is_numeric($_location)) { - $query->where('a.location = ' . $db->quote($db->escape($location))); + if (is_float($_location)) + { + $query->where('a.location = ' . (float) $_location); + } + else + { + $query->where('a.location = ' . (int) $_location); + } } - // Filter by admin_view. - if ($admin_view = $this->getState('filter.admin_view')) + elseif (CostbenefitprojectionHelper::checkString($_location)) { - $query->where('a.admin_view = ' . $db->quote($db->escape($admin_view))); + $query->where('a.location = ' . $db->quote($db->escape($_location))); } - // Filter by site_view. - if ($site_view = $this->getState('filter.site_view')) + // Filter by Admin_view. + $_admin_view = $this->getState('filter.admin_view'); + if (is_numeric($_admin_view)) { - $query->where('a.site_view = ' . $db->quote($db->escape($site_view))); + if (is_float($_admin_view)) + { + $query->where('a.admin_view = ' . (float) $_admin_view); + } + else + { + $query->where('a.admin_view = ' . (int) $_admin_view); + } + } + elseif (CostbenefitprojectionHelper::checkString($_admin_view)) + { + $query->where('a.admin_view = ' . $db->quote($db->escape($_admin_view))); + } + // Filter by Site_view. + $_site_view = $this->getState('filter.site_view'); + if (is_numeric($_site_view)) + { + if (is_float($_site_view)) + { + $query->where('a.site_view = ' . (float) $_site_view); + } + else + { + $query->where('a.site_view = ' . (int) $_site_view); + } + } + elseif (CostbenefitprojectionHelper::checkString($_site_view)) + { + $query->where('a.site_view = ' . $db->quote($db->escape($_site_view))); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -286,7 +341,7 @@ class CostbenefitprojectionModelHelp_documents extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (CostbenefitprojectionHelper::checkArray($pks)) + if (($pks_size = CostbenefitprojectionHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -304,7 +359,24 @@ class CostbenefitprojectionModelHelp_documents extends JModelList // From the costbenefitprojection_help_document table $query->from($db->quoteName('#__costbenefitprojection_help_document', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Order the results by ordering $query->order('a.ordering ASC'); @@ -389,11 +461,11 @@ class CostbenefitprojectionModelHelp_documents extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.title'); $id .= ':' . $this->getState('filter.type'); $id .= ':' . $this->getState('filter.location'); $id .= ':' . $this->getState('filter.admin_view'); - $id .= ':' . $this->getState('filter.site_view'); + $id .= ':' . $this->getState('filter.site_view'); + $id .= ':' . $this->getState('filter.title'); return parent::getStoreId($id); } diff --git a/admin/models/import.php b/admin/models/import.php index 4e0dbb7a..8b3c56a6 100644 --- a/admin/models/import.php +++ b/admin/models/import.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage import.php @@ -434,7 +434,15 @@ class CostbenefitprojectionModelImport extends JModelLegacy $jinput = JFactory::getApplication()->input; foreach($target_headers as $header) { - $data['target_headers'][$header] = $jinput->getString($header, null); + if (($column = $jinput->getString($header, false)) !== false || + ($column = $jinput->getString(strtolower($header), false)) !== false) + { + $data['target_headers'][$header] = $column; + } + else + { + $data['target_headers'][$header] = null; + } } // set the data if(isset($package['dir'])) diff --git a/admin/models/import_health_data_sets.php b/admin/models/import_health_data_sets.php index 798ef551..c65af1e2 100644 --- a/admin/models/import_health_data_sets.php +++ b/admin/models/import_health_data_sets.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage import_health_data_sets.php diff --git a/admin/models/intervention.php b/admin/models/intervention.php index 23d6dca0..9bd469d4 100644 --- a/admin/models/intervention.php +++ b/admin/models/intervention.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage intervention.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -425,7 +425,7 @@ class CostbenefitprojectionModelIntervention extends JModelAdmin public function validate($form, $data, $group = null) { // check if the not_required field is set - if (CostbenefitprojectionHelper::checkString($data['not_required'])) + if (isset($data['not_required']) && CostbenefitprojectionHelper::checkString($data['not_required'])) { $requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = array_unique($requiredFields); diff --git a/admin/models/interventions.php b/admin/models/interventions.php index 8f8639f9..91fdf5d9 100644 --- a/admin/models/interventions.php +++ b/admin/models/interventions.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions.php @@ -37,22 +37,28 @@ class CostbenefitprojectionModelInterventions extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'a.name','name', - 'g.name', + 'g.name','company', 'a.type','type', 'a.coverage','coverage', - 'a.description','description', - 'a.duration','duration' + 'a.duration','duration', + 'a.name','name', + 'a.description','description' ); } parent::__construct($config); } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -62,9 +68,25 @@ class CostbenefitprojectionModelInterventions extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } - $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); - $this->setState('filter.name', $name); + } + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); $company = $this->getUserStateFromRequest($this->context . '.filter.company', 'filter_company'); $this->setState('filter.company', $company); @@ -75,29 +97,14 @@ class CostbenefitprojectionModelInterventions extends JModelList $coverage = $this->getUserStateFromRequest($this->context . '.filter.coverage', 'filter_coverage'); $this->setState('filter.coverage', $coverage); - $description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description'); - $this->setState('filter.description', $description); - $duration = $this->getUserStateFromRequest($this->context . '.filter.duration', 'filter_duration'); - $this->setState('filter.duration', $duration); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); + $this->setState('filter.duration', $duration); + + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); + $this->setState('filter.name', $name); + + $description = $this->getUserStateFromRequest($this->context . '.filter.description', 'filter_description'); + $this->setState('filter.description', $description); // List state information. parent::populateState($ordering, $direction); @@ -253,30 +260,78 @@ class CostbenefitprojectionModelInterventions extends JModelList } } - // Filter by company. - if ($company = $this->getState('filter.company')) + // Filter by Company. + $_company = $this->getState('filter.company'); + if (is_numeric($_company)) { - $query->where('a.company = ' . $db->quote($db->escape($company))); + if (is_float($_company)) + { + $query->where('a.company = ' . (float) $_company); + } + else + { + $query->where('a.company = ' . (int) $_company); + } + } + elseif (CostbenefitprojectionHelper::checkString($_company)) + { + $query->where('a.company = ' . $db->quote($db->escape($_company))); } // Filter by Type. - if ($type = $this->getState('filter.type')) + $_type = $this->getState('filter.type'); + if (is_numeric($_type)) { - $query->where('a.type = ' . $db->quote($db->escape($type))); + if (is_float($_type)) + { + $query->where('a.type = ' . (float) $_type); + } + else + { + $query->where('a.type = ' . (int) $_type); + } + } + elseif (CostbenefitprojectionHelper::checkString($_type)) + { + $query->where('a.type = ' . $db->quote($db->escape($_type))); } // Filter by Coverage. - if ($coverage = $this->getState('filter.coverage')) + $_coverage = $this->getState('filter.coverage'); + if (is_numeric($_coverage)) { - $query->where('a.coverage = ' . $db->quote($db->escape($coverage))); + if (is_float($_coverage)) + { + $query->where('a.coverage = ' . (float) $_coverage); + } + else + { + $query->where('a.coverage = ' . (int) $_coverage); + } + } + elseif (CostbenefitprojectionHelper::checkString($_coverage)) + { + $query->where('a.coverage = ' . $db->quote($db->escape($_coverage))); } // Filter by Duration. - if ($duration = $this->getState('filter.duration')) + $_duration = $this->getState('filter.duration'); + if (is_numeric($_duration)) { - $query->where('a.duration = ' . $db->quote($db->escape($duration))); + if (is_float($_duration)) + { + $query->where('a.duration = ' . (float) $_duration); + } + else + { + $query->where('a.duration = ' . (int) $_duration); + } + } + elseif (CostbenefitprojectionHelper::checkString($_duration)) + { + $query->where('a.duration = ' . $db->quote($db->escape($_duration))); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -296,7 +351,7 @@ class CostbenefitprojectionModelInterventions extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (CostbenefitprojectionHelper::checkArray($pks)) + if (($pks_size = CostbenefitprojectionHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -314,7 +369,24 @@ class CostbenefitprojectionModelInterventions extends JModelList // From the costbenefitprojection_intervention table $query->from($db->quoteName('#__costbenefitprojection_intervention', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Filter the companies (admin sees all) if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -429,12 +501,12 @@ class CostbenefitprojectionModelInterventions extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.name'); $id .= ':' . $this->getState('filter.company'); $id .= ':' . $this->getState('filter.type'); $id .= ':' . $this->getState('filter.coverage'); - $id .= ':' . $this->getState('filter.description'); - $id .= ':' . $this->getState('filter.duration'); + $id .= ':' . $this->getState('filter.duration'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.description'); return parent::getStoreId($id); } diff --git a/admin/models/scaling_factor.php b/admin/models/scaling_factor.php index 77e000b0..65065dd2 100644 --- a/admin/models/scaling_factor.php +++ b/admin/models/scaling_factor.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factor.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -412,7 +412,7 @@ class CostbenefitprojectionModelScaling_factor extends JModelAdmin public function validate($form, $data, $group = null) { // check if the not_required field is set - if (CostbenefitprojectionHelper::checkString($data['not_required'])) + if (isset($data['not_required']) && CostbenefitprojectionHelper::checkString($data['not_required'])) { $requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = array_unique($requiredFields); diff --git a/admin/models/scaling_factors.php b/admin/models/scaling_factors.php index ad757223..7444b7b9 100644 --- a/admin/models/scaling_factors.php +++ b/admin/models/scaling_factors.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factors.php @@ -37,8 +37,8 @@ class CostbenefitprojectionModelScaling_factors extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'g.name', - 'h.name', + 'g.name','causerisk', + 'h.name','company', 'a.yld_scaling_factor_males','yld_scaling_factor_males', 'a.yld_scaling_factor_females','yld_scaling_factor_females', 'a.mortality_scaling_factor_males','mortality_scaling_factor_males', @@ -50,11 +50,17 @@ class CostbenefitprojectionModelScaling_factors extends JModelList parent::__construct($config); } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -64,7 +70,26 @@ class CostbenefitprojectionModelScaling_factors extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } + } + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + $causerisk = $this->getUserStateFromRequest($this->context . '.filter.causerisk', 'filter_causerisk'); $this->setState('filter.causerisk', $causerisk); @@ -88,24 +113,6 @@ class CostbenefitprojectionModelScaling_factors extends JModelList $presenteeism_scaling_factor_females = $this->getUserStateFromRequest($this->context . '.filter.presenteeism_scaling_factor_females', 'filter_presenteeism_scaling_factor_females'); $this->setState('filter.presenteeism_scaling_factor_females', $presenteeism_scaling_factor_females); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); // List state information. parent::populateState($ordering, $direction); @@ -218,20 +225,44 @@ class CostbenefitprojectionModelScaling_factors extends JModelList } } - // Filter by causerisk. - if ($causerisk = $this->getState('filter.causerisk')) + // Filter by Causerisk. + $_causerisk = $this->getState('filter.causerisk'); + if (is_numeric($_causerisk)) { - $query->where('a.causerisk = ' . $db->quote($db->escape($causerisk))); + if (is_float($_causerisk)) + { + $query->where('a.causerisk = ' . (float) $_causerisk); + } + else + { + $query->where('a.causerisk = ' . (int) $_causerisk); + } } - // Filter by company. - if ($company = $this->getState('filter.company')) + elseif (CostbenefitprojectionHelper::checkString($_causerisk)) { - $query->where('a.company = ' . $db->quote($db->escape($company))); + $query->where('a.causerisk = ' . $db->quote($db->escape($_causerisk))); + } + // Filter by Company. + $_company = $this->getState('filter.company'); + if (is_numeric($_company)) + { + if (is_float($_company)) + { + $query->where('a.company = ' . (float) $_company); + } + else + { + $query->where('a.company = ' . (int) $_company); + } + } + elseif (CostbenefitprojectionHelper::checkString($_company)) + { + $query->where('a.company = ' . $db->quote($db->escape($_company))); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -251,7 +282,7 @@ class CostbenefitprojectionModelScaling_factors extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (CostbenefitprojectionHelper::checkArray($pks)) + if (($pks_size = CostbenefitprojectionHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -269,7 +300,24 @@ class CostbenefitprojectionModelScaling_factors extends JModelList // From the costbenefitprojection_scaling_factor table $query->from($db->quoteName('#__costbenefitprojection_scaling_factor', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Filter by companies (admin sees all) if ( !$user->authorise('core.options', 'com_costbenefitprojection')) diff --git a/admin/models/service_provider.php b/admin/models/service_provider.php index e377f76e..86d3faa6 100644 --- a/admin/models/service_provider.php +++ b/admin/models/service_provider.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_provider.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -199,9 +199,17 @@ class CostbenefitprojectionModelService_provider extends JModelAdmin $query->select('ag.title AS access_level'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); // Filter by access level. - if ($access = $this->getState('filter.access')) + $_access = $this->getState('filter.access'); + if ($_access && is_numeric($_access)) { - $query->where('a.access = ' . (int) $access); + $query->where('a.access = ' . (int) $_access); + } + elseif (CostbenefitprojectionHelper::checkArray($_access)) + { + // Secure the array for the query + $_access = ArrayHelper::toInteger($_access); + // Filter by the Access Array. + $query->where('a.access IN (' . implode(',', $_access) . ')'); } // Implement View Level Access if (!$user->authorise('core.options', 'com_costbenefitprojection')) diff --git a/admin/models/service_providers.php b/admin/models/service_providers.php index 8bd64f52..58628114 100644 --- a/admin/models/service_providers.php +++ b/admin/models/service_providers.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_providers.php @@ -37,8 +37,8 @@ class CostbenefitprojectionModelService_providers extends JModelList 'a.ordering','ordering', 'a.created_by','created_by', 'a.modified_by','modified_by', - 'g.name', - 'h.name', + 'h.name','country', + 'g.name','user', 'a.publicname','publicname', 'a.publicemail','publicemail', 'a.publicnumber','publicnumber' @@ -47,11 +47,17 @@ class CostbenefitprojectionModelService_providers extends JModelList parent::__construct($config); } - + /** * Method to auto-populate the model state. * + * Note. Calling getState in this method will result in recursion. + * + * @param string $ordering An optional ordering field. + * @param string $direction An optional direction (asc|desc). + * * @return void + * */ protected function populateState($ordering = null, $direction = null) { @@ -61,13 +67,32 @@ class CostbenefitprojectionModelService_providers extends JModelList if ($layout = $app->input->get('layout')) { $this->context .= '.' . $layout; - } - $user = $this->getUserStateFromRequest($this->context . '.filter.user', 'filter_user'); - $this->setState('filter.user', $user); + } + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); $country = $this->getUserStateFromRequest($this->context . '.filter.country', 'filter_country'); $this->setState('filter.country', $country); + $user = $this->getUserStateFromRequest($this->context . '.filter.user', 'filter_user'); + $this->setState('filter.user', $user); + $publicname = $this->getUserStateFromRequest($this->context . '.filter.publicname', 'filter_publicname'); $this->setState('filter.publicname', $publicname); @@ -76,24 +101,6 @@ class CostbenefitprojectionModelService_providers extends JModelList $publicnumber = $this->getUserStateFromRequest($this->context . '.filter.publicnumber', 'filter_publicnumber'); $this->setState('filter.publicnumber', $publicnumber); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); // List state information. parent::populateState($ordering, $direction); @@ -206,15 +213,27 @@ class CostbenefitprojectionModelService_providers extends JModelList } } - // Filter by country. - if ($country = $this->getState('filter.country')) + // Filter by Country. + $_country = $this->getState('filter.country'); + if (is_numeric($_country)) { - $query->where('a.country = ' . $db->quote($db->escape($country))); + if (is_float($_country)) + { + $query->where('a.country = ' . (float) $_country); + } + else + { + $query->where('a.country = ' . (int) $_country); + } + } + elseif (CostbenefitprojectionHelper::checkString($_country)) + { + $query->where('a.country = ' . $db->quote($db->escape($_country))); } // Add the list ordering clause. $orderCol = $this->state->get('list.ordering', 'a.id'); - $orderDirn = $this->state->get('list.direction', 'asc'); + $orderDirn = $this->state->get('list.direction', 'desc'); if ($orderCol != '') { $query->order($db->escape($orderCol . ' ' . $orderDirn)); @@ -234,7 +253,7 @@ class CostbenefitprojectionModelService_providers extends JModelList public function getExportData($pks, $user = null) { // setup the query - if (CostbenefitprojectionHelper::checkArray($pks)) + if (($pks_size = CostbenefitprojectionHelper::checkArray($pks)) !== false || 'bulk' === $pks) { // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) $_export = true; @@ -252,7 +271,24 @@ class CostbenefitprojectionModelService_providers extends JModelList // From the costbenefitprojection_service_provider table $query->from($db->quoteName('#__costbenefitprojection_service_provider', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); + // The bulk export path + if ('bulk' === $pks) + { + $query->where('a.id > 0'); + } + // A large array of ID's will not work out well + elseif ($pks_size > 500) + { + // Use lowest ID + $query->where('a.id >= ' . (int) min($pks)); + // Use highest ID + $query->where('a.id <= ' . (int) max($pks)); + } + // The normal default path + else + { + $query->where('a.id IN (' . implode(',',$pks) . ')'); + } // Filter the providers (admin sees all) if (!$user->authorise('core.options', 'com_costbenefitprojection')) @@ -354,8 +390,8 @@ class CostbenefitprojectionModelService_providers extends JModelList $id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.modified_by'); - $id .= ':' . $this->getState('filter.user'); $id .= ':' . $this->getState('filter.country'); + $id .= ':' . $this->getState('filter.user'); $id .= ':' . $this->getState('filter.publicname'); $id .= ':' . $this->getState('filter.publicemail'); $id .= ':' . $this->getState('filter.publicnumber'); diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 5639c2d0..655637de 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -529,13 +529,3 @@ INSERT INTO `#__costbenefitprojection_currency` (`id`, `asset_id`, `alias`, `cod (164, 0, '', 'ZZZ', 2, ',', 'Reserved', '', 0, '', 'O', '', '', 1, 0, 0, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 1, 0, 0, 164); - --- --- Always insure this column rules is large enough for all the access control values. --- -ALTER TABLE `#__assets` CHANGE `rules` `rules` MEDIUMTEXT NOT NULL COMMENT 'JSON encoded access control.'; - --- --- Always insure this column name is large enough for long component and view names. --- -ALTER TABLE `#__assets` CHANGE `name` `name` VARCHAR(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The unique name for the asset.'; diff --git a/admin/sql/uninstall.mysql.utf8.sql b/admin/sql/uninstall.mysql.utf8.sql index 5d566a27..62fe149d 100644 --- a/admin/sql/uninstall.mysql.utf8.sql +++ b/admin/sql/uninstall.mysql.utf8.sql @@ -7,3 +7,4 @@ DROP TABLE IF EXISTS `#__costbenefitprojection_scaling_factor`; DROP TABLE IF EXISTS `#__costbenefitprojection_intervention`; DROP TABLE IF EXISTS `#__costbenefitprojection_currency`; DROP TABLE IF EXISTS `#__costbenefitprojection_help_document`; + diff --git a/admin/sql/updates/mysql/3.4.6.sql b/admin/sql/updates/mysql/3.4.6.sql new file mode 100644 index 00000000..4efc7b70 --- /dev/null +++ b/admin/sql/updates/mysql/3.4.6.sql @@ -0,0 +1,3 @@ +ALTER TABLE `#__costbenefitprojection_intervention` ENGINE = InnoDB; + +ALTER TABLE `#__costbenefitprojection_intervention` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; diff --git a/admin/tables/causerisk.php b/admin/tables/causerisk.php index 5fc5fa9a..da6f2585 100644 --- a/admin/tables/causerisk.php +++ b/admin/tables/causerisk.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk.php diff --git a/admin/tables/company.php b/admin/tables/company.php index 2d0aa52c..63162401 100644 --- a/admin/tables/company.php +++ b/admin/tables/company.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.php diff --git a/admin/tables/country.php b/admin/tables/country.php index 9730ecd0..a9874a9a 100644 --- a/admin/tables/country.php +++ b/admin/tables/country.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage country.php diff --git a/admin/tables/currency.php b/admin/tables/currency.php index 91b40fe0..035e905d 100644 --- a/admin/tables/currency.php +++ b/admin/tables/currency.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage currency.php diff --git a/admin/tables/health_data.php b/admin/tables/health_data.php index 98ea7ee8..267b947d 100644 --- a/admin/tables/health_data.php +++ b/admin/tables/health_data.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage health_data.php diff --git a/admin/tables/help_document.php b/admin/tables/help_document.php index a161f170..e7dde8d6 100644 --- a/admin/tables/help_document.php +++ b/admin/tables/help_document.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help_document.php diff --git a/admin/tables/intervention.php b/admin/tables/intervention.php index c26bad79..2a70db20 100644 --- a/admin/tables/intervention.php +++ b/admin/tables/intervention.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage intervention.php diff --git a/admin/tables/scaling_factor.php b/admin/tables/scaling_factor.php index 4f93f379..6926ab6d 100644 --- a/admin/tables/scaling_factor.php +++ b/admin/tables/scaling_factor.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factor.php diff --git a/admin/tables/service_provider.php b/admin/tables/service_provider.php index 064bac43..0bd8ab44 100644 --- a/admin/tables/service_provider.php +++ b/admin/tables/service_provider.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage service_provider.php diff --git a/admin/views/causerisk/submitbutton.js b/admin/views/causerisk/submitbutton.js index 50fd0585..a48d27cd 100644 --- a/admin/views/causerisk/submitbutton.js +++ b/admin/views/causerisk/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/admin/views/causerisk/tmpl/edit.php b/admin/views/causerisk/tmpl/edit.php index 52f938f5..badb4fcf 100644 --- a/admin/views/causerisk/tmpl/edit.php +++ b/admin/views/causerisk/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -55,7 +55,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'causeriskTab'; ?> - canDo->get('causerisk.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('causerisk.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('causerisk.edit.state') || ($this->canDo->get('causerisk.delete') && $this->canDo->get('causerisk.edit.state'))) : ?>
diff --git a/admin/views/causerisk/view.html.php b/admin/views/causerisk/view.html.php index 0ff3cf0e..2e5b3970 100644 --- a/admin/views/causerisk/view.html.php +++ b/admin/views/causerisk/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/causesrisks/tmpl/default.php b/admin/views/causesrisks/tmpl/default.php index d1da03f0..cdff8f82 100644 --- a/admin/views/causesrisks/tmpl/default.php +++ b/admin/views/causesrisks/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,76 +18,73 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_costbenefitprojection&task=causesrisks.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'causeriskList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_COSTBENEFITPROJECTION_CAUSESRISKS_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COSTBENEFITPROJECTION_CAUSESRISKS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/causesrisks/tmpl/default_batch_body.php b/admin/views/causesrisks/tmpl/default_batch_body.php index 312de332..58aaea33 100644 --- a/admin/views/causesrisks/tmpl/default_batch_body.php +++ b/admin/views/causesrisks/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/causesrisks/tmpl/default_batch_footer.php b/admin/views/causesrisks/tmpl/default_batch_footer.php index ccc6b89e..678e0319 100644 --- a/admin/views/causesrisks/tmpl/default_batch_footer.php +++ b/admin/views/causesrisks/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_footer.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/causesrisks/tmpl/default_body.php b/admin/views/causesrisks/tmpl/default_body.php index fe06c0d2..fb2e7ae4 100644 --- a/admin/views/causesrisks/tmpl/default_body.php +++ b/admin/views/causesrisks/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_costbenefitprojection&view=causesrisks&task=causerisk.edit"; @@ -33,11 +33,8 @@ $edit = "index.php?option=com_costbenefitprojection&view=causesrisks&task=causer get('causerisk.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/causesrisks/tmpl/default_foot.php b/admin/views/causesrisks/tmpl/default_foot.php index 72f773a2..2aabaaeb 100644 --- a/admin/views/causesrisks/tmpl/default_foot.php +++ b/admin/views/causesrisks/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_foot.php diff --git a/admin/views/causesrisks/tmpl/default_head.php b/admin/views/causesrisks/tmpl/default_head.php index b820afd5..b0f0e831 100644 --- a/admin/views/causesrisks/tmpl/default_head.php +++ b/admin/views/causesrisks/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_head.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/causesrisks/tmpl/default_toolbar.php b/admin/views/causesrisks/tmpl/default_toolbar.php index 2e5992b3..5640dc83 100644 --- a/admin/views/causesrisks/tmpl/default_toolbar.php +++ b/admin/views/causesrisks/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_toolbar.php diff --git a/admin/views/causesrisks/view.html.php b/admin/views/causesrisks/view.html.php index 70d44cf0..15534b52 100644 --- a/admin/views/causesrisks/view.html.php +++ b/admin/views/causesrisks/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -44,8 +44,8 @@ class CostbenefitprojectionViewCausesrisks extends JViewLegacy $this->user = JFactory::getUser(); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); - $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -160,39 +160,42 @@ class CostbenefitprojectionViewCausesrisks extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); - } - - if ($this->canState) - { - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_PUBLISHED'), - 'filter_published', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) - ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } - } - - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_ACCESS'), - 'filter_access', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) - ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } @@ -237,7 +240,7 @@ class CostbenefitprojectionViewCausesrisks extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'a.name' => JText::_('COM_COSTBENEFITPROJECTION_CAUSERISK_NAME_LABEL'), 'a.ref' => JText::_('COM_COSTBENEFITPROJECTION_CAUSERISK_REF_LABEL'), diff --git a/admin/views/combinedresults/tmpl/default.php b/admin/views/combinedresults/tmpl/default.php index e368ad60..cb98a39e 100644 --- a/admin/views/combinedresults/tmpl/default.php +++ b/admin/views/combinedresults/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); ?> canDo->get('combinedresults.access')): ?> diff --git a/admin/views/combinedresults/tmpl/default_chart_cost.php b/admin/views/combinedresults/tmpl/default_chart_cost.php index 664a1f7c..d6a946a5 100644 --- a/admin/views/combinedresults/tmpl/default_chart_cost.php +++ b/admin/views/combinedresults/tmpl/default_chart_cost.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_cost.php diff --git a/admin/views/combinedresults/tmpl/default_chart_cost_percent.php b/admin/views/combinedresults/tmpl/default_chart_cost_percent.php index 40d9d2b9..3b0ea359 100644 --- a/admin/views/combinedresults/tmpl/default_chart_cost_percent.php +++ b/admin/views/combinedresults/tmpl/default_chart_cost_percent.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_cost_percent.php diff --git a/admin/views/combinedresults/tmpl/default_chart_intervention_cost_benefit.php b/admin/views/combinedresults/tmpl/default_chart_intervention_cost_benefit.php index fd98f70f..e51bd3fc 100644 --- a/admin/views/combinedresults/tmpl/default_chart_intervention_cost_benefit.php +++ b/admin/views/combinedresults/tmpl/default_chart_intervention_cost_benefit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_intervention_cost_benefit.php diff --git a/admin/views/combinedresults/tmpl/default_chart_work_days_lost.php b/admin/views/combinedresults/tmpl/default_chart_work_days_lost.php index 121d3acf..05aa0db7 100644 --- a/admin/views/combinedresults/tmpl/default_chart_work_days_lost.php +++ b/admin/views/combinedresults/tmpl/default_chart_work_days_lost.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_work_days_lost.php diff --git a/admin/views/combinedresults/tmpl/default_chart_work_days_lost_percent.php b/admin/views/combinedresults/tmpl/default_chart_work_days_lost_percent.php index d704a8dc..b00deabe 100644 --- a/admin/views/combinedresults/tmpl/default_chart_work_days_lost_percent.php +++ b/admin/views/combinedresults/tmpl/default_chart_work_days_lost_percent.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_work_days_lost_percent.php diff --git a/admin/views/combinedresults/tmpl/default_main.php b/admin/views/combinedresults/tmpl/default_main.php index 28477c61..c519f933 100644 --- a/admin/views/combinedresults/tmpl/default_main.php +++ b/admin/views/combinedresults/tmpl/default_main.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_main.php diff --git a/admin/views/combinedresults/tmpl/default_table_calculated_cost_in_detail.php b/admin/views/combinedresults/tmpl/default_table_calculated_cost_in_detail.php index a7e8aef8..b7d536ef 100644 --- a/admin/views/combinedresults/tmpl/default_table_calculated_cost_in_detail.php +++ b/admin/views/combinedresults/tmpl/default_table_calculated_cost_in_detail.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_calculated_cost_in_detail.php diff --git a/admin/views/combinedresults/tmpl/default_table_cost_summary.php b/admin/views/combinedresults/tmpl/default_table_cost_summary.php index 5ab2f993..67f18adf 100644 --- a/admin/views/combinedresults/tmpl/default_table_cost_summary.php +++ b/admin/views/combinedresults/tmpl/default_table_cost_summary.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_cost_summary.php diff --git a/admin/views/combinedresults/tmpl/default_table_intervention_net_benefit.php b/admin/views/combinedresults/tmpl/default_table_intervention_net_benefit.php index 655ebcf4..50d0f0ce 100644 --- a/admin/views/combinedresults/tmpl/default_table_intervention_net_benefit.php +++ b/admin/views/combinedresults/tmpl/default_table_intervention_net_benefit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_intervention_net_benefit.php diff --git a/admin/views/combinedresults/tmpl/default_table_work_days_lost_summary.php b/admin/views/combinedresults/tmpl/default_table_work_days_lost_summary.php index a1fe2462..058ae0ae 100644 --- a/admin/views/combinedresults/tmpl/default_table_work_days_lost_summary.php +++ b/admin/views/combinedresults/tmpl/default_table_work_days_lost_summary.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_work_days_lost_summary.php diff --git a/admin/views/combinedresults/view.html.php b/admin/views/combinedresults/view.html.php index 43f79939..df4ac54c 100644 --- a/admin/views/combinedresults/view.html.php +++ b/admin/views/combinedresults/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -249,7 +249,7 @@ class CostbenefitprojectionViewCombinedresults extends JViewLegacy if ($this->canDo->get('combinedresults.companies')) { // add Companies button. - JToolBarHelper::custom('combinedresults.gotoCompanies', 'vcard', '', 'COM_COSTBENEFITPROJECTION_COMPANIES', false); + JToolBarHelper::custom('combinedresults.gotoCompanies', 'vcard custom-button-gotocompanies', '', 'COM_COSTBENEFITPROJECTION_COMPANIES', false); } // set help url for this view if found diff --git a/admin/views/companies/tmpl/default.php b/admin/views/companies/tmpl/default.php index 84d87a2a..472e5e82 100644 --- a/admin/views/companies/tmpl/default.php +++ b/admin/views/companies/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,76 +18,73 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_costbenefitprojection&task=companies.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'companyList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_COSTBENEFITPROJECTION_COMPANIES_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COSTBENEFITPROJECTION_COMPANIES_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/companies/tmpl/default_batch_body.php b/admin/views/companies/tmpl/default_batch_body.php index 63bf68a8..f97da4da 100644 --- a/admin/views/companies/tmpl/default_batch_body.php +++ b/admin/views/companies/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/companies/tmpl/default_batch_footer.php b/admin/views/companies/tmpl/default_batch_footer.php index a432d0dd..373d8b89 100644 --- a/admin/views/companies/tmpl/default_batch_footer.php +++ b/admin/views/companies/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_footer.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/companies/tmpl/default_body.php b/admin/views/companies/tmpl/default_body.php index e8ec6cb9..08eb5abf 100644 --- a/admin/views/companies/tmpl/default_body.php +++ b/admin/views/companies/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_costbenefitprojection&view=companies&task=company.edit"; @@ -33,11 +33,8 @@ $edit = "index.php?option=com_costbenefitprojection&view=companies&task=company. get('company.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/companies/tmpl/default_foot.php b/admin/views/companies/tmpl/default_foot.php index 7b69ee60..441c00e4 100644 --- a/admin/views/companies/tmpl/default_foot.php +++ b/admin/views/companies/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_foot.php diff --git a/admin/views/companies/tmpl/default_head.php b/admin/views/companies/tmpl/default_head.php index 98a21c59..e12ca04e 100644 --- a/admin/views/companies/tmpl/default_head.php +++ b/admin/views/companies/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_head.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/companies/tmpl/default_toolbar.php b/admin/views/companies/tmpl/default_toolbar.php index 5cff1244..d18e79d7 100644 --- a/admin/views/companies/tmpl/default_toolbar.php +++ b/admin/views/companies/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_toolbar.php diff --git a/admin/views/companies/view.html.php b/admin/views/companies/view.html.php index 744b811a..edda9c2e 100644 --- a/admin/views/companies/view.html.php +++ b/admin/views/companies/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -44,8 +44,8 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy $this->user = JFactory::getUser(); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); - $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -164,41 +164,24 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); - } - - if ($this->canState) - { - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_PUBLISHED'), - 'filter_published', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) - ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } - } - - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_ACCESS'), - 'filter_access', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) - ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Department Selection $this->departmentOptions = $this->getTheDepartmentSelections(); // We do some sanitation for Department filter @@ -217,16 +200,6 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy 'filter_department', JHtml::_('select.options', $this->departmentOptions, 'value', 'text', $this->state->get('filter.department')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Department Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_DEPARTMENT_LABEL').' -', - 'batch[department]', - JHtml::_('select.options', $this->departmentOptions, 'value', 'text') - ); - } } // Set Country Name Selection @@ -243,20 +216,10 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy { // Country Name Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_COUNTRY_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_COUNTRY_LABEL') . ' -', 'filter_country', JHtml::_('select.options', $this->countryNameOptions, 'value', 'text', $this->state->get('filter.country')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Country Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_COUNTRY_LABEL').' -', - 'batch[country]', - JHtml::_('select.options', $this->countryNameOptions, 'value', 'text') - ); - } } // Set Service Provider User Selection @@ -273,20 +236,10 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy { // Service Provider User Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_SERVICE_PROVIDER_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_COMPANY_SERVICE_PROVIDER_LABEL') . ' -', 'filter_service_provider', JHtml::_('select.options', $this->service_providerUserOptions, 'value', 'text', $this->state->get('filter.service_provider')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Service Provider User Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_SERVICE_PROVIDER_LABEL').' -', - 'batch[service_provider]', - JHtml::_('select.options', $this->service_providerUserOptions, 'value', 'text') - ); - } } // Set Per Selection @@ -307,16 +260,70 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy 'filter_per', JHtml::_('select.options', $this->perOptions, 'value', 'text', $this->state->get('filter.per')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Per Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_PER_LABEL').' -', - 'batch[per]', - JHtml::_('select.options', $this->perOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Department batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Department Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_DEPARTMENT_LABEL').' -', + 'batch[department]', + JHtml::_('select.options', $this->departmentOptions, 'value', 'text') + ); + } + + // Only load Country Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Country Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_COUNTRY_LABEL').' -', + 'batch[country]', + JHtml::_('select.options', $this->countryNameOptions, 'value', 'text') + ); + } + + // Only load Service Provider User batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Service Provider User Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_SERVICE_PROVIDER_LABEL').' -', + 'batch[service_provider]', + JHtml::_('select.options', $this->service_providerUserOptions, 'value', 'text') + ); + } + + // Only load Per batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Per Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COMPANY_PER_LABEL').' -', + 'batch[per]', + JHtml::_('select.options', $this->perOptions, 'value', 'text') + ); } } @@ -361,7 +368,7 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'a.name' => JText::_('COM_COSTBENEFITPROJECTION_COMPANY_NAME_LABEL'), 'g.name' => JText::_('COM_COSTBENEFITPROJECTION_COMPANY_USER_LABEL'), @@ -390,13 +397,13 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); if ($results) { // get model $model = $this->getModel(); $results = array_unique($results); - $_filter = array(); foreach ($results as $department) { // Translate the department selection @@ -404,9 +411,8 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy // Now add the department and its text to the options array $_filter[] = JHtml::_('select.option', $department, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } protected function getThePerSelections() @@ -426,13 +432,13 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); if ($results) { // get model $model = $this->getModel(); $results = array_unique($results); - $_filter = array(); foreach ($results as $per) { // Translate the per selection @@ -440,8 +446,7 @@ class CostbenefitprojectionViewCompanies extends JViewLegacy // Now add the per and its text to the options array $_filter[] = JHtml::_('select.option', $per, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/views/company/submitbutton.js b/admin/views/company/submitbutton.js index 8895e56b..53fafe2f 100644 --- a/admin/views/company/submitbutton.js +++ b/admin/views/company/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/admin/views/company/tmpl/edit.php b/admin/views/company/tmpl/edit.php index f64c85a2..12ebaae2 100644 --- a/admin/views/company/tmpl/edit.php +++ b/admin/views/company/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -122,7 +122,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'companyTab'; ?> - canDo->get('company.delete') || $this->canDo->get('company.edit.created_by') || $this->canDo->get('company.edit.state') || $this->canDo->get('company.edit.created')) : ?> + canDo->get('company.edit.created_by') || $this->canDo->get('company.edit.created') || $this->canDo->get('company.edit.state') || ($this->canDo->get('company.delete') && $this->canDo->get('company.edit.state'))) : ?>
diff --git a/admin/views/company/view.html.php b/admin/views/company/view.html.php index d1f4d253..6de57f03 100644 --- a/admin/views/company/view.html.php +++ b/admin/views/company/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/companyresults/tmpl/default.php b/admin/views/companyresults/tmpl/default.php index 81180b0c..83cdaddb 100644 --- a/admin/views/companyresults/tmpl/default.php +++ b/admin/views/companyresults/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); ?> canDo->get('companyresults.access')): ?> diff --git a/admin/views/companyresults/tmpl/default_chart_cost.php b/admin/views/companyresults/tmpl/default_chart_cost.php index 664a1f7c..d6a946a5 100644 --- a/admin/views/companyresults/tmpl/default_chart_cost.php +++ b/admin/views/companyresults/tmpl/default_chart_cost.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_cost.php diff --git a/admin/views/companyresults/tmpl/default_chart_cost_percent.php b/admin/views/companyresults/tmpl/default_chart_cost_percent.php index 40d9d2b9..3b0ea359 100644 --- a/admin/views/companyresults/tmpl/default_chart_cost_percent.php +++ b/admin/views/companyresults/tmpl/default_chart_cost_percent.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_cost_percent.php diff --git a/admin/views/companyresults/tmpl/default_chart_intervention_cost_benefit.php b/admin/views/companyresults/tmpl/default_chart_intervention_cost_benefit.php index fd98f70f..e51bd3fc 100644 --- a/admin/views/companyresults/tmpl/default_chart_intervention_cost_benefit.php +++ b/admin/views/companyresults/tmpl/default_chart_intervention_cost_benefit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_intervention_cost_benefit.php diff --git a/admin/views/companyresults/tmpl/default_chart_work_days_lost.php b/admin/views/companyresults/tmpl/default_chart_work_days_lost.php index 121d3acf..05aa0db7 100644 --- a/admin/views/companyresults/tmpl/default_chart_work_days_lost.php +++ b/admin/views/companyresults/tmpl/default_chart_work_days_lost.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_work_days_lost.php diff --git a/admin/views/companyresults/tmpl/default_chart_work_days_lost_percent.php b/admin/views/companyresults/tmpl/default_chart_work_days_lost_percent.php index d704a8dc..b00deabe 100644 --- a/admin/views/companyresults/tmpl/default_chart_work_days_lost_percent.php +++ b/admin/views/companyresults/tmpl/default_chart_work_days_lost_percent.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_work_days_lost_percent.php diff --git a/admin/views/companyresults/tmpl/default_main.php b/admin/views/companyresults/tmpl/default_main.php index 28477c61..c519f933 100644 --- a/admin/views/companyresults/tmpl/default_main.php +++ b/admin/views/companyresults/tmpl/default_main.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_main.php diff --git a/admin/views/companyresults/tmpl/default_table_calculated_cost_in_detail.php b/admin/views/companyresults/tmpl/default_table_calculated_cost_in_detail.php index a7e8aef8..b7d536ef 100644 --- a/admin/views/companyresults/tmpl/default_table_calculated_cost_in_detail.php +++ b/admin/views/companyresults/tmpl/default_table_calculated_cost_in_detail.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_calculated_cost_in_detail.php diff --git a/admin/views/companyresults/tmpl/default_table_cost_summary.php b/admin/views/companyresults/tmpl/default_table_cost_summary.php index 5ab2f993..67f18adf 100644 --- a/admin/views/companyresults/tmpl/default_table_cost_summary.php +++ b/admin/views/companyresults/tmpl/default_table_cost_summary.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_cost_summary.php diff --git a/admin/views/companyresults/tmpl/default_table_intervention_net_benefit.php b/admin/views/companyresults/tmpl/default_table_intervention_net_benefit.php index 655ebcf4..50d0f0ce 100644 --- a/admin/views/companyresults/tmpl/default_table_intervention_net_benefit.php +++ b/admin/views/companyresults/tmpl/default_table_intervention_net_benefit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_intervention_net_benefit.php diff --git a/admin/views/companyresults/tmpl/default_table_work_days_lost_summary.php b/admin/views/companyresults/tmpl/default_table_work_days_lost_summary.php index a1fe2462..058ae0ae 100644 --- a/admin/views/companyresults/tmpl/default_table_work_days_lost_summary.php +++ b/admin/views/companyresults/tmpl/default_table_work_days_lost_summary.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_work_days_lost_summary.php diff --git a/admin/views/companyresults/tmpl/default_variables.php b/admin/views/companyresults/tmpl/default_variables.php index 6f98c35f..d95c66b6 100644 --- a/admin/views/companyresults/tmpl/default_variables.php +++ b/admin/views/companyresults/tmpl/default_variables.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_variables.php diff --git a/admin/views/companyresults/view.html.php b/admin/views/companyresults/view.html.php index ec25d4b0..6a015b0c 100644 --- a/admin/views/companyresults/view.html.php +++ b/admin/views/companyresults/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -294,12 +294,12 @@ class CostbenefitprojectionViewCompanyresults extends JViewLegacy if ($this->canDo->get('companyresults.companies')) { // add Companies button. - JToolBarHelper::custom('companyresults.gotoCompanies', 'vcard', '', 'COM_COSTBENEFITPROJECTION_COMPANIES', false); + JToolBarHelper::custom('companyresults.gotoCompanies', 'vcard custom-button-gotocompanies', '', 'COM_COSTBENEFITPROJECTION_COMPANIES', false); } if ($this->canDo->get('companyresults.edit')) { // add Edit button. - JToolBarHelper::custom('companyresults.editCompany', 'pencil', '', 'COM_COSTBENEFITPROJECTION_EDIT', false); + JToolBarHelper::custom('companyresults.editCompany', 'pencil custom-button-editcompany', '', 'COM_COSTBENEFITPROJECTION_EDIT', false); } // set help url for this view if found diff --git a/admin/views/costbenefitprojection/tmpl/default.php b/admin/views/costbenefitprojection/tmpl/default.php index ecf4ff14..68f7a774 100644 --- a/admin/views/costbenefitprojection/tmpl/default.php +++ b/admin/views/costbenefitprojection/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -82,18 +82,6 @@ JHtml::_('behavior.tooltip');
- -
-
- 'readme_one')); ?> - - loadTemplate('readme_information');?> - - -
-
- -
@@ -106,6 +94,18 @@ JHtml::_('behavior.tooltip');
+ +
+
+ 'readme_one')); ?> + + loadTemplate('readme_information');?> + + +
+
+ +
\ No newline at end of file diff --git a/admin/views/costbenefitprojection/tmpl/default_closed_issues_the_closed_issues_on_github.php b/admin/views/costbenefitprojection/tmpl/default_closed_issues_the_closed_issues_on_github.php index 08a1c860..d1c9c416 100644 --- a/admin/views/costbenefitprojection/tmpl/default_closed_issues_the_closed_issues_on_github.php +++ b/admin/views/costbenefitprojection/tmpl/default_closed_issues_the_closed_issues_on_github.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_closed_issues_the_closed_issues_on_github.php diff --git a/admin/views/costbenefitprojection/tmpl/default_main.php b/admin/views/costbenefitprojection/tmpl/default_main.php index 59591416..43aedc94 100644 --- a/admin/views/costbenefitprojection/tmpl/default_main.php +++ b/admin/views/costbenefitprojection/tmpl/default_main.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_main.php diff --git a/admin/views/costbenefitprojection/tmpl/default_open_issues_the_open_issues_on_github.php b/admin/views/costbenefitprojection/tmpl/default_open_issues_the_open_issues_on_github.php index 9e8476b8..7461f07f 100644 --- a/admin/views/costbenefitprojection/tmpl/default_open_issues_the_open_issues_on_github.php +++ b/admin/views/costbenefitprojection/tmpl/default_open_issues_the_open_issues_on_github.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_open_issues_the_open_issues_on_github.php diff --git a/admin/views/costbenefitprojection/tmpl/default_readme_information.php b/admin/views/costbenefitprojection/tmpl/default_readme_information.php index 764d7b0e..551b5560 100644 --- a/admin/views/costbenefitprojection/tmpl/default_readme_information.php +++ b/admin/views/costbenefitprojection/tmpl/default_readme_information.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_readme_information.php diff --git a/admin/views/costbenefitprojection/tmpl/default_usage_statistics_table.php b/admin/views/costbenefitprojection/tmpl/default_usage_statistics_table.php index e2316b60..996d6b46 100644 --- a/admin/views/costbenefitprojection/tmpl/default_usage_statistics_table.php +++ b/admin/views/costbenefitprojection/tmpl/default_usage_statistics_table.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_usage_statistics_table.php diff --git a/admin/views/costbenefitprojection/tmpl/default_vast_development_method_notice_board.php b/admin/views/costbenefitprojection/tmpl/default_vast_development_method_notice_board.php index c65f8cdd..67873c45 100644 --- a/admin/views/costbenefitprojection/tmpl/default_vast_development_method_notice_board.php +++ b/admin/views/costbenefitprojection/tmpl/default_vast_development_method_notice_board.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_vast_development_method_notice_board.php diff --git a/admin/views/costbenefitprojection/tmpl/default_vdm.php b/admin/views/costbenefitprojection/tmpl/default_vdm.php index 7c3a81da..ed2adae6 100644 --- a/admin/views/costbenefitprojection/tmpl/default_vdm.php +++ b/admin/views/costbenefitprojection/tmpl/default_vdm.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_vdm.php diff --git a/admin/views/costbenefitprojection/view.html.php b/admin/views/costbenefitprojection/view.html.php index 03a11812..5a42008e 100644 --- a/admin/views/costbenefitprojection/view.html.php +++ b/admin/views/costbenefitprojection/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -36,9 +36,8 @@ class CostbenefitprojectionViewCostbenefitprojection extends JViewLegacy $this->contributors = CostbenefitprojectionHelper::getContributors(); $this->usagedata = $this->get('UsageData'); $this->github = $this->get('Github'); - $this->readme = $this->get('Readme'); - $this->wiki = $this->get('Wiki'); - $this->noticeboard = $this->get('Noticeboard'); + $this->noticeboard = $this->get('Noticeboard'); + $this->readme = $this->get('Readme'); // get the manifest details of the component $this->manifest = CostbenefitprojectionHelper::manifest(); diff --git a/admin/views/countries/tmpl/default.php b/admin/views/countries/tmpl/default.php index 8311a425..5133d4a4 100644 --- a/admin/views/countries/tmpl/default.php +++ b/admin/views/countries/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,76 +18,73 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_costbenefitprojection&task=countries.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'countryList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_COSTBENEFITPROJECTION_COUNTRIES_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COSTBENEFITPROJECTION_COUNTRIES_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/countries/tmpl/default_batch_body.php b/admin/views/countries/tmpl/default_batch_body.php index f8a1f016..60b8abac 100644 --- a/admin/views/countries/tmpl/default_batch_body.php +++ b/admin/views/countries/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/countries/tmpl/default_batch_footer.php b/admin/views/countries/tmpl/default_batch_footer.php index 08c05e40..37dd5727 100644 --- a/admin/views/countries/tmpl/default_batch_footer.php +++ b/admin/views/countries/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_footer.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/countries/tmpl/default_body.php b/admin/views/countries/tmpl/default_body.php index 4801ff8d..588bd4d0 100644 --- a/admin/views/countries/tmpl/default_body.php +++ b/admin/views/countries/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_costbenefitprojection&view=countries&task=country.edit"; @@ -33,11 +33,8 @@ $edit = "index.php?option=com_costbenefitprojection&view=countries&task=country. get('country.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/countries/tmpl/default_foot.php b/admin/views/countries/tmpl/default_foot.php index 7b69ee60..441c00e4 100644 --- a/admin/views/countries/tmpl/default_foot.php +++ b/admin/views/countries/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_foot.php diff --git a/admin/views/countries/tmpl/default_head.php b/admin/views/countries/tmpl/default_head.php index 8a14154e..abeebc96 100644 --- a/admin/views/countries/tmpl/default_head.php +++ b/admin/views/countries/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_head.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/countries/tmpl/default_toolbar.php b/admin/views/countries/tmpl/default_toolbar.php index 2c4f2bbf..f1bd59af 100644 --- a/admin/views/countries/tmpl/default_toolbar.php +++ b/admin/views/countries/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_toolbar.php diff --git a/admin/views/countries/view.html.php b/admin/views/countries/view.html.php index 8bffef8d..a84e9d60 100644 --- a/admin/views/countries/view.html.php +++ b/admin/views/countries/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -44,8 +44,8 @@ class CostbenefitprojectionViewCountries extends JViewLegacy $this->user = JFactory::getUser(); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); - $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -160,41 +160,24 @@ class CostbenefitprojectionViewCountries extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); - } - - if ($this->canState) - { - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_PUBLISHED'), - 'filter_published', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) - ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } - } - - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_ACCESS'), - 'filter_access', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) - ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Currency Name Selection $this->currencyNameOptions = JFormHelper::loadFieldType('Currency')->options; // We do some sanitation for Currency Name filter @@ -209,20 +192,41 @@ class CostbenefitprojectionViewCountries extends JViewLegacy { // Currency Name Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_COUNTRY_CURRENCY_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_COUNTRY_CURRENCY_LABEL') . ' -', 'filter_currency', JHtml::_('select.options', $this->currencyNameOptions, 'value', 'text', $this->state->get('filter.currency')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Currency Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COUNTRY_CURRENCY_LABEL').' -', - 'batch[currency]', - JHtml::_('select.options', $this->currencyNameOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Currency Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Currency Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_COUNTRY_CURRENCY_LABEL').' -', + 'batch[currency]', + JHtml::_('select.options', $this->currencyNameOptions, 'value', 'text') + ); } } @@ -267,7 +271,7 @@ class CostbenefitprojectionViewCountries extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'a.name' => JText::_('COM_COSTBENEFITPROJECTION_COUNTRY_NAME_LABEL'), 'g.name' => JText::_('COM_COSTBENEFITPROJECTION_COUNTRY_USER_LABEL'), diff --git a/admin/views/country/submitbutton.js b/admin/views/country/submitbutton.js index ae8d75ba..dcfabfa9 100644 --- a/admin/views/country/submitbutton.js +++ b/admin/views/country/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/admin/views/country/tmpl/edit.php b/admin/views/country/tmpl/edit.php index bd720061..9b7aca0d 100644 --- a/admin/views/country/tmpl/edit.php +++ b/admin/views/country/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -150,7 +150,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'countryTab'; ?> - canDo->get('country.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('country.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('country.edit.state') || ($this->canDo->get('country.delete') && $this->canDo->get('country.edit.state'))) : ?>
diff --git a/admin/views/country/view.html.php b/admin/views/country/view.html.php index 4ab043ec..2f9421b8 100644 --- a/admin/views/country/view.html.php +++ b/admin/views/country/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/currencies/tmpl/default.php b/admin/views/currencies/tmpl/default.php index 04bf29f5..e920cce4 100644 --- a/admin/views/currencies/tmpl/default.php +++ b/admin/views/currencies/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,76 +18,73 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_costbenefitprojection&task=currencies.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'currencyList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_COSTBENEFITPROJECTION_CURRENCIES_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COSTBENEFITPROJECTION_CURRENCIES_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/currencies/tmpl/default_batch_body.php b/admin/views/currencies/tmpl/default_batch_body.php index 93347c2e..8675b67e 100644 --- a/admin/views/currencies/tmpl/default_batch_body.php +++ b/admin/views/currencies/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/currencies/tmpl/default_batch_footer.php b/admin/views/currencies/tmpl/default_batch_footer.php index 1e39994d..bb1381cf 100644 --- a/admin/views/currencies/tmpl/default_batch_footer.php +++ b/admin/views/currencies/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_footer.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/currencies/tmpl/default_body.php b/admin/views/currencies/tmpl/default_body.php index a05a0b85..79c1626d 100644 --- a/admin/views/currencies/tmpl/default_body.php +++ b/admin/views/currencies/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_costbenefitprojection&view=currencies&task=currency.edit"; @@ -33,11 +33,8 @@ $edit = "index.php?option=com_costbenefitprojection&view=currencies&task=currenc get('currency.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/currencies/tmpl/default_foot.php b/admin/views/currencies/tmpl/default_foot.php index 72f773a2..2aabaaeb 100644 --- a/admin/views/currencies/tmpl/default_foot.php +++ b/admin/views/currencies/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_foot.php diff --git a/admin/views/currencies/tmpl/default_head.php b/admin/views/currencies/tmpl/default_head.php index cdf262bd..c03e13fd 100644 --- a/admin/views/currencies/tmpl/default_head.php +++ b/admin/views/currencies/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_head.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/currencies/tmpl/default_toolbar.php b/admin/views/currencies/tmpl/default_toolbar.php index 94588f37..9bcf2ebe 100644 --- a/admin/views/currencies/tmpl/default_toolbar.php +++ b/admin/views/currencies/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_toolbar.php diff --git a/admin/views/currencies/view.html.php b/admin/views/currencies/view.html.php index 6f45e292..46c85e55 100644 --- a/admin/views/currencies/view.html.php +++ b/admin/views/currencies/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -44,8 +44,8 @@ class CostbenefitprojectionViewCurrencies extends JViewLegacy $this->user = JFactory::getUser(); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); - $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -160,39 +160,42 @@ class CostbenefitprojectionViewCurrencies extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); - } - - if ($this->canState) - { - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_PUBLISHED'), - 'filter_published', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) - ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } - } - - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_ACCESS'), - 'filter_access', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) - ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); } } @@ -237,7 +240,7 @@ class CostbenefitprojectionViewCurrencies extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'a.name' => JText::_('COM_COSTBENEFITPROJECTION_CURRENCY_NAME_LABEL'), 'a.codethree' => JText::_('COM_COSTBENEFITPROJECTION_CURRENCY_CODETHREE_LABEL'), diff --git a/admin/views/currency/submitbutton.js b/admin/views/currency/submitbutton.js index 92f74764..125a45d7 100644 --- a/admin/views/currency/submitbutton.js +++ b/admin/views/currency/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/admin/views/currency/tmpl/edit.php b/admin/views/currency/tmpl/edit.php index 6f35ca37..4c332c64 100644 --- a/admin/views/currency/tmpl/edit.php +++ b/admin/views/currency/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -72,7 +72,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'currencyTab'; ?> - canDo->get('currency.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('currency.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('currency.edit.state') || ($this->canDo->get('currency.delete') && $this->canDo->get('currency.edit.state'))) : ?>
diff --git a/admin/views/currency/view.html.php b/admin/views/currency/view.html.php index 787673d4..5440010a 100644 --- a/admin/views/currency/view.html.php +++ b/admin/views/currency/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/health_data/submitbutton.js b/admin/views/health_data/submitbutton.js index 3b4a1ebd..9bc98e5d 100644 --- a/admin/views/health_data/submitbutton.js +++ b/admin/views/health_data/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/admin/views/health_data/tmpl/edit.php b/admin/views/health_data/tmpl/edit.php index a5c4b2a1..2f2d9133 100644 --- a/admin/views/health_data/tmpl/edit.php +++ b/admin/views/health_data/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -51,7 +51,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'health_dataTab'; ?> - canDo->get('health_data.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('health_data.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('health_data.edit.state') || ($this->canDo->get('health_data.delete') && $this->canDo->get('health_data.edit.state'))) : ?>
diff --git a/admin/views/health_data/view.html.php b/admin/views/health_data/view.html.php index 006b9a6b..0dfc50ca 100644 --- a/admin/views/health_data/view.html.php +++ b/admin/views/health_data/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/health_data_sets/tmpl/default.php b/admin/views/health_data_sets/tmpl/default.php index d48289a5..0b800cce 100644 --- a/admin/views/health_data_sets/tmpl/default.php +++ b/admin/views/health_data_sets/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,76 +18,73 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_costbenefitprojection&task=health_data_sets.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'health_dataList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_SETS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/health_data_sets/tmpl/default_batch_body.php b/admin/views/health_data_sets/tmpl/default_batch_body.php index f60d06cb..1506cb4a 100644 --- a/admin/views/health_data_sets/tmpl/default_batch_body.php +++ b/admin/views/health_data_sets/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/health_data_sets/tmpl/default_batch_footer.php b/admin/views/health_data_sets/tmpl/default_batch_footer.php index fb3c6b8b..829d53cf 100644 --- a/admin/views/health_data_sets/tmpl/default_batch_footer.php +++ b/admin/views/health_data_sets/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_footer.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/health_data_sets/tmpl/default_body.php b/admin/views/health_data_sets/tmpl/default_body.php index 6313c5a6..24df30e6 100644 --- a/admin/views/health_data_sets/tmpl/default_body.php +++ b/admin/views/health_data_sets/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_costbenefitprojection&view=health_data_sets&task=health_data.edit"; @@ -33,11 +33,8 @@ $edit = "index.php?option=com_costbenefitprojection&view=health_data_sets&task=h get('health_data.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/health_data_sets/tmpl/default_foot.php b/admin/views/health_data_sets/tmpl/default_foot.php index be491a1e..b1ad69e9 100644 --- a/admin/views/health_data_sets/tmpl/default_foot.php +++ b/admin/views/health_data_sets/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_foot.php diff --git a/admin/views/health_data_sets/tmpl/default_head.php b/admin/views/health_data_sets/tmpl/default_head.php index 44db5cac..e0534b6d 100644 --- a/admin/views/health_data_sets/tmpl/default_head.php +++ b/admin/views/health_data_sets/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_head.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/health_data_sets/tmpl/default_toolbar.php b/admin/views/health_data_sets/tmpl/default_toolbar.php index d015b9df..3fd9477e 100644 --- a/admin/views/health_data_sets/tmpl/default_toolbar.php +++ b/admin/views/health_data_sets/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_toolbar.php diff --git a/admin/views/health_data_sets/view.html.php b/admin/views/health_data_sets/view.html.php index efe75716..78741961 100644 --- a/admin/views/health_data_sets/view.html.php +++ b/admin/views/health_data_sets/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -44,8 +44,8 @@ class CostbenefitprojectionViewHealth_data_sets extends JViewLegacy $this->user = JFactory::getUser(); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); - $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -143,6 +143,11 @@ class CostbenefitprojectionViewHealth_data_sets extends JViewLegacy JToolBarHelper::custom('health_data_sets.exportData', 'download', '', 'COM_COSTBENEFITPROJECTION_EXPORT_DATA', true); } } + if ($this->user->authorise('health_data.bulk_export', 'com_costbenefitprojection')) + { + // add Bulk Export button. + JToolBarHelper::custom('health_data_sets.getBulkExport', 'download custom-button-getbulkexport', '', 'COM_COSTBENEFITPROJECTION_BULK_EXPORT', false); + } if ($this->canDo->get('core.import') && $this->canDo->get('health_data.import')) { @@ -160,41 +165,24 @@ class CostbenefitprojectionViewHealth_data_sets extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); - } - - if ($this->canState) - { - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_PUBLISHED'), - 'filter_published', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) - ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } - } - - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_ACCESS'), - 'filter_access', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) - ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); } + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + // Set Causerisk Name Selection $this->causeriskNameOptions = JFormHelper::loadFieldType('Causesrisks')->options; // We do some sanitation for Causerisk Name filter @@ -209,20 +197,10 @@ class CostbenefitprojectionViewHealth_data_sets extends JViewLegacy { // Causerisk Name Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_CAUSERISK_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_CAUSERISK_LABEL') . ' -', 'filter_causerisk', JHtml::_('select.options', $this->causeriskNameOptions, 'value', 'text', $this->state->get('filter.causerisk')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Causerisk Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_CAUSERISK_LABEL').' -', - 'batch[causerisk]', - JHtml::_('select.options', $this->causeriskNameOptions, 'value', 'text') - ); - } } // Set Year Selection @@ -243,16 +221,6 @@ class CostbenefitprojectionViewHealth_data_sets extends JViewLegacy 'filter_year', JHtml::_('select.options', $this->yearOptions, 'value', 'text', $this->state->get('filter.year')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Year Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_YEAR_LABEL').' -', - 'batch[year]', - JHtml::_('select.options', $this->yearOptions, 'value', 'text') - ); - } } // Set Country Name Selection @@ -269,20 +237,63 @@ class CostbenefitprojectionViewHealth_data_sets extends JViewLegacy { // Country Name Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_COUNTRY_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_COUNTRY_LABEL') . ' -', 'filter_country', JHtml::_('select.options', $this->countryNameOptions, 'value', 'text', $this->state->get('filter.country')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Country Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_COUNTRY_LABEL').' -', - 'batch[country]', - JHtml::_('select.options', $this->countryNameOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load access batch if create, edit and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + + // Only load Causerisk Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Causerisk Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_CAUSERISK_LABEL').' -', + 'batch[causerisk]', + JHtml::_('select.options', $this->causeriskNameOptions, 'value', 'text') + ); + } + + // Only load Year batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Year Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_YEAR_LABEL').' -', + 'batch[year]', + JHtml::_('select.options', $this->yearOptions, 'value', 'text') + ); + } + + // Only load Country Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Country Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_COUNTRY_LABEL').' -', + 'batch[country]', + JHtml::_('select.options', $this->countryNameOptions, 'value', 'text') + ); } } @@ -327,7 +338,7 @@ class CostbenefitprojectionViewHealth_data_sets extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'g.name' => JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_CAUSERISK_LABEL'), 'a.year' => JText::_('COM_COSTBENEFITPROJECTION_HEALTH_DATA_YEAR_LABEL'), @@ -353,13 +364,13 @@ class CostbenefitprojectionViewHealth_data_sets extends JViewLegacy $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); if ($results) { // get model $model = $this->getModel(); $results = array_unique($results); - $_filter = array(); foreach ($results as $year) { // Translate the year selection @@ -367,8 +378,7 @@ class CostbenefitprojectionViewHealth_data_sets extends JViewLegacy // Now add the year and its text to the options array $_filter[] = JHtml::_('select.option', $year, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/views/help_document/submitbutton.js b/admin/views/help_document/submitbutton.js index c1690187..d60da52a 100644 --- a/admin/views/help_document/submitbutton.js +++ b/admin/views/help_document/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/admin/views/help_document/tmpl/edit.php b/admin/views/help_document/tmpl/edit.php index a530d777..d8290aea 100644 --- a/admin/views/help_document/tmpl/edit.php +++ b/admin/views/help_document/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -77,7 +77,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'help_documentTab'; ?> - canDo->get('help_document.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('help_document.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('help_document.edit.state') || ($this->canDo->get('help_document.delete') && $this->canDo->get('help_document.edit.state'))) : ?>
@@ -90,25 +90,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst - canDo->get('core.admin')) : ?> - -
-
-
-
- form->getFieldset('accesscontrol') as $field): ?> -
- label; echo $field->input;?> -
-
- -
-
-
-
- - -
diff --git a/admin/views/help_document/view.html.php b/admin/views/help_document/view.html.php index c2cb131f..1ad5d98a 100644 --- a/admin/views/help_document/view.html.php +++ b/admin/views/help_document/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/help_documents/tmpl/default.php b/admin/views/help_documents/tmpl/default.php index 18035212..63d61a94 100644 --- a/admin/views/help_documents/tmpl/default.php +++ b/admin/views/help_documents/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,76 +18,73 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_costbenefitprojection&task=help_documents.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENTS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/help_documents/tmpl/default_batch_body.php b/admin/views/help_documents/tmpl/default_batch_body.php index 5413e466..e4cf205c 100644 --- a/admin/views/help_documents/tmpl/default_batch_body.php +++ b/admin/views/help_documents/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/help_documents/tmpl/default_batch_footer.php b/admin/views/help_documents/tmpl/default_batch_footer.php index 905707b8..f9a37a78 100644 --- a/admin/views/help_documents/tmpl/default_batch_footer.php +++ b/admin/views/help_documents/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_footer.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/help_documents/tmpl/default_body.php b/admin/views/help_documents/tmpl/default_body.php index 7c73b9c3..34252cec 100644 --- a/admin/views/help_documents/tmpl/default_body.php +++ b/admin/views/help_documents/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_costbenefitprojection&view=help_documents&task=help_document.edit"; @@ -33,11 +33,8 @@ $edit = "index.php?option=com_costbenefitprojection&view=help_documents&task=hel get('help_document.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/help_documents/tmpl/default_foot.php b/admin/views/help_documents/tmpl/default_foot.php index 7b69ee60..441c00e4 100644 --- a/admin/views/help_documents/tmpl/default_foot.php +++ b/admin/views/help_documents/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_foot.php diff --git a/admin/views/help_documents/tmpl/default_head.php b/admin/views/help_documents/tmpl/default_head.php index 305952fe..22ce389a 100644 --- a/admin/views/help_documents/tmpl/default_head.php +++ b/admin/views/help_documents/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_head.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/help_documents/tmpl/default_toolbar.php b/admin/views/help_documents/tmpl/default_toolbar.php index ec28ef6d..2c7f1f07 100644 --- a/admin/views/help_documents/tmpl/default_toolbar.php +++ b/admin/views/help_documents/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_toolbar.php diff --git a/admin/views/help_documents/view.html.php b/admin/views/help_documents/view.html.php index f50e8fd2..cdb93fa8 100644 --- a/admin/views/help_documents/view.html.php +++ b/admin/views/help_documents/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -44,8 +44,8 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy $this->user = JFactory::getUser(); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); - $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -160,39 +160,16 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); - } - - if ($this->canState) - { - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_PUBLISHED'), - 'filter_published', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) - ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } - } - - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_ACCESS'), - 'filter_access', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) - ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); } // Set Type Selection @@ -213,16 +190,6 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy 'filter_type', JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Type Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_TYPE_LABEL').' -', - 'batch[type]', - JHtml::_('select.options', $this->typeOptions, 'value', 'text') - ); - } } // Set Location Selection @@ -243,16 +210,6 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy 'filter_location', JHtml::_('select.options', $this->locationOptions, 'value', 'text', $this->state->get('filter.location')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Location Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_LOCATION_LABEL').' -', - 'batch[location]', - JHtml::_('select.options', $this->locationOptions, 'value', 'text') - ); - } } // Set Admin View Selection @@ -269,20 +226,10 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy { // Admin View Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_ADMIN_VIEW_LABEL') . ' -', 'filter_admin_view', JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text', $this->state->get('filter.admin_view')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Admin View Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', - 'batch[admin_view]', - JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text') - ); - } } // Set Site View Selection @@ -299,20 +246,64 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy { // Site View Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_SITE_VIEW_LABEL') . ' -', 'filter_site_view', JHtml::_('select.options', $this->site_viewOptions, 'value', 'text', $this->state->get('filter.site_view')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Site View Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', - 'batch[site_view]', - JHtml::_('select.options', $this->site_viewOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_TYPE_LABEL').' -', + 'batch[type]', + JHtml::_('select.options', $this->typeOptions, 'value', 'text') + ); + } + + // Only load Location batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Location Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_LOCATION_LABEL').' -', + 'batch[location]', + JHtml::_('select.options', $this->locationOptions, 'value', 'text') + ); + } + + // Only load Admin View batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Admin View Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -', + 'batch[admin_view]', + JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text') + ); + } + + // Only load Site View batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Site View Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_SITE_VIEW_LABEL').' -', + 'batch[site_view]', + JHtml::_('select.options', $this->site_viewOptions, 'value', 'text') + ); } } @@ -357,7 +348,7 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'a.title' => JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_TITLE_LABEL'), 'a.type' => JText::_('COM_COSTBENEFITPROJECTION_HELP_DOCUMENT_TYPE_LABEL'), @@ -385,13 +376,13 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); if ($results) { // get model $model = $this->getModel(); $results = array_unique($results); - $_filter = array(); foreach ($results as $type) { // Translate the type selection @@ -399,9 +390,8 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy // Now add the type and its text to the options array $_filter[] = JHtml::_('select.option', $type, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } protected function getTheLocationSelections() @@ -421,13 +411,13 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); if ($results) { // get model $model = $this->getModel(); $results = array_unique($results); - $_filter = array(); foreach ($results as $location) { // Translate the location selection @@ -435,8 +425,7 @@ class CostbenefitprojectionViewHelp_documents extends JViewLegacy // Now add the location and its text to the options array $_filter[] = JHtml::_('select.option', $location, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/views/import/tmpl/default.php b/admin/views/import/tmpl/default.php index 87f75e00..eece2b64 100644 --- a/admin/views/import/tmpl/default.php +++ b/admin/views/import/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index ced76dab..4619ca30 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/import_health_data_sets/tmpl/default.php b/admin/views/import_health_data_sets/tmpl/default.php index 1a4ad431..126066a0 100644 --- a/admin/views/import_health_data_sets/tmpl/default.php +++ b/admin/views/import_health_data_sets/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php diff --git a/admin/views/import_health_data_sets/view.html.php b/admin/views/import_health_data_sets/view.html.php index f4245003..e60fa9fa 100644 --- a/admin/views/import_health_data_sets/view.html.php +++ b/admin/views/import_health_data_sets/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/intervention/submitbutton.js b/admin/views/intervention/submitbutton.js index 03ad61fa..8b8efa10 100644 --- a/admin/views/intervention/submitbutton.js +++ b/admin/views/intervention/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/admin/views/intervention/tmpl/edit.php b/admin/views/intervention/tmpl/edit.php index 2db3b233..5443b2e7 100644 --- a/admin/views/intervention/tmpl/edit.php +++ b/admin/views/intervention/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -62,7 +62,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'interventionTab'; ?> - canDo->get('intervention.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('intervention.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('intervention.edit.state') || ($this->canDo->get('intervention.delete') && $this->canDo->get('intervention.edit.state'))) : ?>
diff --git a/admin/views/intervention/view.html.php b/admin/views/intervention/view.html.php index 631ab042..f68ebed1 100644 --- a/admin/views/intervention/view.html.php +++ b/admin/views/intervention/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/interventions/tmpl/default.php b/admin/views/interventions/tmpl/default.php index 73293248..2f1eab6b 100644 --- a/admin/views/interventions/tmpl/default.php +++ b/admin/views/interventions/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,76 +18,73 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_costbenefitprojection&task=interventions.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'interventionList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_COSTBENEFITPROJECTION_INTERVENTIONS_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COSTBENEFITPROJECTION_INTERVENTIONS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/interventions/tmpl/default_batch_body.php b/admin/views/interventions/tmpl/default_batch_body.php index 17707c22..ac41d499 100644 --- a/admin/views/interventions/tmpl/default_batch_body.php +++ b/admin/views/interventions/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/interventions/tmpl/default_batch_footer.php b/admin/views/interventions/tmpl/default_batch_footer.php index 7c95abf4..dbcd377b 100644 --- a/admin/views/interventions/tmpl/default_batch_footer.php +++ b/admin/views/interventions/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_footer.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/interventions/tmpl/default_body.php b/admin/views/interventions/tmpl/default_body.php index 4b621e9a..6ab0f7ff 100644 --- a/admin/views/interventions/tmpl/default_body.php +++ b/admin/views/interventions/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_costbenefitprojection&view=interventions&task=intervention.edit"; @@ -33,11 +33,8 @@ $edit = "index.php?option=com_costbenefitprojection&view=interventions&task=inte get('intervention.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/interventions/tmpl/default_foot.php b/admin/views/interventions/tmpl/default_foot.php index 7b69ee60..441c00e4 100644 --- a/admin/views/interventions/tmpl/default_foot.php +++ b/admin/views/interventions/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_foot.php diff --git a/admin/views/interventions/tmpl/default_head.php b/admin/views/interventions/tmpl/default_head.php index 8fe35d76..dc600c22 100644 --- a/admin/views/interventions/tmpl/default_head.php +++ b/admin/views/interventions/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_head.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/interventions/tmpl/default_toolbar.php b/admin/views/interventions/tmpl/default_toolbar.php index de55bca3..fa9cf272 100644 --- a/admin/views/interventions/tmpl/default_toolbar.php +++ b/admin/views/interventions/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_toolbar.php diff --git a/admin/views/interventions/view.html.php b/admin/views/interventions/view.html.php index 433f4d99..f28dacf6 100644 --- a/admin/views/interventions/view.html.php +++ b/admin/views/interventions/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -44,8 +44,8 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy $this->user = JFactory::getUser(); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); - $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -160,39 +160,16 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); - } - - if ($this->canState) - { - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_PUBLISHED'), - 'filter_published', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) - ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } - } - - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_ACCESS'), - 'filter_access', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) - ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); } // Set Company Name Selection @@ -209,20 +186,10 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy { // Company Name Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COMPANY_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COMPANY_LABEL') . ' -', 'filter_company', JHtml::_('select.options', $this->companyNameOptions, 'value', 'text', $this->state->get('filter.company')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Company Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COMPANY_LABEL').' -', - 'batch[company]', - JHtml::_('select.options', $this->companyNameOptions, 'value', 'text') - ); - } } // Set Type Selection @@ -243,16 +210,6 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy 'filter_type', JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('filter.type')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Type Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_TYPE_LABEL').' -', - 'batch[type]', - JHtml::_('select.options', $this->typeOptions, 'value', 'text') - ); - } } // Set Coverage Selection @@ -273,16 +230,6 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy 'filter_coverage', JHtml::_('select.options', $this->coverageOptions, 'value', 'text', $this->state->get('filter.coverage')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Coverage Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COVERAGE_LABEL').' -', - 'batch[coverage]', - JHtml::_('select.options', $this->coverageOptions, 'value', 'text') - ); - } } // Set Duration Selection @@ -303,16 +250,60 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy 'filter_duration', JHtml::_('select.options', $this->durationOptions, 'value', 'text', $this->state->get('filter.duration')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Duration Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_DURATION_LABEL').' -', - 'batch[duration]', - JHtml::_('select.options', $this->durationOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load Company Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Company Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COMPANY_LABEL').' -', + 'batch[company]', + JHtml::_('select.options', $this->companyNameOptions, 'value', 'text') + ); + } + + // Only load Type batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Type Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_TYPE_LABEL').' -', + 'batch[type]', + JHtml::_('select.options', $this->typeOptions, 'value', 'text') + ); + } + + // Only load Coverage batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Coverage Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COVERAGE_LABEL').' -', + 'batch[coverage]', + JHtml::_('select.options', $this->coverageOptions, 'value', 'text') + ); + } + + // Only load Duration batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Duration Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_DURATION_LABEL').' -', + 'batch[duration]', + JHtml::_('select.options', $this->durationOptions, 'value', 'text') + ); } } @@ -357,7 +348,7 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'a.name' => JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_NAME_LABEL'), 'g.name' => JText::_('COM_COSTBENEFITPROJECTION_INTERVENTION_COMPANY_LABEL'), @@ -386,13 +377,13 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); if ($results) { // get model $model = $this->getModel(); $results = array_unique($results); - $_filter = array(); foreach ($results as $type) { // Translate the type selection @@ -400,9 +391,8 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy // Now add the type and its text to the options array $_filter[] = JHtml::_('select.option', $type, JText::_($text)); } - return $_filter; } - return false; + return $_filter; } protected function getTheCoverageSelections() @@ -422,19 +412,18 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); if ($results) { $results = array_unique($results); - $_filter = array(); foreach ($results as $coverage) { // Now add the coverage and its text to the options array $_filter[] = JHtml::_('select.option', $coverage, $coverage); } - return $_filter; } - return false; + return $_filter; } protected function getTheDurationSelections() @@ -454,18 +443,17 @@ class CostbenefitprojectionViewInterventions extends JViewLegacy $db->setQuery($query); $results = $db->loadColumn(); + $_filter = array(); if ($results) { $results = array_unique($results); - $_filter = array(); foreach ($results as $duration) { // Now add the duration and its text to the options array $_filter[] = JHtml::_('select.option', $duration, $duration); } - return $_filter; } - return false; + return $_filter; } } diff --git a/admin/views/scaling_factor/submitbutton.js b/admin/views/scaling_factor/submitbutton.js index f83855c4..8315aefd 100644 --- a/admin/views/scaling_factor/submitbutton.js +++ b/admin/views/scaling_factor/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/admin/views/scaling_factor/tmpl/edit.php b/admin/views/scaling_factor/tmpl/edit.php index ee3f8973..0b90f19b 100644 --- a/admin/views/scaling_factor/tmpl/edit.php +++ b/admin/views/scaling_factor/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -50,7 +50,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'scaling_factorTab'; ?> - canDo->get('scaling_factor.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('scaling_factor.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('scaling_factor.edit.state') || ($this->canDo->get('scaling_factor.delete') && $this->canDo->get('scaling_factor.edit.state'))) : ?>
diff --git a/admin/views/scaling_factor/view.html.php b/admin/views/scaling_factor/view.html.php index e4e6ccc2..d2ee252e 100644 --- a/admin/views/scaling_factor/view.html.php +++ b/admin/views/scaling_factor/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/scaling_factors/tmpl/default.php b/admin/views/scaling_factors/tmpl/default.php index e8107a98..f333858f 100644 --- a/admin/views/scaling_factors/tmpl/default.php +++ b/admin/views/scaling_factors/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,76 +18,73 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_costbenefitprojection&task=scaling_factors.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'scaling_factorList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTORS_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTORS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/scaling_factors/tmpl/default_batch_body.php b/admin/views/scaling_factors/tmpl/default_batch_body.php index 334ed8aa..dad1d9b5 100644 --- a/admin/views/scaling_factors/tmpl/default_batch_body.php +++ b/admin/views/scaling_factors/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/scaling_factors/tmpl/default_batch_footer.php b/admin/views/scaling_factors/tmpl/default_batch_footer.php index 3c6f71f8..2be5ee22 100644 --- a/admin/views/scaling_factors/tmpl/default_batch_footer.php +++ b/admin/views/scaling_factors/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_footer.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/scaling_factors/tmpl/default_body.php b/admin/views/scaling_factors/tmpl/default_body.php index 4feb4619..c3bbd889 100644 --- a/admin/views/scaling_factors/tmpl/default_body.php +++ b/admin/views/scaling_factors/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_costbenefitprojection&view=scaling_factors&task=scaling_factor.edit"; @@ -33,11 +33,8 @@ $edit = "index.php?option=com_costbenefitprojection&view=scaling_factors&task=sc get('scaling_factor.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/scaling_factors/tmpl/default_foot.php b/admin/views/scaling_factors/tmpl/default_foot.php index eb41752f..f9748138 100644 --- a/admin/views/scaling_factors/tmpl/default_foot.php +++ b/admin/views/scaling_factors/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_foot.php diff --git a/admin/views/scaling_factors/tmpl/default_head.php b/admin/views/scaling_factors/tmpl/default_head.php index dcbc7de5..8d3dfda5 100644 --- a/admin/views/scaling_factors/tmpl/default_head.php +++ b/admin/views/scaling_factors/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_head.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/scaling_factors/tmpl/default_toolbar.php b/admin/views/scaling_factors/tmpl/default_toolbar.php index 5db22f45..3c4d6310 100644 --- a/admin/views/scaling_factors/tmpl/default_toolbar.php +++ b/admin/views/scaling_factors/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_toolbar.php diff --git a/admin/views/scaling_factors/view.html.php b/admin/views/scaling_factors/view.html.php index 3f1f056f..df141ff1 100644 --- a/admin/views/scaling_factors/view.html.php +++ b/admin/views/scaling_factors/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -44,8 +44,8 @@ class CostbenefitprojectionViewScaling_factors extends JViewLegacy $this->user = JFactory::getUser(); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); - $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -160,39 +160,16 @@ class CostbenefitprojectionViewScaling_factors extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); - } - - if ($this->canState) - { - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_PUBLISHED'), - 'filter_published', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) - ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } - } - - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_ACCESS'), - 'filter_access', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) - ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); } // Set Causerisk Name Selection @@ -209,20 +186,10 @@ class CostbenefitprojectionViewScaling_factors extends JViewLegacy { // Causerisk Name Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_CAUSERISK_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_CAUSERISK_LABEL') . ' -', 'filter_causerisk', JHtml::_('select.options', $this->causeriskNameOptions, 'value', 'text', $this->state->get('filter.causerisk')) ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Causerisk Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_CAUSERISK_LABEL').' -', - 'batch[causerisk]', - JHtml::_('select.options', $this->causeriskNameOptions, 'value', 'text') - ); - } } // Set Company Name Selection @@ -239,20 +206,42 @@ class CostbenefitprojectionViewScaling_factors extends JViewLegacy { // Company Name Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_COMPANY_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_COMPANY_LABEL') . ' -', 'filter_company', JHtml::_('select.options', $this->companyNameOptions, 'value', 'text', $this->state->get('filter.company')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Company Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_COMPANY_LABEL').' -', - 'batch[company]', - JHtml::_('select.options', $this->companyNameOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load Causerisk Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Causerisk Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_CAUSERISK_LABEL').' -', + 'batch[causerisk]', + JHtml::_('select.options', $this->causeriskNameOptions, 'value', 'text') + ); + } + + // Only load Company Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Company Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_COMPANY_LABEL').' -', + 'batch[company]', + JHtml::_('select.options', $this->companyNameOptions, 'value', 'text') + ); } } @@ -297,7 +286,7 @@ class CostbenefitprojectionViewScaling_factors extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'g.name' => JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_CAUSERISK_LABEL'), 'h.name' => JText::_('COM_COSTBENEFITPROJECTION_SCALING_FACTOR_COMPANY_LABEL'), diff --git a/admin/views/service_provider/submitbutton.js b/admin/views/service_provider/submitbutton.js index 9ccaf340..969eba15 100644 --- a/admin/views/service_provider/submitbutton.js +++ b/admin/views/service_provider/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/admin/views/service_provider/tmpl/edit.php b/admin/views/service_provider/tmpl/edit.php index 6c5c1a3a..9cc05e20 100644 --- a/admin/views/service_provider/tmpl/edit.php +++ b/admin/views/service_provider/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,10 +20,10 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); $componentParams = $this->params; // will be removed just use $this->params instead ?> @@ -62,7 +62,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'service_providerTab'; ?> - canDo->get('service_provider.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('service_provider.edit.state') || $this->canDo->get('core.edit.created')) : ?> + canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.created') || $this->canDo->get('service_provider.edit.state') || ($this->canDo->get('service_provider.delete') && $this->canDo->get('service_provider.edit.state'))) : ?>
diff --git a/admin/views/service_provider/view.html.php b/admin/views/service_provider/view.html.php index 21e101ea..b2e1a983 100644 --- a/admin/views/service_provider/view.html.php +++ b/admin/views/service_provider/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php diff --git a/admin/views/service_providers/tmpl/default.php b/admin/views/service_providers/tmpl/default.php index ef3148b5..62905af8 100644 --- a/admin/views/service_providers/tmpl/default.php +++ b/admin/views/service_providers/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,76 +18,73 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); -// load tooltip behavior -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.multiselect'); -JHtml::_('dropdown.init'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); JHtml::_('formbehavior.chosen', 'select'); - if ($this->saveOrder) { $saveOrderingUrl = 'index.php?option=com_costbenefitprojection&task=service_providers.saveOrderAjax&tmpl=component'; JHtml::_('sortablelist.sortable', 'service_providerList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); } - ?> - -
-sidebar)): ?> -
- sidebar; ?> -
-
- -
- -items)): ?> - loadTemplate('toolbar');?> -
- -
- - loadTemplate('toolbar');?> - - loadTemplate('head');?> - loadTemplate('foot');?> - loadTemplate('body');?> -
- - canCreate && $this->canEdit) : ?> - JText::_('COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_BATCH_OPTIONS'), - 'footer' => $this->loadTemplate('batch_footer') - ), - $this->loadTemplate('batch_body') - ); ?> - - - - -
- - - - \ No newline at end of file + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COSTBENEFITPROJECTION_SERVICE_PROVIDERS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + diff --git a/admin/views/service_providers/tmpl/default_batch_body.php b/admin/views/service_providers/tmpl/default_batch_body.php index ce45c5de..1d86146b 100644 --- a/admin/views/service_providers/tmpl/default_batch_body.php +++ b/admin/views/service_providers/tmpl/default_batch_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/service_providers/tmpl/default_batch_footer.php b/admin/views/service_providers/tmpl/default_batch_footer.php index e367b5f3..5b97c2de 100644 --- a/admin/views/service_providers/tmpl/default_batch_footer.php +++ b/admin/views/service_providers/tmpl/default_batch_footer.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_batch_footer.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); ?> diff --git a/admin/views/service_providers/tmpl/default_body.php b/admin/views/service_providers/tmpl/default_body.php index 934fea9b..35d877f8 100644 --- a/admin/views/service_providers/tmpl/default_body.php +++ b/admin/views/service_providers/tmpl/default_body.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_body.php @@ -18,7 +18,7 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); $edit = "index.php?option=com_costbenefitprojection&view=service_providers&task=service_provider.edit"; @@ -33,11 +33,8 @@ $edit = "index.php?option=com_costbenefitprojection&view=service_providers&task= get('service_provider.edit.state')): ?> saveOrder) - { - $iconClass = ' inactive'; - } - else + $iconClass = ''; + if (!$this->saveOrder) { $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); } diff --git a/admin/views/service_providers/tmpl/default_foot.php b/admin/views/service_providers/tmpl/default_foot.php index 7b69ee60..441c00e4 100644 --- a/admin/views/service_providers/tmpl/default_foot.php +++ b/admin/views/service_providers/tmpl/default_foot.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_foot.php diff --git a/admin/views/service_providers/tmpl/default_head.php b/admin/views/service_providers/tmpl/default_head.php index 64cdd8c9..a459c264 100644 --- a/admin/views/service_providers/tmpl/default_head.php +++ b/admin/views/service_providers/tmpl/default_head.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_head.php @@ -24,7 +24,7 @@ defined('_JEXEC') or die('Restricted access'); canEdit&& $this->canState): ?> - ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + ', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> diff --git a/admin/views/service_providers/tmpl/default_toolbar.php b/admin/views/service_providers/tmpl/default_toolbar.php index d446544a..e551c3da 100644 --- a/admin/views/service_providers/tmpl/default_toolbar.php +++ b/admin/views/service_providers/tmpl/default_toolbar.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_toolbar.php diff --git a/admin/views/service_providers/view.html.php b/admin/views/service_providers/view.html.php index 14cb7767..1ae327c0 100644 --- a/admin/views/service_providers/view.html.php +++ b/admin/views/service_providers/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -44,8 +44,8 @@ class CostbenefitprojectionViewService_providers extends JViewLegacy $this->user = JFactory::getUser(); // Add the list ordering clause. $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); - $this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); - $this->saveOrder = $this->listOrder == 'ordering'; + $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC')); + $this->saveOrder = $this->listOrder == 'a.ordering'; // set the return here value $this->return_here = urlencode(base64_encode((string) JUri::getInstance())); // get global action permissions @@ -160,39 +160,16 @@ class CostbenefitprojectionViewService_providers extends JViewLegacy if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) { JToolBarHelper::preferences('com_costbenefitprojection'); - } - - if ($this->canState) - { - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_PUBLISHED'), - 'filter_published', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) - ); - // only load if batch allowed - if ($this->canBatch) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), - 'batch[published]', - JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) - ); - } - } - - JHtmlSidebar::addFilter( - JText::_('JOPTION_SELECT_ACCESS'), - 'filter_access', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) - ); - - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - JHtmlBatch_::addListSelection( - JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_ACCESS'), - 'batch[access]', - JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') - ); + } + + // Only load publish filter if state change is allowed + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); } // Set Country Name Selection @@ -209,20 +186,31 @@ class CostbenefitprojectionViewService_providers extends JViewLegacy { // Country Name Filter JHtmlSidebar::addFilter( - '- Select '.JText::_('COM_COSTBENEFITPROJECTION_SERVICE_PROVIDER_COUNTRY_LABEL').' -', + '- Select ' . JText::_('COM_COSTBENEFITPROJECTION_SERVICE_PROVIDER_COUNTRY_LABEL') . ' -', 'filter_country', JHtml::_('select.options', $this->countryNameOptions, 'value', 'text', $this->state->get('filter.country')) ); + } - if ($this->canBatch && $this->canCreate && $this->canEdit) - { - // Country Name Batch Selection - JHtmlBatch_::addListSelection( - '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_SERVICE_PROVIDER_COUNTRY_LABEL').' -', - 'batch[country]', - JHtml::_('select.options', $this->countryNameOptions, 'value', 'text') - ); - } + // Only load published batch if state and batch is allowed + if ($this->canState && $this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COSTBENEFITPROJECTION_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + + // Only load Country Name batch if create, edit, and batch is allowed + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + // Country Name Batch Selection + JHtmlBatch_::addListSelection( + '- Keep Original '.JText::_('COM_COSTBENEFITPROJECTION_SERVICE_PROVIDER_COUNTRY_LABEL').' -', + 'batch[country]', + JHtml::_('select.options', $this->countryNameOptions, 'value', 'text') + ); } } @@ -267,7 +255,7 @@ class CostbenefitprojectionViewService_providers extends JViewLegacy protected function getSortFields() { return array( - 'ordering' => JText::_('JGRID_HEADING_ORDERING'), + 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.published' => JText::_('JSTATUS'), 'g.name' => JText::_('COM_COSTBENEFITPROJECTION_SERVICE_PROVIDER_USER_LABEL'), 'h.name' => JText::_('COM_COSTBENEFITPROJECTION_SERVICE_PROVIDER_COUNTRY_LABEL'), diff --git a/admin/whmcs.php b/admin/whmcs.php index 4aa050dd..3f5bfdd8 100644 --- a/admin/whmcs.php +++ b/admin/whmcs.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage whmcs.php diff --git a/costbenefitprojection.xml b/costbenefitprojection.xml index 1cb94c73..4a7205d2 100644 --- a/costbenefitprojection.xml +++ b/costbenefitprojection.xml @@ -1,15 +1,15 @@ COM_COSTBENEFITPROJECTION - 30th May, 2020 + 6th January, 2021 Llewellyn van der Merwe joomla@vdm.io http://www.vdm.io Copyright (C) 2015. All Rights Reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - 3.4.6 + 3.4.7 Cost Benefit Projection (v.3.4.6) +

Cost Benefit Projection (v.3.4.7)

Create Epidemiological Profiles for diseases and risks affecting your company. Detailed information on projected work days lost and costs. Create and edit activities and wellness responses for your workplace. Access to Small Business Modeling. Results displayed by gender. Network with other companies and wellness professionals. diff --git a/costbenefitprojection_update_server.xml b/costbenefitprojection_update_server.xml index b886fc2d..75b7ffa2 100644 --- a/costbenefitprojection_update_server.xml +++ b/costbenefitprojection_update_server.xml @@ -356,4 +356,21 @@ http://www.vdm.io + + Cost Benefit Projection + Cost Benefit Projection Tool. + com_costbenefitprojection + component + 3.4.7 + http://www.vdm.io + + http://domain.com/demo.zip + + + stable + + Llewellyn van der Merwe + http://www.vdm.io + + \ No newline at end of file diff --git a/media/js/table2excel.js b/media/js/table2excel.js index 6e864c6f..dab59c9e 100644 --- a/media/js/table2excel.js +++ b/media/js/table2excel.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage table2excel.js diff --git a/media/js/timeago.js b/media/js/timeago.js new file mode 100644 index 00000000..0c2c219f --- /dev/null +++ b/media/js/timeago.js @@ -0,0 +1,232 @@ +/** + * Timeago is a jQuery plugin that makes it easy to support automatically + * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). + * + * @name timeago + * @version 1.5.4 + * @requires jQuery v1.2.3+ + * @author Ryan McGeary + * @license MIT License - http://www.opensource.org/licenses/mit-license.php + * + * For usage and examples, visit: + * http://timeago.yarp.com/ + * + * Copyright (c) 2008-2017, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org) + */ + +(function (factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof module === 'object' && typeof module.exports === 'object') { + factory(require('jquery')); + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { + $.timeago = function(timestamp) { + if (timestamp instanceof Date) { + return inWords(timestamp); + } else if (typeof timestamp === "string") { + return inWords($.timeago.parse(timestamp)); + } else if (typeof timestamp === "number") { + return inWords(new Date(timestamp)); + } else { + return inWords($.timeago.datetime(timestamp)); + } + }; + var $t = $.timeago; + + $.extend($.timeago, { + settings: { + refreshMillis: 60000, + allowPast: true, + allowFuture: false, + localeTitle: false, + cutoff: 0, + autoDispose: true, + strings: { + prefixAgo: null, + prefixFromNow: null, + suffixAgo: "ago", + suffixFromNow: "from now", + inPast: 'any moment now', + seconds: "less than a minute", + minute: "about a minute", + minutes: "%d minutes", + hour: "about an hour", + hours: "about %d hours", + day: "a day", + days: "%d days", + month: "about a month", + months: "%d months", + year: "about a year", + years: "%d years", + wordSeparator: " ", + numbers: [] + } + }, + + inWords: function(distanceMillis) { + if (!this.settings.allowPast && ! this.settings.allowFuture) { + throw 'timeago allowPast and allowFuture settings can not both be set to false.'; + } + + var $l = this.settings.strings; + var prefix = $l.prefixAgo; + var suffix = $l.suffixAgo; + if (this.settings.allowFuture) { + if (distanceMillis < 0) { + prefix = $l.prefixFromNow; + suffix = $l.suffixFromNow; + } + } + + if (!this.settings.allowPast && distanceMillis >= 0) { + return this.settings.strings.inPast; + } + + var seconds = Math.abs(distanceMillis) / 1000; + var minutes = seconds / 60; + var hours = minutes / 60; + var days = hours / 24; + var years = days / 365; + + function substitute(stringOrFunction, number) { + var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction; + var value = ($l.numbers && $l.numbers[number]) || number; + return string.replace(/%d/i, value); + } + + var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) || + seconds < 90 && substitute($l.minute, 1) || + minutes < 45 && substitute($l.minutes, Math.round(minutes)) || + minutes < 90 && substitute($l.hour, 1) || + hours < 24 && substitute($l.hours, Math.round(hours)) || + hours < 42 && substitute($l.day, 1) || + days < 30 && substitute($l.days, Math.round(days)) || + days < 45 && substitute($l.month, 1) || + days < 365 && substitute($l.months, Math.round(days / 30)) || + years < 1.5 && substitute($l.year, 1) || + substitute($l.years, Math.round(years)); + + var separator = $l.wordSeparator || ""; + if ($l.wordSeparator === undefined) { separator = " "; } + return $.trim([prefix, words, suffix].join(separator)); + }, + + parse: function(iso8601) { + var s = $.trim(iso8601); + s = s.replace(/\.\d+/,""); // remove milliseconds + s = s.replace(/-/,"/").replace(/-/,"/"); + s = s.replace(/T/," ").replace(/Z/," UTC"); + s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400 + s = s.replace(/([\+\-]\d\d)$/," $100"); // +09 -> +0900 + return new Date(s); + }, + datetime: function(elem) { + var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title"); + return $t.parse(iso8601); + }, + isTime: function(elem) { + // jQuery's `is()` doesn't play well with HTML5 in IE + return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time"); + } + }); + + // functions that can be called via $(el).timeago('action') + // init is default when no action is given + // functions are called with context of a single element + var functions = { + init: function() { + functions.dispose.call(this); + var refresh_el = $.proxy(refresh, this); + refresh_el(); + var $s = $t.settings; + if ($s.refreshMillis > 0) { + this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis); + } + }, + update: function(timestamp) { + var date = (timestamp instanceof Date) ? timestamp : $t.parse(timestamp); + $(this).data('timeago', { datetime: date }); + if ($t.settings.localeTitle) { + $(this).attr("title", date.toLocaleString()); + } + refresh.apply(this); + }, + updateFromDOM: function() { + $(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) }); + refresh.apply(this); + }, + dispose: function () { + if (this._timeagoInterval) { + window.clearInterval(this._timeagoInterval); + this._timeagoInterval = null; + } + } + }; + + $.fn.timeago = function(action, options) { + var fn = action ? functions[action] : functions.init; + if (!fn) { + throw new Error("Unknown function name '"+ action +"' for timeago"); + } + // each over objects here and call the requested function + this.each(function() { + fn.call(this, options); + }); + return this; + }; + + function refresh() { + var $s = $t.settings; + + //check if it's still visible + if ($s.autoDispose && !$.contains(document.documentElement,this)) { + //stop if it has been removed + $(this).timeago("dispose"); + return this; + } + + var data = prepareData(this); + + if (!isNaN(data.datetime)) { + if ( $s.cutoff === 0 || Math.abs(distance(data.datetime)) < $s.cutoff) { + $(this).text(inWords(data.datetime)); + } else { + if ($(this).attr('title').length > 0) { + $(this).text($(this).attr('title')); + } + } + } + return this; + } + + function prepareData(element) { + element = $(element); + if (!element.data("timeago")) { + element.data("timeago", { datetime: $t.datetime(element) }); + var text = $.trim(element.text()); + if ($t.settings.localeTitle) { + element.attr("title", element.data('timeago').datetime.toLocaleString()); + } else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) { + element.attr("title", text); + } + } + return element.data("timeago"); + } + + function inWords(date) { + return $t.inWords(distance(date)); + } + + function distance(date) { + return (new Date().getTime() - date.getTime()); + } + + // fix for IE6 suckage + document.createElement("abbr"); + document.createElement("time"); +})); diff --git a/script.php b/script.php index 68e1141f..6c240183 100644 --- a/script.php +++ b/script.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage script.php @@ -83,7 +83,7 @@ class com_costbenefitprojectionInstallerScript $company_done = $db->execute(); if ($company_done) { - // If succesfully remove Company add queued success message. + // If successfully remove Company add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.company) type alias was removed from the #__content_type table')); } @@ -98,7 +98,7 @@ class com_costbenefitprojectionInstallerScript $company_done = $db->execute(); if ($company_done) { - // If succesfully remove Company add queued success message. + // If successfully remove Company add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.company) type alias was removed from the #__contentitem_tag_map table')); } @@ -113,7 +113,7 @@ class com_costbenefitprojectionInstallerScript $company_done = $db->execute(); if ($company_done) { - // If succesfully remove Company add queued success message. + // If successfully removed Company add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.company) type alias was removed from the #__ucm_content table')); } @@ -169,7 +169,7 @@ class com_costbenefitprojectionInstallerScript $service_provider_done = $db->execute(); if ($service_provider_done) { - // If succesfully remove Service_provider add queued success message. + // If successfully remove Service_provider add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.service_provider) type alias was removed from the #__content_type table')); } @@ -184,7 +184,7 @@ class com_costbenefitprojectionInstallerScript $service_provider_done = $db->execute(); if ($service_provider_done) { - // If succesfully remove Service_provider add queued success message. + // If successfully remove Service_provider add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.service_provider) type alias was removed from the #__contentitem_tag_map table')); } @@ -199,7 +199,7 @@ class com_costbenefitprojectionInstallerScript $service_provider_done = $db->execute(); if ($service_provider_done) { - // If succesfully remove Service_provider add queued success message. + // If successfully removed Service_provider add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.service_provider) type alias was removed from the #__ucm_content table')); } @@ -255,7 +255,7 @@ class com_costbenefitprojectionInstallerScript $country_done = $db->execute(); if ($country_done) { - // If succesfully remove Country add queued success message. + // If successfully remove Country add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.country) type alias was removed from the #__content_type table')); } @@ -270,7 +270,7 @@ class com_costbenefitprojectionInstallerScript $country_done = $db->execute(); if ($country_done) { - // If succesfully remove Country add queued success message. + // If successfully remove Country add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.country) type alias was removed from the #__contentitem_tag_map table')); } @@ -285,7 +285,7 @@ class com_costbenefitprojectionInstallerScript $country_done = $db->execute(); if ($country_done) { - // If succesfully remove Country add queued success message. + // If successfully removed Country add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.country) type alias was removed from the #__ucm_content table')); } @@ -341,7 +341,7 @@ class com_costbenefitprojectionInstallerScript $causerisk_done = $db->execute(); if ($causerisk_done) { - // If succesfully remove Causerisk add queued success message. + // If successfully remove Causerisk add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.causerisk) type alias was removed from the #__content_type table')); } @@ -356,7 +356,7 @@ class com_costbenefitprojectionInstallerScript $causerisk_done = $db->execute(); if ($causerisk_done) { - // If succesfully remove Causerisk add queued success message. + // If successfully remove Causerisk add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.causerisk) type alias was removed from the #__contentitem_tag_map table')); } @@ -371,7 +371,7 @@ class com_costbenefitprojectionInstallerScript $causerisk_done = $db->execute(); if ($causerisk_done) { - // If succesfully remove Causerisk add queued success message. + // If successfully removed Causerisk add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.causerisk) type alias was removed from the #__ucm_content table')); } @@ -427,7 +427,7 @@ class com_costbenefitprojectionInstallerScript $health_data_done = $db->execute(); if ($health_data_done) { - // If succesfully remove Health_data add queued success message. + // If successfully remove Health_data add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.health_data) type alias was removed from the #__content_type table')); } @@ -442,7 +442,7 @@ class com_costbenefitprojectionInstallerScript $health_data_done = $db->execute(); if ($health_data_done) { - // If succesfully remove Health_data add queued success message. + // If successfully remove Health_data add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.health_data) type alias was removed from the #__contentitem_tag_map table')); } @@ -457,7 +457,7 @@ class com_costbenefitprojectionInstallerScript $health_data_done = $db->execute(); if ($health_data_done) { - // If succesfully remove Health_data add queued success message. + // If successfully removed Health_data add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.health_data) type alias was removed from the #__ucm_content table')); } @@ -513,7 +513,7 @@ class com_costbenefitprojectionInstallerScript $scaling_factor_done = $db->execute(); if ($scaling_factor_done) { - // If succesfully remove Scaling_factor add queued success message. + // If successfully remove Scaling_factor add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.scaling_factor) type alias was removed from the #__content_type table')); } @@ -528,7 +528,7 @@ class com_costbenefitprojectionInstallerScript $scaling_factor_done = $db->execute(); if ($scaling_factor_done) { - // If succesfully remove Scaling_factor add queued success message. + // If successfully remove Scaling_factor add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.scaling_factor) type alias was removed from the #__contentitem_tag_map table')); } @@ -543,7 +543,7 @@ class com_costbenefitprojectionInstallerScript $scaling_factor_done = $db->execute(); if ($scaling_factor_done) { - // If succesfully remove Scaling_factor add queued success message. + // If successfully removed Scaling_factor add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.scaling_factor) type alias was removed from the #__ucm_content table')); } @@ -599,7 +599,7 @@ class com_costbenefitprojectionInstallerScript $intervention_done = $db->execute(); if ($intervention_done) { - // If succesfully remove Intervention add queued success message. + // If successfully remove Intervention add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.intervention) type alias was removed from the #__content_type table')); } @@ -614,7 +614,7 @@ class com_costbenefitprojectionInstallerScript $intervention_done = $db->execute(); if ($intervention_done) { - // If succesfully remove Intervention add queued success message. + // If successfully remove Intervention add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.intervention) type alias was removed from the #__contentitem_tag_map table')); } @@ -629,7 +629,7 @@ class com_costbenefitprojectionInstallerScript $intervention_done = $db->execute(); if ($intervention_done) { - // If succesfully remove Intervention add queued success message. + // If successfully removed Intervention add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.intervention) type alias was removed from the #__ucm_content table')); } @@ -685,7 +685,7 @@ class com_costbenefitprojectionInstallerScript $currency_done = $db->execute(); if ($currency_done) { - // If succesfully remove Currency add queued success message. + // If successfully remove Currency add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.currency) type alias was removed from the #__content_type table')); } @@ -700,7 +700,7 @@ class com_costbenefitprojectionInstallerScript $currency_done = $db->execute(); if ($currency_done) { - // If succesfully remove Currency add queued success message. + // If successfully remove Currency add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.currency) type alias was removed from the #__contentitem_tag_map table')); } @@ -715,7 +715,7 @@ class com_costbenefitprojectionInstallerScript $currency_done = $db->execute(); if ($currency_done) { - // If succesfully remove Currency add queued success message. + // If successfully removed Currency add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.currency) type alias was removed from the #__ucm_content table')); } @@ -771,7 +771,7 @@ class com_costbenefitprojectionInstallerScript $help_document_done = $db->execute(); if ($help_document_done) { - // If succesfully remove Help_document add queued success message. + // If successfully remove Help_document add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.help_document) type alias was removed from the #__content_type table')); } @@ -786,7 +786,7 @@ class com_costbenefitprojectionInstallerScript $help_document_done = $db->execute(); if ($help_document_done) { - // If succesfully remove Help_document add queued success message. + // If successfully remove Help_document add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.help_document) type alias was removed from the #__contentitem_tag_map table')); } @@ -801,7 +801,7 @@ class com_costbenefitprojectionInstallerScript $help_document_done = $db->execute(); if ($help_document_done) { - // If succesfully remove Help_document add queued success message. + // If successfully removed Help_document add queued success message. $app->enqueueMessage(JText::_('The (com_costbenefitprojection.help_document) type alias was removed from the #__ucm_content table')); } @@ -845,10 +845,31 @@ class com_costbenefitprojectionInstallerScript $help_document_done = $db->execute(); if ($help_document_done) { - // If succesfully remove costbenefitprojection add queued success message. + // If successfully removed costbenefitprojection add queued success message. $app->enqueueMessage(JText::_('All related items was removed from the #__assets table')); } + // Get the biggest rule column in the assets table at this point. + $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $db->setQuery($get_rule_length); + if ($db->execute()) + { + $rule_length = $db->loadResult(); + // Check the size of the rules column + if ($rule_length < 5120) + { + // Revert the assets table rules column back to the default + $revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';"; + $db->setQuery($revert_rule); + $db->execute(); + $app->enqueueMessage(JText::_('Reverted the #__assets table rules column back to its default size of varchar(5120)')); + } + else + { + + $app->enqueueMessage(JText::_('Could not revert the #__assets table rules column back to its default size of varchar(5120), since there is still one or more components that still requires the column to be larger.')); + } + } // Set db if not set already. if (!isset($db)) @@ -1281,9 +1302,9 @@ class com_costbenefitprojectionInstallerScript $help_document->type_title = 'Costbenefitprojection Help_document'; $help_document->type_alias = 'com_costbenefitprojection.help_document'; $help_document->table = '{"special": {"dbtable": "#__costbenefitprojection_help_document","key": "id","type": "Help_document","prefix": "costbenefitprojectionTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}'; + $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}'; $help_document->router = 'CostbenefitprojectionHelperRoute::getHelp_documentRoute'; - $help_document->content_history_options = '{"formFile": "administrator/components/com_costbenefitprojection/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; + $help_document->content_history_options = '{"formFile": "administrator/components/com_costbenefitprojection/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; // Set the object into the content types table. $help_document_Inserted = $db->insertObject('#__content_types', $help_document); @@ -1303,6 +1324,22 @@ class com_costbenefitprojectionInstallerScript $db->setQuery($query); $allDone = $db->execute(); + // Get the biggest rule column in the assets table at this point. + $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1"; + $db->setQuery($get_rule_length); + if ($db->execute()) + { + $rule_length = $db->loadResult(); + // Check the size of the rules column + if ($rule_length <= 26240) + { + // Fix the assets table rules column size + $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` TEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to TEXT by JCB';"; + $db->setQuery($fix_rules_size); + $db->execute(); + $app->enqueueMessage(JText::_('The #__assets table rules column was resized to the TEXT datatype for the components possible large permission rules.')); + } + } echo ' '; @@ -1716,9 +1753,9 @@ class com_costbenefitprojectionInstallerScript $help_document->type_title = 'Costbenefitprojection Help_document'; $help_document->type_alias = 'com_costbenefitprojection.help_document'; $help_document->table = '{"special": {"dbtable": "#__costbenefitprojection_help_document","key": "id","type": "Help_document","prefix": "costbenefitprojectionTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","not_required":"not_required","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}'; + $help_document->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "title","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "content","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "null","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"title":"title","type":"type","groups":"groups","location":"location","admin_view":"admin_view","site_view":"site_view","alias":"alias","content":"content","article":"article","url":"url","target":"target"}}'; $help_document->router = 'CostbenefitprojectionHelperRoute::getHelp_documentRoute'; - $help_document->content_history_options = '{"formFile": "administrator/components/com_costbenefitprojection/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; + $help_document->content_history_options = '{"formFile": "administrator/components/com_costbenefitprojection/models/forms/help_document.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","type","location","article","target"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "article","targetTable": "#__content","targetColumn": "id","displayColumn": "title"}]}'; // Check if help_document type is already in content_type DB. $help_document_id = null; @@ -1744,7 +1781,7 @@ class com_costbenefitprojectionInstallerScript echo ' -

Upgrade to Version 3.4.6 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 3.4.7 Was Successful! Let us know if anything is not working as expected.

'; // Set db if not set already. if (!isset($db)) diff --git a/site/assets/css/combinedresults.css b/site/assets/css/combinedresults.css index 8880204e..42e45a6d 100644 --- a/site/assets/css/combinedresults.css +++ b/site/assets/css/combinedresults.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage combinedresults.css diff --git a/site/assets/css/company.css b/site/assets/css/company.css index e8c5cf13..c6d44fe5 100644 --- a/site/assets/css/company.css +++ b/site/assets/css/company.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.css diff --git a/site/assets/css/companyresults.css b/site/assets/css/companyresults.css index b269c5ef..cec0dfba 100644 --- a/site/assets/css/companyresults.css +++ b/site/assets/css/companyresults.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companyresults.css diff --git a/site/assets/css/cpanel.css b/site/assets/css/cpanel.css index 9de07814..4d58e8f8 100644 --- a/site/assets/css/cpanel.css +++ b/site/assets/css/cpanel.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage cpanel.css diff --git a/site/assets/css/createaccount.css b/site/assets/css/createaccount.css index a41c2c91..60db6f39 100644 --- a/site/assets/css/createaccount.css +++ b/site/assets/css/createaccount.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage createaccount.css diff --git a/site/assets/css/intervention.css b/site/assets/css/intervention.css index 3fd50474..db5ab5ca 100644 --- a/site/assets/css/intervention.css +++ b/site/assets/css/intervention.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage intervention.css diff --git a/site/assets/css/publicresults.css b/site/assets/css/publicresults.css index 99ea5d4e..d9b750eb 100644 --- a/site/assets/css/publicresults.css +++ b/site/assets/css/publicresults.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publicresults.css diff --git a/site/assets/css/scaling_factor.css b/site/assets/css/scaling_factor.css index 9de72689..75c6711a 100644 --- a/site/assets/css/scaling_factor.css +++ b/site/assets/css/scaling_factor.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factor.css diff --git a/site/assets/css/site.css b/site/assets/css/site.css index 8dfbd6a8..e28aded1 100644 --- a/site/assets/css/site.css +++ b/site/assets/css/site.css @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage site.css diff --git a/site/assets/js/site.js b/site/assets/js/site.js index 32b61815..6af26c8c 100644 --- a/site/assets/js/site.js +++ b/site/assets/js/site.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage site.js diff --git a/site/controller.php b/site/controller.php index 7ef85c6d..ede1482e 100644 --- a/site/controller.php +++ b/site/controller.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage controller.php diff --git a/site/controllers/ajax.json.php b/site/controllers/ajax.json.php index b4ec011b..548f6d47 100644 --- a/site/controllers/ajax.json.php +++ b/site/controllers/ajax.json.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage ajax.json.php diff --git a/site/controllers/company.php b/site/controllers/company.php index f95fc2fb..1926aa76 100644 --- a/site/controllers/company.php +++ b/site/controllers/company.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.php diff --git a/site/controllers/help.php b/site/controllers/help.php index f9f18c79..af58caf6 100644 --- a/site/controllers/help.php +++ b/site/controllers/help.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage help.php diff --git a/site/controllers/intervention.php b/site/controllers/intervention.php index 05e1c801..c15c4847 100644 --- a/site/controllers/intervention.php +++ b/site/controllers/intervention.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage intervention.php diff --git a/site/controllers/scaling_factor.php b/site/controllers/scaling_factor.php index 0c9a7a53..f1965f4c 100644 --- a/site/controllers/scaling_factor.php +++ b/site/controllers/scaling_factor.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factor.php diff --git a/site/costbenefitprojection.php b/site/costbenefitprojection.php index 67bf94c8..806c1afd 100644 --- a/site/costbenefitprojection.php +++ b/site/costbenefitprojection.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php @@ -19,6 +19,7 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); + JHtml::_('behavior.tabstate'); // Set the component css/js @@ -27,7 +28,7 @@ $document->addStyleSheet('components/com_costbenefitprojection/assets/css/site.c $document->addScript('components/com_costbenefitprojection/assets/js/site.js'); // Require helper files -JLoader::register('CostbenefitprojectionHelper', __DIR__ . '/helpers/costbenefitprojection.php'); +JLoader::register('CostbenefitprojectionHelper', __DIR__ . '/helpers/costbenefitprojection.php'); JLoader::register('CostbenefitprojectionHelperRoute', __DIR__ . '/helpers/route.php'); // Get an instance of the controller prefixed by Costbenefitprojection diff --git a/site/helpers/category.php b/site/helpers/category.php index 7bbd78cd..b949fdc8 100644 --- a/site/helpers/category.php +++ b/site/helpers/category.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage category.php diff --git a/site/helpers/costbenefitprojection.php b/site/helpers/costbenefitprojection.php index 643ac152..ac45a6ce 100644 --- a/site/helpers/costbenefitprojection.php +++ b/site/helpers/costbenefitprojection.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage costbenefitprojection.php @@ -20,8 +20,9 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\CMS\Language\Language; -use Joomla\String\StringHelper; +use Joomla\CMS\Language\Language; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -1273,9 +1274,33 @@ abstract class CostbenefitprojectionHelper /** * Greate user and update given table + * + * @param array $credentials Array('name' => string, 'username' => string, 'email' => string, 'password' => string, 'password2' => string) + * @param int $autologin + * @param array $params Array('useractivation' => int, 'sendpassword' => int, 'allowUserRegistration' => int) + * @param array $mode 1 = Site Registrations; 0 = Admin Registration; 2 = Custom Helper Method Called registerUser + * + * @return int|Error User ID on success, or an error. */ - public static function createUser($new) + public static function createUser($credentials, $autologin = 0, + $params = array( + 'useractivation' => 0, 'sendpassword' => 1 + ), $mode = 1 + ) { + // Override mode + if ($mode == 2 && method_exists(__CLASS__, 'registerUser')) + { + // Update params + $params['autologin'] = $autologin; + // Now Register User + return self::registerUser($credentials, $params); + } + elseif ($mode == 2) + { + // Fallback to Site Registrations + $mode = 1; + } // load the user component language files if there is an error. $lang = JFactory::getLanguage(); $extension = 'com_users'; @@ -1283,53 +1308,113 @@ abstract class CostbenefitprojectionHelper $language_tag = 'en-GB'; $reload = true; $lang->load($extension, $base_dir, $language_tag, $reload); - // load the user regestration model - $model = self::getModel('registration', JPATH_ROOT. '/components/com_users', 'Users'); - // make sure no activation is needed - $useractivation = self::setParams('com_users','useractivation',0); - // make sure password is send - $sendpassword = self::setParams('com_users','sendpassword',1); - // Check if password was set - if (isset($new['password']) && isset($new['password2']) && self::checkString($new['password']) && self::checkString($new['password2'])) + // Load the correct user model. + if ($mode == 1) // 1 = Site Registrations { - // Use the users passwords - $password = $new['password']; - $password2 = $new['password2']; + // Load the user site-registration model + $model = self::getModel('registration', $base_dir . '/components/' . $extension, 'Users'); } - else + else // 0 = Admin Registration { - // Set random password - $password = self::randomkey(8); - $password2 = $password; + // Load the backend-user model + $model = self::getModel('user', JPATH_ADMINISTRATOR . '/components/' . $extension, 'Users'); } - // set username if not set - if (!isset($new['username']) || !self::checkString($new['username'])) + // Check if we have params/config + if (self::checkArray($params)) { - $new['username'] = self::safeString($new['name']); + // Make changes to user config + foreach ($params as $param => $set) + { + // If you know of a better path, let me know + $params[$param] = self::setParams($extension, $param, $set); + } } - // linup new user data + // Set username to email if not set + if (!isset($credentials['username']) || !self::checkString($credentials['username'])) + { + $credentials['username'] = $credentials['email']; + } + // Lineup new user data array $data = array( - 'username' => $new['username'], - 'name' => $new['name'], - 'email1' => $new['email'], - 'password1' => $password, // First password field - 'password2' => $password2, // Confirm password field + 'username' => $credentials['username'], + 'name' => $credentials['name'], 'block' => 0 ); - // register the new user - $userId = $model->register($data); - // set activation back to default - self::setParams('com_users','useractivation',$useractivation); - // set send password back to default - self::setParams('com_users','sendpassword',$sendpassword); + // Added details based on mode + if ($mode == 1) // 1 = Site-registration mode + { + $data['email1'] = $credentials['email']; + } + else // 0 = Admin-registration mode + { + $data['email'] = $credentials['email']; + $data['registerDate'] = JFactory::getDate()->toSql(); + } + // Check if password was set + if ($mode == 1 && (!isset($credentials['password']) || !isset($credentials['password2']) || !self::checkString($credentials['password']) || !self::checkString($credentials['password2']))) + { + // Set random password when empty password was submitted, + // when using the 1 = site-registration mode + $credentials['password'] = self::randomkey(8); + $credentials['password2'] = $credentials['password']; + } + // Now Add password if set + if (isset($credentials['password']) && isset($credentials['password2']) && self::checkString($credentials['password']) && self::checkString($credentials['password2'])) + { + if ($mode == 1) // 1 = Site-registration mode + { + $data['password1'] = $credentials['password']; + } + else // 0 = Admin-registration mode + { + $data['password'] = $credentials['password']; + } + $data['password2'] = $credentials['password2']; + } + // Load the group/s value if set, only for Admin Registration ($mode == 0) + if ($mode == 0 && isset($credentials['groups']) && self::checkArray($credentials['groups'])) + { + $data['groups'] = $credentials['groups']; + } + // Create the new user + if ($mode == 1) // 1 = Site-registration mode + { + $userId = $model->register($data); + } + else // 0 = Admin-registration mode + { + $model->save($data); + $userId = $model->getState('user.id', 0); + } + // Check if we have params + if (self::checkArray($params)) + { + // Change user params/config back + foreach ($params as $param => $set) + { + // If you know of a better path, let me know + self::setParams($extension, $param, $set); + } + } // if user is created if ($userId > 0) { + // Auto Login if Needed + if ($autologin && isset($credentials['password'])) + { + // Try to login + try{ + JFactory::getApplication()->login($credentials); + } catch (Exception $exception){ + // Do noting for now, may want to set redirect. + } + } + // Return ID return $userId; } return $model->getError(); } - protected static function setParams($component,$target,$value) + public static function setParams($component,$target,$value) { // Get the params and set the new values $params = JComponentHelper::getParams($component); @@ -1347,7 +1432,7 @@ abstract class CostbenefitprojectionHelper // Execute the query $db->setQuery($query); - $db->query(); + $db->execute(); } return $was; } @@ -1374,21 +1459,17 @@ abstract class CostbenefitprojectionHelper $password2 = $new['password2']; } // set username - if (isset($new['username']) && self::checkString($new['username'])) + if (!isset($new['username']) || !self::checkString($new['username'])) { - $new['username'] = self::safeString($new['username']); + $new['username'] = $new['email']; } - else - { - $new['username'] = self::safeString($new['name']); - } - // linup update user data + // lineup update user data $data = array( 'id' => $new['id'], 'username' => $new['username'], 'name' => $new['name'], 'email' => $new['email'], - 'password1' => $password, // First password field + 'password' => $password, // First password field 'password2' => $password2, // Confirm password field 'block' => 0 ); // set groups if found diff --git a/site/helpers/headercheck.php b/site/helpers/headercheck.php index 6d926d64..8ccb273a 100644 --- a/site/helpers/headercheck.php +++ b/site/helpers/headercheck.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage headercheck.php diff --git a/site/helpers/route.php b/site/helpers/route.php index 1f3ac58b..ff79e96b 100644 --- a/site/helpers/route.php +++ b/site/helpers/route.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage route.php diff --git a/site/language/en-GB/en-GB.com_costbenefitprojection.ini b/site/language/en-GB/en-GB.com_costbenefitprojection.ini index 412e41b2..ebebfe4f 100644 --- a/site/language/en-GB/en-GB.com_costbenefitprojection.ini +++ b/site/language/en-GB/en-GB.com_costbenefitprojection.ini @@ -39,6 +39,8 @@ COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_CHECKED_IN_1="%d Company successfull COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_CHECKED_IN_MORE="%d Companies successfully checked in." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_DELETED="%s Companies deleted." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_DELETED_1="%s Company deleted." +COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_FAILED_PUBLISHING="%s Companies failed publishing." +COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_FAILED_PUBLISHING_1="%s Company failed publishing." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_FEATURED="%s Companies featured." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_FEATURED_1="%s Company featured." COM_COSTBENEFITPROJECTION_COMPANIES_N_ITEMS_PUBLISHED="%s Companies published." @@ -254,6 +256,8 @@ COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_CHECKED_IN_1="%d Intervention su COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_CHECKED_IN_MORE="%d Interventions successfully checked in." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_DELETED="%s Interventions deleted." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_DELETED_1="%s Intervention deleted." +COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_FAILED_PUBLISHING="%s Interventions failed publishing." +COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_FAILED_PUBLISHING_1="%s Intervention failed publishing." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_FEATURED="%s Interventions featured." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_FEATURED_1="%s Intervention featured." COM_COSTBENEFITPROJECTION_INTERVENTIONS_N_ITEMS_PUBLISHED="%s Interventions published." @@ -405,6 +409,8 @@ COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_CHECKED_IN_1="%d Scaling Facto COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_CHECKED_IN_MORE="%d Scaling Factors successfully checked in." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_DELETED="%s Scaling Factors deleted." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_DELETED_1="%s Scaling Factor deleted." +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_FAILED_PUBLISHING="%s Scaling Factors failed publishing." +COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_FAILED_PUBLISHING_1="%s Scaling Factor failed publishing." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_FEATURED="%s Scaling Factors featured." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_FEATURED_1="%s Scaling Factor featured." COM_COSTBENEFITPROJECTION_SCALING_FACTORS_N_ITEMS_PUBLISHED="%s Scaling Factors published." diff --git a/site/layouts/appnotice.php b/site/layouts/appnotice.php index e5209b78..f3289833 100644 --- a/site/layouts/appnotice.php +++ b/site/layouts/appnotice.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage appnotice.php diff --git a/site/layouts/company/age_groups_percentages_fullwidth.php b/site/layouts/company/age_groups_percentages_fullwidth.php index 90b12b0e..d84c13b3 100644 --- a/site/layouts/company/age_groups_percentages_fullwidth.php +++ b/site/layouts/company/age_groups_percentages_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_fullwidth.php diff --git a/site/layouts/company/age_groups_percentages_left.php b/site/layouts/company/age_groups_percentages_left.php index 2228abf9..c4055545 100644 --- a/site/layouts/company/age_groups_percentages_left.php +++ b/site/layouts/company/age_groups_percentages_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_left.php diff --git a/site/layouts/company/age_groups_percentages_right.php b/site/layouts/company/age_groups_percentages_right.php index 0fff564c..ae238030 100644 --- a/site/layouts/company/age_groups_percentages_right.php +++ b/site/layouts/company/age_groups_percentages_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage age_groups_percentages_right.php diff --git a/site/layouts/company/causerisk_selection_fullwidth.php b/site/layouts/company/causerisk_selection_fullwidth.php index 1342061c..9e65dd44 100644 --- a/site/layouts/company/causerisk_selection_fullwidth.php +++ b/site/layouts/company/causerisk_selection_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage causerisk_selection_fullwidth.php diff --git a/site/layouts/company/details_above.php b/site/layouts/company/details_above.php index f662a99a..942cbccc 100644 --- a/site/layouts/company/details_above.php +++ b/site/layouts/company/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/site/layouts/company/details_left.php b/site/layouts/company/details_left.php index 57938987..6ed8e7d8 100644 --- a/site/layouts/company/details_left.php +++ b/site/layouts/company/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/site/layouts/company/details_right.php b/site/layouts/company/details_right.php index 6c345485..22ccf773 100644 --- a/site/layouts/company/details_right.php +++ b/site/layouts/company/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/site/layouts/company/details_under.php b/site/layouts/company/details_under.php index 5a6e6ded..0b043c60 100644 --- a/site/layouts/company/details_under.php +++ b/site/layouts/company/details_under.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_under.php diff --git a/site/layouts/company/interventions_fullwidth.php b/site/layouts/company/interventions_fullwidth.php index 82f96889..7ceb502e 100644 --- a/site/layouts/company/interventions_fullwidth.php +++ b/site/layouts/company/interventions_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage interventions_fullwidth.php @@ -117,25 +117,25 @@ $can = CostbenefitprojectionHelper::getActions('intervention'); escape($item->duration); ?> - published == 1):?> + published == 1): ?> - published == 0):?> + published == 0): ?> - published == 2):?> + published == 2): ?> - published == -2):?> + published == -2): ?> diff --git a/site/layouts/company/publishing.php b/site/layouts/company/publishing.php index 052e3894..1c812463 100644 --- a/site/layouts/company/publishing.php +++ b/site/layouts/company/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/site/layouts/company/publlshing.php b/site/layouts/company/publlshing.php index 459bc81d..f9fb69fd 100644 --- a/site/layouts/company/publlshing.php +++ b/site/layouts/company/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/site/layouts/company/scaling_factors_fullwidth.php b/site/layouts/company/scaling_factors_fullwidth.php index bfa4b384..5ce9d3a6 100644 --- a/site/layouts/company/scaling_factors_fullwidth.php +++ b/site/layouts/company/scaling_factors_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factors_fullwidth.php @@ -122,25 +122,25 @@ else escape($item->presenteeism_scaling_factor_females); ?> - published == 1):?> + published == 1): ?> - published == 0):?> + published == 0): ?> - published == 2):?> + published == 2): ?> - published == -2):?> + published == -2): ?> diff --git a/site/layouts/companydetails.php b/site/layouts/companydetails.php index cb012674..a536e2cc 100644 --- a/site/layouts/companydetails.php +++ b/site/layouts/companydetails.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companydetails.php diff --git a/site/layouts/databreakdownmalefemale.php b/site/layouts/databreakdownmalefemale.php index 7388bc43..ede62762 100644 --- a/site/layouts/databreakdownmalefemale.php +++ b/site/layouts/databreakdownmalefemale.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage databreakdownmalefemale.php diff --git a/site/layouts/intervention/details_above.php b/site/layouts/intervention/details_above.php index 6501caa4..824120c6 100644 --- a/site/layouts/intervention/details_above.php +++ b/site/layouts/intervention/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/site/layouts/intervention/details_fullwidth.php b/site/layouts/intervention/details_fullwidth.php index 1b971196..a684b291 100644 --- a/site/layouts/intervention/details_fullwidth.php +++ b/site/layouts/intervention/details_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_fullwidth.php diff --git a/site/layouts/intervention/details_under.php b/site/layouts/intervention/details_under.php index 5a6e6ded..0b043c60 100644 --- a/site/layouts/intervention/details_under.php +++ b/site/layouts/intervention/details_under.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_under.php diff --git a/site/layouts/intervention/publishing.php b/site/layouts/intervention/publishing.php index 052e3894..1c812463 100644 --- a/site/layouts/intervention/publishing.php +++ b/site/layouts/intervention/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/site/layouts/intervention/publlshing.php b/site/layouts/intervention/publlshing.php index 9adbd116..7767bba7 100644 --- a/site/layouts/intervention/publlshing.php +++ b/site/layouts/intervention/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/site/layouts/intervention/settings_fullwidth.php b/site/layouts/intervention/settings_fullwidth.php index cce94596..ae887369 100644 --- a/site/layouts/intervention/settings_fullwidth.php +++ b/site/layouts/intervention/settings_fullwidth.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage settings_fullwidth.php diff --git a/site/layouts/intervention/settings_left.php b/site/layouts/intervention/settings_left.php index a234c014..f41c46a9 100644 --- a/site/layouts/intervention/settings_left.php +++ b/site/layouts/intervention/settings_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage settings_left.php diff --git a/site/layouts/scaling_factor/details_above.php b/site/layouts/scaling_factor/details_above.php index 3436e420..88d019c5 100644 --- a/site/layouts/scaling_factor/details_above.php +++ b/site/layouts/scaling_factor/details_above.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_above.php diff --git a/site/layouts/scaling_factor/details_left.php b/site/layouts/scaling_factor/details_left.php index 73d5ca27..26c411f9 100644 --- a/site/layouts/scaling_factor/details_left.php +++ b/site/layouts/scaling_factor/details_left.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_left.php diff --git a/site/layouts/scaling_factor/details_right.php b/site/layouts/scaling_factor/details_right.php index a5e0c076..6a1160e2 100644 --- a/site/layouts/scaling_factor/details_right.php +++ b/site/layouts/scaling_factor/details_right.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage details_right.php diff --git a/site/layouts/scaling_factor/publishing.php b/site/layouts/scaling_factor/publishing.php index 052e3894..1c812463 100644 --- a/site/layouts/scaling_factor/publishing.php +++ b/site/layouts/scaling_factor/publishing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publishing.php @@ -34,6 +34,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; // get the fields $fields = $displayData->get($fields_tab_layout) ?: array( + 'title', 'created', 'created_by', 'modified', diff --git a/site/layouts/scaling_factor/publlshing.php b/site/layouts/scaling_factor/publlshing.php index 9adbd116..7767bba7 100644 --- a/site/layouts/scaling_factor/publlshing.php +++ b/site/layouts/scaling_factor/publlshing.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage publlshing.php diff --git a/site/models/ajax.php b/site/models/ajax.php index bfc6ad03..e560a73f 100644 --- a/site/models/ajax.php +++ b/site/models/ajax.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage ajax.php @@ -235,14 +235,14 @@ public function getInterventionBuildTable($idName,$oject,$cluster) } return $new; } - + /** * Check and if a vdm notice is new (per/user) **/ public function isNew($notice) { // first get the file path - $path_filename = CostbenefitprojectionHelper::getFilePath('user', 'notice', JFactory::getUser()->username, $fileType = '.md', JPATH_COMPONENT_ADMINISTRATOR); + $path_filename = CostbenefitprojectionHelper::getFilePath('path', 'usernotice', 'md', JFactory::getUser()->username, JPATH_COMPONENT_ADMINISTRATOR); // check if the file is set if (($content = @file_get_contents($path_filename)) !== FALSE) { @@ -260,7 +260,7 @@ public function getInterventionBuildTable($idName,$oject,$cluster) public function isRead($notice) { // first get the file path - $path_filename = CostbenefitprojectionHelper::getFilePath('user', 'notice', JFactory::getUser()->username, $fileType = '.md', JPATH_COMPONENT_ADMINISTRATOR); + $path_filename = CostbenefitprojectionHelper::getFilePath('path', 'usernotice', 'md', JFactory::getUser()->username, JPATH_COMPONENT_ADMINISTRATOR); // set as read if not already set if (($content = @file_get_contents($path_filename)) !== FALSE) { diff --git a/site/models/combinedresults.php b/site/models/combinedresults.php index ca4fee7b..e2c753e9 100644 --- a/site/models/combinedresults.php +++ b/site/models/combinedresults.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage combinedresults.php diff --git a/site/models/company.php b/site/models/company.php index a893f2fc..b7fd1932 100644 --- a/site/models/company.php +++ b/site/models/company.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -918,7 +918,7 @@ class CostbenefitprojectionModelCompany extends JModelAdmin public function validate($form, $data, $group = null) { // check if the not_required field is set - if (CostbenefitprojectionHelper::checkString($data['not_required'])) + if (isset($data['not_required']) && CostbenefitprojectionHelper::checkString($data['not_required'])) { $requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = array_unique($requiredFields); diff --git a/site/models/companyresults.php b/site/models/companyresults.php index 7983dd3b..84d0e565 100644 --- a/site/models/companyresults.php +++ b/site/models/companyresults.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage companyresults.php @@ -203,7 +203,7 @@ class CostbenefitprojectionModelCompanyresults extends JModelItem if ($e->getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseWaring(404, $e->getMessage()); + JError::raiseWarning(404, $e->getMessage()); } else { diff --git a/site/models/cpanel.php b/site/models/cpanel.php index 151e2652..0f235099 100644 --- a/site/models/cpanel.php +++ b/site/models/cpanel.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage cpanel.php diff --git a/site/models/createaccount.php b/site/models/createaccount.php index ae9553f7..f9e8b32d 100644 --- a/site/models/createaccount.php +++ b/site/models/createaccount.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage createaccount.php diff --git a/site/models/forms/company.js b/site/models/forms/company.js index 0185f335..77361c2c 100644 --- a/site/models/forms/company.js +++ b/site/models/forms/company.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage company.js diff --git a/site/models/forms/company.xml b/site/models/forms/company.xml index edd70b37..6d27626e 100644 --- a/site/models/forms/company.xml +++ b/site/models/forms/company.xml @@ -84,6 +84,14 @@ readonly="true" filter="unset" /> + + + + + + + + + + + + getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseWaring(404, $e->getMessage()); + JError::raiseWarning(404, $e->getMessage()); } else { diff --git a/site/models/scaling_factor.php b/site/models/scaling_factor.php index 77e000b0..65065dd2 100644 --- a/site/models/scaling_factor.php +++ b/site/models/scaling_factor.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage scaling_factor.php @@ -20,8 +20,8 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -use Joomla\Registry\Registry; -use Joomla\String\StringHelper; +use Joomla\Registry\Registry; +use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; /** @@ -412,7 +412,7 @@ class CostbenefitprojectionModelScaling_factor extends JModelAdmin public function validate($form, $data, $group = null) { // check if the not_required field is set - if (CostbenefitprojectionHelper::checkString($data['not_required'])) + if (isset($data['not_required']) && CostbenefitprojectionHelper::checkString($data['not_required'])) { $requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = array_unique($requiredFields); diff --git a/site/router.php b/site/router.php index f2492d2d..f828c3a2 100644 --- a/site/router.php +++ b/site/router.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage router.php diff --git a/site/views/combinedresults/tmpl/default.php b/site/views/combinedresults/tmpl/default.php index 256518d8..12c4e202 100644 --- a/site/views/combinedresults/tmpl/default.php +++ b/site/views/combinedresults/tmpl/default.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default.php @@ -18,7 +18,9 @@ /------------------------------------------------------------------------------------------------------*/ // No direct access to this file -defined('_JEXEC') or die('Restricted access'); +defined('_JEXEC') or die('Restricted access'); + + // set the active tabs based on interventions if (isset($this->results->interventions) && CostbenefitprojectionHelper::checkArray($this->results->interventions)) @@ -31,7 +33,6 @@ else $savings = ''; $details = 'uk-active '; } - ?>
diff --git a/site/views/combinedresults/tmpl/default_chart_cost.php b/site/views/combinedresults/tmpl/default_chart_cost.php index 664a1f7c..d6a946a5 100644 --- a/site/views/combinedresults/tmpl/default_chart_cost.php +++ b/site/views/combinedresults/tmpl/default_chart_cost.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_cost.php diff --git a/site/views/combinedresults/tmpl/default_chart_cost_percent.php b/site/views/combinedresults/tmpl/default_chart_cost_percent.php index 40d9d2b9..3b0ea359 100644 --- a/site/views/combinedresults/tmpl/default_chart_cost_percent.php +++ b/site/views/combinedresults/tmpl/default_chart_cost_percent.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_cost_percent.php diff --git a/site/views/combinedresults/tmpl/default_chart_intervention_cost_benefit.php b/site/views/combinedresults/tmpl/default_chart_intervention_cost_benefit.php index fd98f70f..e51bd3fc 100644 --- a/site/views/combinedresults/tmpl/default_chart_intervention_cost_benefit.php +++ b/site/views/combinedresults/tmpl/default_chart_intervention_cost_benefit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_intervention_cost_benefit.php diff --git a/site/views/combinedresults/tmpl/default_chart_intervention_cost_benefit_save.php b/site/views/combinedresults/tmpl/default_chart_intervention_cost_benefit_save.php index 11f38ab5..c7e665bb 100644 --- a/site/views/combinedresults/tmpl/default_chart_intervention_cost_benefit_save.php +++ b/site/views/combinedresults/tmpl/default_chart_intervention_cost_benefit_save.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_intervention_cost_benefit_save.php diff --git a/site/views/combinedresults/tmpl/default_chart_work_days_lost.php b/site/views/combinedresults/tmpl/default_chart_work_days_lost.php index 121d3acf..05aa0db7 100644 --- a/site/views/combinedresults/tmpl/default_chart_work_days_lost.php +++ b/site/views/combinedresults/tmpl/default_chart_work_days_lost.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_work_days_lost.php diff --git a/site/views/combinedresults/tmpl/default_chart_work_days_lost_percent.php b/site/views/combinedresults/tmpl/default_chart_work_days_lost_percent.php index d704a8dc..b00deabe 100644 --- a/site/views/combinedresults/tmpl/default_chart_work_days_lost_percent.php +++ b/site/views/combinedresults/tmpl/default_chart_work_days_lost_percent.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_chart_work_days_lost_percent.php diff --git a/site/views/combinedresults/tmpl/default_table_calculated_cost_in_detail.php b/site/views/combinedresults/tmpl/default_table_calculated_cost_in_detail.php index a7e8aef8..b7d536ef 100644 --- a/site/views/combinedresults/tmpl/default_table_calculated_cost_in_detail.php +++ b/site/views/combinedresults/tmpl/default_table_calculated_cost_in_detail.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_calculated_cost_in_detail.php diff --git a/site/views/combinedresults/tmpl/default_table_cost_summary.php b/site/views/combinedresults/tmpl/default_table_cost_summary.php index 5ab2f993..67f18adf 100644 --- a/site/views/combinedresults/tmpl/default_table_cost_summary.php +++ b/site/views/combinedresults/tmpl/default_table_cost_summary.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_cost_summary.php diff --git a/site/views/combinedresults/tmpl/default_table_intervention_net_benefit.php b/site/views/combinedresults/tmpl/default_table_intervention_net_benefit.php index 655ebcf4..50d0f0ce 100644 --- a/site/views/combinedresults/tmpl/default_table_intervention_net_benefit.php +++ b/site/views/combinedresults/tmpl/default_table_intervention_net_benefit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_intervention_net_benefit.php diff --git a/site/views/combinedresults/tmpl/default_table_work_days_lost_summary.php b/site/views/combinedresults/tmpl/default_table_work_days_lost_summary.php index a1fe2462..058ae0ae 100644 --- a/site/views/combinedresults/tmpl/default_table_work_days_lost_summary.php +++ b/site/views/combinedresults/tmpl/default_table_work_days_lost_summary.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage default_table_work_days_lost_summary.php diff --git a/site/views/combinedresults/view.html.php b/site/views/combinedresults/view.html.php index b5438dc5..0a70f014 100644 --- a/site/views/combinedresults/view.html.php +++ b/site/views/combinedresults/view.html.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage view.html.php @@ -177,8 +177,6 @@ class CostbenefitprojectionViewCombinedresults extends JViewLegacy */ protected function addToolBar() { - // adding the joomla toolbar to the front - JLoader::register('JToolbarHelper', JPATH_ADMINISTRATOR.'/includes/toolbar.php'); // set help url for this view if found $help_url = CostbenefitprojectionHelper::getHelpUrl('combinedresults'); diff --git a/site/views/company/submitbutton.js b/site/views/company/submitbutton.js index 8895e56b..53fafe2f 100644 --- a/site/views/company/submitbutton.js +++ b/site/views/company/submitbutton.js @@ -3,7 +3,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage submitbutton.js diff --git a/site/views/company/tmpl/edit.php b/site/views/company/tmpl/edit.php index 4903cd7c..694c9608 100644 --- a/site/views/company/tmpl/edit.php +++ b/site/views/company/tmpl/edit.php @@ -4,7 +4,7 @@ /-------------------------------------------------------------------------------------------------------/ @version 3.4.x - @build 30th May, 2020 + @build 6th January, 2021 @created 15th June, 2012 @package Cost Benefit Projection @subpackage edit.php @@ -20,15 +20,15 @@ // No direct access to this file defined('_JEXEC') or die('Restricted access'); -JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); -JHtml::_('behavior.tooltip'); -JHtml::_('behavior.formvalidation'); -JHtml::_('formbehavior.chosen', 'select'); -JHtml::_('behavior.keepalive'); -JHtml::_('behavior.tabstate'); +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +JHtml::_('behavior.tabstate'); JHtml::_('behavior.calendar'); -$componentParams = $this->params; // will be removed just use $this->params instead ?> +
toolbar->render(); ?>
@@ -102,7 +102,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst tab_name = 'companyTab'; ?> - canDo->get('company.delete') || $this->canDo->get('company.edit.created_by') || $this->canDo->get('company.edit.state') || $this->canDo->get('company.edit.created')) : ?> + canDo->get('company.edit.created_by') || $this->canDo->get('company.edit.created') || $this->canDo->get('company.edit.state') || ($this->canDo->get('company.delete') && $this->canDo->get('company.edit.state'))) : ?>
@@ -144,7 +144,8 @@ $componentParams = $this->params; // will be removed just use $this->params inst
- + +