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

#1789 [NumberingModule] add: custom numbering model like dolibarr native #1790

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions admin/control.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
exit;
}

// Actions set_mod, update_mask
require_once __DIR__ . '/../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

/*
* View
*/
Expand Down
7 changes: 2 additions & 5 deletions admin/question.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,8 @@
//Extrafields actions
require DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php';

//Set numering modele for control object
if ($action == 'setmod') {
$constforval = 'DIGIQUALI_' . strtoupper('question') . "_ADDON";
dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
}
// Actions set_mod, update_mask
require_once __DIR__ . '/../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

/*
* View
Expand Down
3 changes: 3 additions & 0 deletions admin/sheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@
exit;
}

// Actions set_mod, update_mask
require_once __DIR__ . '/../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

/*
* View
*/
Expand Down
3 changes: 3 additions & 0 deletions admin/survey.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
// Extrafields actions
require_once DOL_DOCUMENT_ROOT . '/core/actions_extrafields.inc.php';

// Actions set_mod, update_mask
require_once __DIR__ . '/../../saturne/core/tpl/actions/admin_conf_actions.tpl.php';

/*
* View
*/
Expand Down
63 changes: 63 additions & 0 deletions core/modules/digiquali/answer/mod_answer_custom.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/* Copyright (C) 2024 EVARISK <[email protected]>
*
* 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
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/

/**
* \file core/modules/digiquali/answer/mod_answer_custom.php
* \ingroup digiquali
* \brief File of class to manage mod_answer_custom numbering rules standard.
*/

// Load Saturne libraries.
require_once __DIR__ . '/../../../../../saturne/core/modules/saturne/modules_saturne.php';

/**
* Class to manage answer numbering rules custom.
*/
class mod_answer_custom extends CustomModeleNumRefSaturne
{
/**
* @var string Numbering module ref prefix.
*/
public string $prefix = 'AN';

/**
* @var string Name.
*/
public string $name = 'Pan';

/**
* Return description of module
*
* @param String $mode Either "standard" for normal prefix or "custom"
* @return String Descriptive text
*/
public function info($mode = 'custom'): string
{
return parent::info($mode);
}

/**
* Return next value
*
* @return string Value if OK, 0 if KO
*/
public function getNextValue(object $object): string
{
return parent::getNextCustomValue($object);
}
}
63 changes: 63 additions & 0 deletions core/modules/digiquali/control/mod_control_custom.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/* Copyright (C) 2024 EVARISK <[email protected]>
*
* 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
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/

/**
* \file core/modules/digiquali/control/mod_control_custom.php
* \ingroup digiquali
* \brief File of class to manage mod_control_custom numbering rules standard.
*/

// Load Saturne libraries.
require_once __DIR__ . '/../../../../../saturne/core/modules/saturne/modules_saturne.php';

/**
* Class to manage control numbering rules custom.
*/
class mod_control_custom extends CustomModeleNumRefSaturne
{
/**
* @var string Numbering module ref prefix.
*/
public string $prefix = 'FC';

/**
* @var string Name.
*/
public string $name = 'Daphnis';

/**
* Return description of module
*
* @param String $mode Either "standard" for normal prefix or "custom"
* @return String Descriptive text
*/
public function info($mode = 'custom'): string
{
return parent::info($mode);
}

/**
* Return next value
*
* @return string Value if OK, 0 if KO
*/
public function getNextValue(object $object): string
{
return parent::getNextCustomValue($object);
}
}
63 changes: 63 additions & 0 deletions core/modules/digiquali/controldet/mod_controldet_custom.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/* Copyright (C) 2024 EVARISK <[email protected]>
*
* 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
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/

/**
* \file core/modules/digiquali/controldet/mod_controldet_custom.php
* \ingroup digiquali
* \brief File of class to manage mod_controldet_custom numbering rules standard.
*/

// Load Saturne libraries.
require_once __DIR__ . '/../../../../../saturne/core/modules/saturne/modules_saturne.php';

/**
* Class to manage controldet numbering rules custom.
*/
class mod_controldet_custom extends CustomModeleNumRefSaturne
{
/**
* @var string Numbering module ref prefix.
*/
public string $prefix = 'FCR';

/**
* @var string Name.
*/
public string $name = 'Atlas';

/**
* Return description of module
*
* @param String $mode Either "standard" for normal prefix or "custom"
* @return String Descriptive text
*/
public function info($mode = 'custom'): string
{
return parent::info($mode);
}

/**
* Return next value
*
* @return string Value if OK, 0 if KO
*/
public function getNextValue(object $object): string
{
return parent::getNextCustomValue($object);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/* Copyright (C) 2024 EVARISK <[email protected]>
*
* 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
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/

/**
* \file core/modules/digiquali/controlequipment/mod_control_equipment_custom.php
* \ingroup digiquali
* \brief File of class to manage mod_control_equipment_custom numbering rules standard.
*/

// Load Saturne libraries.
require_once __DIR__ . '/../../../../../saturne/core/modules/saturne/modules_saturne.php';

/**
* Class to manage controlequipment numbering rules custom.
*/
class mod_control_equipment_custom extends CustomModeleNumRefSaturne
{
/**
* @var string Numbering module ref prefix.
*/
public string $prefix = 'FCE';

/**
* @var string Name.
*/
public string $name = 'Janus';

/**
* Return description of module
*
* @param String $mode Either "standard" for normal prefix or "custom"
* @return String Descriptive text
*/
public function info($mode = 'custom'): string
{
return parent::info($mode);
}

/**
* Return next value
*
* @return string Value if OK, 0 if KO
*/
public function getNextValue(object $object): string
{
return parent::getNextCustomValue($object);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/* Copyright (C) 2024 EVARISK <[email protected]>
*
* 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
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/

/**
* \file core/modules/digiquali/controldocument/mod_controldocument_custom.php
* \ingroup digiquali
* \brief File of class to manage mod_controldocument_custom numbering rules standard.
*/

// Load Saturne libraries.
require_once __DIR__ . '/../../../../../../saturne/core/modules/saturne/modules_saturne.php';

/**
* Class to manage controldocument numbering rules custom.
*/
class mod_controldocument_custom extends CustomModeleNumRefSaturne
{
/**
* @var string Numbering module ref prefix.
*/
public string $prefix = 'FCD';

/**
* @var string Name.
*/
public string $name = 'Titan';

/**
* Return description of module
*
* @param String $mode Either "standard" for normal prefix or "custom"
* @return String Descriptive text
*/
public function info($mode = 'custom'): string
{
return parent::info($mode);
}

/**
* Return next value
*
* @return string Value if OK, 0 if KO
*/
public function getNextValue(object $object): string
{
return parent::getNextCustomValue($object);
}
}
Loading