Fixed the dynamicGet ajax to now get field values from the new admin_fields table

This commit is contained in:
Llewellyn van der Merwe 2017-10-13 01:39:04 +02:00
parent 35482416cb
commit fc41ba85d8
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
22 changed files with 50 additions and 60 deletions

View File

@ -114,7 +114,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.5.8 + *Version*: 2.5.8
+ *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
+ *Line count*: **123443** + *Line count*: **123433**
+ *File count*: **740** + *File count*: **740**
+ *Folder count*: **129** + *Folder count*: **129**

View File

@ -114,7 +114,7 @@ Component Builder is mapped as a component in itself on my local development env
+ *Version*: 2.5.8 + *Version*: 2.5.8
+ *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
+ *Line count*: **123443** + *Line count*: **123433**
+ *File count*: **740** + *File count*: **740**
+ *Folder count*: **129** + *Folder count*: **129**

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_get.css @subpackage dynamic_get.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_gets.css @subpackage dynamic_gets.css

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_get.php @subpackage dynamic_get.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_gets.php @subpackage dynamic_gets.php

View File

@ -499,17 +499,18 @@ class ComponentbuilderModelAjax extends JModelList
} }
// Used in dynamic_get // Used in dynamic_get
public function getViewTableColumns($id, $as, $type) public function getViewTableColumns($admin_view, $as, $type)
{ {
// Get a db connection. // Get a db connection.
$db = JFactory::getDbo(); $db = JFactory::getDbo();
// Create a new query object. // Create a new query object.
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select($db->quoteName(array('addfields', 'name_single'))); $query->select($db->quoteName(array('a.addfields', 'b.name_single')));
$query->from($db->quoteName('#__componentbuilder_admin_view')); $query->from($db->quoteName('#__componentbuilder_admin_fields', 'a'));
$query->where($db->quoteName('published') . ' = 1'); $query->join('LEFT', $db->quoteName('#__componentbuilder_admin_view', 'b') . ' ON (' . $db->quoteName('a.admin_view') . ' = ' . $db->quoteName('b.id') . ')');
$query->where($db->quoteName('id') . ' = '. $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. // Reset the query using our newly populated query object.
$db->setQuery($query); $db->setQuery($query);
@ -854,7 +855,7 @@ class ComponentbuilderModelAjax extends JModelList
return false; return false;
} }
protected function setListMethodName($names,$table,$as,$type) protected function setListMethodName($names, $table, $as, $type)
{ {
$methodNames = array(); $methodNames = array();
if (ComponentbuilderHelper::checkArray($names)) if (ComponentbuilderHelper::checkArray($names))
@ -901,21 +902,10 @@ class ComponentbuilderModelAjax extends JModelList
protected function getViewName($id) protected function getViewName($id)
{ {
// Get a db connection. // Get the view name
$db = JFactory::getDbo(); if ($name = ComponentbuilderHelper::getVar('admin_view', (int) $id, 'id', 'name_single'))
// 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())
{ {
return $db->loadResult(); return $name;
} }
return ''; return '';
} }

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_get.php @subpackage dynamic_get.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_gets.php @subpackage dynamic_gets.php

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_get.js @subpackage dynamic_get.js

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_get.php @subpackage dynamic_get.php

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage submitbutton.js @subpackage submitbutton.js

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage edit.php @subpackage edit.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage view.html.php @subpackage view.html.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage default.php @subpackage default.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage default_batch_body.php @subpackage default_batch_body.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage default_batch_footer.php @subpackage default_batch_footer.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage default_body.php @subpackage default_body.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage default_foot.php @subpackage default_foot.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage default_head.php @subpackage default_head.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage default_toolbar.php @subpackage default_toolbar.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version @update number 95 of this MVC @version @update number 97 of this MVC
@build 10th October, 2017 @build 12th October, 2017
@created 21st May, 2015 @created 21st May, 2015
@package Component Builder @package Component Builder
@subpackage view.html.php @subpackage view.html.php