mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Qual: Enable phan on modulebuilder (#30652)
* Allow null for buyer, and force '' for in printObjectLine(s) * Allow null for Contact in show_actions_done * Qual: Enable phan on modulebuilder # Qual: Enable phan on modulebuilder Most files of the modulebuilder template can be checked as regular files. It will help improve the template * Update baseline (enable modulebuilder notices) * Add properties that are expected to exist on modules_boxes * Qual: Ignore false positive (phan) * Set phpdoc type to include null on formAddObjectLine * Qual: Fixes for modulebuilder (phan, phpstan, bugs, format) * Fix phpcs for intracom * Make ModeleBoxes:showBox() signature match child class's * Fix *box::showBox() phpdoc types * Update index.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
4e2842ca27
commit
b0087aaf61
|
|
@ -576,7 +576,10 @@ return [
|
|||
'htdocs/core/lib/intracommreport.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
'htdocs/core/lib/invoice.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
'htdocs/core/lib/invoice2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/core/lib/ldap.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
'htdocs/core/lib/ldap.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownArrayFunctionParamType'],
|
||||
'htdocs/core/lib/memory.lib.php' => ['PhanTypeMismatchDimFetch'],
|
||||
'htdocs/core/lib/multicurrency.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
|
||||
'htdocs/core/lib/pdf.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/lib/loan.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
'htdocs/core/lib/mailmanspip.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
'htdocs/core/lib/memory.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanTypeMismatchDimFetch'],
|
||||
|
|
@ -598,7 +601,7 @@ return [
|
|||
'htdocs/core/lib/resource.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
'htdocs/core/lib/salaries.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
'htdocs/core/lib/security.lib.php' => ['PhanPluginUnknownArrayFunctionParamType'],
|
||||
'htdocs/core/lib/security2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/lib/security2.lib.php' => ['PhanPluginUnknownArrayFunctionParamType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/lib/sendings.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'],
|
||||
'htdocs/core/lib/signature.lib.php' => ['PhanPossiblyUndeclaredVariable'],
|
||||
'htdocs/core/lib/socialnetwork.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
|
|
@ -975,7 +978,6 @@ return [
|
|||
'htdocs/margin/lib/margins.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
'htdocs/margin/productMargins.php' => ['PhanTypeMismatchArgumentProbablyReal'],
|
||||
'htdocs/master.inc.php' => ['PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/modulebuilder/index.php' => ['PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'],
|
||||
'htdocs/mrp/class/api_mos.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'],
|
||||
'htdocs/mrp/class/mo.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanPluginUnknownObjectMethodCall', 'PhanPossiblyUndeclaredVariable', 'PhanTypeMismatchProperty'],
|
||||
'htdocs/mrp/lib/mrp.lib.php' => ['PhanPluginUnknownArrayFunctionReturnType'],
|
||||
|
|
|
|||
|
|
@ -323,12 +323,12 @@ return [
|
|||
// mymodule seen in cti, but not in git.
|
||||
.'|htdocs/custom/mymodule/.*' // @phpstan-ignore-line
|
||||
.'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line
|
||||
.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
|
||||
//.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line
|
||||
// Included as stub (better analysis)
|
||||
.'|htdocs/includes/nusoap/.*' // @phpstan-ignore-line
|
||||
// Included as stub (old version + incompatible typing hints)
|
||||
.'|htdocs/includes/restler/.*' // @phpstan-ignore-line
|
||||
// Included as stub (did not seem properly analysed by phan without it)
|
||||
// Included as stub (did not seem properly analyzed by phan without it)
|
||||
.'|htdocs/includes/stripe/.*' // @phpstan-ignore-line
|
||||
.'|htdocs/conf/conf.php' // @phpstan-ignore-line
|
||||
// .'|htdocs/[^h].*/.*' // For testing @phpstan-ignore-line
|
||||
|
|
|
|||
|
|
@ -175,10 +175,14 @@ class DolibarrApi
|
|||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object datas
|
||||
* Clean sensitive object data
|
||||
* @phpstan-template T of Object
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @phpstan-param T $object
|
||||
* @phpstan-return T
|
||||
*/
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -133,7 +134,7 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedManualEntries").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedManualEntries").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -141,7 +142,7 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -156,9 +157,9 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -109,9 +110,9 @@ class box_accountancy_suspense_account extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -142,7 +143,7 @@ class box_actions extends ModeleBoxes
|
|||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="tdoverflowmax200"',
|
||||
'text' => $actionstatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'text2' => $late,
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
|
|
@ -176,7 +177,7 @@ class box_actions extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoActionsToDo").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoActionsToDo").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +185,7 @@ class box_actions extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql)
|
||||
);
|
||||
}
|
||||
|
|
@ -199,9 +200,9 @@ class box_actions extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -145,7 +146,7 @@ class box_actions_future extends ModeleBoxes
|
|||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="tdoverflowmax200"',
|
||||
'text' => $actionstatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'text2' => $late,
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
|
|
@ -179,7 +180,7 @@ class box_actions_future extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoActionsToDo").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoActionsToDo").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -187,7 +188,7 @@ class box_actions_future extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql)
|
||||
);
|
||||
}
|
||||
|
|
@ -202,9 +203,9 @@ class box_actions_future extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014-2021 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -88,7 +89,7 @@ class box_activity extends ModeleBoxes
|
|||
$textHead = $langs->trans("Activity").' - '.$langs->trans("LastXMonthRolling", $nbofperiod);
|
||||
$this->info_box_head = array(
|
||||
'text' => $textHead,
|
||||
'limit'=> dol_strlen($textHead),
|
||||
'limit' => dol_strlen($textHead),
|
||||
);
|
||||
|
||||
// compute the year limit to show
|
||||
|
|
@ -175,7 +176,7 @@ class box_activity extends ModeleBoxes
|
|||
if (count($data) == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=>'<span class="opacitymedium">'.$langs->trans("NoRecordedProposals").'</span>',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedProposals").'</span>',
|
||||
);
|
||||
$line++;
|
||||
}
|
||||
|
|
@ -235,7 +236,7 @@ class box_activity extends ModeleBoxes
|
|||
|
||||
$this->info_box_contents[$line][1] = array(
|
||||
'td' => '',
|
||||
'text' =>$langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut, 0, 0),
|
||||
'text' => $langs->trans("Orders")." ".$commandestatic->LibStatut($data[$j]->fk_statut, 0, 0),
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][2] = array(
|
||||
|
|
@ -261,7 +262,7 @@ class box_activity extends ModeleBoxes
|
|||
if (count($data) == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=>$langs->trans("NoRecordedOrders"),
|
||||
'text' => $langs->trans("NoRecordedOrders"),
|
||||
);
|
||||
$line++;
|
||||
}
|
||||
|
|
@ -349,7 +350,7 @@ class box_activity extends ModeleBoxes
|
|||
if (count($data) == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=>$langs->trans("NoRecordedInvoices"),
|
||||
'text' => $langs->trans("NoRecordedInvoices"),
|
||||
);
|
||||
$line++;
|
||||
}
|
||||
|
|
@ -418,7 +419,7 @@ class box_activity extends ModeleBoxes
|
|||
if (count($data) == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=>$langs->trans("NoRecordedUnpaidInvoices"),
|
||||
'text' => $langs->trans("NoRecordedUnpaidInvoices"),
|
||||
);
|
||||
$line++;
|
||||
}
|
||||
|
|
@ -439,9 +440,9 @@ class box_activity extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -170,9 +170,9 @@ class box_birthdays extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -162,9 +162,9 @@ class box_birthdays_members extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -151,7 +152,7 @@ class box_boms extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -159,7 +160,7 @@ class box_boms extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -174,9 +175,9 @@ class box_boms extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -116,7 +117,7 @@ class box_bookmarks extends ModeleBoxes
|
|||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center" colspan="2"',
|
||||
'tooltip' => $mytxt,
|
||||
'url'=> DOL_URL_ROOT.'/bookmarks/list.php', 'text'=>$mytxt,
|
||||
'url' => DOL_URL_ROOT.'/bookmarks/list.php', 'text' => $mytxt,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +125,7 @@ class box_bookmarks extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -139,9 +140,9 @@ class box_bookmarks extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2021 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -149,7 +150,7 @@ class box_clients extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedCustomers").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedCustomers").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -157,7 +158,7 @@ class box_clients extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql)
|
||||
);
|
||||
}
|
||||
|
|
@ -172,9 +173,9 @@ class box_clients extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -188,7 +189,7 @@ class box_commandes extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -196,7 +197,7 @@ class box_commandes extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -211,9 +212,9 @@ class box_commandes extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -165,7 +166,7 @@ class box_comptes extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -180,9 +181,9 @@ class box_comptes extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2018 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
* Copyright (C) 2020 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -176,7 +177,7 @@ class box_contacts extends ModeleBoxes
|
|||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="nowrap right" width="18"',
|
||||
'text' => $contactstatic->getLibStatut(3),
|
||||
'asis'=>1,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$line++;
|
||||
|
|
@ -185,8 +186,8 @@ class box_contacts extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedContacts").'</span>',
|
||||
'asis'=> 1
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedContacts").'</span>',
|
||||
'asis' => 1
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -194,7 +195,7 @@ class box_contacts extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -209,9 +210,9 @@ class box_contacts extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -137,14 +138,14 @@ class box_contracts extends ModeleBoxes
|
|||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
'text' => $contractstatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'asis'=>1
|
||||
'text2' => $late,
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
|
||||
'text' => $thirdpartytmp->getNomUrl(1),
|
||||
'asis'=>1
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
|
|
@ -155,7 +156,7 @@ class box_contracts extends ModeleBoxes
|
|||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="nowraponall right"',
|
||||
'text' => $contractstatic->getLibStatut(7),
|
||||
'asis'=>1,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
$line++;
|
||||
|
|
@ -164,7 +165,7 @@ class box_contracts extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedContracts").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedContracts").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -172,7 +173,7 @@ class box_contracts extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -187,9 +188,9 @@ class box_contracts extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -149,7 +150,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
|
|||
if ($num == 0 || $nboutstandingbillreachedcustomers == 0) {
|
||||
$this->info_box_contents[0][] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("None").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("None").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -157,7 +158,7 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql)
|
||||
);
|
||||
}
|
||||
|
|
@ -172,9 +173,9 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -315,9 +315,9 @@ class box_dolibarr_state_board extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -102,9 +103,9 @@ class box_external_rss extends ModeleBoxes
|
|||
$this->info_box_head = array(
|
||||
'text' => $title,
|
||||
'sublink' => $link,
|
||||
'subtext'=>$langs->trans("LastRefreshDate").': '.($rssparser->getLastFetchDate() ? dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown")),
|
||||
'subpicto'=>'globe',
|
||||
'target'=>'_blank',
|
||||
'subtext' => $langs->trans("LastRefreshDate").': '.($rssparser->getLastFetchDate() ? dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown")),
|
||||
'subpicto' => 'globe',
|
||||
'target' => '_blank',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -206,9 +207,9 @@ class box_external_rss extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -223,9 +223,9 @@ class box_factures extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -219,9 +219,9 @@ class box_factures_fourn extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -261,9 +261,9 @@ class box_factures_fourn_imp extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -273,9 +273,9 @@ class box_factures_imp extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -150,9 +151,9 @@ class box_fediverse extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -153,7 +154,7 @@ class box_ficheinter extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedInterventions").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedInterventions").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -161,7 +162,7 @@ class box_ficheinter extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -176,9 +177,9 @@ class box_ficheinter extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2019 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -141,7 +142,7 @@ class box_fournisseurs extends ModeleBoxes
|
|||
$langs->load("suppliers");
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedSuppliers").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedSuppliers").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -149,7 +150,7 @@ class box_fournisseurs extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -164,9 +165,9 @@ class box_fournisseurs extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -312,9 +312,9 @@ class box_funnel_of_prospection extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No $stringtoprint .=, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No $stringtoprint .=, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -137,7 +138,7 @@ class box_goodcustomers extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedCustomers").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedCustomers").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -145,7 +146,7 @@ class box_goodcustomers extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -160,9 +161,9 @@ class box_goodcustomers extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -77,13 +78,13 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||
$text = $langs->trans("BoxCustomersInvoicesPerMonth", $max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'subclass'=>'linkobject boxfilter',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
'limit' => dol_strlen($text),
|
||||
'graph' => 1,
|
||||
'sublink' => '',
|
||||
'subtext' => $langs->trans("Filter"),
|
||||
'subpicto' => 'filter.png',
|
||||
'subclass' => 'linkobject boxfilter',
|
||||
'target' => 'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
|
|
@ -260,9 +261,9 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '</div>';
|
||||
$stringtoshow .= '</div>';
|
||||
}
|
||||
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat'=>$stringtoshow);
|
||||
$this->info_box_contents[0][0] = array('tr' => 'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat' => $stringtoshow);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength'=>500, 'text' => $mesg);
|
||||
$this->info_box_contents[0][0] = array('tr' => 'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength' => 500, 'text' => $mesg);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
|
|
@ -275,9 +276,9 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -74,13 +75,13 @@ class box_graph_invoices_peryear extends ModeleBoxes
|
|||
$text = $langs->trans("Turnover", $max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'subclass'=>'linkobject boxfilter',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
'limit' => dol_strlen($text),
|
||||
'graph' => 1,
|
||||
'sublink' => '',
|
||||
'subtext' => $langs->trans("Filter"),
|
||||
'subpicto' => 'filter.png',
|
||||
'subclass' => 'linkobject boxfilter',
|
||||
'target' => 'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
|
|
@ -193,9 +194,9 @@ class box_graph_invoices_peryear extends ModeleBoxes
|
|||
$stringtoshow .= '</form>';
|
||||
$stringtoshow .= '</div>';
|
||||
$stringtoshow .= $px2->show();
|
||||
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat'=>$stringtoshow);
|
||||
$this->info_box_contents[0][0] = array('tr' => 'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat' => $stringtoshow);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength'=>500, 'text' => $mesg);
|
||||
$this->info_box_contents[0][0] = array('tr' => 'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength' => 500, 'text' => $mesg);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
|
|
@ -208,9 +209,9 @@ class box_graph_invoices_peryear extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -75,13 +76,13 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||
$text = $langs->trans("BoxSuppliersInvoicesPerMonth", $max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'subclass'=>'linkobject boxfilter',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
'limit' => dol_strlen($text),
|
||||
'graph' => 1,
|
||||
'sublink' => '',
|
||||
'subtext' => $langs->trans("Filter"),
|
||||
'subpicto' => 'filter.png',
|
||||
'subclass' => 'linkobject boxfilter',
|
||||
'target' => 'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
|
|
@ -255,9 +256,9 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '</div>';
|
||||
$stringtoshow .= '</div>';
|
||||
}
|
||||
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat'=>$stringtoshow);
|
||||
$this->info_box_contents[0][0] = array('tr' => 'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat' => $stringtoshow);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength'=>500, 'text' => $mesg);
|
||||
$this->info_box_contents[0][0] = array('tr' => 'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength' => 500, 'text' => $mesg);
|
||||
}
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
|
|
@ -270,9 +271,9 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -203,9 +204,9 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -164,7 +165,7 @@ class box_graph_nb_tickets_type extends ModeleBoxes
|
|||
$stringtoprint .= $px1->show($totalnb ? 0 : 1);
|
||||
}
|
||||
$stringtoprint .= '</div>';
|
||||
$this->info_box_contents[][]=array(
|
||||
$this->info_box_contents[][] = array(
|
||||
'td' => 'class="center"',
|
||||
'text' => $stringtoprint
|
||||
);
|
||||
|
|
@ -185,9 +186,9 @@ class box_graph_nb_tickets_type extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -166,9 +167,9 @@ class box_graph_new_vs_close_ticket extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -76,13 +77,13 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||
$text = $langs->trans("BoxCustomersOrdersPerMonth", $max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'subclass'=>'linkobject boxfilter',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
'limit' => dol_strlen($text),
|
||||
'graph' => 1,
|
||||
'sublink' => '',
|
||||
'subtext' => $langs->trans("Filter"),
|
||||
'subpicto' => 'filter.png',
|
||||
'subclass' => 'linkobject boxfilter',
|
||||
'target' => 'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
|
|
@ -260,15 +261,15 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '</div>';
|
||||
}
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'tr'=>'class="oddeven nohover"',
|
||||
'tr' => 'class="oddeven nohover"',
|
||||
'td' => 'class="nohover center"',
|
||||
'textnoformat'=>$stringtoshow,
|
||||
'textnoformat' => $stringtoshow,
|
||||
);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'tr'=>'class="oddeven nohover"',
|
||||
'tr' => 'class="oddeven nohover"',
|
||||
'td' => 'class="nohover left"',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => $mesg,
|
||||
);
|
||||
}
|
||||
|
|
@ -283,9 +284,9 @@ class box_graph_orders_permonth extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -75,13 +76,13 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||
$text = $langs->trans("BoxSuppliersOrdersPerMonth", $max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'subclass'=>'linkobject boxfilter',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
'limit' => dol_strlen($text),
|
||||
'graph' => 1,
|
||||
'sublink' => '',
|
||||
'subtext' => $langs->trans("Filter"),
|
||||
'subpicto' => 'filter.png',
|
||||
'subclass' => 'linkobject boxfilter',
|
||||
'target' => 'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
|
|
@ -259,15 +260,15 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '</div>';
|
||||
}
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'tr'=>'class="oddeven nohover"',
|
||||
'tr' => 'class="oddeven nohover"',
|
||||
'td' => 'class="nohover center"',
|
||||
'textnoformat'=>$stringtoshow,
|
||||
'textnoformat' => $stringtoshow,
|
||||
);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'tr'=>'class="oddeven nohover"',
|
||||
'tr' => 'class="oddeven nohover"',
|
||||
'td' => 'class="nohover left"',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => $mesg,
|
||||
);
|
||||
}
|
||||
|
|
@ -282,9 +283,9 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -125,13 +126,13 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
$text = $langs->trans("BoxProductDistribution", $max).' - '.$langs->trans("Year").': '.$year;
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1,
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'subclass'=>'linkobject boxfilter',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
'limit' => dol_strlen($text),
|
||||
'graph' => 1,
|
||||
'sublink' => '',
|
||||
'subtext' => $langs->trans("Filter"),
|
||||
'subpicto' => 'filter.png',
|
||||
'subclass' => 'linkobject boxfilter',
|
||||
'target' => 'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -154,7 +155,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
if (empty($data2)) {
|
||||
$showpointvalue = 0;
|
||||
$nocolor = 1;
|
||||
$data2 = array(array(0=>$langs->trans("None"), 1=>1));
|
||||
$data2 = array(array(0 => $langs->trans("None"), 1 => 1));
|
||||
}
|
||||
|
||||
$filenamenb = $dir."/prodserforpropal-".$year.".png";
|
||||
|
|
@ -217,7 +218,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
if (empty($data3)) {
|
||||
$showpointvalue = 0;
|
||||
$nocolor = 1;
|
||||
$data3 = array(array(0=>$langs->trans("None"), 1=>1));
|
||||
$data3 = array(array(0 => $langs->trans("None"), 1 => 1));
|
||||
}
|
||||
|
||||
$filenamenb = $dir."/prodserfororder-".$year.".png";
|
||||
|
|
@ -282,7 +283,7 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
if (empty($data1)) {
|
||||
$showpointvalue = 0;
|
||||
$nocolor = 1;
|
||||
$data1 = array(array(0=>$langs->trans("None"), 1=>1));
|
||||
$data1 = array(array(0 => $langs->trans("None"), 1 => 1));
|
||||
}
|
||||
$filenamenb = $dir."/prodserforinvoice-".$year.".png";
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=productstats&file=prodserforinvoice-'.$year.'.png';
|
||||
|
|
@ -408,12 +409,12 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
$this->info_box_contents[0][0] = array(
|
||||
'tr' => 'class="oddeven nohover"',
|
||||
'td' => 'class="nohover center"',
|
||||
'textnoformat'=>$stringtoshow,
|
||||
'textnoformat' => $stringtoshow,
|
||||
);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => 'class="nohover left"',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => '<span class="opacitymedium">'.$mesg.'</span>'
|
||||
);
|
||||
}
|
||||
|
|
@ -422,9 +423,9 @@ class box_graph_product_distribution extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -78,13 +79,13 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||
$text = $langs->trans("BoxProposalsPerMonth", $max);
|
||||
$this->info_box_head = array(
|
||||
'text' => $text,
|
||||
'limit'=> dol_strlen($text),
|
||||
'graph'=> 1, // Set to 1 if it's a box graph
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'subclass'=>'linkobject boxfilter',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
'limit' => dol_strlen($text),
|
||||
'graph' => 1, // Set to 1 if it's a box graph
|
||||
'sublink' => '',
|
||||
'subtext' => $langs->trans("Filter"),
|
||||
'subpicto' => 'filter.png',
|
||||
'subclass' => 'linkobject boxfilter',
|
||||
'target' => 'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
$dir = ''; // We don't need a path because image file will not be saved into disk
|
||||
|
|
@ -256,13 +257,13 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||
$stringtoshow .= '</div>';
|
||||
}
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'tr'=>'class="oddeven nohover"',
|
||||
'tr' => 'class="oddeven nohover"',
|
||||
'td' => 'class="nohover center"',
|
||||
'textnoformat'=>$stringtoshow,
|
||||
'textnoformat' => $stringtoshow,
|
||||
);
|
||||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'tr'=>'class="oddeven nohover"',
|
||||
'tr' => 'class="oddeven nohover"',
|
||||
'td' => 'class="nohover left"',
|
||||
'maxlength' => 500,
|
||||
'text' => $mesg,
|
||||
|
|
@ -279,9 +280,9 @@ class box_graph_propales_permonth extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -180,7 +181,7 @@ class box_graph_ticket_by_severity extends ModeleBoxes
|
|||
$stringtoprint .= $px1->show($totalnb ? 0 : 1);
|
||||
}
|
||||
$stringtoprint .= '</div>';
|
||||
$this->info_box_contents[][]=array(
|
||||
$this->info_box_contents[][] = array(
|
||||
'td' => 'class="center"',
|
||||
'text' => $stringtoprint
|
||||
);
|
||||
|
|
@ -201,9 +202,9 @@ class box_graph_ticket_by_severity extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -186,9 +186,9 @@ class box_last_knowledgerecord extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -186,9 +186,9 @@ class box_last_modified_knowledgerecord extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -175,7 +176,7 @@ class box_last_modified_ticket extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => '',
|
||||
'text'=>'<span class="opacitymedium">'.$langs->trans("BoxLastModifiedTicketNoRecordedTickets").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("BoxLastModifiedTicketNoRecordedTickets").'</span>'
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -192,9 +193,9 @@ class box_last_modified_ticket extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -186,9 +187,9 @@ class box_last_ticket extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2012 Charles-François BENKE <charles.fr@benke.fr>
|
||||
* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2014-2020 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -63,7 +64,7 @@ class box_lastlogin extends ModeleBoxes
|
|||
$textHead = $langs->trans("BoxLoginInformation");
|
||||
$this->info_box_head = array(
|
||||
'text' => $textHead,
|
||||
'limit'=> dol_strlen($textHead),
|
||||
'limit' => dol_strlen($textHead),
|
||||
);
|
||||
|
||||
$line = 0;
|
||||
|
|
@ -97,9 +98,9 @@ class box_lastlogin extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -257,9 +257,9 @@ class box_members_by_tags extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -257,9 +257,9 @@ class box_members_by_type extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -134,7 +135,7 @@ class box_members_last_modified extends ModeleBoxes
|
|||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax150 maxwidth150onsmartphone"',
|
||||
'text' =>$memberstatic->company,
|
||||
'text' => $memberstatic->company,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
|
|
@ -159,7 +160,7 @@ class box_members_last_modified extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=>$langs->trans("NoRecordedCustomers"),
|
||||
'text' => $langs->trans("NoRecordedCustomers"),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -167,7 +168,7 @@ class box_members_last_modified extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -182,9 +183,9 @@ class box_members_last_modified extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -158,7 +159,7 @@ class box_members_last_subscriptions extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedMembers").'</span>',
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedMembers").'</span>',
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -166,7 +167,7 @@ class box_members_last_subscriptions extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -181,9 +182,9 @@ class box_members_last_subscriptions extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -222,9 +222,9 @@ class box_members_subscriptions_by_year extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -148,7 +149,7 @@ class box_mos extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedOrders").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -156,7 +157,7 @@ class box_mos extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -171,9 +172,9 @@ class box_mos extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -236,9 +236,9 @@ class box_produits extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -228,9 +228,9 @@ class box_produits_alerte_stock extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Juan José Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -72,7 +73,7 @@ class box_project extends ModeleBoxes
|
|||
$totalnbTask = 0;
|
||||
|
||||
$textHead = $langs->trans("OpenedProjects");
|
||||
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
|
||||
$this->info_box_head = array('text' => $textHead, 'limit' => dol_strlen($textHead));
|
||||
|
||||
$i = 0;
|
||||
// list the summary of the orders
|
||||
|
|
@ -206,9 +207,9 @@ class box_project extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016 Juan José Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -69,7 +70,7 @@ class box_project_opportunities extends ModeleBoxes
|
|||
$this->max = $max;
|
||||
|
||||
$textHead = $langs->trans("OpenedProjectsOpportunities");
|
||||
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
|
||||
$this->info_box_head = array('text' => $textHead, 'limit' => dol_strlen($textHead));
|
||||
|
||||
$i = 0;
|
||||
// list the summary of the orders
|
||||
|
|
@ -146,7 +147,7 @@ class box_project_opportunities extends ModeleBoxes
|
|||
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="amount right nowraponall"', 'text' => ($projectstatic->opp_amount ? price($projectstatic->opp_amount) : ''));
|
||||
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="nowraponall"', 'asis'=>1, 'text' => ($projectstatic->opp_status_code ? $langs->trans("OppStatus".$projectstatic->opp_status_code).' ' : '').'<span class="opacitymedium small">('.round($projectstatic->opp_percent).'%)</span>');
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="nowraponall"', 'asis' => 1, 'text' => ($projectstatic->opp_status_code ? $langs->trans("OppStatus".$projectstatic->opp_status_code).' ' : '').'<span class="opacitymedium small">('.round($projectstatic->opp_percent).'%)</span>');
|
||||
|
||||
$this->info_box_contents[$i][] = array('td' => 'class="right"', 'text' => $projectstatic->getLibStatut(3));
|
||||
|
||||
|
|
@ -191,9 +192,9 @@ class box_project_opportunities extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2021 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -142,7 +143,7 @@ class box_propales extends ModeleBoxes
|
|||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="nowraponall"',
|
||||
'text' => $propalstatic->getNomUrl(1),
|
||||
'text2'=> $late,
|
||||
'text2' => $late,
|
||||
'asis' => 1,
|
||||
);
|
||||
|
||||
|
|
@ -173,7 +174,7 @@ class box_propales extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=>$langs->trans("NoRecordedProposals"),
|
||||
'text' => $langs->trans("NoRecordedProposals"),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -181,7 +182,7 @@ class box_propales extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -196,9 +197,9 @@ class box_propales extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2019 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -155,7 +156,7 @@ class box_prospect extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedProspects").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedProspects").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -178,9 +179,9 @@ class box_prospect extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2017 Nicolas Zabouri <info@inovea-conseil.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -194,9 +195,9 @@ class box_scheduled_jobs extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2017 Nicolas Zabouri <info@inovea-conseil.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -189,7 +190,7 @@ class box_services_contracts extends ModeleBoxes
|
|||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($datem, 'day', 'tzuserrel'),
|
||||
'text2'=> $late,
|
||||
'text2' => $late,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
|
|
@ -202,7 +203,7 @@ class box_services_contracts extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$i][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoContractedProducts").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoContractedProducts").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -225,9 +226,9 @@ class box_services_contracts extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -142,7 +143,7 @@ class box_services_expired extends ModeleBoxes
|
|||
$this->info_box_contents[$i][] = array(
|
||||
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateEndPlanned").': '.dol_print_date($dateline, 'dayhour', 'tzuserrel')).'"',
|
||||
'text' => dol_print_date($dateline, 'day', 'tzuserrel'),
|
||||
'text2'=> $late,
|
||||
'text2' => $late,
|
||||
);
|
||||
|
||||
$this->info_box_contents[$i][] = array(
|
||||
|
|
@ -166,7 +167,7 @@ class box_services_expired extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -181,9 +182,9 @@ class box_services_expired extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -100,7 +101,7 @@ class box_shipments extends ModeleBoxes
|
|||
$sql .= " AND e.fk_statut = 1";
|
||||
}
|
||||
if ($user->socid > 0) {
|
||||
$sql.= " AND s.rowid = ".((int) $user->socid);
|
||||
$sql .= " AND s.rowid = ".((int) $user->socid);
|
||||
}
|
||||
if (!$user->hasRight('societe', 'client', 'voir')) {
|
||||
$sql .= " AND sc.fk_user = ".((int) $user->id);
|
||||
|
|
@ -165,7 +166,7 @@ class box_shipments extends ModeleBoxes
|
|||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=> '<span class="opacitymedium">'.$langs->trans("NoRecordedShipments").'</span>'
|
||||
'text' => '<span class="opacitymedium">'.$langs->trans("NoRecordedShipments").'</span>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -173,7 +174,7 @@ class box_shipments extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][0] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -188,9 +189,9 @@ class box_shipments extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2015-2019 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -170,7 +171,7 @@ class box_supplier_orders extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -185,9 +186,9 @@ class box_supplier_orders extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -169,7 +170,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
|||
} else {
|
||||
$this->info_box_contents[0][] = array(
|
||||
'td' => '',
|
||||
'maxlength'=>500,
|
||||
'maxlength' => 500,
|
||||
'text' => ($this->db->error().' sql='.$sql),
|
||||
);
|
||||
}
|
||||
|
|
@ -184,9 +185,9 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2012-2018 Charlene BENKE <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -96,12 +97,12 @@ class box_task extends ModeleBoxes
|
|||
|
||||
$this->info_box_head = array(
|
||||
'text' => $textHead,
|
||||
'limit'=> dol_strlen($textHead),
|
||||
'sublink'=>'',
|
||||
'subtext'=>$langs->trans("Filter"),
|
||||
'subpicto'=>'filter.png',
|
||||
'subclass'=>'linkobject boxfilter',
|
||||
'target'=>'none' // Set '' to get target="_blank"
|
||||
'limit' => dol_strlen($textHead),
|
||||
'sublink' => '',
|
||||
'subtext' => $langs->trans("Filter"),
|
||||
'subpicto' => 'filter.png',
|
||||
'subclass' => 'linkobject boxfilter',
|
||||
'target' => 'none' // Set '' to get target="_blank"
|
||||
);
|
||||
|
||||
// list the summary of the orders
|
||||
|
|
@ -202,9 +203,9 @@ class box_task extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2016 Juan José Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -80,7 +81,7 @@ class box_validated_projects extends ModeleBoxes
|
|||
$totalnbTask = 0;
|
||||
|
||||
$textHead = $langs->trans("ProjectTasksWithoutTimeSpent");
|
||||
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
|
||||
$this->info_box_head = array('text' => $textHead, 'limit' => dol_strlen($textHead));
|
||||
|
||||
// list the summary of the orders
|
||||
if ($user->hasRight('projet', 'lire')) {
|
||||
|
|
@ -188,9 +189,9 @@ class box_validated_projects extends ModeleBoxes
|
|||
/**
|
||||
* Method to show box
|
||||
*
|
||||
* @param array $head Array with properties of box title
|
||||
* @param array $contents Array with properties of box lines
|
||||
* @param int $nooutput No print, only return string
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
|
|
|
|||
|
|
@ -219,12 +219,12 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
|
|||
/**
|
||||
* Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)
|
||||
*
|
||||
* @param array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput No print, only return string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head, $contents, $nooutput = 0)
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
global $langs, $user, $conf;
|
||||
|
||||
|
|
@ -243,6 +243,10 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
|
|||
$refresh = dol_cache_refresh($cachedir, $filename, $cachetime);
|
||||
$out = '';
|
||||
|
||||
if ($contents === null) {
|
||||
$contents = array();
|
||||
}
|
||||
|
||||
if ($refresh) {
|
||||
dol_syslog(get_class($this).'::showBox');
|
||||
|
||||
|
|
@ -442,8 +446,8 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
|
|||
* List is sorted by widget filename so by priority to run.
|
||||
*
|
||||
* @param ?string[] $forcedirwidget null=All default directories. This parameter is used by modulebuilder module only.
|
||||
* @return array<array{picto:string,file:string,fullpath:string,relpath:string,iscoreorexternal:'external'|'internal',version:string,status:string,info:string}> Array list of widgets
|
||||
*
|
||||
* @return array<array{picto:string,file:string,fullpath:string,relpath:string,iscoreorexternal:'external'|'internal',version:string,status:string,info:string}> Array list of widgets
|
||||
*
|
||||
*/
|
||||
public static function getWidgetsList($forcedirwidget = null)
|
||||
{
|
||||
|
|
@ -540,7 +544,8 @@ class ModeleBoxes // Can't be abstract as it is instantiated to build "empty" bo
|
|||
if (preg_match('/NORUN$/i', $files[$key])) {
|
||||
$disabledbyname = 1;
|
||||
}
|
||||
// We set info of modules
|
||||
|
||||
// We set info of modules @phan-suppress-next-line PhanUndeclaredProperty
|
||||
$widget[$j]['picto'] = ((!property_exists($objMod, 'picto') || empty($objMod->picto)) ? (empty($objMod->boximg) ? img_object('', 'generic') : $objMod->boximg) : img_object('', $objMod->picto));
|
||||
$widget[$j]['file'] = $files[$key];
|
||||
$widget[$j]['fullpath'] = $fullpath[$key];
|
||||
|
|
|
|||
|
|
@ -5120,7 +5120,7 @@ abstract class CommonObject
|
|||
*
|
||||
* @param int $dateSelector 1=Show also date range input fields
|
||||
* @param Societe $seller Object thirdparty who sell
|
||||
* @param Societe $buyer Object thirdparty who buy
|
||||
* @param ?Societe $buyer Object thirdparty who buy
|
||||
* @param string $defaulttpldir Directory where to find the template
|
||||
* @return void
|
||||
*/
|
||||
|
|
@ -5170,7 +5170,7 @@ abstract class CommonObject
|
|||
*
|
||||
* @param string $action Action code
|
||||
* @param Societe $seller Object of seller third party
|
||||
* @param Societe $buyer Object of buyer third party
|
||||
* @param ?Societe $buyer Object of buyer third party
|
||||
* @param int $selected ID line selected
|
||||
* @param int $dateSelector 1=Show also date range input fields
|
||||
* @param string $defaulttpldir Directory where to find the template
|
||||
|
|
@ -5256,7 +5256,7 @@ abstract class CommonObject
|
|||
*
|
||||
* @param string $action GET/POST action
|
||||
* @param CommonObjectLine $line Selected object line to output
|
||||
* @param string $var Not used
|
||||
* @param '' $var Not used
|
||||
* @param int $num Number of line (0)
|
||||
* @param int $i I
|
||||
* @param int $dateSelector 1=Show also date range input fields
|
||||
|
|
|
|||
|
|
@ -1741,7 +1741,7 @@ function show_actions_todo($conf, $langs, $db, $filterobj, $objcon = null, $nopr
|
|||
* @param Translate $langs Object langs
|
||||
* @param DoliDB $db Object db
|
||||
* @param mixed $filterobj Filter on object Adherent|Societe|Project|Product|CommandeFournisseur|Dolresource|Ticket... to list events linked to an object
|
||||
* @param Contact $objcon Filter on object contact to filter events on a contact
|
||||
* @param ?Contact $objcon Filter on object contact to filter events on a contact
|
||||
* @param int $noprint Return string but does not output it
|
||||
* @param string|string[] $actioncode Filter on actioncode
|
||||
* @param string $donetodo Filter on event 'done' or 'todo' or ''=nofilter (all).
|
||||
|
|
|
|||
|
|
@ -26,14 +26,14 @@
|
|||
/**
|
||||
* Regenerate files .class.php
|
||||
*
|
||||
* @param string $destdir Directory
|
||||
* @param string $module Module name
|
||||
* @param string $objectname Name of object
|
||||
* @param string $newmask New mask
|
||||
* @param string $readdir Directory source (use $destdir when not defined)
|
||||
* @param string $destdir Directory
|
||||
* @param string $module Module name
|
||||
* @param string $objectname Name of object
|
||||
* @param string $newmask New mask
|
||||
* @param string $readdir Directory source (use $destdir when not defined)
|
||||
* @param array{}|array{name:string,key:string,type:string,label:string,picot?:string,enabled:int<0,1>,notnull:int<0,1>,position:int,visible:int,noteditable?:int<0,1>,alwayseditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int<0,1>,css?:string,cssview?:string,csslist?:string,help?:string,showoncombobox?:int<0,1>,disabled?:int<0,1>,autofocusoncreate?:int<0,1>,arrayofkeyval?:array<string,string>,validate?:int<0,1>,comment?:string} $addfieldentry Array of 1 field entry to add
|
||||
* @param string $delfieldentry Id of field to remove
|
||||
* @return int<-7,-1>|CommonObject Return integer <=0 if KO, Object if OK
|
||||
* @param string $delfieldentry Id of field to remove
|
||||
* @return int<-7,-1>|CommonObject Return integer <=0 if KO, Object if OK
|
||||
* @see rebuildObjectSql()
|
||||
*/
|
||||
function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir = '', $addfieldentry = array(), $delfieldentry = '')
|
||||
|
|
@ -79,7 +79,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
|||
return -3;
|
||||
}
|
||||
|
||||
//$pathoffiletoedittmp=$destdir.'/class/'.strtolower($objectname).'.class.php.tmp';
|
||||
//$pathoffiletoedittmp = $destdir.'/class/'.strtolower($objectname).'.class.php.tmp';
|
||||
//dol_delete_file($pathoffiletoedittmp, 0, 1, 1);
|
||||
|
||||
try {
|
||||
|
|
@ -116,67 +116,68 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
|||
$i = 0;
|
||||
$texttoinsert = '// BEGIN MODULEBUILDER PROPERTIES'."\n";
|
||||
$texttoinsert .= "\t".'/**'."\n";
|
||||
$texttoinsert .= "\t".' * @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.'."\n";
|
||||
$texttoinsert .= "\t".' * @inheritdoc'."\n";
|
||||
$texttoinsert .= "\t".' * Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.'."\n";
|
||||
$texttoinsert .= "\t".' */'."\n";
|
||||
$texttoinsert .= "\t".'public $fields=array('."\n";
|
||||
$texttoinsert .= "\t".'public $fields = array('."\n";
|
||||
|
||||
if (count($object->fields)) {
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$i++;
|
||||
$texttoinsert .= "\t\t".'"'.$key.'" => array(';
|
||||
$texttoinsert .= '"type"=>"'.dol_escape_php($val['type']).'",';
|
||||
$texttoinsert .= ' "label"=>"'.dol_escape_php($val['label']).'",';
|
||||
$texttoinsert .= '"type" => "'.dol_escape_php($val['type']).'",';
|
||||
$texttoinsert .= ' "label" => "'.dol_escape_php($val['label']).'",';
|
||||
if (!empty($val['picto'])) {
|
||||
$texttoinsert .= ' "picto"=>"'.dol_escape_php($val['picto']).'",';
|
||||
$texttoinsert .= ' "picto" => "'.dol_escape_php($val['picto']).'",';
|
||||
}
|
||||
$texttoinsert .= ' "enabled"=>"'.($val['enabled'] !== '' ? dol_escape_php($val['enabled']) : 1).'",';
|
||||
$texttoinsert .= " 'position'=>".($val['position'] !== '' ? (int) $val['position'] : 50).",";
|
||||
$texttoinsert .= " 'notnull'=>".(empty($val['notnull']) ? 0 : (int) $val['notnull']).",";
|
||||
$texttoinsert .= ' "visible"=>"'.($val['visible'] !== '' ? dol_escape_js($val['visible']) : -1).'",';
|
||||
$texttoinsert .= ' "enabled" => "'.($val['enabled'] !== '' ? dol_escape_php($val['enabled']) : 1).'",';
|
||||
$texttoinsert .= " 'position' => ".($val['position'] !== '' ? (int) $val['position'] : 50).",";
|
||||
$texttoinsert .= " 'notnull' => ".(empty($val['notnull']) ? 0 : (int) $val['notnull']).",";
|
||||
$texttoinsert .= ' "visible" => "'.($val['visible'] !== '' ? dol_escape_js($val['visible']) : -1).'",';
|
||||
if (!empty($val['noteditable'])) {
|
||||
$texttoinsert .= ' "noteditable"=>"'.dol_escape_php($val['noteditable']).'",';
|
||||
$texttoinsert .= ' "noteditable" => "'.dol_escape_php($val['noteditable']).'",';
|
||||
}
|
||||
if (!empty($val['alwayseditable'])) {
|
||||
$texttoinsert .= ' "alwayseditable"=>"'.dol_escape_php($val['alwayseditable']).'",';
|
||||
$texttoinsert .= ' "alwayseditable" => "'.dol_escape_php($val['alwayseditable']).'",';
|
||||
}
|
||||
if (array_key_exists('default', $val) && (!empty($val['default']) || $val['default'] === '0')) {
|
||||
$texttoinsert .= ' "default"=>"'.dol_escape_php($val['default']).'",';
|
||||
$texttoinsert .= ' "default" => "'.dol_escape_php($val['default']).'",';
|
||||
}
|
||||
if (!empty($val['index'])) {
|
||||
$texttoinsert .= ' "index"=>"'.(int) $val['index'].'",';
|
||||
$texttoinsert .= ' "index" => "'.(int) $val['index'].'",';
|
||||
}
|
||||
if (!empty($val['foreignkey'])) {
|
||||
$texttoinsert .= ' "foreignkey"=>"'.(int) $val['foreignkey'].'",';
|
||||
$texttoinsert .= ' "foreignkey" => "'.(int) $val['foreignkey'].'",';
|
||||
}
|
||||
if (!empty($val['searchall'])) {
|
||||
$texttoinsert .= ' "searchall"=>"'.(int) $val['searchall'].'",';
|
||||
$texttoinsert .= ' "searchall" => "'.(int) $val['searchall'].'",';
|
||||
}
|
||||
if (!empty($val['isameasure'])) {
|
||||
$texttoinsert .= ' "isameasure"=>"'.(int) $val['isameasure'].'",';
|
||||
$texttoinsert .= ' "isameasure" => "'.(int) $val['isameasure'].'",';
|
||||
}
|
||||
if (!empty($val['css'])) {
|
||||
$texttoinsert .= ' "css"=>"'.dol_escape_php($val['css']).'",';
|
||||
$texttoinsert .= ' "css" => "'.dol_escape_php($val['css']).'",';
|
||||
}
|
||||
if (!empty($val['cssview'])) {
|
||||
$texttoinsert .= ' "cssview"=>"'.dol_escape_php($val['cssview']).'",';
|
||||
$texttoinsert .= ' "cssview" => "'.dol_escape_php($val['cssview']).'",';
|
||||
}
|
||||
if (!empty($val['csslist'])) {
|
||||
$texttoinsert .= ' "csslist"=>"'.dol_escape_php($val['csslist']).'",';
|
||||
$texttoinsert .= ' "csslist" => "'.dol_escape_php($val['csslist']).'",';
|
||||
}
|
||||
if (!empty($val['help'])) {
|
||||
$texttoinsert .= ' "help"=>"'.dol_escape_php($val['help']).'",';
|
||||
$texttoinsert .= ' "help" => "'.dol_escape_php($val['help']).'",';
|
||||
}
|
||||
if (!empty($val['showoncombobox'])) {
|
||||
$texttoinsert .= ' "showoncombobox"=>"'.(int) $val['showoncombobox'].'",';
|
||||
$texttoinsert .= ' "showoncombobox" => "'.(int) $val['showoncombobox'].'",';
|
||||
}
|
||||
if (!empty($val['disabled'])) {
|
||||
$texttoinsert .= ' "disabled"=>"'.(int) $val['disabled'].'",';
|
||||
$texttoinsert .= ' "disabled" => "'.(int) $val['disabled'].'",';
|
||||
}
|
||||
if (!empty($val['autofocusoncreate'])) {
|
||||
$texttoinsert .= ' "autofocusoncreate"=>"'.(int) $val['autofocusoncreate'].'",';
|
||||
$texttoinsert .= ' "autofocusoncreate" => "'.(int) $val['autofocusoncreate'].'",';
|
||||
}
|
||||
if (!empty($val['arrayofkeyval'])) {
|
||||
$texttoinsert .= ' "arrayofkeyval"=>array(';
|
||||
$texttoinsert .= ' "arrayofkeyval" => array(';
|
||||
$i = 0;
|
||||
foreach ($val['arrayofkeyval'] as $key2 => $val2) {
|
||||
if ($i) {
|
||||
|
|
@ -188,10 +189,10 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
|||
$texttoinsert .= '),';
|
||||
}
|
||||
if (!empty($val['validate'])) {
|
||||
$texttoinsert .= ' "validate"=>"'.(int) $val['validate'].'",';
|
||||
$texttoinsert .= ' "validate" => "'.(int) $val['validate'].'",';
|
||||
}
|
||||
if (!empty($val['comment'])) {
|
||||
$texttoinsert .= ' "comment"=>"'.dol_escape_php($val['comment']).'"';
|
||||
$texttoinsert .= ' "comment" => "'.dol_escape_php($val['comment']).'"';
|
||||
}
|
||||
|
||||
$texttoinsert .= "),\n";
|
||||
|
|
@ -203,16 +204,16 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
|||
//print ($texttoinsert);exit;
|
||||
|
||||
if (count($object->fields)) {
|
||||
//$typetotypephp=array('integer'=>'integer', 'duration'=>'integer', 'varchar'=>'string');
|
||||
//$typetotypephp = array('integer' => 'integer', 'duration' => 'integer', 'varchar' => 'string');
|
||||
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$i++;
|
||||
//$typephp=$typetotypephp[$val['type']];
|
||||
//$typephp = $typetotypephp[$val['type']];
|
||||
$texttoinsert .= "\t".'public $'.$key.";";
|
||||
//if ($key == 'rowid') $texttoinsert.= ' AUTO_INCREMENT PRIMARY KEY';
|
||||
//if ($key == 'entity') $texttoinsert.= ' DEFAULT 1';
|
||||
//$texttoinsert.= ($val['notnull']?' NOT NULL':'');
|
||||
//if ($i < count($object->fields)) $texttoinsert.=";";
|
||||
//if ($i < count($object->fields)) $texttoinsert. = ";";
|
||||
$texttoinsert .= "\n";
|
||||
}
|
||||
}
|
||||
|
|
@ -245,14 +246,14 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
|
|||
/**
|
||||
* Save data into a memory area shared by all users, all sessions on server
|
||||
*
|
||||
* @param string $destdir Directory
|
||||
* @param string $module Module name
|
||||
* @param string $objectname Name of object
|
||||
* @param string $newmask New mask
|
||||
* @param string $readdir Directory source (use $destdir when not defined)
|
||||
* @param Object $object If object was already loaded/known, it is pass to avoid another include and new.
|
||||
* @param string $moduletype 'external' or 'internal'
|
||||
* @return int Return integer <=0 if KO, >0 if OK
|
||||
* @param string $destdir Directory
|
||||
* @param string $module Module name
|
||||
* @param string $objectname Name of object
|
||||
* @param string $newmask New mask
|
||||
* @param string $readdir Directory source (use $destdir when not defined)
|
||||
* @param Object $object If object was already loaded/known, it is pass to avoid another include and new.
|
||||
* @param string $moduletype 'external' or 'internal'
|
||||
* @return int Return integer <=0 if KO, >0 if OK
|
||||
* @see rebuildObjectClass()
|
||||
*/
|
||||
function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '', $object = null, $moduletype = 'external')
|
||||
|
|
@ -430,8 +431,8 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
|
|||
/**
|
||||
* Get list of existing objects from a directory
|
||||
*
|
||||
* @param string $destdir Directory
|
||||
* @return array|int Return integer <=0 if KO, array if OK
|
||||
* @param string $destdir Directory
|
||||
* @return string[]|int Return integer <=0 if KO, array if OK
|
||||
*/
|
||||
function dolGetListOfObjectClasses($destdir)
|
||||
{
|
||||
|
|
@ -462,9 +463,9 @@ function dolGetListOfObjectClasses($destdir)
|
|||
/**
|
||||
* Function to check if comment BEGIN and END exists in modMyModule class
|
||||
*
|
||||
* @param string $file Filename or path
|
||||
* @param int $number 0 = For Menus, 1 = For permissions, 2 = For Dictionaries
|
||||
* @return int 1 if OK , -1 if KO
|
||||
* @param string $file Filename or path
|
||||
* @param int<0,2> $number 0 = For Menus, 1 = For permissions, 2 = For Dictionaries
|
||||
* @return int 1 if OK , -1 if KO
|
||||
*/
|
||||
function checkExistComment($file, $number)
|
||||
{
|
||||
|
|
@ -507,8 +508,8 @@ function checkExistComment($file, $number)
|
|||
/**
|
||||
* Delete all permissions
|
||||
*
|
||||
* @param string $file file with path
|
||||
* @return void
|
||||
* @param string $file file with path
|
||||
* @return void
|
||||
*/
|
||||
function deletePerms($file)
|
||||
{
|
||||
|
|
@ -538,10 +539,10 @@ function deletePerms($file)
|
|||
}
|
||||
|
||||
/**
|
||||
* Compare two value
|
||||
* @param int|string $a value 1
|
||||
* @param int|string $b value 2
|
||||
* @return int less 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.
|
||||
* Compare two values
|
||||
* @param int|string $a value 1
|
||||
* @param int|string $b value 2
|
||||
* @return int<-1,1> <=0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.
|
||||
*/
|
||||
function compareFirstValue($a, $b)
|
||||
{
|
||||
|
|
@ -549,25 +550,25 @@ function compareFirstValue($a, $b)
|
|||
}
|
||||
/**
|
||||
* Rewriting all permissions after any actions
|
||||
* @param string $file filename or path
|
||||
* @param array<int,string[]> $permissions permissions existing in file
|
||||
* @param int|null $key key for permission needed
|
||||
* @param array{0:string,1:string}|null $right $right to update or add
|
||||
* @param string|null $objectname name of object
|
||||
* @param string|null $module name of module
|
||||
* @param int<-2,2> $action 0 for delete, 1 for add, 2 for update, -1 when delete object completely, -2 for generate rights after add
|
||||
* @return int<-1,1> 1 if OK,-1 if KO
|
||||
* @param string $file filename or path
|
||||
* @param array<int,string[]> $permissions permissions existing in file
|
||||
* @param ?int $key key for permission needed
|
||||
* @param ?array{0:string,1:string} $right $right to update or add
|
||||
* @param string $objectname name of object
|
||||
* @param string $module name of module
|
||||
* @param int<-2,2> $action 0 for delete, 1 for add, 2 for update, -1 when delete object completely, -2 for generate rights after add
|
||||
* @return int<-1,1> 1 if OK,-1 if KO
|
||||
*/
|
||||
function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $module, $action)
|
||||
{
|
||||
$error = 0;
|
||||
$rights = array();
|
||||
if ($action == 0) {
|
||||
if ($action == 0 && $key !== null) {
|
||||
// delete right from permissions array
|
||||
array_splice($permissions, array_search($permissions[$key], $permissions), 1);
|
||||
} elseif ($action == 1) {
|
||||
array_push($permissions, $right);
|
||||
} elseif ($action == 2 && !empty($right)) {
|
||||
} elseif ($action == 2 && !empty($right) && $key !== null) {
|
||||
// update right from permissions array
|
||||
array_splice($permissions, array_search($permissions[$key], $permissions), 1, $right);
|
||||
} elseif ($action == -1 && !empty($objectname)) {
|
||||
|
|
@ -624,7 +625,7 @@ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $
|
|||
foreach ($permissions as $perms) {
|
||||
$object = $perms[4];
|
||||
if (!isset($perms_grouped[$object])) {
|
||||
$perms_grouped[$object] = [];
|
||||
$perms_grouped[$object] = array();
|
||||
}
|
||||
$perms_grouped[$object][] = $perms;
|
||||
}
|
||||
|
|
@ -656,11 +657,10 @@ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $
|
|||
//convert to string
|
||||
foreach ($permissions as $perms) {
|
||||
foreach ($perms as $per) {
|
||||
$rights[] = implode(";\n\t\t", $per);
|
||||
$rights[] = "\$r++;\n\t\t";
|
||||
$rights[] = implode(";\n\t\t", $per)."\$r++;\n";
|
||||
}
|
||||
}
|
||||
$rights_str = implode("", $rights);
|
||||
$rights_str = implode("\t\t", $rights);
|
||||
// delete all permissions from file
|
||||
deletePerms($file);
|
||||
// rewrite all permissions again
|
||||
|
|
@ -674,8 +674,8 @@ function reWriteAllPermissions($file, $permissions, $key, $right, $objectname, $
|
|||
/**
|
||||
* Converts a formatted properties string into an associative array.
|
||||
*
|
||||
* @param string $string The formatted properties string.
|
||||
* @return array<string,bool|int|float|string|mixed[]> The resulting associative array.
|
||||
* @param string $string The formatted properties string.
|
||||
* @return array<string,bool|int|float|string|mixed[]> The resulting associative array.
|
||||
*/
|
||||
function parsePropertyString($string)
|
||||
{
|
||||
|
|
@ -683,7 +683,7 @@ function parsePropertyString($string)
|
|||
|
||||
// Uses a regular expression to capture keys and values
|
||||
preg_match_all('/\s*([^\s=>]+)\s*=>\s*([^,]+),?/', $string, $matches, PREG_SET_ORDER);
|
||||
$propertyArray = [];
|
||||
$propertyArray = array();
|
||||
|
||||
foreach ($matches as $match) {
|
||||
$key = trim($match[1]);
|
||||
|
|
@ -718,10 +718,10 @@ function parsePropertyString($string)
|
|||
|
||||
/**
|
||||
* Write all properties of the object in AsciiDoc format
|
||||
* @param string $file path of the class
|
||||
* @param string $objectname name of the objectClass
|
||||
* @param string $destfile file where write table of properties
|
||||
* @return int 1 if OK, -1 if KO
|
||||
* @param string $file path of the class
|
||||
* @param string $objectname name of the objectClass
|
||||
* @param string $destfile file where write table of properties
|
||||
* @return int 1 if OK, -1 if KO
|
||||
*/
|
||||
function writePropsInAsciiDoc($file, $objectname, $destfile)
|
||||
{
|
||||
|
|
@ -729,7 +729,7 @@ function writePropsInAsciiDoc($file, $objectname, $destfile)
|
|||
// stock all properties in array
|
||||
$attributesUnique = array('type','label', 'enabled', 'position', 'notnull', 'visible', 'noteditable', 'index', 'default' , 'foreignkey', 'arrayofkeyval', 'alwayseditable','validate', 'searchall','comment', 'isameasure', 'css', 'cssview','csslist', 'help', 'showoncombobox','picto' );
|
||||
|
||||
$start = "public \$fields=array(";
|
||||
$start = "public \$fields = array(";
|
||||
$end = ");";
|
||||
$i = 1;
|
||||
$keys = array();
|
||||
|
|
@ -817,9 +817,9 @@ function writePropsInAsciiDoc($file, $objectname, $destfile)
|
|||
/**
|
||||
* Delete property and permissions from documentation ascii file if we delete an object
|
||||
*
|
||||
* @param string $file file or path
|
||||
* @param string $objectname name of object wants to deleted
|
||||
* @return void
|
||||
* @param string $file file or path
|
||||
* @param string $objectname name of object wants to deleted
|
||||
* @return void
|
||||
*/
|
||||
function deletePropsAndPermsFromDoc($file, $objectname)
|
||||
{
|
||||
|
|
@ -846,12 +846,12 @@ function deletePropsAndPermsFromDoc($file, $objectname)
|
|||
/**
|
||||
* Search a string and return all lines needed from file. Does not include line $start nor $end
|
||||
*
|
||||
* @param string $file file for searching
|
||||
* @param string $start start line if exist
|
||||
* @param string $end end line if exist
|
||||
* @param string $excludestart Ignore if start line is $excludestart
|
||||
* @param int $includese Include start and end line
|
||||
* @return string Return the lines between first line with $start and $end. "" if not found.
|
||||
* @param string $file file for searching
|
||||
* @param string $start start line if it exists
|
||||
* @param string $end end line if it exists
|
||||
* @param string $excludestart Ignore if start line is $excludestart
|
||||
* @param int<0,1> $includese Include start and end line
|
||||
* @return string Return the lines between first line with $start and $end. "" if not found.
|
||||
*/
|
||||
function getFromFile($file, $start, $end, $excludestart = '', $includese = 0)
|
||||
{
|
||||
|
|
@ -889,9 +889,9 @@ function getFromFile($file, $start, $end, $excludestart = '', $includese = 0)
|
|||
|
||||
/**
|
||||
* Write all permissions of each object in AsciiDoc format
|
||||
* @param string $file path of the class
|
||||
* @param string $destfile file where write table of permissions
|
||||
* @return int<-1,1> 1 if OK, -1 if KO
|
||||
* @param string $file path of the class
|
||||
* @param string $destfile file where write table of permissions
|
||||
* @return int<-1,1> 1 if OK, -1 if KO
|
||||
*/
|
||||
function writePermsInAsciiDoc($file, $destfile)
|
||||
{
|
||||
|
|
@ -939,10 +939,10 @@ function writePermsInAsciiDoc($file, $destfile)
|
|||
array_pop($permsN);
|
||||
|
||||
// Group permissions by Object and add it to string
|
||||
$final_array = [];
|
||||
$final_array = array();
|
||||
$index = 0;
|
||||
while ($index < count($permsN)) {
|
||||
$temp_array = [$permsN[$index], $permsN[$index + 1]];
|
||||
$temp_array = array($permsN[$index], $permsN[$index + 1]);
|
||||
$final_array[] = $temp_array;
|
||||
$index += 2;
|
||||
}
|
||||
|
|
@ -974,11 +974,11 @@ function writePermsInAsciiDoc($file, $destfile)
|
|||
/**
|
||||
* Add Object in ModuleApi File
|
||||
*
|
||||
* @param string $srcfile Source file to use as example
|
||||
* @param string $file Path of modified file
|
||||
* @param string[] $objects Array of objects in the module
|
||||
* @param string $modulename Name of module
|
||||
* @return int<-1,1> Return 1 if OK, -1 if KO
|
||||
* @param string $srcfile Source file to use as example
|
||||
* @param string $file Path of modified file
|
||||
* @param string[] $objects Array of objects in the module
|
||||
* @param string $modulename Name of module
|
||||
* @return int<-1,1> Return 1 if OK, -1 if KO
|
||||
*/
|
||||
function addObjectsToApiFile($srcfile, $file, $objects, $modulename)
|
||||
{
|
||||
|
|
@ -1007,7 +1007,7 @@ function addObjectsToApiFile($srcfile, $file, $objects, $modulename)
|
|||
} elseif (preg_match('/'.$props.'/', $lineContent)) {
|
||||
$lineContent = '';
|
||||
foreach ($objects as $objectname) {
|
||||
$lineContent .= "\tpublic \$".strtolower($objectname).";". PHP_EOL;
|
||||
$lineContent .= "\t/*".PHP_EOL."\t * @var mixed TODO: set type".PHP_EOL."\t */".PHP_EOL."\tpublic \$".strtolower($objectname).";". PHP_EOL;
|
||||
}
|
||||
} elseif (preg_match('/'.$constructObj.'/', $lineContent)) {
|
||||
$lineContent = '';
|
||||
|
|
@ -1040,7 +1040,7 @@ function addObjectsToApiFile($srcfile, $file, $objects, $modulename)
|
|||
'myobject' => strtolower($objectname),
|
||||
'MyObject' => $objectname,
|
||||
'MYOBJECT' => strtoupper($objectname),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
'---Replace with your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
);
|
||||
$contentReplaced = make_substitutions($allContent, $arrayreplacement, null);
|
||||
//$contentReplaced = str_replace(["myobject","MyObject"], [strtolower($object),$object], $allContent);
|
||||
|
|
@ -1060,10 +1060,10 @@ function addObjectsToApiFile($srcfile, $file, $objects, $modulename)
|
|||
/**
|
||||
* Remove Object variables and methods from API_Module File
|
||||
*
|
||||
* @param string $file File api module
|
||||
* @param string[] $objects Array of objects in the module
|
||||
* @param string $objectname Name of object want to remove
|
||||
* @return int<-1,1> 1 if OK, -1 if KO
|
||||
* @param string $file File api module
|
||||
* @param string[] $objects Array of objects in the module
|
||||
* @param string $objectname Name of object want to remove
|
||||
* @return int<-1,1> 1 if OK, -1 if KO
|
||||
*/
|
||||
function removeObjectFromApiFile($file, $objects, $objectname)
|
||||
{
|
||||
|
|
@ -1108,12 +1108,12 @@ function removeObjectFromApiFile($file, $objects, $objectname)
|
|||
|
||||
|
||||
/**
|
||||
* @param string $file path of filename
|
||||
* @param array<int,array{commentgroup:string,fk_menu:string,type:string,titre:string,mainmenu:string,leftmenu:string,url:string,langs:string,position:int,enabled:int,perms:string,target:string,user:int}> $menus all menus for module
|
||||
* @param mixed|null $menuWantTo menu get for do actions
|
||||
* @param int|null $key key for the concerned menu
|
||||
* @param int<-1,2> $action for specify what action (0 = delete perm, 1 = add perm, 2 = update perm, -1 = when we delete object)
|
||||
* @return int<-1,1> 1 if OK, -1 if KO
|
||||
* @param string $file path of filename
|
||||
* @param array<int,array{commentgroup:string,fk_menu:string,type:string,titre:string,mainmenu:string,leftmenu:string,url:string,langs:string,position:int,enabled:int,perms:string,target:string,user:int}> $menus all menus for module
|
||||
* @param null|string|array{commentgroup:string,fk_menu:string,type:string,titre:string,mainmenu:string,leftmenu:string,url:string,langs:string,position:int,enabled:int,perms:string,target:string,user:int} $menuWantTo menu get for do actions
|
||||
* @param ?int $key key for the concerned menu
|
||||
* @param int<-1,2> $action for specify what action (0 = delete perm, 1 = add perm, 2 = update perm, -1 = when we delete object)
|
||||
* @return int<-1,1> 1 if OK, -1 if KO
|
||||
*/
|
||||
function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action)
|
||||
{
|
||||
|
|
@ -1150,7 +1150,7 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action)
|
|||
} else {
|
||||
$errors++;
|
||||
}
|
||||
} elseif ($action == -1 && !empty($menuWantTo)) {
|
||||
} elseif ($action == -1 && !empty($menuWantTo) && is_string($menuWantTo)) {
|
||||
// delete menus when delete Object
|
||||
foreach ($menus as $index => $menu) {
|
||||
if ((strpos(strtolower($menu['fk_menu']), strtolower($menuWantTo)) !== false) || (strpos(strtolower($menu['leftmenu']), strtolower($menuWantTo)) !== false)) {
|
||||
|
|
@ -1184,20 +1184,20 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action)
|
|||
//var_dump(dol_escape_php($menu['perms'], 1)); exit;
|
||||
|
||||
$str_menu .= $start."\n";
|
||||
$str_menu .= "\t\t\$this->menu[\$r++]=array(\n";
|
||||
$str_menu .= "\t\t\t 'fk_menu' => '".dol_escape_php($menu['fk_menu'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'type' => '".dol_escape_php($menu['type'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'titre' => '".dol_escape_php($menu['titre'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'mainmenu' => '".dol_escape_php($menu['mainmenu'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'leftmenu' => '".dol_escape_php($menu['leftmenu'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'url' => '".dol_escape_php($menu['url'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'langs' => '".dol_escape_php($menu['langs'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'position' => ".((int) $menu['position']).",\n";
|
||||
$str_menu .= "\t\t\t 'enabled' => '".dol_escape_php($menu['enabled'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'perms' => '".dol_escape_php($menu['perms'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'target' => '".dol_escape_php($menu['target'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t 'user' => ".((int) $menu['user']).",\n";
|
||||
$str_menu .= "\t\t\t 'object' => '".dol_escape_php($menu['object'], 1)."',\n";
|
||||
$str_menu .= "\t\t\$this->menu[\$r++] = array(\n";
|
||||
$str_menu .= "\t\t\t'fk_menu' => '".dol_escape_php($menu['fk_menu'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'type' => '".dol_escape_php($menu['type'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'titre' => '".dol_escape_php($menu['titre'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'mainmenu' => '".dol_escape_php($menu['mainmenu'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'leftmenu' => '".dol_escape_php($menu['leftmenu'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'url' => '".dol_escape_php($menu['url'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'langs' => '".dol_escape_php($menu['langs'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'position' => ".((int) $menu['position']).",\n";
|
||||
$str_menu .= "\t\t\t'enabled' => '".dol_escape_php($menu['enabled'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'perms' => '".dol_escape_php($menu['perms'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'target' => '".dol_escape_php($menu['target'], 1)."',\n";
|
||||
$str_menu .= "\t\t\t'user' => ".((int) $menu['user']).",\n";
|
||||
$str_menu .= "\t\t\t'object' => '".dol_escape_php($menu['object'], 1)."',\n";
|
||||
$str_menu .= "\t\t);\n";
|
||||
|
||||
if (is_null($next_val) || $val_actuel['leftmenu'] !== $next_val['leftmenu']) {
|
||||
|
|
@ -1215,41 +1215,41 @@ function reWriteAllMenus($file, $menus, $menuWantTo, $key, $action)
|
|||
/**
|
||||
* Updates a dictionary in a module descriptor file.
|
||||
*
|
||||
* @param string $module The name of the module.
|
||||
* @param string $file The path to the module descriptor file.
|
||||
* @param array<string,bool|string|array<string,bool|int|string>> $dicts The dictionary data to be updated.
|
||||
* @return int Returns the number of replacements made in the file.
|
||||
* @param string $module The name of the module.
|
||||
* @param string $file The path to the module descriptor file.
|
||||
* @param array{langs:string,tabname:string[],tablib:string[],tabsql:string[],tabsqlsort:string[],tabfield:string[],tabfieldvalue:string[],tabfieldinsert:string[],tabrowid:string[],tabcond:string[],tabhelp:array<array{code:string,field2:string}>} $dicts The dictionary data to be updated.
|
||||
* @return int Returns the number of replacements made in the file.
|
||||
*/
|
||||
function updateDictionaryInFile($module, $file, $dicts)
|
||||
{
|
||||
$isEmpty = false;
|
||||
$dicData = "\t\t\$this->dictionaries=array(\n";
|
||||
$dicData = "\t\t\$this->dictionaries = array(\n";
|
||||
$module = strtolower($module);
|
||||
foreach ($dicts as $key => $value) {
|
||||
if (empty($value)) {
|
||||
$isEmpty = true;
|
||||
$dicData = "\t\t\$this->dictionaries=array();";
|
||||
$dicData = "\t\t\$this->dictionaries = array();";
|
||||
break;
|
||||
}
|
||||
|
||||
$dicData .= "\t\t\t'$key'=>";
|
||||
$dicData .= "\t\t\t'$key' => ";
|
||||
|
||||
if ($key === 'tabcond') {
|
||||
$conditions = array_map(
|
||||
/**
|
||||
* @param bool|string|int $val
|
||||
* @return string|int
|
||||
* @param bool|string|int $val
|
||||
* @return string|int
|
||||
*/
|
||||
function ($val) use ($module) {
|
||||
static function ($val) use ($module) {
|
||||
return is_bool($val) ? "isModEnabled('$module')" : $val;
|
||||
},
|
||||
$value
|
||||
);
|
||||
$dicData .= "array(" . implode(",", $conditions) . ")";
|
||||
$dicData .= "array(" . implode(", ", $conditions) . ")";
|
||||
} elseif ($key === 'tabhelp') {
|
||||
$helpItems = array();
|
||||
foreach ($value as $helpValue) {
|
||||
$helpItems[] = "array('code'=>\$langs->trans('".$helpValue['code']."'), 'field2' => 'field2tooltip')";
|
||||
$helpItems[] = "array('code' => \$langs->trans('".$helpValue['code']."'), 'field2' => 'field2tooltip')";
|
||||
}
|
||||
$dicData .= "array(" . implode(",", $helpItems) . ")";
|
||||
} else {
|
||||
|
|
@ -1258,8 +1258,8 @@ function updateDictionaryInFile($module, $file, $dicts)
|
|||
",",
|
||||
array_map(
|
||||
/**
|
||||
* @param string $val
|
||||
* @return string
|
||||
* @param string $val
|
||||
* @return string
|
||||
*/
|
||||
static function ($val) {
|
||||
return "'$val'";
|
||||
|
|
@ -1282,16 +1282,16 @@ function updateDictionaryInFile($module, $file, $dicts)
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a new dictionary table.
|
||||
* Create a new dictionary table.
|
||||
*
|
||||
* for creating a new dictionary table in Dolibarr. It generates the necessary SQL code to define the table structure,
|
||||
* It generates the necessary SQL code to define the table structure,
|
||||
* including columns such as 'rowid', 'code', 'label', 'position', 'use_default', 'active', etc. The table name is constructed based on the provided $namedic parameter.
|
||||
*
|
||||
* @param string $modulename The lowercase name of the module for which the dictionary table is being created.
|
||||
* @param string $file The file path to the Dolibarr module builder file where the dictionaries are defined.
|
||||
* @param string $namedic The name of the dictionary, which will also be used as the base for the table name.
|
||||
* @param array<string,string|array<string,int|string>> $dictionnaires An optional array containing pre-existing dictionary data, including 'tabname', 'tablib', 'tabsql', etc.
|
||||
* @return int<-1,-1> Return int < 0 if error, return nothing on success
|
||||
* @param string $modulename The lowercase name of the module for which the dictionary table is being created.
|
||||
* @param string $file The file path to the Dolibarr module builder file where the dictionaries are defined.
|
||||
* @param string $namedic The name of the dictionary, which will also be used as the base for the table name.
|
||||
* @param ?array{langs:string,tabname:string[],tablib:string[],tabsql:string[],tabsqlsort:string[],tabfield:string[],tabfieldvalue:string[],tabfieldinsert:string[],tabrowid:string[],tabcond:string[],tabhelp:array<array{code:string,field2:string}>} $dictionnaires An optional array containing pre-existing dictionary data, including tabname, tablib, tabsql, etc.
|
||||
* @return int<-1,-1> Return int < 0 if error, return nothing on success
|
||||
*/
|
||||
function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = null)
|
||||
{
|
||||
|
|
@ -1370,9 +1370,9 @@ function createNewDictionnary($modulename, $file, $namedic, $dictionnaires = nul
|
|||
/**
|
||||
* Generate Urls and add them to documentation module
|
||||
*
|
||||
* @param string $file_api filename or path of api
|
||||
* @param string $file_doc filename or path of documentation
|
||||
* @return int<-1,1> -1 if KO, 1 if OK, 0 if nothing change
|
||||
* @param string $file_api filename or path of api
|
||||
* @param string $file_doc filename or path of documentation
|
||||
* @return int<-1,1> -1 if KO, 1 if OK, 0 if nothing change
|
||||
*/
|
||||
function writeApiUrlsInDoc($file_api, $file_doc)
|
||||
{
|
||||
|
|
@ -1384,7 +1384,7 @@ function writeApiUrlsInDoc($file_api, $file_doc)
|
|||
$extractUrls = explode("\n", $string);
|
||||
|
||||
// extract urls from file
|
||||
$urlValues = [];
|
||||
$urlValues = array();
|
||||
foreach ($extractUrls as $key => $line) {
|
||||
$lineWithoutTabsSpaces = preg_replace('/^[\t\s]+/', '', $line);
|
||||
if (strpos($lineWithoutTabsSpaces, '* @url') === 0) {
|
||||
|
|
@ -1395,7 +1395,7 @@ function writeApiUrlsInDoc($file_api, $file_doc)
|
|||
|
||||
// get urls by object
|
||||
$str = $_SERVER['HTTP_HOST'].'/api/index.php/';
|
||||
$groupedUrls = [];
|
||||
$groupedUrls = array();
|
||||
foreach ($urlValues as $url) {
|
||||
if (preg_match('/(?:GET|POST|PUT|DELETE) (\w+)s/', $url, $matches)) {
|
||||
$objectName = $matches[1];
|
||||
|
|
@ -1427,9 +1427,9 @@ function writeApiUrlsInDoc($file_api, $file_doc)
|
|||
|
||||
/**
|
||||
* count directories or files in modulebuilder folder
|
||||
* @param string $path path of directory
|
||||
* @param int $type type of file 1= file,2=directory
|
||||
* @return int|bool
|
||||
* @param string $path path of directory
|
||||
* @param int<1,2> $type type of file 1= file,2=directory
|
||||
* @return int|false False on failure (path is not a directory)
|
||||
*/
|
||||
function countItemsInDirectory($path, $type = 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -390,6 +391,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||
|
||||
$objMod = new $modName($db);
|
||||
if (is_object($objMod)) {
|
||||
'@phan-var-force ModeleBoxes $objMod';
|
||||
// Define disabledbyname and disabledbymodule
|
||||
$disabledbyname = 0;
|
||||
$disabledbymodule = 0; // TODO Set to 2 if module is not enabled
|
||||
|
|
@ -400,7 +402,7 @@ class MailingTargets // This can't be abstract as it is used for some method
|
|||
$disabledbyname = 1;
|
||||
}
|
||||
|
||||
// We set info of modules
|
||||
// We set info of modules @phan-suppress-next-line PhanUndeclaredProperty
|
||||
$widget[$j]['picto'] = (empty($objMod->picto) ? (empty($objMod->boximg) ? img_object('', 'generic') : $objMod->boximg) : img_object('', $objMod->picto));
|
||||
$widget[$j]['file'] = $files[$key];
|
||||
$widget[$j]['fullpath'] = $fullpath[$key];
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2015 ATM Consulting <support@atm-consulting.fr>
|
||||
* Copyright (C) 2019-2020 Open-DSI <support@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* 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
|
||||
|
|
@ -129,7 +130,7 @@ foreach ($list_DEB as $key) {
|
|||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("INTRACOMMREPORT_TYPE_ACTEUR").'</td>';
|
||||
$arraychoices = array(''=>$langs->trans("None"), 'PSI'=>'Déclarant pour son compte', 'TDP'=>'Tiers déclarant');
|
||||
$arraychoices = array('' => $langs->trans("None"), 'PSI' => 'Déclarant pour son compte', 'TDP' => 'Tiers déclarant');
|
||||
print '<td>';
|
||||
print $form->selectarray('INTRACOMMREPORT_TYPE_ACTEUR', $arraychoices, $conf->global->INTRACOMMREPORT_TYPE_ACTEUR, 0);
|
||||
print '</td>';
|
||||
|
|
@ -137,7 +138,7 @@ print "</tr>\n";
|
|||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("INTRACOMMREPORT_ROLE_ACTEUR").'</td>';
|
||||
$arraychoices = array(''=>$langs->trans("None"), 'sender'=>'Emetteur', 'PSI'=>'Déclarant');
|
||||
$arraychoices = array('' => $langs->trans("None"), 'sender' => 'Emetteur', 'PSI' => 'Déclarant');
|
||||
print '<td>';
|
||||
print $form->selectarray('INTRACOMMREPORT_ROLE_ACTEUR', $arraychoices, $conf->global->INTRACOMMREPORT_ROLE_ACTEUR, 0);
|
||||
print '</td>';
|
||||
|
|
@ -145,7 +146,7 @@ print "</tr>\n";
|
|||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION").'</td>';
|
||||
$arraychoices = array(1=>'Seuil de 460 000 €', 2=>'En dessous de 460 000 €');
|
||||
$arraychoices = array(1 => 'Seuil de 460 000 €', 2 => 'En dessous de 460 000 €');
|
||||
print '<td>';
|
||||
print $form->selectarray('INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION', $arraychoices, $conf->global->INTRACOMMREPORT_NIV_OBLIGATION_INTRODUCTION, 0);
|
||||
print '</td>';
|
||||
|
|
@ -153,7 +154,7 @@ print "</tr>\n";
|
|||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION").'</td>';
|
||||
$arraychoices = array(3=>'Seuil de 460 000 €', 4=>'En dessous de 460 000 €');
|
||||
$arraychoices = array(3 => 'Seuil de 460 000 €', 4 => 'En dessous de 460 000 €');
|
||||
print '<td>';
|
||||
print $form->selectarray('INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION', $arraychoices, $conf->global->INTRACOMMREPORT_NIV_OBLIGATION_EXPEDITION, 0);
|
||||
print '</td>';
|
||||
|
|
|
|||
|
|
@ -103,16 +103,16 @@ class IntracommReport extends CommonObject
|
|||
/**
|
||||
* @var array Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields=array(
|
||||
"rowid" => array("type"=>"integer", "label"=>"TechnicalID", "enabled"=>"1", 'position'=>10, 'notnull'=>1, "visible"=>"0",),
|
||||
"ref" => array("type"=>"varchar(30)", "label"=>"Ref", "enabled"=>"1", 'position'=>15, 'notnull'=>1, "visible"=>"1", "csslist"=>"tdoverflowmax150", "showoncombobox"=>"1",),
|
||||
"type_declaration" => array("type"=>"varchar(32)", "label"=>"TypeOfDeclaration", "enabled"=>"1", 'position'=>25, 'notnull'=>0, "visible"=>"1", 'arrayofkeyval' => array("deb" => "DEB", "des" => "DES")),
|
||||
"periods" => array("type"=>"varchar(32)", "label"=>"Periods", "enabled"=>"1", 'position'=>30, 'notnull'=>0, "visible"=>"-1",),
|
||||
"mode" => array("type"=>"varchar(32)", "label"=>"Mode", "enabled"=>"1", 'position'=>35, 'notnull'=>0, "visible"=>"-1",),
|
||||
"content_xml" => array("type"=>"text", "label"=>"Contentxml", "enabled"=>"1", 'position'=>40, 'notnull'=>0, "visible"=>"-1",),
|
||||
"type_export" => array("type"=>"varchar(10)", "label"=>"TypeOfExport", "enabled"=>"1", 'position'=>45, 'notnull'=>0, "visible"=>"-1", 'arrayofkeyval' => array("in" => "Input", "out" => "Output")),
|
||||
"datec" => array("type"=>"datetime", "label"=>"DateCreation", "enabled"=>"1", 'position'=>50, 'notnull'=>0, "visible"=>"-1",),
|
||||
"tms" => array("type"=>"timestamp", "label"=>"DateModification", "enabled"=>"1", 'position'=>55, 'notnull'=>1, "visible"=>"-1",),
|
||||
public $fields = array(
|
||||
"rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 10, 'notnull' => 1, "visible" => "0",),
|
||||
"ref" => array("type" => "varchar(30)", "label" => "Ref", "enabled" => "1", 'position' => 15, 'notnull' => 1, "visible" => "1", "csslist" => "tdoverflowmax150", "showoncombobox" => "1",),
|
||||
"type_declaration" => array("type" => "varchar(32)", "label" => "TypeOfDeclaration", "enabled" => "1", 'position' => 25, 'notnull' => 0, "visible" => "1", 'arrayofkeyval' => array("deb" => "DEB", "des" => "DES")),
|
||||
"periods" => array("type" => "varchar(32)", "label" => "Periods", "enabled" => "1", 'position' => 30, 'notnull' => 0, "visible" => "-1",),
|
||||
"mode" => array("type" => "varchar(32)", "label" => "Mode", "enabled" => "1", 'position' => 35, 'notnull' => 0, "visible" => "-1",),
|
||||
"content_xml" => array("type" => "text", "label" => "Contentxml", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "-1",),
|
||||
"type_export" => array("type" => "varchar(10)", "label" => "TypeOfExport", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "-1", 'arrayofkeyval' => array("in" => "Input", "out" => "Output")),
|
||||
"datec" => array("type" => "datetime", "label" => "DateCreation", "enabled" => "1", 'position' => 50, 'notnull' => 0, "visible" => "-1",),
|
||||
"tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 55, 'notnull' => 1, "visible" => "-1",),
|
||||
);
|
||||
public $rowid;
|
||||
public $ref;
|
||||
|
|
|
|||
|
|
@ -516,8 +516,8 @@ print '<input type="hidden" name="mode" value="'.$mode.'">';
|
|||
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/intracommreport/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
|
||||
|
||||
|
|
@ -619,7 +619,7 @@ foreach ($object->fields as $key => $val) {
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
$parameters = array('arrayfields' => $arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
/*if (!empty($arrayfields['anotherfield']['checked'])) {
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ $version = GETPOST('version', 'alpha');
|
|||
$family = GETPOST('family', 'alpha');
|
||||
$picto = GETPOST('idpicto', 'alpha');
|
||||
$idmodule = GETPOST('idmodule', 'alpha');
|
||||
$format = ''; // Prevent undefined in css tab
|
||||
|
||||
// Security check
|
||||
if (!isModEnabled('modulebuilder')) {
|
||||
|
|
@ -216,12 +217,31 @@ foreach ($dirsrootforscan as $tmpdirread) {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Produce copyright replacement string for user
|
||||
*
|
||||
* @param User $user User to produce the copyright notice for.
|
||||
* @param Translate $langs Translation object to use.
|
||||
* @param int $now Date for which the copyright will be generated.
|
||||
*
|
||||
* @return string String to be used as replacement after Copyright (C)
|
||||
*/
|
||||
function getLicenceHeader($user, $langs, $now)
|
||||
{
|
||||
$licInfo = $user->getFullName($langs);
|
||||
$emailTabs = str_repeat("\t", (int) (max(0, (31 - mb_strlen($licInfo)) / 4)));
|
||||
$licInfo .= ($user->email ? $emailTabs.'<'.$user->email.'>' : '');
|
||||
$licInfo = dol_print_date($now, '%Y')."\t\t".$licInfo;
|
||||
return $licInfo;
|
||||
}
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($dirins && $action == 'initmodule' && $modulename) {
|
||||
$modulename = ucfirst($modulename); // Force first letter in uppercase
|
||||
$destdir = '/not_set/';
|
||||
|
||||
if (preg_match('/[^a-z0-9_]/i', $modulename)) {
|
||||
$error++;
|
||||
|
|
@ -336,6 +356,8 @@ if ($dirins && $action == 'initmodule' && $modulename) {
|
|||
// Edit PHP files
|
||||
if (!$error) {
|
||||
$listofphpfilestoedit = dol_dir_list($destdir, 'files', 1, '\.(php|MD|js|sql|txt|xml|lang)$', '', 'fullname', SORT_ASC, 0, 1);
|
||||
|
||||
$licInfo = getLicenceHeader($user, $langs, $now);
|
||||
foreach ($listofphpfilestoedit as $phpfileval) {
|
||||
//var_dump($phpfileval['fullname']);
|
||||
$arrayreplacement = array(
|
||||
|
|
@ -347,7 +369,8 @@ if ($dirins && $action == 'initmodule' && $modulename) {
|
|||
'Mon module' => $modulename,
|
||||
'mon module' => $modulename,
|
||||
'htdocs/modulebuilder/template' => strtolower($modulename),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : ''),
|
||||
'---Put here your own copyright and developer email---' => $licInfo,
|
||||
'---Replace with your own copyright and developer email---' => $licInfo,
|
||||
'Editor name' => $editorname,
|
||||
'https://www.example.com' => $editorurl,
|
||||
'$this->version = \'1.0\'' => '$this->version = \''.$version.'\'',
|
||||
|
|
@ -357,7 +380,7 @@ if ($dirins && $action == 'initmodule' && $modulename) {
|
|||
);
|
||||
|
||||
if (getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR')) {
|
||||
$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
|
||||
$arrayreplacement['---Replace with your own copyright and developer email---'] = dol_print_date($now, '%Y')."\t\t" . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
|
|
@ -394,6 +417,9 @@ if ($dirins && $action == 'initmodule' && $modulename) {
|
|||
}
|
||||
}
|
||||
|
||||
$destdir = '/not_set/'; // Initialize (for static analysis)
|
||||
$destfile = '/not_set/'; // Initialize (for static analysis)
|
||||
$srcfile = '/not_set/'; // Initialize (for static analysis)
|
||||
|
||||
// init API, PHPUnit
|
||||
if ($dirins && in_array($action, array('initapi', 'initphpunit', 'initpagecontact', 'initpagedocument', 'initpagenote', 'initpageagenda')) && !empty($module)) {
|
||||
|
|
@ -466,7 +492,8 @@ if ($dirins && in_array($action, array('initapi', 'initphpunit', 'initpagecontac
|
|||
'myobject' => strtolower($objectname),
|
||||
'MyObject' => $objectname,
|
||||
'MYOBJECT' => strtoupper($objectname),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
if ($action == 'initapi') {
|
||||
|
|
@ -527,7 +554,7 @@ if ($dirins && $action == 'initsqlextrafields' && !empty($module)) {
|
|||
'MyObject' => $objectname,
|
||||
'my object' => strtolower($objectname),
|
||||
'myobject' => strtolower($objectname),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
dolReplaceInFile($destfile1, $arrayreplacement);
|
||||
|
|
@ -572,7 +599,7 @@ if ($dirins && $action == 'inithook' && !empty($module)) {
|
|||
'Mon module' => $modulename,
|
||||
'mon module' => $modulename,
|
||||
'htdocs/modulebuilder/template' => strtolower($modulename),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
|
|
@ -607,7 +634,7 @@ if ($dirins && $action == 'inittrigger' && !empty($module)) {
|
|||
'Mon module' => $modulename,
|
||||
'mon module' => $modulename,
|
||||
'htdocs/modulebuilder/template' => strtolower($modulename),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
|
|
@ -642,7 +669,7 @@ if ($dirins && $action == 'initwidget' && !empty($module)) {
|
|||
'Mon module' => $modulename,
|
||||
'mon module' => $modulename,
|
||||
'htdocs/modulebuilder/template' => strtolower($modulename),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
|
|
@ -677,7 +704,7 @@ if ($dirins && $action == 'initemailing' && !empty($module)) {
|
|||
'Mon module' => $modulename,
|
||||
'mon module' => $modulename,
|
||||
'htdocs/modulebuilder/template' => strtolower($modulename),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
|
|
@ -712,7 +739,7 @@ if ($dirins && $action == 'initcss' && !empty($module)) {
|
|||
'Mon module' => $modulename,
|
||||
'mon module' => $modulename,
|
||||
'htdocs/modulebuilder/template' => strtolower($modulename),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : ''),
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
|
|
@ -752,7 +779,7 @@ if ($dirins && $action == 'initjs' && !empty($module)) {
|
|||
'Mon module' => $modulename,
|
||||
'mon module' => $modulename,
|
||||
'htdocs/modulebuilder/template' => strtolower($modulename),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
|
|
@ -797,7 +824,7 @@ if ($dirins && $action == 'initcli' && !empty($module)) {
|
|||
'__USER_FULLNAME__' => $user->getFullName($langs),
|
||||
'__USER_EMAIL__' => $user->email,
|
||||
'__YYYY-MM-DD__' => dol_print_date($now, 'dayrfc'),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, 'dayrfc').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
|
|
@ -809,6 +836,8 @@ if ($dirins && $action == 'initcli' && !empty($module)) {
|
|||
}
|
||||
|
||||
|
||||
$moduledescriptorfile = '/not_set/';
|
||||
|
||||
// init Doc
|
||||
if ($dirins && $action == 'initdoc' && !empty($module)) {
|
||||
dol_mkdir($dirins.'/'.strtolower($module).'/doc');
|
||||
|
|
@ -838,7 +867,7 @@ if ($dirins && $action == 'initdoc' && !empty($module)) {
|
|||
'__USER_FULLNAME__' => $user->getFullName($langs),
|
||||
'__USER_EMAIL__' => $user->email,
|
||||
'__YYYY-MM-DD__' => dol_print_date($now, 'dayrfc'),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, 'dayrfc').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamPosition
|
||||
|
|
@ -1098,14 +1127,14 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
* 'alwayseditable' says if field can be modified also when status is not draft ('1' or '0')
|
||||
* 'default' is a default value for creation (can still be overwrote by the Setup of Default Values if field is editable in creation form). Note: If default is set to '(PROV)' and field is 'ref', the default value will be set to '(PROVid)' where id is rowid when a new record is created.
|
||||
* 'index' if we want an index in database.
|
||||
* 'foreignkey'=>'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...).
|
||||
* 'foreignkey' => 'tablename.field' if the field is a foreign key (it is recommended to name the field fk_...).
|
||||
* 'searchall' is 1 if we want to search in this field when making a search from the quick search button.
|
||||
* 'isameasure' must be set to 1 or 2 if field can be used for measure. Field type must be summable like integer or double(24,8). Use 1 in most cases, or 2 if you don't want to see the column total into list (for example for percentage)
|
||||
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css'=>'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview'=>'wordbreak', 'csslist'=>'tdoverflowmax200'
|
||||
* 'css' and 'cssview' and 'csslist' is the CSS style to use on field. 'css' is used in creation and update. 'cssview' is used in view mode. 'csslist' is used for columns in lists. For example: 'css' => 'minwidth300 maxwidth500 widthcentpercentminusx', 'cssview' => 'wordbreak', 'csslist' => 'tdoverflowmax200'
|
||||
* 'help' is a 'TranslationString' to use to show a tooltip on field. You can also use 'TranslationString:keyfortooltiponlick' for a tooltip on click.
|
||||
* 'showoncombobox' if value of the field must be visible into the label of the combobox that list record
|
||||
* 'disabled' is 1 if we want to have the field locked by a 'disabled' attribute. In most cases, this is never set into the definition of $fields into class, but is set dynamically by some part of code.
|
||||
* 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0"=>"Draft","1"=>"Active","-1"=>"Cancel"). Note that type can be 'integer' or 'varchar'
|
||||
* 'arrayofkeyval' to set a list of values if type is a list of predefined values. For example: array("0" => "Draft","1" => "Active","-1" => "Cancel"). Note that type can be 'integer' or 'varchar'
|
||||
* 'autofocusoncreate' to have field having the focus on a create form. Only 1 field should have this property set to 1.
|
||||
* 'comment' is not used. You can store here any text of your choice. It is not used by application.
|
||||
* 'validate' is 1 if need to validate with $this->validateField()
|
||||
|
|
@ -1113,27 +1142,27 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
*/
|
||||
|
||||
/*public $fields=array(
|
||||
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'index'=>1, 'position'=>1, 'comment'=>'Id'),
|
||||
'ref' =>array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'showoncombobox'=>1, 'index'=>1, 'position'=>10, 'searchall'=>1, 'comment'=>'Reference of object'),
|
||||
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'default'=>1, 'notnull'=>1, 'index'=>1, 'position'=>20),
|
||||
'label' =>array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'searchall'=>1, 'css'=>'minwidth200', 'help'=>'Help text', 'alwayseditable'=>'1'),
|
||||
'amount' =>array('type'=>'double(24,8)', 'label'=>'Amount', 'enabled'=>1, 'visible'=>1, 'default'=>'null', 'position'=>40, 'searchall'=>0, 'isameasure'=>1, 'help'=>'Help text'),
|
||||
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>50, 'notnull'=>-1, 'index'=>1, 'searchall'=>1, 'help'=>'LinkToThirdparty'),
|
||||
'description' =>array('type'=>'text', 'label'=>'Descrption', 'enabled'=>1, 'visible'=>0, 'position'=>60),
|
||||
'note_public' =>array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>0, 'position'=>61),
|
||||
'note_private' =>array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>0, 'position'=>62),
|
||||
'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>500),
|
||||
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>501),
|
||||
//'date_valid' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||
'fk_user_creat' =>array('type'=>'integer', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-2, 'notnull'=>1, 'position'=>510),
|
||||
'fk_user_modif' =>array('type'=>'integer', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>511),
|
||||
//'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'index'=>0, 'position'=>1000),
|
||||
'status' =>array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>1, 'notnull'=>1, 'default'=>0, 'index'=>1, 'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'),
|
||||
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 10, 'searchall' => 1, 'comment' => 'Reference of object'),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'default' => 1, 'notnull' => 1, 'index' => 1, 'position' => 20),
|
||||
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'searchall' => 1, 'css' => 'minwidth200', 'help' => 'Help text', 'alwayseditable' => '1'),
|
||||
'amount' => array('type' => 'double(24,8)', 'label' => 'Amount', 'enabled' => 1, 'visible' => 1, 'default' => 'null', 'position' => 40, 'searchall' => 0, 'isameasure' => 1, 'help' => 'Help text'),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'visible' => 1, 'enabled' => 1, 'position' => 50, 'notnull' => -1, 'index' => 1, 'searchall' => 1, 'help' => 'LinkToThirdparty'),
|
||||
'description' => array('type' => 'text', 'label' => 'Descrption', 'enabled' => 1, 'visible' => 0, 'position' => 60),
|
||||
'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 61),
|
||||
'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 62),
|
||||
'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500),
|
||||
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 501),
|
||||
//'date_valid' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'position' => 502),
|
||||
'fk_user_creat' => array('type' => 'integer', 'label' => 'UserAuthor', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 510),
|
||||
'fk_user_modif' => array('type' => 'integer', 'label' => 'UserModif', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 511),
|
||||
//'fk_user_valid' => array('type' => 'integer', 'label' => 'UserValidation', 'enabled' => 1, 'visible' => -1, 'position' => 512),
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
|
||||
'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => 0, 'index' => 1, 'position' => 1000, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Active', -1 => 'Cancel')),
|
||||
);*/
|
||||
|
||||
$stringforproperties = '// BEGIN MODULEBUILDER PROPERTIES'."\n";
|
||||
$stringforproperties .= 'public $fields=array('."\n";
|
||||
$stringforproperties .= 'public $fields = array('."\n";
|
||||
$i = 10;
|
||||
while ($obj = $db->fetch_object($_results)) {
|
||||
// fieldname
|
||||
|
|
@ -1249,6 +1278,8 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
// $alwayseditable
|
||||
if ($fieldname == 'label') {
|
||||
$alwayseditable = 1;
|
||||
} else {
|
||||
$alwayseditable = 0;
|
||||
}
|
||||
// index
|
||||
$index = 0;
|
||||
|
|
@ -1283,36 +1314,36 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
}
|
||||
|
||||
// Build the property string
|
||||
$stringforproperties .= "'".$obj->Field."'=>array('type'=>'".$type."', 'label'=>'".$label."',";
|
||||
$stringforproperties .= "'".$obj->Field."' => array('type' => '".$type."', 'label' => '".$label."',";
|
||||
if ($default != '') {
|
||||
$stringforproperties .= " 'default'=>".$default.",";
|
||||
$stringforproperties .= " 'default' => ".$default.",";
|
||||
}
|
||||
$stringforproperties .= " 'enabled'=>".$enabled.",";
|
||||
$stringforproperties .= " 'visible'=>".$visible;
|
||||
$stringforproperties .= " 'enabled' => ".$enabled.",";
|
||||
$stringforproperties .= " 'visible' => ".$visible;
|
||||
if ($notnull) {
|
||||
$stringforproperties .= ", 'notnull'=>".$notnull;
|
||||
$stringforproperties .= ", 'notnull' => ".$notnull;
|
||||
}
|
||||
if ($alwayseditable) {
|
||||
$stringforproperties .= ", 'alwayseditable'=>1";
|
||||
$stringforproperties .= ", 'alwayseditable' => 1";
|
||||
}
|
||||
if ($fieldname == 'ref' || $fieldname == 'code') {
|
||||
$stringforproperties .= ", 'showoncombobox'=>1";
|
||||
$stringforproperties .= ", 'showoncombobox' => 1";
|
||||
}
|
||||
$stringforproperties .= ", 'position'=>".$position;
|
||||
$stringforproperties .= ", 'position' => ".$position;
|
||||
if ($index) {
|
||||
$stringforproperties .= ", 'index'=>".$index;
|
||||
$stringforproperties .= ", 'index' => ".$index;
|
||||
}
|
||||
if ($picto) {
|
||||
$stringforproperties .= ", 'picto'=>'".$picto."'";
|
||||
$stringforproperties .= ", 'picto' => '".$picto."'";
|
||||
}
|
||||
if ($css) {
|
||||
$stringforproperties .= ", 'css'=>'".$css."'";
|
||||
$stringforproperties .= ", 'css' => '".$css."'";
|
||||
}
|
||||
if ($cssview) {
|
||||
$stringforproperties .= ", 'cssview'=>'".$cssview."'";
|
||||
$stringforproperties .= ", 'cssview' => '".$cssview."'";
|
||||
}
|
||||
if ($csslist) {
|
||||
$stringforproperties .= ", 'csslist'=>'".$csslist."'";
|
||||
$stringforproperties .= ", 'csslist' => '".$csslist."'";
|
||||
}
|
||||
$stringforproperties .= "),\n";
|
||||
$i += 5;
|
||||
|
|
@ -1322,6 +1353,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
}
|
||||
}
|
||||
|
||||
$filetogenerate = array(); // For static analysis
|
||||
if (!$error) {
|
||||
// Copy some files
|
||||
$filetogenerate = array(
|
||||
|
|
@ -1333,14 +1365,14 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
'myobject_list.php' => strtolower($objectname).'_list.php',
|
||||
'admin/myobject_extrafields.php' => 'admin/'.strtolower($objectname).'_extrafields.php',
|
||||
'lib/mymodule_myobject.lib.php' => 'lib/'.strtolower($module).'_'.strtolower($objectname).'.lib.php',
|
||||
//'test/phpunit/MyObjectTest.php'=>'test/phpunit/'.strtolower($objectname).'Test.php',
|
||||
//'test/phpunit/MyObjectTest.php' => 'test/phpunit/'.strtolower($objectname).'Test.php',
|
||||
'sql/llx_mymodule_myobject.sql' => 'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.sql',
|
||||
'sql/llx_mymodule_myobject.key.sql' => 'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql',
|
||||
'sql/llx_mymodule_myobject_extrafields.sql' => 'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql',
|
||||
'sql/llx_mymodule_myobject_extrafields.key.sql' => 'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.key.sql',
|
||||
//'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php',
|
||||
//'scripts/mymodule.php' => 'scripts/'.strtolower($objectname).'.php',
|
||||
'class/myobject.class.php' => 'class/'.strtolower($objectname).'.class.php',
|
||||
//'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php',
|
||||
//'class/api_mymodule.class.php' => 'class/api_'.strtolower($module).'.class.php',
|
||||
);
|
||||
|
||||
if (GETPOST('includerefgeneration', 'aZ09')) {
|
||||
|
|
@ -1366,15 +1398,21 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrModules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
}
|
||||
}
|
||||
$rights = $moduleobj->rights;
|
||||
if (is_object($moduleobj)) {
|
||||
$rights = $moduleobj->rights;
|
||||
} else {
|
||||
$rights = [];
|
||||
}
|
||||
$moduledescriptorfile = $destdir.'/core/modules/mod'.$module.'.class.php';
|
||||
$checkComment = checkExistComment($moduledescriptorfile, 1);
|
||||
if ($checkComment < 0) {
|
||||
|
|
@ -1421,9 +1459,9 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
|
||||
// Edit the class 'class/'.strtolower($objectname).'.class.php'
|
||||
if (GETPOST('includerefgeneration', 'aZ09')) {
|
||||
// Replace 'visible'=>1, 'noteditable'=>0, 'default'=>''
|
||||
// Replace 'visible' => 1, 'noteditable' => 0, 'default' => ''
|
||||
$arrayreplacement = array(
|
||||
'/\'visible\'=>1,\s*\'noteditable\'=>0,\s*\'default\'=>\'\'/' => "'visible'=>4, 'noteditable'=>1, 'default'=>'(PROV)'"
|
||||
'/\'visible\'s*=>s*1,\s*\'noteditable\'s*=>s*0,\s*\'default\'s*=>s*\'\'/' => "'visible' => 4, 'noteditable' => 1, 'default' => '(PROV)'"
|
||||
);
|
||||
//var_dump($arrayreplacement);exit;
|
||||
//var_dump($destdir.'/class/'.strtolower($objectname).'.class.php');exit;
|
||||
|
|
@ -1451,7 +1489,7 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
dolReplaceInFile($destdir.'/core/modules/mod'.$module.'.class.php', $arrayreplacement, '', 0, 0, 1);
|
||||
}
|
||||
|
||||
// TODO Update entries '$myTmpObjects['MyObject']=array('includerefgeneration'=>0, 'includedocgeneration'=>0);'
|
||||
// TODO Update entries '$myTmpObjects['MyObject'] = array('includerefgeneration' => 0, 'includedocgeneration' => 0);'
|
||||
|
||||
|
||||
// Scan for object class files
|
||||
|
|
@ -1477,51 +1515,51 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
|
||||
// Regenerate left menu entry in descriptor for $objectname
|
||||
$stringtoadd = "
|
||||
\$this->menu[\$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=mymodule',
|
||||
'type'=>'left',
|
||||
'titre'=>'MyObject',
|
||||
\$this->menu[\$r++] = array(
|
||||
'fk_menu' => 'fk_mainmenu=mymodule',
|
||||
'type' => 'left',
|
||||
'titre' => 'MyObject',
|
||||
'prefix' => img_picto('', \$this->picto, 'class=\"paddingright pictofixedwidth valignmiddle\"'),
|
||||
'mainmenu'=>'mymodule',
|
||||
'leftmenu'=>'myobject',
|
||||
'url'=>'/mymodule/myobject_list.php',
|
||||
'langs'=>'mymodule@mymodule',
|
||||
'position'=>1000+\$r,
|
||||
'enabled'=>'isModEnabled(\"mymodule\")',
|
||||
'perms'=>'".(GETPOST('generatepermissions') ? '$user->hasRight("mymodule", "myobject", "read")' : '1')."',
|
||||
'target'=>'',
|
||||
'user'=>2,
|
||||
'object'=>'MyObject'
|
||||
'mainmenu' => 'mymodule',
|
||||
'leftmenu' => 'myobject',
|
||||
'url' => '/mymodule/myobject_list.php',
|
||||
'langs' => 'mymodule@mymodule',
|
||||
'position' => 1000 + \$r,
|
||||
'enabled' => 'isModEnabled(\"mymodule\")',
|
||||
'perms' => '".(GETPOST('generatepermissions') ? '$user->hasRight("mymodule", "myobject", "read")' : '1')."',
|
||||
'target' => '',
|
||||
'user' => 2,
|
||||
'object' => 'MyObject'
|
||||
);
|
||||
\$this->menu[\$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=myobject',
|
||||
'type'=>'left',
|
||||
'titre'=>'List MyObject',
|
||||
'mainmenu'=>'mymodule',
|
||||
'leftmenu'=>'mymodule_myobject_list',
|
||||
'url'=>'/mymodule/myobject_list.php',
|
||||
'langs'=>'mymodule@mymodule',
|
||||
'position'=>1000+\$r,
|
||||
'enabled'=>'isModEnabled(\"mymodule\")',
|
||||
'perms'=>'".(GETPOST('generatepermissions') ? '$user->hasRight("mymodule", "myobject", "read")' : '1')."',
|
||||
'target'=>'',
|
||||
'user'=>2,
|
||||
'object'=>'MyObject'
|
||||
);
|
||||
\$this->menu[\$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=myobject',
|
||||
'type'=>'left',
|
||||
'titre'=>'New MyObject',
|
||||
'mainmenu'=>'mymodule',
|
||||
'leftmenu'=>'mymodule_myobject_new',
|
||||
'url'=>'/mymodule/myobject_card.php?action=create',
|
||||
'langs'=>'mymodule@mymodule',
|
||||
'position'=>1000+\$r,
|
||||
'enabled'=>'isModEnabled(\"mymodule\")',
|
||||
'perms'=>'".(GETPOST('generatepermissions') ? '$user->hasRight("mymodule", "myobject", "write")' : '1')."',
|
||||
'target'=>'',
|
||||
'user'=>2,
|
||||
'object'=>'MyObject'
|
||||
\$this->menu[\$r++] = array(
|
||||
'fk_menu' => 'fk_mainmenu=mymodule,fk_leftmenu=myobject',
|
||||
'type' => 'left',
|
||||
'titre' => 'List MyObject',
|
||||
'mainmenu' => 'mymodule',
|
||||
'leftmenu' => 'mymodule_myobject_list',
|
||||
'url' => '/mymodule/myobject_list.php',
|
||||
'langs' => 'mymodule@mymodule',
|
||||
'position' => 1000 + \$r,
|
||||
'enabled' => 'isModEnabled(\"mymodule\")',
|
||||
'perms' => '".(GETPOST('generatepermissions') ? '$user->hasRight("mymodule", "myobject", "read")' : '1')."',
|
||||
'target' => '',
|
||||
'user' => 2,
|
||||
'object' => 'MyObject'
|
||||
);
|
||||
\$this->menu[\$r++] = array(
|
||||
'fk_menu' => 'fk_mainmenu=mymodule,fk_leftmenu=myobject',
|
||||
'type' => 'left',
|
||||
'titre' => 'New MyObject',
|
||||
'mainmenu' => 'mymodule',
|
||||
'leftmenu' => 'mymodule_myobject_new',
|
||||
'url' => '/mymodule/myobject_card.php?action=create',
|
||||
'langs' => 'mymodule@mymodule',
|
||||
'position' => 1000 + \$r,
|
||||
'enabled' => 'isModEnabled(\"mymodule\")',
|
||||
'perms' => '".(GETPOST('generatepermissions') ? '$user->hasRight("mymodule", "myobject", "write")' : '1')."',
|
||||
'target' => '',
|
||||
'user' => 2,
|
||||
'object' => 'MyObject'
|
||||
);";
|
||||
$stringtoadd = preg_replace('/MyObject/', $objectname, $stringtoadd);
|
||||
$stringtoadd = preg_replace('/mymodule/', strtolower($module), $stringtoadd);
|
||||
|
|
@ -1536,15 +1574,21 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrModules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
}
|
||||
}
|
||||
$menus = $moduleobj->menu;
|
||||
if (is_object($moduleobj)) {
|
||||
$menus = $moduleobj->menu;
|
||||
} else {
|
||||
$menus = array();
|
||||
}
|
||||
$counter = 0 ;
|
||||
foreach ($menus as $menu) {
|
||||
if ($menu['leftmenu'] == strtolower($objectname)) {
|
||||
|
|
@ -1582,12 +1626,12 @@ if ($dirins && $action == 'initobject' && $module && $objectname) {
|
|||
'htdocs/modulebuilder/template/' => strtolower($modulename),
|
||||
'myobject' => strtolower($objectname),
|
||||
'MyObject' => $objectname,
|
||||
//'MYOBJECT'=>strtoupper($objectname),
|
||||
'---Put here your own copyright and developer email---' => dol_print_date($now, '%Y').' '.$user->getFullName($langs).($user->email ? ' <'.$user->email.'>' : '')
|
||||
//'MYOBJECT' => strtoupper($objectname),
|
||||
'---Replace with your own copyright and developer email---' => getLicenceHeader($user, $langs, $now)
|
||||
);
|
||||
|
||||
if (getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR')) {
|
||||
$arrayreplacement['---Put here your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
|
||||
$arrayreplacement['---Replace with your own copyright and developer email---'] = dol_print_date($now, '%Y').' ' . getDolGlobalString('MODULEBUILDER_SPECIFIC_AUTHOR');
|
||||
}
|
||||
|
||||
$result = dolReplaceInFile($phpfileval['fullname'], $arrayreplacement);
|
||||
|
|
@ -1670,6 +1714,7 @@ if ($dirins && $action == 'initdic' && $module && empty($cancel)) {
|
|||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrModules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -1751,6 +1796,9 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||
$error++;
|
||||
setEventMessages($langs->trans("ErrorObjectNotFound", $langs->transnoentities($objectname)), null, 'errors');
|
||||
}
|
||||
|
||||
$addfieldentry = array();
|
||||
|
||||
// We click on add property
|
||||
if (!GETPOST('regenerateclasssql') && !GETPOST('regeneratemissing')) {
|
||||
if (!GETPOST('propname', 'aZ09')) {
|
||||
|
|
@ -1766,6 +1814,7 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
|
||||
}
|
||||
|
||||
|
||||
if (!$error && !GETPOST('regenerateclasssql') && !GETPOST('regeneratemissing')) {
|
||||
$addfieldentry = array(
|
||||
'name' => GETPOST('propname', 'aZ09'),
|
||||
|
|
@ -1786,8 +1835,8 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||
'cssview' => GETPOST('propcssview', 'alpha'),
|
||||
'csslist' => GETPOST('propcsslist', 'alpha'),
|
||||
'default' => GETPOST('propdefault', 'restricthtml'),
|
||||
'noteditable' => intval(GETPOSTINT('propnoteditable')),
|
||||
//'alwayseditable'=>intval(GETPOST('propalwayseditable', 'int')),
|
||||
'noteditable' => GETPOSTINT('propnoteditable'),
|
||||
//'alwayseditable' => GETPOSTINT('propalwayseditable'),
|
||||
'validate' => GETPOSTINT('propvalidate')
|
||||
);
|
||||
|
||||
|
|
@ -1801,8 +1850,6 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$addfieldentry = array();
|
||||
}
|
||||
|
||||
/*if (GETPOST('regeneratemissing'))
|
||||
|
|
@ -1913,9 +1960,12 @@ if ($dirins && $action == 'confirm_deletemodule') {
|
|||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
|
||||
$moduleobj = null;
|
||||
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -1994,9 +2044,11 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) {
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2083,6 +2135,8 @@ if (($dirins && $action == 'confirm_deletedictionary' && $dicname) || ($dirins &
|
|||
if (!preg_match('/^c_/', $newdicname)) {
|
||||
$newdicname = 'c_'.strtolower($dicname);
|
||||
}
|
||||
} else {
|
||||
$newdicname = null;
|
||||
}
|
||||
|
||||
dol_include_once($pathtofile);
|
||||
|
|
@ -2091,6 +2145,7 @@ if (($dirins && $action == 'confirm_deletedictionary' && $dicname) || ($dirins &
|
|||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrModules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2113,9 +2168,13 @@ if (($dirins && $action == 'confirm_deletedictionary' && $dicname) || ($dirins &
|
|||
$newdicname = $dicts['tabname'][GETPOSTINT('dictionnarykey') - 1];
|
||||
}
|
||||
|
||||
//chercher la table dicname
|
||||
$checkTable = $db->DDLDescTable(MAIN_DB_PREFIX.strtolower($newdicname));
|
||||
if ($checkTable && $db->num_rows($checkTable) <= 0) {
|
||||
// Lookup the table dicname
|
||||
$checkTable = false;
|
||||
if ($newdicname !== null) {
|
||||
$checkTable = $db->DDLDescTable(MAIN_DB_PREFIX.strtolower($newdicname));
|
||||
}
|
||||
|
||||
if (is_bool($checkTable) || $db->num_rows($checkTable) <= 0) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
|
|
@ -2171,6 +2230,7 @@ if ($dirins && $action == 'updatedictionary' && GETPOST('dictionnarykey')) {
|
|||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2239,6 +2299,7 @@ if ($dirins && $action == 'generatepackage') {
|
|||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2288,9 +2349,11 @@ if ($dirins && $action == 'addright' && !empty($module) && empty($cancel)) {
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrModules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2315,7 +2378,11 @@ if ($dirins && $action == 'addright' && !empty($module) && empty($cancel)) {
|
|||
//check existing object permission
|
||||
$counter = 0;
|
||||
$permsForObject = array();
|
||||
$permissions = $moduleobj->rights;
|
||||
if (is_object($moduleobj)) {
|
||||
$permissions = $moduleobj->rights;
|
||||
} else {
|
||||
$permissions = array();
|
||||
}
|
||||
$allObject = array();
|
||||
|
||||
$countPerms = count($permissions);
|
||||
|
|
@ -2339,15 +2406,16 @@ if ($dirins && $action == 'addright' && !empty($module) && empty($cancel)) {
|
|||
}
|
||||
}
|
||||
|
||||
$rightToAdd = array();
|
||||
if (!$error) {
|
||||
$key = $countPerms + 1;
|
||||
//prepare right to add
|
||||
$rightToAdd = [
|
||||
$rightToAdd = array(
|
||||
0 => $id,
|
||||
1 => $label,
|
||||
4 => $objectForPerms,
|
||||
5 => $crud
|
||||
];
|
||||
);
|
||||
|
||||
if (isModEnabled(strtolower($module))) {
|
||||
$result = unActivateModule(strtolower($module));
|
||||
|
|
@ -2384,9 +2452,11 @@ if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright') &&
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrModules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2420,16 +2490,26 @@ if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright') &&
|
|||
// $label = "Delete objects of $module";
|
||||
}
|
||||
|
||||
$permissions = $moduleobj->rights;
|
||||
$key = (int) GETPOST('counter') - 1;
|
||||
if (is_object($moduleobj)) {
|
||||
$permissions = $moduleobj->rights;
|
||||
} else {
|
||||
$permissions = [];
|
||||
}
|
||||
$key = GETPOSTINT('counter') - 1;
|
||||
//get permission want to delete from permissions array
|
||||
$x1 = $permissions[$key][1];
|
||||
$x2 = $permissions[$key][4];
|
||||
$x3 = $permissions[$key][5];
|
||||
if (array_key_exists($key, $permissions)) {
|
||||
$x1 = $permissions[$key][1];
|
||||
$x2 = $permissions[$key][4];
|
||||
$x3 = $permissions[$key][5];
|
||||
} else {
|
||||
$x1 = null;
|
||||
$x2 = null;
|
||||
$x3 = null;
|
||||
}
|
||||
//check existing object permission
|
||||
$counter = 0;
|
||||
$permsForObject = array();
|
||||
$permissions = $moduleobj->rights;
|
||||
// $permissions = $moduleobj->rights; // Already fetched above
|
||||
$firstRight = 0;
|
||||
$existRight = 0;
|
||||
$allObject = array();
|
||||
|
|
@ -2471,6 +2551,7 @@ if ($dirins && GETPOST('action') == 'update_right' && GETPOST('modifyright') &&
|
|||
if ($rewrite < 0) {
|
||||
setEventMessages($langs->trans("WarningCommentNotFound", $langs->trans("Permissions"), "mod".$module."class.php"), null, 'warnings');
|
||||
} else {
|
||||
$rightUpdated = null; // I not set at this point
|
||||
reWriteAllPermissions($moduledescriptorfile, $permissions, $key, $rightUpdated, '', '', 2);
|
||||
setEventMessages($langs->trans('PermissionUpdatedSuccesfuly'), null);
|
||||
clearstatcache(true);
|
||||
|
|
@ -2489,9 +2570,11 @@ if ($dirins && $action == 'confirm_deleteright' && !empty($module) && GETPOSTINT
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2661,9 +2744,11 @@ if ($dirins && $action == 'confirm_deletemenu' && GETPOSTINT('menukey')) {
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2723,9 +2808,11 @@ if ($dirins && $action == 'addmenu' && empty($cancel)) {
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2879,9 +2966,11 @@ if ($dirins && $action == "update_menu" && GETPOSTINT('menukey') && GETPOST('tab
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -2980,9 +3069,11 @@ if ($dirins && $action == "update_props_module" && !empty(GETPOST('keydescriptio
|
|||
dol_include_once($pathtofile);
|
||||
|
||||
$class = 'mod'.$module;
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
@ -3140,9 +3231,11 @@ if (!empty($module) && $module != 'initmodule' && $module != 'deletemodule') {
|
|||
$loadclasserrormessage .= 'Line: '.$e->getLine()."<br>\n";
|
||||
}
|
||||
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
print $e->getMessage();
|
||||
|
|
@ -3229,7 +3322,7 @@ if (is_array($listofmodules) && count($listofmodules) > 0) {
|
|||
$linktoenabledisable .= ' <a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1], 1).'?save_lastsearch_values=1&backtopage='.urlencode($backtourl).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"), "setup", 'style="padding-right: 8px"').'</a>';
|
||||
}
|
||||
} else {
|
||||
if (!empty($moduleobj)) {
|
||||
if (is_object($moduleobj)) {
|
||||
$linktoenabledisable .= '<a class="reposition asetresetmodule valignmiddle" href="'.$_SERVER["PHP_SELF"].'?id='.$moduleobj->numero.'&action=set&token='.newToken().'&value=mod'.$module.$param.'">';
|
||||
$linktoenabledisable .= img_picto($langs->trans("ModuleIsNotActive", $urltomodulesetup), 'switch_off', 'style="padding-right: 8px"', false, 0, 0, '', 'classfortooltip', 1);
|
||||
$linktoenabledisable .= "</a>\n";
|
||||
|
|
@ -3528,7 +3621,7 @@ if ($module == 'initmodule') {
|
|||
|
||||
print load_fiche_titre($form->textwithpicto($langs->trans("DescriptorFile"), $langs->transnoentitiesnoconv("File").' '.$pathtofile), '', '');
|
||||
|
||||
if (!empty($moduleobj)) {
|
||||
if (is_object($moduleobj)) {
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<div class="fichecenter">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
|
|
@ -3745,7 +3838,7 @@ if ($module == 'initmodule') {
|
|||
print '<input type="hidden" name="file" value="'.dol_escape_htmltag($file).'">';
|
||||
print '<input type="hidden" name="tab" value="'.$tab.'">';
|
||||
print '<input type="hidden" name="module" value="'.$module.'">';
|
||||
print $formadmin->select_language(getDolGlobalString('MAIN_LANG_DEFAULT'), 'newlangcode', 0, 0, 1, 0, 0, 'minwidth300', 1);
|
||||
print $formadmin->select_language(getDolGlobalString('MAIN_LANG_DEFAULT'), 'newlangcode', 0, array(), 1, 0, 0, 'minwidth300', 1);
|
||||
print '<input type="submit" name="addlanguage" class="button smallpaddingimp" value="'.dol_escape_htmltag($langs->trans("AddLanguageFile")).'"><br>';
|
||||
print '</form>';
|
||||
|
||||
|
|
@ -6245,6 +6338,7 @@ if ($module == 'initmodule') {
|
|||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
$texttoshow = null;
|
||||
if ($cron['jobtype'] == 'method') {
|
||||
$text = $langs->trans("CronClass");
|
||||
$texttoshow = $langs->trans('CronModule').': '.$module.'<br>';
|
||||
|
|
@ -6457,10 +6551,11 @@ if ($module == 'initmodule') {
|
|||
$pathtofile = $listofmodules[strtolower($module)]['moduledescriptorrelpath'];
|
||||
dol_include_once($pathtofile);
|
||||
$class = 'mod'.$module;
|
||||
|
||||
$moduleobj = null;
|
||||
if (class_exists($class)) {
|
||||
try {
|
||||
$moduleobj = new $class($db);
|
||||
'@phan-var-force DolibarrMOdules $moduleobj';
|
||||
} catch (Exception $e) {
|
||||
$error++;
|
||||
dol_print_error($db, $e->getMessage());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -29,7 +29,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
||||
$tmp2 = realpath(__FILE__);
|
||||
$i = strlen($tmp) - 1;
|
||||
$j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--;
|
||||
$j--;
|
||||
|
|
|
|||
|
|
@ -33,7 +33,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
||||
$tmp2 = realpath(__FILE__);
|
||||
$i = strlen($tmp) - 1;
|
||||
$j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--;
|
||||
$j--;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -218,26 +217,26 @@ if ($action == 'updateMask') {
|
|||
|
||||
$className = $myTmpObjects[$tmpobjectkey]['class'];
|
||||
$tmpobject = new $className($db);
|
||||
'@phan-var-force MyObject $tmpobject';
|
||||
$tmpobject->initAsSpecimen();
|
||||
|
||||
// Search template files
|
||||
$file = '';
|
||||
$className = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/mymodule/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$className = "pdf_".$modele."_".strtolower($tmpobjectkey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($className !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $className($db);
|
||||
'@phan-var-force ModelePDFMyObject $module';
|
||||
|
||||
'@phan-var-force ModelePDFMyObject $module';
|
||||
|
||||
|
|
@ -372,8 +371,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
require_once $dir.'/'.$file.'.php';
|
||||
|
||||
$module = new $file($db);
|
||||
|
||||
'@phan-var-force CommonNumRefGenerator $module';
|
||||
'@phan-var-force ModeleNumRefMyObject $module';
|
||||
|
||||
// Show modules according to features level
|
||||
if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
|
||||
|
|
@ -416,6 +414,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
|
||||
$className = $myTmpObjectArray['class'];
|
||||
$mytmpinstance = new $className($db);
|
||||
'@phan-var-force MyObject $mytmpinstance';
|
||||
$mytmpinstance->initAsSpecimen();
|
||||
|
||||
// Info
|
||||
|
|
@ -498,6 +497,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
if (is_dir($dir)) {
|
||||
$handle = opendir($dir);
|
||||
if (is_resource($handle)) {
|
||||
$filelist = array();
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
$filelist[] = $file;
|
||||
}
|
||||
|
|
@ -512,7 +512,6 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
|
||||
require_once $dir.'/'.$file;
|
||||
$module = new $className($db);
|
||||
|
||||
'@phan-var-force ModelePDFMyObject $module';
|
||||
|
||||
$modulequalified = 1;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -22,7 +21,7 @@
|
|||
* \ingroup mymodule
|
||||
* \brief Example hook overload.
|
||||
*
|
||||
* Put detailed description here.
|
||||
* TODO: Write detailed description here.
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/commonhookactions.class.php';
|
||||
|
|
@ -43,13 +42,13 @@ class ActionsMyModule extends CommonHookActions
|
|||
public $error = '';
|
||||
|
||||
/**
|
||||
* @var array Errors
|
||||
* @var string[] Errors
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var array Hook results. Propagated to $hookmanager->resArray for later reuse
|
||||
* @var mixed[] Hook results. Propagated to $hookmanager->resArray for later reuse
|
||||
*/
|
||||
public $results = array();
|
||||
|
||||
|
|
@ -67,7 +66,7 @@ class ActionsMyModule extends CommonHookActions
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
|
|
@ -78,12 +77,12 @@ class ActionsMyModule extends CommonHookActions
|
|||
/**
|
||||
* Execute action
|
||||
*
|
||||
* @param array $parameters Array of parameters
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @return int Return integer <0 if KO,
|
||||
* @param array<string,mixed> $parameters Array of parameters
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @return int Return integer <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
*/
|
||||
public function getNomUrl($parameters, &$object, &$action)
|
||||
{
|
||||
|
|
@ -93,13 +92,13 @@ class ActionsMyModule extends CommonHookActions
|
|||
}
|
||||
|
||||
/**
|
||||
* Overloading the doActions function : replacing the parent's function with the one below
|
||||
* Overload the doActions function : replacing the parent's function with the one below
|
||||
*
|
||||
* @param array $parameters Hook metadatas (context, etc...)
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
|
||||
* @param array<string,mixed> $parameters Hook metadata (context, etc...)
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param ?string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
|
||||
*/
|
||||
public function doActions($parameters, &$object, &$action, $hookmanager)
|
||||
{
|
||||
|
|
@ -108,9 +107,10 @@ class ActionsMyModule extends CommonHookActions
|
|||
$error = 0; // Error counter
|
||||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
// @phan-suppress-next-line PhanPluginEmptyStatementIf
|
||||
if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2'
|
||||
// Do what you want here...
|
||||
// You can for example load and use call global vars like $fieldstosearchall to overwrite them, or update database depending on $action and GETPOST values.
|
||||
// You can for example load and use call global vars like $fieldstosearchall to overwrite them, or update the database depending on $action and GETPOST values.
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
|
|
@ -125,13 +125,13 @@ class ActionsMyModule extends CommonHookActions
|
|||
|
||||
|
||||
/**
|
||||
* Overloading the doMassActions function : replacing the parent's function with the one below
|
||||
* Overload the doMassActions function : replacing the parent's function with the one below
|
||||
*
|
||||
* @param array $parameters Hook metadatas (context, etc...)
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
|
||||
* @param array<string,mixed> $parameters Hook metadata (context, etc...)
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param ?string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
|
||||
*/
|
||||
public function doMassActions($parameters, &$object, &$action, $hookmanager)
|
||||
{
|
||||
|
|
@ -141,6 +141,7 @@ class ActionsMyModule extends CommonHookActions
|
|||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2'
|
||||
// @phan-suppress-next-line PhanPluginEmptyStatementForeachLoop
|
||||
foreach ($parameters['toselect'] as $objectid) {
|
||||
// Do action on each object id
|
||||
}
|
||||
|
|
@ -158,13 +159,13 @@ class ActionsMyModule extends CommonHookActions
|
|||
|
||||
|
||||
/**
|
||||
* Overloading the addMoreMassActions function : replacing the parent's function with the one below
|
||||
* Overload the addMoreMassActions function : replacing the parent's function with the one below
|
||||
*
|
||||
* @param array $parameters Hook metadatas (context, etc...)
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
|
||||
* @param array<string,mixed> $parameters Hook metadata (context, etc...)
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param ?string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
|
||||
*/
|
||||
public function addMoreMassActions($parameters, &$object, &$action, $hookmanager)
|
||||
{
|
||||
|
|
@ -189,14 +190,14 @@ class ActionsMyModule extends CommonHookActions
|
|||
|
||||
|
||||
/**
|
||||
* Execute action
|
||||
* Execute action before PDF (document) creation
|
||||
*
|
||||
* @param array $parameters Array of parameters
|
||||
* @param Object $object Object output on PDF
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @return int Return integer <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
* @param array<string,mixed> $parameters Array of parameters
|
||||
* @param CommonObject $object Object output on PDF
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @return int Return integer <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
*/
|
||||
public function beforePDFCreation($parameters, &$object, &$action)
|
||||
{
|
||||
|
|
@ -210,6 +211,7 @@ class ActionsMyModule extends CommonHookActions
|
|||
dol_syslog(get_class($this).'::executeHooks action='.$action);
|
||||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
// @phan-suppress-next-line PhanPluginEmptyStatementIf
|
||||
if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) { // do something only for the context 'somecontext1' or 'somecontext2'
|
||||
}
|
||||
|
||||
|
|
@ -217,14 +219,14 @@ class ActionsMyModule extends CommonHookActions
|
|||
}
|
||||
|
||||
/**
|
||||
* Execute action
|
||||
* Execute action after PDF (document) creation
|
||||
*
|
||||
* @param array $parameters Array of parameters
|
||||
* @param Object $pdfhandler PDF builder handler
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @return int Return integer <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
* @param array<string,mixed> $parameters Array of parameters
|
||||
* @param CommonDocGenerator $pdfhandler PDF builder handler
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @return int Return integer <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
*/
|
||||
public function afterPDFCreation($parameters, &$pdfhandler, &$action)
|
||||
{
|
||||
|
|
@ -238,6 +240,7 @@ class ActionsMyModule extends CommonHookActions
|
|||
dol_syslog(get_class($this).'::executeHooks action='.$action);
|
||||
|
||||
/* print_r($parameters); print_r($object); echo "action: " . $action; */
|
||||
// @phan-suppress-next-line PhanPluginEmptyStatementIf
|
||||
if (in_array($parameters['currentcontext'], array('somecontext1', 'somecontext2'))) {
|
||||
// do something only for the context 'somecontext1' or 'somecontext2'
|
||||
}
|
||||
|
|
@ -248,12 +251,12 @@ class ActionsMyModule extends CommonHookActions
|
|||
|
||||
|
||||
/**
|
||||
* Overloading the loadDataForCustomReports function : returns data to complete the customreport tool
|
||||
* Overload the loadDataForCustomReports function : returns data to complete the customreport tool
|
||||
*
|
||||
* @param array $parameters Hook metadatas (context, etc...)
|
||||
* @param string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
|
||||
* @param array<string,mixed> $parameters Hook metadata (context, etc...)
|
||||
* @param ?string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer < 0 on error, 0 on success, 1 to replace standard code
|
||||
*/
|
||||
public function loadDataForCustomReports($parameters, &$action, $hookmanager)
|
||||
{
|
||||
|
|
@ -293,14 +296,14 @@ class ActionsMyModule extends CommonHookActions
|
|||
|
||||
|
||||
/**
|
||||
* Overloading the restrictedArea function : check permission on an object
|
||||
* Overload the restrictedArea function : check permission on an object
|
||||
*
|
||||
* @param array $parameters Hook metadatas (context, etc...)
|
||||
* @param string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
* @param array<string,mixed> $parameters Hook metadata (context, etc...)
|
||||
* @param string $action Current action (if set). Generally create or edit or null
|
||||
* @param HookManager $hookmanager Hook manager propagated to allow calling another hook
|
||||
* @return int Return integer <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
*/
|
||||
public function restrictedArea($parameters, &$action, $hookmanager)
|
||||
{
|
||||
|
|
@ -322,13 +325,13 @@ class ActionsMyModule extends CommonHookActions
|
|||
/**
|
||||
* Execute action completeTabsHead
|
||||
*
|
||||
* @param array $parameters Array of parameters
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @param Hookmanager $hookmanager hookmanager
|
||||
* @return int Return integer <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
* @param array<string,mixed> $parameters Array of parameters
|
||||
* @param CommonObject $object The object to process (an invoice if you are in invoice module, a propale in propale's module, etc...)
|
||||
* @param string $action 'add', 'update', 'view'
|
||||
* @param Hookmanager $hookmanager Hookmanager
|
||||
* @return int Return integer <0 if KO,
|
||||
* =0 if OK but we want to process standard actions too,
|
||||
* >0 if OK and we want to replace standard actions.
|
||||
*/
|
||||
public function completeTabsHead(&$parameters, &$object, &$action, $hookmanager)
|
||||
{
|
||||
|
|
@ -364,7 +367,7 @@ class ActionsMyModule extends CommonHookActions
|
|||
// return 1 to replace standard code
|
||||
return 1;
|
||||
} else {
|
||||
// en V14 et + $parameters['head'] est modifiable par référence
|
||||
// From V14 onwards, $parameters['head'] is modifiable by referende
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -373,5 +376,5 @@ class ActionsMyModule extends CommonHookActions
|
|||
}
|
||||
}
|
||||
|
||||
/* Add here any other hooked methods... */
|
||||
/* Add other hook methods here... */
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -65,6 +64,8 @@ class MyModuleApi extends DolibarrApi
|
|||
*
|
||||
* @param int $id ID of myobject
|
||||
* @return Object Object with cleaned properties
|
||||
* @phan-return MyObject Object with cleaned properties
|
||||
* @phpstan-return MyObject Object with cleaned properties
|
||||
*
|
||||
* @phan-return MyObject
|
||||
*
|
||||
|
|
@ -102,9 +103,9 @@ class MyModuleApi extends DolibarrApi
|
|||
* @param int $page Page number
|
||||
* @param string $sqlfilters Other criteria to filter answers separated by a comma. Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
|
||||
* @param string $properties Restrict the data returned to these properties. Ignored if empty. Comma separated list of properties names
|
||||
* @return array Array of ordered objects
|
||||
*
|
||||
* @phan-return MyObject[]
|
||||
* @return array Array of MyObject objects
|
||||
* @phan-return array<int,MyObject>
|
||||
* @phpstan-return array<int,MyObject>
|
||||
*
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 503 System error
|
||||
|
|
@ -192,7 +193,8 @@ class MyModuleApi extends DolibarrApi
|
|||
* Create myobject object
|
||||
*
|
||||
* @param array $request_data Request data
|
||||
* @phan-param array<string,null|int|float|string|mixed[]> $request_data
|
||||
* @phan-param array{string,mixed} $request_data
|
||||
* @phpstan-param array{string,mixed} $request_data
|
||||
* @return int ID of myobject
|
||||
*
|
||||
* @throws RestException 403 Not allowed
|
||||
|
|
@ -239,9 +241,12 @@ class MyModuleApi extends DolibarrApi
|
|||
* Update myobject
|
||||
*
|
||||
* @param int $id Id of myobject to update
|
||||
* @param array $request_data Datas
|
||||
* @phan-param array<string,null|int|float|string|mixed[]> $request_data
|
||||
* @param array $request_data Data
|
||||
* @phan-param mixed[] $request_data
|
||||
* @phpstan-param mixed[] $request_data
|
||||
* @return Object Object after update
|
||||
* @phan-return MyObject
|
||||
* @phpstan-return MyObject
|
||||
*
|
||||
* @phan-return MyObject
|
||||
*
|
||||
|
|
@ -300,7 +305,8 @@ class MyModuleApi extends DolibarrApi
|
|||
*
|
||||
* @param int $id MyObject ID
|
||||
* @return array
|
||||
* @phan-return array<string,{code:int,message:string}>
|
||||
* @phan-return array<string,array{code:int,message:string}>
|
||||
* @phpstan-return array<string,array{code:int,message:string}>
|
||||
*
|
||||
* @throws RestException 403 Not allowed
|
||||
* @throws RestException 404 Not found
|
||||
|
|
@ -342,9 +348,11 @@ class MyModuleApi extends DolibarrApi
|
|||
* Validate fields before creating or updating object
|
||||
*
|
||||
* @param array $data Array of data to validate
|
||||
* @phan-param array<string,null|int|float|string|mixed[]> $data
|
||||
* @phan-param array<string,null|int|float|string> $data
|
||||
* @phpstan-param array<string,null|int|float|string> $data
|
||||
* @return array
|
||||
* @phan-return array<string,null|int|float|string> $data
|
||||
* @phan-return array<string,null|int|float|string>|array{}
|
||||
* @phpstan-return array<string,null|int|float|string>|array{}
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
|
|
@ -369,10 +377,14 @@ class MyModuleApi extends DolibarrApi
|
|||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
|
||||
/**
|
||||
* Clean sensible object data fields
|
||||
* Clean sensitive object data fields
|
||||
* @phpstan-template T of Object
|
||||
*
|
||||
* @param Object $object Object to clean
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @phpstan-param T $object
|
||||
* @phpstan-return T
|
||||
*/
|
||||
protected function _cleanObjectDatas($object)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -107,30 +106,28 @@ class MyObject extends CommonObject
|
|||
|
||||
// BEGIN MODULEBUILDER PROPERTIES
|
||||
/**
|
||||
* @var array<string,array{type:string,length?:int|string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
* @inheritdoc
|
||||
* Array with all fields and their property. Do not use it as a static var. It may be modified by constructor.
|
||||
*/
|
||||
public $fields = array(
|
||||
'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'),
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'default' => 1, 'index' => 1, 'position' => 10),
|
||||
'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 1, 'noteditable' => 0, 'default' => '', 'notnull' => 1, 'showoncombobox' => 1, 'index' => 1, 'position' => 20, 'searchall' => 1, 'comment' => 'Reference of object', 'validate' => 1),
|
||||
'label' => array('type' => 'varchar(255)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 30, 'searchall' => 1, 'css' => 'minwidth300', 'cssview' => 'wordbreak', 'help' => 'Help text', 'showoncombobox' => 2, 'validate' => 1, 'alwayseditable' => 1),
|
||||
'amount' => array('type' => 'price', 'label' => 'Amount', 'enabled' => 1, 'visible' => 1, 'default' => 'null', 'position' => 40, 'searchall' => 0, 'isameasure' => 1, 'help' => 'Help text for amount', 'validate' => 1),
|
||||
'qty' => array('type' => 'real', 'label' => 'Qty', 'enabled' => 1, 'visible' => 1, 'default' => '0', 'position' => 45, 'searchall' => 0, 'isameasure' => 1, 'help' => 'Help text for quantity', 'css' => 'maxwidth75imp', 'validate' => 1),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))', 'picto' => 'company', 'label' => 'ThirdParty', 'visible' => 1, 'enabled' => 'isModEnabled("societe")', 'position' => 50, 'notnull' => -1, 'index' => 1, 'help' => 'OrganizationEventLinkToThirdParty', 'validate' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
|
||||
'fk_project' => array('type' => 'integer:Project:projet/class/project.class.php:1', 'label' => 'Project', 'picto' => 'project', 'enabled' => 'isModEnabled("project")', 'visible' => -1, 'position' => 52, 'notnull' => -1, 'index' => 1, 'validate' => 1, 'css' => 'maxwidth500 widthcentpercentminusxx', 'csslist' => 'tdoverflowmax150'),
|
||||
'description' => array('type' => 'text', 'label' => 'Description', 'enabled' => 1, 'visible' => 3, 'position' => 60, 'validate' => 1),
|
||||
'note_public' => array('type' => 'html', 'label' => 'NotePublic', 'enabled' => 1, 'visible' => 0, 'position' => 61, 'validate' => 1, 'cssview' => 'wordbreak'),
|
||||
'note_private' => array('type' => 'html', 'label' => 'NotePrivate', 'enabled' => 1, 'visible' => 0, 'position' => 62, 'validate' => 1, 'cssview' => 'wordbreak'),
|
||||
'date_creation' => array('type' => 'datetime', 'label' => 'DateCreation', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 500),
|
||||
'tms' => array('type' => 'timestamp', 'label' => 'DateModification', 'enabled' => 1, 'visible' => -2, 'notnull' => 0, 'position' => 501),
|
||||
//'date_validation ' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>502),
|
||||
'fk_user_creat' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserAuthor', 'picto' => 'user', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 510, 'foreignkey' => 'user.rowid', 'csslist' => 'tdoverflowmax150'),
|
||||
'fk_user_modif' => array('type' => 'integer:User:user/class/user.class.php', 'label' => 'UserModif', 'picto' => 'user', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'position' => 511, 'csslist' => 'tdoverflowmax150'),
|
||||
//'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512),
|
||||
'last_main_doc' => array('type' => 'varchar(255)', 'label' => 'LastMainDoc', 'enabled' => 1, 'visible' => 0, 'notnull' => 0, 'position' => 600),
|
||||
'import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
|
||||
'model_pdf' => array('type' => 'varchar(255)', 'label' => 'Model pdf', 'enabled' => 1, 'visible' => 0, 'notnull' => -1, 'position' => 1010),
|
||||
'status' => array('type' => 'integer', 'label' => 'Status', 'enabled' => 1, 'visible' => 1, 'notnull' => 1, 'default' => 0, 'index' => 1, 'position' => 2000, 'arrayofkeyval' => array(0 => 'Draft', 1 => 'Validated', 9 => 'Canceled'), 'validate' => 1),
|
||||
"rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => "1", 'position' => 1, 'notnull' => 1, "visible" => "0", "noteditable" => "1", "index" => "1", "css" => "left", "comment" => "Id"),
|
||||
"ref" => array("type" => "varchar(128)", "label" => "Ref", "enabled" => "1", 'position' => 20, 'notnull' => 1, "visible" => "1", "index" => "1", "searchall" => "1", "showoncombobox" => "1", "validate" => "1", "comment" => "Reference of object"),
|
||||
"label" => array("type" => "varchar(255)", "label" => "Label", "enabled" => "1", 'position' => 30, 'notnull' => 0, "visible" => "1", "alwayseditable" => "1", "searchall" => "1", "css" => "minwidth300", "cssview" => "wordbreak", "help" => "Help text", "showoncombobox" => "2", "validate" => "1",),
|
||||
"amount" => array("type" => "price", "label" => "Amount", "enabled" => "1", 'position' => 40, 'notnull' => 0, "visible" => "1", "default" => "null", "isameasure" => "1", "help" => "Help text for amount", "validate" => "1",),
|
||||
"qty" => array("type" => "real", "label" => "Qty", "enabled" => "1", 'position' => 45, 'notnull' => 0, "visible" => "1", "default" => "0", "isameasure" => "1", "css" => "maxwidth75imp", "help" => "Help text for quantity", "validate" => "1",),
|
||||
"fk_soc" => array("type" => "integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))", "label" => "ThirdParty", "picto" => "company", "enabled" => "isModEnabled('societe')", 'position' => 50, 'notnull' => -1, "visible" => "1", "index" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150", "help" => "OrganizationEventLinkToThirdParty", "validate" => "1",),
|
||||
"fk_project" => array("type" => "integer:Project:projet/class/project.class.php:1", "label" => "Project", "picto" => "project", "enabled" => "isModEnabled('project')", 'position' => 52, 'notnull' => -1, "visible" => "-1", "index" => "1", "css" => "maxwidth500 widthcentpercentminusxx", "csslist" => "tdoverflowmax150", "validate" => "1",),
|
||||
"description" => array("type" => "text", "label" => "Description", "enabled" => "1", 'position' => 60, 'notnull' => 0, "visible" => "3", "validate" => "1",),
|
||||
"note_public" => array("type" => "html", "label" => "NotePublic", "enabled" => "1", 'position' => 61, 'notnull' => 0, "visible" => "0", "cssview" => "wordbreak", "validate" => "1",),
|
||||
"note_private" => array("type" => "html", "label" => "NotePrivate", "enabled" => "1", 'position' => 62, 'notnull' => 0, "visible" => "0", "cssview" => "wordbreak", "validate" => "1",),
|
||||
"date_creation" => array("type" => "datetime", "label" => "DateCreation", "enabled" => "1", 'position' => 500, 'notnull' => 1, "visible" => "-2",),
|
||||
"tms" => array("type" => "timestamp", "label" => "DateModification", "enabled" => "1", 'position' => 501, 'notnull' => 0, "visible" => "-2",),
|
||||
"fk_user_creat" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserAuthor", "picto" => "user", "enabled" => "1", 'position' => 510, 'notnull' => 1, "visible" => "-2", "foreignkey" => "0", "csslist" => "tdoverflowmax150",),
|
||||
"fk_user_modif" => array("type" => "integer:User:user/class/user.class.php", "label" => "UserModif", "picto" => "user", "enabled" => "1", 'position' => 511, 'notnull' => -1, "visible" => "-2", "csslist" => "tdoverflowmax150",),
|
||||
"last_main_doc" => array("type" => "varchar(255)", "label" => "LastMainDoc", "enabled" => "1", 'position' => 600, 'notnull' => 0, "visible" => "0",),
|
||||
"import_key" => array("type" => "varchar(14)", "label" => "ImportId", "enabled" => "1", 'position' => 1000, 'notnull' => -1, "visible" => "-2",),
|
||||
"model_pdf" => array("type" => "varchar(255)", "label" => "Model pdf", "enabled" => "1", 'position' => 1010, 'notnull' => -1, "visible" => "0",),
|
||||
"status" => array("type" => "integer", "label" => "Status", "enabled" => "1", 'position' => 2000, 'notnull' => 1, "visible" => "1", "index" => "1", "arrayofkeyval" => array("0" => "Draft", "1" => "Validated", "9" => "Canceled"), "validate" => "1",),
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -162,6 +159,9 @@ class MyObject extends CommonObject
|
|||
* @var int Thirdparty ID
|
||||
*/
|
||||
public $socid; // both socid and fk_soc are used
|
||||
/**
|
||||
* @var int Thirdparty ID
|
||||
*/
|
||||
public $fk_soc; // both socid and fk_soc are used
|
||||
|
||||
/**
|
||||
|
|
@ -230,7 +230,7 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
|
|
@ -275,9 +275,9 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Create object into database
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int<-1,max> Return integer <0 if KO, Id of created object if OK
|
||||
* @param User $user User that creates
|
||||
* @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int<-1,max> Return integer <0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function create(User $user, $notrigger = 0)
|
||||
{
|
||||
|
|
@ -291,9 +291,9 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Clone an object into another one
|
||||
*
|
||||
* @param User $user User that creates
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return mixed New object created, <0 if KO
|
||||
* @param User $user User that creates
|
||||
* @param int $fromid Id of object to clone
|
||||
* @return self|int<-1,-1> New object created, <0 if KO
|
||||
*/
|
||||
public function createFromClone(User $user, $fromid)
|
||||
{
|
||||
|
|
@ -390,11 +390,11 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Load object in memory from the database
|
||||
*
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref
|
||||
* @param int $id Id object
|
||||
* @param string $ref Ref
|
||||
* @param int<0,1> $noextrafields 0=Default to load extrafields, 1=No extrafields
|
||||
* @param int<0,1> $nolines 0=Default to load extrafields, 1=No extrafields
|
||||
* @return int<-1,1> Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
* @return int<-1,1> Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = null, $noextrafields = 0, $nolines = 0)
|
||||
{
|
||||
|
|
@ -409,7 +409,7 @@ class MyObject extends CommonObject
|
|||
* Load object lines in memory from the database
|
||||
*
|
||||
* @param int<0,1> $noextrafields 0=Default to load extrafields, 1=No extrafields
|
||||
* @return int<1,1> Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
* @return int<-1,1> Return integer <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetchLines($noextrafields = 0)
|
||||
{
|
||||
|
|
@ -432,7 +432,7 @@ class MyObject extends CommonObject
|
|||
* @param string $filter Filter as an Universal Search string.
|
||||
* Example: '((client:=:1) OR ((client:>=:2) AND (client:<=:3))) AND (client:!=:8) AND (nom:like:'a%')'
|
||||
* @param string $filtermode No longer used
|
||||
* @return self[]|int<-1,-1> int <0 if KO, array of pages if OK
|
||||
* @return array<int,self>|int<-1,-1> <0 if KO, array of pages if OK
|
||||
*/
|
||||
public function fetchAll($sortorder = '', $sortfield = '', $limit = 1000, $offset = 0, string $filter = '', $filtermode = 'AND')
|
||||
{
|
||||
|
|
@ -752,9 +752,9 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* getTooltipContentArray
|
||||
*
|
||||
* @param array $params Params to construct tooltip data
|
||||
* @param array<string,string> $params Params to construct tooltip data
|
||||
* @since v18
|
||||
* @return array
|
||||
* @return array{optimize?:string,picto?:string,ref?:string}
|
||||
*/
|
||||
public function getTooltipContentArray($params)
|
||||
{
|
||||
|
|
@ -782,11 +782,11 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Return a link to the object card (with optionally the picto)
|
||||
*
|
||||
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
|
||||
* @param string $option On what the link point to ('nolink', ...)
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
|
||||
* @param string $option On what the link point to ('nolink', ...)
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||
|
|
@ -904,9 +904,9 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Return a thumb for kanban views
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param array $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param ?array<string,string> $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '', $arraydata = null)
|
||||
{
|
||||
|
|
@ -947,7 +947,7 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Return the label of the status
|
||||
*
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function getLabelStatus($mode = 0)
|
||||
|
|
@ -958,8 +958,8 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Return the label of the status
|
||||
*
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
* @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function getLibStatut($mode = 0)
|
||||
{
|
||||
|
|
@ -970,9 +970,9 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Return the label of a given status
|
||||
*
|
||||
* @param int $status Id status
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
* @param int $status Id status
|
||||
* @param int<0,6> $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
public function LibStatut($status, $mode = 0)
|
||||
{
|
||||
|
|
@ -1004,7 +1004,7 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Load the info information in the object
|
||||
*
|
||||
* @param int $id Id of object
|
||||
* @param int $id Id of object
|
||||
* @return void
|
||||
*/
|
||||
public function info($id)
|
||||
|
|
@ -1056,10 +1056,10 @@ class MyObject extends CommonObject
|
|||
}
|
||||
|
||||
/**
|
||||
* Initialise object with example values
|
||||
* Initialize object with example values
|
||||
* Id must be 0 if object instance is a specimen
|
||||
*
|
||||
* @return int
|
||||
* @return int
|
||||
*/
|
||||
public function initAsSpecimen()
|
||||
{
|
||||
|
|
@ -1073,7 +1073,7 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Create an array of lines
|
||||
*
|
||||
* @return array|int array of lines if OK, <0 if KO
|
||||
* @return CommonObjectLine[]|int array of lines if OK, <0 if KO
|
||||
*/
|
||||
public function getLinesArray()
|
||||
{
|
||||
|
|
@ -1094,7 +1094,7 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Returns the reference to the following non used object depending on the active numbering module.
|
||||
*
|
||||
* @return string Object free reference
|
||||
* @return string Object free reference
|
||||
*/
|
||||
public function getNextNumRef()
|
||||
{
|
||||
|
|
@ -1127,6 +1127,7 @@ class MyObject extends CommonObject
|
|||
|
||||
if (class_exists($classname)) {
|
||||
$obj = new $classname();
|
||||
'@phan-var-force ModeleNumRefMyObject $obj';
|
||||
$numref = $obj->getNextValue($this);
|
||||
|
||||
if ($numref != '' && $numref != '-1') {
|
||||
|
|
@ -1149,13 +1150,13 @@ class MyObject extends CommonObject
|
|||
/**
|
||||
* Create a document onto disk according to template module.
|
||||
*
|
||||
* @param string $modele Force template to use ('' to not force)
|
||||
* @param Translate $outputlangs object lang a utiliser pour traduction
|
||||
* @param int $hidedetails Hide details of lines
|
||||
* @param int $hidedesc Hide description
|
||||
* @param int $hideref Hide ref
|
||||
* @param null|array $moreparams Array to provide more information
|
||||
* @return int 0 if KO, 1 if OK
|
||||
* @param string $modele Force template to use ('' to not force)
|
||||
* @param Translate $outputlangs object lang a utiliser pour traduction
|
||||
* @param int<0,1> $hidedetails Hide details of lines
|
||||
* @param int<0,1> $hidedesc Hide description
|
||||
* @param int<0,1> $hideref Hide ref
|
||||
* @param ?array<string,string> $moreparams Array to provide more information
|
||||
* @return int 0 if KO, 1 if OK
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
|
||||
{
|
||||
|
|
@ -1189,10 +1190,10 @@ class MyObject extends CommonObject
|
|||
* Return validation test result for a field.
|
||||
* Need MAIN_ACTIVATE_VALIDATION_RESULT to be called.
|
||||
*
|
||||
* @param array $fields Array of properties of field to show
|
||||
* @param string $fieldKey Key of attribute
|
||||
* @param string $fieldValue value of attribute
|
||||
* @return bool Return false if fail, true on success, set $this->error for error message
|
||||
* @param array<string,?array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> $fields Array of properties of field to show
|
||||
* @param string $fieldKey Key of attribute
|
||||
* @param string $fieldValue value of attribute
|
||||
* @return bool Return false if fail, true on success, set $this->error for error message
|
||||
*/
|
||||
public function validateField($fields, $fieldKey, $fieldValue)
|
||||
{
|
||||
|
|
@ -1261,7 +1262,7 @@ class MyObjectLine extends CommonObjectLine
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put your own copyright and developer email here---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -189,7 +188,7 @@ class mymodulewidget1 extends ModeleBoxes
|
|||
* @param ?array{text?:string,sublink?:string,subpicto:?string,nbcol?:int,limit?:int,subclass?:string,graph?:string} $head Array with properties of box title
|
||||
* @param ?array<array<array{tr?:string,td?:string,target?:string,text?:string,text2?:string,textnoformat?:string,tooltip?:string,logo?:string,url?:string,maxlength?:string}>> $contents Array with properties of box lines
|
||||
* @param int<0,1> $nooutput When 1, do not print, return string
|
||||
* @return ?string
|
||||
* @return string
|
||||
*/
|
||||
public function showBox($head = null, $contents = null, $nooutput = 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put your own copyright and developer email here---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* This file is an example to follow to add your own email selector inside
|
||||
* the Dolibarr email tool.
|
||||
|
|
@ -23,11 +22,18 @@ class mailing_mailing_mymodule_selector1 extends MailingTargets
|
|||
public $name = 'mailing_mymodule_selector1';
|
||||
// CHANGE THIS: Put here a description of your selector module
|
||||
public $desc = 'Emailing target selector1';
|
||||
|
||||
// CHANGE THIS: Set to 1 if selector is available for admin users only
|
||||
/**
|
||||
* @var int<0,1>
|
||||
*/
|
||||
public $require_admin = 0;
|
||||
|
||||
public $enabled = 'isModEnabled("mymodule")';
|
||||
|
||||
/**
|
||||
* @var string[] The modules on which this selector depends (can be "none" to not show the module.
|
||||
*/
|
||||
public $require_module = array();
|
||||
|
||||
/**
|
||||
|
|
@ -165,7 +171,7 @@ class mailing_mailing_mymodule_selector1 extends MailingTargets
|
|||
* array of SQL request that returns two field:
|
||||
* One called "label", One called "nb".
|
||||
*
|
||||
* @return string[]
|
||||
* @return array{}|array{label:string,nb:string}
|
||||
*/
|
||||
public function getSqlArrayForStats()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -42,7 +41,7 @@ class modMyModule extends DolibarrModules
|
|||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $langs;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
|
|
@ -189,11 +188,11 @@ class modMyModule extends DolibarrModules
|
|||
/* END MODULEBUILDER TABS */
|
||||
// Example:
|
||||
// To add a new tab identified by code tabname1
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight('mymodule', 'read'):/mymodule/mynewtab1.php?id=__ID__');
|
||||
// $this->tabs[] = array('data' => 'objecttype:+tabname1:Title1:mylangfile@mymodule:$user->hasRight(\'mymodule\', \'read\'):/mymodule/mynewtab1.php?id=__ID__');
|
||||
// To add another new tab identified by code tabname2. Label will be result of calling all substitution functions on 'Title2' key.
|
||||
// $this->tabs[] = array('data'=>'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->hasRight('othermodule', 'read'):/mymodule/mynewtab2.php?id=__ID__',
|
||||
// $this->tabs[] = array('data' => 'objecttype:+tabname2:SUBSTITUTION_Title2:mylangfile@mymodule:$user->hasRight(\'othermodule\', \'read\'):/mymodule/mynewtab2.php?id=__ID__',
|
||||
// To remove an existing tab identified by code tabname
|
||||
// $this->tabs[] = array('data'=>'objecttype:-tabname:NU:conditiontoremove');
|
||||
// $this->tabs[] = array('data' => 'objecttype:-tabname:NU:conditiontoremove');
|
||||
//
|
||||
// Where objecttype can be
|
||||
// 'categories_x' to add a tab in category view (replace 'x' by type of category (0=product, 1=supplier, 2=customer, 3=member)
|
||||
|
|
@ -221,27 +220,27 @@ class modMyModule extends DolibarrModules
|
|||
// Dictionaries
|
||||
/* Example:
|
||||
$this->dictionaries=array(
|
||||
'langs'=>'mymodule@mymodule',
|
||||
'langs' => 'mymodule@mymodule',
|
||||
// List of tables we want to see into dictonnary editor
|
||||
'tabname'=>array("table1", "table2", "table3"),
|
||||
'tabname' => array("table1", "table2", "table3"),
|
||||
// Label of tables
|
||||
'tablib'=>array("Table1", "Table2", "Table3"),
|
||||
'tablib' => array("Table1", "Table2", "Table3"),
|
||||
// Request to select fields
|
||||
'tabsql'=>array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'),
|
||||
'tabsql' => array('SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table1 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table2 as f', 'SELECT f.rowid as rowid, f.code, f.label, f.active FROM '.MAIN_DB_PREFIX.'table3 as f'),
|
||||
// Sort order
|
||||
'tabsqlsort'=>array("label ASC", "label ASC", "label ASC"),
|
||||
'tabsqlsort' => array("label ASC", "label ASC", "label ASC"),
|
||||
// List of fields (result of select to show dictionary)
|
||||
'tabfield'=>array("code,label", "code,label", "code,label"),
|
||||
'tabfield' => array("code,label", "code,label", "code,label"),
|
||||
// List of fields (list of fields to edit a record)
|
||||
'tabfieldvalue'=>array("code,label", "code,label", "code,label"),
|
||||
'tabfieldvalue' => array("code,label", "code,label", "code,label"),
|
||||
// List of fields (list of fields for insert)
|
||||
'tabfieldinsert'=>array("code,label", "code,label", "code,label"),
|
||||
'tabfieldinsert' => array("code,label", "code,label", "code,label"),
|
||||
// Name of columns with primary key (try to always name it 'rowid')
|
||||
'tabrowid'=>array("rowid", "rowid", "rowid"),
|
||||
'tabrowid' => array("rowid", "rowid", "rowid"),
|
||||
// Condition to show each dictionary
|
||||
'tabcond'=>array(isModEnabled('mymodule'), isModEnabled('mymodule'), isModEnabled('mymodule')),
|
||||
'tabcond' => array(isModEnabled('mymodule'), isModEnabled('mymodule'), isModEnabled('mymodule')),
|
||||
// Tooltip for every fields of dictionaries: DO NOT PUT AN EMPTY ARRAY
|
||||
'tabhelp'=>array(array('code'=>$langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip'), array('code'=>$langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip'), ...),
|
||||
'tabhelp' => array(array('code' => $langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip'), array('code' => $langs->trans('CodeTooltipHelp'), 'field2' => 'field2tooltip'), ...),
|
||||
);
|
||||
*/
|
||||
/* BEGIN MODULEBUILDER DICTIONARIES */
|
||||
|
|
@ -337,50 +336,50 @@ class modMyModule extends DolibarrModules
|
|||
/* BEGIN MODULEBUILDER LEFTMENU MYOBJECT */
|
||||
/*
|
||||
$this->menu[$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'MyObject',
|
||||
'fk_menu' => 'fk_mainmenu=mymodule', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type' => 'left', // This is a Left menu entry
|
||||
'titre' => 'MyObject',
|
||||
'prefix' => img_picto('', $this->picto, 'class="pictofixedwidth valignmiddle paddingright"'),
|
||||
'mainmenu'=>'mymodule',
|
||||
'leftmenu'=>'myobject',
|
||||
'url'=>'/mymodule/mymoduleindex.php',
|
||||
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'isModEnabled("mymodule")', // Define condition to show or hide menu entry. Use 'isModEnabled("mymodule")' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->hasRight("mymodule", "myobject", "read")',
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
'object'=>'MyObject'
|
||||
'mainmenu' => 'mymodule',
|
||||
'leftmenu' => 'myobject',
|
||||
'url' => '/mymodule/mymoduleindex.php',
|
||||
'langs' => 'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position' => 1000 + $r,
|
||||
'enabled' => 'isModEnabled("mymodule")', // Define condition to show or hide menu entry. Use 'isModEnabled("mymodule")' if entry must be visible if module is enabled.
|
||||
'perms' => '$user->hasRight("mymodule", "myobject", "read")',
|
||||
'target' => '',
|
||||
'user' => 2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
'object' => 'MyObject'
|
||||
);
|
||||
$this->menu[$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'New_MyObject',
|
||||
'mainmenu'=>'mymodule',
|
||||
'leftmenu'=>'mymodule_myobject_new',
|
||||
'url'=>'/mymodule/myobject_card.php?action=create',
|
||||
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'isModEnabled("mymodule")', // Define condition to show or hide menu entry. Use 'isModEnabled("mymodule")' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms'=>'$user->hasRight("mymodule", "myobject", "write")'
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
'object'=>'MyObject'
|
||||
'fk_menu' => 'fk_mainmenu=mymodule,fk_leftmenu=myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type' => 'left', // This is a Left menu entry
|
||||
'titre' => 'New_MyObject',
|
||||
'mainmenu' => 'mymodule',
|
||||
'leftmenu' => 'mymodule_myobject_new',
|
||||
'url' => '/mymodule/myobject_card.php?action=create',
|
||||
'langs' => 'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position' => 1000 + $r,
|
||||
'enabled' => 'isModEnabled("mymodule")', // Define condition to show or hide menu entry. Use 'isModEnabled("mymodule")' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
|
||||
'perms' => '$user->hasRight("mymodule", "myobject", "write")'
|
||||
'target' => '',
|
||||
'user' => 2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
'object' => 'MyObject'
|
||||
);
|
||||
$this->menu[$r++]=array(
|
||||
'fk_menu'=>'fk_mainmenu=mymodule,fk_leftmenu=myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type'=>'left', // This is a Left menu entry
|
||||
'titre'=>'List_MyObject',
|
||||
'mainmenu'=>'mymodule',
|
||||
'leftmenu'=>'mymodule_myobject_list',
|
||||
'url'=>'/mymodule/myobject_list.php',
|
||||
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position'=>1000+$r,
|
||||
'enabled'=>'isModEnabled("mymodule")', // Define condition to show or hide menu entry. Use 'isModEnabled("mymodule")' if entry must be visible if module is enabled.
|
||||
'perms'=>'$user->hasRight("mymodule", "myobject", "read")'
|
||||
'target'=>'',
|
||||
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
'object'=>'MyObject'
|
||||
'fk_menu' => 'fk_mainmenu=mymodule,fk_leftmenu=myobject', // '' if this is a top menu. For left menu, use 'fk_mainmenu=xxx' or 'fk_mainmenu=xxx,fk_leftmenu=yyy' where xxx is mainmenucode and yyy is a leftmenucode
|
||||
'type' => 'left', // This is a Left menu entry
|
||||
'titre' => 'List_MyObject',
|
||||
'mainmenu' => 'mymodule',
|
||||
'leftmenu' => 'mymodule_myobject_list',
|
||||
'url' => '/mymodule/myobject_list.php',
|
||||
'langs' => 'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
|
||||
'position' => 1000 + $r,
|
||||
'enabled' => 'isModEnabled("mymodule")', // Define condition to show or hide menu entry. Use 'isModEnabled("mymodule")' if entry must be visible if module is enabled.
|
||||
'perms' => '$user->hasRight("mymodule", "myobject", "read")'
|
||||
'target' => '',
|
||||
'user' => 2, // 0=Menu for internal users, 1=external users, 2=both
|
||||
'object' => 'MyObject'
|
||||
);
|
||||
*/
|
||||
/* END MODULEBUILDER LEFTMENU MYOBJECT */
|
||||
|
|
@ -405,10 +404,10 @@ class modMyModule extends DolibarrModules
|
|||
include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
//$keyforselect='myobjectline'; $keyforaliasextra='extraline'; $keyforelement='myobjectline@mymodule';
|
||||
//include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php';
|
||||
//$this->export_dependencies_array[$r] = array('myobjectline'=>array('tl.rowid','tl.ref')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields)
|
||||
//$this->export_special_array[$r] = array('t.field'=>'...');
|
||||
//$this->export_examplevalues_array[$r] = array('t.field'=>'Example');
|
||||
//$this->export_help_array[$r] = array('t.field'=>'FieldDescHelp');
|
||||
//$this->export_dependencies_array[$r] = array('myobjectline' => array('tl.rowid','tl.ref')); // To force to activate one or several fields if we select some fields that need same (like to select a unique key if we ask a field of a child to avoid the DISTINCT to discard them, or for computed field than need several other fields)
|
||||
//$this->export_special_array[$r] = array('t.field' => '...');
|
||||
//$this->export_examplevalues_array[$r] = array('t.field' => 'Example');
|
||||
//$this->export_help_array[$r] = array('t.field' => 'FieldDescHelp');
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'mymodule_myobject as t';
|
||||
//$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'mymodule_myobject_line as tl ON tl.fk_myobject = t.rowid';
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2018-2021 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put your own copyright and developer email here---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -63,7 +63,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put your own copyright and developer email here---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -102,7 +102,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
|
|
@ -261,6 +261,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
if (getMultidirOutput($object)) {
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
$dir = null;
|
||||
// Definition of $dir and $file
|
||||
if ($object->specimen) {
|
||||
$dir = getMultidirOutput($object);
|
||||
|
|
@ -270,6 +271,9 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
$dir = getMultidirOutput($object)."/".$objectref;
|
||||
$file = $dir."/".$objectref.".pdf";
|
||||
}
|
||||
if ($dir === null) {
|
||||
return 0;
|
||||
}
|
||||
if (!file_exists($dir)) {
|
||||
if (dol_mkdir($dir) < 0) {
|
||||
$this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir);
|
||||
|
|
@ -293,6 +297,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
|
||||
// Create pdf instance
|
||||
$pdf = pdf_getInstance($this->format);
|
||||
'@phan-var-force TCPDI|TCPDF $pdf';
|
||||
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
|
||||
$pdf->SetAutoPageBreak(1, 0);
|
||||
|
||||
|
|
@ -346,6 +351,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
$pdf->setSignature($cert, $cert, $this->emetteur->name, '', 2, $info);
|
||||
}
|
||||
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
$pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
|
||||
|
||||
|
||||
|
|
@ -499,7 +505,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
}
|
||||
}
|
||||
|
||||
$tab_height = $tab_height - $height_note;
|
||||
$tab_height -= $height_note;
|
||||
$tab_top = $posyafter + 6;
|
||||
} else {
|
||||
$height_note = 0;
|
||||
|
|
@ -791,7 +797,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
// Pagefoot
|
||||
$this->_pagefoot($pdf, $object, $outputlangs);
|
||||
if (method_exists($pdf, 'AliasNbPages')) {
|
||||
$pdf->AliasNbPages();
|
||||
$pdf->AliasNbPages(); // @phan-suppress-current-line PhanUndeclaredMethod
|
||||
}
|
||||
|
||||
$pdf->Close();
|
||||
|
|
@ -841,15 +847,15 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
/**
|
||||
* Show table for lines
|
||||
*
|
||||
* @param tcpdf $pdf Object PDF
|
||||
* @param string $tab_top Top position of table
|
||||
* @param string $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y (not used)
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
||||
* @param int<0,1> $hidebottom Hide bottom bar of array
|
||||
* @param string $currency Currency code
|
||||
* @param ?Translate $outputlangsbis Langs object bis
|
||||
* @param TCPDF|TCPDI $pdf Object PDF
|
||||
* @param int $tab_top Top position of table
|
||||
* @param int $tab_height Height of table (rectangle)
|
||||
* @param int $nexY Y (not used)
|
||||
* @param Translate $outputlangs Langs object
|
||||
* @param int<-1,1> $hidetop 1=Hide top bar of array and title, 0=Hide nothing, -1=Hide only title
|
||||
* @param int<0,1> $hidebottom Hide bottom bar of array
|
||||
* @param string $currency Currency code
|
||||
* @param ?Translate $outputlangsbis Langs object bis
|
||||
* @return void
|
||||
*/
|
||||
protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency = '', $outputlangsbis = null)
|
||||
|
|
@ -880,7 +886,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
|
||||
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
|
||||
if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
|
||||
$pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', array(), explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -902,12 +908,12 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
/**
|
||||
* Show top header of page.
|
||||
*
|
||||
* @param TCPDF $pdf Object PDF
|
||||
* @param MyObject $object Object to show
|
||||
* @param int<0,1> $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param ?Translate $outputlangsbis Object lang for output bis
|
||||
* @return float|int Return topshift value
|
||||
* @param TCPDF|TCPDI $pdf Object PDF
|
||||
* @param MyObject $object Object to show
|
||||
* @param int<0,1> $showaddress 0=no, 1=yes
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param ?Translate $outputlangsbis Object lang for output bis
|
||||
* @return float|int Return topshift value
|
||||
*/
|
||||
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
|
||||
{
|
||||
|
|
@ -993,10 +999,12 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
$posy += 1;
|
||||
$pdf->SetFont('', '', $default_font_size - 2);
|
||||
|
||||
if ($object->ref_client) {
|
||||
// @phan-suppress-next-line PhanUndeclaredProperty
|
||||
if (property_exists($object, 'ref_client') && $object->ref_client) {
|
||||
$posy += 4;
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetTextColor(0, 0, 60);
|
||||
// @phan-suppress-next-line PhanUndeclaredProperty
|
||||
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".dol_trunc($outputlangs->convToOutputCharset($object->ref_client), 65), '', 'R');
|
||||
}
|
||||
|
||||
|
|
@ -1029,7 +1037,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
|
||||
$title .= ' - '.$outputlangsbis->transnoentities("Date");
|
||||
}
|
||||
$pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs, true), '', 'R');
|
||||
$pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date_creation, "day", false, $outputlangs, true), '', 'R');
|
||||
|
||||
if (!getDolGlobalString('MAIN_PDF_HIDE_CUSTOMER_CODE') && !empty($object->thirdparty->code_client)) {
|
||||
$posy += 3;
|
||||
|
|
@ -1119,6 +1127,8 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
|
||||
if (is_object($thirdparty)) {
|
||||
$carac_client_name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
|
||||
} else {
|
||||
$carac_client_name = null;
|
||||
}
|
||||
|
||||
$mode = 'target';
|
||||
|
|
@ -1148,6 +1158,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
// Show recipient name
|
||||
$pdf->SetXY($posx + 2, $posy + 3);
|
||||
$pdf->SetFont('', 'B', $default_font_size);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
$pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0, $ltrdirection);
|
||||
|
||||
$posy = $pdf->getY();
|
||||
|
|
@ -1155,6 +1166,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
// Show recipient information
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->SetXY($posx + 2, $posy);
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
|
||||
}
|
||||
|
||||
|
|
@ -1166,11 +1178,11 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
/**
|
||||
* Show footer of page. Need this->emetteur object
|
||||
*
|
||||
* @param TCPDF $pdf PDF
|
||||
* @param Object $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int<0,1> $hidefreetext 1=Hide free text
|
||||
* @return int Return height of bottom margin including footer text
|
||||
* @param TCPDI|TCPDF $pdf PDF
|
||||
* @param CommonObject $object Object to show
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @param int<0,1> $hidefreetext 1=Hide free text
|
||||
* @return int<0,1> Return height of bottom margin including footer text
|
||||
*/
|
||||
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
|
||||
{
|
||||
|
|
@ -1182,11 +1194,11 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
/**
|
||||
* Define Array Column Field
|
||||
*
|
||||
* @param CommonObject $object common object
|
||||
* @param Translate $outputlangs langs
|
||||
* @param CommonObject $object common object
|
||||
* @param Translate $outputlangs langs
|
||||
* @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
|
||||
* @param int<0,1> $hideref Do not show ref
|
||||
* @return void
|
||||
*/
|
||||
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
|
||||
|
|
@ -1242,7 +1254,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
);
|
||||
|
||||
// PHOTO
|
||||
// $rank = $rank + 10;
|
||||
// $rank += 10;
|
||||
// $this->cols['photo'] = array(
|
||||
// 'rank' => $rank,
|
||||
// 'width' => (!getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH') ? 20 : getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')), // in mm
|
||||
|
|
@ -1262,7 +1274,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
// }
|
||||
|
||||
|
||||
$rank = $rank + 10;
|
||||
$rank += 10;
|
||||
$this->cols['vat'] = array(
|
||||
'rank' => $rank,
|
||||
'status' => false,
|
||||
|
|
@ -1277,7 +1289,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
$this->cols['vat']['status'] = true;
|
||||
}
|
||||
|
||||
$rank = $rank + 10;
|
||||
$rank += 10;
|
||||
$this->cols['subprice'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 19, // in mm
|
||||
|
|
@ -1288,7 +1300,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
'border-left' => true, // add left line separator
|
||||
);
|
||||
|
||||
$rank = $rank + 10;
|
||||
$rank += 10;
|
||||
$this->cols['qty'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 16, // in mm
|
||||
|
|
@ -1299,7 +1311,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
'border-left' => true, // add left line separator
|
||||
);
|
||||
|
||||
$rank = $rank + 10;
|
||||
$rank += 10;
|
||||
$this->cols['unit'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 11, // in mm
|
||||
|
|
@ -1313,7 +1325,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
$this->cols['unit']['status'] = true;
|
||||
}
|
||||
|
||||
$rank = $rank + 10;
|
||||
$rank += 10;
|
||||
$this->cols['discount'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 13, // in mm
|
||||
|
|
@ -1327,7 +1339,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
$this->cols['discount']['status'] = true;
|
||||
}
|
||||
|
||||
$rank = $rank + 1000; // add a big offset to be sure is the last col because default extrafield rank is 100
|
||||
$rank += 1000; // add a big offset to be sure is the last col because default extrafield rank is 100
|
||||
$this->cols['totalexcltax'] = array(
|
||||
'rank' => $rank,
|
||||
'width' => 26, // in mm
|
||||
|
|
@ -1356,6 +1368,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
|
|||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
} elseif (empty($reshook)) {
|
||||
// @phan-suppress-next-line PhanPluginSuspiciousParamOrderInternal
|
||||
$this->cols = array_replace($this->cols, $hookmanager->resArray); // array_replace is used to preserve keys
|
||||
} else {
|
||||
$this->cols = $hookmanager->resArray;
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2008i Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put your own copyright and developer email here---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -124,8 +124,8 @@ class mod_myobject_advanced extends ModeleNumRefMyObject
|
|||
/**
|
||||
* Return next free value
|
||||
*
|
||||
* @param MyObject $object Object we need next value for
|
||||
* @return string|int<-1,0> Next free value if OK, <=0 if KO
|
||||
* @param MyObject $object Object we need next value for
|
||||
* @return string|int<-1,0> Next value if OK, <=0 if KO
|
||||
*/
|
||||
public function getNextValue($object)
|
||||
{
|
||||
|
|
@ -141,7 +141,7 @@ class mod_myobject_advanced extends ModeleNumRefMyObject
|
|||
return 0;
|
||||
}
|
||||
|
||||
$date = $object->date;
|
||||
$date = $object->date_creation;
|
||||
|
||||
$numFinal = get_next_value($db, $mask, 'mymodule_myobject', 'ref', '', '', $date);
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put your own copyright and developer email here---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -38,6 +38,9 @@ class mod_myobject_standard extends ModeleNumRefMyObject
|
|||
*/
|
||||
public $version = 'dolibarr'; // 'development', 'experimental', 'dolibarr'
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $prefix = 'MYOBJECT';
|
||||
|
||||
/**
|
||||
|
|
@ -78,8 +81,8 @@ class mod_myobject_standard extends ModeleNumRefMyObject
|
|||
* Checks if the numbers already in the database do not
|
||||
* cause conflicts that would prevent this numbering working.
|
||||
*
|
||||
* @param MyObject $object Object we need next value for
|
||||
* @return bool false if conflict, true if ok
|
||||
* @param CommonObject $object Object we need next value for
|
||||
* @return bool false if conflict, true if ok
|
||||
*/
|
||||
public function canBeActivated($object)
|
||||
{
|
||||
|
|
@ -94,7 +97,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject
|
|||
$sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
|
||||
if ($object->ismultientitymanaged == 1) {
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
} elseif ($object->ismultientitymanaged == 2) {
|
||||
} elseif ($object->ismultientitymanaged == 2) { // @phan-suppress-current-line PhanPluginEmptyStatementIf
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
|
@ -118,8 +121,8 @@ class mod_myobject_standard extends ModeleNumRefMyObject
|
|||
/**
|
||||
* Return next free value
|
||||
*
|
||||
* @param MyObject $object Object we need next value for
|
||||
* @return string|int<-1,0> Next free value if OK, -1 if KO
|
||||
* @param MyObject $object Object we need next value for
|
||||
* @return string|int<-1,0> Next value if OK, <=0 if KO
|
||||
*/
|
||||
public function getNextValue($object)
|
||||
{
|
||||
|
|
@ -156,7 +159,7 @@ class mod_myobject_standard extends ModeleNumRefMyObject
|
|||
if ($max >= (pow(10, 4) - 1)) {
|
||||
$num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is
|
||||
} else {
|
||||
$num = sprintf("%04s", $max + 1);
|
||||
$num = sprintf("%04u", $max + 1);
|
||||
}
|
||||
|
||||
dol_syslog("mod_myobject_standard::getNextValue return ".$this->prefix.$yymm."-".$num);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put your own copyright and developer email here---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -59,22 +59,19 @@ abstract class ModelePDFMyObject extends CommonDocGenerator
|
|||
return $list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Function to build and write pdf to disk
|
||||
* Function to build a document on disk
|
||||
*
|
||||
* @param MyObject $object Source object to generate document from
|
||||
* @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
|
||||
* @param MyObject $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
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -84,10 +81,17 @@ abstract class ModelePDFMyObject extends CommonDocGenerator
|
|||
abstract class ModeleNumRefMyObject extends CommonNumRefGenerator
|
||||
{
|
||||
/**
|
||||
* Return next free value
|
||||
* Return an example of numbering
|
||||
*
|
||||
* @param MyObject $object Object we need next value for
|
||||
* @return string|int<-1,0> Next free value if OK, -1 if KO
|
||||
* @return string Example
|
||||
*/
|
||||
abstract public function getExample();
|
||||
|
||||
/**
|
||||
* Return next free value
|
||||
*
|
||||
* @param MyObject $object Object we need next value for
|
||||
* @return string|int<-1,0> Next value if OK, <=0 if KO
|
||||
*/
|
||||
abstract public function getNextValue($object);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put your own copyright and developer email here---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -33,7 +33,7 @@ global $noMoreLinkedObjectBlockAfter;
|
|||
$langs = $GLOBALS['langs'];
|
||||
'@phan-var-force Translate $langs';
|
||||
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
'@phan-var-force MyObject[] $linkedObjectBlock';
|
||||
'@phan-var-force array<string,MyObject> $linkedObjectBlock';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->load("mymodule");
|
||||
|
|
@ -51,7 +51,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
|||
<td><?php echo $langs->trans("MyObject"); ?></td>
|
||||
<td><?php echo $objectlink->getNomUrl(1); ?></td>
|
||||
<td></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
|
||||
<td class="center"><?php echo dol_print_date($objectlink->date_creation, 'day'); ?></td>
|
||||
<td class="right"><?php echo ''; ?></td>
|
||||
<td class="right"><?php echo $objectlink->getLibStatut(7); ?></td>
|
||||
<td class="right"><a class="reposition" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -88,7 +87,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
|
|||
}
|
||||
|
||||
// Or you can execute some code here
|
||||
switch ($action) {
|
||||
switch ($action) { // @phan-suppress-current-line PhanNoopSwitchCases
|
||||
// Users
|
||||
//case 'USER_CREATE':
|
||||
//case 'USER_MODIFY':
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) ---Put here your own copyright and developer email---
|
||||
/* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -54,7 +54,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
||||
$tmp2 = realpath(__FILE__);
|
||||
$i = strlen($tmp) - 1;
|
||||
$j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--;
|
||||
$j--;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) ---Put here your own copyright and developer email---
|
||||
/* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -62,7 +62,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
||||
$tmp2 = realpath(__FILE__);
|
||||
$i = strlen($tmp) - 1;
|
||||
$j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--;
|
||||
$j--;
|
||||
|
|
@ -96,5 +99,3 @@ if (empty($dolibarr_nocache)) {
|
|||
?>
|
||||
|
||||
/* Javascript library of module MyModule */
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) ---Put here your own copyright and developer email---
|
||||
# Copyright (C) ---Replace with your own copyright and developer email---
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) ---Put here your own copyright and developer email---
|
||||
/* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
/**
|
||||
* Prepare admin pages header
|
||||
*
|
||||
* @return array
|
||||
* @return array<array{string,string,string}>
|
||||
*/
|
||||
function mymoduleAdminPrepareHead()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
/* Copyright (C) ---Put here your own copyright and developer email---
|
||||
/* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -24,8 +24,8 @@
|
|||
/**
|
||||
* Prepare array of tabs for MyObject
|
||||
*
|
||||
* @param MyObject $object MyObject
|
||||
* @return array Array of tabs
|
||||
* @param MyObject $object MyObject
|
||||
* @return array<array{string,string,string}> Array of tabs
|
||||
*/
|
||||
function myobjectPrepareHead($object)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,7 +31,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
||||
$tmp2 = realpath(__FILE__);
|
||||
$i = strlen($tmp) - 1;
|
||||
$j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--;
|
||||
$j--;
|
||||
|
|
@ -67,7 +70,7 @@ $now = dol_now();
|
|||
$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
|
||||
|
||||
// Security check - Protection if external user
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$socid = GETPOSTINT('socid');
|
||||
if (isset($user->socid) && $user->socid > 0) {
|
||||
$action = '';
|
||||
$socid = $user->socid;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -48,7 +48,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
||||
$tmp2 = realpath(__FILE__);
|
||||
$i = strlen($tmp) - 1;
|
||||
$j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--;
|
||||
$j--;
|
||||
|
|
@ -101,10 +104,10 @@ if (GETPOST('actioncode', 'array')) {
|
|||
$search_rowid = GETPOST('search_rowid');
|
||||
$search_agenda_label = GETPOST('search_agenda_label');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
@ -160,7 +163,7 @@ if (!$permissiontoread) {
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array('id'=>$id);
|
||||
$parameters = array('id' => $id);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -266,14 +269,14 @@ if ($object->id > 0) {
|
|||
$objthirdparty = $object;
|
||||
$objcon = new stdClass();
|
||||
|
||||
$out = '&origin='.urlencode($object->element.(property_exists($object, 'module') ? '@'.$object->module : '')).'&originid='.urlencode($object->id);
|
||||
$out = '&origin='.urlencode($object->element.(property_exists($object, 'module') ? '@'.$object->module : '')).'&originid='.urlencode((string) $object->id);
|
||||
$urlbacktopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$out .= '&backtopage='.urlencode($urlbacktopage);
|
||||
$permok = $user->hasRight('agenda', 'myactions', 'create');
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objthirdparty) == 'Societe') {
|
||||
$out .= '&socid='.urlencode($objthirdparty->id);
|
||||
$out .= '&socid='.urlencode((string) $objthirdparty->id);
|
||||
}
|
||||
$out .= (!empty($objcon->id) ? '&contactid='.urlencode($objcon->id) : '');
|
||||
//$out.=$langs->trans("AddAnAction").' ';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -52,7 +52,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
||||
$tmp2 = realpath(__FILE__);
|
||||
$i = strlen($tmp) - 1;
|
||||
$j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--;
|
||||
$j--;
|
||||
|
|
@ -110,10 +113,12 @@ $object = new MyObject($db);
|
|||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->mymodule->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array($object->element.'card', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
$soc = null;
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
|
||||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Initialize array of search criteria
|
||||
|
|
@ -472,7 +477,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Show object lines
|
||||
$result = $object->getLinesArray();
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOSTINT('lineid')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
|
|
@ -490,7 +495,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
}
|
||||
|
||||
if (!empty($object->lines)) {
|
||||
$object->printObjectLines($action, $mysoc, null, GETPOST('lineid', 'int'), 1);
|
||||
$object->printObjectLines($action, $mysoc, null, GETPOSTINT('lineid'), 1);
|
||||
}
|
||||
|
||||
// Form to add new line
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -29,7 +29,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
||||
$tmp2 = realpath(__FILE__);
|
||||
$i = strlen($tmp) - 1;
|
||||
$j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--;
|
||||
$j--;
|
||||
|
|
@ -62,10 +65,10 @@ dol_include_once('/mymodule/lib/mymodule_myobject.lib.php');
|
|||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mymodule@mymodule", "companies", "other", "mails"));
|
||||
|
||||
$id = (GETPOST('id') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
||||
$id = (GETPOST('id') ? GETPOSTINT('id') : GETPOSTINT('facid')); // For backward compatibility
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$lineid = GETPOST('lineid', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$lineid = GETPOSTINT('lineid');
|
||||
$socid = GETPOSTINT('socid');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
// Initialize a technical objects
|
||||
|
|
@ -108,7 +111,7 @@ if (!$permissiontoread) {
|
|||
*/
|
||||
|
||||
if ($action == 'addcontact' && $permissiontoadd) {
|
||||
$contactid = (GETPOST('userid') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||
$contactid = (GETPOST('userid') ? GETPOSTINT('userid') : GETPOSTINT('contactid'));
|
||||
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
|
||||
|
||||
|
|
@ -125,7 +128,7 @@ if ($action == 'addcontact' && $permissiontoadd) {
|
|||
}
|
||||
} elseif ($action == 'swapstatut' && $permissiontoadd) {
|
||||
// Toggle the status of a contact
|
||||
$result = $object->swapContactStatus(GETPOST('ligne', 'int'));
|
||||
$result = $object->swapContactStatus(GETPOSTINT('ligne'));
|
||||
} elseif ($action == 'deletecontact' && $permissiontoadd) { // Permission to add on object because this is an update of a link of object, not a deletion of data
|
||||
// Deletes a contact
|
||||
$result = $object->delete_contact($lineid);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) ---Replace with your own copyright and developer email---
|
||||
*
|
||||
* 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
|
||||
|
|
@ -50,7 +50,10 @@ if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
|||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME'];
|
||||
$tmp2 = realpath(__FILE__);
|
||||
$i = strlen($tmp) - 1;
|
||||
$j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--;
|
||||
$j--;
|
||||
|
|
@ -88,13 +91,13 @@ $langs->loadLangs(array("mymodule@mymodule", "companies", "other", "mails"));
|
|||
// Get parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm');
|
||||
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
|
||||
$id = (GETPOSTINT('socid') ? GETPOSTINT('socid') : GETPOSTINT('id'));
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
|
||||
if (empty($page) || $page == -1) {
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user