<?php
/* Copyright (C) 2021  MB Informatique         <info@mb-informatique.fr> */

class HolidaySign extends Holiday
{
    public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
    {
        global $conf, $langs;

        try {
            if (!file_exists(DOL_DOCUMENT_ROOT.'/custom/mbisignature/newonlinesign.php'))
                throw new Exception ('Does not exist');
            else
                $path = "custom/mbisignature";
        }
        catch(Exception $e) {
            $path = "mbisignature";
        }

        $langs->load("holiday");
        $outputlangs->load("holiday");

        if (!dol_strlen($modele)) {
            $modele = 'holiday_sign';

            if ($this->model_pdf) {
                $modele = $this->model_pdf;
            }
        }

        $modelpath = $path . "/core/modules/holiday/doc/";

        return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
    }
}
