| @@ -92,8 +92,14 @@ | ||
| 92 | 92 | $this->set('cached_entry', get_transient('e2pdf_' . $this->get('dataset'))); |
| 93 | 93 | } else { |
| 94 | 94 | $entry = FrmEntry::getOne($this->get('dataset')); |
| 95 | 95 | if ($entry && isset($entry->form_id) && $entry->form_id == $this->get('cached_form')->id) { |
| 96 | + if (!empty($entry->parent_item_id)) { | |
| 97 | + $parent_entry = FrmEntry::getOne($entry->parent_item_id); | |
| 98 | + if ($parent_entry && isset($parent_entry->form_id)) { | |
| 99 | + $entry->parent_entry = $parent_entry; | |
| 100 | + } | |
| 101 | + } | |
| 96 | 102 | $this->set('cached_entry', $entry); |
| 97 | 103 | } |
| 98 | 104 | } |
| 99 | 105 | } |
| @@ -101,8 +107,14 @@ | ||
| 101 | 107 | case 'dataset2': |
| 102 | 108 | if ($this->get('cached_form2') && $this->get('dataset2') && class_exists('FrmEntry')) { |
| 103 | 109 | $entry = FrmEntry::getOne($this->get('dataset2')); |
| 104 | 110 | if ($entry && isset($entry->form_id) && $entry->form_id == $this->get('cached_form2')->id) { |
| 111 | + if (!empty($entry->parent_item_id)) { | |
| 112 | + $parent_entry = FrmEntry::getOne($entry->parent_item_id); | |
| 113 | + if ($parent_entry && isset($parent_entry->form_id)) { | |
| 114 | + $entry->parent_entry = $parent_entry; | |
| 115 | + } | |
| 116 | + } | |
| 105 | 117 | $this->set('cached_entry2', $entry); |
| 106 | 118 | } |
| 107 | 119 | } |
| 108 | 120 | break; |
| @@ -327,8 +339,18 @@ | ||
| 327 | 339 | add_filter('frm_row_actions', array($this, 'hook_formidable_row_actions'), 10, 2); |
| 328 | 340 | |
| 329 | 341 | // frm-graph |
| 330 | 342 | add_filter('frm_graph_shortcode_custom_html', array($this, 'filter_frm_graph_shortcode_custom_html'), 99, 2); |
| 343 | + | |
| 344 | + // extension hooks | |
| 345 | + add_filter('e2pdf_extension_hooks', function ($hooks) { | |
| 346 | + $hooks[$this->info['key']] = [ | |
| 347 | + 'hook_formidable_entry_view' => __('WP Admin Entry View', 'e2pdf'), | |
| 348 | + 'hook_formidable_entry_edit' => __('WP Admin Entry Edit', 'e2pdf'), | |
| 349 | + 'hook_formidable_row_actions' => __('WP Admin Entry Row Actions', 'e2pdf') | |
| 350 | + ]; | |
| 351 | + return $hooks; | |
| 352 | + }); | |
| 331 | 353 | } |
| 332 | 354 | |
| 333 | 355 | public function action_frm_success_action() { |
| 334 | 356 | $this->set('iframe_download', true); |
| @@ -898,8 +920,14 @@ | ||
| 898 | 920 | } |
| 899 | 921 | } |
| 900 | 922 | } |
| 901 | 923 | |
| 924 | + if ($field->type === 'signature' && is_array($replace_with)) { | |
| 925 | + if (!empty($replace_with['format']) && $replace_with['format'] == 'drawn' && !empty($replace_with['output'])) { | |
| 926 | + return $replace_with['output']; | |
| 927 | + } | |
| 928 | + } | |
| 929 | + | |
| 902 | 930 | return $replace_with; |
| 903 | 931 | } |
| 904 | 932 | |
| 905 | 933 | /** |
| @@ -3514,10 +3542,12 @@ | ||
| 3514 | 3542 | $html = ''; |
| 3515 | 3543 | $source = ''; |
| 3516 | 3544 | |
| 3517 | 3545 | if ($this->get('item') && class_exists('FrmformsController')) { |
| 3518 | - if ($this->get('cached_form') && $this->get('cached_form')->parent_form_id) { | |
| 3519 | - return '<div class="e2pdf-vm-error">' . __("Child form doesn't support Visual Mapper", 'e2pdf') . '</div>'; | |
| 3546 | + $child = false; | |
| 3547 | + if ($this->get('cached_form') && !empty($this->get('cached_form')->parent_form_id)) { | |
| 3548 | + $child = true; | |
| 3549 | + $this->set('item', $this->get('cached_form')->parent_form_id); | |
| 3520 | 3550 | } |
| 3521 | 3551 | if (class_exists('FrmProFieldsHelper')) { |
| 3522 | 3552 | add_filter('frm_get_paged_fields', array($this, 'filter_remove_pagebreaks'), 9); |
| 3523 | 3553 | } |
| @@ -3621,12 +3651,12 @@ | ||
| 3621 | 3651 | /* |
| 3622 | 3652 | * Metas patterns to replace field names |
| 3623 | 3653 | * @since 0.01.42 |
| 3624 | 3654 | */ |
| 3625 | - $metas_pattern = array( | |
| 3626 | - '/item_meta\[(?:.*?)\]\[0\]\[(.*?)\](?:\[\])?/i' => '$1:1', | |
| 3655 | + $metas_pattern = [ | |
| 3656 | + '/item_meta\[(?:.*?)\]\[0\]\[(.*?)\](?:\[\])?/i' => $child ? '$1' : '$1:1', | |
| 3627 | 3657 | '/item_meta\[(.*?)\](\[\])?/i' => '$1', |
| 3628 | - ); | |
| 3658 | + ]; | |
| 3629 | 3659 | |
| 3630 | 3660 | // replace names |
| 3631 | 3661 | $metas = $xpath->query("//*[contains(@name, 'item_meta')]"); |
| 3632 | 3662 | foreach ($metas as $element) { |