info("the templateid is set"); $sql = "update vtiger_emailtemplates set foldername =?, templatename =?, subject =?, description =?, body =? where templateid =?"; $params = array($folderName, $templateName, $subject, $description, $body, $templateid); $adb->pquery($sql, $params); $log->info("about to invoke the detailviewemailtemplate file"); header("Location:index.php?module=Settings&action=detailviewemailtemplate&parenttab=Settings&templateid=".$templateid); } else { $templateid = $db->getUniqueID('vtiger_emailtemplates'); $sql = "insert into vtiger_emailtemplates values (?,?,?,?,?,?,?)"; $params = array($folderName, $templateName, $subject, $description, $body, 0, $templateid); $adb->pquery($sql, $params); $log->info("added to the db the emailtemplate"); header("Location:index.php?module=Settings&action=detailviewemailtemplate&parenttab=Settings&templateid=".$templateid); } ?>