From d31dcf7b6d3df915bf40f81a8cd9e282adccae3a Mon Sep 17 00:00:00 2001 From: TangHien4698 Date: Mon, 1 Nov 2021 09:02:55 +0700 Subject: [PATCH 01/10] add Optimize columns on list views for forms, estates, and addresses --- plugin.php | 2 +- .../DetailViewPostSaveController.php | 175 +++++++++++++++++- plugin/Gui/Table/AddressListTable.php | 33 +++- plugin/Gui/Table/EstateListTable.php | 33 +++- plugin/Gui/Table/FormsTable.php | 34 +++- plugin/Installer/DatabaseChanges.php | 13 +- .../RecordManagerReadListViewEstate.php | 9 + tests/TestClassDatabaseChanges.php | 5 +- 8 files changed, 294 insertions(+), 10 deletions(-) diff --git a/plugin.php b/plugin.php index be176e4dd..d6c98a3b5 100644 --- a/plugin.php +++ b/plugin.php @@ -106,7 +106,7 @@ }, 11); add_action('admin_init', [$pAdminViewController, 'add_ajax_actions']); add_action('admin_init', [CaptchaDataChecker::class, 'addHook']); - +add_action('admin_init', [$pDetailViewPostSaveController, 'getAllPost']); add_action('plugins_loaded', function() { load_plugin_textdomain('onoffice-for-wp-websites', false, basename(ONOFFICE_PLUGIN_DIR) . '/languages'); // Check 'onoffice-personalized' Folder exists diff --git a/plugin/Controller/DetailViewPostSaveController.php b/plugin/Controller/DetailViewPostSaveController.php index 03e1ddf90..444b7ac12 100644 --- a/plugin/Controller/DetailViewPostSaveController.php +++ b/plugin/Controller/DetailViewPostSaveController.php @@ -23,6 +23,10 @@ use onOffice\WPlugin\DataView\DataDetailViewHandler; use onOffice\WPlugin\Utility\__String; +use onOffice\WPlugin\Record\RecordManagerReadListViewEstate; +use onOffice\WPlugin\Record\RecordManagerReadListViewAddress; +use onOffice\WPlugin\Record\RecordManagerReadForm; + use WP_Post; /** @@ -91,6 +95,18 @@ public function onSavePost($postId) { flush_rewrite_rules(); } } + $this->addPageUseShortCode($pPost); + } + + } + public function getAllPost() { + $args = array( + 'post_status' => 'publish', + ); + $posts = get_pages($args); + foreach ($posts as $post) + { + $this->addPageUseShortCode($post); } } @@ -114,6 +130,8 @@ public function onMoveTrash($postId) { $pDataDetailViewHandler->saveDetailView($pDetailView); flush_rewrite_rules(); } + $pPost = get_post($postId); + $this->deletePageUseShortCode($pPost); } @@ -128,7 +146,36 @@ private function generateDetailViewCode($detailViewName) { return 'view="'.$detailViewName.'"'; } - + private function generateDetailCode($detailViewName,$option) { + return $option.'="'.$detailViewName.'"'; + } + private function getListView() + { + $pRecordReadListView = new RecordManagerReadListViewEstate(); + $pRecordReadListView->addColumn('listview_id'); + $pRecordReadListView->addColumn('name'); + $pRecordReadListView->addColumn('page_shortcode'); + $listView = $pRecordReadListView->getRecords(); + return $listView; + } + private function getListViewAddress() + { + $pRecordReadListViewAddress = new RecordManagerReadListViewAddress(); + $pRecordReadListViewAddress->addColumn('listview_address_id'); + $pRecordReadListViewAddress->addColumn('name'); + $pRecordReadListViewAddress->addColumn('page_shortcode'); + $listViewAddress = $pRecordReadListViewAddress->getRecords(); + return $listViewAddress; + } + private function getListForm() + { + $pRecordReadForm = new RecordManagerReadForm(); + $pRecordReadForm->addColumn('form_id'); + $pRecordReadForm->addColumn('name'); + $pRecordReadForm->addColumn('page_shortcode'); + $listForm = $pRecordReadForm->getRecords(); + return $listForm; + } /** * * @param string $post @@ -156,4 +203,130 @@ private function postContainsViewName($post, $viewName) { return false; } + + private function postContains($post, $viewName, $element,$option) { + $matches = array(); + $regex = get_shortcode_regex(array($element)); + preg_match_all('/'.$regex.'/ism', $post, $matches); + + $detailviewCode = $this->generateDetailCode($viewName,$option); + if (!array_key_exists(3, $matches)) { + return false; + } + + foreach ($matches[3] as $tagParams) { + if (__String::getNew($tagParams)->contains($detailviewCode)) { + return true; + } + } + + return false; + } + + private function addPageUseShortCode($post) + { + $listView = $this->getListView(); + $listViewAddress = $this->getListViewAddress(); + $listForm = $this->getListForm(); + $isRevision = wp_is_post_revision($post); + if (!$isRevision) { + $postContent = $post->post_content; + $postID = $post->ID; + if (empty($postID)) + { + return; + } + if (strpos($postContent,'oo_estate') !== false) + { + $this->addPageShortCode($listView,$post,'oo_estate','view',"oo_plugin_listviews","listview_id","listview_id"); + } + if (strpos($postContent,'oo_address') !== false) + { + $this->addPageShortCode($listViewAddress,$post,'oo_address','view',"oo_plugin_listviews_address","listview_address_id","listview_address_id"); + } + if (strpos($postContent,'oo_form') !== false) + { + $this->addPageShortCode($listForm,$post,'oo_form','form',"oo_plugin_forms","form_id","form_id"); + } + + } + } + private function deletePageUseShortCode($post) + { + $listView = $this->getListView(); + $listViewAddress = $this->getListViewAddress(); + $listForm = $this->getListForm(); + $isRevision = wp_is_post_revision($post); + if (!$isRevision) { + $postContent = $post->post_content; + $postID = $post->ID; + if (empty($postID)) + { + return; + } + if (strpos($postContent,'oo_estate') !== false) + { + $this->deletePageShortCode($listView,$post,"oo_plugin_listviews","listview_id","listview_id"); + } + if (strpos($postContent,'oo_address') !== false) + { + $this->deletePageShortCode($listViewAddress,$post,"oo_plugin_listviews_address","listview_address_id","listview_address_id"); + } + if (strpos($postContent,'oo_form') !== false) + { + $this->deletePageShortCode($listForm,$post,"oo_plugin_forms","form_id","form_id"); + } + + } + } + private function addPageShortCode($listView,$post,$element,$option,$tableName,$column,$primaKey) + { + $pRecordReadListView = new RecordManagerReadListViewEstate(); + $postID = $post->ID; + $postContent = $post->post_content; + foreach($listView as $view) + { + $pageID = []; + if (!empty($view->page_shortcode)) + { + $pageID = explode(',',$view->page_shortcode); + } + if (in_array($postID,$pageID)) + { + break; + } + $viewContained = $this->postContains($postContent, $view->name,$element,$option); + if ($viewContained) { + if (empty($pageID)) + { + $pageID = $postID; + }else { + $pageID[] = $postID; + $pageID = implode(",",$pageID); + } + $pRecordReadListView->updateColumnPageShortCode($pageID,$view->$primaKey,$tableName,$column); + } + } + } + private function deletePageShortCode($listView,$post,$tableName,$column,$primaKey) + { + $pRecordReadListView = new RecordManagerReadListViewEstate(); + $postID = $post->ID; + foreach($listView as $view) + { + $pageID = ''; + if (empty($view->page_shortcode)) + { + break; + } + if (strpos($view->page_shortcode,(string)$postID)!== false) + { + $pageID = chop($view->page_shortcode,$postID); + $pageID = trim($pageID,","); + $pageID = str_replace(",,",",",$pageID); + $pRecordReadListView->updateColumnPageShortCode($pageID,$view->$primaKey,$tableName,$column); + } + + } + } } diff --git a/plugin/Gui/Table/AddressListTable.php b/plugin/Gui/Table/AddressListTable.php index 5c61c557c..d2bd7741f 100644 --- a/plugin/Gui/Table/AddressListTable.php +++ b/plugin/Gui/Table/AddressListTable.php @@ -77,9 +77,13 @@ private function fillData() $pRecordRead->setOffset($offset); $pRecordRead->addColumn('listview_address_id', 'ID'); $pRecordRead->addColumn('name'); + $pRecordRead->addColumn('template'); $pRecordRead->addColumn('name', 'shortcode'); + $pRecordRead->addColumn('page_shortcode'); - $this->setItems($pRecordRead->getRecords()); + $pRecord = $pRecordRead->getRecords(); + $pRecord = $this->handleRecord($pRecord); + $this->setItems($pRecord); $itemsCount = $pRecordRead->getCountOverall(); $this->set_pagination_args([ @@ -89,6 +93,31 @@ private function fillData() ]); } + private function handleRecord($listRecord) + { + if (empty($listRecord)) + { + return []; + } + foreach ($listRecord as &$record) + { + if (!empty($record->page_shortcode)) + { + $listPageID = explode(',',$record->page_shortcode); + $page = ''; + foreach ($listPageID as $pageID) + { + if (!empty($page)) + { + $page .= ','; + } + $page .= "".get_the_title((int)$pageID).""; + } + $record->page_shortcode = $page; + } + } + return $listRecord; + } /** * @@ -144,7 +173,9 @@ public function prepare_items() $columns = [ 'cb' => '', 'name' => __('Name of View', 'onoffice-for-wp-websites'), + 'template' => __('Tempaltes', 'onoffice-for-wp-websites'), 'shortcode' => __('Shortcode', 'onoffice-for-wp-websites'), + 'page_shortcode' => __('Page with Shortcode', 'onoffice-for-wp-websites'), ]; $hidden = ['ID']; diff --git a/plugin/Gui/Table/EstateListTable.php b/plugin/Gui/Table/EstateListTable.php index f15ba3808..efdc3a4f8 100644 --- a/plugin/Gui/Table/EstateListTable.php +++ b/plugin/Gui/Table/EstateListTable.php @@ -104,12 +104,16 @@ private function fillData() $pRecordRead->addColumn('listview_id', 'ID'); $pRecordRead->addColumn('name'); $pRecordRead->addColumn('filterId'); + $pRecordRead->addColumn('template'); $pRecordRead->addColumn('show_status'); $pRecordRead->addColumn('list_type'); $pRecordRead->addColumn('name', 'shortcode'); + $pRecordRead->addColumn('page_shortcode'); $pRecordRead->addWhere("`list_type` IN('default', 'reference', 'favorites')"); - $this->setItems($pRecordRead->getRecords()); + $pRecord = $pRecordRead->getRecords(); + $pRecord = $this->handleRecord($pRecord); + $this->setItems($pRecord); $itemsCount = $pRecordRead->getCountOverall(); $this->set_pagination_args([ @@ -119,6 +123,31 @@ private function fillData() ]); } + private function handleRecord($listRecord) + { + if (empty($listRecord)) + { + return []; + } + foreach ($listRecord as &$record) + { + if (!empty($record->page_shortcode)) + { + $listPageID = explode(',',$record->page_shortcode); + $page = ''; + foreach ($listPageID as $pageID) + { + if (!empty($page)) + { + $page .= ','; + } + $page .= "".get_the_title((int)$pageID).""; + } + $record->page_shortcode = $page; + } + } + return $listRecord; + } /** * @@ -130,9 +159,11 @@ public function prepare_items() 'cb' => '', 'name' => __('Name of View', 'onoffice-for-wp-websites'), 'filtername' => __('Filter', 'onoffice-for-wp-websites'), + 'template' => __('Tempaltes', 'onoffice-for-wp-websites'), 'show_status' => __('Show Status', 'onoffice-for-wp-websites'), 'list_type' => __('Type of List', 'onoffice-for-wp-websites'), 'shortcode' => __('Shortcode', 'onoffice-for-wp-websites'), + 'page_shortcode' => __('Page with Shortcode', 'onoffice-for-wp-websites'), ]; $hidden = ['ID', 'filterId']; diff --git a/plugin/Gui/Table/FormsTable.php b/plugin/Gui/Table/FormsTable.php index b04c2507e..c874547cc 100644 --- a/plugin/Gui/Table/FormsTable.php +++ b/plugin/Gui/Table/FormsTable.php @@ -93,14 +93,17 @@ private function fillData() $pRecordRead->setOffset($offset); $pRecordRead->addColumn('form_id', 'ID'); $pRecordRead->addColumn('name'); + $pRecordRead->addColumn('template'); $pRecordRead->addColumn('form_type'); $pRecordRead->addColumn('name', 'shortcode'); - + $pRecordRead->addColumn('page_shortcode'); if ($this->_listType != 'all' && $this->_listType != null) { $pRecordRead->addWhere("`form_type` = '".esc_sql($this->_listType)."'"); } - $this->setItems($pRecordRead->getRecords()); + $pRecord = $pRecordRead->getRecords(); + $pRecord = $this->handleRecord($pRecord); + $this->setItems($pRecord); $itemsCount = $pRecordRead->getCountOverall(); $this->set_pagination_args( array( @@ -112,6 +115,31 @@ private function fillData() $this->_countByType = $pRecordRead->getCountByType(); } + private function handleRecord($listRecord) + { + if (empty($listRecord)) + { + return []; + } + foreach ($listRecord as &$record) + { + if (!empty($record->page_shortcode)) + { + $listPageID = explode(',',$record->page_shortcode); + $page = ''; + foreach ($listPageID as $pageID) + { + if (!empty($page)) + { + $page .= ','; + } + $page .= "".get_the_title((int)$pageID).""; + } + $record->page_shortcode = $page; + } + } + return $listRecord; + } /** * @@ -122,8 +150,10 @@ public function prepare_items() $columns = array( 'cb' => '', 'name' => __('Name of Form', 'onoffice-for-wp-websites'), + 'template' => __('Tempaltes', 'onoffice-for-wp-websites'), 'form_type' => __('Type of Form', 'onoffice-for-wp-websites'), 'shortcode' => __('Shortcode', 'onoffice-for-wp-websites'), + 'page_shortcode' => __('Page with Shortcode', 'onoffice-for-wp-websites'), ); $hidden = array('ID', 'filterId'); diff --git a/plugin/Installer/DatabaseChanges.php b/plugin/Installer/DatabaseChanges.php index 47a6a5a0b..46d8dccf1 100644 --- a/plugin/Installer/DatabaseChanges.php +++ b/plugin/Installer/DatabaseChanges.php @@ -34,7 +34,7 @@ class DatabaseChanges implements DatabaseChangesInterface { /** @var int */ - const MAX_VERSION = 20; + const MAX_VERSION = 21; /** @var WPOptionWrapperBase */ private $_pWpOption; @@ -132,7 +132,7 @@ public function install() $this->updateSortByUserDefinedDefault(); $dbversion = 15; } - + if ($dbversion == 15) { dbDelta( $this->getCreateQueryFieldConfigDefaults() ); dbDelta( $this->getCreateQueryFieldConfigDefaultsValues() ); @@ -159,6 +159,12 @@ public function install() $dbversion = 20; } + if ($dbversion == 20) { + dbDelta($this->getCreateQueryListviews()); + dbDelta($this->getCreateQueryListViewsAddress()); + dbDelta($this->getCreateQueryForms()); + $dbversion = 21; + } $this->_pWpOption->updateOption( 'oo_plugin_db_version', $dbversion, true); } @@ -229,6 +235,7 @@ private function getCreateQueryListviews() `sortBySetting` ENUM('0','1') NOT NULL DEFAULT '0' COMMENT 'Sortierung nach Benutzerwahl: 0 means preselected, 1 means userDefined', `sortByUserDefinedDefault` VARCHAR(200) NOT NULL COMMENT 'Standardsortierung', `sortByUserDefinedDirection` ENUM('0','1') NOT NULL DEFAULT '0' COMMENT 'Formulierung der Sortierrichtung: 0 means highestFirst/lowestFirt, 1 means descending/ascending', + `page_shortcode` tinytext NOT NULL, PRIMARY KEY (`listview_id`), UNIQUE KEY `name` (`name`) ) $charsetCollate;"; @@ -269,6 +276,7 @@ private function getCreateQueryForms() `radius` INT( 10 ) NULL DEFAULT NULL, `geo_order` VARCHAR( 255 ) NOT NULL DEFAULT 'street,zip,city,country,radius', `show_estate_context` tinyint(1) NOT NULL DEFAULT '0', + `page_shortcode` tinytext NOT NULL, PRIMARY KEY (`form_id`), UNIQUE KEY `name` (`name`) ) $charsetCollate;"; @@ -536,6 +544,7 @@ private function getCreateQueryListViewsAddress() `template` tinytext NOT NULL, `recordsPerPage` int(10) NOT NULL DEFAULT '10', `showPhoto` tinyint(1) NOT NULL DEFAULT '0', + `page_shortcode` tinytext NOT NULL, PRIMARY KEY (`listview_address_id`), UNIQUE KEY `name` (`name`) ) $charsetCollate;"; diff --git a/plugin/Record/RecordManagerReadListViewEstate.php b/plugin/Record/RecordManagerReadListViewEstate.php index f53097bfd..c8bf83fab 100644 --- a/plugin/Record/RecordManagerReadListViewEstate.php +++ b/plugin/Record/RecordManagerReadListViewEstate.php @@ -364,4 +364,13 @@ public function getContactDataByListviewId($listviewId) { return $this->readContactDataByListviewId($listviewId); } + + public function updateColumnPageShortCode($page,$listviewId,$tableName,$column) + { + $prefix = $this->getTablePrefix(); + $pWpDb = $this->getWpdb(); + $pWpDb->query("UPDATE {$prefix}".$tableName." + SET `page_shortcode` ='" .$page."' + WHERE `".$column."` = ".esc_sql($listviewId)); + } } diff --git a/tests/TestClassDatabaseChanges.php b/tests/TestClassDatabaseChanges.php index 6536863a6..d76661f63 100644 --- a/tests/TestClassDatabaseChanges.php +++ b/tests/TestClassDatabaseChanges.php @@ -111,12 +111,13 @@ public function testInstall(): array $this->assertGreaterThanOrEqual(self::NUM_NEW_TABLES, count($this->_createQueries)); $dbversion = $this->_pDbChanges->getDbVersion(); - $this->assertEquals(20, $dbversion); + $this->assertEquals(21, $dbversion); return $this->_createQueries; } public function testInstallMigrationsDataSimilarEstates(): array { + $this->_pDbChanges->deinstall(); add_option('oo_plugin_db_version', '16'); add_filter('query', [$this, 'saveCreateQuery'], 1); $this->_pDbChanges->install(); @@ -191,7 +192,7 @@ public function testDeleteCommentFieldApplicantSearchForm() */ public function testMaxVersion() { - $this->assertEquals(20, DatabaseChanges::MAX_VERSION); + $this->assertEquals(21, DatabaseChanges::MAX_VERSION); } From 9994a4000478444ce1aef0e8968c11ff56e2252d Mon Sep 17 00:00:00 2001 From: TangHien4698 Date: Tue, 2 Nov 2021 10:47:29 +0700 Subject: [PATCH 02/10] Change query insert ignore --- plugin/Installer/DatabaseChanges.php | 32 +++++++++++++++++----------- tests/TestClassWPPageWrapper.php | 10 +++++++-- 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/plugin/Installer/DatabaseChanges.php b/plugin/Installer/DatabaseChanges.php index 46d8dccf1..54da36182 100644 --- a/plugin/Installer/DatabaseChanges.php +++ b/plugin/Installer/DatabaseChanges.php @@ -299,19 +299,27 @@ private function installDataQueryForms() $template = $templatePathsForm; } } - $this->_pWPDB->insert( - $tableName, - array( - 'name' => 'Default Form', - 'form_type' => 'contact', - 'template' => $template, - 'country_active' => 1, - 'zip_active' => 1, - 'street_active' => 1, - 'radius_active' => 1, - 'geo_order' => 'street,zip,city,country,radius' - ) + $data = array( + 'name' => 'Default Form', + 'form_type' => 'contact', + 'template' => $template, + 'country_active' => 1, + 'zip_active' => 1, + 'street_active' => 1, + 'radius_active' => 1, + 'geo_order' => 'street,zip,city,country,radius' ); + $query = "INSERT IGNORE $tableName (name, form_type, template, country_active, zip_active, street_active, radius_active, geo_order)"; + $query .= "VALUES ("; + $query .= "'" . esc_sql($data['name']) ."',"; + $query .= "'" . esc_sql($data['form_type']) ."',"; + $query .= "'" . esc_sql($data['template']) ."',"; + $query .= esc_sql($data['country_active']) . ","; + $query .= esc_sql($data['zip_active']) . ","; + $query .= esc_sql($data['street_active']) . ","; + $query .= esc_sql($data['radius_active']) . ","; + $query .= "'" . esc_sql($data['geo_order']) ."')"; + $this->_pWPDB->query($query); $defaultFormId = $this->_pWPDB->insert_id; $this->installDataQueryFormFieldConfig($defaultFormId); } diff --git a/tests/TestClassWPPageWrapper.php b/tests/TestClassWPPageWrapper.php index 93573f282..17a6453cd 100644 --- a/tests/TestClassWPPageWrapper.php +++ b/tests/TestClassWPPageWrapper.php @@ -26,7 +26,9 @@ use onOffice\WPlugin\WP\UnknownPageException; use onOffice\WPlugin\WP\WPPageWrapper; use WP_UnitTestCase; - +use onOffice\WPlugin\Installer\DatabaseChanges; +use onOffice\WPlugin\Utility\__String; +use onOffice\WPlugin\WP\WPOptionWrapperTest; /** * @preserveGlobalState disabled @@ -61,6 +63,11 @@ class TestClassWPPageWrapper */ public function prepare() { + global $wpdb; + + $pWpOption = new WPOptionWrapperTest(); + $pDbChanges = new DatabaseChanges($pWpOption, $wpdb); + $pDbChanges->install(); $this->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/'); $this->_pSubject = new WPPageWrapper(); // set this even though the permalink for pages always is %postname% @@ -71,7 +78,6 @@ public function prepare() 'post_status' => 'publish', 'post_date' => '2016-05-01 13:37:37', ]); - $postData = self::POST_DATA; $postData['post_parent'] = $this->_ancestorId; $this->_postId = wp_insert_post($postData); From 35b06b5d366faae436ab06cf0648bab2587de5cb Mon Sep 17 00:00:00 2001 From: TangHien4698 Date: Mon, 20 Dec 2021 10:13:01 +0700 Subject: [PATCH 03/10] update unit test change database --- tests/TestClassDatabaseChanges.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestClassDatabaseChanges.php b/tests/TestClassDatabaseChanges.php index fe13f4193..56b7f138c 100644 --- a/tests/TestClassDatabaseChanges.php +++ b/tests/TestClassDatabaseChanges.php @@ -108,7 +108,7 @@ public function testInstall(): array $this->_pDbChanges->install(); remove_filter('query', [$this, 'saveCreateQuery'], 1); - $this->assertLessThanOrEqual(self::NUM_NEW_TABLES, count($this->_createQueries)); + $this->assertGreaterThanOrEqual(self::NUM_NEW_TABLES, count($this->_createQueries)); $dbversion = $this->_pDbChanges->getDbVersion(); $this->assertEquals(22, $dbversion); From 6444b3858231420242db4502ee9b8fab5846f0dd Mon Sep 17 00:00:00 2001 From: TangHien4698 Date: Mon, 27 Dec 2021 09:44:40 +0700 Subject: [PATCH 04/10] update test --- tests/TestClassDatabaseChanges.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/TestClassDatabaseChanges.php b/tests/TestClassDatabaseChanges.php index 56b7f138c..80fb18ef7 100644 --- a/tests/TestClassDatabaseChanges.php +++ b/tests/TestClassDatabaseChanges.php @@ -214,7 +214,7 @@ public function testUninstall(array $createQueries) // assert that as many tables have been removed as have been created $uniqueCreateQueries = array_unique($createQueries); $uniqueDropQueries = array_unique($this->_dropQueries); - $this->assertGreaterThanOrEqual(count($uniqueCreateQueries), count($uniqueDropQueries)); + $this->assertEquals(count($uniqueCreateQueries), count($uniqueDropQueries)); $dbversion = $this->_pWpOption->getOption('oo_plugin_db_version', null); $this->assertNull($dbversion); $this->assertNull($this->_pDbChanges->getDbVersion()); From 68246c1efc47f5cc2de293ba3dcd7fab7707ab88 Mon Sep 17 00:00:00 2001 From: TangHien4698 Date: Tue, 4 Jan 2022 09:40:53 +0700 Subject: [PATCH 05/10] fix code under review --- languages/onoffice-for-wp-websites-de_DE.mo | Bin 16003 -> 15973 bytes languages/onoffice-for-wp-websites-de_DE.po | 4 ++-- languages/onoffice-for-wp-websites-es_ES.mo | Bin 14992 -> 15751 bytes languages/onoffice-for-wp-websites-es_ES.po | 2 +- languages/onoffice-for-wp-websites-it_IT.mo | Bin 14944 -> 15569 bytes languages/onoffice-for-wp-websites-it_IT.po | 2 +- languages/onoffice-for-wp-websites-nl_NL.mo | Bin 14738 -> 15113 bytes languages/onoffice-for-wp-websites-nl_NL.po | 2 +- .../DetailViewPostSaveController.php | 8 +++++--- plugin/Gui/Table/AddressListTable.php | 2 +- plugin/Gui/Table/EstateListTable.php | 8 +++++--- plugin/Gui/Table/FormsTable.php | 2 +- 12 files changed, 17 insertions(+), 13 deletions(-) diff --git a/languages/onoffice-for-wp-websites-de_DE.mo b/languages/onoffice-for-wp-websites-de_DE.mo index 6ca46cf0f2fe94b0e38f5e23834c7bbaf7864335..2bddd112fa23367148259bc42c08b19197796f92 100644 GIT binary patch delta 4345 zcmZwJe{ht=9mny#kPv~ygmASc zUc3A3v-{oe?mpqEC;qxU{$XBvzu~`+_fL1 zIF7-KI2o@aKPEfJm|-{$hvQVt!m?C*+$^HtreUe`U=u2a&8PvxPWvv@fV(jle}o$N z4V;LlaU}l5@t-({dM2IKZvn2sB{&s#W1fi{^9u?J;9YFMtH`^?!)WQa7!~m&I2s#K zfow(v+Jhr-htvKnj-|dAC*kX;ewQ&D|BTAm4RkZVNzXIpYd8jJGaej@b*PjrM@_H} ziOn>lQXj$f_&nZ+*H8<&iCS?cv*hDQRJ{nbAP;Ju3XJPP0|l*U4XWOZ%0K`$@pe?? zy{G_QKn-vRwX!!*{og_b@(yae%czB1Lj`ujsb^5pI9YD;uN97`K?4?{BCJFOQjPqW z27W2^O_+gERBE@O-rtMbqC=>GkD>xUiwf)=r~PB6{U$1~uay7)P{?5PH!+QTJ%J~1 z6E1uprXKhIy>iHzpyzyyHVGb(7YScZi zM+>(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bKHGC*7RK82kiN@Smtn7B|8_FAw#0j6!v2Hb&uc>yxOd zZbJ=d4{9dgMs@fC>Kpai2Sk>YMXhWHL-52X&t+)Z6tKj=~LCkEdNKk5EY~;tfC-)uGU0e~OY&56VGJU758K zHAA(iscb~ez-o-e&8QLX!Dift`lA%bx7`}th7-^YyO*y;DpjZ@D5iUw>hY)tJc63K zrKlUPwV!XtezXr^0(K!^`{o0T!>>?#D5BKwcr0p3QcyFTi+McX6jI@JHHXNHL}fSm z1zAN}h^AC!HhC;qGv=3AOAu5Z>*kFy>!#BtQa+tiX_ur$ko~YCj zEr-fDACqC#?3^X1$b;n9WIL%M+KgIny#*?vKEWA#h5B)#S2fWdXXJk2`N8r%erxBm z{O0??BmS@bz+N<4$Rx6lXaj0(RgUE900L2aN z-V|yl$xn%jcKVM<2$@dC6O|J_!T)kPsIMkZ*<-v&=EtPdws%;c!!9zP%pntq$_z41 z>;DXuY;r%@L}rq7qA#Y0$R48dGMP%WtA~>A(nLkeSVDNq%q~((3ds+N%JXD!u*Uxe zIEx%3_vym!QbFZWvXX2gL&#~8KveQcCYh)PWgY293e@;cd7OHHOeSv;eJ`9NOP1+C%s7=d4hD8Fe+2J8~;;# z+5dN2ZY7N*jXX(~5tUZsUF^HW@uo*bJAvlt5rH?ND+0q~(!KRDjuY4%TkHKjcC6!# z?$_Zsb>64(oI1Dvg^)m5;v(;0;snQwN$%r#HFuwKyaj_YoxsJEtiYMF_&{cAdBU=# z(;6BY7uK8ZO3I|By2*i?sXO{FT^9T#zhT*m{8h{ISJl@wH@4I_2TrD)2putWa0KPPahDAM~waYKlAa#V{GSX-7yw-)}tF13}9{V$;P*ed`4 diff --git a/languages/onoffice-for-wp-websites-it_IT.po b/languages/onoffice-for-wp-websites-it_IT.po index 0fabf84a5..f4107c61b 100644 --- a/languages/onoffice-for-wp-websites-it_IT.po +++ b/languages/onoffice-for-wp-websites-it_IT.po @@ -709,7 +709,7 @@ msgstr "Scendendo" #: plugin/Model/FormModelBuilder/FormModelBuilderDB.php:193 #: plugin/Model/FormModelBuilder/FormModelBuilderEstateDetailSettings.php:245 #: plugin/Model/FormModelBuilder/FormModelBuilderSimilarEstateSettings.php:215 -msgid "Template" +msgid "Templates" msgstr "Modello" #: plugin/Model/FormModelBuilder/FormModelBuilderDBAddress.php:94 diff --git a/languages/onoffice-for-wp-websites-nl_NL.mo b/languages/onoffice-for-wp-websites-nl_NL.mo index d9b50a29129ce7cc54ad57fcebccc6a2d8a262cf..d9890ba1c3a3675afd5754ef16cea3cad0961742 100644 GIT binary patch delta 4490 zcmaLYdvKIj8OQOnAqA2^0=dut0bar-;gV!Y0wjSBCD3pY3v#~Ordclfl5nAa?nFXe{!_X0DYEdqtNSz{51+*=7gj%qbQoldmgHpzk3Hh9J z-g9}*bI$wb>BPoW$#c2s+YJBS<$n?X|Itx3V}8~3zxJYdjQU9YD~`jy*~aw2C76fn zuqSTDVtg6-F~|6ofoCxjFJTwF;%mz%yXHgNpfCcz6YT-9gft|oC zJY(DcjJ>H}#r~L0H0l>bC9wvTp$61O7h)mCusiFU4HT61=TRxziCSPUGN*YBmFl-~ z9{vS8<2bgV2`8g6u^4+`i>*I_+Rz4MhdEQjr=|GlU{N>CF9Q5zYD3ar7_7op~9L~SsEn(v7`@~;Rt)1W}Mp$6_irG7u& zgGW)RJ&Bs&D(Z+nM@^i`AO+qV6<7(XeY9<#j0$Wv-oQopILk)(=qquA>&bf$G=cUO#i$s6cz5#uX=Rp#s%$ET-Wk z)WTDdV9i3*+Ymzqw$b_wDnq+a<9~uWl7pxtIc%RFM=ktY>v>dw$;%W*Qur7h9KzL9 z$Em0eb5W5lMrG;|)c4?V)LnQMmFgehP~3+)+q0-Z{)U{AxsIAAi(RN*h$K5{hEvc4 z^{5@sLhY~#wWAfN+rJJq;q#~?_z|lAE2zK@p)z$6wSkMMd9R=XN+W9Z&qwteh@JKR z*HX|<>XG9zQ&9_tP=Q2HnRpDf&^K&-D=Lufs2%M>eFuJun&&k3!^@~Zy6|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v)3 za}qa^7w!HD>uDTJULn)TJTidXNcItJkLn}Mo7$Y1nUy5+-3u`C(dy=-qFKP@N$*FH#lGDZU$4MPk;BmH(t_^aQ6sCFn=f|jm@*leTdqrda4}}QZiU0rr diff --git a/languages/onoffice-for-wp-websites-nl_NL.po b/languages/onoffice-for-wp-websites-nl_NL.po index 33c5c99a2..848883726 100644 --- a/languages/onoffice-for-wp-websites-nl_NL.po +++ b/languages/onoffice-for-wp-websites-nl_NL.po @@ -706,7 +706,7 @@ msgstr "Aflopend" #: plugin/Model/FormModelBuilder/FormModelBuilderDB.php:193 #: plugin/Model/FormModelBuilder/FormModelBuilderEstateDetailSettings.php:245 #: plugin/Model/FormModelBuilder/FormModelBuilderSimilarEstateSettings.php:215 -msgid "Template" +msgid "Templates" msgstr "Sjabloon" #: plugin/Model/FormModelBuilder/FormModelBuilderDBAddress.php:94 diff --git a/plugin/Controller/DetailViewPostSaveController.php b/plugin/Controller/DetailViewPostSaveController.php index 444b7ac12..24b91bcfc 100644 --- a/plugin/Controller/DetailViewPostSaveController.php +++ b/plugin/Controller/DetailViewPostSaveController.php @@ -321,9 +321,11 @@ private function deletePageShortCode($listView,$post,$tableName,$column,$primaKe } if (strpos($view->page_shortcode,(string)$postID)!== false) { - $pageID = chop($view->page_shortcode,$postID); - $pageID = trim($pageID,","); - $pageID = str_replace(",,",",",$pageID); + $pageShortCode = explode(",",$view->page_shortcode); + if (($keyPageDelete = array_search($postID, $pageShortCode)) !== false) { + unset($pageShortCode[$keyPageDelete]); + } + $pageID = implode(",",$pageShortCode); $pRecordReadListView->updateColumnPageShortCode($pageID,$view->$primaKey,$tableName,$column); } diff --git a/plugin/Gui/Table/AddressListTable.php b/plugin/Gui/Table/AddressListTable.php index 273782b17..06e83fab9 100644 --- a/plugin/Gui/Table/AddressListTable.php +++ b/plugin/Gui/Table/AddressListTable.php @@ -174,7 +174,7 @@ public function prepare_items() $columns = [ 'cb' => '', 'name' => __('Name of View', 'onoffice-for-wp-websites'), - 'template' => __('Tempaltes', 'onoffice-for-wp-websites'), + 'template' => __('Templates', 'onoffice-for-wp-websites'), 'shortcode' => __('Shortcode', 'onoffice-for-wp-websites'), 'page_shortcode' => __('Page with Shortcode', 'onoffice-for-wp-websites'), ]; diff --git a/plugin/Gui/Table/EstateListTable.php b/plugin/Gui/Table/EstateListTable.php index a131ec279..42d33ec2f 100644 --- a/plugin/Gui/Table/EstateListTable.php +++ b/plugin/Gui/Table/EstateListTable.php @@ -130,7 +130,8 @@ private function handleRecord($listRecord) { return []; } - foreach ($listRecord as &$record) + $recordEstate = []; + foreach ($listRecord as $record) { if (!empty($record->page_shortcode)) { @@ -142,12 +143,13 @@ private function handleRecord($listRecord) { $page .= ','; } - $page .= "".get_the_title((int)$pageID).""; + $page .= "".esc_html(get_the_title((int)$pageID)).""; } $record->page_shortcode = $page; } + $recordEstate[] = $record; } - return $listRecord; + return $recordEstate; } /** diff --git a/plugin/Gui/Table/FormsTable.php b/plugin/Gui/Table/FormsTable.php index 841f4fd51..59f333b06 100644 --- a/plugin/Gui/Table/FormsTable.php +++ b/plugin/Gui/Table/FormsTable.php @@ -151,7 +151,7 @@ public function prepare_items() $columns = array( 'cb' => '', 'name' => __('Name of Form', 'onoffice-for-wp-websites'), - 'template' => __('Tempaltes', 'onoffice-for-wp-websites'), + 'template' => __('Templates', 'onoffice-for-wp-websites'), 'form_type' => __('Type of Form', 'onoffice-for-wp-websites'), 'shortcode' => __('Shortcode', 'onoffice-for-wp-websites'), 'page_shortcode' => __('Page with Shortcode', 'onoffice-for-wp-websites'), From 500acc06522536ff61c11e90b14dc34e591971f6 Mon Sep 17 00:00:00 2001 From: TangHien4698 Date: Wed, 12 Jan 2022 08:52:52 +0700 Subject: [PATCH 06/10] 56183-Optimize-columns-on-list-views-for-forms-estates-and-addresses --- plugin/Gui/Table/AddressListTable.php | 26 ------------------------- plugin/Gui/Table/EstateListTable.php | 28 --------------------------- plugin/Gui/Table/FormsTable.php | 25 ------------------------ plugin/Gui/Table/WP/ListTable.php | 27 ++++++++++++++++++++++++++ 4 files changed, 27 insertions(+), 79 deletions(-) diff --git a/plugin/Gui/Table/AddressListTable.php b/plugin/Gui/Table/AddressListTable.php index 06e83fab9..6992c7075 100644 --- a/plugin/Gui/Table/AddressListTable.php +++ b/plugin/Gui/Table/AddressListTable.php @@ -94,32 +94,6 @@ private function fillData() ]); } - private function handleRecord($listRecord) - { - if (empty($listRecord)) - { - return []; - } - foreach ($listRecord as &$record) - { - if (!empty($record->page_shortcode)) - { - $listPageID = explode(',',$record->page_shortcode); - $page = ''; - foreach ($listPageID as $pageID) - { - if (!empty($page)) - { - $page .= ','; - } - $page .= "".get_the_title((int)$pageID).""; - } - $record->page_shortcode = $page; - } - } - return $listRecord; - } - /** * * @return array diff --git a/plugin/Gui/Table/EstateListTable.php b/plugin/Gui/Table/EstateListTable.php index 42d33ec2f..c2c6f78cb 100644 --- a/plugin/Gui/Table/EstateListTable.php +++ b/plugin/Gui/Table/EstateListTable.php @@ -124,34 +124,6 @@ private function fillData() ]); } - private function handleRecord($listRecord) - { - if (empty($listRecord)) - { - return []; - } - $recordEstate = []; - foreach ($listRecord as $record) - { - if (!empty($record->page_shortcode)) - { - $listPageID = explode(',',$record->page_shortcode); - $page = ''; - foreach ($listPageID as $pageID) - { - if (!empty($page)) - { - $page .= ','; - } - $page .= "".esc_html(get_the_title((int)$pageID)).""; - } - $record->page_shortcode = $page; - } - $recordEstate[] = $record; - } - return $recordEstate; - } - /** * */ diff --git a/plugin/Gui/Table/FormsTable.php b/plugin/Gui/Table/FormsTable.php index 59f333b06..110d872b7 100644 --- a/plugin/Gui/Table/FormsTable.php +++ b/plugin/Gui/Table/FormsTable.php @@ -116,31 +116,6 @@ private function fillData() $this->_countByType = $pRecordRead->getCountByType(); } - private function handleRecord($listRecord) - { - if (empty($listRecord)) - { - return []; - } - foreach ($listRecord as &$record) - { - if (!empty($record->page_shortcode)) - { - $listPageID = explode(',',$record->page_shortcode); - $page = ''; - foreach ($listPageID as $pageID) - { - if (!empty($page)) - { - $page .= ','; - } - $page .= "".get_the_title((int)$pageID).""; - } - $record->page_shortcode = $page; - } - } - return $listRecord; - } /** * diff --git a/plugin/Gui/Table/WP/ListTable.php b/plugin/Gui/Table/WP/ListTable.php index 89b414601..57c3ae504 100644 --- a/plugin/Gui/Table/WP/ListTable.php +++ b/plugin/Gui/Table/WP/ListTable.php @@ -145,4 +145,31 @@ protected function setItems(array $items) /** @return array */ protected function getItems() { return $this->items; } + + protected function handleRecord(array $records) + { + if (empty($records)) + { + return []; + } + $recordHandled = []; + foreach ($records as $record) + { + if (!empty($record->page_shortcode)) + { + $listPageID = explode(',',$record->page_shortcode); + $pages = ''; + $listPage = []; + foreach ($listPageID as $pageID) + { + $listPage[] = "".esc_html(get_the_title((int)$pageID)).""; + } + $pages = implode(',',$listPage); + $record->page_shortcode = $pages; + } + $recordHandled[] = $record; + } + return $recordHandled; + } + } From 6609639a29d19177664cb0b0ec0ee2f867444dab Mon Sep 17 00:00:00 2001 From: TangHien4698 Date: Wed, 26 Jan 2022 15:09:33 +0700 Subject: [PATCH 07/10] update oder field Alpha --- plugin/Gui/Table/AddressListTable.php | 35 ++++++++++++++++++++++++--- plugin/Gui/Table/EstateListTable.php | 7 ++---- plugin/Gui/Table/FormsTable.php | 5 ++-- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/plugin/Gui/Table/AddressListTable.php b/plugin/Gui/Table/AddressListTable.php index 6992c7075..72046b5bc 100644 --- a/plugin/Gui/Table/AddressListTable.php +++ b/plugin/Gui/Table/AddressListTable.php @@ -23,6 +23,8 @@ use onOffice\WPlugin\Gui\Table\WP\ListTable; use onOffice\WPlugin\Record\RecordManagerReadListViewAddress; +use onOffice\WPlugin\FilterCall; +use onOffice\SDK\onOfficeSDK; use function __; use function admin_url; use function esc_html; @@ -43,6 +45,8 @@ class AddressListTable /** @var int */ private $_itemsPerPage = null; + /** @var FilterCall */ + private $_pFilterCall = null; /** * @@ -59,6 +63,7 @@ public function __construct($args = []) ]); $this->_itemsPerPage = $this->get_items_per_page('onoffice-address-listview_per_page', 10); + $this->_pFilterCall = new FilterCall(onOfficeSDK::MODULE_ADDRESS); } @@ -77,12 +82,12 @@ private function fillData() $pRecordRead->setOffset($offset); $pRecordRead->addColumn('listview_address_id', 'ID'); $pRecordRead->addColumn('name'); + $pRecordRead->addColumn('filterId'); $pRecordRead->addColumn('template'); $pRecordRead->addColumn('name', 'shortcode'); $pRecordRead->addColumn('page_shortcode'); - $this->setItems($pRecordRead->getRecordsSortedAlphabetically()); - $pRecord = $pRecordRead->getRecords(); + $pRecord = $pRecordRead->getRecordsSortedAlphabetically(); $pRecord = $this->handleRecord($pRecord); $this->setItems($pRecord); $itemsCount = $pRecordRead->getCountOverall(); @@ -93,7 +98,29 @@ private function fillData() 'total_pages' => ceil($itemsCount / 10) ]); } + /** + * + * @param object $pItem + * @return string + * + */ + protected function column_filtername($pItem) + { + $filterName = ''; + try { + if ($pItem->filterId != 0) { + $filterName = $this->_pFilterCall->getFilternameById($pItem->filterId); + } + } catch (APIClientCredentialsException $pCredentialsException) { + $filterName = __('(Needs valid API credentials)', 'onoffice-for-wp-websites'); + } catch (UnknownFilterException $pFilterException) { + /* translators: %s will be replaced with a number. */ + $filterName = sprintf(__('(Unknown Filter (ID: %s))', 'onoffice-for-wp-websites'), + $pFilterException->getFilterId()); + } + return $filterName; + } /** * * @return array @@ -105,6 +132,7 @@ public function get_columns() return [ 'cb' => '', 'name' => __('Name of View', 'onoffice-for-wp-websites'), + 'filtername' => __('Filter', 'onoffice-for-wp-websites'), 'shortcode' => __('Shortcode', 'onoffice-for-wp-websites'), ]; } @@ -148,12 +176,13 @@ public function prepare_items() $columns = [ 'cb' => '', 'name' => __('Name of View', 'onoffice-for-wp-websites'), + 'filtername' => __('Filter', 'onoffice-for-wp-websites'), 'template' => __('Templates', 'onoffice-for-wp-websites'), 'shortcode' => __('Shortcode', 'onoffice-for-wp-websites'), 'page_shortcode' => __('Page with Shortcode', 'onoffice-for-wp-websites'), ]; - $hidden = ['ID']; + $hidden = ['ID','filterId']; $sortable = []; $this->_column_headers = [$columns, $hidden, $sortable, diff --git a/plugin/Gui/Table/EstateListTable.php b/plugin/Gui/Table/EstateListTable.php index c2c6f78cb..10d628497 100644 --- a/plugin/Gui/Table/EstateListTable.php +++ b/plugin/Gui/Table/EstateListTable.php @@ -105,14 +105,12 @@ private function fillData() $pRecordRead->addColumn('name'); $pRecordRead->addColumn('filterId'); $pRecordRead->addColumn('template'); - $pRecordRead->addColumn('show_status'); $pRecordRead->addColumn('list_type'); $pRecordRead->addColumn('name', 'shortcode'); $pRecordRead->addColumn('page_shortcode'); $pRecordRead->addWhere("`list_type` IN('default', 'reference', 'favorites')"); - $this->setItems($pRecordRead->getRecordsSortedAlphabetically()); - $pRecord = $pRecordRead->getRecords(); + $pRecord = $pRecordRead->getRecordsSortedAlphabetically(); $pRecord = $this->handleRecord($pRecord); $this->setItems($pRecord); $itemsCount = $pRecordRead->getCountOverall(); @@ -134,8 +132,7 @@ public function prepare_items() 'cb' => '', 'name' => __('Name of View', 'onoffice-for-wp-websites'), 'filtername' => __('Filter', 'onoffice-for-wp-websites'), - 'template' => __('Tempaltes', 'onoffice-for-wp-websites'), - 'show_status' => __('Show Status', 'onoffice-for-wp-websites'), + 'template' => __('Templates', 'onoffice-for-wp-websites'), 'list_type' => __('Type of List', 'onoffice-for-wp-websites'), 'shortcode' => __('Shortcode', 'onoffice-for-wp-websites'), 'page_shortcode' => __('Page with Shortcode', 'onoffice-for-wp-websites'), diff --git a/plugin/Gui/Table/FormsTable.php b/plugin/Gui/Table/FormsTable.php index 110d872b7..49db12c97 100644 --- a/plugin/Gui/Table/FormsTable.php +++ b/plugin/Gui/Table/FormsTable.php @@ -93,6 +93,7 @@ private function fillData() $pRecordRead->setOffset($offset); $pRecordRead->addColumn('form_id', 'ID'); $pRecordRead->addColumn('name'); + $pRecordRead->addColumn('recipient'); $pRecordRead->addColumn('template'); $pRecordRead->addColumn('form_type'); $pRecordRead->addColumn('name', 'shortcode'); @@ -101,10 +102,9 @@ private function fillData() $pRecordRead->addWhere("`form_type` = '".esc_sql($this->_listType)."'"); } - $pRecord = $pRecordRead->getRecords(); + $pRecord = $pRecordRead->getRecordsSortedAlphabetically(); $pRecord = $this->handleRecord($pRecord); $this->setItems($pRecord); - $this->setItems($pRecordRead->getRecordsSortedAlphabetically()); $itemsCount = $pRecordRead->getCountOverall(); $this->set_pagination_args( array( @@ -126,6 +126,7 @@ public function prepare_items() $columns = array( 'cb' => '', 'name' => __('Name of Form', 'onoffice-for-wp-websites'), + 'recipient' => __('Email Address', 'onoffice-for-wp-websites'), 'template' => __('Templates', 'onoffice-for-wp-websites'), 'form_type' => __('Type of Form', 'onoffice-for-wp-websites'), 'shortcode' => __('Shortcode', 'onoffice-for-wp-websites'), From d93dcbf63f349b487bde67b5f53601813521136e Mon Sep 17 00:00:00 2001 From: TangHien4698 Date: Wed, 26 Jan 2022 16:54:13 +0700 Subject: [PATCH 08/10] add exception --- plugin/Gui/Table/AddressListTable.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin/Gui/Table/AddressListTable.php b/plugin/Gui/Table/AddressListTable.php index 72046b5bc..923814b2d 100644 --- a/plugin/Gui/Table/AddressListTable.php +++ b/plugin/Gui/Table/AddressListTable.php @@ -23,6 +23,8 @@ use onOffice\WPlugin\Gui\Table\WP\ListTable; use onOffice\WPlugin\Record\RecordManagerReadListViewAddress; +use onOffice\WPlugin\Controller\Exception\UnknownFilterException; +use onOffice\WPlugin\API\APIClientCredentialsException; use onOffice\WPlugin\FilterCall; use onOffice\SDK\onOfficeSDK; use function __; From 38668ef7975df325a61391d6ff1ec718f3fe0f3e Mon Sep 17 00:00:00 2001 From: tang-hien-egs Date: Thu, 10 Mar 2022 15:02:51 +0700 Subject: [PATCH 09/10] change delete page use shortcode --- plugin/Controller/DetailViewPostSaveController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugin/Controller/DetailViewPostSaveController.php b/plugin/Controller/DetailViewPostSaveController.php index 24b91bcfc..3e251c3ef 100644 --- a/plugin/Controller/DetailViewPostSaveController.php +++ b/plugin/Controller/DetailViewPostSaveController.php @@ -27,6 +27,7 @@ use onOffice\WPlugin\Record\RecordManagerReadListViewAddress; use onOffice\WPlugin\Record\RecordManagerReadForm; +use PHPStan\Rules\Variables\VariableCloningRule; use WP_Post; /** @@ -131,6 +132,7 @@ public function onMoveTrash($postId) { flush_rewrite_rules(); } $pPost = get_post($postId); +// var_dump($pPost); $this->deletePageUseShortCode($pPost); } @@ -257,8 +259,12 @@ private function deletePageUseShortCode($post) $listViewAddress = $this->getListViewAddress(); $listForm = $this->getListForm(); $isRevision = wp_is_post_revision($post); +// var_dump($isRevision); +// die(); if (!$isRevision) { $postContent = $post->post_content; +// var_dump(strpos($postContent,'oo_address') !== false); +// die(); $postID = $post->ID; if (empty($postID)) { @@ -317,7 +323,7 @@ private function deletePageShortCode($listView,$post,$tableName,$column,$primaKe $pageID = ''; if (empty($view->page_shortcode)) { - break; + continue; } if (strpos($view->page_shortcode,(string)$postID)!== false) { From 893ac08985beb209d6be8d8d46c5b19702410d4f Mon Sep 17 00:00:00 2001 From: tang-hien-egs Date: Thu, 10 Mar 2022 23:02:40 +0700 Subject: [PATCH 10/10] romove comment in code --- plugin/Controller/DetailViewPostSaveController.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/plugin/Controller/DetailViewPostSaveController.php b/plugin/Controller/DetailViewPostSaveController.php index 3e251c3ef..799ba15ea 100644 --- a/plugin/Controller/DetailViewPostSaveController.php +++ b/plugin/Controller/DetailViewPostSaveController.php @@ -27,7 +27,6 @@ use onOffice\WPlugin\Record\RecordManagerReadListViewAddress; use onOffice\WPlugin\Record\RecordManagerReadForm; -use PHPStan\Rules\Variables\VariableCloningRule; use WP_Post; /** @@ -132,7 +131,6 @@ public function onMoveTrash($postId) { flush_rewrite_rules(); } $pPost = get_post($postId); -// var_dump($pPost); $this->deletePageUseShortCode($pPost); } @@ -259,12 +257,9 @@ private function deletePageUseShortCode($post) $listViewAddress = $this->getListViewAddress(); $listForm = $this->getListForm(); $isRevision = wp_is_post_revision($post); -// var_dump($isRevision); -// die(); + if (!$isRevision) { $postContent = $post->post_content; -// var_dump(strpos($postContent,'oo_address') !== false); -// die(); $postID = $post->ID; if (empty($postID)) {