Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi name templates #215

Open
tronx2100 opened this issue Jun 13, 2024 · 0 comments
Open

multi name templates #215

tronx2100 opened this issue Jun 13, 2024 · 0 comments

Comments

@tronx2100
Copy link

to add multiname templates we can easy do it in pdf_rfltr_default.modules.php starting on line 148

            // add this
            $title = "";  
            $rowid = $object->array_options['options_rfltr_model_id'];
            if ($rowid > 0) {
                $sql = "SELECT title FROM " . MAIN_DB_PREFIX . "referenceletters WHERE rowid = " . $this->db->escape($rowid) . ";";
                $this->db->begin();
                dol_syslog(get_class($this) . "::" . __METHOD__, LOG_DEBUG);
                $resql = $this->db->query($sql);
                if ($resql) {
                    if ($this->db->num_rows($resql) > 0) {
                        $obj = $this->db->fetch_object($resql);
                        $title = '_'.$obj->title;
                    }
                }
            }
            $file_dest = $dir_dest . '/' . $objectref .$title. '.pdf';   // change this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant