Updated with JCB v2.12.4

This commit is contained in:
Llewellyn van der Merwe 2021-01-06 15:56:35 +02:00
parent f043be8516
commit 5168e0ef24
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
132 changed files with 920 additions and 656 deletions

View File

@ -2,7 +2,7 @@
This is a [Joomla 3.x](http://www.joomla.org/) component. This is a [Joomla 3.x](http://www.joomla.org/) component.
![Questions and Answers image](https://raw.githubusercontent.com/vdm-io/Joomla-Questions-and-Answers/master/admin/assets/images/vdm-component.jpg "The Questions and Answers") ![Questions and Answers image](https://github.com/Llewellynvdm/Joomla-Questions-and-Answers/raw/master/admin/assets/images/vdm-component.jpg "The Questions and Answers")
Just a basic Questions & Answers. Just a basic Questions & Answers.
@ -12,23 +12,52 @@ Just a basic Questions & Answers.
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Questions and Answers](https://www.vdm.io/) + *Name*: [Questions and Answers](https://www.vdm.io/)
+ *First Build*: 30th January, 2017 + *First Build*: 30th January, 2017
+ *Last Build*: 30th May, 2020 + *Last Build*: 6th January, 2021
+ *Version*: 1.0.x + *Version*: 1.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
# Component Number # Component Number
+ *Line count*: **30682** + *Line count*: **30948**
+ *File count*: **202** + *File count*: **202**
+ *Folder count*: **63** + *Folder count*: **63**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
## Donations
If you want to support this project, please consider donating: ## Contributors
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder).
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218 [![Contributors](https://opencollective.com/Joomla-Component-Builder/contributors.svg?width=890&button=false)](https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors)
### Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)]
[![Our Backers on opencollective](https://opencollective.com/Joomla-Component-Builder/backers.svg?width=890)](https://opencollective.com/Joomla-Component-Builder#backers)
### Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/Joomla-Component-Builder#sponsor)]
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/0/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/0/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/1/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/1/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/2/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/2/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/3/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/3/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/4/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/4/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/5/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/5/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/6/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/6/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/7/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/7/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/8/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/8/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/9/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/9/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/10/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/10/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/11/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/11/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/12/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/12/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/13/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/13/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/14/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/14/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/15/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/15/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/16/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/16/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/17/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/17/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/18/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/18/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/19/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/19/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/20/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/20/website)

View File

@ -2,7 +2,7 @@
This is a [Joomla 3.x](http://www.joomla.org/) component. This is a [Joomla 3.x](http://www.joomla.org/) component.
![Questions and Answers image](https://raw.githubusercontent.com/vdm-io/Joomla-Questions-and-Answers/master/admin/assets/images/vdm-component.jpg "The Questions and Answers") ![Questions and Answers image](https://github.com/Llewellynvdm/Joomla-Questions-and-Answers/raw/master/admin/assets/images/vdm-component.jpg "The Questions and Answers")
Just a basic Questions & Answers. Just a basic Questions & Answers.
@ -12,23 +12,52 @@ Just a basic Questions & Answers.
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Questions and Answers](https://www.vdm.io/) + *Name*: [Questions and Answers](https://www.vdm.io/)
+ *First Build*: 30th January, 2017 + *First Build*: 30th January, 2017
+ *Last Build*: 30th May, 2020 + *Last Build*: 6th January, 2021
+ *Version*: 1.0.x + *Version*: 1.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
# Component Number # Component Number
+ *Line count*: **30682** + *Line count*: **30948**
+ *File count*: **202** + *File count*: **202**
+ *Folder count*: **63** + *Folder count*: **63**
> This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder).
> Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io)
## Donations
If you want to support this project, please consider donating: ## Contributors
* PayPal: [paypal.me/asseblief](https://www.paypal.me/asseblief) This project exists thanks to all the people who contribute to the [Joomla Component Builder Project](https://github.com/vdm-io/Joomla-Component-Builder).
* Bitcoin: 18vURxYpPFjvNk8BnUy1ovCAyQmY3MzkSf
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218 [![Contributors](https://opencollective.com/Joomla-Component-Builder/contributors.svg?width=890&button=false)](https://github.com/vdm-io/Joomla-Component-Builder/graphs/contributors)
### Backers
Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/Joomla-Component-Builder#backer)]
[![Our Backers on opencollective](https://opencollective.com/Joomla-Component-Builder/backers.svg?width=890)](https://opencollective.com/Joomla-Component-Builder#backers)
### Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/Joomla-Component-Builder#sponsor)]
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/0/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/0/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/1/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/1/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/2/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/2/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/3/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/3/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/4/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/4/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/5/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/5/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/6/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/6/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/7/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/7/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/8/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/8/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/9/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/9/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/10/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/10/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/11/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/11/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/12/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/12/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/13/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/13/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/14/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/14/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/15/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/15/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/16/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/16/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/17/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/17/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/18/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/18/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/19/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/19/website)
[![Sponsor](https://opencollective.com/Joomla-Component-Builder/sponsor/20/avatar.svg)](https://opencollective.com/Joomla-Component-Builder/sponsor/20/website)

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage admin.css @subpackage admin.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage dashboard.css @subpackage dashboard.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.css @subpackage help_document.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_documents.css @subpackage help_documents.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.css @subpackage question_and_answer.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questions_and_answers.css @subpackage questions_and_answers.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage admin.js @subpackage admin.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage controller.php @subpackage controller.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage ajax.json.php @subpackage ajax.json.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage download.php @subpackage download.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help.php @subpackage help.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.php @subpackage help_document.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_documents.php @subpackage help_documents.php
@ -69,7 +69,7 @@ class QuestionsanswersControllerHelp_documents extends JControllerAdmin
$input = JFactory::getApplication()->input; $input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array'); $pks = $input->post->get('cid', array(), 'array');
// Sanitize the input // Sanitize the input
ArrayHelper::toInteger($pks); $pks = ArrayHelper::toInteger($pks);
// Get the model // Get the model
$model = $this->getModel('Help_documents'); $model = $this->getModel('Help_documents');
// get the data to export // get the data to export

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage import.php @subpackage import.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.php @subpackage question_and_answer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questions_and_answers.php @subpackage questions_and_answers.php
@ -69,7 +69,7 @@ class QuestionsanswersControllerQuestions_and_answers extends JControllerAdmin
$input = JFactory::getApplication()->input; $input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array'); $pks = $input->post->get('cid', array(), 'array');
// Sanitize the input // Sanitize the input
ArrayHelper::toInteger($pks); $pks = ArrayHelper::toInteger($pks);
// Get the model // Get the model
$model = $this->getModel('Questions_and_answers'); $model = $this->getModel('Questions_and_answers');
// get the data to export // get the data to export

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questionsanswers.php @subpackage questionsanswers.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage headercheck.php @subpackage headercheck.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage batch_.php @subpackage batch_.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questionsanswers.php @subpackage questionsanswers.php
@ -27,6 +27,7 @@
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Language\Language; use Joomla\CMS\Language\Language;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper; use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper; use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory; use PhpOffice\PhpSpreadsheet\IOFactory;
@ -470,9 +471,9 @@ abstract class QuestionsanswersHelper
/** /**
* Change to nice fancy date * Change to nice fancy date
*/ */
public static function fancyDate($date) public static function fancyDate($date, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($date)) if ($check_stamp && !self::isValidTimeStamp($date))
{ {
$date = strtotime($date); $date = strtotime($date);
} }
@ -482,9 +483,9 @@ abstract class QuestionsanswersHelper
/** /**
* get date based in period past * get date based in period past
*/ */
public static function fancyDynamicDate($date) public static function fancyDynamicDate($date, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($date)) if ($check_stamp && !self::isValidTimeStamp($date))
{ {
$date = strtotime($date); $date = strtotime($date);
} }
@ -508,9 +509,9 @@ abstract class QuestionsanswersHelper
/** /**
* Change to nice fancy day time and date * Change to nice fancy day time and date
*/ */
public static function fancyDayTimeDate($time) public static function fancyDayTimeDate($time, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($time)) if ($check_stamp && !self::isValidTimeStamp($time))
{ {
$time = strtotime($time); $time = strtotime($time);
} }
@ -520,9 +521,9 @@ abstract class QuestionsanswersHelper
/** /**
* Change to nice fancy time and date * Change to nice fancy time and date
*/ */
public static function fancyDateTime($time) public static function fancyDateTime($time, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($time)) if ($check_stamp && !self::isValidTimeStamp($time))
{ {
$time = strtotime($time); $time = strtotime($time);
} }
@ -532,9 +533,9 @@ abstract class QuestionsanswersHelper
/** /**
* Change to nice hour:minutes time * Change to nice hour:minutes time
*/ */
public static function fancyTime($time) public static function fancyTime($time, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($time)) if ($check_stamp && !self::isValidTimeStamp($time))
{ {
$time = strtotime($time); $time = strtotime($time);
} }
@ -544,9 +545,9 @@ abstract class QuestionsanswersHelper
/** /**
* set the date day as Sunday through Saturday * set the date day as Sunday through Saturday
*/ */
public static function setDayName($date) public static function setDayName($date, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($date)) if ($check_stamp && !self::isValidTimeStamp($date))
{ {
$date = strtotime($date); $date = strtotime($date);
} }
@ -556,9 +557,9 @@ abstract class QuestionsanswersHelper
/** /**
* set the date month as January through December * set the date month as January through December
*/ */
public static function setMonthName($date) public static function setMonthName($date, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($date)) if ($check_stamp && !self::isValidTimeStamp($date))
{ {
$date = strtotime($date); $date = strtotime($date);
} }
@ -568,9 +569,9 @@ abstract class QuestionsanswersHelper
/** /**
* set the date day as 1st * set the date day as 1st
*/ */
public static function setDay($date) public static function setDay($date, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($date)) if ($check_stamp && !self::isValidTimeStamp($date))
{ {
$date = strtotime($date); $date = strtotime($date);
} }
@ -580,9 +581,9 @@ abstract class QuestionsanswersHelper
/** /**
* set the date month as 5 * set the date month as 5
*/ */
public static function setMonth($date) public static function setMonth($date, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($date)) if ($check_stamp && !self::isValidTimeStamp($date))
{ {
$date = strtotime($date); $date = strtotime($date);
} }
@ -592,9 +593,9 @@ abstract class QuestionsanswersHelper
/** /**
* set the date year as 2004 (for charts) * set the date year as 2004 (for charts)
*/ */
public static function setYear($date) public static function setYear($date, $check_stamp = true)
{ {
if (!self::isValidTimeStamp($date)) if ($check_stamp && !self::isValidTimeStamp($date))
{ {
$date = strtotime($date); $date = strtotime($date);
} }
@ -604,9 +605,9 @@ abstract class QuestionsanswersHelper
/** /**
* set the date as 2004/05 (for charts) * set the date as 2004/05 (for charts)
*/ */
public static function setYearMonth($date, $spacer = '/') public static function setYearMonth($date, $spacer = '/', $check_stamp = true)
{ {
if (!self::isValidTimeStamp($date)) if ($check_stamp && !self::isValidTimeStamp($date))
{ {
$date = strtotime($date); $date = strtotime($date);
} }
@ -616,15 +617,27 @@ abstract class QuestionsanswersHelper
/** /**
* set the date as 2004/05/03 (for charts) * set the date as 2004/05/03 (for charts)
*/ */
public static function setYearMonthDay($date, $spacer = '/') public static function setYearMonthDay($date, $spacer = '/', $check_stamp = true)
{ {
if (!self::isValidTimeStamp($date)) if ($check_stamp && !self::isValidTimeStamp($date))
{ {
$date = strtotime($date); $date = strtotime($date);
} }
return date('Y' . $spacer . 'm' . $spacer . 'd', $date); return date('Y' . $spacer . 'm' . $spacer . 'd', $date);
} }
/**
* set the date as 03/05/2004
*/
public static function setDayMonthYear($date, $spacer = '/', $check_stamp = true)
{
if ($check_stamp && !self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
return date('d' . $spacer . 'm' . $spacer . 'Y', $date);
}
/** /**
* Check if string is a valid time stamp * Check if string is a valid time stamp
*/ */
@ -635,6 +648,16 @@ abstract class QuestionsanswersHelper
&& ($timestamp >= ~PHP_INT_MAX); && ($timestamp >= ~PHP_INT_MAX);
} }
/**
* Check if string is a valid date
* https://www.php.net/manual/en/function.checkdate.php#113205
*/
public static function isValidateDate($date, $format = 'Y-m-d H:i:s')
{
$d = DateTime::createFromFormat($format, $date);
return $d && $d->format($format) == $date;
}
/** /**
* prepare base64 string for url * prepare base64 string for url
@ -2259,6 +2282,8 @@ abstract class QuestionsanswersHelper
->setLastModifiedBy($modified) ->setLastModifiedBy($modified)
->setTitle($title) ->setTitle($title)
->setSubject($subjectTab); ->setSubject($subjectTab);
// The file type
$file_type = 'Xls';
// set description // set description
if ($description) if ($description)
{ {
@ -2298,21 +2323,46 @@ abstract class QuestionsanswersHelper
)); ));
// Add some data // Add some data
if (self::checkArray($rows)) if (($size = self::checkArray($rows)) !== false)
{ {
$i = 1; $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'; $a = 'A';
foreach ($array as $value){ foreach ($array as $value)
$spreadsheet->setActiveSheetIndex(0)->setCellValue($a.$i, $value); {
if ($i == 1){ $active_sheet->setCellValue($a.$i, $value);
$spreadsheet->getActiveSheet()->getColumnDimension($a)->setAutoSize(true); if ($xls_mode != 3)
$spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($headerStyles); {
$spreadsheet->getActiveSheet()->getStyle($a.$i)->getAlignment()->setHorizontal(PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER); if ($i == 1)
} elseif ($a === 'A'){ {
$spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($sideStyles); $active_sheet->getColumnDimension($a)->setAutoSize(true);
} else { $active_sheet->getStyle($a.$i)->applyFromArray($headerStyles);
$spreadsheet->getActiveSheet()->getStyle($a.$i)->applyFromArray($normalStyles); $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++; $a++;
} }
@ -2332,7 +2382,7 @@ abstract class QuestionsanswersHelper
// Redirect output to a client's web browser (Excel5) // Redirect output to a client's web browser (Excel5)
header('Content-Type: application/vnd.ms-excel'); header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="'.$fileName.'.xls"'); header('Content-Disposition: attachment;filename="' . $fileName . '.' . strtolower($file_type) .'"');
header('Cache-Control: max-age=0'); header('Cache-Control: max-age=0');
// If you're serving to IE 9, then the following may be needed // If you're serving to IE 9, then the following may be needed
header('Cache-Control: max-age=1'); header('Cache-Control: max-age=1');
@ -2343,7 +2393,7 @@ abstract class QuestionsanswersHelper
header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1 header ('Cache-Control: cache, must-revalidate'); // HTTP/1.1
header ('Pragma: public'); // HTTP/1.0 header ('Pragma: public'); // HTTP/1.0
$writer = IOFactory::createWriter($spreadsheet, 'Xls'); $writer = IOFactory::createWriter($spreadsheet, $file_type);
$writer->save('php://output'); $writer->save('php://output');
jexit(); jexit();
} }

View File

@ -122,6 +122,8 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_CHECKED_IN_1="%d Help Document succe
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_CHECKED_IN_MORE="%d Help Documents successfully checked in." COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_CHECKED_IN_MORE="%d Help Documents successfully checked in."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_DELETED="%s Help Documents deleted." COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_DELETED="%s Help Documents deleted."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_DELETED_1="%s Help Document deleted." COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_DELETED_1="%s Help Document deleted."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FAILED_PUBLISHING="%s Help Documents failed publishing."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FAILED_PUBLISHING_1="%s Help Document failed publishing."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FEATURED="%s Help Documents featured." COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FEATURED="%s Help Documents featured."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FEATURED_1="%s Help Document featured." COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_FEATURED_1="%s Help Document featured."
COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_PUBLISHED="%s Help Documents published." COM_QUESTIONSANSWERS_HELP_DOCUMENTS_N_ITEMS_PUBLISHED="%s Help Documents published."
@ -168,7 +170,6 @@ COM_QUESTIONSANSWERS_HELP_DOCUMENT_MODIFIED_DATE_LABEL="Modified Date"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_NEW="A New Help Document" COM_QUESTIONSANSWERS_HELP_DOCUMENT_NEW="A New Help Document"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_NOT_REQUIRED="Not Required" COM_QUESTIONSANSWERS_HELP_DOCUMENT_NOT_REQUIRED="Not Required"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_ORDERING_LABEL="Ordering" COM_QUESTIONSANSWERS_HELP_DOCUMENT_ORDERING_LABEL="Ordering"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_PERMISSION="Permissions"
COM_QUESTIONSANSWERS_HELP_DOCUMENT_PUBLISHING="Publishing" COM_QUESTIONSANSWERS_HELP_DOCUMENT_PUBLISHING="Publishing"
COM_QUESTIONSANSWERS_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_QUESTIONSANSWERS_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_QUESTIONSANSWERS_HELP_DOCUMENT_SELECT_AN_OPTION="Select an option" COM_QUESTIONSANSWERS_HELP_DOCUMENT_SELECT_AN_OPTION="Select an option"
@ -296,6 +297,8 @@ COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_CHECKED_IN_1="%d Question and
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_CHECKED_IN_MORE="%d Questions and Answers successfully checked in." COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_CHECKED_IN_MORE="%d Questions and Answers successfully checked in."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_DELETED="%s Questions and Answers deleted." COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_DELETED="%s Questions and Answers deleted."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_DELETED_1="%s Question and Answer deleted." COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_DELETED_1="%s Question and Answer deleted."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FAILED_PUBLISHING="%s Questions and Answers failed publishing."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FAILED_PUBLISHING_1="%s Question and Answer failed publishing."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FEATURED="%s Questions and Answers featured." COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FEATURED="%s Questions and Answers featured."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FEATURED_1="%s Question and Answer featured." COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_FEATURED_1="%s Question and Answer featured."
COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_PUBLISHED="%s Questions and Answers published." COM_QUESTIONSANSWERS_QUESTIONS_AND_ANSWERS_N_ITEMS_PUBLISHED="%s Questions and Answers published."

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage batchselection.php @subpackage batchselection.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_above.php @subpackage details_above.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_fullwidth.php @subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_left.php @subpackage details_left.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_right.php @subpackage details_right.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_under.php @subpackage details_under.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage publishing.php @subpackage publishing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage publlshing.php @subpackage publlshing.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_fullwidth.php @subpackage details_fullwidth.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_rightside.php @subpackage details_rightside.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage details_under.php @subpackage details_under.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage metadata.php @subpackage metadata.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage publishing.php @subpackage publishing.php
@ -40,6 +40,7 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1];
// get the fields // get the fields
$fields = $displayData->get($fields_tab_layout) ?: array( $fields = $displayData->get($fields_tab_layout) ?: array(
'title',
'created', 'created',
'created_by', 'created_by',
'modified', 'modified',

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage ajax.php @subpackage ajax.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage adminviewfolderlist.php @subpackage adminviewfolderlist.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage alloweddocumentformats.php @subpackage alloweddocumentformats.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage allowedimageformats.php @subpackage allowedimageformats.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage articles.php @subpackage articles.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage siteviewfolderlist.php @subpackage siteviewfolderlist.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.js @subpackage help_document.js

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.js @subpackage question_and_answer.js

View File

@ -102,6 +102,14 @@
rows="3" rows="3"
cols="30" cols="30"
/> />
<!-- Was added due to Permissions JS needing a Title field -->
<!-- Let us know at gh-629 should this change -->
<!-- https://github.com/vdm-io/Joomla-Component-Builder/issues/629#issuecomment-750117235 -->
<field
name="title"
type="hidden"
default="questionsanswers question_and_answer"
/>
<!-- Dynamic Fields. --> <!-- Dynamic Fields. -->
<!-- Question Field. Type: Textarea. (joomla) --> <!-- Question Field. Type: Textarea. (joomla) -->
<field <field

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.php @subpackage help_document.php
@ -429,7 +429,7 @@ class QuestionsanswersModelHelp_document extends JModelAdmin
public function validate($form, $data, $group = null) public function validate($form, $data, $group = null)
{ {
// check if the not_required field is set // check if the not_required field is set
if (QuestionsanswersHelper::checkString($data['not_required'])) if (isset($data['not_required']) && QuestionsanswersHelper::checkString($data['not_required']))
{ {
$requiredFields = (array) explode(',',(string) $data['not_required']); $requiredFields = (array) explode(',',(string) $data['not_required']);
$requiredFields = array_unique($requiredFields); $requiredFields = array_unique($requiredFields);

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_documents.php @subpackage help_documents.php
@ -43,11 +43,11 @@ class QuestionsanswersModelHelp_documents extends JModelList
'a.ordering','ordering', 'a.ordering','ordering',
'a.created_by','created_by', 'a.created_by','created_by',
'a.modified_by','modified_by', 'a.modified_by','modified_by',
'a.title','title',
'a.type','type', 'a.type','type',
'a.location','location', 'a.location','location',
'g.', 'a.admin_view','admin_view',
'h.' 'a.site_view','site_view',
'a.title','title'
); );
} }
@ -57,7 +57,13 @@ class QuestionsanswersModelHelp_documents extends JModelList
/** /**
* Method to auto-populate the model state. * 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 * @return void
*
*/ */
protected function populateState($ordering = null, $direction = null) protected function populateState($ordering = null, $direction = null)
{ {
@ -68,8 +74,24 @@ class QuestionsanswersModelHelp_documents extends JModelList
{ {
$this->context .= '.' . $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'); $type = $this->getUserStateFromRequest($this->context . '.filter.type', 'filter_type');
$this->setState('filter.type', $type); $this->setState('filter.type', $type);
@ -83,23 +105,8 @@ class QuestionsanswersModelHelp_documents extends JModelList
$site_view = $this->getUserStateFromRequest($this->context . '.filter.site_view', 'filter_site_view'); $site_view = $this->getUserStateFromRequest($this->context . '.filter.site_view', 'filter_site_view');
$this->setState('filter.site_view', $site_view); $this->setState('filter.site_view', $site_view);
$sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); $title = $this->getUserStateFromRequest($this->context . '.filter.title', 'filter_title');
$this->setState('filter.sorting', $sorting); $this->setState('filter.title', $title);
$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. // List state information.
parent::populateState($ordering, $direction); parent::populateState($ordering, $direction);
@ -250,29 +257,77 @@ class QuestionsanswersModelHelp_documents extends JModelList
} }
// Filter by Type. // 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 (QuestionsanswersHelper::checkString($_type))
{
$query->where('a.type = ' . $db->quote($db->escape($_type)));
} }
// Filter by Location. // 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);
} }
// Filter by admin_view. else
if ($admin_view = $this->getState('filter.admin_view'))
{ {
$query->where('a.admin_view = ' . $db->quote($db->escape($admin_view))); $query->where('a.location = ' . (int) $_location);
} }
// Filter by site_view. }
if ($site_view = $this->getState('filter.site_view')) elseif (QuestionsanswersHelper::checkString($_location))
{ {
$query->where('a.site_view = ' . $db->quote($db->escape($site_view))); $query->where('a.location = ' . $db->quote($db->escape($_location)));
}
// Filter by Admin_view.
$_admin_view = $this->getState('filter.admin_view');
if (is_numeric($_admin_view))
{
if (is_float($_admin_view))
{
$query->where('a.admin_view = ' . (float) $_admin_view);
}
else
{
$query->where('a.admin_view = ' . (int) $_admin_view);
}
}
elseif (QuestionsanswersHelper::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 (QuestionsanswersHelper::checkString($_site_view))
{
$query->where('a.site_view = ' . $db->quote($db->escape($_site_view)));
} }
// Add the list ordering clause. // Add the list ordering clause.
$orderCol = $this->state->get('list.ordering', 'a.id'); $orderCol = $this->state->get('list.ordering', 'a.id');
$orderDirn = $this->state->get('list.direction', 'asc'); $orderDirn = $this->state->get('list.direction', 'desc');
if ($orderCol != '') if ($orderCol != '')
{ {
$query->order($db->escape($orderCol . ' ' . $orderDirn)); $query->order($db->escape($orderCol . ' ' . $orderDirn));
@ -292,7 +347,7 @@ class QuestionsanswersModelHelp_documents extends JModelList
public function getExportData($pks, $user = null) public function getExportData($pks, $user = null)
{ {
// setup the query // setup the query
if (QuestionsanswersHelper::checkArray($pks)) if (($pks_size = QuestionsanswersHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{ {
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true; $_export = true;
@ -310,7 +365,24 @@ class QuestionsanswersModelHelp_documents extends JModelList
// From the questionsanswers_help_document table // From the questionsanswers_help_document table
$query->from($db->quoteName('#__questionsanswers_help_document', 'a')); $query->from($db->quoteName('#__questionsanswers_help_document', 'a'));
// 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) . ')'); $query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Order the results by ordering // Order the results by ordering
$query->order('a.ordering ASC'); $query->order('a.ordering ASC');
@ -395,11 +467,11 @@ class QuestionsanswersModelHelp_documents extends JModelList
$id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by'); $id .= ':' . $this->getState('filter.modified_by');
$id .= ':' . $this->getState('filter.title');
$id .= ':' . $this->getState('filter.type'); $id .= ':' . $this->getState('filter.type');
$id .= ':' . $this->getState('filter.location'); $id .= ':' . $this->getState('filter.location');
$id .= ':' . $this->getState('filter.admin_view'); $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); return parent::getStoreId($id);
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage import.php @subpackage import.php
@ -440,7 +440,15 @@ class QuestionsanswersModelImport extends JModelLegacy
$jinput = JFactory::getApplication()->input; $jinput = JFactory::getApplication()->input;
foreach($target_headers as $header) 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 // set the data
if(isset($package['dir'])) if(isset($package['dir']))

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.php @subpackage question_and_answer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questions_and_answers.php @subpackage questions_and_answers.php
@ -40,14 +40,15 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
$config['filter_fields'] = array( $config['filter_fields'] = array(
'a.id','id', 'a.id','id',
'a.published','published', 'a.published','published',
'a.access','access',
'a.ordering','ordering', 'a.ordering','ordering',
'a.created_by','created_by', 'a.created_by','created_by',
'a.modified_by','modified_by', 'a.modified_by','modified_by',
'a.question','question',
'a.answer','answer',
'c.title','category_title', 'c.title','category_title',
'c.id', 'category_id', 'c.id', 'category_id',
'a.catid', 'catid' 'a.catid','catid',
'a.question','question',
'a.answer','answer'
); );
} }
@ -57,7 +58,13 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
/** /**
* Method to auto-populate the model state. * 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 * @return void
*
*/ */
protected function populateState($ordering = null, $direction = null) protected function populateState($ordering = null, $direction = null)
{ {
@ -68,30 +75,10 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
{ {
$this->context .= '.' . $layout; $this->context .= '.' . $layout;
} }
$question = $this->getUserStateFromRequest($this->context . '.filter.question', 'filter_question');
$this->setState('filter.question', $question);
$answer = $this->getUserStateFromRequest($this->context . '.filter.answer', 'filter_answer');
$this->setState('filter.answer', $answer);
$category = $app->getUserStateFromRequest($this->context . '.filter.category', 'filter_category');
$this->setState('filter.category', $category);
$categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id');
$this->setState('filter.category_id', $categoryId);
$catid = $app->getUserStateFromRequest($this->context . '.filter.catid', 'filter_catid');
$this->setState('filter.catid', $catid);
$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'); $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int');
$this->setState('filter.access', $access); $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', ''); $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', '');
$this->setState('filter.published', $published); $this->setState('filter.published', $published);
@ -101,6 +88,27 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
$created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created');
$this->setState('filter.created', $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);
$category = $app->getUserStateFromRequest($this->context . '.filter.category', 'filter_category');
$this->setState('filter.category', $category);
$categoryId = $this->getUserStateFromRequest($this->context . '.filter.category_id', 'filter_category_id');
$this->setState('filter.category_id', $categoryId);
$catid = $this->getUserStateFromRequest($this->context . '.filter.catid', 'filter_catid');
$this->setState('filter.catid', $catid);
$question = $this->getUserStateFromRequest($this->context . '.filter.question', 'filter_question');
$this->setState('filter.question', $question);
$answer = $this->getUserStateFromRequest($this->context . '.filter.answer', 'filter_answer');
$this->setState('filter.answer', $answer);
// List state information. // List state information.
parent::populateState($ordering, $direction); parent::populateState($ordering, $direction);
} }
@ -179,9 +187,17 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
$query->select('ag.title AS access_level'); $query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
// Filter by access level. // 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 (QuestionsanswersHelper::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 // Implement View Level Access
if (!$user->authorise('core.options', 'com_questionsanswers')) if (!$user->authorise('core.options', 'com_questionsanswers'))
@ -221,9 +237,9 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
} }
elseif (is_array($categoryId)) elseif (is_array($categoryId))
{ {
ArrayHelper::toInteger($categoryId); $categoryId = ArrayHelper::toInteger($categoryId);
$categoryId = implode(',', $categoryId); $categoryId = implode(',', $categoryId);
$query->where('a.category IN (' . $categoryId . ')'); $query->where('a.catid IN (' . $categoryId . ')');
} }
@ -249,7 +265,7 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
public function getExportData($pks, $user = null) public function getExportData($pks, $user = null)
{ {
// setup the query // setup the query
if (QuestionsanswersHelper::checkArray($pks)) if (($pks_size = QuestionsanswersHelper::checkArray($pks)) !== false || 'bulk' === $pks)
{ {
// Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME) // Set a value to know this is export method. (USE IN CUSTOM CODE TO ALTER OUTCOME)
$_export = true; $_export = true;
@ -267,7 +283,24 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
// From the questionsanswers_question_and_answer table // From the questionsanswers_question_and_answer table
$query->from($db->quoteName('#__questionsanswers_question_and_answer', 'a')); $query->from($db->quoteName('#__questionsanswers_question_and_answer', 'a'));
// 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) . ')'); $query->where('a.id IN (' . implode(',',$pks) . ')');
}
// Implement View Level Access // Implement View Level Access
if (!$user->authorise('core.options', 'com_questionsanswers')) if (!$user->authorise('core.options', 'com_questionsanswers'))
{ {
@ -370,14 +403,15 @@ class QuestionsanswersModelQuestions_and_answers extends JModelList
$id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.id');
$id .= ':' . $this->getState('filter.search'); $id .= ':' . $this->getState('filter.search');
$id .= ':' . $this->getState('filter.published'); $id .= ':' . $this->getState('filter.published');
$id .= ':' . $this->getState('filter.access');
$id .= ':' . $this->getState('filter.ordering'); $id .= ':' . $this->getState('filter.ordering');
$id .= ':' . $this->getState('filter.created_by'); $id .= ':' . $this->getState('filter.created_by');
$id .= ':' . $this->getState('filter.modified_by'); $id .= ':' . $this->getState('filter.modified_by');
$id .= ':' . $this->getState('filter.question');
$id .= ':' . $this->getState('filter.answer');
$id .= ':' . $this->getState('filter.category'); $id .= ':' . $this->getState('filter.category');
$id .= ':' . $this->getState('filter.category_id'); $id .= ':' . $this->getState('filter.category_id');
$id .= ':' . $this->getState('filter.catid'); $id .= ':' . $this->getState('filter.catid');
$id .= ':' . $this->getState('filter.question');
$id .= ':' . $this->getState('filter.answer');
return parent::getStoreId($id); return parent::getStoreId($id);
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questionsanswers.php @subpackage questionsanswers.php
@ -39,7 +39,7 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
$icons = array(); $icons = array();
// view groups array // view groups array
$viewGroups = array( $viewGroups = array(
'main' => array('png.question_and_answer.add', 'png.questions_and_answers', 'png.questions_and_answers.catid', 'png.help_documents') 'main' => array('png.question_and_answer.add', 'png.questions_and_answers', 'png.questions_and_answers.catid_qpo0O0oqp_com_questionsanswers_po0O0oq_question_and_answer', 'png.help_documents')
); );
// view access array // view access array
$viewAccess = array( $viewAccess = array(
@ -103,9 +103,19 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
$add = true; $add = true;
break; break;
default: default:
$url = 'index.php?option=com_categories&view=categories&extension=com_questionsanswers.'.$name; // 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_questionsanswers.' . $name;
}
$url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
$image = $name . '_' . $action . '.' . $type; $image = $name . '_' . $action . '.' . $type;
$alt = $name.'&nbsp;'.$action; $alt = $viewName . '&nbsp;' . $action;
$name = 'COM_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($name,'U') . '_' . QuestionsanswersHelper::safeString($action,'U'); $name = 'COM_QUESTIONSANSWERS_DASHBOARD_' . QuestionsanswersHelper::safeString($name,'U') . '_' . QuestionsanswersHelper::safeString($action,'U');
break; break;
} }
@ -137,7 +147,7 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
$dashboard_list = false; $dashboard_list = false;
$accessTo = ''; $accessTo = '';
$accessAdd = ''; $accessAdd = '';
// acces checking start // access checking start
$accessCreate = (isset($viewAccess[$viewName.'.create'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.create']):false; $accessCreate = (isset($viewAccess[$viewName.'.create'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.create']):false;
$accessAccess = (isset($viewAccess[$viewName.'.access'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.access']):false; $accessAccess = (isset($viewAccess[$viewName.'.access'])) ? QuestionsanswersHelper::checkString($viewAccess[$viewName.'.access']):false;
// set main controllers // set main controllers
@ -152,7 +162,7 @@ class QuestionsanswersModelQuestionsanswers extends JModelList
{ {
$accessAdd = 'core.create'; $accessAdd = 'core.create';
} }
// check if acces to view is set // check if access to view is set
if ($accessAccess) if ($accessAccess)
{ {
$accessTo = $viewAccess[$viewName.'.access']; $accessTo = $viewAccess[$viewName.'.access'];

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questionsanswers.php @subpackage questionsanswers.php
@ -25,6 +25,7 @@
// No direct access to this file // No direct access to this file
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tabstate'); JHtml::_('behavior.tabstate');
// Access check. // Access check.

View File

@ -69,13 +69,3 @@ CREATE TABLE IF NOT EXISTS `#__questionsanswers_help_document` (
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci; ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;
--
-- 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.';

View File

@ -1,2 +1,3 @@
DROP TABLE IF EXISTS `#__questionsanswers_question_and_answer`; DROP TABLE IF EXISTS `#__questionsanswers_question_and_answer`;
DROP TABLE IF EXISTS `#__questionsanswers_help_document`; DROP TABLE IF EXISTS `#__questionsanswers_help_document`;

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help_document.php @subpackage help_document.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.php @subpackage question_and_answer.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage submitbutton.js @subpackage submitbutton.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage edit.php @subpackage edit.php
@ -83,7 +83,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'help_documentTab'; ?> <?php $this->tab_name = 'help_documentTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?> <?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->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')) : ?> <?php if ($this->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'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'help_documentTab', 'publishing', JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_PUBLISHING', true)); ?> <?php echo JHtml::_('bootstrap.addTab', 'help_documentTab', 'publishing', JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop"> <div class="row-fluid form-horizontal-desktop">
<div class="span6"> <div class="span6">
@ -96,25 +96,6 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php echo JHtml::_('bootstrap.endTab'); ?> <?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?> <?php endif; ?>
<?php if ($this->canDo->get('core.admin')) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'help_documentTab', 'permissions', JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_PERMISSION', true)); ?>
<div class="row-fluid form-horizontal-desktop">
<div class="span12">
<fieldset class="adminform">
<div class="adminformlist">
<?php foreach ($this->form->getFieldset('accesscontrol') as $field): ?>
<div>
<?php echo $field->label; echo $field->input;?>
</div>
<div class="clearfix"></div>
<?php endforeach; ?>
</div>
</fieldset>
</div>
</div>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?> <?php echo JHtml::_('bootstrap.endTabSet'); ?>
<div> <div>

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default.php @subpackage default.php
@ -26,18 +26,15 @@
// No direct access to this file // 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.tooltip');
JHtml::_('behavior.multiselect'); JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init'); JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', 'select'); JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder) if ($this->saveOrder)
{ {
$saveOrderingUrl = 'index.php?option=com_questionsanswers&task=help_documents.saveOrderAjax&tmpl=component'; $saveOrderingUrl = 'index.php?option=com_questionsanswers&task=help_documents.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); JHtml::_('sortablelist.sortable', 'help_documentList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
} }
?> ?>
<script type="text/javascript"> <script type="text/javascript">
Joomla.orderTable = function() Joomla.orderTable = function()

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_batch_body.php @subpackage default_batch_body.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_batch_footer.php @subpackage default_batch_footer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_body.php @subpackage default_body.php
@ -39,11 +39,8 @@ $edit = "index.php?option=com_questionsanswers&view=help_documents&task=help_doc
<td class="order nowrap center hidden-phone"> <td class="order nowrap center hidden-phone">
<?php if ($canDo->get('help_document.edit.state')): ?> <?php if ($canDo->get('help_document.edit.state')): ?>
<?php <?php
if ($this->saveOrder) $iconClass = '';
{ if (!$this->saveOrder)
$iconClass = ' inactive';
}
else
{ {
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_foot.php @subpackage default_foot.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_head.php @subpackage default_head.php
@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access');
<tr> <tr>
<?php if ($this->canEdit&& $this->canState): ?> <?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone"> <th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> <?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
</th> </th>
<th width="20" class="nowrap center"> <th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?> <?php echo JHtml::_('grid.checkall'); ?>

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_toolbar.php @subpackage default_toolbar.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php
@ -50,8 +50,8 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
$this->user = JFactory::getUser(); $this->user = JFactory::getUser();
// Add the list ordering clause. // Add the list ordering clause.
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
$this->listDirn = $this->escape($this->state->get('list.direction', 'asc')); $this->listDirn = $this->escape($this->state->get('list.direction', 'DESC'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value // set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance())); $this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions // get global action permissions
@ -168,6 +168,7 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
JToolBarHelper::preferences('com_questionsanswers'); JToolBarHelper::preferences('com_questionsanswers');
} }
// Only load publish filter if state change is allowed
if ($this->canState) if ($this->canState)
{ {
JHtmlSidebar::addFilter( JHtmlSidebar::addFilter(
@ -175,30 +176,6 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
'filter_published', 'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) 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_QUESTIONSANSWERS_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_QUESTIONSANSWERS_KEEP_ORIGINAL_ACCESS'),
'batch[access]',
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text')
);
} }
// Set Type Selection // Set Type Selection
@ -219,16 +196,6 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
'filter_type', 'filter_type',
JHtml::_('select.options', $this->typeOptions, 'value', 'text', $this->state->get('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_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE_LABEL').' -',
'batch[type]',
JHtml::_('select.options', $this->typeOptions, 'value', 'text')
);
}
} }
// Set Location Selection // Set Location Selection
@ -249,16 +216,6 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
'filter_location', 'filter_location',
JHtml::_('select.options', $this->locationOptions, 'value', 'text', $this->state->get('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_QUESTIONSANSWERS_HELP_DOCUMENT_LOCATION_LABEL').' -',
'batch[location]',
JHtml::_('select.options', $this->locationOptions, 'value', 'text')
);
}
} }
// Set Admin View Selection // Set Admin View Selection
@ -279,16 +236,6 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
'filter_admin_view', 'filter_admin_view',
JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text', $this->state->get('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_QUESTIONSANSWERS_HELP_DOCUMENT_ADMIN_VIEW_LABEL').' -',
'batch[admin_view]',
JHtml::_('select.options', $this->admin_viewOptions, 'value', 'text')
);
}
} }
// Set Site View Selection // Set Site View Selection
@ -309,7 +256,52 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
'filter_site_view', 'filter_site_view',
JHtml::_('select.options', $this->site_viewOptions, 'value', 'text', $this->state->get('filter.site_view')) JHtml::_('select.options', $this->site_viewOptions, 'value', 'text', $this->state->get('filter.site_view'))
); );
}
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_QUESTIONSANSWERS_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_QUESTIONSANSWERS_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_QUESTIONSANSWERS_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_QUESTIONSANSWERS_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) if ($this->canBatch && $this->canCreate && $this->canEdit)
{ {
// Site View Batch Selection // Site View Batch Selection
@ -320,7 +312,6 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
); );
} }
} }
}
/** /**
* Method to set up the document properties * Method to set up the document properties
@ -363,7 +354,7 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
protected function getSortFields() protected function getSortFields()
{ {
return array( return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'), 'a.published' => JText::_('JSTATUS'),
'a.title' => JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_TITLE_LABEL'), 'a.title' => JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_TITLE_LABEL'),
'a.type' => JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE_LABEL'), 'a.type' => JText::_('COM_QUESTIONSANSWERS_HELP_DOCUMENT_TYPE_LABEL'),
@ -391,13 +382,13 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
$db->setQuery($query); $db->setQuery($query);
$results = $db->loadColumn(); $results = $db->loadColumn();
$_filter = array();
if ($results) if ($results)
{ {
// get model // get model
$model = $this->getModel(); $model = $this->getModel();
$results = array_unique($results); $results = array_unique($results);
$_filter = array();
foreach ($results as $type) foreach ($results as $type)
{ {
// Translate the type selection // Translate the type selection
@ -405,9 +396,8 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
// Now add the type and its text to the options array // Now add the type and its text to the options array
$_filter[] = JHtml::_('select.option', $type, JText::_($text)); $_filter[] = JHtml::_('select.option', $type, JText::_($text));
} }
return $_filter;
} }
return false; return $_filter;
} }
protected function getTheLocationSelections() protected function getTheLocationSelections()
@ -427,13 +417,13 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
$db->setQuery($query); $db->setQuery($query);
$results = $db->loadColumn(); $results = $db->loadColumn();
$_filter = array();
if ($results) if ($results)
{ {
// get model // get model
$model = $this->getModel(); $model = $this->getModel();
$results = array_unique($results); $results = array_unique($results);
$_filter = array();
foreach ($results as $location) foreach ($results as $location)
{ {
// Translate the location selection // Translate the location selection
@ -441,8 +431,7 @@ class QuestionsanswersViewHelp_documents extends JViewLegacy
// Now add the location and its text to the options array // Now add the location and its text to the options array
$_filter[] = JHtml::_('select.option', $location, JText::_($text)); $_filter[] = JHtml::_('select.option', $location, JText::_($text));
} }
}
return $_filter; return $_filter;
} }
return false;
}
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default.php @subpackage default.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage submitbutton.js @subpackage submitbutton.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage edit.php @subpackage edit.php
@ -77,7 +77,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
<?php $this->tab_name = 'question_and_answerTab'; ?> <?php $this->tab_name = 'question_and_answerTab'; ?>
<?php echo JLayoutHelper::render('joomla.edit.params', $this); ?> <?php echo JLayoutHelper::render('joomla.edit.params', $this); ?>
<?php if ($this->canDo->get('question_and_answer.delete') || $this->canDo->get('question_and_answer.edit.created_by') || $this->canDo->get('question_and_answer.edit.state') || $this->canDo->get('question_and_answer.edit.created')) : ?> <?php if ($this->canDo->get('question_and_answer.edit.created_by') || $this->canDo->get('question_and_answer.edit.created') || $this->canDo->get('question_and_answer.edit.state') || ($this->canDo->get('question_and_answer.delete') && $this->canDo->get('question_and_answer.edit.state'))) : ?>
<?php echo JHtml::_('bootstrap.addTab', 'question_and_answerTab', 'publishing', JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_PUBLISHING', true)); ?> <?php echo JHtml::_('bootstrap.addTab', 'question_and_answerTab', 'publishing', JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_PUBLISHING', true)); ?>
<div class="row-fluid form-horizontal-desktop"> <div class="row-fluid form-horizontal-desktop">
<div class="span6"> <div class="span6">
@ -422,7 +422,7 @@ function JRouter(link) {
function getFile(filename, fileFormat, target, type){ function getFile(filename, fileFormat, target, type){
// set uikit version // set uikit version
var uiVer = <?php echo (int) $this->params->get('uikit_version', 2); ?>; var uiVer = <?php echo (int) $this->params->get('uikit_version', 3); ?>;
// set the link // set the link
var link = '<?php echo QuestionsanswersHelper::getFolderPath('url'); ?>'; var link = '<?php echo QuestionsanswersHelper::getFolderPath('url'); ?>';
// build the return // build the return
@ -486,7 +486,7 @@ function getFile(filename, fileFormat, target, type){
var theplaceholder = '<div class="uk-width-1-1"><div class="uk-panel uk-panel-box"><center><code>[DOCLINK='+fileName+']</code> <?php echo JText::_('COM_QUESTIONSANSWERS_OR'); ?> <code>[DOCBUTTON='+fileName+']</code><br /><?php echo JText::_('COM_QUESTIONSANSWERS_ADD_ONE_OF_THESE_PLACEHOLDERS_IN_TEXT_FOR_CUSTOM_DOWNLOAD_PLACEMENT'); ?>.</center></div></div>'; var theplaceholder = '<div class="uk-width-1-1"><div class="uk-panel uk-panel-box"><center><code>[DOCLINK='+fileName+']</code> <?php echo JText::_('COM_QUESTIONSANSWERS_OR'); ?> <code>[DOCBUTTON='+fileName+']</code><br /><?php echo JText::_('COM_QUESTIONSANSWERS_ADD_ONE_OF_THESE_PLACEHOLDERS_IN_TEXT_FOR_CUSTOM_DOWNLOAD_PLACEMENT'); ?>.</center></div></div>';
// get the download link if set // get the download link if set
var thedownload = ''; var thedownload = '';
if (documentsLinks.hasOwnProperty(item)) { if (typeof documentsLinks !== 'undefined' && documentsLinks.hasOwnProperty(item)) {
thedownload = '<a href="'+JRouter(documentsLinks[item])+'" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-success"><i class="uk-icon-download"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_DOWNLOAD'); ?> '+fileName+'</a>'; thedownload = '<a href="'+JRouter(documentsLinks[item])+'" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-success"><i class="uk-icon-download"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_DOWNLOAD'); ?> '+fileName+'</a>';
} }
var thedelete = '<button onclick="removeFileCheck(\''+item+'\', \''+target+'\', \''+type+'\', \''+uiVer+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+fileName+'</button>'; var thedelete = '<button onclick="removeFileCheck(\''+item+'\', \''+target+'\', \''+type+'\', \''+uiVer+'\')" type="button" class="uk-button uk-width-1-1 uk-button-small uk-margin-small-bottom uk-button-danger"><i class="uk-icon-trash"></i> <?php echo JText::_('COM_QUESTIONSANSWERS_REMOVE'); ?> '+fileName+'</button>';

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default.php @subpackage default.php
@ -26,18 +26,15 @@
// No direct access to this file // 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.tooltip');
JHtml::_('behavior.multiselect'); JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init'); JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', 'select'); JHtml::_('formbehavior.chosen', 'select');
if ($this->saveOrder) if ($this->saveOrder)
{ {
$saveOrderingUrl = 'index.php?option=com_questionsanswers&task=questions_and_answers.saveOrderAjax&tmpl=component'; $saveOrderingUrl = 'index.php?option=com_questionsanswers&task=questions_and_answers.saveOrderAjax&tmpl=component';
JHtml::_('sortablelist.sortable', 'question_and_answerList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); JHtml::_('sortablelist.sortable', 'question_and_answerList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl);
} }
?> ?>
<script type="text/javascript"> <script type="text/javascript">
Joomla.orderTable = function() Joomla.orderTable = function()

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_batch_body.php @subpackage default_batch_body.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_batch_footer.php @subpackage default_batch_footer.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_body.php @subpackage default_body.php
@ -39,11 +39,8 @@ $edit = "index.php?option=com_questionsanswers&view=questions_and_answers&task=q
<td class="order nowrap center hidden-phone"> <td class="order nowrap center hidden-phone">
<?php if ($canDo->get('question_and_answer.edit.state')): ?> <?php if ($canDo->get('question_and_answer.edit.state')): ?>
<?php <?php
if ($this->saveOrder) $iconClass = '';
{ if (!$this->saveOrder)
$iconClass = ' inactive';
}
else
{ {
$iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED');
} }

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_foot.php @subpackage default_foot.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_head.php @subpackage default_head.php
@ -30,7 +30,7 @@ defined('_JEXEC') or die('Restricted access');
<tr> <tr>
<?php if ($this->canEdit&& $this->canState): ?> <?php if ($this->canEdit&& $this->canState): ?>
<th width="1%" class="nowrap center hidden-phone"> <th width="1%" class="nowrap center hidden-phone">
<?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> <?php echo JHtml::_('grid.sort', '<i class="icon-menu-2"></i>', 'a.ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?>
</th> </th>
<th width="20" class="nowrap center"> <th width="20" class="nowrap center">
<?php echo JHtml::_('grid.checkall'); ?> <?php echo JHtml::_('grid.checkall'); ?>

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_toolbar.php @subpackage default_toolbar.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php
@ -51,7 +51,7 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
// Add the list ordering clause. // Add the list ordering clause.
$this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id')); $this->listOrder = $this->escape($this->state->get('list.ordering', 'a.id'));
$this->listDirn = $this->escape($this->state->get('list.direction', 'desc')); $this->listDirn = $this->escape($this->state->get('list.direction', 'desc'));
$this->saveOrder = $this->listOrder == 'ordering'; $this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value // set the return here value
$this->return_here = urlencode(base64_encode((string) JUri::getInstance())); $this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
// get global action permissions // get global action permissions
@ -168,6 +168,7 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
JToolBarHelper::preferences('com_questionsanswers'); JToolBarHelper::preferences('com_questionsanswers');
} }
// Only load publish filter if state change is allowed
if ($this->canState) if ($this->canState)
{ {
JHtmlSidebar::addFilter( JHtmlSidebar::addFilter(
@ -175,15 +176,6 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
'filter_published', 'filter_published',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) 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_QUESTIONSANSWERS_KEEP_ORIGINAL_STATE'),
'batch[published]',
JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true)
);
}
} }
JHtmlSidebar::addFilter( JHtmlSidebar::addFilter(
@ -192,6 +184,24 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
); );
// Category Filter.
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_CATEGORY'),
'filter_category_id',
JHtml::_('select.options', JHtml::_('category.options', 'com_questionsanswers.question_and_answer'), 'value', 'text', $this->state->get('filter.category_id'))
);
// Only load published batch if state and batch is allowed
if ($this->canState && $this->canBatch)
{
JHtmlBatch_::addListSelection(
JText::_('COM_QUESTIONSANSWERS_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) if ($this->canBatch && $this->canCreate && $this->canEdit)
{ {
JHtmlBatch_::addListSelection( JHtmlBatch_::addListSelection(
@ -201,13 +211,6 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
); );
} }
// Category Filter.
JHtmlSidebar::addFilter(
JText::_('JOPTION_SELECT_CATEGORY'),
'filter_category_id',
JHtml::_('select.options', JHtml::_('category.options', 'com_questionsanswers.question_and_answer'), 'value', 'text', $this->state->get('filter.category_id'))
);
if ($this->canBatch && $this->canCreate && $this->canEdit) if ($this->canBatch && $this->canCreate && $this->canEdit)
{ {
// Category Batch selection. // Category Batch selection.
@ -260,7 +263,7 @@ class QuestionsanswersViewQuestions_and_answers extends JViewLegacy
protected function getSortFields() protected function getSortFields()
{ {
return array( return array(
'ordering' => JText::_('JGRID_HEADING_ORDERING'), 'a.ordering' => JText::_('JGRID_HEADING_ORDERING'),
'a.published' => JText::_('JSTATUS'), 'a.published' => JText::_('JSTATUS'),
'a.question' => JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_QUESTION_LABEL'), 'a.question' => JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_QUESTION_LABEL'),
'a.answer' => JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_LABEL'), 'a.answer' => JText::_('COM_QUESTIONSANSWERS_QUESTION_AND_ANSWER_ANSWER_LABEL'),

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default.php @subpackage default.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_main.php @subpackage default_main.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_readme_information.php @subpackage default_readme_information.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_vast_development_method_notice_board.php @subpackage default_vast_development_method_notice_board.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage default_vdm.php @subpackage default_vdm.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage view.html.php @subpackage view.html.php

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage A4.print.css @subpackage A4.print.css

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_QUESTIONSANSWERS</name> <name>COM_QUESTIONSANSWERS</name>
<creationDate>30th May, 2020</creationDate> <creationDate>6th January, 2021</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail> <authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl> <authorUrl>https://www.vdm.io/</authorUrl>

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage script.php @subpackage script.php
@ -89,7 +89,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_done = $db->execute(); $question_and_answer_done = $db->execute();
if ($question_and_answer_done) if ($question_and_answer_done)
{ {
// If succesfully remove Question_and_answer add queued success message. // If successfully remove Question_and_answer add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__content_type</b> table')); $app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__content_type</b> table'));
} }
@ -104,7 +104,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_done = $db->execute(); $question_and_answer_done = $db->execute();
if ($question_and_answer_done) if ($question_and_answer_done)
{ {
// If succesfully remove Question_and_answer add queued success message. // If successfully remove Question_and_answer add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__contentitem_tag_map</b> table')); $app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
} }
@ -119,7 +119,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_done = $db->execute(); $question_and_answer_done = $db->execute();
if ($question_and_answer_done) if ($question_and_answer_done)
{ {
// If succesfully remove Question_and_answer add queued success message. // If successfully removed Question_and_answer add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__ucm_content</b> table')); $app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer) type alias was removed from the <b>#__ucm_content</b> table'));
} }
@ -175,7 +175,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_catid_done = $db->execute(); $question_and_answer_catid_done = $db->execute();
if ($question_and_answer_catid_done) if ($question_and_answer_catid_done)
{ {
// If succesfully remove Question_and_answer catid add queued success message. // If successfully remove Question_and_answer catid add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer.category) type alias was removed from the <b>#__content_type</b> table')); $app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer.category) type alias was removed from the <b>#__content_type</b> table'));
} }
@ -190,7 +190,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_catid_done = $db->execute(); $question_and_answer_catid_done = $db->execute();
if ($question_and_answer_catid_done) if ($question_and_answer_catid_done)
{ {
// If succesfully remove Question_and_answer catid add queued success message. // If successfully remove Question_and_answer catid add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer.category) type alias was removed from the <b>#__contentitem_tag_map</b> table')); $app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer.category) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
} }
@ -205,7 +205,7 @@ class com_questionsanswersInstallerScript
$question_and_answer_catid_done = $db->execute(); $question_and_answer_catid_done = $db->execute();
if ($question_and_answer_catid_done) if ($question_and_answer_catid_done)
{ {
// If succesfully remove Question_and_answer catid add queued success message. // If successfully removed Question_and_answer catid add queued success message.
$app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer.category) type alias was removed from the <b>#__ucm_content</b> table')); $app->enqueueMessage(JText::_('The (com_questionsanswers.question_and_answer.category) type alias was removed from the <b>#__ucm_content</b> table'));
} }
@ -261,7 +261,7 @@ class com_questionsanswersInstallerScript
$help_document_done = $db->execute(); $help_document_done = $db->execute();
if ($help_document_done) 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_questionsanswers.help_document) type alias was removed from the <b>#__content_type</b> table')); $app->enqueueMessage(JText::_('The (com_questionsanswers.help_document) type alias was removed from the <b>#__content_type</b> table'));
} }
@ -276,7 +276,7 @@ class com_questionsanswersInstallerScript
$help_document_done = $db->execute(); $help_document_done = $db->execute();
if ($help_document_done) 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_questionsanswers.help_document) type alias was removed from the <b>#__contentitem_tag_map</b> table')); $app->enqueueMessage(JText::_('The (com_questionsanswers.help_document) type alias was removed from the <b>#__contentitem_tag_map</b> table'));
} }
@ -291,7 +291,7 @@ class com_questionsanswersInstallerScript
$help_document_done = $db->execute(); $help_document_done = $db->execute();
if ($help_document_done) 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_questionsanswers.help_document) type alias was removed from the <b>#__ucm_content</b> table')); $app->enqueueMessage(JText::_('The (com_questionsanswers.help_document) type alias was removed from the <b>#__ucm_content</b> table'));
} }
@ -335,10 +335,31 @@ class com_questionsanswersInstallerScript
$help_document_done = $db->execute(); $help_document_done = $db->execute();
if ($help_document_done) if ($help_document_done)
{ {
// If succesfully remove questionsanswers add queued success message. // If successfully removed questionsanswers add queued success message.
$app->enqueueMessage(JText::_('All related items was removed from the <b>#__assets</b> table')); $app->enqueueMessage(JText::_('All related items was removed from the <b>#__assets</b> 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 <b>#__assets</b> table rules column back to its default size of varchar(5120)'));
}
else
{
$app->enqueueMessage(JText::_('Could not revert the <b>#__assets</b> 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. // Set db if not set already.
if (!isset($db)) if (!isset($db))
@ -602,9 +623,9 @@ class com_questionsanswersInstallerScript
$help_document->type_title = 'Questionsanswers Help_document'; $help_document->type_title = 'Questionsanswers Help_document';
$help_document->type_alias = 'com_questionsanswers.help_document'; $help_document->type_alias = 'com_questionsanswers.help_document';
$help_document->table = '{"special": {"dbtable": "#__questionsanswers_help_document","key": "id","type": "Help_document","prefix": "questionsanswersTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $help_document->table = '{"special": {"dbtable": "#__questionsanswers_help_document","key": "id","type": "Help_document","prefix": "questionsanswersTable","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 = 'QuestionsanswersHelperRoute::getHelp_documentRoute'; $help_document->router = 'QuestionsanswersHelperRoute::getHelp_documentRoute';
$help_document->content_history_options = '{"formFile": "administrator/components/com_questionsanswers/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_questionsanswers/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. // Set the object into the content types table.
$help_document_Inserted = $db->insertObject('#__content_types', $help_document); $help_document_Inserted = $db->insertObject('#__content_types', $help_document);
@ -624,6 +645,22 @@ class com_questionsanswersInstallerScript
$db->setQuery($query); $db->setQuery($query);
$allDone = $db->execute(); $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 <= 7520)
{
// 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 <b>#__assets</b> table rules column was resized to the TEXT datatype for the components possible large permission rules.'));
}
}
echo '<a target="_blank" href="https://www.vdm.io/" title="Questions and Answers"> echo '<a target="_blank" href="https://www.vdm.io/" title="Questions and Answers">
<img src="components/com_questionsanswers/assets/images/vdm-component.jpg"/> <img src="components/com_questionsanswers/assets/images/vdm-component.jpg"/>
</a>'; </a>';
@ -744,9 +781,9 @@ class com_questionsanswersInstallerScript
$help_document->type_title = 'Questionsanswers Help_document'; $help_document->type_title = 'Questionsanswers Help_document';
$help_document->type_alias = 'com_questionsanswers.help_document'; $help_document->type_alias = 'com_questionsanswers.help_document';
$help_document->table = '{"special": {"dbtable": "#__questionsanswers_help_document","key": "id","type": "Help_document","prefix": "questionsanswersTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; $help_document->table = '{"special": {"dbtable": "#__questionsanswers_help_document","key": "id","type": "Help_document","prefix": "questionsanswersTable","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 = 'QuestionsanswersHelperRoute::getHelp_documentRoute'; $help_document->router = 'QuestionsanswersHelperRoute::getHelp_documentRoute';
$help_document->content_history_options = '{"formFile": "administrator/components/com_questionsanswers/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_questionsanswers/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. // Check if help_document type is already in content_type DB.
$help_document_id = null; $help_document_id = null;

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage category.css @subpackage category.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage downloads.css @subpackage downloads.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.css @subpackage question_and_answer.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage questions_and_answers.css @subpackage questions_and_answers.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage site.css @subpackage site.css

View File

@ -10,7 +10,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage site.js @subpackage site.js

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage controller.php @subpackage controller.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage ajax.json.php @subpackage ajax.json.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage download.php @subpackage download.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage help.php @subpackage help.php

View File

@ -11,7 +11,7 @@
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 1.0.x @version 1.0.x
@build 30th May, 2020 @build 6th January, 2021
@created 30th January, 2017 @created 30th January, 2017
@package Questions and Answers @package Questions and Answers
@subpackage question_and_answer.php @subpackage question_and_answer.php

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