2017-01-06 15:44:09 +00:00
|
|
|
<?php
|
|
|
|
|
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
|
|
|
|
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
2018-10-27 12:43:12 +00:00
|
|
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
2024-08-17 17:32:52 +00:00
|
|
|
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
2017-01-06 15:44:09 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2019-09-23 19:55:30 +00:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
* or see https://www.gnu.org/
|
2017-01-06 15:44:09 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2024-08-14 17:21:10 +00:00
|
|
|
* \class ModelePDFUser
|
2017-01-06 15:44:09 +00:00
|
|
|
* \brief Parent class for product code generators
|
|
|
|
|
*/
|
2018-08-13 15:26:32 +00:00
|
|
|
|
2017-01-06 15:44:09 +00:00
|
|
|
/**
|
2024-08-14 17:21:10 +00:00
|
|
|
* \file htdocs/core/modules/user/modules_user.class.php
|
2017-01-06 15:44:09 +00:00
|
|
|
* \ingroup contract
|
|
|
|
|
* \brief File with parent class for generating contracts to PDF and File of class to manage contract numbering
|
|
|
|
|
*/
|
|
|
|
|
|
2024-08-14 17:21:10 +00:00
|
|
|
require_once DOL_DOCUMENT_ROOT.'/core/class/commondocgenerator.class.php';
|
2018-08-13 15:26:32 +00:00
|
|
|
|
2017-01-06 15:44:09 +00:00
|
|
|
/**
|
|
|
|
|
* Parent class to manage intervention document templates
|
|
|
|
|
*/
|
|
|
|
|
abstract class ModelePDFUser extends CommonDocGenerator
|
|
|
|
|
{
|
2018-08-17 16:54:41 +00:00
|
|
|
/**
|
|
|
|
|
* @var string Error code (or message)
|
|
|
|
|
*/
|
2020-04-10 08:59:32 +00:00
|
|
|
public $error = '';
|
2017-01-06 15:44:09 +00:00
|
|
|
|
|
|
|
|
|
2020-10-31 13:32:18 +00:00
|
|
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
2017-01-06 15:44:09 +00:00
|
|
|
/**
|
2024-08-14 17:21:10 +00:00
|
|
|
* Return list of active generation modules
|
2017-01-06 15:44:09 +00:00
|
|
|
*
|
2024-08-14 17:21:10 +00:00
|
|
|
* @param DoliDB $db Database handler
|
|
|
|
|
* @param int<0,max> $maxfilenamelength Max length of value to show
|
|
|
|
|
* @return string[]|int<-1,0> List of templates
|
2017-01-06 15:44:09 +00:00
|
|
|
*/
|
2019-03-01 22:08:57 +00:00
|
|
|
public static function liste_modeles($db, $maxfilenamelength = 0)
|
2017-01-06 15:44:09 +00:00
|
|
|
{
|
2020-10-31 13:32:18 +00:00
|
|
|
// phpcs:enable
|
2020-04-10 08:59:32 +00:00
|
|
|
$type = 'user';
|
2021-02-09 13:18:27 +00:00
|
|
|
$list = array();
|
2017-01-06 15:44:09 +00:00
|
|
|
|
|
|
|
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
2021-02-09 13:18:27 +00:00
|
|
|
$list = getListOfModels($db, $type, $maxfilenamelength);
|
|
|
|
|
return $list;
|
2017-01-06 15:44:09 +00:00
|
|
|
}
|
2024-08-14 17:21:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
|
|
|
/**
|
|
|
|
|
* Function to build a document
|
|
|
|
|
*
|
|
|
|
|
* @param User $object Object source to build document
|
|
|
|
|
* @param Translate $outputlangs Lang output object
|
|
|
|
|
* @param string $srctemplatepath Full path of source filename for generator using a template file
|
|
|
|
|
* @param int<0,1> $hidedetails Do not show line details
|
|
|
|
|
* @param int<0,1> $hidedesc Do not show desc
|
|
|
|
|
* @param int<0,1> $hideref Do not show ref
|
|
|
|
|
* @return int<-1,1> 1 if OK, <=0 if KO
|
|
|
|
|
*/
|
|
|
|
|
abstract public function write_file($object, $outputlangs, $srctemplatepath = '', $hidedetails = 0, $hidedesc = 0, $hideref = 0);
|
|
|
|
|
// phpcs:enable
|
2018-08-13 15:26:32 +00:00
|
|
|
}
|