Merge pull request #15127 from frederic34/task_universal

fix unknown property db
This commit is contained in:
Laurent Destailleur 2020-10-25 14:35:03 +01:00 committed by GitHub
commit f31b4ee49d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,12 +61,12 @@ class mod_task_universal extends ModeleNumRefTask
*/ */
public function info() public function info()
{ {
global $conf, $langs; global $conf, $langs, $db;
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("projects", "admin")); $langs->loadLangs(array("projects", "admin"));
$form = new Form($this->db); $form = new Form($db);
$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n"; $texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; $texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
@ -109,8 +109,7 @@ class mod_task_universal extends ModeleNumRefTask
$numExample = $this->getNextValue($mysoc, ''); $numExample = $this->getNextValue($mysoc, '');
$mysoc->code_client = $old_code_client; $mysoc->code_client = $old_code_client;
if (!$numExample) if (!$numExample) {
{
$numExample = $langs->trans('NotConfigured'); $numExample = $langs->trans('NotConfigured');
} }
return $numExample; return $numExample;
@ -132,8 +131,7 @@ class mod_task_universal extends ModeleNumRefTask
// On defini critere recherche compteur // On defini critere recherche compteur
$mask = $conf->global->PROJECT_TASK_UNIVERSAL_MASK; $mask = $conf->global->PROJECT_TASK_UNIVERSAL_MASK;
if (!$mask) if (!$mask) {
{
$this->error = 'NotConfigured'; $this->error = 'NotConfigured';
return 0; return 0;
} }