switch ( $option ) {
case 'delete':
- // echo '<pre>$this->entryId: ' . print_r( $this->entryId, true ) . '</pre>';
if ( $this->entryId ) {
$return = $this->deleteEntry( $this->entryId, true, 'id' );
- // echo '<pre>$return: ' . print_r( $return, true ) . '</pre>';
+ // Need to delete the notes, contacts and referredby also
+ $this->wpdb->delete(
+ GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'lead_notes',
+ array( 'lead' => $this->entryId ),
+ array( '%d' )
+ );
+ $this->wpdb->delete(
+ GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'lead_contacts',
+ array( 'lead' => $this->entryId ),
+ array( '%d' )
+ );
+ $this->wpdb->delete(
+ GLM_MEMBERS_TRAVEL_PLUGIN_DB_PREFIX . 'leads_referredby',
+ array( 'lead' => $this->entryId ),
+ array( '%d' )
+ );
}
$entry = $this->getList();
$view = 'index.html';
);
}
+
+if ( current_user_can( 'glm_members_management' ) ) {
+ add_filter(
+ 'glm-member-db-add-tab-for-import',
+ function( $addOnTabs ){
+ $newTabs = array(
+ array(
+ 'text' => 'Travel Leads',
+ 'menu' => 'import',
+ 'action' => 'travel',
+ )
+ );
+ $addOnTabs = array_merge( $addOnTabs, $newTabs );
+ return $addOnTabs;
+ }
+ );
+}
'index' => GLM_MEMBERS_TRAVEL_PLUGIN_SLUG,
'members' => GLM_MEMBERS_TRAVEL_PLUGIN_SLUG,
),
+ 'import' =>array(
+ 'travel' => GLM_MEMBERS_TRAVEL_PLUGIN_SLUG,
+ ),
),
'frontActions' => array(
)