From fc41ba85d8c3b44fe168152ae68c64e46eeeffbf Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Fri, 13 Oct 2017 01:39:04 +0200 Subject: [PATCH] Fixed the dynamicGet ajax to now get field values from the new admin_fields table --- README.md | 2 +- admin/README.txt | 2 +- admin/assets/css/dynamic_get.css | 4 +-- admin/assets/css/dynamic_gets.css | 4 +-- admin/controllers/dynamic_get.php | 4 +-- admin/controllers/dynamic_gets.php | 4 +-- admin/models/ajax.php | 30 +++++++------------ admin/models/dynamic_get.php | 4 +-- admin/models/dynamic_gets.php | 4 +-- admin/models/forms/dynamic_get.js | 4 +-- admin/tables/dynamic_get.php | 4 +-- admin/views/dynamic_get/submitbutton.js | 4 +-- admin/views/dynamic_get/tmpl/edit.php | 4 +-- admin/views/dynamic_get/view.html.php | 4 +-- admin/views/dynamic_gets/tmpl/default.php | 4 +-- .../dynamic_gets/tmpl/default_batch_body.php | 4 +-- .../tmpl/default_batch_footer.php | 4 +-- .../views/dynamic_gets/tmpl/default_body.php | 4 +-- .../views/dynamic_gets/tmpl/default_foot.php | 4 +-- .../views/dynamic_gets/tmpl/default_head.php | 4 +-- .../dynamic_gets/tmpl/default_toolbar.php | 4 +-- admin/views/dynamic_gets/view.html.php | 4 +-- 22 files changed, 50 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index b2a3eebf0..ae54c6516 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ Component Builder is mapped as a component in itself on my local development env + *Version*: 2.5.8 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **123443** ++ *Line count*: **123433** + *File count*: **740** + *Folder count*: **129** diff --git a/admin/README.txt b/admin/README.txt index b2a3eebf0..ae54c6516 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -114,7 +114,7 @@ Component Builder is mapped as a component in itself on my local development env + *Version*: 2.5.8 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **123443** ++ *Line count*: **123433** + *File count*: **740** + *Folder count*: **129** diff --git a/admin/assets/css/dynamic_get.css b/admin/assets/css/dynamic_get.css index 2260ffd14..e0e69cc8f 100644 --- a/admin/assets/css/dynamic_get.css +++ b/admin/assets/css/dynamic_get.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage dynamic_get.css diff --git a/admin/assets/css/dynamic_gets.css b/admin/assets/css/dynamic_gets.css index 0381d4f66..90aa92346 100644 --- a/admin/assets/css/dynamic_gets.css +++ b/admin/assets/css/dynamic_gets.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage dynamic_gets.css diff --git a/admin/controllers/dynamic_get.php b/admin/controllers/dynamic_get.php index 2a87602d1..6189df66a 100644 --- a/admin/controllers/dynamic_get.php +++ b/admin/controllers/dynamic_get.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage dynamic_get.php diff --git a/admin/controllers/dynamic_gets.php b/admin/controllers/dynamic_gets.php index 96a4bc7ff..d6f1725cb 100644 --- a/admin/controllers/dynamic_gets.php +++ b/admin/controllers/dynamic_gets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage dynamic_gets.php diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 1783571a6..b58ba619f 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -499,17 +499,18 @@ class ComponentbuilderModelAjax extends JModelList } // Used in dynamic_get - public function getViewTableColumns($id, $as, $type) + public function getViewTableColumns($admin_view, $as, $type) { // Get a db connection. $db = JFactory::getDbo(); // Create a new query object. $query = $db->getQuery(true); - $query->select($db->quoteName(array('addfields', 'name_single'))); - $query->from($db->quoteName('#__componentbuilder_admin_view')); - $query->where($db->quoteName('published') . ' = 1'); - $query->where($db->quoteName('id') . ' = '. $id); + $query->select($db->quoteName(array('a.addfields', 'b.name_single'))); + $query->from($db->quoteName('#__componentbuilder_admin_fields', 'a')); + $query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'b') . ' ON (' . $db->quoteName('a.admin_view') . ' = ' . $db->quoteName('b.id') . ')'); + $query->where($db->quoteName('b.published') . ' = 1'); + $query->where($db->quoteName('a.admin_view') . ' = '. (int) $admin_view); // Reset the query using our newly populated query object. $db->setQuery($query); @@ -854,7 +855,7 @@ class ComponentbuilderModelAjax extends JModelList return false; } - protected function setListMethodName($names,$table,$as,$type) + protected function setListMethodName($names, $table, $as, $type) { $methodNames = array(); if (ComponentbuilderHelper::checkArray($names)) @@ -901,21 +902,10 @@ class ComponentbuilderModelAjax extends JModelList protected function getViewName($id) { - // Get a db connection. - $db = JFactory::getDbo(); - - // Create a new query object. - $query = $db->getQuery(true); - $query->select($db->quoteName(array('name_single'))); - $query->from($db->quoteName('#__componentbuilder_admin_view')); - $query->where($db->quoteName('id') . ' = '. (int) $id); - - // Reset the query using our newly populated query object. - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) + // Get the view name + if ($name = ComponentbuilderHelper::getVar('admin_view', (int) $id, 'id', 'name_single')) { - return $db->loadResult(); + return $name; } return ''; } diff --git a/admin/models/dynamic_get.php b/admin/models/dynamic_get.php index f2adfb57a..0f8403f14 100644 --- a/admin/models/dynamic_get.php +++ b/admin/models/dynamic_get.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage dynamic_get.php diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php index fe86b820f..9cef64809 100644 --- a/admin/models/dynamic_gets.php +++ b/admin/models/dynamic_gets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage dynamic_gets.php diff --git a/admin/models/forms/dynamic_get.js b/admin/models/forms/dynamic_get.js index d47fc369e..518d54d1a 100644 --- a/admin/models/forms/dynamic_get.js +++ b/admin/models/forms/dynamic_get.js @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage dynamic_get.js diff --git a/admin/tables/dynamic_get.php b/admin/tables/dynamic_get.php index 978914a83..6fe77d5fd 100644 --- a/admin/tables/dynamic_get.php +++ b/admin/tables/dynamic_get.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage dynamic_get.php diff --git a/admin/views/dynamic_get/submitbutton.js b/admin/views/dynamic_get/submitbutton.js index 6987e0888..1f5ef61de 100644 --- a/admin/views/dynamic_get/submitbutton.js +++ b/admin/views/dynamic_get/submitbutton.js @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage submitbutton.js diff --git a/admin/views/dynamic_get/tmpl/edit.php b/admin/views/dynamic_get/tmpl/edit.php index f5381d8d1..0584172a1 100644 --- a/admin/views/dynamic_get/tmpl/edit.php +++ b/admin/views/dynamic_get/tmpl/edit.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage edit.php diff --git a/admin/views/dynamic_get/view.html.php b/admin/views/dynamic_get/view.html.php index 0c2cbfbf5..db0e8d87b 100644 --- a/admin/views/dynamic_get/view.html.php +++ b/admin/views/dynamic_get/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage view.html.php diff --git a/admin/views/dynamic_gets/tmpl/default.php b/admin/views/dynamic_gets/tmpl/default.php index 535abf34b..60f659741 100644 --- a/admin/views/dynamic_gets/tmpl/default.php +++ b/admin/views/dynamic_gets/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage default.php diff --git a/admin/views/dynamic_gets/tmpl/default_batch_body.php b/admin/views/dynamic_gets/tmpl/default_batch_body.php index a99d39033..0f29180ff 100644 --- a/admin/views/dynamic_gets/tmpl/default_batch_body.php +++ b/admin/views/dynamic_gets/tmpl/default_batch_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage default_batch_body.php diff --git a/admin/views/dynamic_gets/tmpl/default_batch_footer.php b/admin/views/dynamic_gets/tmpl/default_batch_footer.php index 68ef17d1d..039cf167c 100644 --- a/admin/views/dynamic_gets/tmpl/default_batch_footer.php +++ b/admin/views/dynamic_gets/tmpl/default_batch_footer.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage default_batch_footer.php diff --git a/admin/views/dynamic_gets/tmpl/default_body.php b/admin/views/dynamic_gets/tmpl/default_body.php index 55ab12f38..bef9e6c3d 100644 --- a/admin/views/dynamic_gets/tmpl/default_body.php +++ b/admin/views/dynamic_gets/tmpl/default_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage default_body.php diff --git a/admin/views/dynamic_gets/tmpl/default_foot.php b/admin/views/dynamic_gets/tmpl/default_foot.php index 9bc65a6db..8b4593900 100644 --- a/admin/views/dynamic_gets/tmpl/default_foot.php +++ b/admin/views/dynamic_gets/tmpl/default_foot.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage default_foot.php diff --git a/admin/views/dynamic_gets/tmpl/default_head.php b/admin/views/dynamic_gets/tmpl/default_head.php index d09ed094a..d30f1a7c7 100644 --- a/admin/views/dynamic_gets/tmpl/default_head.php +++ b/admin/views/dynamic_gets/tmpl/default_head.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage default_head.php diff --git a/admin/views/dynamic_gets/tmpl/default_toolbar.php b/admin/views/dynamic_gets/tmpl/default_toolbar.php index 084c078a6..0e30a2b12 100644 --- a/admin/views/dynamic_gets/tmpl/default_toolbar.php +++ b/admin/views/dynamic_gets/tmpl/default_toolbar.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage default_toolbar.php diff --git a/admin/views/dynamic_gets/view.html.php b/admin/views/dynamic_gets/view.html.php index 80b63e3eb..248ffb940 100644 --- a/admin/views/dynamic_gets/view.html.php +++ b/admin/views/dynamic_gets/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 95 of this MVC - @build 10th October, 2017 + @version @update number 97 of this MVC + @build 12th October, 2017 @created 21st May, 2015 @package Component Builder @subpackage view.html.php