mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge remote-tracking branch 'upstream/develop' into nospaceaftercomma
This commit is contained in:
commit
b10558bacd
|
|
@ -11,9 +11,9 @@ LaunchProgram=Launch %1
|
|||
AssocFileExtension=&Associate %1 with the %2 file extension
|
||||
AssocingFileExtension=Associating %1 with the %2 file extension...
|
||||
|
||||
YouWillInstallDoliWamp=You will install or upgrade DoliWamp (Apache+Mysql+PHP+Dolibarr) on your computer.
|
||||
ThisAssistantInstallOrUpgrade=This assistant installs or upgrades Dolibarr ERP-CRM and all required third party softwares (Apache, Mysql and PHP) optimized for a Dolibarr usage.
|
||||
IfYouHaveTechnicalKnowledge=If you are looking for a hosted version in the Cloud, you should look at https://saas.dolibarr.org. If you have technical knowledge and want to manage your Apache, Mysql and PHP yourself, you should not use this assistant and make a manual installation of Dolibarr on your existing Apache, Mysql and PHP installation.
|
||||
YouWillInstallDoliWamp=You will install or upgrade DoliWamp (so Dolibarr + all required third party softwares like Apache, Mysql and PHP) on your computer.
|
||||
ThisAssistantInstallOrUpgrade=WARNING: Using an ERP CRM installed on a local computer can be dangerous: if your computer break down, you can lose all your data. Do this if you are ready to manage backup yourself seriously. If not, use an installation in Saas instead (see https://saas.dolibarr.org).
|
||||
IfYouHaveTechnicalKnowledge=Moreover, if you have technical knowledges and want to manage your Apache, Mysql and PHP yourself, you should not use this assistant and make a manual installation of Dolibarr on your existing server with Apache, Mysql and PHP.
|
||||
ButIfYouLook=But if you look for an automatic setup on your local computer, you''re on the good way...
|
||||
DoYouWantToStart=Do you want to start installation/upgrade process ?
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ PortAlreadyInUse=Port %1 seems to be already in use. You should cancel to go bac
|
|||
|
||||
FirefoxDetected=Firefox has been detected on your computer. Would you like to use it as the default browser for Dolibarr ?
|
||||
ChromeDetected=Chrome has been detected on your computer. Would you like to use it as the default browser for Dolibarr ?
|
||||
ChooseDefaultBrowser=Please choose your default browser. If you are not sure, just click Open :
|
||||
ChooseDefaultBrowser=Please choose your default browser (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). If you are not sure, just click Open :
|
||||
|
||||
LaunchNow=Launch Dolibarr now
|
||||
|
||||
|
|
|
|||
|
|
@ -2,47 +2,47 @@
|
|||
[CustomMessages]
|
||||
|
||||
NameAndVersion=%1 version %2
|
||||
Additionalcons=Ic<49>nes suppl<70>mentaires :
|
||||
CreateDesktopIcon=Cr<EFBFBD>er une ic<69>ne sur le &Bureau
|
||||
CreateQuickLaunchIcon=Cr<EFBFBD>er une ic<69>ne dans la barre de &Lancement rapide
|
||||
AdditionalIcons=Icônes supplémentaires :
|
||||
CreateDesktopIcon=Créer une icône sur le &Bureau
|
||||
CreateQuickLaunchIcon=Créer une icône dans la barre de &Lancement rapide
|
||||
ProgramOnTheWeb=Page d'accueil de %1
|
||||
UninstallProgram=D<EFBFBD>sinstaller %1
|
||||
LaunchProgram=Ex<EFBFBD>cuter %1
|
||||
UninstallProgram=Désinstaller %1
|
||||
LaunchProgram=Exécuter %1
|
||||
AssocFileExtension=&Associer %1 avec l'extension de fichier %2
|
||||
AssocingFileExtension=Associe %1 avec l'extension de fichier %2...
|
||||
|
||||
YouWillInstallDoliWamp=Vous allez installer ou mettre <EFBFBD> jour DoliWamp (Apache+Mysql+PHP+Dolibarr) sur votre ordinateur.
|
||||
ThisAssistantInstallOrUpgrade=Cet assistant installe ou met <20> jour Dolibarr ERP-CRM et tous ses composants pr<70>requis (Apache, Mysql et PHP) optimis<69>s pour une utilisation de Dolibarr.
|
||||
IfYouHaveTechnicalKnowledge=Si vous cherchez un h<>bergement dans le Cloud, aller voir sur https://saas.dolibarr.org. Si vous avez des comp<6D>tences techniques et voulez g<>rer vous m<>me Apache, Mysql et PHP, vous ne devriez pas utiliser cet assistant mais faire plut<75>t une installation manuelle de Dolibarr sur votre socle Apache, Mysql et PHP existant.
|
||||
ButIfYouLook=Mais si vous recherchez une installation automatis<EFBFBD>e locale sur votre ordinateur, cl<63> en main, vous <20>tes sur la bonne voie...
|
||||
DoYouWantToStart=Voulez-vous d<EFBFBD>marrer le processus d'installation/mise <20> jour ?
|
||||
YouWillInstallDoliWamp=Vous allez installer ou mettre à jour DoliWamp sur votre ordinateur (donc Dolibarr + tous ses composants prérequis comme Apache, Mysql et PHP).
|
||||
ThisAssistantInstallOrUpgrade=AVERTISSEMENT: L'utilisation d'un ERP CRM installé sur un ordinateur local peut être dangereuse: si votre ordinateur tombe en panne, vous pouvez perdre toutes vos données. Faites-le si vous êtes prêt à gérer les sauvegardes vous-même sérieusement. Sinon, utilisez plutôt une installation en Saas (voir https://saas.dolibarr.org).
|
||||
IfYouHaveTechnicalKnowledge=De plus, si vous avez des compétences techniques et envisagez de partager votre Apache, Mysql et PHP avec d''autres applications que Dolibarr, vous ne devriez pas utiliser cet assistant mais faire plutôt une installation manuelle de Dolibarr sur un serveur existant équipé de Apache, Mysql et PHP.
|
||||
ButIfYouLook=Mais si vous recherchez une installation clé en main automatisée sur une poste local, vous êtes sur la bonne voie...
|
||||
DoYouWantToStart=Voulez-vous démarrer le processus d'installation/mise à jour ?
|
||||
|
||||
TechnicalParameters=Param<EFBFBD>tres techniques
|
||||
IfFirstInstall=S'il s'agit de la premi<EFBFBD>re installation, merci de sp<73>cifier ces quelques param<61>tres techniques. Si vous ne les comprennez pas, <20>tes non s<>r, ou proc<6F>dez <20> une mise <20> jour, laissez les champs avec les valeurs propos<6F>es par d<>faut.
|
||||
TechnicalParameters=Paramètres techniques
|
||||
IfFirstInstall=S'il s'agit de la première installation, merci de spécifier ces quelques paramètres techniques. Si vous ne les comprennez pas, êtes non sûr, ou procédez à une mise à jour, laissez les champs avec les valeurs proposées par défaut.
|
||||
|
||||
|
||||
; WARNING !!! STRINGS FOR THIS 4 STRINGS MUST BE LOWER THAN 70 CHARACTERS
|
||||
SMTPServer=Serveur SMTP (le votre ou de votre FAI, premi<EFBFBD>re installation uniquement):
|
||||
ApachePort=Port Apache (premi<EFBFBD>re installation uniquement, le choix standard est 80):
|
||||
MySqlPort=Port Mysql (premi<EFBFBD>re installation uniquement, le choix standard est 3306):
|
||||
MySqlPassword=Mot de passe serveur+base MySql de root (premi<EFBFBD>re installation uniquement):
|
||||
SMTPServer=Serveur SMTP (le votre ou de votre FAI, première installation uniquement):
|
||||
ApachePort=Port Apache (première installation uniquement, le choix standard est 80):
|
||||
MySqlPort=Port Mysql (première installation uniquement, le choix standard est 3306):
|
||||
MySqlPassword=Mot de passe serveur+base MySql de root (première installation uniquement):
|
||||
|
||||
FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signal<EFBFBD>. Cliquez sur OK pour continuer...
|
||||
FailedToDeleteLock=Echec de la suppression du fichier %1/www/dolibarr/install.lock. Vous pouvez ignorer l'avertissement mais il est possible que vous deviez le supprimer manuellement plus tard. Dans ce cas, cela vous sera signalé. Cliquez sur OK pour continuer...
|
||||
|
||||
PortAlreadyInUse=Le port %1 semble d<EFBFBD>j<EFBFBD> utilis<69>. Il est recommand<6E> d'annuler pour revenir en arri<72>re et sp<73>cifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ?
|
||||
PortAlreadyInUse=Le port %1 semble déjà utilisé. Il est recommandé d'annuler pour revenir en arrière et spécifier une autre valeur pour le port %2. Annuler le choix et choisir une autre valeur ?
|
||||
|
||||
FirefoxDetected=Firefox a <EFBFBD>t<EFBFBD> d<>tect<63> sur votre ordinateur. Voulez-vous en faire votre navigateur par d<>faut pour Dolibarr ?
|
||||
ChromeDetected=Chrome a <EFBFBD>t<EFBFBD> d<>tect<63> sur votre ordinateur. Voulez-vous en faire votre navigateur par d<>faut pour Dolibarr ?
|
||||
ChooseDefaultBrowser=Merci de choisir votre navigateur par d<EFBFBD>faut. Si vous n'<27>tes pas s<>r, cliquez simplement sur Ouvrir :
|
||||
FirefoxDetected=Firefox a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ?
|
||||
ChromeDetected=Chrome a été détecté sur votre ordinateur. Voulez-vous en faire votre navigateur par défaut pour Dolibarr ?
|
||||
ChooseDefaultBrowser=Merci de choisir votre navigateur par défaut (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si vous n'êtes pas sûr, cliquez simplement sur Ouvrir :
|
||||
|
||||
LaunchNow=Lancer Dolibarr maintenant
|
||||
|
||||
ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont <EFBFBD>t<EFBFBD> supprim<69>s. Toutefois, tous vos fichiers de donn<6E>es sont toujours dans le r<>pertoire %1. Vous devez supprimer ce r<>pertoire manuellement pour avoir une d<>sinstallation compl<70>te.
|
||||
ProgramHasBeenRemoved=Les fichiers du programme Dolibarr ont été supprimés. Toutefois, tous vos fichiers de données sont toujours dans le répertoire %1. Vous devez supprimer ce répertoire manuellement pour avoir une désinstallation complète.
|
||||
|
||||
DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant d<EFBFBD>marrer ou red<65>marrer Apache et Mysql, ceci peut durer de quelques secondes <20> une minute apr<70>s cette confirmation. D<>marrer l'installation ou mise <20> jour du serveur web et base de donn<6E>es requis par Dolibarr ?
|
||||
DoliWampWillStartApacheMysql=L'installeur DoliWamp va maintenant démarrer ou redémarrer Apache et Mysql, ceci peut durer de quelques secondes à une minute après cette confirmation. Démarrer l'installation ou mise à jour du serveur web et base de données requis par Dolibarr ?
|
||||
|
||||
OldVersionFoundAndMoveInNew=Une ancienne version de base a <EFBFBD>t<EFBFBD> trouv<75>e et d<>plac<61>e pour fonctionner avec la nouvelle version de Dolibarr.
|
||||
OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a <EFBFBD>t<EFBFBD> trouv<75>e mais ne peut <20>tre d<>plac<61>e pour <20>tre utilis<69>e avec la nouvelle version de Dolibarr.
|
||||
OldVersionFoundAndMoveInNew=Une ancienne version de base a été trouvée et déplacée pour fonctionner avec la nouvelle version de Dolibarr.
|
||||
OldVersionFoundButFailedToMoveInNew=Une ancienne version de base a été trouvée mais ne peut être déplacée pour être utilisée avec la nouvelle version de Dolibarr.
|
||||
|
||||
DLLMissing=L'installation de votre Windows est incompl<EFBFBD>te. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2012". Installer la version 32-bit version (vcredist_x86.exe) d'abord (vous pourrez le trouver <EFBFBD> https://www.microsoft.com/en-us/download/) puis relancer l'installation de DoliWamp après.
|
||||
ContinueAnyway=Continuer malgr<EFBFBD> tout (le process d'installaton échouera)
|
||||
DLLMissing=L'installation de votre Windows est incomplète. Il manque le composant "Micrsoft Visual C++ Redistributable for Visual Studio 2012". Installer la version 32-bit (vcredist_x86.exe) d'abord (vous pourrez le trouver à https://www.microsoft.com/fr-fr/download/) puis relancer l'installation de DoliWamp après.
|
||||
ContinueAnyway=Continuer malgré tout (le process d'installaton échouera)
|
||||
|
|
|
|||
|
|
@ -3,4 +3,4 @@ REM Launch Dolibarr Admin center
|
|||
REM ----------------------------
|
||||
|
||||
REM Go to admin center page
|
||||
start "DoliWamp admin" "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/
|
||||
start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/
|
||||
|
|
|
|||
|
|
@ -4,4 +4,4 @@ REM ---------------------------
|
|||
|
||||
REM Go to help center page
|
||||
echo Please wait...
|
||||
start "Dolibarr Help center" "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/support/
|
||||
start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/support/
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ REM Launch Dolibarr
|
|||
REM ---------------
|
||||
|
||||
REM If no lock file, we call install process
|
||||
IF NOT EXIST dolibarr_documents\install.lock start "Dolibarr" "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/install/
|
||||
IF NOT EXIST dolibarr_documents\install.lock start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/install/
|
||||
|
||||
REM If lock file exists, we call home page
|
||||
IF EXIST dolibarr_documents\install.lock start "Dolibarr" "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/
|
||||
IF EXIST dolibarr_documents\install.lock start "WAMPBROWSER" http://localhost:WAMPAPACHEPORT/dolibarr/
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ if ($idobject > 0)
|
|||
dol_print_error($db, $obj->error);
|
||||
}
|
||||
}
|
||||
else if ($obj->error == 'ErrorLoginAlreadyExists')
|
||||
elseif ($obj->error == 'ErrorLoginAlreadyExists')
|
||||
{
|
||||
print "User with login ".$obj->login." already exists\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,6 +188,15 @@
|
|||
<rule ref="Squiz.WhiteSpace.ControlStructureSpacing.SpacingBeforeClose" />
|
||||
|
||||
<rule ref="Squiz.Functions.MultiLineFunctionDeclaration" />
|
||||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing">
|
||||
<properties>
|
||||
<property name="equalsSpacing" value="1"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint">
|
||||
<severity>0</severity>
|
||||
</rule>
|
||||
|
||||
|
||||
<!-- Rules from PEAR Standard -->
|
||||
|
||||
|
|
@ -389,6 +398,7 @@
|
|||
|
||||
<rule ref="PSR2.Classes.ClassDeclaration" />
|
||||
<rule ref="PSR2.Methods.FunctionClosingBrace" />
|
||||
<rule ref="PSR2.ControlStructures.ElseIfDeclaration.NotAllowed" />
|
||||
|
||||
<!-- This is not in PSR2 -->
|
||||
<rule ref="PEAR.NamingConventions.ValidVariableName.PrivateNoUnderscore">
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class autoTranslator
|
|||
* @param string $_apikey Api key
|
||||
* @return void
|
||||
*/
|
||||
function __construct($_destlang,$_refLang,$_langDir,$_limittofile,$_apikey)
|
||||
function __construct($_destlang, $_refLang, $_langDir, $_limittofile, $_apikey)
|
||||
{
|
||||
|
||||
// Set enviorment variables
|
||||
|
|
@ -156,7 +156,7 @@ class autoTranslator
|
|||
* @param string $my_destlang Target language code
|
||||
* @return void
|
||||
*/
|
||||
private function updateTranslationFile($destPath,$file,$my_destlang)
|
||||
private function updateTranslationFile($destPath, $file, $my_destlang)
|
||||
{
|
||||
$this->_time_end = date('Y-m-d H:i:s');
|
||||
|
||||
|
|
@ -183,7 +183,7 @@ class autoTranslator
|
|||
* @param string $my_destlang Target language code
|
||||
* @return void
|
||||
*/
|
||||
private function createTranslationFile($path,$my_destlang)
|
||||
private function createTranslationFile($path, $my_destlang)
|
||||
{
|
||||
$fp = fopen($path, 'w+');
|
||||
fwrite($fp, "/*\n");
|
||||
|
|
@ -205,7 +205,7 @@ class autoTranslator
|
|||
* @param string $my_destlang Language code (ie: fr_FR)
|
||||
* @return int 0=Nothing translated, 1=Record translated
|
||||
*/
|
||||
private function translateFileLine($content,$file,$key,$value,$my_destlang)
|
||||
private function translateFileLine($content, $file, $key, $value, $my_destlang)
|
||||
{
|
||||
|
||||
//print "key =".$key."\n";
|
||||
|
|
@ -220,11 +220,13 @@ class autoTranslator
|
|||
}
|
||||
}
|
||||
|
||||
if ($key == 'CHARSET') $val=$this->_outputpagecode;
|
||||
else if (preg_match('/^Format/', $key)) $val=$value;
|
||||
else if ($value=='-') $val=$value;
|
||||
else
|
||||
{
|
||||
if ($key == 'CHARSET') {
|
||||
$val=$this->_outputpagecode;
|
||||
} elseif (preg_match('/^Format/', $key)) {
|
||||
$val=$value;
|
||||
} elseif ($value=='-') {
|
||||
$val=$value;
|
||||
} else {
|
||||
// If not translated then translate
|
||||
if ($this->_outputpagecode == 'UTF-8') $val=$this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2));
|
||||
else $val=utf8_decode($this->translateTexts(array($value), substr($this->_refLang, 0, 2), substr($my_destlang, 0, 2)));
|
||||
|
|
|
|||
|
|
@ -215,8 +215,8 @@ foreach ($dups as $string => $pages)
|
|||
$s.="\n";
|
||||
|
||||
if ($duplicateinsamefile) $sduplicateinsamefile .= $s;
|
||||
else if ($inmain) $sinmainandother .= $s;
|
||||
else if ($inadmin) $sininstallandadmin .= $s;
|
||||
elseif ($inmain) $sinmainandother .= $s;
|
||||
elseif ($inadmin) $sininstallandadmin .= $s;
|
||||
else $sother .= $s;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@ foreach($filesToProcess as $fileToProcess)
|
|||
{
|
||||
//print "Key $key is a key we always want to see into secondary file (line: $cnt).\n";
|
||||
}
|
||||
else if ( ! array_key_exists($key, $aSecondary))
|
||||
elseif ( ! array_key_exists($key, $aSecondary))
|
||||
{
|
||||
//print "Key $key does NOT exist in secondary language (line: $cnt).\n";
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ if (empty($reshook))
|
|||
if ($result < 0) {
|
||||
setEventMessages($accounting->error, $accounting->errors, 'errors');
|
||||
}
|
||||
} else if ($action == 'enable') {
|
||||
} elseif ($action == 'enable') {
|
||||
if ($accounting->fetch($id)) {
|
||||
$result = $accounting->account_activate($id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||
if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') {
|
||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
||||
}
|
||||
else if ($value == 'entity') {
|
||||
elseif ($value == 'entity') {
|
||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
|
|
@ -318,7 +318,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
|
||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
||||
}
|
||||
else if ($field == 'entity') {
|
||||
elseif ($field == 'entity') {
|
||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
|
|
@ -531,12 +531,15 @@ if ($id)
|
|||
if ($fieldlist[$field]=='country_id') { $valuetoshow=''; }
|
||||
if ($fieldlist[$field]=='pcg_version' || $fieldlist[$field]=='fk_pcg_version') { $valuetoshow=$langs->trans("Pcg_version"); }
|
||||
|
||||
if ($valuetoshow != '')
|
||||
{
|
||||
if ($valuetoshow != '') {
|
||||
print '<td align="'.$align.'">';
|
||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
||||
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||
else print $valuetoshow;
|
||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
|
||||
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1,$valuetoshow).'</a>';
|
||||
} elseif (! empty($tabhelp[$id][$value])) {
|
||||
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||
} else {
|
||||
print $valuetoshow;
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
|
||||
|
|
@ -729,14 +732,14 @@ if ($id)
|
|||
{
|
||||
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
|
||||
}
|
||||
else if ($value == 'source')
|
||||
elseif ($value == 'source')
|
||||
{
|
||||
$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
|
||||
}
|
||||
else if ($valuetoshow=='all') {
|
||||
elseif ($valuetoshow=='all') {
|
||||
$valuetoshow=$langs->trans('All');
|
||||
}
|
||||
else if ($fieldlist[$field]=='country') {
|
||||
elseif ($fieldlist[$field]=='country') {
|
||||
if (empty($obj->country_code))
|
||||
{
|
||||
$valuetoshow='-';
|
||||
|
|
@ -747,7 +750,7 @@ if ($id)
|
|||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
||||
}
|
||||
}
|
||||
else if ($fieldlist[$field]=='country_id') {
|
||||
elseif ($fieldlist[$field]=='country_id') {
|
||||
$showfield=0;
|
||||
}
|
||||
|
||||
|
|
@ -811,7 +814,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldListAccountModel($fieldlist, $obj='', $tabname='', $context='')
|
||||
function fieldListAccountModel($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $form;
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
|||
exit;
|
||||
}
|
||||
}
|
||||
} else if ($action == 'edit' && $user->rights->accounting->chartofaccount) {
|
||||
} elseif ($action == 'edit' && $user->rights->accounting->chartofaccount) {
|
||||
if (! $cancel) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ if ($action == 'add' && $user->rights->accounting->chartofaccount)
|
|||
header("Location: " . $urltogo);
|
||||
exit();
|
||||
}
|
||||
} else if ($action == 'delete' && $user->rights->accounting->chartofaccount) {
|
||||
} elseif ($action == 'delete' && $user->rights->accounting->chartofaccount) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if (! empty($object->id)) {
|
||||
|
|
@ -272,7 +272,7 @@ if ($action == 'create') {
|
|||
|
||||
print '</form>';
|
||||
}
|
||||
else if ($id > 0 || $ref) {
|
||||
elseif ($id > 0 || $ref) {
|
||||
|
||||
$result = $object->fetch($id, $ref, 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -268,7 +268,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||
if ($field == 'fk_country' && $_POST['country'] > 0) {
|
||||
$_POST[$listfieldvalue[$i]] = $_POST['country'];
|
||||
}
|
||||
else if ($field == 'entity') {
|
||||
elseif ($field == 'entity') {
|
||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
|
|
@ -492,7 +492,7 @@ if ($id)
|
|||
{
|
||||
print '<td align="'.$align.'">';
|
||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
||||
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
|
|
@ -699,10 +699,10 @@ if ($id)
|
|||
{
|
||||
$valuetoshow = yn($valuetoshow);
|
||||
}
|
||||
else if ($valuetoshow=='all') {
|
||||
elseif ($valuetoshow=='all') {
|
||||
$valuetoshow=$langs->trans('All');
|
||||
}
|
||||
else if ($fieldlist[$field]=='country') {
|
||||
elseif ($fieldlist[$field]=='country') {
|
||||
if (empty($obj->country_code))
|
||||
{
|
||||
$valuetoshow='-';
|
||||
|
|
@ -713,20 +713,20 @@ if ($id)
|
|||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
||||
}
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
|
||||
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
|
||||
$key=$langs->trans("Country".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
||||
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
||||
$langs->loadLangs(array("propal"));
|
||||
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
|
||||
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
|
||||
$key=$langs->trans("Action".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||
elseif ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||
$showfield=0;
|
||||
}
|
||||
|
||||
|
|
@ -813,7 +813,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldListAccountingCategories($fieldlist, $obj='', $tabname='', $context='')
|
||||
function fieldListAccountingCategories($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $form, $mysoc;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if ($action == 'confirm_delete' && $confirm == "yes") {
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'add') {
|
||||
elseif ($action == 'add') {
|
||||
if (! GETPOST('cancel', 'alpha')) {
|
||||
$error = 0;
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ else if ($action == 'add') {
|
|||
}
|
||||
|
||||
// Update record
|
||||
else if ($action == 'update') {
|
||||
elseif ($action == 'update') {
|
||||
if (! GETPOST('cancel', 'alpha')) {
|
||||
$result = $object->fetch($id);
|
||||
|
||||
|
|
@ -198,7 +198,7 @@ if ($action == 'create')
|
|||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
} else if ($id) {
|
||||
} elseif ($id) {
|
||||
$result = $object->fetch($id);
|
||||
if ($result > 0) {
|
||||
$head = fiscalyear_prepare_head($object);
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
|
||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
||||
}
|
||||
else if ($field == 'entity') {
|
||||
elseif ($field == 'entity') {
|
||||
$_POST[$listfieldvalue[$i]] = $conf->entity;
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
|
|
@ -441,7 +441,7 @@ if ($id)
|
|||
{
|
||||
print '<td align="'.$align.'">';
|
||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
||||
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
|
|
@ -611,11 +611,11 @@ if ($id)
|
|||
if ($valuetoshow=='all') {
|
||||
$valuetoshow=$langs->trans('All');
|
||||
}
|
||||
else if ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||
elseif ($fieldlist[$field]=='nature' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||
$key=$langs->trans("AccountingJournalType".strtoupper($obj->nature));
|
||||
$valuetoshow=($obj->nature && $key != "AccountingJournalType".strtoupper($langs->trans($obj->nature))?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'accounting_journal') {
|
||||
$valuetoshow=$langs->trans($obj->label);
|
||||
}
|
||||
|
||||
|
|
@ -627,11 +627,17 @@ if ($id)
|
|||
|
||||
// Can an entry be erased or disabled ?
|
||||
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default
|
||||
if (isset($obj->code) && $id != 10)
|
||||
{
|
||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; }
|
||||
else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
||||
else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
||||
if (isset($obj->code) && $id != 10) {
|
||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) {
|
||||
$iserasable = 0;
|
||||
$canbedisabled = 0;
|
||||
} elseif ($obj->code == 'RECEP') {
|
||||
$iserasable = 0;
|
||||
$canbedisabled = 0;
|
||||
} elseif ($obj->code == 'EF0') {
|
||||
$iserasable = 0;
|
||||
$canbedisabled = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$canbemodified=$iserasable;
|
||||
|
|
@ -696,7 +702,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldListJournal($fieldlist, $obj='', $tabname='', $context='')
|
||||
function fieldListJournal($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $form, $mysoc;
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ if ($action == "confirm_update") {
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == "add") {
|
||||
elseif ($action == "add") {
|
||||
$error = 0;
|
||||
|
||||
if ((floatval($debit) != 0.0) && (floatval($credit) != 0.0))
|
||||
|
|
@ -201,7 +201,7 @@ else if ($action == "add") {
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == "confirm_delete") {
|
||||
elseif ($action == "confirm_delete") {
|
||||
$object = new BookKeeping($db);
|
||||
|
||||
$result = $object->fetch($id, null, $mode);
|
||||
|
|
@ -218,7 +218,7 @@ else if ($action == "confirm_delete") {
|
|||
$action = '';
|
||||
}
|
||||
|
||||
else if ($action == "confirm_create") {
|
||||
elseif ($action == "confirm_create") {
|
||||
$error = 0;
|
||||
|
||||
$object = new BookKeeping($db);
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ class AccountancyCategory // extends CommonObject
|
|||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
*/
|
||||
function create($user, $notrigger=0)
|
||||
function create($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
|
|
@ -239,7 +239,7 @@ class AccountancyCategory // extends CommonObject
|
|||
* @param string $label Label
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id, $code='', $label='')
|
||||
function fetch($id, $code = '', $label = '')
|
||||
{
|
||||
$sql = "SELECT";
|
||||
$sql.= " t.rowid,";
|
||||
|
|
@ -299,7 +299,7 @@ class AccountancyCategory // extends CommonObject
|
|||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user=null, $notrigger=0)
|
||||
function update($user = null, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
|
|
@ -379,7 +379,7 @@ class AccountancyCategory // extends CommonObject
|
|||
* @param int $notrigger 0=launch triggers after, 1=disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($user, $notrigger=0)
|
||||
function delete($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
$error=0;
|
||||
|
|
@ -726,7 +726,7 @@ class AccountancyCategory // extends CommonObject
|
|||
* @param int $year Specifig year - Can be empty
|
||||
* @return integer <0 if KO, >= 0 if OK
|
||||
*/
|
||||
public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code='nofilter', $month=0, $year=0)
|
||||
public function getSumDebitCredit($cpt, $date_start, $date_end, $sens, $thirdparty_code = 'nofilter', $month = 0, $year = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -796,7 +796,7 @@ class AccountancyCategory // extends CommonObject
|
|||
* @param int $categorytype -1=All, 0=Only non computed groups, 1=Only computed groups
|
||||
* @return array|int Array of groups or -1 if error
|
||||
*/
|
||||
public function getCats($categorytype=-1)
|
||||
public function getCats($categorytype = -1)
|
||||
{
|
||||
global $conf, $mysoc;
|
||||
|
||||
|
|
@ -853,7 +853,7 @@ class AccountancyCategory // extends CommonObject
|
|||
* @param string $predefinedgroupwhere Sql criteria filter to select accounting accounts
|
||||
* @return array|int Array of accounting accounts or -1 if error
|
||||
*/
|
||||
public function getCptsCat($cat_id, $predefinedgroupwhere='')
|
||||
public function getCptsCat($cat_id, $predefinedgroupwhere = '')
|
||||
{
|
||||
global $conf, $mysoc;
|
||||
$sql = '';
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ class AccountingAccount extends CommonObject
|
|||
* @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
|
||||
*/
|
||||
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0, $save_lastsearch_value=-1)
|
||||
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
|
|
@ -632,7 +632,7 @@ class AccountingAccount extends CommonObject
|
|||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
function getLibStatut($mode = 0)
|
||||
{
|
||||
return $this->LibStatut($this->status, $mode);
|
||||
}
|
||||
|
|
@ -645,7 +645,7 @@ class AccountingAccount extends CommonObject
|
|||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
function LibStatut($statut,$mode=0)
|
||||
function LibStatut($statut, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ class AccountingJournal extends CommonObject
|
|||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle='',$notooltip=0)
|
||||
function getNomUrl($withpicto = 0, $withlabel = 0, $nourl = 0, $moretitle = '', $notooltip = 0)
|
||||
{
|
||||
global $langs, $conf, $user;
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ class AccountingJournal extends CommonObject
|
|||
* @param int $mode 0=libelle long, 1=libelle court
|
||||
* @return string Label of type
|
||||
*/
|
||||
function getLibType($mode=0)
|
||||
function getLibType($mode = 0)
|
||||
{
|
||||
return $this->LibType($this->nature, $mode);
|
||||
}
|
||||
|
|
@ -283,7 +283,7 @@ class AccountingJournal extends CommonObject
|
|||
* @param int $mode 0=libelle long, 1=libelle court
|
||||
* @return string Label of type
|
||||
*/
|
||||
function LibType($nature,$mode=0)
|
||||
function LibType($nature, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ class BookKeeping extends CommonObject
|
|||
* @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
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
|
||||
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||
{
|
||||
global $db, $conf, $langs;
|
||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||
|
|
@ -470,7 +470,7 @@ class BookKeeping extends CommonObject
|
|||
* @param string $mode Mode
|
||||
* @return int <0 if KO, Id of created object if OK
|
||||
*/
|
||||
public function createStd(User $user, $notrigger = false, $mode='')
|
||||
public function createStd(User $user, $notrigger = false, $mode = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -641,7 +641,7 @@ class BookKeeping extends CommonObject
|
|||
*
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
public function fetch($id, $ref = null, $mode='')
|
||||
public function fetch($id, $ref = null, $mode = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -1090,7 +1090,7 @@ class BookKeeping extends CommonObject
|
|||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function update(User $user, $notrigger = false, $mode='')
|
||||
public function update(User $user, $notrigger = false, $mode = '')
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
|
|
@ -1225,7 +1225,7 @@ class BookKeeping extends CommonObject
|
|||
* @param string $mode Mode
|
||||
* @return number <0 if KO, >0 if OK
|
||||
*/
|
||||
public function updateByMvt($piece_num='', $field='', $value='', $mode='')
|
||||
public function updateByMvt($piece_num = '', $field = '', $value = '', $mode = '')
|
||||
{
|
||||
$error=0;
|
||||
|
||||
|
|
@ -1260,7 +1260,7 @@ class BookKeeping extends CommonObject
|
|||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function delete(User $user, $notrigger = false, $mode='')
|
||||
public function delete(User $user, $notrigger = false, $mode = '')
|
||||
{
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
|
||||
|
|
@ -1338,7 +1338,7 @@ class BookKeeping extends CommonObject
|
|||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function deleteByYearAndJournal($delyear='', $journal='', $mode='')
|
||||
function deleteByYearAndJournal($delyear = '', $journal = '', $mode = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -1500,7 +1500,7 @@ class BookKeeping extends CommonObject
|
|||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetchPerMvt($piecenum, $mode='')
|
||||
public function fetchPerMvt($piecenum, $mode = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -1536,7 +1536,7 @@ class BookKeeping extends CommonObject
|
|||
* @param string $mode Mode
|
||||
* @return string Next numero to use
|
||||
*/
|
||||
public function getNextNumMvt($mode='')
|
||||
public function getNextNumMvt($mode = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -1565,7 +1565,7 @@ class BookKeeping extends CommonObject
|
|||
* @param string $mode Mode
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetchAllPerMvt($piecenum, $mode='')
|
||||
function fetchAllPerMvt($piecenum, $mode = '')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -1687,7 +1687,7 @@ class BookKeeping extends CommonObject
|
|||
* @param string $piece_num Piece num
|
||||
* @return int int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function transformTransaction($direction=0,$piece_num='')
|
||||
public function transformTransaction($direction = 0, $piece_num = '')
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -219,12 +219,12 @@ if ($search_month > 0)
|
|||
{
|
||||
if ($search_year > 0 && empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'";
|
||||
else if ($search_year > 0 && ! empty($search_day))
|
||||
elseif ($search_year > 0 && ! empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||
else
|
||||
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
||||
}
|
||||
else if ($search_year > 0)
|
||||
elseif ($search_year > 0)
|
||||
{
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
|
|
@ -212,7 +212,8 @@ if (empty($chartaccountcode))
|
|||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,";
|
||||
$sql.= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,";
|
||||
$sql.= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.accountancy_code_sell as code_sell, p.tva_tx as tva_tx_prod,";
|
||||
$sql.= " aa.rowid as aarowid,";
|
||||
$sql.= " p.accountancy_code_sell_intra as code_sell_intra, p.accountancy_code_sell_export as code_sell_export,";
|
||||
$sql.= " aa.rowid as aarowid, aa2.rowid as aarowid_intra, aa3.rowid as aarowid_export,";
|
||||
$sql.= " co.code as country_code, co.label as country,";
|
||||
$sql.= " s.tva_intra";
|
||||
$parameters=array();
|
||||
|
|
@ -257,12 +258,12 @@ if ($search_month > 0)
|
|||
{
|
||||
if ($search_year > 0 && empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'";
|
||||
else if ($search_year > 0 && ! empty($search_day))
|
||||
elseif ($search_year > 0 && ! empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||
else
|
||||
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
||||
}
|
||||
else if ($search_year > 0)
|
||||
elseif ($search_year > 0)
|
||||
{
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'";
|
||||
}
|
||||
|
|
@ -437,7 +438,9 @@ if ($result) {
|
|||
$code_sell_p_notset = '';
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
|
||||
if ($objp->type_l == 1) {
|
||||
$isinEEC = isInEEC($objp->country_code);
|
||||
|
||||
if ($objp->type_l == 1) {
|
||||
$objp->code_sell_l = (! empty($conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_SERVICE_SOLD_ACCOUNT : '');
|
||||
if ($objp->aarowid == '') {
|
||||
$objp->aarowid_suggest = $aarowid_s;
|
||||
|
|
@ -450,8 +453,19 @@ if ($result) {
|
|||
}
|
||||
if ($objp->code_sell_l == -1) $objp->code_sell_l='';
|
||||
|
||||
if ($objp->country_sell == '1') {
|
||||
$objp->code_sell_p = $objp->code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid;
|
||||
} elseif ($isinEEC == true) {
|
||||
$objp->code_sell_p = $objp->code_sell_intra;
|
||||
$objp->aarowid_suggest = $objp->aarowid_intra;
|
||||
} else {
|
||||
$objp->code_sell_p = $objp->code_sell_export;
|
||||
$objp->aarowid_suggest = $objp->aarowid_export;
|
||||
}
|
||||
|
||||
if (! empty($objp->code_sell)) {
|
||||
$objp->code_sell_p = $objp->code_sell; // Code on product
|
||||
//$objp->code_sell_p = $objp->code_sell; // Code on product
|
||||
} else {
|
||||
$code_sell_p_notset = 'color:orange';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -190,12 +190,12 @@ if ($search_month > 0)
|
|||
{
|
||||
if ($search_year > 0 && empty($search_day))
|
||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'";
|
||||
else if ($search_year > 0 && ! empty($search_day))
|
||||
elseif ($search_year > 0 && ! empty($search_day))
|
||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||
else
|
||||
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
|
||||
}
|
||||
else if ($search_year > 0)
|
||||
elseif ($search_year > 0)
|
||||
{
|
||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -219,12 +219,12 @@ if ($search_month > 0)
|
|||
{
|
||||
if ($search_year > 0 && empty($search_day))
|
||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'";
|
||||
else if ($search_year > 0 && ! empty($search_day))
|
||||
elseif ($search_year > 0 && ! empty($search_day))
|
||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||
else
|
||||
$sql.= " AND date_format(erd.date, '%m') = '".$db->escape($search_month)."'";
|
||||
}
|
||||
else if ($search_year > 0)
|
||||
elseif ($search_year > 0)
|
||||
{
|
||||
$sql.= " AND erd.date BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -290,18 +290,18 @@ if ($result) {
|
|||
$paymentstatic->ref = $links[$key]['url_id'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentstatic->getNomUrl(2, '', ''); // TODO Do not include list of invoice in tooltip, the dol_string_nohtmltag is ko with this
|
||||
$tabpay[$obj->rowid]["paymentid"] = $paymentstatic->id;
|
||||
} else if ($links[$key]['type'] == 'payment_supplier') {
|
||||
} elseif ($links[$key]['type'] == 'payment_supplier') {
|
||||
$paymentsupplierstatic->id = $links[$key]['url_id'];
|
||||
$paymentsupplierstatic->ref = $links[$key]['url_id'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsupplierstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentsupplierid"] = $paymentsupplierstatic->id;
|
||||
} else if ($links[$key]['type'] == 'company') {
|
||||
} elseif ($links[$key]['type'] == 'company') {
|
||||
$societestatic->id = $links[$key]['url_id'];
|
||||
$societestatic->name = $links[$key]['label'];
|
||||
$societestatic->email = $tabcompany[$obj->rowid]['email'];
|
||||
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
||||
if ($compta_soc) $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'user') {
|
||||
} elseif ($links[$key]['type'] == 'user') {
|
||||
$userstatic->id = $links[$key]['url_id'];
|
||||
$userstatic->name = $links[$key]['label'];
|
||||
$userstatic->email = $tabuser[$obj->rowid]['email'];
|
||||
|
|
@ -310,7 +310,7 @@ if ($result) {
|
|||
if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
|
||||
else $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
|
||||
if ($compta_user) $tabtp[$obj->rowid][$compta_user] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'sc') {
|
||||
} elseif ($links[$key]['type'] == 'sc') {
|
||||
$chargestatic->id = $links[$key]['url_id'];
|
||||
$chargestatic->ref = $links[$key]['url_id'];
|
||||
|
||||
|
|
@ -339,14 +339,14 @@ if ($result) {
|
|||
$objmid = $db->fetch_object($resultmid);
|
||||
$tabtp[$obj->rowid][$objmid->accountancy_code] += $obj->amount;
|
||||
}
|
||||
} else if ($links[$key]['type'] == 'payment_donation') {
|
||||
} elseif ($links[$key]['type'] == 'payment_donation') {
|
||||
$paymentdonstatic->id = $links[$key]['url_id'];
|
||||
$paymentdonstatic->ref = $links[$key]['url_id'];
|
||||
$paymentdonstatic->fk_donation = $links[$key]['url_id'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentdonstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentdonationid"] = $paymentdonstatic->id;
|
||||
$tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'member') {
|
||||
} elseif ($links[$key]['type'] == 'member') {
|
||||
$paymentsubscriptionstatic->id = $links[$key]['url_id'];
|
||||
$paymentsubscriptionstatic->ref = $links[$key]['url_id'];
|
||||
$paymentsubscriptionstatic->label = $links[$key]['label'];
|
||||
|
|
@ -354,24 +354,24 @@ if ($result) {
|
|||
$tabpay[$obj->rowid]["paymentsubscriptionid"] = $paymentsubscriptionstatic->id;
|
||||
$paymentsubscriptionstatic->fetch($paymentsubscriptionstatic->id);
|
||||
$tabtp[$obj->rowid][$account_pay_subscription] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'payment_vat') { // Payment VAT
|
||||
} elseif ($links[$key]['type'] == 'payment_vat') { // Payment VAT
|
||||
$paymentvatstatic->id = $links[$key]['url_id'];
|
||||
$paymentvatstatic->ref = $links[$key]['url_id'];
|
||||
$paymentvatstatic->label = $links[$key]['label'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentvatid"] = $paymentvatstatic->id;
|
||||
$tabtp[$obj->rowid][$account_pay_vat] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'payment_salary') {
|
||||
} elseif ($links[$key]['type'] == 'payment_salary') {
|
||||
$paymentsalstatic->id = $links[$key]['url_id'];
|
||||
$paymentsalstatic->ref = $links[$key]['url_id'];
|
||||
$paymentsalstatic->label = $links[$key]['label'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
|
||||
} else if ($links[$key]['type'] == 'payment_expensereport') {
|
||||
} elseif ($links[$key]['type'] == 'payment_expensereport') {
|
||||
$paymentexpensereportstatic->id = $links[$key]['url_id'];
|
||||
$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentexpensereport"] = $paymentexpensereportstatic->id;
|
||||
} else if ($links[$key]['type'] == 'payment_various') {
|
||||
} elseif ($links[$key]['type'] == 'payment_various') {
|
||||
$paymentvariousstatic->id = $links[$key]['url_id'];
|
||||
$paymentvariousstatic->ref = $links[$key]['url_id'];
|
||||
$paymentvariousstatic->label = $links[$key]['label'];
|
||||
|
|
@ -380,7 +380,7 @@ if ($result) {
|
|||
$paymentvariousstatic->fetch($paymentvariousstatic->id);
|
||||
$account_various = (! empty($paymentvariousstatic->accountancy_code) ? $paymentvariousstatic->accountancy_code : 'NotDefined'); // NotDefined is a reserved word
|
||||
$tabtp[$obj->rowid][$account_various] += $obj->amount;
|
||||
} else if ($links[$key]['type'] == 'payment_loan') {
|
||||
} elseif ($links[$key]['type'] == 'payment_loan') {
|
||||
$paymentloanstatic->id = $links[$key]['url_id'];
|
||||
$paymentloanstatic->ref = $links[$key]['url_id'];
|
||||
$paymentloanstatic->fk_loan = $links[$key]['url_id'];
|
||||
|
|
@ -399,7 +399,7 @@ if ($result) {
|
|||
$tabtp[$obj->rowid][$objmid->accountancy_account_insurance] -= $objmid->amount_insurance;
|
||||
$tabtp[$obj->rowid][$objmid->accountancy_account_interest] -= $objmid->amount_interest;
|
||||
}
|
||||
} else if ($links[$key]['type'] == 'banktransfert') {
|
||||
} elseif ($links[$key]['type'] == 'banktransfert') {
|
||||
$accountLinestatic->fetch($links[$key]['url_id']);
|
||||
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- ' .$accountLinestatic ->getNomUrl(1);
|
||||
$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
|
||||
|
|
@ -567,68 +567,68 @@ if (! $error && $action == 'writebookkeeping') {
|
|||
|
||||
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} else if ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
||||
} elseif ($tabtype[$key] == 'payment_supplier') { // If payment is payment of supplier invoice, we get ref of invoice
|
||||
$bookkeeping->subledger_account = $tabcompany[$key]['code_compta'];
|
||||
$bookkeeping->subledger_label = $tabcompany[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
|
||||
$accountingaccount->fetch(null, $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} else if ($tabtype[$key] == 'payment_expensereport') {
|
||||
} elseif ($tabtype[$key] == 'payment_expensereport') {
|
||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
|
||||
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} else if ($tabtype[$key] == 'payment_salary') {
|
||||
} elseif ($tabtype[$key] == 'payment_salary') {
|
||||
$bookkeeping->subledger_account = $tabuser[$key]['accountancy_code'];
|
||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
|
||||
$accountingaccount->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} else if (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
||||
} elseif (in_array($tabtype[$key], array('sc', 'payment_sc'))) { // If payment is payment of social contribution
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
$bookkeeping->label_compte = $objmid->labelc;
|
||||
} else if ($tabtype[$key] == 'payment_vat') {
|
||||
} elseif ($tabtype[$key] == 'payment_vat') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} else if ($tabtype[$key] == 'payment_donation') {
|
||||
} elseif ($tabtype[$key] == 'payment_donation') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} else if ($tabtype[$key] == 'member') {
|
||||
} elseif ($tabtype[$key] == 'member') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} else if ($tabtype[$key] == 'payment_loan') {
|
||||
} elseif ($tabtype[$key] == 'payment_loan') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} else if ($tabtype[$key] == 'payment_various') {
|
||||
} elseif ($tabtype[$key] == 'payment_various') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} else if ($tabtype[$key] == 'banktransfert') {
|
||||
} elseif ($tabtype[$key] == 'banktransfert') {
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
$bookkeeping->numero_compte = $k;
|
||||
|
|
@ -845,11 +845,11 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||
if ($tabtype[$key] == 'payment_supplier') {
|
||||
print '"' . $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER . '"' . $sep;
|
||||
} else if($tabtype[$key] == 'payment') {
|
||||
} elseif($tabtype[$key] == 'payment') {
|
||||
print '"' . $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER . '"' . $sep;
|
||||
} else if($tabtype[$key] == 'payment_expensereport') {
|
||||
} elseif($tabtype[$key] == 'payment_expensereport') {
|
||||
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
|
||||
} else if($tabtype[$key] == 'payment_salary') {
|
||||
} elseif($tabtype[$key] == 'payment_salary') {
|
||||
print '"' . $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT . '"' . $sep;
|
||||
} else {
|
||||
print '"' . length_accounta(html_entity_decode($k)) . '"' . $sep;
|
||||
|
|
|
|||
|
|
@ -214,12 +214,12 @@ if ($search_month > 0)
|
|||
{
|
||||
if ($search_year > 0 && empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'";
|
||||
else if ($search_year > 0 && ! empty($search_day))
|
||||
elseif ($search_year > 0 && ! empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||
else
|
||||
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
||||
}
|
||||
else if ($search_year > 0)
|
||||
elseif ($search_year > 0)
|
||||
{
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -256,12 +256,12 @@ if ($search_month > 0)
|
|||
{
|
||||
if ($search_year > 0 && empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, $search_month, false))."' AND '".$db->idate(dol_get_last_day($search_year, $search_month, false))."'";
|
||||
else if ($search_year > 0 && ! empty($search_day))
|
||||
elseif ($search_year > 0 && ! empty($search_day))
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
|
||||
else
|
||||
$sql.= " AND date_format(f.datef, '%m') = '".$db->escape($search_month)."'";
|
||||
}
|
||||
else if ($search_year > 0)
|
||||
elseif ($search_year > 0)
|
||||
{
|
||||
$sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($search_year, 1, false))."' AND '".$db->idate(dol_get_last_day($search_year, 12, false))."'";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ class Adherent extends CommonObject
|
|||
* @param string $moreinheader Add more html headers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='', $moreinheader='')
|
||||
function send_an_email($text, $subject, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $addr_cc = "", $addr_bcc = "", $deliveryreceipt = 0, $msgishtml = -1, $errors_to = '', $moreinheader = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs;
|
||||
|
|
@ -358,7 +358,7 @@ class Adherent extends CommonObject
|
|||
* @param string $morphy Nature of the adherent (physical or moral)
|
||||
* @return string Label
|
||||
*/
|
||||
function getmorphylib($morphy='')
|
||||
function getmorphylib($morphy = '')
|
||||
{
|
||||
global $langs;
|
||||
if (! $morphy) { $morphy=$this->morphy; }
|
||||
|
|
@ -374,7 +374,7 @@ class Adherent extends CommonObject
|
|||
* @param int $notrigger 1 ne declenche pas les triggers, 0 sinon
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user,$notrigger=0)
|
||||
function create($user, $notrigger = 0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
|
|
@ -500,7 +500,7 @@ class Adherent extends CommonObject
|
|||
* @param string $action Current action for hookmanager
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0,$action='update')
|
||||
function update($user, $notrigger = 0, $nosyncuser = 0, $nosyncuserpass = 0, $nosyncthirdparty = 0, $action = 'update')
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
|
|
@ -817,7 +817,7 @@ class Adherent extends CommonObject
|
|||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if KO, 0=nothing to do, >0 if OK
|
||||
*/
|
||||
function delete($rowid, $user, $notrigger=0)
|
||||
function delete($rowid, $user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
|
@ -927,7 +927,7 @@ class Adherent extends CommonObject
|
|||
* @param int $nosyncuser Do not synchronize linked user
|
||||
* @return string If OK return clear password, 0 if no change, < 0 if error
|
||||
*/
|
||||
function setPassword($user, $password='', $isencrypted=0, $notrigger=0, $nosyncuser=0)
|
||||
function setPassword($user, $password = '', $isencrypted = 0, $notrigger = 0, $nosyncuser = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
|
@ -1147,7 +1147,7 @@ class Adherent extends CommonObject
|
|||
* @param string $lastname Lastname
|
||||
* @return void
|
||||
*/
|
||||
function fetch_name($firstname,$lastname)
|
||||
function fetch_name($firstname, $lastname)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
|
@ -1183,7 +1183,7 @@ class Adherent extends CommonObject
|
|||
* @param bool $fetch_subscriptions To load member subscriptions
|
||||
* @return int >0 if OK, 0 if not found, <0 if KO
|
||||
*/
|
||||
function fetch($rowid,$ref='',$fk_soc='',$ref_ext='',$fetch_optionals=true,$fetch_subscriptions=true)
|
||||
function fetch($rowid, $ref = '', $fk_soc = '', $ref_ext = '', $fetch_optionals = true, $fetch_subscriptions = true)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
|
@ -1400,7 +1400,7 @@ class Adherent extends CommonObject
|
|||
* @param int $datesubend Date end subscription
|
||||
* @return int rowid of record added, <0 if KO
|
||||
*/
|
||||
function subscription($date, $amount, $accountid=0, $operation='', $label='', $num_chq='', $emetteur_nom='', $emetteur_banque='', $datesubend=0)
|
||||
function subscription($date, $amount, $accountid = 0, $operation = '', $label = '', $num_chq = '', $emetteur_nom = '', $emetteur_banque = '', $datesubend = 0)
|
||||
{
|
||||
global $conf,$langs,$user;
|
||||
|
||||
|
|
@ -1486,7 +1486,7 @@ class Adherent extends CommonObject
|
|||
* @param string $autocreatethirdparty Auto create new thirdparty if member not yet linked to a thirdparty and we request an option that generate invoice.
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom='', $emetteur_banque='', $autocreatethirdparty=0)
|
||||
function subscriptionComplementaryActions($subscriptionid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom = '', $emetteur_banque = '', $autocreatethirdparty = 0)
|
||||
{
|
||||
global $conf, $langs, $user, $mysoc;
|
||||
|
||||
|
|
@ -2018,7 +2018,7 @@ class Adherent extends CommonObject
|
|||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpictoimg=0, $maxlen=0, $option='card', $mode='', $morecss='', $save_lastsearch_value=-1)
|
||||
function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
|
@ -2109,7 +2109,7 @@ class Adherent extends CommonObject
|
|||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
function getLibStatut($mode = 0)
|
||||
{
|
||||
return $this->LibStatut($this->statut, $this->need_subscription, $this->datefin, $mode);
|
||||
}
|
||||
|
|
@ -2124,7 +2124,7 @@ class Adherent extends CommonObject
|
|||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
|
||||
function LibStatut($statut, $need_subscription, $date_end_subscription, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
|
@ -2307,7 +2307,7 @@ class Adherent extends CommonObject
|
|||
* @param null|array $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)
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
|
|
@ -2400,7 +2400,7 @@ class Adherent extends CommonObject
|
|||
* 2=Return key only (uid=qqq)
|
||||
* @return string DN
|
||||
*/
|
||||
function _load_ldap_dn($info,$mode=0)
|
||||
function _load_ldap_dn($info, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
|
@ -2487,7 +2487,7 @@ class Adherent extends CommonObject
|
|||
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // Create OpenLDAP MD5 password (TODO add type of encryption)
|
||||
}
|
||||
// Set LDAP password if possible
|
||||
else if ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
|
||||
elseif ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
|
||||
{
|
||||
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
|
||||
{
|
||||
|
|
@ -2502,7 +2502,7 @@ class Adherent extends CommonObject
|
|||
}
|
||||
}
|
||||
// Use $this->pass_indatabase value if exists
|
||||
else if (! empty($this->pass_indatabase))
|
||||
elseif (! empty($this->pass_indatabase))
|
||||
{
|
||||
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass_indatabase; // $this->pass_indatabase = mot de passe non crypte
|
||||
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase, 4); // md5 for OpenLdap TODO add type of encryption
|
||||
|
|
@ -2694,7 +2694,7 @@ class Adherent extends CommonObject
|
|||
* @param string $daysbeforeendlist Nb of days before end of subscription (negative number = after subscription). Can be a list of delay, separated by a semicolon, for example '10;5;0;-5'
|
||||
* @return int 0 if OK, <>0 if KO (this function is used also by cron so only 0 is OK)
|
||||
*/
|
||||
public function sendReminderForExpiredSubscription($daysbeforeendlist='10')
|
||||
public function sendReminderForExpiredSubscription($daysbeforeendlist = '10')
|
||||
{
|
||||
global $conf, $langs, $mysoc, $user;
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class AdherentType extends CommonObject
|
|||
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
||||
* @return int >0 if OK, < 0 if KO
|
||||
*/
|
||||
function create($user,$notrigger=0)
|
||||
function create($user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -170,7 +170,7 @@ class AdherentType extends CommonObject
|
|||
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
||||
* @return int >0 if OK, < 0 if KO
|
||||
*/
|
||||
function update($user,$notrigger=0)
|
||||
function update($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $hookmanager;
|
||||
|
||||
|
|
@ -356,7 +356,7 @@ class AdherentType extends CommonObject
|
|||
* 2=Return array of members id only
|
||||
* @return mixed Array of members or -1 on error
|
||||
*/
|
||||
function listMembersForMemberType($excludefilter='', $mode=0)
|
||||
function listMembersForMemberType($excludefilter = '', $mode = 0)
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
|
|
@ -411,7 +411,7 @@ class AdherentType extends CommonObject
|
|||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0)
|
||||
function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ class AdherentType extends CommonObject
|
|||
* 2=Return key only (uid=qqq)
|
||||
* @return string DN
|
||||
*/
|
||||
function _load_ldap_dn($info,$mode=0)
|
||||
function _load_ldap_dn($info, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class AdherentStats extends Stats
|
|||
* @param int $socid Id third party
|
||||
* @param int $userid Id user for filter
|
||||
*/
|
||||
function __construct($db, $socid=0, $userid=0)
|
||||
function __construct($db, $socid = 0, $userid = 0)
|
||||
{
|
||||
global $user, $conf;
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ class AdherentStats extends Stats
|
|||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of nb each month
|
||||
*/
|
||||
function getNbByMonth($year, $format=0)
|
||||
function getNbByMonth($year, $format = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ class AdherentStats extends Stats
|
|||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of amount each month
|
||||
*/
|
||||
function getAmountByMonth($year, $format=0)
|
||||
function getAmountByMonth($year, $format = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ class Members extends DolibarrApi
|
|||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when resiliating member: '.$member->error);
|
||||
}
|
||||
} else if ($value == '1') {
|
||||
} elseif ($value == '1') {
|
||||
$result = $member->validate(DolibarrApiAccess::$user);
|
||||
if ($result < 0) {
|
||||
throw new RestException(500, 'Error when validating member: '.$member->error);
|
||||
|
|
@ -361,7 +361,7 @@ class Members extends DolibarrApi
|
|||
*
|
||||
* @url POST {id}/subscriptions
|
||||
*/
|
||||
function createSubscription($id, $start_date, $end_date, $amount, $label='')
|
||||
function createSubscription($id, $start_date, $end_date, $amount, $label = '')
|
||||
{
|
||||
if(! DolibarrApiAccess::$user->rights->adherent->cotisation->creer) {
|
||||
throw new RestException(401);
|
||||
|
|
|
|||
|
|
@ -207,7 +207,7 @@ $type=$this->fk_type;
|
|||
* @param int $notrigger 0=Disable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user, $notrigger=0)
|
||||
function update($user, $notrigger = 0)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
|
|
@ -263,7 +263,7 @@ $type=$this->fk_type;
|
|||
* @param bool $notrigger false=launch triggers after, true=disable triggers
|
||||
* @return int <0 if KO, 0 if not found, >0 if OK
|
||||
*/
|
||||
function delete($user, $notrigger=false)
|
||||
function delete($user, $notrigger = false)
|
||||
{
|
||||
$error = 0;
|
||||
|
||||
|
|
@ -356,7 +356,7 @@ $type=$this->fk_type;
|
|||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $notooltip=0, $option='', $morecss='', $save_lastsearch_value=-1)
|
||||
function getNomUrl($withpicto = 0, $notooltip = 0, $option = '', $morecss = '', $save_lastsearch_value = -1)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
|
@ -395,7 +395,7 @@ $type=$this->fk_type;
|
|||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
function getLibStatut($mode = 0)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,9 +210,9 @@ if ($mode && ! count($data))
|
|||
else
|
||||
{
|
||||
if ($mode == 'memberbycountry') print $langs->trans("MembersByCountryDesc").'<br>';
|
||||
else if ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'<br>';
|
||||
else if ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'<br>';
|
||||
else if ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'<br>';//+
|
||||
elseif ($mode == 'memberbystate') print $langs->trans("MembersByStateDesc").'<br>';
|
||||
elseif ($mode == 'memberbytown') print $langs->trans("MembersByTownDesc").'<br>';
|
||||
elseif ($mode == 'memberbyregion') print $langs->trans("MembersByRegion").'<br>';//+
|
||||
else
|
||||
{
|
||||
print $langs->trans("MembersStatisticsDesc").'<br>';
|
||||
|
|
|
|||
|
|
@ -793,8 +793,8 @@ if ($rowid > 0)
|
|||
else
|
||||
{
|
||||
if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankviainvoice' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $bankviainvoice=1;
|
||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
|
||||
else if (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $invoiceonly=1;
|
||||
elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'bankdirect' && ! empty($conf->banque->enabled)) $bankdirect=1;
|
||||
elseif (! empty($conf->global->ADHERENT_BANK_USE) && $conf->global->ADHERENT_BANK_USE == 'invoiceonly' && ! empty($conf->banque->enabled) && ! empty($conf->societe->enabled) && ! empty($conf->facture->enabled)) $invoiceonly=1;
|
||||
}
|
||||
|
||||
print "\n\n<!-- Form add subscription -->\n";
|
||||
|
|
|
|||
|
|
@ -95,18 +95,16 @@ if ($cancel) {
|
|||
|
||||
$action='';
|
||||
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
if (! empty($backtopage)) {
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'add' && $user->rights->adherent->configurer)
|
||||
{
|
||||
if ($action == 'add' && $user->rights->adherent->configurer) {
|
||||
$object->label = trim($label);
|
||||
$object->statut = trim($statut);
|
||||
$object->subscription = (int) trim($subscription);
|
||||
$object->statut = (int) $statut;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->note = trim($comment);
|
||||
$object->mail_valid = trim($mail_valid);
|
||||
$object->vote = (boolean) trim($vote);
|
||||
|
|
@ -159,8 +157,8 @@ if ($action == 'update' && $user->rights->adherent->configurer)
|
|||
$object->oldcopy = clone $object;
|
||||
|
||||
$object->label = trim($label);
|
||||
$object->statut = trim($statut);
|
||||
$object->subscription = (int) trim($subscription);
|
||||
$object->statut = (int) $statut;
|
||||
$object->subscription = (int) $subscription;
|
||||
$object->note = trim($comment);
|
||||
$object->mail_valid = trim($mail_valid);
|
||||
$object->vote = (boolean) trim($vote);
|
||||
|
|
@ -266,8 +264,7 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||
|
||||
$membertype = new AdherentType($db);
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object($result);
|
||||
|
||||
$membertype->id = $objp->rowid;
|
||||
|
|
@ -283,9 +280,12 @@ if (! $rowid && $action != 'create' && $action != 'edit')
|
|||
print '<td align="center">'.yn($objp->subscription).'</td>';
|
||||
print '<td align="center">'.yn($objp->vote).'</td>';
|
||||
print '<td align="center">';
|
||||
if ( !empty($objp->statut) ) print img_picto($langs->trans("InActivity"), 'statut4');
|
||||
else print img_picto($langs->trans("ActivityCeased"), 'statut5');
|
||||
print '</td>';
|
||||
if ( !empty($objp->statut) ) {
|
||||
print img_picto($langs->trans("InActivity"), 'statut4');
|
||||
} else {
|
||||
print img_picto($langs->trans("ActivityCeased"), 'statut5');
|
||||
}
|
||||
print '</td>';
|
||||
if ($user->rights->adherent->configurer)
|
||||
print '<td class="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
|
||||
else
|
||||
|
|
@ -330,7 +330,7 @@ if ($action == 'create')
|
|||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), 1);
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print $form->selectyesno("subscription", 1, 1);
|
||||
print '</td></tr>';
|
||||
|
|
@ -350,8 +350,13 @@ if ($action == 'create')
|
|||
|
||||
// Other attributes
|
||||
$parameters=array();
|
||||
<<<<<<< HEAD
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions', $parameters, $act, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
=======
|
||||
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
>>>>>>> upstream/develop
|
||||
if (empty($reshook))
|
||||
{
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
|
|
@ -405,8 +410,16 @@ if ($rowid > 0)
|
|||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Status").'</td><td>';
|
||||
<<<<<<< HEAD
|
||||
if ( !empty($object->statut) ) print img_picto($langs->trans('TypeStatusActive'), 'statut4').' '.$langs->trans("InActivity");
|
||||
else print img_picto($langs->trans('TypeStatusInactive'), 'statut5').' '.$langs->trans("ActivityCeased");
|
||||
=======
|
||||
if ( !empty($object->statut) ) {
|
||||
print img_picto($langs->trans('TypeStatusActive'),'statut4').' '.$langs->trans("InActivity");
|
||||
} else {
|
||||
print img_picto($langs->trans('TypeStatusInactive'),'statut5').' '.$langs->trans("ActivityCeased");
|
||||
}
|
||||
>>>>>>> upstream/develop
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
|
|
@ -444,12 +457,12 @@ if ($rowid > 0)
|
|||
}
|
||||
|
||||
// Add
|
||||
if ( $user->rights->adherent->configurer && !empty($object->statut) )
|
||||
if ( $user->rights->adherent->configurer && !empty($object->statut) )
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
}
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
|
||||
}
|
||||
|
||||
// Delete
|
||||
if ($user->rights->adherent->configurer)
|
||||
|
|
@ -538,11 +551,11 @@ if ($rowid > 0)
|
|||
if ($status != '')
|
||||
{
|
||||
if ($status == '-1,1') { $titre=$langs->trans("MembersListQualified"); }
|
||||
else if ($status == '-1') { $titre=$langs->trans("MembersListToValid"); }
|
||||
else if ($status == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
|
||||
else if ($status == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
|
||||
else if ($status == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
|
||||
else if ($status == '0') { $titre=$langs->trans("MembersListResiliated"); }
|
||||
elseif ($status == '-1') { $titre=$langs->trans("MembersListToValid"); }
|
||||
elseif ($status == '1' && ! $filter) { $titre=$langs->trans("MembersListValid"); }
|
||||
elseif ($status == '1' && $filter=='uptodate') { $titre=$langs->trans("MembersListUpToDate"); }
|
||||
elseif ($status == '1' && $filter=='outofdate') { $titre=$langs->trans("MembersListNotUpToDate"); }
|
||||
elseif ($status == '0') { $titre=$langs->trans("MembersListResiliated"); }
|
||||
}
|
||||
elseif ($action == 'search')
|
||||
{
|
||||
|
|
@ -598,8 +611,8 @@ if ($rowid > 0)
|
|||
|
||||
print '<td align="right" colspan="2" class="liste_titre">';
|
||||
print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
|
|
@ -746,11 +759,16 @@ if ($rowid > 0)
|
|||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" size="40" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut);
|
||||
print '</td></tr>';
|
||||
|
||||
print $form->selectarray('statut', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')), $object->statut);
|
||||
print '</td></tr>';
|
||||
|
||||
<<<<<<< HEAD
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print $form->selectyesno("subscription", $object->subscription, 1);
|
||||
=======
|
||||
print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
|
||||
print $form->selectyesno("subscription",$object->subscription,1);
|
||||
>>>>>>> upstream/develop
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ if ($action == 'set')
|
|||
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
else if ($action == 'specimen') // For orders
|
||||
elseif ($action == 'specimen') // For orders
|
||||
{
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -133,13 +133,13 @@ else if ($action == 'specimen') // For orders
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'setmodel')
|
||||
elseif ($action == 'setmodel')
|
||||
{
|
||||
//print "sssd".$value;
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -149,7 +149,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ if ($action == 'set')
|
|||
dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
else if ($action == 'specimen') // For orders
|
||||
elseif ($action == 'specimen') // For orders
|
||||
{
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -128,13 +128,13 @@ else if ($action == 'specimen') // For orders
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'setmodel')
|
||||
elseif ($action == 'setmodel')
|
||||
{
|
||||
//print "sssd".$value;
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -144,7 +144,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ if ($action == 'specimen') {
|
|||
if ($action == 'set') {
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
else if ($action == 'del') {
|
||||
elseif ($action == 'del') {
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
if ($conf->global->BANKADDON_PDF == "$value")
|
||||
|
|
@ -141,7 +141,7 @@ else if ($action == 'del') {
|
|||
}
|
||||
}
|
||||
// Set default model
|
||||
else if ($action == 'setdoc') {
|
||||
elseif ($action == 'setdoc') {
|
||||
if (dolibarr_set_const($db, "BANKADDON_PDF", $value, 'chaine', 0, '',
|
||||
$conf->entity)) {
|
||||
// The constant that was read before the new set
|
||||
|
|
|
|||
|
|
@ -289,14 +289,14 @@ if ($resql)
|
|||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
else if (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
||||
elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
||||
{
|
||||
$box_order = "B0".$record['box_order'];
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
}
|
||||
else if (dol_strlen($record['box_order']) == 2)
|
||||
elseif (dol_strlen($record['box_order']) == 2)
|
||||
{
|
||||
if (preg_match("/[13579]{1}/", substr($record['box_order'], -1)))
|
||||
{
|
||||
|
|
@ -304,7 +304,7 @@ if ($resql)
|
|||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||
$resql = $db->query($sql);
|
||||
}
|
||||
else if (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
||||
elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
||||
{
|
||||
$box_order = "B".$record['box_order'];
|
||||
$sql="UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$box_order."' WHERE entity = ".$conf->entity." AND box_order = '".$record['box_order']."'";
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if ($action == 'updateMask')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen')
|
||||
elseif ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -119,12 +119,12 @@ else if ($action == 'specimen')
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -134,7 +134,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "COMMANDE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -151,7 +151,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// TODO Check if numbering module chosen can be activated
|
||||
// by calling method canBeActivated
|
||||
|
|
@ -159,7 +159,7 @@ else if ($action == 'setmod')
|
|||
dolibarr_set_const($db, "COMMANDE_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
||||
elseif ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft = GETPOST("COMMANDE_DRAFT_WATERMARK");
|
||||
$res = dolibarr_set_const($db, "COMMANDE_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
|
|
@ -176,7 +176,7 @@ else if ($action == 'set_COMMANDE_DRAFT_WATERMARK')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'set_ORDER_FREE_TEXT')
|
||||
elseif ($action == 'set_ORDER_FREE_TEXT')
|
||||
{
|
||||
$freetext = GETPOST("ORDER_FREE_TEXT", 'none'); // No alpha here, we want exact string
|
||||
|
||||
|
|
@ -192,10 +192,8 @@ else if ($action == 'set_ORDER_FREE_TEXT')
|
|||
{
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Activate Set Shippable Icon In List
|
||||
else if ($action=="setshippableiconinlist") {
|
||||
} elseif ($action=="setshippableiconinlist") {
|
||||
// Activate Set Shippable Icon In List
|
||||
$setshippableiconinlist = GETPOST('value', 'int');
|
||||
$res = dolibarr_set_const($db, "SHIPPABLE_ORDER_ICON_IN_LIST", $setshippableiconinlist, 'yesno', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
|
|
@ -207,7 +205,7 @@ else if ($action=="setshippableiconinlist") {
|
|||
}
|
||||
|
||||
// Activate ask for payment bank
|
||||
else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
||||
elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
||||
{
|
||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
|
|
@ -224,7 +222,7 @@ else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_ORDER')
|
|||
}
|
||||
|
||||
// Activate ask for warehouse
|
||||
else if ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
|
||||
elseif ($action == 'set_WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER')
|
||||
{
|
||||
$res = dolibarr_set_const($db, "WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
|
|
|
|||
|
|
@ -136,9 +136,7 @@ if ( ($action == 'update' && ! GETPOST("cancel", 'alpha'))
|
|||
else dol_syslog($imgThumbMini);
|
||||
}
|
||||
else dol_syslog("ErrorImageFormatNotSupported", LOG_WARNING);
|
||||
}
|
||||
else if (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result))
|
||||
{
|
||||
} elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result)) {
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
$tmparray=explode(':', $result);
|
||||
|
|
@ -821,7 +819,7 @@ else
|
|||
{
|
||||
print '<a class="img_logo" href="'.$_SERVER["PHP_SELF"].'?action=addthumb&file='.urlencode($mysoc->logo).'">'.img_picto($langs->trans('GenerateThumb'), 'refresh').'</a> ';
|
||||
}
|
||||
else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
elseif ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||
{
|
||||
print '<img class="img_logo" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
|
||||
}
|
||||
|
|
@ -1097,11 +1095,11 @@ else
|
|||
{
|
||||
print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
|
||||
}
|
||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==1)
|
||||
elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==1)
|
||||
{
|
||||
print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
|
||||
}
|
||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){
|
||||
elseif($conf->global->MAIN_INFO_LOCALTAX_CALC1==2){
|
||||
print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
|
||||
}
|
||||
|
||||
|
|
@ -1151,11 +1149,11 @@ else
|
|||
{
|
||||
print $langs->trans("CalcLocaltax1").' - '.$langs->trans("CalcLocaltax1Desc");
|
||||
}
|
||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
|
||||
elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==1)
|
||||
{
|
||||
print $langs->trans("CalcLocaltax2").' - '.$langs->trans("CalcLocaltax2Desc");
|
||||
}
|
||||
else if($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
|
||||
elseif($conf->global->MAIN_INFO_LOCALTAX_CALC2==2)
|
||||
{
|
||||
print $langs->trans("CalcLocaltax3").' - '.$langs->trans("CalcLocaltax3Desc");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ if ($action == 'activate_delivery')
|
|||
header("Location: confexped.php");
|
||||
exit;
|
||||
}
|
||||
else if ($action == 'disable_delivery')
|
||||
elseif ($action == 'disable_delivery')
|
||||
{
|
||||
dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity);
|
||||
header("Location: confexped.php");
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ $sql.= ", entity";
|
|||
$sql.= " FROM ".MAIN_DB_PREFIX."const";
|
||||
$sql.= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
|
||||
if ((empty($user->entity) || $user->admin) && $debug) {} // to force for superadmin to debug
|
||||
else if (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
||||
elseif (! GETPOST('visible') || GETPOST('visible') != 'all') $sql.= " AND visible = 1"; // We must always have this. Otherwise, array is too large and submitting data fails due to apache POST or GET limits
|
||||
if (GETPOST('name')) $sql.=natural_search("name", GETPOST('name'));
|
||||
$sql.= " ORDER BY entity, name ASC";
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ if ($action == 'updateMask')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen') // For contract
|
||||
elseif ($action == 'specimen') // For contract
|
||||
{
|
||||
$modele= GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -115,12 +115,12 @@ else if ($action == 'specimen') // For contract
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -130,7 +130,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "CONTRACT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -147,7 +147,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
|
@ -155,7 +155,7 @@ else if ($action == 'setmod')
|
|||
dolibarr_set_const($db, "CONTRACT_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
else if ($action == 'set_other')
|
||||
elseif ($action == 'set_other')
|
||||
{
|
||||
$freetext= GETPOST('CONTRACT_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
||||
$res1 = dolibarr_set_const($db, "CONTRACT_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
|
|
|||
|
|
@ -728,7 +728,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||
if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') {
|
||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
||||
}
|
||||
else if ($value == 'entity') {
|
||||
elseif ($value == 'entity') {
|
||||
$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
|
|
@ -780,7 +780,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||
if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') {
|
||||
$_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]], 'MU');
|
||||
}
|
||||
else if ($field == 'entity') {
|
||||
elseif ($field == 'entity') {
|
||||
$_POST[$listfieldvalue[$i]] = getEntity($tabname[$id]);
|
||||
}
|
||||
if ($i) $sql.=",";
|
||||
|
|
@ -1125,7 +1125,7 @@ if ($id)
|
|||
{
|
||||
print '<td'.($class?' class="'.$class.'"':'').'>';
|
||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
||||
else if (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||
elseif (! empty($tabhelp[$id][$value])) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
|
||||
else print $valuetoshow;
|
||||
print '</td>';
|
||||
}
|
||||
|
|
@ -1409,14 +1409,14 @@ if ($id)
|
|||
{
|
||||
$valuetoshow = isset($elementList[$valuetoshow])?$elementList[$valuetoshow]:$valuetoshow;
|
||||
}
|
||||
else if ($value == 'source')
|
||||
elseif ($value == 'source')
|
||||
{
|
||||
$valuetoshow = isset($sourceList[$valuetoshow])?$sourceList[$valuetoshow]:$valuetoshow;
|
||||
}
|
||||
else if ($valuetoshow=='all') {
|
||||
elseif ($valuetoshow=='all') {
|
||||
$valuetoshow=$langs->trans('All');
|
||||
}
|
||||
else if ($fieldlist[$field]=='country') {
|
||||
elseif ($fieldlist[$field]=='country') {
|
||||
if (empty($obj->country_code))
|
||||
{
|
||||
$valuetoshow='-';
|
||||
|
|
@ -1427,143 +1427,140 @@ if ($id)
|
|||
$valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->country);
|
||||
}
|
||||
}
|
||||
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
||||
elseif ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
|
||||
$valuetoshow=yn($valuetoshow);
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='type_cdr') {
|
||||
elseif ($fieldlist[$field]=='type_cdr') {
|
||||
if(empty($valuetoshow)) $valuetoshow = $langs->trans('None');
|
||||
elseif($valuetoshow == 1) $valuetoshow = $langs->trans('AtEndOfMonth');
|
||||
elseif($valuetoshow == 2) $valuetoshow = $langs->trans('CurrentNext');
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='price' || preg_match('/^amount/i', $fieldlist[$field])) {
|
||||
} elseif ($fieldlist[$field]=='price' || preg_match('/^amount/i', $fieldlist[$field])) {
|
||||
$valuetoshow=price($valuetoshow);
|
||||
}
|
||||
if ($value == 'private')
|
||||
{
|
||||
$valuetoshow = yn($elementList[$valuetoshow]);
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle_facture') {
|
||||
elseif ($fieldlist[$field]=='libelle_facture') {
|
||||
$langs->load("bills");
|
||||
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
$valuetoshow=nl2br($valuetoshow);
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
|
||||
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
|
||||
$key=$langs->trans("Country".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
||||
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_availability') {
|
||||
$langs->load("propal");
|
||||
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
|
||||
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_actioncomm') {
|
||||
$key=$langs->trans("Action".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
|
||||
elseif (! empty($obj->code_iso) && $fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_currencies') {
|
||||
$key=$langs->trans("Currency".strtoupper($obj->code_iso));
|
||||
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') {
|
||||
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_typent') {
|
||||
$key=$langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') {
|
||||
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_prospectlevel') {
|
||||
$key=$langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow=($key != strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
|
||||
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_civility') {
|
||||
$key=$langs->trans("Civility".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
|
||||
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_type_contact') {
|
||||
$langs->load('agenda');
|
||||
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
|
||||
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_payment_term') {
|
||||
$langs->load("bills");
|
||||
$key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
|
||||
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paiement') {
|
||||
$langs->load("bills");
|
||||
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
|
||||
elseif ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_reason') {
|
||||
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
|
||||
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_input_method') {
|
||||
$langs->load("orders");
|
||||
$key=$langs->trans($obj->code);
|
||||
$valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->{$fieldlist[$field]};
|
||||
}
|
||||
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
|
||||
elseif ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_shipment_mode') {
|
||||
$langs->load("sendings");
|
||||
$key=$langs->trans("SendingMethod".strtoupper($obj->code));
|
||||
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code)?$key:$obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format')
|
||||
elseif ($fieldlist[$field] == 'libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_paper_format')
|
||||
{
|
||||
$key = $langs->trans('PaperFormat'.strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
|
||||
elseif ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
|
||||
{
|
||||
$langs->load('trips');
|
||||
$key = $langs->trans(strtoupper($obj->code));
|
||||
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||
elseif ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
|
||||
$showfield=0;
|
||||
}
|
||||
else if ($fieldlist[$field]=='unicode') {
|
||||
elseif ($fieldlist[$field]=='unicode') {
|
||||
$valuetoshow = $langs->getCurrencySymbol($obj->code, 1);
|
||||
}
|
||||
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||
elseif ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||
$langs->load("products");
|
||||
$valuetoshow=$langs->trans($obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||
elseif ($fieldlist[$field]=='short_label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_units') {
|
||||
$langs->load("products");
|
||||
$valuetoshow = $langs->trans($obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
|
||||
elseif (($fieldlist[$field] == 'unit') && ($tabname[$id] == MAIN_DB_PREFIX.'c_paper_format'))
|
||||
{
|
||||
$key = $langs->trans('SizeUnit'.strtolower($obj->unit));
|
||||
$valuetoshow = ($obj->code && $key != 'SizeUnit'.strtolower($obj->unit) ? $key : $obj->{$fieldlist[$field]});
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') {
|
||||
elseif ($fieldlist[$field]=='localtax1' || $fieldlist[$field]=='localtax2') {
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax1_type') {
|
||||
elseif ($fieldlist[$field]=='localtax1_type') {
|
||||
if ($obj->localtax1 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='localtax2_type') {
|
||||
elseif ($fieldlist[$field]=='localtax2_type') {
|
||||
if ($obj->localtax2 != 0)
|
||||
$valuetoshow=$localtax_typeList[$valuetoshow];
|
||||
else
|
||||
$valuetoshow = '';
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='taux') {
|
||||
elseif ($fieldlist[$field]=='taux') {
|
||||
$valuetoshow = price($valuetoshow, 0, $langs, 0, 0);
|
||||
$align="center";
|
||||
}
|
||||
else if (in_array($fieldlist[$field], array('recuperableonly')))
|
||||
{
|
||||
} elseif (in_array($fieldlist[$field], array('recuperableonly'))) {
|
||||
$align="center";
|
||||
}
|
||||
else if ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
|
||||
elseif ($fieldlist[$field]=='accountancy_code' || $fieldlist[$field]=='accountancy_code_sell' || $fieldlist[$field]=='accountancy_code_buy') {
|
||||
$valuetoshow = length_accountg($valuetoshow);
|
||||
}
|
||||
elseif ($fieldlist[$field] == 'fk_tva')
|
||||
|
|
@ -1600,12 +1597,15 @@ if ($id)
|
|||
}
|
||||
|
||||
// Can an entry be erased or disabled ?
|
||||
$iserasable=1;$canbedisabled=1;$canbemodified=1; // true by default
|
||||
// all true by default
|
||||
$iserasable=1;
|
||||
$canbedisabled=1;
|
||||
$canbemodified=1;
|
||||
if (isset($obj->code) && $id != 10)
|
||||
{
|
||||
if (($obj->code == '0' || $obj->code == '' || preg_match('/unknown/i', $obj->code))) { $iserasable = 0; $canbedisabled = 0; }
|
||||
else if ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
||||
else if ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
||||
elseif ($obj->code == 'RECEP') { $iserasable = 0; $canbedisabled = 0; }
|
||||
elseif ($obj->code == 'EF0') { $iserasable = 0; $canbedisabled = 0; }
|
||||
}
|
||||
|
||||
if (isset($obj->type) && in_array($obj->type, array('system', 'systemauto'))) { $iserasable=0; }
|
||||
|
|
@ -1639,8 +1639,8 @@ if ($id)
|
|||
else
|
||||
{
|
||||
if (in_array($obj->code, array('AC_OTH','AC_OTH_AUTO'))) print $langs->trans("AlwaysActive");
|
||||
else if (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
|
||||
else if (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
|
||||
elseif (isset($obj->type) && in_array($obj->type, array('systemauto')) && empty($obj->active)) print $langs->trans("Deprecated");
|
||||
elseif (isset($obj->type) && in_array($obj->type, array('system')) && ! empty($obj->active) && $obj->code != 'AC_OTH') print $langs->trans("UsedOnlyWithTypeOption");
|
||||
else print $langs->trans("AlwaysActive");
|
||||
}
|
||||
print "</td>";
|
||||
|
|
@ -1755,7 +1755,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return string '' or value of entity into table
|
||||
*/
|
||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
{
|
||||
global $conf,$langs,$db,$mysoc;
|
||||
global $form;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,6 @@ try {
|
|||
// Here we are dealing with errors
|
||||
$trace = $e->getTrace();
|
||||
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
||||
else if ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||
else die('Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class Dolistore
|
|||
*
|
||||
* @param boolean $debug Enable debug of request on screen
|
||||
*/
|
||||
function __construct($debug=false)
|
||||
function __construct($debug = false)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ class Dolistore
|
|||
// Here we are dealing with errors
|
||||
$trace = $e->getTrace();
|
||||
if ($trace[0]['args'][0] == 404) die('Bad ID');
|
||||
else if ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||
elseif ($trace[0]['args'][0] == 401) die('Bad auth key');
|
||||
else
|
||||
{
|
||||
print 'Can not access to '.$conf->global->MAIN_MODULE_DOLISTORE_API_SRV.'<br>';
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ else
|
|||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
}
|
||||
else if(! empty($conf->global->USER_MAIL_REQUIRED))
|
||||
elseif(! empty($conf->global->USER_MAIL_REQUIRED))
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_ECM_AUTO_TREE_ENABLED">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ if ($action == 'updateMask')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'set_param')
|
||||
elseif ($action == 'set_param')
|
||||
{
|
||||
$freetext=GETPOST('SHIPPING_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
||||
$res = dolibarr_set_const($db, "SHIPPING_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
|
@ -98,7 +98,7 @@ else if ($action == 'set_param')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen')
|
||||
elseif ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -144,12 +144,12 @@ else if ($action == 'specimen')
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -159,7 +159,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "EXPEDITION_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -176,7 +176,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmodel')
|
||||
elseif ($action == 'setmodel')
|
||||
{
|
||||
dolibarr_set_const($db, "EXPEDITION_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ if ($action == 'updateMask')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen') // For fiche inter
|
||||
elseif ($action == 'specimen') // For fiche inter
|
||||
{
|
||||
$modele= GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ else if ($action == 'specimen') // For fiche inter
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
if ($ret > 0 && empty($conf->global->EXPENSEREPORT_ADDON_PDF))
|
||||
|
|
@ -127,7 +127,7 @@ else if ($action == 'set')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -137,7 +137,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "EXPENSEREPORT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -154,7 +154,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
|
@ -162,7 +162,7 @@ else if ($action == 'setmod')
|
|||
dolibarr_set_const($db, "EXPENSEREPORT_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
else if ($action == 'setoptions')
|
||||
elseif ($action == 'setoptions')
|
||||
{
|
||||
$db->begin();
|
||||
|
||||
|
|
|
|||
|
|
@ -124,12 +124,12 @@ if ($action == 'specimen')
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -139,7 +139,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "FACTURE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -156,7 +156,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ else
|
|||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=activate_'.strtolower($const).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
}
|
||||
else if ($value == 1)
|
||||
elseif ($value == 1)
|
||||
{
|
||||
print '<a href="'.$_SERVER['PHP_SELF'].'?action=disable_'.strtolower($const).'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ if ($action == 'updateMask')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen') // For fiche inter
|
||||
elseif ($action == 'specimen') // For fiche inter
|
||||
{
|
||||
$modele= GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -116,12 +116,12 @@ else if ($action == 'specimen') // For fiche inter
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -131,7 +131,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -148,7 +148,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
|
@ -156,7 +156,7 @@ else if ($action == 'setmod')
|
|||
dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
else if ($action == 'set_FICHINTER_FREE_TEXT')
|
||||
elseif ($action == 'set_FICHINTER_FREE_TEXT')
|
||||
{
|
||||
$freetext= GETPOST('FICHINTER_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
||||
$res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
|
@ -173,7 +173,7 @@ else if ($action == 'set_FICHINTER_FREE_TEXT')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
||||
elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK')
|
||||
{
|
||||
$draft= GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha');
|
||||
$res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ if ($action == 'updateMask')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen') // For contract
|
||||
elseif ($action == 'specimen') // For contract
|
||||
{
|
||||
$modele= GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -117,12 +117,12 @@ else if ($action == 'specimen') // For contract
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -132,7 +132,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "HOLIDAY_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -149,7 +149,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
|
@ -157,7 +157,7 @@ else if ($action == 'setmod')
|
|||
dolibarr_set_const($db, "HOLIDAY_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
else if ($action == 'set_other')
|
||||
elseif ($action == 'set_other')
|
||||
{
|
||||
$freetext= GETPOST('HOLIDAY_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
||||
$res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ if ($action == 'update')
|
|||
{
|
||||
dolibarr_set_const($db, "MAIN_LOGIN_BACKGROUND", $original_file, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
else if (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result))
|
||||
elseif (preg_match('/^ErrorFileIsInfectedWithAVirus/', $result))
|
||||
{
|
||||
$error++;
|
||||
$langs->load("errors");
|
||||
|
|
|
|||
|
|
@ -673,11 +673,11 @@ else
|
|||
{
|
||||
print $langs->trans('RobotEmail');
|
||||
}
|
||||
else if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
|
||||
elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'user')
|
||||
{
|
||||
print $langs->trans('UserEmail');
|
||||
}
|
||||
else if ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
|
||||
elseif ($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE === 'company')
|
||||
{
|
||||
print $langs->trans('CompanyEmail').' '.dol_escape_htmltag('<'.$mysoc->email.'>');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ foreach ($fieldlist as $field => $value)
|
|||
{
|
||||
print '<td align="'.$align.'">';
|
||||
if (! empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
|
||||
else if (! empty($tabhelp[$id][$value]))
|
||||
elseif (! empty($tabhelp[$id][$value]))
|
||||
{
|
||||
if (in_array($value, array('topic'))) print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click
|
||||
else print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2); // Tooltip on hover
|
||||
|
|
@ -552,7 +552,7 @@ foreach ($fieldsforcontent as $tmpfieldlist)
|
|||
if ($tmpfieldlist == 'topic') {
|
||||
print '<input type="text" class="flat minwidth500" name="'.$tmpfieldlist.'" value="' . (! empty($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '') . '">';
|
||||
}
|
||||
else if ($tmpfieldlist == 'joinfiles') {
|
||||
elseif ($tmpfieldlist == 'joinfiles') {
|
||||
print '<input type="text" class="flat maxwidth50" name="'.$tmpfieldlist.'" value="' . (isset($obj->{$tmpfieldlist}) ? $obj->{$tmpfieldlist} : '1') . '">';
|
||||
}
|
||||
else
|
||||
|
|
@ -947,7 +947,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldList($fieldlist, $obj='', $tabname='', $context='')
|
||||
function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
{
|
||||
global $conf, $langs, $user, $db;
|
||||
global $form;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ if ($action == 'activate_hidemenu')
|
|||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else if ($action == 'disable_hidemenu')
|
||||
elseif ($action == 'disable_hidemenu')
|
||||
{
|
||||
dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", $conf->entity);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
|
|
|
|||
|
|
@ -142,6 +142,12 @@ if ($action=='install')
|
|||
setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules", $original_file, 'module_*-x.y*.zip'), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if (empty($_FILES['fileinstall']['tmp_name']))
|
||||
{
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorFileNotUploaded"), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
|
|
@ -152,7 +158,7 @@ if ($action=='install')
|
|||
dol_mkdir($conf->admin->dir_temp.'/'.$original_file);
|
||||
}
|
||||
|
||||
$tmpdir=preg_replace('/\.zip$/', '', $original_file).'.dir';
|
||||
$tmpdir=preg_replace('/\.zip$/i', '', $original_file).'.dir';
|
||||
if ($tmpdir)
|
||||
{
|
||||
@dol_delete_dir_recursive($conf->admin->dir_temp.'/'.$tmpdir);
|
||||
|
|
@ -207,6 +213,7 @@ if ($action=='install')
|
|||
}
|
||||
else
|
||||
{
|
||||
setEventMessages($langs->trans("ErrorFailToRenameFile", $_FILES['fileinstall']['tmp_name'], $newfile), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
|
@ -244,7 +251,7 @@ if ($action == 'set' && $user->admin)
|
|||
header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
|
||||
exit;
|
||||
}
|
||||
else if ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes')
|
||||
elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$result=unActivateModule($value);
|
||||
if ($result) setEventMessages($result, null, 'errors');
|
||||
|
|
@ -698,7 +705,7 @@ if ($mode == 'common')
|
|||
{
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
else if (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
||||
elseif (! empty($objMod->always_enabled) || ((! empty($conf->multicompany->enabled) && $objMod->core_enabled) && ($user->entity || $conf->entity!=1)))
|
||||
{
|
||||
if (method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) print $langs->trans("Used");
|
||||
else {
|
||||
|
|
@ -761,7 +768,7 @@ if ($mode == 'common')
|
|||
}
|
||||
print "</td>\n";
|
||||
}
|
||||
else if (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url, $regs))
|
||||
elseif (preg_match('/^([^@]+)@([^@]+)$/i', $objMod->config_page_url,$regs))
|
||||
{
|
||||
print '<td class="tdsetuppicto right valignmiddle" width="60px"><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: 6px"').'</a></td>';
|
||||
}
|
||||
|
|
@ -783,7 +790,7 @@ if ($mode == 'common')
|
|||
{
|
||||
// Should never happened
|
||||
}
|
||||
else if (! empty($objMod->disabled))
|
||||
elseif (! empty($objMod->disabled))
|
||||
{
|
||||
print $langs->trans("Disabled");
|
||||
}
|
||||
|
|
@ -1012,6 +1019,7 @@ if ($mode == 'deploy')
|
|||
print '<br>';
|
||||
|
||||
print '<form enctype="multipart/form-data" method="POST" class="noborder" action="'.$_SERVER["PHP_SELF"].'" name="forminstall">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="install">';
|
||||
print '<input type="hidden" name="mode" value="deploy">';
|
||||
|
||||
|
|
@ -1047,6 +1055,20 @@ if ($mode == 'deploy')
|
|||
|
||||
print '<input type="submit" name="send" value="'.dol_escape_htmltag($langs->trans("Send")).'" class="button">';
|
||||
|
||||
if (! empty($conf->global->MAIN_UPLOAD_DOC))
|
||||
{
|
||||
if ($user->admin)
|
||||
{
|
||||
$langs->load('other');
|
||||
print ' ';
|
||||
print info_admin($langs->trans("ThisLimitIsDefinedInSetup",$max,$maxphp),1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ('.$langs->trans("UploadDisabled").')';
|
||||
}
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||
$newval=GETPOST($shortkey.'_key');
|
||||
//print $newkey.' - '.$newval.'<br>';
|
||||
}
|
||||
else if (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg))
|
||||
elseif (preg_match('/^NOTIF_(.*)_new_key/', $key, $reg))
|
||||
{
|
||||
// Add a new entry
|
||||
$newkey='NOTIFICATION_FIXEDEMAIL_'.$reg[1].'_THRESHOLD_HIGHER_'.((int) GETPOST($shortkey.'_amount'));
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ if ($action == 'activate_pdfsecurity')
|
|||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
exit;
|
||||
}
|
||||
else if ($action == 'disable_pdfsecurity')
|
||||
elseif ($action == 'disable_pdfsecurity')
|
||||
{
|
||||
dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION", $conf->entity);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
|
|
|
|||
|
|
@ -96,9 +96,7 @@ if ($action == "set")
|
|||
{
|
||||
$res = dolibarr_set_const($db, "PRELEVEMENT_ADDDAYS", GETPOST("PRELEVEMENT_ADDDAYS"), 'chaine', 0, '', $conf->entity);
|
||||
if (! $res > 0) $error++;
|
||||
} else
|
||||
|
||||
if (! $error)
|
||||
} elseif (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ if ($action == 'set')
|
|||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -197,7 +197,7 @@ else if ($action == 'del')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "PROPALE_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -212,7 +212,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ if ($action == 'updateMask')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'set_param')
|
||||
elseif ($action == 'set_param')
|
||||
{
|
||||
$freetext=GETPOST('RECEPTION_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
||||
$res = dolibarr_set_const($db, "RECEPTION_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
|
||||
|
|
@ -104,7 +104,7 @@ else if ($action == 'set_param')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen')
|
||||
elseif ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -150,12 +150,12 @@ else if ($action == 'specimen')
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -165,7 +165,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "RECEPTION_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -182,7 +182,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmodel')
|
||||
elseif ($action == 'setmodel')
|
||||
{
|
||||
dolibarr_set_const($db, "RECEPTION_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ if ($action == 'activate_encrypt')
|
|||
dol_print_error($db, '');
|
||||
}
|
||||
}
|
||||
else if ($action == 'disable_encrypt')
|
||||
elseif ($action == 'disable_encrypt')
|
||||
{
|
||||
//On n'autorise pas l'annulation de l'encryption car les mots de passe ne peuvent pas etre decodes
|
||||
//Do not allow "disable encryption" as passwords cannot be decrypted
|
||||
|
|
@ -137,7 +137,7 @@ if ($action == 'activate_encryptdbpassconf')
|
|||
setEventMessages($langs->trans('InstrucToEncodePass', dol_encode($dolibarr_main_db_pass)), null, 'warnings');
|
||||
}
|
||||
}
|
||||
else if ($action == 'disable_encryptdbpassconf')
|
||||
elseif ($action == 'disable_encryptdbpassconf')
|
||||
{
|
||||
$result = encodedecode_dbpassconf(0);
|
||||
if ($result > 0)
|
||||
|
|
@ -161,7 +161,7 @@ if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK')
|
|||
header("Location: security.php");
|
||||
exit;
|
||||
}
|
||||
else if ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
|
||||
elseif ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK')
|
||||
{
|
||||
dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", $conf->entity);
|
||||
header("Location: security.php");
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ if ($action == 'updateform')
|
|||
|
||||
|
||||
// Delete file
|
||||
else if ($action == 'delete')
|
||||
elseif ($action == 'delete')
|
||||
{
|
||||
$langs->load("other");
|
||||
$file = $conf->admin->dir_temp . '/' . GETPOST('urlfile', 'alpha'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
|
||||
|
|
|
|||
|
|
@ -55,10 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg))
|
|||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
else if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
|
||||
{
|
||||
} elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
|
||||
$code=$reg[1];
|
||||
if (dolibarr_del_const($db, $code, $conf->entity) > 0)
|
||||
{
|
||||
|
|
@ -71,7 +68,7 @@ else if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg))
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'updateform')
|
||||
elseif ($action == 'updateform')
|
||||
{
|
||||
$res1=dolibarr_set_const($db, "MAIN_APPLICATION_TITLE", $_POST["MAIN_APPLICATION_TITLE"], 'chaine', 0, '', $conf->entity);
|
||||
$res2=dolibarr_set_const($db, "MAIN_SESSION_TIMEOUT", $_POST["MAIN_SESSION_TIMEOUT"], 'chaine', 0, '', $conf->entity);
|
||||
|
|
|
|||
|
|
@ -122,12 +122,12 @@ if ($action == 'specimen') // For invoices
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -137,7 +137,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -153,7 +153,7 @@ else if ($action == 'setdoc')
|
|||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
}
|
||||
else if ($action == 'unsetdoc')
|
||||
elseif ($action == 'unsetdoc')
|
||||
{
|
||||
dolibarr_del_const($db, "INVOICE_SUPPLIER_ADDON_PDF", $conf->entity);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if ($action == 'updateMask')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen') // For orders
|
||||
elseif ($action == 'specimen') // For orders
|
||||
{
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
|
|
@ -120,12 +120,12 @@ else if ($action == 'specimen') // For orders
|
|||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -135,7 +135,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -152,7 +152,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
|
@ -160,13 +160,13 @@ else if ($action == 'setmod')
|
|||
dolibarr_set_const($db, "COMMANDE_SUPPLIER_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
else if ($action == 'addcat')
|
||||
elseif ($action == 'addcat')
|
||||
{
|
||||
$fourn = new Fournisseur($db);
|
||||
$fourn->CreateCategory($user, $_POST["cat"]);
|
||||
}
|
||||
|
||||
else if ($action == 'set_SUPPLIER_ORDER_OTHER')
|
||||
elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
|
||||
{
|
||||
$freetext = GETPOST('SUPPLIER_ORDER_FREE_TEXT', 'none'); // No alpha here, we want exact string
|
||||
$doubleapproval = GETPOST('SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED', 'alpha');
|
||||
|
|
@ -206,7 +206,7 @@ else if ($action == 'set_SUPPLIER_ORDER_OTHER')
|
|||
}
|
||||
|
||||
// Activate ask for payment bank
|
||||
else if ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
|
||||
elseif ($action == 'set_BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER')
|
||||
{
|
||||
$res = dolibarr_set_const($db, "BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_ORDER", $value, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
|
|
|
|||
|
|
@ -61,18 +61,18 @@ if ($action == 'updateMask')
|
|||
{
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}else if ($action == 'setmod')
|
||||
}elseif ($action == 'setmod')
|
||||
{
|
||||
dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON", $value, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
// Activate a model
|
||||
else if ($action == 'set')
|
||||
elseif ($action == 'set')
|
||||
{
|
||||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -82,7 +82,7 @@ else if ($action == 'del')
|
|||
}
|
||||
|
||||
// Set default model
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "SUPPLIER_PAYMENT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -99,7 +99,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'specimen')
|
||||
elseif ($action == 'specimen')
|
||||
{
|
||||
$modele=GETPOST('module', 'alpha');
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ if ($action == 'set')
|
|||
$ret = addDocumentModel($value, $type, $label, $scandir);
|
||||
}
|
||||
|
||||
else if ($action == 'del')
|
||||
elseif ($action == 'del')
|
||||
{
|
||||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0)
|
||||
|
|
@ -178,7 +178,7 @@ else if ($action == 'del')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setdoc')
|
||||
elseif ($action == 'setdoc')
|
||||
{
|
||||
if (dolibarr_set_const($db, "SUPPLIER_PROPOSAL_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
|
||||
{
|
||||
|
|
@ -193,7 +193,7 @@ else if ($action == 'setdoc')
|
|||
}
|
||||
}
|
||||
|
||||
else if ($action == 'setmod')
|
||||
elseif ($action == 'setmod')
|
||||
{
|
||||
// TODO Verifier si module numerotation choisi peut etre active
|
||||
// par appel methode canBeActivated
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ foreach ($syslogModules as $moduleName)
|
|||
if (! empty($tmpoption))
|
||||
{
|
||||
if (isset($_POST[$tmpoption])) $value=$_POST[$tmpoption];
|
||||
else if (! empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
|
||||
elseif (! empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
|
||||
}
|
||||
else $value = (isset($option['default']) ? $option['default'] : '');
|
||||
|
||||
|
|
|
|||
|
|
@ -182,8 +182,8 @@ foreach($configfileparameters as $key)
|
|||
print '<td>'.$newkey.'</td>';
|
||||
// Value
|
||||
print "<td>";
|
||||
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i', '*', ${$newkey});
|
||||
else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i','*', ${$newkey});
|
||||
elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||
else print ${$newkey};
|
||||
if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
|
||||
print "</td>";
|
||||
|
|
|
|||
|
|
@ -56,17 +56,17 @@ if (preg_match('/mysql/i', $conf->db->type))
|
|||
$sql = "SHOW TABLE STATUS";
|
||||
$base=1;
|
||||
}
|
||||
else if ($conf->db->type == 'pgsql')
|
||||
elseif ($conf->db->type == 'pgsql')
|
||||
{
|
||||
$sql = "SELECT conname, contype FROM pg_constraint;";
|
||||
$base=2;
|
||||
}
|
||||
else if ($conf->db->type == 'mssql')
|
||||
elseif ($conf->db->type == 'mssql')
|
||||
{
|
||||
//$sqls[0] = "";
|
||||
//$base=3;
|
||||
}
|
||||
else if ($conf->db->type == 'sqlite' || $conf->db->type == 'sqlite3')
|
||||
elseif ($conf->db->type == 'sqlite' || $conf->db->type == 'sqlite3')
|
||||
{
|
||||
//$sql = "SELECT name, type FROM sqlite_master";
|
||||
$base = 4;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ if (preg_match('/mysql/i', $conf->db->type))
|
|||
$sql = "SHOW TABLE STATUS LIKE '".$db->escape($table)."'";
|
||||
$base=1;
|
||||
}
|
||||
else if ($conf->db->type == 'pgsql')
|
||||
elseif ($conf->db->type == 'pgsql')
|
||||
{
|
||||
$sql = "SELECT conname,contype FROM pg_constraint";
|
||||
$base=2;
|
||||
|
|
|
|||
|
|
@ -374,8 +374,8 @@ foreach($configfileparameters as $key => $value)
|
|||
// Value
|
||||
print "<td>";
|
||||
if ($newkey == 'dolibarr_main_db_pass') print preg_replace('/./i', '*', ${$newkey});
|
||||
else if ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||
else if ($newkey == 'dolibarr_main_document_root_alt')
|
||||
elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||
elseif ($newkey == 'dolibarr_main_document_root_alt')
|
||||
{
|
||||
$tmparray=explode(',', ${$newkey});
|
||||
$i=0;
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ print '<tr '.$bc[false].'><td style="padding-left: 8px">';
|
|||
</div>
|
||||
<?php
|
||||
}
|
||||
else if (in_array($type, array('pgsql')))
|
||||
elseif (in_array($type, array('pgsql')))
|
||||
{
|
||||
?>
|
||||
<div class="formelementrow"><input type="radio" name="what" value="postgresql" id="radio_dump_postgresql" />
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ print $langs->trans("RestoreDesc3", $dolibarr_main_db_name).'<br><br>';
|
|||
</div>
|
||||
<?php
|
||||
}
|
||||
else if (in_array($type, array('pgsql')))
|
||||
elseif (in_array($type, array('pgsql')))
|
||||
{
|
||||
?>
|
||||
<div class="formelementrow">
|
||||
|
|
@ -164,7 +164,7 @@ if (in_array($type, array('mysql', 'mysqli')))
|
|||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
else if (in_array($type, array('pgsql')))
|
||||
elseif (in_array($type, array('pgsql')))
|
||||
{
|
||||
?>
|
||||
<fieldset id="postgresql_options">
|
||||
|
|
|
|||
|
|
@ -48,17 +48,17 @@ if (isset($_POST['caching'])) {
|
|||
} else {
|
||||
eaccelerator_caching(true);
|
||||
}
|
||||
} else if (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
|
||||
} elseif (isset($_POST['optimizer']) && function_exists('eaccelerator_optimizer')) {
|
||||
if ($info['optimizer']) {
|
||||
eaccelerator_optimizer(false);
|
||||
} else {
|
||||
eaccelerator_optimizer(true);
|
||||
}
|
||||
} else if (isset($_POST['clear'])) {
|
||||
} elseif (isset($_POST['clear'])) {
|
||||
eaccelerator_clear();
|
||||
} else if (isset($_POST['clean'])) {
|
||||
} elseif (isset($_POST['clean'])) {
|
||||
eaccelerator_clean();
|
||||
} else if (isset($_POST['purge'])) {
|
||||
} elseif (isset($_POST['purge'])) {
|
||||
eaccelerator_purge();
|
||||
}
|
||||
$info = eaccelerator_info();
|
||||
|
|
@ -81,7 +81,7 @@ function compare($x, $y)
|
|||
|
||||
if ( $x[$sortby] == $y[$sortby] ) {
|
||||
return 0;
|
||||
} else if ($x[$sortby] < $y[$sortby]) {
|
||||
} elseif ($x[$sortby] < $y[$sortby]) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
|
|
@ -101,7 +101,7 @@ function revcompare($x, $y)
|
|||
|
||||
if ($x[$sortby] == $y[$sortby]) {
|
||||
return 0;
|
||||
} else if ($x[$sortby] < $y[$sortby]) {
|
||||
} elseif ($x[$sortby] < $y[$sortby]) {
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ if ($action == 'purge')
|
|||
$formquestion=array();
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'), 'confirm_purge', $formquestion, 'no', 2);
|
||||
}
|
||||
else if ($action == 'lock')
|
||||
elseif ($action == 'lock')
|
||||
{
|
||||
$formquestion=array();
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions', $user->login), 'confirm_lock', $formquestion, 'no', 1);
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ if ($mode == 'searchkey')
|
|||
$htmltext = $langs->trans("OriginalValueWas", $newlangfileonly->tab_translate[$key]);
|
||||
print $form->textwithpicto('', $htmltext, 1, 'info');
|
||||
}
|
||||
else if (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
|
||||
elseif (!empty($conf->global->MAIN_ENABLE_OVERWRITE_TRANSLATION))
|
||||
{
|
||||
//print $key.'-'.$val;
|
||||
print '<a href="' . $_SERVER['PHP_SELF'] . '?mode=overwrite&langcode=' . $langcode . '&transkey=' . $key . '">' . img_edit_add($langs->trans("Overwrite")) . '</a>';
|
||||
|
|
|
|||
|
|
@ -659,7 +659,7 @@ $db->close();
|
|||
* @param string $context 'add'=Output field for the "add form", 'edit'=Output field for the "edit form", 'hide'=Output field for the "add form" but we dont want it to be rendered
|
||||
* @return void
|
||||
*/
|
||||
function fieldListWebsites($fieldlist, $obj='', $tabname='', $context='')
|
||||
function fieldListWebsites($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
{
|
||||
global $conf,$langs,$db;
|
||||
global $form;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class DolibarrApi
|
|||
* @param string $cachedir Cache dir
|
||||
* @param boolean $refreshCache Update cache
|
||||
*/
|
||||
function __construct($db, $cachedir='', $refreshCache=false)
|
||||
function __construct($db, $cachedir = '', $refreshCache = false)
|
||||
{
|
||||
global $conf, $dolibarr_main_url_root;
|
||||
|
||||
|
|
@ -222,7 +222,7 @@ class DolibarrApi
|
|||
* @return bool
|
||||
* @throws RestException
|
||||
*/
|
||||
static function _checkAccessToResource($resource, $resource_id=0, $dbtablename='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid')
|
||||
static function _checkAccessToResource($resource, $resource_id = 0, $dbtablename = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid')
|
||||
{
|
||||
|
||||
// Features/modules to check
|
||||
|
|
@ -230,7 +230,7 @@ class DolibarrApi
|
|||
if (preg_match('/&/', $resource)) {
|
||||
$featuresarray = explode("&", $resource);
|
||||
}
|
||||
else if (preg_match('/\|/', $resource)) {
|
||||
elseif (preg_match('/\|/', $resource)) {
|
||||
$featuresarray = explode("|", $resource);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class Login
|
|||
* @url GET /
|
||||
* @url POST /
|
||||
*/
|
||||
public function index($login, $password, $entity='', $reset=0)
|
||||
public function index($login, $password, $entity = '', $reset = 0)
|
||||
{
|
||||
|
||||
global $conf, $dolibarr_main_authentication, $dolibarr_auto_user;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ class Setup extends DolibarrApi
|
|||
if ($country->fetch($id) < 0) {
|
||||
throw new RestException(503, 'Error when retrieving country : '.$country->error);
|
||||
}
|
||||
else if ($country->fetch($id) == 0) {
|
||||
elseif ($country->fetch($id) == 0) {
|
||||
throw new RestException(404, 'country not found');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ class Asset extends CommonObject
|
|||
* @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
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
|
||||
function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||
{
|
||||
global $db, $conf, $langs;
|
||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||
|
|
@ -369,7 +369,7 @@ class Asset extends CommonObject
|
|||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||
* @return string Label of status
|
||||
*/
|
||||
function getLibStatut($mode=0)
|
||||
function getLibStatut($mode = 0)
|
||||
{
|
||||
return $this->LibStatut($this->status, $mode);
|
||||
}
|
||||
|
|
@ -382,7 +382,7 @@ class Asset extends CommonObject
|
|||
* @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
|
||||
*/
|
||||
static function LibStatut($status,$mode=0)
|
||||
static function LibStatut($status, $mode = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class AssetType extends CommonObject
|
|||
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
||||
* @return int >0 if OK, < 0 if KO
|
||||
*/
|
||||
function create($user,$notrigger=0)
|
||||
function create($user, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -166,7 +166,7 @@ class AssetType extends CommonObject
|
|||
* @param int $notrigger 1=do not execute triggers, 0 otherwise
|
||||
* @return int >0 if OK, < 0 if KO
|
||||
*/
|
||||
function update($user,$notrigger=0)
|
||||
function update($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $hookmanager;
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ class AssetType extends CommonObject
|
|||
* 2=Return array of asset id only
|
||||
* @return mixed Array of asset or -1 on error
|
||||
*/
|
||||
function listAssetForAssetType($excludefilter='', $mode=0)
|
||||
function listAssetForAssetType($excludefilter = '', $mode = 0)
|
||||
{
|
||||
global $conf, $user;
|
||||
|
||||
|
|
@ -405,7 +405,7 @@ class AssetType extends CommonObject
|
|||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $maxlen=0, $notooltip=0)
|
||||
function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
|
|
|||
|
|
@ -104,9 +104,7 @@ if ($action === 'downloadblockchain') {
|
|||
echo $bc;
|
||||
|
||||
exit;
|
||||
}
|
||||
else if (GETPOST('downloadcsv', 'alpha'))
|
||||
{
|
||||
} elseif (GETPOST('downloadcsv', 'alpha')) {
|
||||
$error = 0;
|
||||
|
||||
$previoushash='';
|
||||
|
|
@ -608,4 +606,4 @@ print '<br><br>';
|
|||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
$db->close();
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ class BlockedLogAuthority
|
|||
* @param string $signature Signature of object to load
|
||||
* @return int >0 if OK, <0 if KO, 0 if not found
|
||||
*/
|
||||
public function fetch($id, $signature='')
|
||||
public function fetch($id, $signature = '')
|
||||
{
|
||||
|
||||
global $langs;
|
||||
|
|
@ -161,7 +161,7 @@ class BlockedLogAuthority
|
|||
$sql.= " FROM ".MAIN_DB_PREFIX."blockedlog_authority as b";
|
||||
|
||||
if ($id) $sql.= " WHERE b.rowid = ". $id;
|
||||
else if($signature)$sql.= " WHERE b.signature = '". $this->db->escape( $signature ) ."'" ;
|
||||
elseif($signature)$sql.= " WHERE b.signature = '". $this->db->escape( $signature ) ."'" ;
|
||||
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ class BlockedLog
|
|||
$this->error++;
|
||||
}
|
||||
}
|
||||
else if($this->element === 'payment') {
|
||||
elseif($this->element === 'payment') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
|
||||
|
||||
$object = new Paiement($this->db);
|
||||
|
|
@ -219,7 +219,7 @@ class BlockedLog
|
|||
$this->error++;
|
||||
}
|
||||
}
|
||||
else if($this->element === 'payment_supplier') {
|
||||
elseif($this->element === 'payment_supplier') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/paiementfourn.class.php';
|
||||
|
||||
$object = new PaiementFourn($this->db);
|
||||
|
|
@ -230,7 +230,7 @@ class BlockedLog
|
|||
$this->error++;
|
||||
}
|
||||
}
|
||||
else if($this->element === 'payment_donation') {
|
||||
elseif($this->element === 'payment_donation') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/paymentdonation.class.php';
|
||||
|
||||
$object = new PaymentDonation($this->db);
|
||||
|
|
@ -241,7 +241,7 @@ class BlockedLog
|
|||
$this->error++;
|
||||
}
|
||||
}
|
||||
else if($this->element === 'payment_various') {
|
||||
elseif($this->element === 'payment_various') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
||||
|
||||
$object = new PaymentVarious($this->db);
|
||||
|
|
@ -252,7 +252,7 @@ class BlockedLog
|
|||
$this->error++;
|
||||
}
|
||||
}
|
||||
else if($this->element === 'don' || $this->element === 'donation') {
|
||||
elseif($this->element === 'don' || $this->element === 'donation') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
|
||||
|
||||
$object = new Don($this->db);
|
||||
|
|
@ -263,7 +263,7 @@ class BlockedLog
|
|||
$this->error++;
|
||||
}
|
||||
}
|
||||
else if($this->element === 'subscription') {
|
||||
elseif($this->element === 'subscription') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||
|
||||
$object = new Subscription($this->db);
|
||||
|
|
@ -274,7 +274,7 @@ class BlockedLog
|
|||
$this->error++;
|
||||
}
|
||||
}
|
||||
else if($this->element === 'cashcontrol') {
|
||||
elseif($this->element === 'cashcontrol') {
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/cashcontrol/class/cashcontrol.class.php';
|
||||
|
||||
$object = new CashControl($this->db);
|
||||
|
|
@ -285,11 +285,11 @@ class BlockedLog
|
|||
$this->error++;
|
||||
}
|
||||
}
|
||||
else if ($this->action == 'MODULE_SET')
|
||||
elseif ($this->action == 'MODULE_SET')
|
||||
{
|
||||
return '<i class="opacitymedium">System to track events into unalterable logs were enabled</i>';
|
||||
}
|
||||
else if ($this->action == 'MODULE_RESET')
|
||||
elseif ($this->action == 'MODULE_RESET')
|
||||
{
|
||||
if ($this->signature == '0000000000')
|
||||
{
|
||||
|
|
@ -469,7 +469,7 @@ class BlockedLog
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (!is_object($value)) $this->object_data->{$key} = $value;
|
||||
elseif (!is_object($value)) $this->object_data->{$key} = $value;
|
||||
}
|
||||
|
||||
if (! empty($object->newref)) $this->object_data->ref = $object->newref;
|
||||
|
|
@ -725,7 +725,7 @@ class BlockedLog
|
|||
* @param string $mode 0=unserialize, 1=json_decode
|
||||
* @return string Value unserialized
|
||||
*/
|
||||
public function dolDecodeBlockedData($data, $mode=0)
|
||||
public function dolDecodeBlockedData($data, $mode = 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -763,7 +763,7 @@ class BlockedLog
|
|||
* @param int $forcesignature Force signature (for example '0000000000' when we disabled the module)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function create($user, $forcesignature='')
|
||||
public function create($user, $forcesignature = '')
|
||||
{
|
||||
|
||||
global $conf,$langs,$hookmanager;
|
||||
|
|
@ -878,7 +878,7 @@ class BlockedLog
|
|||
* @param string $previoushash If previous signature hash is known, we can provide it to avoid to make a search of it in database.
|
||||
* @return boolean True if OK, False if KO
|
||||
*/
|
||||
public function checkSignature($previoushash='')
|
||||
public function checkSignature($previoushash = '')
|
||||
{
|
||||
if (empty($previoushash))
|
||||
{
|
||||
|
|
@ -921,7 +921,7 @@ class BlockedLog
|
|||
* @param int $beforeid ID of a record
|
||||
* @return string Hash of previous record (if beforeid is defined) or hash of last record (if beforeid is 0)
|
||||
*/
|
||||
public function getPreviousHash($withlock=0, $beforeid=0)
|
||||
public function getPreviousHash($withlock = 0, $beforeid = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -972,7 +972,7 @@ class BlockedLog
|
|||
* @param string $search_code search code
|
||||
* @return array|int Array of object log or <0 if error
|
||||
*/
|
||||
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref='', $search_amount='', $search_code='')
|
||||
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_fk_user = -1, $search_start = -1, $search_end = -1, $search_ref = '', $search_amount = '', $search_code = '')
|
||||
{
|
||||
global $conf, $cachedlogs;
|
||||
|
||||
|
|
@ -984,11 +984,11 @@ class BlockedLog
|
|||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
|
||||
WHERE entity=".$conf->entity;
|
||||
}
|
||||
else if ($element=='not_certified') {
|
||||
elseif ($element=='not_certified') {
|
||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
|
||||
WHERE entity=".$conf->entity." AND certified = 0";
|
||||
}
|
||||
else if ($element=='just_certified') {
|
||||
elseif ($element=='just_certified') {
|
||||
$sql="SELECT rowid FROM ".MAIN_DB_PREFIX."blockedlog
|
||||
WHERE entity=".$conf->entity." AND certified = 1";
|
||||
}
|
||||
|
|
@ -1070,7 +1070,7 @@ class BlockedLog
|
|||
* @param int $ignoresystem Ignore system events for the test
|
||||
* @return bool
|
||||
*/
|
||||
function alreadyUsed($ignoresystem=0)
|
||||
function alreadyUsed($ignoresystem = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
|
|||
|
|
@ -283,14 +283,14 @@ class Facturation
|
|||
* @param int $aId Id
|
||||
* @return id
|
||||
*/
|
||||
public function id($aId=null)
|
||||
public function id($aId = null)
|
||||
{
|
||||
|
||||
if ( !$aId )
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
else if ( $aId == 'RESET' )
|
||||
elseif ( $aId == 'RESET' )
|
||||
{
|
||||
|
||||
$this->id = null;
|
||||
|
|
@ -308,14 +308,14 @@ class Facturation
|
|||
* @param string $aRef Ref
|
||||
* @return string Ref
|
||||
*/
|
||||
public function ref($aRef=null)
|
||||
public function ref($aRef = null)
|
||||
{
|
||||
|
||||
if (is_null($aRef))
|
||||
{
|
||||
return $this->ref;
|
||||
}
|
||||
else if ( $aRef == 'RESET' )
|
||||
elseif ( $aRef == 'RESET' )
|
||||
{
|
||||
$this->ref = null;
|
||||
}
|
||||
|
|
@ -331,13 +331,13 @@ class Facturation
|
|||
* @param int $aQte Qty
|
||||
* @return int Qty
|
||||
*/
|
||||
public function qte($aQte=null)
|
||||
public function qte($aQte = null)
|
||||
{
|
||||
if (is_null($aQte))
|
||||
{
|
||||
return $this->qte;
|
||||
}
|
||||
else if ( $aQte == 'RESET' )
|
||||
elseif ( $aQte == 'RESET' )
|
||||
{
|
||||
|
||||
$this->qte = null;
|
||||
|
|
@ -354,14 +354,14 @@ class Facturation
|
|||
* @param string $aStock Stock
|
||||
* @return string Stock
|
||||
*/
|
||||
public function stock($aStock=null)
|
||||
public function stock($aStock = null)
|
||||
{
|
||||
|
||||
if (is_null($aStock))
|
||||
{
|
||||
return $this->stock;
|
||||
}
|
||||
else if ( $aStock == 'RESET' )
|
||||
elseif ( $aStock == 'RESET' )
|
||||
{
|
||||
$this->stock = null;
|
||||
}
|
||||
|
|
@ -377,14 +377,14 @@ class Facturation
|
|||
* @param string $aRemisePercent Discount
|
||||
* @return string Discount
|
||||
*/
|
||||
public function remisePercent($aRemisePercent=null)
|
||||
public function remisePercent($aRemisePercent = null)
|
||||
{
|
||||
|
||||
if (is_null($aRemisePercent))
|
||||
{
|
||||
return $this->remise_percent;
|
||||
}
|
||||
else if ($aRemisePercent == 'RESET')
|
||||
elseif ($aRemisePercent == 'RESET')
|
||||
{
|
||||
$this->remise_percent = null;
|
||||
}
|
||||
|
|
@ -400,13 +400,13 @@ class Facturation
|
|||
* @param int $aMontantRemise Amount
|
||||
* @return string Amount
|
||||
*/
|
||||
public function montantRemise($aMontantRemise=null)
|
||||
public function montantRemise($aMontantRemise = null)
|
||||
{
|
||||
|
||||
if (is_null($aMontantRemise)) {
|
||||
|
||||
return $this->montant_remise;
|
||||
} else if ( $aMontantRemise == 'RESET' ) {
|
||||
} elseif ( $aMontantRemise == 'RESET' ) {
|
||||
|
||||
$this->montant_remise = null;
|
||||
} else {
|
||||
|
|
@ -421,13 +421,13 @@ class Facturation
|
|||
* @param int $aPrix Price
|
||||
* @return string Stock
|
||||
*/
|
||||
public function prix($aPrix=null)
|
||||
public function prix($aPrix = null)
|
||||
{
|
||||
|
||||
if (is_null($aPrix)) {
|
||||
|
||||
return $this->prix;
|
||||
} else if ( $aPrix == 'RESET' ) {
|
||||
} elseif ( $aPrix == 'RESET' ) {
|
||||
|
||||
$this->prix = null;
|
||||
} else {
|
||||
|
|
@ -442,12 +442,12 @@ class Facturation
|
|||
* @param int $aTva Vat
|
||||
* @return int Vat
|
||||
*/
|
||||
public function tva($aTva=null)
|
||||
public function tva($aTva = null)
|
||||
{
|
||||
if (is_null($aTva)) {
|
||||
|
||||
return $this->tva;
|
||||
} else if ( $aTva == 'RESET' ) {
|
||||
} elseif ( $aTva == 'RESET' ) {
|
||||
|
||||
$this->tva = null;
|
||||
} else {
|
||||
|
|
@ -462,12 +462,12 @@ class Facturation
|
|||
* @param string $aNumFacture Invoice ref
|
||||
* @return string Invoice ref
|
||||
*/
|
||||
public function numInvoice($aNumFacture=null)
|
||||
public function numInvoice($aNumFacture = null)
|
||||
{
|
||||
if (is_null($aNumFacture)) {
|
||||
|
||||
return $this->num_facture;
|
||||
} else if ( $aNumFacture == 'RESET' ) {
|
||||
} elseif ( $aNumFacture == 'RESET' ) {
|
||||
|
||||
$this->num_facture = null;
|
||||
} else {
|
||||
|
|
@ -482,13 +482,13 @@ class Facturation
|
|||
* @param int $aModeReglement Payment mode
|
||||
* @return int Payment mode
|
||||
*/
|
||||
public function getSetPaymentMode($aModeReglement=null)
|
||||
public function getSetPaymentMode($aModeReglement = null)
|
||||
{
|
||||
|
||||
if (is_null($aModeReglement)) {
|
||||
|
||||
return $this->mode_reglement;
|
||||
} else if ( $aModeReglement == 'RESET' ) {
|
||||
} elseif ( $aModeReglement == 'RESET' ) {
|
||||
|
||||
$this->mode_reglement = null;
|
||||
} else {
|
||||
|
|
@ -503,13 +503,13 @@ class Facturation
|
|||
* @param int $aMontantEncaisse Amount
|
||||
* @return int Amount
|
||||
*/
|
||||
public function montantEncaisse($aMontantEncaisse=null)
|
||||
public function montantEncaisse($aMontantEncaisse = null)
|
||||
{
|
||||
|
||||
if (is_null($aMontantEncaisse)) {
|
||||
|
||||
return $this->montant_encaisse;
|
||||
} else if ( $aMontantEncaisse == 'RESET' ) {
|
||||
} elseif ( $aMontantEncaisse == 'RESET' ) {
|
||||
|
||||
$this->montant_encaisse = null;
|
||||
} else {
|
||||
|
|
@ -524,13 +524,13 @@ class Facturation
|
|||
* @param int $aMontantRendu Amount
|
||||
* @return int Amount
|
||||
*/
|
||||
public function montantRendu($aMontantRendu=null)
|
||||
public function montantRendu($aMontantRendu = null)
|
||||
{
|
||||
|
||||
if (is_null($aMontantRendu)) {
|
||||
|
||||
return $this->montant_rendu;
|
||||
} else if ( $aMontantRendu == 'RESET' ) {
|
||||
} elseif ( $aMontantRendu == 'RESET' ) {
|
||||
|
||||
$this->montant_rendu = null;
|
||||
} else {
|
||||
|
|
@ -545,12 +545,12 @@ class Facturation
|
|||
* @param date $aPaiementLe Date
|
||||
* @return date Date
|
||||
*/
|
||||
public function paiementLe($aPaiementLe=null)
|
||||
public function paiementLe($aPaiementLe = null)
|
||||
{
|
||||
if (is_null($aPaiementLe)) {
|
||||
|
||||
return $this->paiement_le;
|
||||
} else if ( $aPaiementLe == 'RESET' ) {
|
||||
} elseif ( $aPaiementLe == 'RESET' ) {
|
||||
|
||||
$this->paiement_le = null;
|
||||
} else {
|
||||
|
|
@ -565,12 +565,12 @@ class Facturation
|
|||
* @param int $aTotalHt Total amount
|
||||
* @return int Total amount
|
||||
*/
|
||||
public function prixTotalHt($aTotalHt=null)
|
||||
public function prixTotalHt($aTotalHt = null)
|
||||
{
|
||||
if (is_null($aTotalHt)) {
|
||||
|
||||
return $this->prix_total_ht;
|
||||
} else if ( $aTotalHt == 'RESET' ) {
|
||||
} elseif ( $aTotalHt == 'RESET' ) {
|
||||
|
||||
$this->prix_total_ht = null;
|
||||
} else {
|
||||
|
|
@ -585,12 +585,12 @@ class Facturation
|
|||
* @param int $aMontantTva Amount vat
|
||||
* @return int Amount vat
|
||||
*/
|
||||
public function montantTva($aMontantTva=null)
|
||||
public function montantTva($aMontantTva = null)
|
||||
{
|
||||
if (is_null($aMontantTva)) {
|
||||
|
||||
return $this->montant_tva;
|
||||
} else if ( $aMontantTva == 'RESET' ) {
|
||||
} elseif ( $aMontantTva == 'RESET' ) {
|
||||
|
||||
$this->montant_tva = null;
|
||||
} else {
|
||||
|
|
@ -605,7 +605,7 @@ class Facturation
|
|||
* @param int $aTotalTtc Amount ttc
|
||||
* @return int Amount ttc
|
||||
*/
|
||||
public function prixTotalTtc($aTotalTtc=null)
|
||||
public function prixTotalTtc($aTotalTtc = null)
|
||||
{
|
||||
if (is_null($aTotalTtc))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ if ( $nbr_enreg > 1 )
|
|||
$top_liste_produits = '----- '.$nbr_enreg.' '.$langs->transnoentitiesnoconv("CashDeskProducts").' '.$langs->trans("CashDeskOn").' '.$nbr_enreg.' -----';
|
||||
}
|
||||
}
|
||||
else if ( $nbr_enreg == 1 )
|
||||
elseif ( $nbr_enreg == 1 )
|
||||
{
|
||||
$top_liste_produits = '----- 1 '.$langs->transnoentitiesnoconv("ProductFound"). ' -----';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ switch($action)
|
|||
{
|
||||
$sql.= " AND p.rowid = ".$_POST['selProduit'];
|
||||
}
|
||||
else if ( $_POST['hdnSource'] == 'REF' )
|
||||
elseif ( $_POST['hdnSource'] == 'REF' )
|
||||
{
|
||||
$sql.= " AND p.ref = '".$_POST['txtRef']."'";
|
||||
}
|
||||
|
|
@ -163,7 +163,7 @@ switch($action)
|
|||
{
|
||||
$filtre = $ret['ref'];
|
||||
}
|
||||
else if ( $_POST['hdnSource'] == 'REF' )
|
||||
elseif ( $_POST['hdnSource'] == 'REF' )
|
||||
{
|
||||
$filtre = $_POST['txtRef'];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,32 +89,32 @@ if ($action == 'add' && $user->rights->categorie->creer)
|
|||
header("Location: ".$urlfrom);
|
||||
exit;
|
||||
}
|
||||
else if ($idProdOrigin)
|
||||
elseif ($idProdOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
else if ($idCompanyOrigin)
|
||||
elseif ($idCompanyOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
else if ($idSupplierOrigin)
|
||||
elseif ($idSupplierOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
else if ($idMemberOrigin)
|
||||
elseif ($idMemberOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
else if ($idContactOrigin)
|
||||
elseif ($idContactOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type);
|
||||
exit;
|
||||
}
|
||||
else if ($idProjectOrigin)
|
||||
elseif ($idProjectOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type);
|
||||
exit;
|
||||
|
|
@ -179,32 +179,32 @@ if (($action == 'add' || $action == 'confirmed') && $user->rights->categorie->cr
|
|||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else if ($idProdOrigin)
|
||||
elseif ($idProdOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProdOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||
exit;
|
||||
}
|
||||
else if ($idCompanyOrigin)
|
||||
elseif ($idCompanyOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idCompanyOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||
exit;
|
||||
}
|
||||
else if ($idSupplierOrigin)
|
||||
elseif ($idSupplierOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idSupplierOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||
exit;
|
||||
}
|
||||
else if ($idMemberOrigin)
|
||||
elseif ($idMemberOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idMemberOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||
exit;
|
||||
}
|
||||
else if ($idContactOrigin)
|
||||
elseif ($idContactOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idContactOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||
exit;
|
||||
}
|
||||
else if ($idProjectOrigin)
|
||||
elseif ($idProjectOrigin)
|
||||
{
|
||||
header("Location: ".DOL_URL_ROOT.'/categories/viewcat.php?id='.$idProjectOrigin.'&type='.$type.'&mesg='.urlencode($langs->trans("CatCreated")));
|
||||
exit;
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ class Categorie extends CommonObject
|
|||
* @param string $type Type of category ('product', '...') or (0, 1, ...)
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id, $label='', $type=null)
|
||||
function fetch($id, $label = '', $type = null)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -501,7 +501,7 @@ class Categorie extends CommonObject
|
|||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 KO >0 OK
|
||||
*/
|
||||
function delete($user, $notrigger=0)
|
||||
function delete($user, $notrigger = 0)
|
||||
{
|
||||
global $conf,$langs;
|
||||
|
||||
|
|
@ -691,7 +691,7 @@ class Categorie extends CommonObject
|
|||
*
|
||||
* @return int 1 if OK, -1 if KO
|
||||
*/
|
||||
function del_type($obj,$type)
|
||||
function del_type($obj, $type)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user,$langs,$conf;
|
||||
|
|
@ -749,7 +749,7 @@ class Categorie extends CommonObject
|
|||
* @return array|int -1 if KO, array of instance of object if OK
|
||||
* @see containsObject
|
||||
*/
|
||||
function getObjectsInCateg($type, $onlyids=0)
|
||||
function getObjectsInCateg($type, $onlyids = 0)
|
||||
{
|
||||
$objs = array();
|
||||
|
||||
|
|
@ -821,7 +821,7 @@ class Categorie extends CommonObject
|
|||
* @param int $page Page number
|
||||
* @return array|int Array of categories, 0 if no cat, -1 on error
|
||||
*/
|
||||
function getListForItem($id, $type='customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
|
||||
function getListForItem($id, $type = 'customer', $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
|
@ -990,7 +990,7 @@ class Categorie extends CommonObject
|
|||
*
|
||||
* @return array|int Array of categories. this->cats and this->motherof are set, -1 on error
|
||||
*/
|
||||
function get_full_arbo($type, $markafterid=0)
|
||||
function get_full_arbo($type, $markafterid = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
|
@ -1076,7 +1076,7 @@ class Categorie extends CommonObject
|
|||
* @param int $protection Deep counter to avoid infinite loop
|
||||
* @return void
|
||||
*/
|
||||
function build_path_from_id_categ($id_categ,$protection=1000)
|
||||
function build_path_from_id_categ($id_categ, $protection = 1000)
|
||||
{
|
||||
// phpcs:enable
|
||||
dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
|
||||
|
|
@ -1143,7 +1143,7 @@ class Categorie extends CommonObject
|
|||
* @param boolean $parent Just parent categories if true
|
||||
* @return array|int Table of Object Category, -1 on error
|
||||
*/
|
||||
function get_all_categories($type=null, $parent=false)
|
||||
function get_all_categories($type = null, $parent = false)
|
||||
{
|
||||
// phpcs:enable
|
||||
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
|
||||
|
|
@ -1232,7 +1232,7 @@ class Categorie extends CommonObject
|
|||
* @param int $type Type of category (0, 1, ...)
|
||||
* @return array
|
||||
*/
|
||||
function get_main_categories($type=null)
|
||||
function get_main_categories($type = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
return $this->get_all_categories($type, true);
|
||||
|
|
@ -1248,7 +1248,7 @@ class Categorie extends CommonObject
|
|||
* @param int $nocolor 0
|
||||
* @return array
|
||||
*/
|
||||
function print_all_ways($sep = " >> ", $url='', $nocolor=0)
|
||||
function print_all_ways($sep = " >> ", $url = '', $nocolor = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
$ways = array();
|
||||
|
|
@ -1376,7 +1376,7 @@ class Categorie extends CommonObject
|
|||
* labels, 'id'= Get array of category IDs
|
||||
* @return array|int Array of category objects or < 0 if KO
|
||||
*/
|
||||
function containing($id, $type, $mode='object')
|
||||
function containing($id, $type, $mode = 'object')
|
||||
{
|
||||
$cats = array();
|
||||
|
||||
|
|
@ -1397,7 +1397,7 @@ class Categorie extends CommonObject
|
|||
{
|
||||
if ($mode == 'id') {
|
||||
$cats[] = $obj->rowid;
|
||||
} else if ($mode == 'label') {
|
||||
} elseif ($mode == 'label') {
|
||||
$cats[] = $obj->label;
|
||||
} else {
|
||||
$cat = new Categorie($this->db);
|
||||
|
|
@ -1427,7 +1427,7 @@ class Categorie extends CommonObject
|
|||
{
|
||||
if ($mode == 'id') {
|
||||
$cats[] = $obj->rowid;
|
||||
} else if ($mode == 'label') {
|
||||
} elseif ($mode == 'label') {
|
||||
$cats[] = $obj->label;
|
||||
} else {
|
||||
$cat = new Categorie($this->db);
|
||||
|
|
@ -1522,7 +1522,7 @@ class Categorie extends CommonObject
|
|||
* @param int $maxlength Max length of text
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='',$maxlength=0)
|
||||
function getNomUrl($withpicto = 0, $option = '', $maxlength = 0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
|
@ -1608,7 +1608,7 @@ class Categorie extends CommonObject
|
|||
* @param int $nbmax Nombre maximum de photos (0=pas de max)
|
||||
* @return array Tableau de photos
|
||||
*/
|
||||
function liste_photos($dir,$nbmax=0)
|
||||
function liste_photos($dir, $nbmax = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
||||
|
|
@ -1747,7 +1747,7 @@ class Categorie extends CommonObject
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
else if (isset($this->multilangs["$key"]))
|
||||
elseif (isset($this->multilangs["$key"]))
|
||||
{
|
||||
if ($this->db->num_rows($result)) // si aucune ligne dans la base
|
||||
{
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ if ($action == 'edit')
|
|||
|
||||
print '</form>';
|
||||
}
|
||||
else if ($action != 'add')
|
||||
elseif ($action != 'add')
|
||||
{
|
||||
if ($cnt_trans) print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
|
|
|
|||
|
|
@ -86,40 +86,40 @@ if ($id > 0 && $removeelem > 0)
|
|||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'product';
|
||||
}
|
||||
else if ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
|
||||
elseif ($type == Categorie::TYPE_SUPPLIER && $user->rights->societe->creer)
|
||||
{
|
||||
$tmpobject = new Societe($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'supplier';
|
||||
}
|
||||
else if ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
|
||||
elseif ($type == Categorie::TYPE_CUSTOMER && $user->rights->societe->creer)
|
||||
{
|
||||
$tmpobject = new Societe($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'customer';
|
||||
}
|
||||
else if ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
|
||||
elseif ($type == Categorie::TYPE_MEMBER && $user->rights->adherent->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
$tmpobject = new Adherent($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'member';
|
||||
}
|
||||
else if ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
|
||||
elseif ($type == Categorie::TYPE_CONTACT && $user->rights->societe->creer) {
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
$tmpobject = new Contact($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'contact';
|
||||
}
|
||||
else if ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
|
||||
elseif ($type == Categorie::TYPE_ACCOUNT && $user->rights->banque->configurer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
$tmpobject = new Account($db);
|
||||
$result = $tmpobject->fetch($removeelem);
|
||||
$elementtype = 'account';
|
||||
}
|
||||
else if ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
|
||||
elseif ($type == Categorie::TYPE_PROJECT && $user->rights->projet->creer)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
$tmpobject = new Project($db);
|
||||
|
|
|
|||
|
|
@ -791,11 +791,11 @@ if ($action == 'create')
|
|||
print '<td>';
|
||||
$percent=-1;
|
||||
if (isset($_GET['status']) || isset($_POST['status'])) $percent=GETPOST('status');
|
||||
else if (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent=GETPOST('percentage');
|
||||
elseif (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent=GETPOST('percentage');
|
||||
else
|
||||
{
|
||||
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent='0';
|
||||
else if (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent=100;
|
||||
elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent=100;
|
||||
}
|
||||
$formactions->form_select_status_action('formaction', $percent, 1, 'complete', 0, 0, 'maxwidth200');
|
||||
print '</td></tr>';
|
||||
|
|
|
|||
|
|
@ -293,7 +293,7 @@ class ActionComm extends CommonObject
|
|||
$this->type_id=$cactioncomm->id;
|
||||
$this->type_code=$cactioncomm->code;
|
||||
}
|
||||
else if ($result == 0)
|
||||
elseif ($result == 0)
|
||||
{
|
||||
$this->error='Failed to get record with id '.$this->type_id.' code '.$this->type_code.' from dictionary "type of events"';
|
||||
return -1;
|
||||
|
|
@ -566,7 +566,7 @@ class ActionComm extends CommonObject
|
|||
* @param string $ref_ext Ref ext to get
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch($id, $ref='',$ref_ext='')
|
||||
function fetch($id, $ref = '', $ref_ext = '')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
|
@ -761,7 +761,7 @@ class ActionComm extends CommonObject
|
|||
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function delete($notrigger=0)
|
||||
function delete($notrigger = 0)
|
||||
{
|
||||
global $user,$langs,$conf;
|
||||
|
||||
|
|
@ -838,7 +838,7 @@ class ActionComm extends CommonObject
|
|||
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update($user,$notrigger=0)
|
||||
function update($user, $notrigger = 0)
|
||||
{
|
||||
global $langs,$conf,$hookmanager;
|
||||
|
||||
|
|
@ -999,7 +999,7 @@ class ActionComm extends CommonObject
|
|||
* @param string $limit Limit number of answers
|
||||
* @return array or string Error string if KO, array with actions if OK
|
||||
*/
|
||||
static function getActions($db, $socid=0, $fk_element=0, $elementtype='', $filter='', $sortfield='a.datep', $sortorder='DESC', $limit=0)
|
||||
static function getActions($db, $socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
|
|
@ -1051,7 +1051,7 @@ class ActionComm extends CommonObject
|
|||
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord
|
||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||
*/
|
||||
function load_board($user, $load_state_board=0)
|
||||
function load_board($user, $load_state_board = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
|
@ -1164,7 +1164,7 @@ class ActionComm extends CommonObject
|
|||
* @param int $hidenastatus 1=Show nothing if status is "Not applicable"
|
||||
* @return string String with status
|
||||
*/
|
||||
function getLibStatut($mode,$hidenastatus=0)
|
||||
function getLibStatut($mode, $hidenastatus = 0)
|
||||
{
|
||||
return $this->LibStatut($this->percentage, $mode, $hidenastatus, $this->datep);
|
||||
}
|
||||
|
|
@ -1179,7 +1179,7 @@ class ActionComm extends CommonObject
|
|||
* @param int $datestart Date start of event
|
||||
* @return string Label
|
||||
*/
|
||||
function LibStatut($percent,$mode,$hidenastatus=0,$datestart='')
|
||||
function LibStatut($percent, $mode, $hidenastatus = 0, $datestart = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
|
@ -1257,7 +1257,7 @@ class ActionComm extends CommonObject
|
|||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string Chaine avec URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0, $maxlength=0, $classname='', $option='', $overwritepicto=0, $notooltip=0, $save_lastsearch_value=-1)
|
||||
function getNomUrl($withpicto = 0, $maxlength = 0, $classname = '', $option = '', $overwritepicto = 0, $notooltip = 0, $save_lastsearch_value = -1)
|
||||
{
|
||||
global $conf, $langs, $user, $hookmanager, $action;
|
||||
|
||||
|
|
@ -1391,7 +1391,7 @@ class ActionComm extends CommonObject
|
|||
* @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...)
|
||||
* @return int <0 if error, nb of events in new file if ok
|
||||
*/
|
||||
function build_exportfile($format,$type,$cachedelay,$filename,$filters)
|
||||
function build_exportfile($format, $type, $cachedelay, $filename, $filters)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf,$langs,$dolibarr_main_url_root,$mysoc;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user