From 758c0f38cf6e0891c0fc9129d7092daf376cf6fa Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 2 Feb 2022 13:45:15 +0200 Subject: [PATCH] Adds better options with custom get.Improved the auto checkin method. --- README.md | 4 +-- admin/README.txt | 4 +-- admin/helpers/compiler/e_Interpretation.php | 32 +++++++++++++------ admin/models/admin_views.php | 14 ++++---- admin/models/admins_custom_tabs.php | 14 ++++---- admin/models/admins_fields.php | 14 ++++---- admin/models/admins_fields_conditions.php | 14 ++++---- admin/models/admins_fields_relations.php | 14 ++++---- admin/models/class_extendings.php | 14 ++++---- admin/models/class_methods.php | 14 ++++---- admin/models/class_properties.php | 14 ++++---- admin/models/components_admin_views.php | 14 ++++---- admin/models/components_config.php | 14 ++++---- .../models/components_custom_admin_menus.php | 14 ++++---- .../models/components_custom_admin_views.php | 14 ++++---- admin/models/components_dashboard.php | 14 ++++---- admin/models/components_files_folders.php | 14 ++++---- admin/models/components_modules.php | 14 ++++---- admin/models/components_mysql_tweaks.php | 14 ++++---- admin/models/components_placeholders.php | 14 ++++---- admin/models/components_plugins.php | 14 ++++---- admin/models/components_site_views.php | 14 ++++---- admin/models/components_updates.php | 14 ++++---- admin/models/custom_admin_views.php | 14 ++++---- admin/models/custom_codes.php | 14 ++++---- admin/models/dynamic_gets.php | 14 ++++---- admin/models/fields.php | 14 ++++---- admin/models/fieldtypes.php | 14 ++++---- admin/models/help_documents.php | 14 ++++---- admin/models/joomla_components.php | 14 ++++---- admin/models/joomla_modules.php | 14 ++++---- .../joomla_modules_files_folders_urls.php | 14 ++++---- admin/models/joomla_modules_updates.php | 14 ++++---- admin/models/joomla_plugin_groups.php | 14 ++++---- admin/models/joomla_plugins.php | 14 ++++---- .../joomla_plugins_files_folders_urls.php | 14 ++++---- admin/models/joomla_plugins_updates.php | 14 ++++---- admin/models/language_translations.php | 14 ++++---- admin/models/languages.php | 14 ++++---- admin/models/layouts.php | 14 ++++---- admin/models/libraries.php | 14 ++++---- admin/models/libraries_config.php | 14 ++++---- admin/models/libraries_files_folders_urls.php | 14 ++++---- admin/models/placeholders.php | 14 ++++---- admin/models/servers.php | 14 ++++---- admin/models/site_views.php | 14 ++++---- admin/models/snippet_types.php | 14 ++++---- admin/models/snippets.php | 14 ++++---- admin/models/templates.php | 14 ++++---- admin/models/validation_rules.php | 14 ++++---- componentbuilder.xml | 2 +- 51 files changed, 403 insertions(+), 297 deletions(-) diff --git a/README.md b/README.md index 8b519c5e9..b7f8e89b1 100644 --- a/README.md +++ b/README.md @@ -143,11 +143,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 21st January, 2022 ++ *Last Build*: 2nd February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286035** ++ *Line count*: **286129** + *Field count*: **1572** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/README.txt b/admin/README.txt index 8b519c5e9..b7f8e89b1 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,11 +143,11 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 21st January, 2022 ++ *Last Build*: 2nd February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286035** ++ *Line count*: **286129** + *Field count*: **1572** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index b47180df8..b879cebe8 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -3731,11 +3731,17 @@ class Interpretation extends Fields PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "\$data = \$db->loadObject();"; // add the db set query to data - $getItem = str_replace( - array_keys($setQuery), - array_values($setQuery), $getItem - ); } + else + { + // remove our placeholder + $setQuery[$this->hhh . "DB_SET_QUERY_DATA" . $this->hhh] = ''; + } + // add the db set query to data + $getItem = str_replace( + array_keys($setQuery), + array_values($setQuery), $getItem + ); $getItem .= PHP_EOL . PHP_EOL . $tab . $this->_t(2) . "if (empty(\$data))"; $getItem .= PHP_EOL . $this->_t(1) . $tab . $this->_t(1) . "{"; @@ -21699,7 +21705,7 @@ class Interpretation extends Fields public function setCheckinCall() { $call = PHP_EOL . $this->_t(2) . "//" . $this->setLine(__LINE__) - . " check in items"; + . " Check in items"; $call .= PHP_EOL . $this->_t(2) . "\$this->checkInNow();" . PHP_EOL; return $call; @@ -21728,22 +21734,28 @@ class Interpretation extends Fields ) . " Get a db connection."; $checkin .= PHP_EOL . $this->_t(3) . "\$db = JFactory::getDbo();"; $checkin .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) - . " reset query"; + . " Reset query."; $checkin .= PHP_EOL . $this->_t(3) . "\$query = \$db->getQuery(true);"; $checkin .= PHP_EOL . $this->_t(3) . "\$query->select('*');"; $checkin .= PHP_EOL . $this->_t(3) . "\$query->from(\$db->quoteName('#__" . $component . "_" . $view . "'));"; - $checkin .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query);"; + $checkin .= PHP_EOL . $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Only select items that are checked out."; + $checkin .= PHP_EOL . $this->_t(3) + . "\$query->where(\$db->quoteName('checked_out') . '!=0');"; + $this->_t(3) . "//" . $this->setLine(__LINE__) + . " Query only to see if we have a rows"; + $checkin .= PHP_EOL . $this->_t(3) . "\$db->setQuery(\$query, 0, 1);"; $checkin .= PHP_EOL . $this->_t(3) . "\$db->execute();"; $checkin .= PHP_EOL . $this->_t(3) . "if (\$db->getNumRows())"; $checkin .= PHP_EOL . $this->_t(3) . "{"; $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) - . " Get Yesterdays date"; + . " Get Yesterdays date."; $checkin .= PHP_EOL . $this->_t(4) . "\$date = JFactory::getDate()->modify(\$time)->toSql();"; $checkin .= PHP_EOL . $this->_t(4) . "//" . $this->setLine(__LINE__) - . " reset query"; + . " Reset query."; $checkin .= PHP_EOL . $this->_t(4) . "\$query = \$db->getQuery(true);"; $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( __LINE__ @@ -21765,7 +21777,7 @@ class Interpretation extends Fields $checkin .= PHP_EOL . $this->_t(4) . ");"; $checkin .= PHP_EOL . PHP_EOL . $this->_t(4) . "//" . $this->setLine( __LINE__ - ) . " Check table"; + ) . " Check table."; $checkin .= PHP_EOL . $this->_t(4) . "\$query->update(\$db->quoteName('#__" . $component . "_" . $view . "'))->set(\$fields)->where(\$conditions); "; diff --git a/admin/models/admin_views.php b/admin/models/admin_views.php index 7d1d56bf9..94314a6df 100644 --- a/admin/models/admin_views.php +++ b/admin/models/admin_views.php @@ -203,7 +203,7 @@ class ComponentbuilderModelAdmin_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -817,17 +817,19 @@ class ComponentbuilderModelAdmin_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_view')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -842,7 +844,7 @@ class ComponentbuilderModelAdmin_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_view'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/admins_custom_tabs.php b/admin/models/admins_custom_tabs.php index ae1ee5152..2cd0de01a 100644 --- a/admin/models/admins_custom_tabs.php +++ b/admin/models/admins_custom_tabs.php @@ -94,7 +94,7 @@ class ComponentbuilderModelAdmins_custom_tabs extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelAdmins_custom_tabs extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_custom_tabs')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelAdmins_custom_tabs extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_custom_tabs'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/admins_fields.php b/admin/models/admins_fields.php index 3827615f4..4630c9cd8 100644 --- a/admin/models/admins_fields.php +++ b/admin/models/admins_fields.php @@ -94,7 +94,7 @@ class ComponentbuilderModelAdmins_fields extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelAdmins_fields extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_fields')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelAdmins_fields extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_fields'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/admins_fields_conditions.php b/admin/models/admins_fields_conditions.php index 26dd6cf54..f588062a1 100644 --- a/admin/models/admins_fields_conditions.php +++ b/admin/models/admins_fields_conditions.php @@ -94,7 +94,7 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_fields_conditions')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelAdmins_fields_conditions extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_fields_conditions'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/admins_fields_relations.php b/admin/models/admins_fields_relations.php index d6a54b264..16491c625 100644 --- a/admin/models/admins_fields_relations.php +++ b/admin/models/admins_fields_relations.php @@ -94,7 +94,7 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_admin_fields_relations')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelAdmins_fields_relations extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_admin_fields_relations'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/class_extendings.php b/admin/models/class_extendings.php index 68251a878..4beb12da9 100644 --- a/admin/models/class_extendings.php +++ b/admin/models/class_extendings.php @@ -110,7 +110,7 @@ class ComponentbuilderModelClass_extendings extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -323,17 +323,19 @@ class ComponentbuilderModelClass_extendings extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_class_extends')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -348,7 +350,7 @@ class ComponentbuilderModelClass_extendings extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_class_extends'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/class_methods.php b/admin/models/class_methods.php index 646fc1b6d..6b3e5e79f 100644 --- a/admin/models/class_methods.php +++ b/admin/models/class_methods.php @@ -118,7 +118,7 @@ class ComponentbuilderModelClass_methods extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -502,17 +502,19 @@ class ComponentbuilderModelClass_methods extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_class_method')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -527,7 +529,7 @@ class ComponentbuilderModelClass_methods extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_class_method'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/class_properties.php b/admin/models/class_properties.php index cebbe41f7..5b1288dd8 100644 --- a/admin/models/class_properties.php +++ b/admin/models/class_properties.php @@ -118,7 +118,7 @@ class ComponentbuilderModelClass_properties extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -498,17 +498,19 @@ class ComponentbuilderModelClass_properties extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_class_property')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -523,7 +525,7 @@ class ComponentbuilderModelClass_properties extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_class_property'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_admin_views.php b/admin/models/components_admin_views.php index 555516d82..75ec3e4bf 100644 --- a/admin/models/components_admin_views.php +++ b/admin/models/components_admin_views.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_admin_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_admin_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_admin_views')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_admin_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_admin_views'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_config.php b/admin/models/components_config.php index 81e03d419..e100e49c2 100644 --- a/admin/models/components_config.php +++ b/admin/models/components_config.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_config extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_config extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_config')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_config extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_config'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_custom_admin_menus.php b/admin/models/components_custom_admin_menus.php index c1ac0ed32..a05d26f6b 100644 --- a/admin/models/components_custom_admin_menus.php +++ b/admin/models/components_custom_admin_menus.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_custom_admin_menus')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_custom_admin_menus extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_custom_admin_menus'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_custom_admin_views.php b/admin/models/components_custom_admin_views.php index 34617a0b8..38f60715a 100644 --- a/admin/models/components_custom_admin_views.php +++ b/admin/models/components_custom_admin_views.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_custom_admin_views')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_custom_admin_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_custom_admin_views'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_dashboard.php b/admin/models/components_dashboard.php index a79fa23d6..473551471 100644 --- a/admin/models/components_dashboard.php +++ b/admin/models/components_dashboard.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_dashboard extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_dashboard extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_dashboard')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_dashboard extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_dashboard'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_files_folders.php b/admin/models/components_files_folders.php index b7cadc84d..bd53f0406 100644 --- a/admin/models/components_files_folders.php +++ b/admin/models/components_files_folders.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_files_folders extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_files_folders extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_files_folders')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_files_folders extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_files_folders'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_modules.php b/admin/models/components_modules.php index 2112cb012..e035eb096 100644 --- a/admin/models/components_modules.php +++ b/admin/models/components_modules.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_modules extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_modules extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_modules')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_modules extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_modules'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_mysql_tweaks.php b/admin/models/components_mysql_tweaks.php index 55049c4cb..655fa1622 100644 --- a/admin/models/components_mysql_tweaks.php +++ b/admin/models/components_mysql_tweaks.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_mysql_tweaks')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_mysql_tweaks extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_mysql_tweaks'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_placeholders.php b/admin/models/components_placeholders.php index 969cb62c8..98fdabbf6 100644 --- a/admin/models/components_placeholders.php +++ b/admin/models/components_placeholders.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_placeholders extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_placeholders extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_placeholders')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_placeholders extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_placeholders'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_plugins.php b/admin/models/components_plugins.php index ca59efe78..3bfafdba9 100644 --- a/admin/models/components_plugins.php +++ b/admin/models/components_plugins.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_plugins extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_plugins extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_plugins')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_plugins extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_plugins'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_site_views.php b/admin/models/components_site_views.php index 98a98b476..27426721d 100644 --- a/admin/models/components_site_views.php +++ b/admin/models/components_site_views.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_site_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_site_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_site_views')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_site_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_site_views'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/components_updates.php b/admin/models/components_updates.php index 4f481267c..caa6a7680 100644 --- a/admin/models/components_updates.php +++ b/admin/models/components_updates.php @@ -94,7 +94,7 @@ class ComponentbuilderModelComponents_updates extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelComponents_updates extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_component_updates')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelComponents_updates extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_component_updates'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/custom_admin_views.php b/admin/models/custom_admin_views.php index 34f2a8d0b..b0b77d966 100644 --- a/admin/models/custom_admin_views.php +++ b/admin/models/custom_admin_views.php @@ -187,7 +187,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -672,17 +672,19 @@ class ComponentbuilderModelCustom_admin_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_custom_admin_view')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -697,7 +699,7 @@ class ComponentbuilderModelCustom_admin_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_custom_admin_view'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/custom_codes.php b/admin/models/custom_codes.php index 160bb9b85..fbd8a0d5e 100644 --- a/admin/models/custom_codes.php +++ b/admin/models/custom_codes.php @@ -134,7 +134,7 @@ class ComponentbuilderModelCustom_codes extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -590,17 +590,19 @@ class ComponentbuilderModelCustom_codes extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_custom_code')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -615,7 +617,7 @@ class ComponentbuilderModelCustom_codes extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_custom_code'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/dynamic_gets.php b/admin/models/dynamic_gets.php index cbbf55d4d..a04f7cb53 100644 --- a/admin/models/dynamic_gets.php +++ b/admin/models/dynamic_gets.php @@ -118,7 +118,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -503,17 +503,19 @@ class ComponentbuilderModelDynamic_gets extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_dynamic_get')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -528,7 +530,7 @@ class ComponentbuilderModelDynamic_gets extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_dynamic_get'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/fields.php b/admin/models/fields.php index 756eb2e9a..dc32a6bbc 100644 --- a/admin/models/fields.php +++ b/admin/models/fields.php @@ -214,7 +214,7 @@ class ComponentbuilderModelFields extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -858,17 +858,19 @@ class ComponentbuilderModelFields extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_field')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -883,7 +885,7 @@ class ComponentbuilderModelFields extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_field'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/fieldtypes.php b/admin/models/fieldtypes.php index 29e633d43..e6129fb03 100644 --- a/admin/models/fieldtypes.php +++ b/admin/models/fieldtypes.php @@ -126,7 +126,7 @@ class ComponentbuilderModelFieldtypes extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -467,17 +467,19 @@ class ComponentbuilderModelFieldtypes extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_fieldtype')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -492,7 +494,7 @@ class ComponentbuilderModelFieldtypes extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_fieldtype'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index 9fde9ba09..0300518c1 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -133,7 +133,7 @@ class ComponentbuilderModelHelp_documents extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -506,17 +506,19 @@ class ComponentbuilderModelHelp_documents extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_help_document')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -531,7 +533,7 @@ class ComponentbuilderModelHelp_documents extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_help_document'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index b3767b912..503acd031 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -2304,7 +2304,7 @@ class ComponentbuilderModelJoomla_components extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -2756,17 +2756,19 @@ class ComponentbuilderModelJoomla_components extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_component')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -2781,7 +2783,7 @@ class ComponentbuilderModelJoomla_components extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_component'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_modules.php b/admin/models/joomla_modules.php index 4702cc60a..73a407fc9 100644 --- a/admin/models/joomla_modules.php +++ b/admin/models/joomla_modules.php @@ -118,7 +118,7 @@ class ComponentbuilderModelJoomla_modules extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -329,17 +329,19 @@ class ComponentbuilderModelJoomla_modules extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_module')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -354,7 +356,7 @@ class ComponentbuilderModelJoomla_modules extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_module'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_modules_files_folders_urls.php b/admin/models/joomla_modules_files_folders_urls.php index 383a8f533..6f883c835 100644 --- a/admin/models/joomla_modules_files_folders_urls.php +++ b/admin/models/joomla_modules_files_folders_urls.php @@ -94,7 +94,7 @@ class ComponentbuilderModelJoomla_modules_files_folders_urls extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelJoomla_modules_files_folders_urls extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_module_files_folders_urls')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelJoomla_modules_files_folders_urls extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_module_files_folders_urls'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_modules_updates.php b/admin/models/joomla_modules_updates.php index d2c0a4edb..ece517811 100644 --- a/admin/models/joomla_modules_updates.php +++ b/admin/models/joomla_modules_updates.php @@ -94,7 +94,7 @@ class ComponentbuilderModelJoomla_modules_updates extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelJoomla_modules_updates extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_module_updates')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelJoomla_modules_updates extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_module_updates'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_plugin_groups.php b/admin/models/joomla_plugin_groups.php index 96574dc18..db1b680d2 100644 --- a/admin/models/joomla_plugin_groups.php +++ b/admin/models/joomla_plugin_groups.php @@ -110,7 +110,7 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -269,17 +269,19 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_plugin_group')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -294,7 +296,7 @@ class ComponentbuilderModelJoomla_plugin_groups extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_plugin_group'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_plugins.php b/admin/models/joomla_plugins.php index d9d0a2be0..7260d50cc 100644 --- a/admin/models/joomla_plugins.php +++ b/admin/models/joomla_plugins.php @@ -288,7 +288,7 @@ class ComponentbuilderModelJoomla_plugins extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -490,17 +490,19 @@ class ComponentbuilderModelJoomla_plugins extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_plugin')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -515,7 +517,7 @@ class ComponentbuilderModelJoomla_plugins extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_plugin'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_plugins_files_folders_urls.php b/admin/models/joomla_plugins_files_folders_urls.php index 1764069d7..141d3e495 100644 --- a/admin/models/joomla_plugins_files_folders_urls.php +++ b/admin/models/joomla_plugins_files_folders_urls.php @@ -94,7 +94,7 @@ class ComponentbuilderModelJoomla_plugins_files_folders_urls extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelJoomla_plugins_files_folders_urls extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_plugin_files_folders_urls')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelJoomla_plugins_files_folders_urls extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_plugin_files_folders_urls'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/joomla_plugins_updates.php b/admin/models/joomla_plugins_updates.php index 6c17342da..404c898af 100644 --- a/admin/models/joomla_plugins_updates.php +++ b/admin/models/joomla_plugins_updates.php @@ -94,7 +94,7 @@ class ComponentbuilderModelJoomla_plugins_updates extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelJoomla_plugins_updates extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_joomla_plugin_updates')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelJoomla_plugins_updates extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_joomla_plugin_updates'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/language_translations.php b/admin/models/language_translations.php index 7f5afe643..2cf9fa98e 100644 --- a/admin/models/language_translations.php +++ b/admin/models/language_translations.php @@ -189,7 +189,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -676,17 +676,19 @@ class ComponentbuilderModelLanguage_translations extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_language_translation')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -701,7 +703,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_language_translation'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/languages.php b/admin/models/languages.php index 8707b47ca..2c2040c90 100644 --- a/admin/models/languages.php +++ b/admin/models/languages.php @@ -233,7 +233,7 @@ class ComponentbuilderModelLanguages extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -514,17 +514,19 @@ class ComponentbuilderModelLanguages extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_language')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -539,7 +541,7 @@ class ComponentbuilderModelLanguages extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_language'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/layouts.php b/admin/models/layouts.php index 4261763b9..f40249259 100644 --- a/admin/models/layouts.php +++ b/admin/models/layouts.php @@ -126,7 +126,7 @@ class ComponentbuilderModelLayouts extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -485,17 +485,19 @@ class ComponentbuilderModelLayouts extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_layout')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -510,7 +512,7 @@ class ComponentbuilderModelLayouts extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_layout'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/libraries.php b/admin/models/libraries.php index c487d2de2..c338037a9 100644 --- a/admin/models/libraries.php +++ b/admin/models/libraries.php @@ -134,7 +134,7 @@ class ComponentbuilderModelLibraries extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -418,17 +418,19 @@ class ComponentbuilderModelLibraries extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_library')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -443,7 +445,7 @@ class ComponentbuilderModelLibraries extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_library'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/libraries_config.php b/admin/models/libraries_config.php index 6b19a4c25..39142cb2d 100644 --- a/admin/models/libraries_config.php +++ b/admin/models/libraries_config.php @@ -94,7 +94,7 @@ class ComponentbuilderModelLibraries_config extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelLibraries_config extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_library_config')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelLibraries_config extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_library_config'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/libraries_files_folders_urls.php b/admin/models/libraries_files_folders_urls.php index a761ceaf0..6564426d2 100644 --- a/admin/models/libraries_files_folders_urls.php +++ b/admin/models/libraries_files_folders_urls.php @@ -94,7 +94,7 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -240,17 +240,19 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_library_files_folders_urls')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -265,7 +267,7 @@ class ComponentbuilderModelLibraries_files_folders_urls extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_library_files_folders_urls'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/placeholders.php b/admin/models/placeholders.php index 272cd6b86..63c5119e2 100644 --- a/admin/models/placeholders.php +++ b/admin/models/placeholders.php @@ -110,7 +110,7 @@ class ComponentbuilderModelPlaceholders extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -395,17 +395,19 @@ class ComponentbuilderModelPlaceholders extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_placeholder')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -420,7 +422,7 @@ class ComponentbuilderModelPlaceholders extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_placeholder'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/servers.php b/admin/models/servers.php index 969a9977d..e6cad44db 100644 --- a/admin/models/servers.php +++ b/admin/models/servers.php @@ -110,7 +110,7 @@ class ComponentbuilderModelServers extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -510,17 +510,19 @@ class ComponentbuilderModelServers extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_server')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -535,7 +537,7 @@ class ComponentbuilderModelServers extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_server'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/site_views.php b/admin/models/site_views.php index e8eedda05..ce75c8edd 100644 --- a/admin/models/site_views.php +++ b/admin/models/site_views.php @@ -195,7 +195,7 @@ class ComponentbuilderModelSite_views extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -681,17 +681,19 @@ class ComponentbuilderModelSite_views extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_site_view')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -706,7 +708,7 @@ class ComponentbuilderModelSite_views extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_site_view'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/snippet_types.php b/admin/models/snippet_types.php index e56e28eac..08b26f9c7 100644 --- a/admin/models/snippet_types.php +++ b/admin/models/snippet_types.php @@ -110,7 +110,7 @@ class ComponentbuilderModelSnippet_types extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -269,17 +269,19 @@ class ComponentbuilderModelSnippet_types extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_snippet_type')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -294,7 +296,7 @@ class ComponentbuilderModelSnippet_types extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_snippet_type'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/snippets.php b/admin/models/snippets.php index b30063c79..9a8f86e45 100644 --- a/admin/models/snippets.php +++ b/admin/models/snippets.php @@ -248,7 +248,7 @@ class ComponentbuilderModelSnippets extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -576,17 +576,19 @@ class ComponentbuilderModelSnippets extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_snippet')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -601,7 +603,7 @@ class ComponentbuilderModelSnippets extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_snippet'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/templates.php b/admin/models/templates.php index 39ede6229..684ab27ab 100644 --- a/admin/models/templates.php +++ b/admin/models/templates.php @@ -126,7 +126,7 @@ class ComponentbuilderModelTemplates extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -485,17 +485,19 @@ class ComponentbuilderModelTemplates extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_template')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -510,7 +512,7 @@ class ComponentbuilderModelTemplates extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_template'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/admin/models/validation_rules.php b/admin/models/validation_rules.php index 8e0fc82b3..ead2271b9 100644 --- a/admin/models/validation_rules.php +++ b/admin/models/validation_rules.php @@ -110,7 +110,7 @@ class ComponentbuilderModelValidation_rules extends JModelList */ public function getItems() { - // check in items + // Check in items $this->checkInNow(); // load parent items @@ -393,17 +393,19 @@ class ComponentbuilderModelValidation_rules extends JModelList // Get a db connection. $db = JFactory::getDbo(); - // reset query + // Reset query. $query = $db->getQuery(true); $query->select('*'); $query->from($db->quoteName('#__componentbuilder_validation_rule')); - $db->setQuery($query); + // Only select items that are checked out. + $query->where($db->quoteName('checked_out') . '!=0'); + $db->setQuery($query, 0, 1); $db->execute(); if ($db->getNumRows()) { - // Get Yesterdays date + // Get Yesterdays date. $date = JFactory::getDate()->modify($time)->toSql(); - // reset query + // Reset query. $query = $db->getQuery(true); // Fields to update. @@ -418,7 +420,7 @@ class ComponentbuilderModelValidation_rules extends JModelList $db->quoteName('checked_out_time') . '<\''.$date.'\'' ); - // Check table + // Check table. $query->update($db->quoteName('#__componentbuilder_validation_rule'))->set($fields)->where($conditions); $db->setQuery($query); diff --git a/componentbuilder.xml b/componentbuilder.xml index 142f1cb3d..fd6c9fc35 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 21st January, 2022 + 2nd February, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com