Merge branch 'develop' into patch-11
This commit is contained in:
commit
601a4f2df4
78 changed files with 490 additions and 427 deletions
|
|
@ -15,7 +15,6 @@ return [
|
|||
// PhanPluginDuplicateExpressionBinaryOp : 10+ occurrences
|
||||
// PhanTypeArraySuspiciousNull : 10+ occurrences
|
||||
// PhanTypeInvalidUnaryOperandNumeric : 8 occurrences
|
||||
// PhanPluginDuplicateIfCondition : 6 occurrences
|
||||
// PhanRedefineFunctionInternal : 6 occurrences
|
||||
// PhanPluginUnsafeEval : 5 occurrences
|
||||
// PhanParamSuspiciousOrder : 4 occurrences
|
||||
|
|
@ -51,7 +50,6 @@ return [
|
|||
'htdocs/compta/cashcontrol/cashcontrol_card.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/compta/facture/agenda-rec.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/facture/card-rec.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/facture/list.php' => ['PhanPluginDuplicateIfCondition'],
|
||||
'htdocs/compta/prelevement/class/bonprelevement.class.php' => ['PhanParamTooMany'],
|
||||
'htdocs/compta/prelevement/create.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/compta/sociales/class/paymentsocialcontribution.class.php' => ['PhanTypeInvalidUnaryOperandNumeric'],
|
||||
|
|
@ -62,7 +60,7 @@ return [
|
|||
'htdocs/compta/tva/document.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/actions_massactions.inc.php' => ['PhanPluginSuspiciousParamOrder'],
|
||||
'htdocs/core/class/commondocgenerator.class.php' => ['PhanTypeArraySuspiciousNull'],
|
||||
'htdocs/core/class/commonobject.class.php' => ['PhanPluginDuplicateIfCondition', 'PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/class/commonobject.class.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/class/evalmath.class.php' => ['PhanPluginUnsafeEval'],
|
||||
'htdocs/core/class/html.form.class.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/class/html.formmail.class.php' => ['PhanNoopArray'],
|
||||
|
|
@ -72,8 +70,8 @@ return [
|
|||
'htdocs/core/db/sqlite3.class.php' => ['PhanParamSignatureMismatch'],
|
||||
'htdocs/core/filemanagerdol/connectors/php/connector.lib.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/get_info.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanPluginDuplicateIfCondition'],
|
||||
'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanPluginAlwaysReturnFunction', 'PhanPluginDuplicateIfCondition', 'PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'],
|
||||
'htdocs/core/lib/files.lib.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/core/lib/functions.lib.php' => ['PhanParamTooMany', 'PhanPluginAlwaysReturnFunction', 'PhanPluginUnsafeEval', 'PhanRedefineFunctionInternal'],
|
||||
'htdocs/core/lib/price.lib.php' => ['PhanPluginSuspiciousParamPosition'],
|
||||
'htdocs/core/lib/usergroups.lib.php' => ['PhanNoopArrayAccess'],
|
||||
'htdocs/core/menus/standard/auguria_menu.php' => ['PhanParamSuspiciousOrder'],
|
||||
|
|
@ -84,7 +82,6 @@ return [
|
|||
'htdocs/core/modules/member/doc/pdf_standard.class.php' => ['PhanParamSignatureMismatch'],
|
||||
'htdocs/core/modules/movement/doc/pdf_standard.modules.php' => ['PhanPluginDuplicateExpressionBinaryOp'],
|
||||
'htdocs/core/modules/mrp/doc/pdf_vinci.modules.php' => ['PhanTypeArraySuspiciousNull'],
|
||||
'htdocs/core/modules/societe/modules_societe.class.php' => ['PhanPluginDuplicateIfCondition'],
|
||||
'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanParamSignatureMismatch', 'PhanParamSuspiciousOrder'],
|
||||
'htdocs/core/modules/syslog/mod_syslog_syslog.php' => ['PhanParamSignatureMismatch'],
|
||||
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ return [
|
|||
// 'PhanTypeMismatchDeclaredReturnNullable',
|
||||
|
||||
// 'PhanUndeclaredThis',
|
||||
'PhanPluginMixedKeyNoKey',
|
||||
// 'PhanPluginMixedKeyNoKey',
|
||||
'PhanPluginDuplicateConditionalNullCoalescing', // Suggests to optimize to ??
|
||||
//'PhanUnreferencedClosure', // False positives seen with closures in arrays, TODO: move closure checks closer to what is done by unused variable plugin
|
||||
//'PhanPluginNoCommentOnProtectedMethod',
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -745,7 +746,7 @@ class AccountingAccount extends CommonObject
|
|||
$hookmanager->initHooks(array('accountancyBindingCalculation'));
|
||||
|
||||
// Execute hook accountancyBindingCalculation
|
||||
$parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount' => $accountingAccount, $type);
|
||||
$parameters = array('buyer' => $buyer, 'seller' => $seller, 'product' => $product, 'facture' => $facture, 'factureDet' => $factureDet ,'accountingAccount' => $accountingAccount, 0 => $type);
|
||||
$reshook = $hookmanager->executeHooks('accountancyBindingCalculation', $parameters); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
if (empty($reshook)) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -89,7 +90,7 @@ if ($action == 'set') {
|
|||
dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$defaultValues = new DefaultValues($db);
|
||||
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
|
||||
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => $conf->entity));
|
||||
if (!is_array($result) && $result < 0) {
|
||||
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
|
||||
} elseif (count($result) > 0) {
|
||||
|
|
@ -123,18 +124,16 @@ if ($action == 'set') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db, $commande);
|
||||
|
|
@ -334,7 +333,7 @@ $htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoe
|
|||
print '<td>'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).'</td>'."\n";
|
||||
print '<td class="center"> </td>'."\n";
|
||||
print '<td class="right">'."\n";
|
||||
$tmplist = array(''=>' ', 'show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser"));
|
||||
$tmplist = array('' => ' ', 'show_list' => $langs->trans("ViewList"), 'show_month' => $langs->trans("ViewCal"), 'show_week' => $langs->trans("ViewWeek"), 'show_day' => $langs->trans("ViewDay"), 'show_peruser' => $langs->trans("ViewPerUser"));
|
||||
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, getDolGlobalString('AGENDA_DEFAULT_VIEW'));
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
|
@ -369,7 +368,7 @@ print '<td class="center"> </td>'."\n";
|
|||
print '<td class="right nowrap">'."\n";
|
||||
$defval = 'na';
|
||||
$defaultValues = new DefaultValues($db);
|
||||
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page'=>'comm/action/card.php', 't.param'=>'complete', 't.user_id'=>'0', 't.type'=>'createform', 't.entity'=>$conf->entity));
|
||||
$result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => $conf->entity));
|
||||
if (!is_array($result) && $result < 0) {
|
||||
setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
|
||||
} elseif (count($result) > 0) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -86,18 +87,16 @@ if ($action == 'set') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db, $commande);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2010-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -131,18 +132,16 @@ if ($action == 'specimen') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/bank/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -76,18 +77,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/bom/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
* Copyright (C) 2011-2016 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -86,18 +87,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/commande/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -82,18 +83,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/contract/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -131,18 +132,16 @@ if ($action == 'specimen') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/delivery/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2021 Florian Henry <florian.henry@scopen.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -47,20 +48,20 @@ $scandir = GETPOST('scan_dir', 'alpha');
|
|||
$type = 'myobject';
|
||||
|
||||
$arrayofparameters = array(
|
||||
'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1),
|
||||
'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TASK_LABEL' => array('type' => 'textarea','enabled' => 1),
|
||||
'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1),
|
||||
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1),
|
||||
'EVENTORGANIZATION_FILTERATTENDEES_CAT' => array('type' => 'category:'.Categorie::TYPE_CUSTOMER, 'enabled' => 1),
|
||||
'EVENTORGANIZATION_FILTERATTENDEES_TYPE' => array('type' => 'thirdparty_type:', 'enabled' => 1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF' => array('type' => 'emailtemplate:conferenceorbooth', 'enabled' => 1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH' => array('type' => 'emailtemplate:conferenceorbooth', 'enabled' => 1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH' => array('type' => 'emailtemplate:conferenceorbooth', 'enabled' => 1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT' => array('type' => 'emailtemplate:conferenceorbooth', 'enabled' => 1),
|
||||
//'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
//'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1),
|
||||
'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
'SERVICE_BOOTH_LOCATION' => array('type' => 'product', 'enabled' => 1),
|
||||
'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION' => array('type' => 'product', 'enabled' => 1),
|
||||
'EVENTORGANIZATION_SECUREKEY' => array('type' => 'securekey', 'enabled' => 1),
|
||||
);
|
||||
|
||||
$error = 0;
|
||||
|
|
@ -80,7 +81,7 @@ if (empty($user->admin)) {
|
|||
*/
|
||||
|
||||
if ($cancel) {
|
||||
$action ='';
|
||||
$action = '';
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
|
@ -111,18 +112,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/eventorganization/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
@ -218,7 +217,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
if ($val['enabled'] == 1) {
|
||||
$setupnotempty++;
|
||||
print '<tr class="oddeven"><td><!-- '.$constname.' -->';
|
||||
$tooltiphelp = (($langs->trans($constname . 'Tooltip') != $constname . 'Tooltip') ? $langs->trans($constname . 'Tooltip') : '');
|
||||
|
|
@ -230,7 +229,7 @@ if ($action == 'edit') {
|
|||
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print getDolGlobalString($constname);
|
||||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
} elseif ($val['type'] == 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, getDolGlobalString($constname), '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
|
|
@ -300,7 +299,7 @@ if ($action == 'edit') {
|
|||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($arrayofparameters as $constname => $val) {
|
||||
if ($val['enabled']==1) {
|
||||
if ($val['enabled'] == 1) {
|
||||
$setupnotempty++;
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><!-- '.$constname.' -->';
|
||||
|
|
@ -311,7 +310,7 @@ if ($action == 'edit') {
|
|||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print dol_nl2br(getDolGlobalString($constname));
|
||||
} elseif ($val['type']== 'html') {
|
||||
} elseif ($val['type'] == 'html') {
|
||||
print getDolGlobalString($constname);
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print ajax_constantonoff($constname);
|
||||
|
|
@ -348,13 +347,13 @@ if ($action == 'edit') {
|
|||
print '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
}
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
if (getDolGlobalString($constname)==2) {
|
||||
if (getDolGlobalString($constname) == 2) {
|
||||
print $langs->trans("Prospect");
|
||||
} elseif (getDolGlobalString($constname)==3) {
|
||||
} elseif (getDolGlobalString($constname) == 3) {
|
||||
print $langs->trans("ProspectCustomer");
|
||||
} elseif (getDolGlobalString($constname)==1) {
|
||||
} elseif (getDolGlobalString($constname) == 1) {
|
||||
print $langs->trans("Customer");
|
||||
} elseif (getDolGlobalString($constname)==0) {
|
||||
} elseif (getDolGlobalString($constname) == 0) {
|
||||
print $langs->trans("NorProspectNorCustomer");
|
||||
}
|
||||
} elseif ($val['type'] == 'product') {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -102,18 +103,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/expedition/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2022 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -83,18 +84,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/expensereport/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -82,18 +83,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -82,18 +83,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/holiday/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
|
||||
* Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -116,18 +117,16 @@ if ($action == 'update') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/hrm/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
|
||||
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -99,18 +100,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/facture/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
@ -628,10 +627,10 @@ if (getDolGlobalString('INVOICE_USE_DEFAULT_DOCUMENT')) { // Hidden conf
|
|||
print "</tr>\n";
|
||||
|
||||
$listtype = array(
|
||||
Facture::TYPE_STANDARD=>$langs->trans("InvoiceStandard"),
|
||||
Facture::TYPE_REPLACEMENT=>$langs->trans("InvoiceReplacement"),
|
||||
Facture::TYPE_CREDIT_NOTE=>$langs->trans("InvoiceAvoir"),
|
||||
Facture::TYPE_DEPOSIT=>$langs->trans("InvoiceDeposit"),
|
||||
Facture::TYPE_STANDARD => $langs->trans("InvoiceStandard"),
|
||||
Facture::TYPE_REPLACEMENT => $langs->trans("InvoiceReplacement"),
|
||||
Facture::TYPE_CREDIT_NOTE => $langs->trans("InvoiceAvoir"),
|
||||
Facture::TYPE_DEPOSIT => $langs->trans("InvoiceDeposit"),
|
||||
);
|
||||
if (getDolGlobalInt('INVOICE_USE_SITUATION')) {
|
||||
$listtype[Facture::TYPE_SITUATION] = $langs->trans("InvoiceSituation");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 SuperAdmin
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -94,18 +95,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/knowledgemanagement/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -77,18 +78,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/mrp/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -82,18 +83,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/propale/doc/pdf_".$modele.".modules.php");
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -105,18 +106,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/reception/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -109,18 +110,16 @@ if ($action == 'specimen') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/stock/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2021 SuperAdmin
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -91,18 +92,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/stocktransfer/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -102,18 +103,16 @@ if ($action == 'specimen') { // For invoices
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/supplier_invoice/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db, $facture);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||
|
|
@ -92,18 +93,16 @@ if ($action == 'specimen') { // For orders
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/supplier_order/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db, $commande);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -103,18 +104,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/supplier_payment/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -81,18 +82,16 @@ if ($action == 'specimen') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/supplier_proposal/doc/pdf_".$modele.".modules.php");
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -99,18 +100,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/webhook/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele."_".strtolower($tmpobjectkey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2020 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -84,18 +85,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/workstation/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -75,7 +76,7 @@ foreach ($arrayofia as $ia) {
|
|||
$item->cssClass = 'minwidth500';
|
||||
}
|
||||
|
||||
$setupnotempty =+ count($formSetup->items);
|
||||
$setupnotempty = + count($formSetup->items);
|
||||
|
||||
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
|
@ -113,18 +114,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/ai/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele."_".strtolower($tmpobjectkey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
@ -193,45 +192,45 @@ $action = 'edit';
|
|||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$form = new Form($db);
|
||||
|
||||
$help_url = '';
|
||||
$title = "AiSetup";
|
||||
$help_url = '';
|
||||
$title = "AiSetup";
|
||||
|
||||
llxHeader('', $langs->trans($title), $help_url);
|
||||
llxHeader('', $langs->trans($title), $help_url);
|
||||
|
||||
// Subheader
|
||||
$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
|
||||
// Subheader
|
||||
$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($title), $linkback, 'title_setup');
|
||||
print load_fiche_titre($langs->trans($title), $linkback, 'title_setup');
|
||||
|
||||
// Configuration header
|
||||
$head = aiAdminPrepareHead();
|
||||
print dol_get_fiche_head($head, 'settings', $langs->trans($title), -1, "fa-microchip");
|
||||
// Configuration header
|
||||
$head = aiAdminPrepareHead();
|
||||
print dol_get_fiche_head($head, 'settings', $langs->trans($title), -1, "fa-microchip");
|
||||
|
||||
// Setup page goes here
|
||||
//echo '<span class="opacitymedium">'.$langs->trans("AiSetupPage").'</span><br><br>';
|
||||
// Setup page goes here
|
||||
//echo '<span class="opacitymedium">'.$langs->trans("AiSetupPage").'</span><br><br>';
|
||||
|
||||
|
||||
if ($action == 'edit') {
|
||||
print $formSetup->generateOutput(true);
|
||||
print '<br>';
|
||||
print $formSetup->generateOutput(true);
|
||||
print '<br>';
|
||||
} elseif (!empty($formSetup->items)) {
|
||||
print $formSetup->generateOutput();
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
|
||||
print '</div>';
|
||||
} else {
|
||||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
}
|
||||
|
||||
|
||||
if (empty($setupnotempty)) {
|
||||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
print '<br>'.$langs->trans("NothingToSetup");
|
||||
}
|
||||
|
||||
// Page end
|
||||
print dol_get_fiche_end();
|
||||
// Page end
|
||||
print dol_get_fiche_end();
|
||||
|
||||
llxFooter();
|
||||
$db->close();
|
||||
llxFooter();
|
||||
$db->close();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -96,18 +97,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/asset/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2022 Alice Adminson <aadminson@example.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -102,7 +103,7 @@ $item->helpText = $langs->transnoentities('AnHelpMessage');*/
|
|||
//$item->fieldOutputOverride = false; // set this var to override field output
|
||||
|
||||
|
||||
$setupnotempty =+ count($formSetup->items);
|
||||
$setupnotempty = + count($formSetup->items);
|
||||
|
||||
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
|
|
@ -145,18 +146,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/bookcal/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele."_".strtolower($tmpobjectkey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1151,8 +1151,8 @@ if ($action == 'create') {
|
|||
// Create an array for form
|
||||
$formquestion = array(
|
||||
'text' => $langs->trans("ConfirmClone"),
|
||||
array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContent"), 'value' => 1),
|
||||
array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers"), 'value' => 0)
|
||||
0 => array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContent"), 'value' => 1),
|
||||
1 => array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers"), 'value' => 0)
|
||||
);
|
||||
// Incomplete payment. On demande si motif = escompte ou autre
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneEMailing', $object->ref), 'confirm_clone', $formquestion, 'yes', 2, 240);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -560,8 +561,8 @@ if ($socid > 0) {
|
|||
$amount2 = ($showconfirminfo['amount_ttc'] - $amount1);
|
||||
$formquestion = array(
|
||||
'text' => $langs->trans('TypeAmountOfEachNewDiscount'),
|
||||
array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'),
|
||||
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
|
||||
0 => array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'),
|
||||
1 => array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
|
||||
);
|
||||
$langs->load("dict");
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, '', 0);
|
||||
|
|
@ -707,8 +708,8 @@ if ($socid > 0) {
|
|||
$amount2 = ($showconfirminfo['amount_ttc'] - $amount1);
|
||||
$formquestion = array(
|
||||
'text' => $langs->trans('TypeAmountOfEachNewDiscount'),
|
||||
array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'),
|
||||
array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
|
||||
0 => array('type' => 'text', 'name' => 'amount_ttc_1', 'label' => $langs->trans("AmountTTC").' 1', 'value' => $amount1, 'size' => '5'),
|
||||
1 => array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
|
||||
);
|
||||
$langs->load("dict");
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'].($backtopage ? '&backtopage='.urlencode($backtopage) : ''), $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount', price($showconfirminfo['amount_ttc']), $langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Nick Fragoulis
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1662,7 +1663,7 @@ if (empty($reshook)) {
|
|||
null,
|
||||
0,
|
||||
'',
|
||||
(!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA)?0:1)
|
||||
(!empty($conf->global->MAIN_DEPOSIT_MULTI_TVA) ? 0 : 1)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -4459,7 +4460,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Create a form table
|
||||
$formquestion = array('text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"), array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'morecss' => 'minwidth300'));
|
||||
$formquestion = array('text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"), 0 => array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), 1 => array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'morecss' => 'minwidth300'));
|
||||
// Incomplete payment. We ask if reason = discount or other
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidPartially', $object->ref), 'confirm_paid_partially', $formquestion, "yes", 1, 380, 600);
|
||||
}
|
||||
|
|
@ -4491,7 +4492,7 @@ if ($action == 'create') {
|
|||
$arrayreasons[$close[2]['code']] = $close[2]['reason'];
|
||||
|
||||
// Create a form table
|
||||
$formquestion = array('text' => $langs->trans("ConfirmCancelBillQuestion"), array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'morecss' => 'minwidth300'));
|
||||
$formquestion = array('text' => $langs->trans("ConfirmCancelBillQuestion"), 0 => array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), 1 => array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'morecss' => 'minwidth300'));
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$object->id, $langs->trans('CancelBill'), $langs->trans('ConfirmCancelBill', $object->ref), 'confirm_canceled', $formquestion, "yes", 1, 270);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
* Copyright (C) 2019-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2023 Nick Fragoulis
|
||||
* Copyright (C) 2023 Joachim Kueter <git-jk@bloxera.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -273,8 +274,6 @@ foreach ($object->fields as $key => $val) {
|
|||
$newkey = $key;
|
||||
} elseif (array_key_exists('f.'.$key, $arrayfields)) {
|
||||
$newkey = 'f.'.$key;
|
||||
} elseif (array_key_exists('f.'.$key, $arrayfields)) {
|
||||
$newkey = 'f.'.$key;
|
||||
} elseif (array_key_exists('s.'.$key, $arrayfields)) {
|
||||
$newkey = 's.'.$key;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2023 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2023 Nick Fragoulis
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -1351,8 +1352,8 @@ if ($action == 'create') {
|
|||
} elseif ($action == 'activate') {
|
||||
$formquestion = array(
|
||||
array('type' => 'date', 'name' => 'd_start', 'label' => $langs->trans("DateServiceActivate"), 'value' => dol_now()),
|
||||
array('type' => 'date', 'name' => 'd_end', 'label' => $langs->trans("DateEndPlanned"), /*'value' => $form->selectDate('', "end", $usehm, $usehm, '', "active", 1, 0),*/ '', ''),
|
||||
array('type' => 'text', 'name' => 'comment', 'label' => $langs->trans("Comment"), 'value' => '', '', '', 'class' => 'minwidth300', 'moreattr' => 'autofocus')
|
||||
array('type' => 'date', 'name' => 'd_end', 'label' => $langs->trans("DateEndPlanned"), /*'value' => $form->selectDate('', "end", $usehm, $usehm, '', "active", 1, 0),*/ 0 => '', 1 => ''),
|
||||
array('type' => 'text', 'name' => 'comment', 'label' => $langs->trans("Comment"), 'value' => '', 0 => '', 1 => '', 'class' => 'minwidth300', 'moreattr' => 'autofocus')
|
||||
);
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("ActivateAllOnContract"), $langs->trans("ConfirmActivateAllOnContract"), "confirm_activate", $formquestion, 'yes', 1, 280);
|
||||
} elseif ($action == 'clone') {
|
||||
|
|
@ -1890,7 +1891,7 @@ if ($action == 'create') {
|
|||
// Cree un tableau formulaire
|
||||
$formquestion = array(
|
||||
'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"),
|
||||
array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid));
|
||||
0 => array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid));
|
||||
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOSTINT('rowid'), $langs->trans("MoveToAnotherContract"), $langs->trans("ConfirmMoveToAnotherContract"), "confirm_move", $formquestion);
|
||||
print '<table class="notopnoleftnoright" width="100%"><tr class="oddeven" height="6"><td></td></tr></table>';
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*/
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -580,18 +582,15 @@ if ($action == "importSignature") {
|
|||
$classname = 'pdf_' . $last_modelpdf;
|
||||
break;
|
||||
}
|
||||
if ($filefound) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$filefound) {
|
||||
if ($filefound === '') {
|
||||
$response = $langs->trans("Error") . ' Failed to load doc generator with modelpaths=' . $modelpath . ' - modele=' . $last_modelpdf;
|
||||
dol_syslog($response, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if (!$error && $classname !== '') {
|
||||
// If PDF template class was found
|
||||
require_once $file;
|
||||
|
||||
|
|
|
|||
|
|
@ -1659,8 +1659,6 @@ abstract class CommonObject
|
|||
$modulename = 'agenda';
|
||||
} elseif (strpos($obj->element, 'supplier') !== false && $obj->element != 'supplier_proposal') {
|
||||
$modulename = 'fournisseur';
|
||||
} elseif (strpos($obj->element, 'supplier') !== false && $obj->element != 'supplier_proposal') {
|
||||
$modulename = 'fournisseur';
|
||||
}
|
||||
if (!empty($conf->{$modulename}->enabled)) {
|
||||
$libelle_element = $langs->trans('ContactDefault_'.$obj->element);
|
||||
|
|
@ -5705,7 +5703,7 @@ abstract class CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
if (!$filefound) {
|
||||
if ($filefound === '' || $classname === '') {
|
||||
$this->error = $langs->trans("Error").' Failed to load doc generator with modelpaths='.$modelspath.' - modele='.$modele;
|
||||
$this->errors[] = $this->error;
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2014-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2020 OScss-Shop <support@oscss-shop.fr>
|
||||
* Copyright (C) 2023-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -331,7 +332,7 @@ class Fiscalyear extends CommonObject
|
|||
$params = [
|
||||
'id' => $this->id,
|
||||
'objecttype' => $this->element,
|
||||
'option', $option,
|
||||
'option' => $option,
|
||||
'nofetch' => 1,
|
||||
];
|
||||
$classfortooltip = 'classfortooltip';
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ class FormMail extends Form
|
|||
public $witherrorsto;
|
||||
|
||||
/**
|
||||
* @var int 0=No attaches files, 1=Show attached files, 2=Can add new attached files
|
||||
* @var int|string 0=No attaches files, 1=Show attached files, 2=Can add new attached files, 'text'=Show attached files and the text
|
||||
*/
|
||||
public $withfile;
|
||||
|
||||
|
|
|
|||
|
|
@ -3167,12 +3167,6 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||
$accessallowed = 1;
|
||||
}
|
||||
$original_file = $conf->expedition->dir_output."/".(strpos($original_file, 'receipt/') === 0 ? '' : 'receipt/').$original_file;
|
||||
} elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) {
|
||||
// Wrapping pour les actions
|
||||
if ($fuser->hasRight('agenda', 'myactions', $read) || preg_match('/^specimen/i', $original_file)) {
|
||||
$accessallowed = 1;
|
||||
}
|
||||
$original_file = $conf->agenda->dir_output.'/'.$original_file;
|
||||
} elseif ($modulepart == 'actionsreport' && !empty($conf->agenda->dir_temp)) {
|
||||
// Wrapping pour les actions
|
||||
if ($fuser->hasRight('agenda', 'allactions', $read) || preg_match('/^specimen/i', $original_file)) {
|
||||
|
|
@ -3289,10 +3283,6 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||
$accessallowed = 1;
|
||||
}
|
||||
$original_file = $conf->adherent->dir_output.'/'.$original_file;
|
||||
} elseif ($modulepart == 'scanner_user_temp' && !empty($conf->scanner->dir_temp)) {
|
||||
// Wrapping for Scanner
|
||||
$accessallowed = 1;
|
||||
$original_file = $conf->scanner->dir_temp.'/'.$fuser->id.'/'.$original_file;
|
||||
// If modulepart=module_user_temp Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/temp/iduser
|
||||
// If modulepart=module_temp Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/temp
|
||||
// If modulepart=module_user Allows any module to open a file if file is in directory called DOL_DATA_ROOT/modulepart/iduser
|
||||
|
|
|
|||
|
|
@ -261,6 +261,16 @@ function isModEnabled($module)
|
|||
$arrayconv['supplier_order'] = 'fournisseur';
|
||||
$arrayconv['supplier_invoice'] = 'fournisseur';
|
||||
}
|
||||
// Special case.
|
||||
// @TODO Replace isModEnabled('delivery_note') with
|
||||
// isModEnabled('shipping') && getDolGlobalString('MAIN_SUBMODULE_EXPEDITION')
|
||||
if ($module == 'delivery_note') {
|
||||
if (!getDolGlobalString('MAIN_SUBMODULE_EXPEDITION')) {
|
||||
return false;
|
||||
} else {
|
||||
$module = 'shipping';
|
||||
}
|
||||
}
|
||||
|
||||
$module_alt = $module;
|
||||
if (!empty($arrayconv[$module])) {
|
||||
|
|
@ -12169,20 +12179,20 @@ function getElementProperties($elementType)
|
|||
$classname = 'Expedition';
|
||||
$module = 'expedition';
|
||||
$table_element = 'expedition';
|
||||
} elseif ($elementType == 'delivery_note') {
|
||||
$classpath = 'delivery/class';
|
||||
$subelement = 'delivery';
|
||||
$module = 'expedition';
|
||||
} elseif ($elementType == 'delivery') {
|
||||
$classpath = 'delivery/class';
|
||||
$subelement = 'delivery';
|
||||
$module = 'expedition';
|
||||
} elseif ($elementType == 'supplier_proposal') {
|
||||
$classpath = 'supplier_proposal/class';
|
||||
$module = 'supplier_proposal';
|
||||
$element = 'supplierproposal';
|
||||
$classfile = 'supplier_proposal';
|
||||
$subelement = 'supplierproposal';
|
||||
} elseif ($elementType == 'shipping') {
|
||||
$classpath = 'expedition/class';
|
||||
$subelement = 'expedition';
|
||||
$module = 'expedition_bon';
|
||||
} elseif ($elementType == 'delivery') {
|
||||
$classpath = 'delivery/class';
|
||||
$subelement = 'delivery';
|
||||
$module = 'expedition';
|
||||
} elseif ($elementType == 'contract') {
|
||||
$classpath = 'contrat/class';
|
||||
$module = 'contrat';
|
||||
|
|
|
|||
|
|
@ -1443,6 +1443,7 @@ function pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $pos
|
|||
}
|
||||
if (empty($reshook)) {
|
||||
$labelproductservice = pdf_getlinedesc($object, $i, $outputlangs, $hideref, $hidedesc, $issupplierline);
|
||||
$labelproductservice = preg_replace('/(<img[^>]*src=")[^\"]*viewimage\.php[^\"]*modulepart=medias[^\"]*file=([^\"]*)/', '\1file:/'.DOL_DATA_ROOT.'/medias/\2\3', $labelproductservice, -1, $nbrep);
|
||||
|
||||
//var_dump($labelproductservice);exit;
|
||||
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@ function shipping_prepare_head($object)
|
|||
// delivery link
|
||||
$object->fetchObjectLinked($object->id, $object->element);
|
||||
if (isset($object->linkedObjectsIds['delivery']) && is_array($object->linkedObjectsIds['delivery']) && count($object->linkedObjectsIds['delivery']) > 0) { // If there is a delivery
|
||||
// Take first one element of array
|
||||
// Take first element of array
|
||||
$tmp = reset($object->linkedObjectsIds['delivery']);
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/delivery/card.php?id=".$tmp;
|
||||
$head[$h][0] = DOL_URL_ROOT."/delivery/card.php?id=".((int) $tmp);
|
||||
$head[$h][1] = $langs->trans("DeliveryCard");
|
||||
$head[$h][2] = 'delivery';
|
||||
$h++;
|
||||
|
|
@ -75,7 +75,7 @@ function shipping_prepare_head($object)
|
|||
$objectsrc->fetch($object->origin_id);
|
||||
}
|
||||
$nbContact = count($objectsrc->liste_contact(-1, 'internal')) + count($objectsrc->liste_contact(-1, 'external'));
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".$object->id;
|
||||
$head[$h][0] = DOL_URL_ROOT."/expedition/contact.php?id=".((int) $object->id);
|
||||
$head[$h][1] = $langs->trans("ContactsAddresses");
|
||||
if ($nbContact > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbContact.'</span>';
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011-2019 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -108,7 +109,6 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0,
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array('/');
|
||||
if (is_array($conf->modules_parts['models'])) {
|
||||
$dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
|
||||
|
|
@ -120,18 +120,17 @@ function fichinter_create($db, $object, $modele, $outputlangs, $hidedetails = 0,
|
|||
// Get the location of the module and verify it exists
|
||||
$file = dol_buildpath($reldir."core/modules/fichinter/doc/".$file, 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = $prefix.'_'.$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Charge le modele
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$obj = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -115,7 +116,6 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array('/');
|
||||
if (is_array($conf->modules_parts['models'])) {
|
||||
$dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
|
||||
|
|
@ -127,19 +127,18 @@ function members_card_pdf_create($db, $arrayofmembers, $modele, $outputlangs, $o
|
|||
// We check that file of doc generaotr exists
|
||||
$file = dol_buildpath($reldir."core/modules/member/doc/".$file, 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = $prefix.'_'.$template;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Charge le modele
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$obj = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -117,7 +118,6 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array('/');
|
||||
if (is_array($conf->modules_parts['models'])) {
|
||||
$dirmodels = array_merge($dirmodels, $conf->modules_parts['models']);
|
||||
|
|
@ -129,18 +129,17 @@ function doc_label_pdf_create($db, $arrayofrecords, $modele, $outputlangs, $outp
|
|||
// Determine the model path and validate that it exists
|
||||
$file = dol_buildpath($reldir."core/modules/printsheet/doc/".$file, 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = $prefix.'_'.$template;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Load the model
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$obj = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -136,8 +137,6 @@ abstract class ModeleThirdPartyCode extends CommonNumRefGenerator
|
|||
$s = '';
|
||||
if ($type == -1) {
|
||||
$s .= $langs->trans("Name").': <b>'.$this->getNom($langs).'</b><br>';
|
||||
} elseif ($type == -1) {
|
||||
$s .= $langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
|
||||
} elseif ($type == 0) {
|
||||
$s .= $langs->trans("CustomerCodeDesc").'<br>';
|
||||
} elseif ($type == 1) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (C) 2015-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015 Benoit Bruchard <benoitb21@gmail.com>
|
||||
* Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -62,7 +63,7 @@ if ($action == 'specimen') {
|
|||
// Search template files
|
||||
$dir = DOL_DOCUMENT_ROOT."/core/modules/dons/";
|
||||
$file = $modele.".modules.php";
|
||||
if (file_exists($dir.$file)) {
|
||||
if ($modele !== '' && file_exists($dir.$file)) {
|
||||
$classname = $modele;
|
||||
require_once $dir.$file;
|
||||
|
||||
|
|
|
|||
|
|
@ -2934,19 +2934,17 @@ class EmailCollector extends CommonObject
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$reldir = '';
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/project/".$modele.'.php', 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = $modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
if ($savesocid > 0) {
|
||||
if ($savesocid != $projecttocreate->socid) {
|
||||
$errorforactions++;
|
||||
|
|
|
|||
|
|
@ -1803,7 +1803,7 @@ if ($action == 'create') {
|
|||
// Confirm deletion
|
||||
if ($action == 'delete') {
|
||||
$formquestion = array();
|
||||
if ($object->statut == Expedition::STATUS_CLOSED && getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) {
|
||||
if ($object->status == Expedition::STATUS_CLOSED && getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT_CLOSE')) {
|
||||
$formquestion = array(
|
||||
array(
|
||||
'label' => $langs->trans('ShipmentIncrementStockOnDelete'),
|
||||
|
|
@ -2184,7 +2184,7 @@ if ($action == 'create') {
|
|||
$editColspan--;
|
||||
}
|
||||
print '<td class="center linecoleditlineotherinfo" colspan="'.$editColspan.'">';
|
||||
if ($object->statut <= 1) {
|
||||
if ($object->status <= 1) {
|
||||
print $langs->trans("QtyToShip").' - ';
|
||||
} else {
|
||||
print $langs->trans("QtyShipped").' - ';
|
||||
|
|
@ -2197,7 +2197,7 @@ if ($action == 'create') {
|
|||
}
|
||||
print '</td>';
|
||||
} else {
|
||||
if ($object->statut <= 1) {
|
||||
if ($object->status <= 1) {
|
||||
print '<td class="center linecolqtytoship">'.$langs->trans("QtyToShip").'</td>';
|
||||
} else {
|
||||
print '<td class="center linecolqtyshipped">'.$langs->trans("QtyShipped").'</td>';
|
||||
|
|
@ -2213,7 +2213,7 @@ if ($action == 'create') {
|
|||
print '<td class="center linecolweight">'.$langs->trans("CalculatedWeight").'</td>';
|
||||
print '<td class="center linecolvolume">'.$langs->trans("CalculatedVolume").'</td>';
|
||||
//print '<td class="center">'.$langs->trans("Size").'</td>';
|
||||
if ($object->statut == 0) {
|
||||
if ($object->status == 0) {
|
||||
print '<td class="linecoledit"></td>';
|
||||
print '<td class="linecoldelete" width="10"></td>';
|
||||
}
|
||||
|
|
@ -2574,7 +2574,7 @@ if ($action == 'create') {
|
|||
print '<input type="submit" class="button button-save" id="savelinebutton marginbottomonly" name="save" value="'.$langs->trans("Save").'"><br>';
|
||||
print '<input type="submit" class="button button-cancel" id="cancellinebutton" name="cancel" value="'.$langs->trans("Cancel").'"><br>';
|
||||
print '</td>';
|
||||
} elseif ($object->statut == Expedition::STATUS_DRAFT) {
|
||||
} elseif ($object->status == Expedition::STATUS_DRAFT) {
|
||||
// edit-delete buttons
|
||||
print '<td class="linecoledit center">';
|
||||
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editline&token='.newToken().'&lineid='.$lines[$i]->id.'">'.img_edit().'</a>';
|
||||
|
|
@ -2647,7 +2647,7 @@ if ($action == 'create') {
|
|||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
// modified by hook
|
||||
if (empty($reshook)) {
|
||||
if ($object->statut == Expedition::STATUS_DRAFT && $num_prod > 0) {
|
||||
if ($object->status == Expedition::STATUS_DRAFT && $num_prod > 0) {
|
||||
if ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'creer'))
|
||||
|| (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('expedition', 'shipping_advance', 'validate'))) {
|
||||
print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=valid&token='.newToken().'&id='.$object->id, '');
|
||||
|
|
@ -2657,12 +2657,12 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// 0=draft, 1=validated/delivered, 2=closed/delivered
|
||||
if ($object->statut == Expedition::STATUS_VALIDATED && !getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) {
|
||||
if ($object->status == Expedition::STATUS_VALIDATED && !getDolGlobalString('STOCK_CALCULATE_ON_SHIPMENT')) {
|
||||
if ($user->hasRight('expedition', 'creer')) {
|
||||
print dolGetButtonAction('', $langs->trans('SetToDraft'), 'default', $_SERVER["PHP_SELF"].'?action=setdraft&token='.newToken().'&id='.$object->id, '');
|
||||
}
|
||||
}
|
||||
if ($object->statut == Expedition::STATUS_CLOSED) {
|
||||
if ($object->status == Expedition::STATUS_CLOSED) {
|
||||
if ($user->hasRight('expedition', 'creer')) {
|
||||
print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
|
||||
}
|
||||
|
|
@ -2670,7 +2670,7 @@ if ($action == 'create') {
|
|||
|
||||
// Send
|
||||
if (empty($user->socid)) {
|
||||
if ($object->statut > 0) {
|
||||
if ($object->status > 0) {
|
||||
if (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('expedition', 'shipping_advance', 'send')) {
|
||||
print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
|
||||
} else {
|
||||
|
|
@ -2680,7 +2680,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Create bill
|
||||
if (isModEnabled('invoice') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) {
|
||||
if (isModEnabled('invoice') && ($object->status == Expedition::STATUS_VALIDATED || $object->status == Expedition::STATUS_CLOSED)) {
|
||||
if ($user->hasRight('facture', 'creer')) {
|
||||
if (getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') {
|
||||
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, '');
|
||||
|
|
@ -2690,13 +2690,13 @@ if ($action == 'create') {
|
|||
|
||||
// This is just to generate a delivery receipt
|
||||
//var_dump($object->linkedObjectsIds['delivery']);
|
||||
if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->hasRight('expedition', 'delivery', 'creer') && empty($object->linkedObjectsIds['delivery'])) {
|
||||
if (getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') && ($object->status == Expedition::STATUS_VALIDATED || $object->status == Expedition::STATUS_CLOSED) && $user->hasRight('expedition', 'delivery', 'creer') && empty($object->linkedObjectsIds['delivery'])) {
|
||||
print dolGetButtonAction('', $langs->trans('CreateDeliveryOrder'), 'default', $_SERVER["PHP_SELF"].'?action=create_delivery&token='.newToken().'&id='.$object->id, '');
|
||||
}
|
||||
|
||||
// Set Billed and Closed
|
||||
if ($object->statut == Expedition::STATUS_VALIDATED) {
|
||||
if ($user->hasRight('expedition', 'creer') && $object->statut > 0) {
|
||||
if ($object->status == Expedition::STATUS_VALIDATED) {
|
||||
if ($user->hasRight('expedition', 'creer') && $object->status > 0) {
|
||||
if (!$object->billed && getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT') !== '0') {
|
||||
print dolGetButtonAction('', $langs->trans('ClassifyBilled'), 'default', $_SERVER["PHP_SELF"].'?action=classifybilled&token='.newToken().'&id='.$object->id, '');
|
||||
}
|
||||
|
|
@ -2705,7 +2705,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Cancel
|
||||
if ($object->statut == Expedition::STATUS_VALIDATED) {
|
||||
if ($object->status == Expedition::STATUS_VALIDATED) {
|
||||
if ($user->hasRight('expedition', 'creer')) {
|
||||
print dolGetButtonAction('', $langs->trans('Cancel'), 'danger', $_SERVER["PHP_SELF"].'?action=cancel&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -657,7 +657,7 @@ if (isModEnabled('category') && $user->hasRight('categorie', 'lire') && ($user->
|
|||
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$tmptitle = $langs->trans('IncludingProductWithTag');
|
||||
$moreforfilter .= img_picto($tmptitle, 'category');
|
||||
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
|
||||
//$cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
|
||||
//$moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
|
||||
$moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category, 'search_product_category', 1, $tmptitle);
|
||||
|
|
@ -668,7 +668,7 @@ if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) {
|
|||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
|
||||
$moreforfilter .= img_picto($tmptitle, 'category');
|
||||
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
|
||||
$moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle);
|
||||
$moreforfilter .= '</div>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1667,7 +1667,7 @@ if ($action == 'create') {
|
|||
}
|
||||
$formquestion = array(
|
||||
'text' => '',
|
||||
array('type' => 'other', 'name' => 'fk_user_author', 'label' => $langs->trans("SelectTargetUser"), 'value' => $form->select_dolusers((GETPOSTINT('fk_user_author') > 0 ? GETPOSTINT('fk_user_author') : $user->id), 'fk_user_author', 0, null, 0, $criteriaforfilter, '', '0', 0, 0, '', 0, '', 'maxwidth150'))
|
||||
0 => array('type' => 'other', 'name' => 'fk_user_author', 'label' => $langs->trans("SelectTargetUser"), 'value' => $form->select_dolusers((GETPOSTINT('fk_user_author') > 0 ? GETPOSTINT('fk_user_author') : $user->id), 'fk_user_author', 0, null, 0, $criteriaforfilter, '', '0', 0, 0, '', 0, '', 'maxwidth150'))
|
||||
);
|
||||
// Paiement incomplet. On demande si motif = escompte ou autre
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneExpenseReport', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
|
||||
|
|
@ -1694,7 +1694,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
if ($action == 'cancel') {
|
||||
$array_input = array('text' => $langs->trans("ConfirmCancelTrip"), array('type' => "text", 'label' => '<strong>'.$langs->trans("Comment").'</strong>', 'name' => "detail_cancel", 'value' => ""));
|
||||
$array_input = array('text' => $langs->trans("ConfirmCancelTrip"), 0 => array('type' => "text", 'label' => '<strong>'.$langs->trans("Comment").'</strong>', 'name' => "detail_cancel", 'value' => ""));
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("Cancel"), "", "confirm_cancel", $array_input, "", 1);
|
||||
}
|
||||
|
||||
|
|
@ -1703,7 +1703,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
if ($action == 'refuse') { // Deny
|
||||
$array_input = array('text' => $langs->trans("ConfirmRefuseTrip"), array('type' => "text", 'label' => $langs->trans("Comment"), 'name' => "detail_refuse", 'value' => ""));
|
||||
$array_input = array('text' => $langs->trans("ConfirmRefuseTrip"), 0 => array('type' => "text", 'label' => $langs->trans("Comment"), 'name' => "detail_refuse", 'value' => ""));
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id, $langs->trans("Deny"), '', "confirm_refuse", $array_input, "yes", 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (c) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2016-2020 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -72,8 +73,14 @@ class ExpenseReport extends CommonObject
|
|||
*/
|
||||
public $line;
|
||||
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_debut;
|
||||
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_fin;
|
||||
|
||||
/**
|
||||
|
|
@ -86,6 +93,9 @@ class ExpenseReport extends CommonObject
|
|||
*/
|
||||
public $fk_user;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $user_approve_id;
|
||||
|
||||
/**
|
||||
|
|
@ -107,6 +117,8 @@ class ExpenseReport extends CommonObject
|
|||
public $modepaymentid;
|
||||
|
||||
public $paid;
|
||||
// Paiement
|
||||
public $user_paid_infos;
|
||||
|
||||
public $user_author_infos;
|
||||
public $user_validator_infos;
|
||||
|
|
@ -116,6 +128,9 @@ class ExpenseReport extends CommonObject
|
|||
// ACTIONS
|
||||
|
||||
// Create
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_create;
|
||||
|
||||
/**
|
||||
|
|
@ -129,16 +144,41 @@ class ExpenseReport extends CommonObject
|
|||
public $fk_user_author; // Note fk_user_author is not the 'author' but the guy the expense report is for.
|
||||
|
||||
// Update
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_modif;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_user_modif;
|
||||
|
||||
// Refus
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_refuse;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $detail_refuse;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $fk_user_refuse;
|
||||
|
||||
// Annulation
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_cancel;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $detail_cancel;
|
||||
|
||||
/**
|
||||
|
|
@ -169,37 +209,36 @@ class ExpenseReport extends CommonObject
|
|||
* @var int ID of User making validation
|
||||
*/
|
||||
public $fk_user_valid;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $user_valid_infos;
|
||||
|
||||
// Approve
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $date_approve;
|
||||
public $fk_user_approve; // User that has approved
|
||||
|
||||
// Paiement
|
||||
public $user_paid_infos;
|
||||
/**
|
||||
* @var int ID User that has approved
|
||||
*/
|
||||
public $fk_user_approve;
|
||||
|
||||
public $localtax1; // for backward compatibility (real field should be total_localtax1 defined into CommonObject)
|
||||
public $localtax2; // for backward compatibility (real field should be total_localtax2 defined into CommonObject)
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $labelStatus = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
public $labelStatusShort = array();
|
||||
|
||||
// Multicurrency
|
||||
/**
|
||||
* @var int Currency ID
|
||||
*/
|
||||
public $fk_multicurrency;
|
||||
|
||||
/**
|
||||
* @var string multicurrency code
|
||||
*/
|
||||
public $multicurrency_code;
|
||||
public $multicurrency_tx;
|
||||
public $multicurrency_total_ht;
|
||||
public $multicurrency_total_tva;
|
||||
public $multicurrency_total_ttc;
|
||||
|
||||
|
||||
/**
|
||||
* Draft status
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (c) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -35,13 +36,34 @@ class ExpenseReportStats extends Stats
|
|||
*/
|
||||
public $table_element;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $socid;
|
||||
|
||||
/**
|
||||
* @var int ID
|
||||
*/
|
||||
public $userid;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $from;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $field;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $where;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $datetouse = 'date_valid';
|
||||
|
||||
|
||||
|
|
@ -120,7 +142,7 @@ class ExpenseReportStats extends Stats
|
|||
$sql .= $this->db->order('dm', 'DESC');
|
||||
|
||||
$res = $this->_getNbByMonth($year, $sql, $format);
|
||||
//var_dump($res);print '<br>';
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +164,7 @@ class ExpenseReportStats extends Stats
|
|||
$sql .= $this->db->order('dm', 'DESC');
|
||||
|
||||
$res = $this->_getAmountByMonth($year, $sql, $format);
|
||||
//var_dump($res);print '<br>';
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,14 @@ class PaymentExpenseReport extends CommonObject
|
|||
*/
|
||||
public $fk_expensereport;
|
||||
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $datec = '';
|
||||
|
||||
/**
|
||||
* @var int|string
|
||||
*/
|
||||
public $datep = '';
|
||||
public $amount; // Total amount of payment
|
||||
public $amounts = array(); // Array of amounts
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
|
||||
* Copyright (C) 2023 Nick Fragoulis
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -3094,7 +3095,7 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Create a form table
|
||||
$formquestion = array('text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"), array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'morecss' => 'minwidth300'));
|
||||
$formquestion = array('text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"), 0 => array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), 1 => array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'morecss' => 'minwidth300'));
|
||||
// Incomplete payment. We ask if the reason is discount or other
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidPartially', $object->ref), 'confirm_paid_partially', $formquestion, "yes", 1, 310);
|
||||
}
|
||||
|
|
@ -3115,7 +3116,7 @@ if ($action == 'create') {
|
|||
$arrayreasons[$close[2]['code']] = $close[2]['reason'];
|
||||
|
||||
// Create a form table
|
||||
$formquestion = array('text' => $langs->trans("ConfirmCancelBillQuestion"), array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'morecss' => 'minwidth300'));
|
||||
$formquestion = array('text' => $langs->trans("ConfirmCancelBillQuestion"), 0 => array('type' => 'radio', 'name' => 'close_code', 'label' => $langs->trans("Reason"), 'values' => $arrayreasons), 1 => array('type' => 'text', 'name' => 'close_note', 'label' => $langs->trans("Comment"), 'value' => '', 'morecss' => 'minwidth300'));
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('CancelBill'), $langs->trans('ConfirmCancelBill', $object->ref), 'confirm_canceled', $formquestion, "yes", 1, 280);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014-2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020-2021 Udo Tamm <dev@dolibit.de>
|
||||
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
*
|
||||
|
|
@ -108,7 +108,7 @@ $candelete = 0;
|
|||
if ($user->hasRight('holiday', 'delete')) {
|
||||
$candelete = 1;
|
||||
}
|
||||
if ($object->statut == Holiday::STATUS_DRAFT && $user->hasRight('holiday', 'write') && in_array($object->fk_user, $childids)) {
|
||||
if ($object->status == Holiday::STATUS_DRAFT && $user->hasRight('holiday', 'write') && in_array($object->fk_user, $childids)) {
|
||||
$candelete = 1;
|
||||
}
|
||||
|
||||
|
|
@ -116,7 +116,7 @@ if ($object->statut == Holiday::STATUS_DRAFT && $user->hasRight('holiday', 'writ
|
|||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$result = restrictedArea($user, 'holiday', $object->id, 'holiday', '', '', 'rowid', $object->statut);
|
||||
$result = restrictedArea($user, 'holiday', $object->id, 'holiday', '', '', 'rowid', $object->status);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -357,7 +357,7 @@ if (empty($reshook)) {
|
|||
$object->fetch($id);
|
||||
|
||||
// If under validation
|
||||
if ($object->statut == Holiday::STATUS_DRAFT) {
|
||||
if ($object->status == Holiday::STATUS_DRAFT) {
|
||||
// If this is the requester or has read/write rights
|
||||
if ($cancreate) {
|
||||
$approverid = GETPOSTINT('valideur');
|
||||
|
|
@ -440,7 +440,7 @@ if (empty($reshook)) {
|
|||
$object->fetch($id);
|
||||
|
||||
// If this is a rough draft, approved, canceled or refused
|
||||
if ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED) {
|
||||
if ($object->status == Holiday::STATUS_DRAFT || $object->status == Holiday::STATUS_CANCELED || $object->status == Holiday::STATUS_REFUSED) {
|
||||
$result = $object->delete($user);
|
||||
} else {
|
||||
$error++;
|
||||
|
|
@ -462,10 +462,10 @@ if (empty($reshook)) {
|
|||
$object->fetch($id);
|
||||
|
||||
// If draft and owner of leave
|
||||
if ($object->statut == Holiday::STATUS_DRAFT && $cancreate) {
|
||||
if ($object->status == Holiday::STATUS_DRAFT && $cancreate) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
|
||||
$object->statut = Holiday::STATUS_VALIDATED;
|
||||
$object->status = Holiday::STATUS_VALIDATED;
|
||||
|
||||
$verif = $object->validate($user);
|
||||
|
||||
|
|
@ -598,7 +598,7 @@ if (empty($reshook)) {
|
|||
$object->fetch($id);
|
||||
|
||||
// If status is waiting approval and approver is also user
|
||||
if ($object->statut == Holiday::STATUS_VALIDATED && $user->id == $object->fk_validator) {
|
||||
if ($object->status == Holiday::STATUS_VALIDATED && $user->id == $object->fk_validator) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
|
||||
$object->date_approval = dol_now();
|
||||
|
|
@ -703,7 +703,7 @@ if (empty($reshook)) {
|
|||
$object->fetch($id);
|
||||
|
||||
// If status pending validation and validator = user
|
||||
if ($object->statut == Holiday::STATUS_VALIDATED && $user->id == $object->fk_validator) {
|
||||
if ($object->status == Holiday::STATUS_VALIDATED && $user->id == $object->fk_validator) {
|
||||
$object->date_refuse = dol_now();
|
||||
$object->fk_user_refuse = $user->id;
|
||||
$object->statut = Holiday::STATUS_REFUSED;
|
||||
|
|
@ -794,7 +794,7 @@ if (empty($reshook)) {
|
|||
|
||||
$object->fetch($id);
|
||||
|
||||
$oldstatus = $object->statut;
|
||||
$oldstatus = $object->status;
|
||||
$object->statut = Holiday::STATUS_DRAFT;
|
||||
$object->status = Holiday::STATUS_DRAFT;
|
||||
|
||||
|
|
@ -821,11 +821,11 @@ if (empty($reshook)) {
|
|||
$object->fetch($id);
|
||||
|
||||
// If status pending validation and validator = validator or user, or rights to do for others
|
||||
if (($object->statut == Holiday::STATUS_VALIDATED || $object->statut == Holiday::STATUS_APPROVED) &&
|
||||
if (($object->status == Holiday::STATUS_VALIDATED || $object->status == Holiday::STATUS_APPROVED) &&
|
||||
(!empty($user->admin) || $user->id == $object->fk_validator || $cancreate || $cancreateall)) {
|
||||
$db->begin();
|
||||
|
||||
$oldstatus = $object->statut;
|
||||
$oldstatus = $object->status;
|
||||
$object->date_cancel = dol_now();
|
||||
$object->fk_user_cancel = $user->id;
|
||||
$object->statut = Holiday::STATUS_CANCELED;
|
||||
|
|
@ -1253,8 +1253,8 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
if ($canread) {
|
||||
$head = holiday_prepare_head($object);
|
||||
|
||||
if (($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) || ($action == 'editvalidator')) {
|
||||
if ($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) {
|
||||
if (($action == 'edit' && $object->status == Holiday::STATUS_DRAFT) || ($action == 'editvalidator')) {
|
||||
if ($action == 'edit' && $object->status == Holiday::STATUS_DRAFT) {
|
||||
$edit = true;
|
||||
}
|
||||
|
||||
|
|
@ -1290,8 +1290,12 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td>';
|
||||
$typeleaves = $object->getTypes(1, -1);
|
||||
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
|
||||
print empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow;
|
||||
if (empty($typeleaves[$object->fk_type])) {
|
||||
$labeltoshow = $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type);
|
||||
} else {
|
||||
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
|
||||
}
|
||||
print $labeltoshow;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
@ -1364,7 +1368,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($object->statut == Holiday::STATUS_REFUSED) {
|
||||
if ($object->status == Holiday::STATUS_REFUSED) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DetailRefusCP').'</td>';
|
||||
print '<td>'.$object->detail_refuse.'</td>';
|
||||
|
|
@ -1414,14 +1418,14 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
if (!$edit && $action != 'editvalidator') {
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">';
|
||||
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
||||
if ($object->status == Holiday::STATUS_APPROVED || $object->status == Holiday::STATUS_CANCELED) {
|
||||
print $langs->trans('ApprovedBy');
|
||||
} else {
|
||||
print $langs->trans('ReviewedByCP');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
||||
if ($object->status == Holiday::STATUS_APPROVED || $object->status == Holiday::STATUS_CANCELED) {
|
||||
if ($object->fk_user_approve > 0) {
|
||||
$approverdone = new User($db);
|
||||
$approverdone->fetch($object->fk_user_approve);
|
||||
|
|
@ -1431,7 +1435,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
print $approverexpected->getNomUrl(-1);
|
||||
}
|
||||
$include_users = $object->fetch_users_approver_holiday();
|
||||
if (is_array($include_users) && in_array($user->id, $include_users) && $object->statut == Holiday::STATUS_VALIDATED) {
|
||||
if (is_array($include_users) && in_array($user->id, $include_users) && $object->status == Holiday::STATUS_VALIDATED) {
|
||||
print '<a class="editfielda paddingleft" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=editvalidator">'.img_edit($langs->trans("Edit")).'</a>';
|
||||
}
|
||||
print '</td>';
|
||||
|
|
@ -1463,19 +1467,19 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
print '<td>'.$langs->trans('DateCreation').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_create, 'dayhour', 'tzuser').'</td>';
|
||||
print '</tr>';
|
||||
if ($object->statut == Holiday::STATUS_APPROVED || $object->statut == Holiday::STATUS_CANCELED) {
|
||||
if ($object->status == Holiday::STATUS_APPROVED || $object->status == Holiday::STATUS_CANCELED) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateValidCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_approval, 'dayhour', 'tzuser').'</td>'; // warning: date_valid is approval date on holiday module
|
||||
print '</tr>';
|
||||
}
|
||||
if ($object->statut == Holiday::STATUS_CANCELED) {
|
||||
if ($object->status == Holiday::STATUS_CANCELED) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateCancelCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_cancel, 'dayhour', 'tzuser').'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($object->statut == Holiday::STATUS_REFUSED) {
|
||||
if ($object->status == Holiday::STATUS_REFUSED) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateRefusCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_refuse, 'dayhour', 'tzuser').'</td>';
|
||||
|
|
@ -1500,7 +1504,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
}
|
||||
|
||||
// Si envoi en validation
|
||||
if ($action == 'sendToValidate' && $object->statut == Holiday::STATUS_DRAFT) {
|
||||
if ($action == 'sendToValidate' && $object->status == Holiday::STATUS_DRAFT) {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("TitleToValidCP"), $langs->trans("ConfirmToValidCP"), "confirm_send", '', 1, 1);
|
||||
}
|
||||
|
||||
|
|
@ -1525,9 +1529,9 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("TitleSetToDraft"), $langs->trans("ConfirmSetToDraft"), "confirm_draft", '', 1, 1);
|
||||
}
|
||||
|
||||
if (($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) || ($action == 'editvalidator')) {
|
||||
if ($action == 'edit' && $object->statut == Holiday::STATUS_DRAFT) {
|
||||
if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) {
|
||||
if (($action == 'edit' && $object->status == Holiday::STATUS_DRAFT) || ($action == 'editvalidator')) {
|
||||
if ($action == 'edit' && $object->status == Holiday::STATUS_DRAFT) {
|
||||
if ($cancreate && $object->status == Holiday::STATUS_DRAFT) {
|
||||
print $form->buttonsSaveCancel();
|
||||
}
|
||||
}
|
||||
|
|
@ -1540,15 +1544,15 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) {
|
||||
if ($cancreate && $object->status == Holiday::STATUS_DRAFT) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'" class="butAction">'.$langs->trans("EditCP").'</a>';
|
||||
}
|
||||
|
||||
if ($cancreate && $object->statut == Holiday::STATUS_DRAFT) { // If draft
|
||||
if ($cancreate && $object->status == Holiday::STATUS_DRAFT) { // If draft
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=sendToValidate&token='.newToken().'" class="butAction">'.$langs->trans("Validate").'</a>';
|
||||
}
|
||||
|
||||
if ($object->statut == Holiday::STATUS_VALIDATED) { // If validated
|
||||
if ($object->status == Holiday::STATUS_VALIDATED) { // If validated
|
||||
// Button Approve / Refuse
|
||||
if ($user->id == $object->fk_validator) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=valid&token='.newToken().'" class="butAction">'.$langs->trans("Approve").'</a>';
|
||||
|
|
@ -1567,7 +1571,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
}
|
||||
}
|
||||
}
|
||||
if ($object->statut == Holiday::STATUS_APPROVED) { // If validated and approved
|
||||
if ($object->status == Holiday::STATUS_APPROVED) { // If validated and approved
|
||||
if ($user->id == $object->fk_validator || $user->id == $object->fk_user_approve || $cancreate || $cancreateall) {
|
||||
if (($object->date_fin > dol_now()) || !empty($user->admin) || $user->id == $object->fk_user_approve) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=cancel&token='.newToken().'" class="butAction">'.$langs->trans("ActionCancelCP").'</a>';
|
||||
|
|
@ -1583,10 +1587,10 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add') {
|
|||
}
|
||||
}
|
||||
|
||||
if (($cancreate || $cancreateall) && $object->statut == Holiday::STATUS_CANCELED) {
|
||||
if (($cancreate || $cancreateall) && $object->status == Holiday::STATUS_CANCELED) {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=backtodraft" class="butAction">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
if ($candelete && ($object->statut == Holiday::STATUS_DRAFT || $object->statut == Holiday::STATUS_CANCELED || $object->statut == Holiday::STATUS_REFUSED)) { // If draft or canceled or refused
|
||||
if ($candelete && ($object->status == Holiday::STATUS_DRAFT || $object->status == Holiday::STATUS_CANCELED || $object->status == Holiday::STATUS_REFUSED)) { // If draft or canceled or refused
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken().'" class="butActionDelete">'.$langs->trans("DeleteCP").'</a>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014-2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020-2021 Udo Tamm <dev@dolibit.de>
|
||||
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
|
|
@ -50,10 +50,10 @@ $confirm = GETPOST('confirm', 'alpha');
|
|||
$id = GETPOSTINT('id');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$fuserid = (GETPOSTINT('fuserid') ? GETPOSTINT('fuserid') : $user->id);
|
||||
$users = (GETPOST('users', 'array') ? GETPOST('users', 'array') : array($user->id));
|
||||
$users = (GETPOST('users', 'array') ? GETPOST('users', 'array') : array($user->id));
|
||||
$groups = GETPOST('groups', 'array');
|
||||
$socid = GETPOSTINT('socid');
|
||||
$autoValidation = GETPOSTINT('autoValidation');
|
||||
$autoValidation = GETPOSTINT('autoValidation');
|
||||
$AutoSendMail = GETPOSTINT('AutoSendMail');
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("other", "holiday", "mails", "trips"));
|
||||
|
|
@ -109,7 +109,7 @@ $candelete = 0;
|
|||
if ($user->hasRight('holiday', 'delete')) {
|
||||
$candelete = 1;
|
||||
}
|
||||
if ($object->statut == Holiday::STATUS_DRAFT && $user->hasRight('holiday', 'write') && in_array($object->fk_user, $childids)) {
|
||||
if ($object->status == Holiday::STATUS_DRAFT && $user->hasRight('holiday', 'write') && in_array($object->fk_user, $childids)) {
|
||||
$candelete = 1;
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ if ($object->statut == Holiday::STATUS_DRAFT && $user->hasRight('holiday', 'writ
|
|||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
$result = restrictedArea($user, 'holiday', $object->id, 'holiday', '', '', 'rowid', $object->statut);
|
||||
$result = restrictedArea($user, 'holiday', $object->id, 'holiday', '', '', 'rowid', $object->status);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -325,7 +325,7 @@ if (empty($reshook)) {
|
|||
$htemp = new Holiday($db);
|
||||
$htemp->fetch($result);
|
||||
|
||||
$htemp->statut = Holiday::STATUS_VALIDATED;
|
||||
$htemp->status = Holiday::STATUS_VALIDATED;
|
||||
$resultValidated = $htemp->update($approverid);
|
||||
|
||||
if ($resultValidated < 0) {
|
||||
|
|
@ -685,10 +685,10 @@ function sendMail($id, $cancreate, $now, $autoValidation)
|
|||
|
||||
if ($result) {
|
||||
// If draft and owner of leave
|
||||
if ($object->statut == Holiday::STATUS_VALIDATED && $cancreate) {
|
||||
if ($object->status == Holiday::STATUS_VALIDATED && $cancreate) {
|
||||
$object->oldcopy = dol_clone($object, 2);
|
||||
|
||||
//if ($autoValidation) $object->statut = Holiday::STATUS_VALIDATED;
|
||||
//if ($autoValidation) $object->status = Holiday::STATUS_VALIDATED;
|
||||
|
||||
$verif = $object->validate($user);
|
||||
|
||||
|
|
|
|||
|
|
@ -71,17 +71,36 @@ class Holiday extends CommonObject
|
|||
*/
|
||||
public $description;
|
||||
|
||||
public $date_debut = ''; // Date start in PHP server TZ
|
||||
public $date_fin = ''; // Date end in PHP server TZ
|
||||
public $date_debut_gmt = ''; // Date start in GMT
|
||||
public $date_fin_gmt = ''; // Date end in GMT
|
||||
public $halfday = ''; // 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
|
||||
/**
|
||||
* @var int|string Date start in PHP server TZ
|
||||
*/
|
||||
public $date_debut = '';
|
||||
|
||||
/**
|
||||
* @var int
|
||||
* @var int|string Date end in PHP server TZ
|
||||
*/
|
||||
public $date_fin = '';
|
||||
|
||||
/**
|
||||
* @var int|string Date start in GMT
|
||||
*/
|
||||
public $date_debut_gmt = '';
|
||||
|
||||
/**
|
||||
* @var int|string Date end in GMT
|
||||
*/
|
||||
public $date_fin_gmt = '';
|
||||
|
||||
/**
|
||||
* @var int|string 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning
|
||||
*/
|
||||
public $halfday = '';
|
||||
|
||||
/**
|
||||
* @var int Status 1=draft, 2=validated, 3=approved, 4 canceled, 5 refused
|
||||
* @deprecated
|
||||
*/
|
||||
public $statut = 0; // 1=draft, 2=validated, 3=approved
|
||||
public $statut = 0;
|
||||
|
||||
/**
|
||||
* @var int ID of user that must approve. Real user for approval is fk_user_valid (old version) or fk_user_approve (new versions)
|
||||
|
|
@ -133,7 +152,9 @@ class Holiday extends CommonObject
|
|||
*/
|
||||
public $fk_user_create;
|
||||
|
||||
|
||||
/**
|
||||
* @var string Detail of refuse
|
||||
*/
|
||||
public $detail_refuse = '';
|
||||
|
||||
/**
|
||||
|
|
@ -760,8 +781,8 @@ class Holiday extends CommonObject
|
|||
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday SET";
|
||||
$sql .= " fk_user_valid = ".((int) $user->id).",";
|
||||
$sql .= " date_valid = '".$this->db->idate(dol_now())."',";
|
||||
if (!empty($this->statut) && is_numeric($this->statut)) {
|
||||
$sql .= " statut = ".((int) $this->statut).",";
|
||||
if (!empty($this->status) && is_numeric($this->status)) {
|
||||
$sql .= " statut = ".((int) $this->status).",";
|
||||
} else {
|
||||
$this->error = 'Property status must be a numeric value';
|
||||
$error++;
|
||||
|
|
@ -888,8 +909,8 @@ class Holiday extends CommonObject
|
|||
$error++;
|
||||
}
|
||||
$sql .= " halfday = ".((int) $this->halfday).",";
|
||||
if (!empty($this->statut) && is_numeric($this->statut)) {
|
||||
$sql .= " statut = ".((int) $this->statut).",";
|
||||
if (!empty($this->status) && is_numeric($this->status)) {
|
||||
$sql .= " statut = ".((int) $this->status).",";
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -993,7 +1014,7 @@ class Holiday extends CommonObject
|
|||
|
||||
$checkBalance = getDictionaryValue('c_holiday_types', 'block_if_negative', $this->fk_type);
|
||||
|
||||
if ($checkBalance > 0 && $this->statut != self::STATUS_DRAFT) {
|
||||
if ($checkBalance > 0 && $this->status != self::STATUS_DRAFT) {
|
||||
$balance = $this->getCPforUser($this->fk_user, $this->fk_type);
|
||||
|
||||
if ($balance < 0) {
|
||||
|
|
@ -1018,8 +1039,8 @@ class Holiday extends CommonObject
|
|||
$error++;
|
||||
}
|
||||
$sql .= " halfday = ".$this->halfday.",";
|
||||
if (!empty($this->statut) && is_numeric($this->statut)) {
|
||||
$sql .= " statut = ".$this->statut.",";
|
||||
if (!empty($this->status) && is_numeric($this->status)) {
|
||||
$sql .= " statut = ".$this->status.",";
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
|
|
@ -1338,7 +1359,7 @@ class Holiday extends CommonObject
|
|||
|
||||
$datas = array();
|
||||
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("Holiday").'</u>';
|
||||
if (isset($this->statut)) {
|
||||
if (isset($this->status)) {
|
||||
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||
}
|
||||
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
|
|
@ -1457,17 +1478,17 @@ class Holiday extends CommonObject
|
|||
*/
|
||||
public function getLibStatut($mode = 0)
|
||||
{
|
||||
return $this->LibStatut($this->statut, $mode, $this->date_debut);
|
||||
return $this->LibStatut($this->status, $mode, $this->date_debut);
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Returns the label of a status
|
||||
*
|
||||
* @param int $status Id status
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @param integer $startdate Date holiday should start
|
||||
* @return string Label
|
||||
* @param int $status Id status
|
||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
|
||||
* @param int|string $startdate Date holiday should start
|
||||
* @return string Label
|
||||
*/
|
||||
public function LibStatut($status, $mode = 0, $startdate = '')
|
||||
{
|
||||
|
|
@ -1520,7 +1541,7 @@ class Holiday extends CommonObject
|
|||
* @param string $morecss More CSS on select component
|
||||
* @return string Show select of status
|
||||
*/
|
||||
public function selectStatutCP($selected = '', $htmlname = 'select_statut', $morecss = 'minwidth125')
|
||||
public function selectStatutCP($selected = 0, $htmlname = 'select_statut', $morecss = 'minwidth125')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
|
@ -1541,7 +1562,7 @@ class Holiday extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
$out .= '</select>'."\n";
|
||||
$out .= "</select>\n";
|
||||
|
||||
$showempty = 0;
|
||||
$out .= ajax_combobox($htmlname, array(), 0, 0, 'resolve', ($showempty < 0 ? (string) $showempty : '-1'), $morecss);
|
||||
|
|
@ -1623,7 +1644,7 @@ class Holiday extends CommonObject
|
|||
* @param int $fk_type Type of vacation
|
||||
* @return int 0=Nothing done, 1=OK, -1=KO
|
||||
*/
|
||||
public function updateSoldeCP($userID = '', $nbHoliday = '', $fk_type = '')
|
||||
public function updateSoldeCP($userID = 0, $nbHoliday = 0, $fk_type = 0)
|
||||
{
|
||||
global $user, $langs;
|
||||
|
||||
|
|
@ -1741,7 +1762,7 @@ class Holiday extends CommonObject
|
|||
* @param int $userid Id user
|
||||
* @return void
|
||||
*/
|
||||
public function createCPusers($single = false, $userid = '')
|
||||
public function createCPusers($single = false, $userid = 0)
|
||||
{
|
||||
// do we have to add balance for all users ?
|
||||
if (!$single) {
|
||||
|
|
@ -2324,7 +2345,7 @@ class Holiday extends CommonObject
|
|||
$this->date_approval = $this->db->jdate($obj->datea);
|
||||
|
||||
$this->user_creation_id = $obj->fk_user_creation;
|
||||
$this->user_validation_id = $obj->fk_user_valid;
|
||||
$this->user_validation_id = $obj->fk_user_validation;
|
||||
$this->user_modification_id = $obj->fk_user_modification;
|
||||
|
||||
if ($obj->status == Holiday::STATUS_APPROVED || $obj->status == Holiday::STATUS_CANCELED) {
|
||||
|
|
@ -2363,7 +2384,6 @@ class Holiday extends CommonObject
|
|||
$this->fk_validator = $user->id;
|
||||
$this->halfday = 0;
|
||||
$this->fk_type = 1;
|
||||
$this->statut = Holiday::STATUS_VALIDATED;
|
||||
$this->status = Holiday::STATUS_VALIDATED;
|
||||
|
||||
return 1;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
||||
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -431,7 +432,7 @@ if (count($typeleaves) == 0) {
|
|||
$userstatic->firstname = $users['firstname'];
|
||||
$userstatic->gender = $users['gender'];
|
||||
$userstatic->photo = $users['photo'];
|
||||
$userstatic->statut = $users['status'];
|
||||
$userstatic->status = $users['status'];
|
||||
$userstatic->employee = $users['employee'];
|
||||
$userstatic->fk_user = $users['fk_user'];
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Copyright (C) 2005 Simon TOSSER <simon@kornog-computing.com>
|
||||
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -167,8 +167,12 @@ if ($object->id) {
|
|||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
print '<td>';
|
||||
$typeleaves = $object->getTypes(1, -1);
|
||||
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
|
||||
print empty($labeltoshow) ? $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type) : $labeltoshow;
|
||||
if (empty($typeleaves[$object->fk_type])) {
|
||||
$labeltoshow = $langs->trans("TypeWasDisabledOrRemoved", $object->fk_type);
|
||||
} else {
|
||||
$labeltoshow = (($typeleaves[$object->fk_type]['code'] && $langs->trans($typeleaves[$object->fk_type]['code']) != $typeleaves[$object->fk_type]['code']) ? $langs->trans($typeleaves[$object->fk_type]['code']) : $typeleaves[$object->fk_type]['label']);
|
||||
}
|
||||
print $labeltoshow;
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
|
@ -212,7 +216,7 @@ if ($object->id) {
|
|||
print '<td>'.num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
if ($object->statut == 5) {
|
||||
if ($object->status == Holiday::STATUS_REFUSED) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DetailRefusCP').'</td>';
|
||||
print '<td>'.$object->detail_refuse.'</td>';
|
||||
|
|
@ -258,19 +262,19 @@ if ($object->id) {
|
|||
print '<td>'.$langs->trans('DateCreation').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_create,'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
if ($object->statut == 3) {
|
||||
if ($object->status == 3) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateValidCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_valid,'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($object->statut == 4) {
|
||||
if ($object->status == 4) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateCancelCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_cancel,'dayhour').'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
if ($object->statut == 5) {
|
||||
if ($object->status == 5) {
|
||||
print '<tr>';
|
||||
print '<td>'.$langs->trans('DateRefusCP').'</td>';
|
||||
print '<td>'.dol_print_date($object->date_refuse,'dayhour').'</td>';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Copyright (C) 2013-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2019-2023 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -842,7 +842,7 @@ if ($id && !$user->hasRight('holiday', 'readall') && !in_array($id, $childids))
|
|||
// Leave request
|
||||
$holidaystatic->id = $obj->rowid;
|
||||
$holidaystatic->ref = ($obj->ref ? $obj->ref : $obj->rowid);
|
||||
$holidaystatic->statut = $obj->status;
|
||||
$holidaystatic->status = $obj->status;
|
||||
$holidaystatic->date_debut = $db->jdate($obj->date_debut);
|
||||
$holidaystatic->date_fin = $db->jdate($obj->date_fin);
|
||||
|
||||
|
|
@ -853,7 +853,7 @@ if ($id && !$user->hasRight('holiday', 'readall') && !in_array($id, $childids))
|
|||
$userstatic->admin = $obj->user_admin;
|
||||
$userstatic->email = $obj->user_email;
|
||||
$userstatic->login = $obj->user_login;
|
||||
$userstatic->statut = $obj->user_status;
|
||||
$userstatic->status = $obj->user_status;
|
||||
$userstatic->photo = $obj->user_photo;
|
||||
|
||||
// Validator
|
||||
|
|
@ -863,7 +863,7 @@ if ($id && !$user->hasRight('holiday', 'readall') && !in_array($id, $childids))
|
|||
$approbatorstatic->admin = $obj->validator_admin;
|
||||
$approbatorstatic->email = $obj->validator_email;
|
||||
$approbatorstatic->login = $obj->validator_login;
|
||||
$approbatorstatic->statut = $obj->validator_status;
|
||||
$approbatorstatic->status = $obj->validator_status;
|
||||
$approbatorstatic->photo = $obj->validator_photo;
|
||||
|
||||
$date = $obj->date_create;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 François Legastelois <flegastelois@teclib.com>
|
||||
* Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -399,7 +399,7 @@ if ($num == 0) {
|
|||
// Leave request
|
||||
$holidaystatic->id = $obj->rowid;
|
||||
$holidaystatic->ref = $obj->ref;
|
||||
$holidaystatic->statut = $obj->status;
|
||||
$holidaystatic->status = $obj->status;
|
||||
$holidaystatic->status = $obj->status;
|
||||
$holidaystatic->fk_user = $obj->fk_user;
|
||||
$holidaystatic->fk_type = $obj->fk_type;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Dimitri Mouillard <dmouillard@teclib.com>
|
||||
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -464,12 +465,12 @@ while ($i < min($num, $limit)) {
|
|||
|
||||
$holidaylogstatic->id = $obj['rowid'];
|
||||
$holidaylogstatic->date = $obj['date_action'];
|
||||
$holidaylogstatic->validator = $obj['fk_user_action'];
|
||||
$holidaylogstatic->employee = $obj['fk_user_update'];
|
||||
$holidaylogstatic->description = $obj['type_action'];
|
||||
$holidaylogstatic->validator = $obj['fk_user_action'];
|
||||
$holidaylogstatic->employee = $obj['fk_user_update'];
|
||||
$holidaylogstatic->description = $obj['type_action'];
|
||||
$holidaylogstatic->type = $obj['fk_type'];
|
||||
$holidaylogstatic->balance_previous = $obj['prev_solde'];
|
||||
$holidaylogstatic->balance_new = $obj['new_solde'];
|
||||
$holidaylogstatic->balance_new = $obj['new_solde'];
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Dolibarr language file - Source file is en_US - deliveries
|
||||
Delivery=Delivery
|
||||
DeliveryRef=Ref Delivery
|
||||
DeliveryCard=Stock receipt
|
||||
DeliveryCard=Delivery receipt
|
||||
DeliveryOrder=Delivery receipt
|
||||
DeliveryDate=Delivery date
|
||||
CreateDeliveryOrder=Generate delivery receipt
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -168,18 +169,16 @@ if ($action == 'specimen') { // For products
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/product/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2021 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -115,18 +116,16 @@ if ($action == 'updateMaskLot') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir . "core/modules/product_batch/doc/pdf_" . $modele . ".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_" . $modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
* Copyright (C) 2019-2020 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2020 Pierre Ardoin <mapiolca@me.com>
|
||||
* Copyright (C) 2022 Vincent de Grandpré <vincent@de-grandpre.quebec>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -2884,9 +2885,9 @@ if (($action == 'clone' && (empty($conf->use_javascript_ajax) || !empty($conf->d
|
|||
// Define confirmation messages
|
||||
$formquestionclone = array(
|
||||
'text' => $langs->trans("ConfirmClone"),
|
||||
array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'morecss' => 'width150'),
|
||||
array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContentProduct"), 'value' => 1),
|
||||
array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1),
|
||||
0 => array('type' => 'text', 'name' => 'clone_ref', 'label' => $langs->trans("NewRefForClone"), 'value' => empty($tmpcode) ? $langs->trans("CopyOf").' '.$object->ref : $tmpcode, 'morecss' => 'width150'),
|
||||
1 => array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneContentProduct"), 'value' => 1),
|
||||
2 => array('type' => 'checkbox', 'name' => 'clone_categories', 'label' => $langs->trans("CloneCategoriesProduct"), 'value' => 1),
|
||||
);
|
||||
if (getDolGlobalString('PRODUIT_MULTIPRICES')) {
|
||||
$formquestionclone[] = array('type' => 'checkbox', 'name' => 'clone_prices', 'label' => $langs->trans("ClonePricesProduct").' ('.$langs->trans("CustomerPrices").')', 'value' => 0);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) ---Put here your own copyright and developer email---
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -537,29 +538,29 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
} elseif ($action == 'destock') { // Destock confirmation
|
||||
// Create an array for form
|
||||
$formquestion = array( 'text' => '',
|
||||
array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestock', $object->ref), 'size'=>40),
|
||||
array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25)
|
||||
0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestock', $object->ref), 'size' => 40),
|
||||
1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25)
|
||||
);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProduct'), '', 'confirm_destock', $formquestion, 'yes', 1);
|
||||
} elseif ($action == 'destockcancel') { // Destock confirmation cancel
|
||||
// Create an array for form
|
||||
$formquestion = array( 'text' => '',
|
||||
array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestockCancel', $object->ref), 'size'=>40),
|
||||
array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25)
|
||||
0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label"), 'value' => $langs->trans('ConfirmDestockCancel', $object->ref), 'size' => 40),
|
||||
1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25)
|
||||
);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DestockAllProductCancel'), '', 'confirm_destockcancel', $formquestion, 'yes', 1);
|
||||
} elseif ($action == 'addstock') { // Addstock confirmation
|
||||
// Create an array for form
|
||||
$formquestion = array( 'text' => '',
|
||||
array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStock', $object->ref), 'size'=>40),
|
||||
array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25)
|
||||
0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStock', $object->ref), 'size' => 40),
|
||||
1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25)
|
||||
);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AddStockAllProduct'), '', 'confirm_addstock', $formquestion, 'yes', 1);
|
||||
} elseif ($action == 'addstockcancel') { // Addstock confirmation cancel
|
||||
// Create an array for form
|
||||
$formquestion = array( 'text' => '',
|
||||
array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStockCancel', $object->ref), 'size'=>40),
|
||||
array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size'=>25)
|
||||
0 => array('type' => 'text', 'name' => 'label', 'label' => $langs->trans("Label").' :', 'value' => $langs->trans('ConfirmAddStockCancel', $object->ref), 'size' => 40),
|
||||
1 => array('type' => 'text', 'name' => 'inventorycode', 'label' => $langs->trans("InventoryCode"), 'value' => dol_print_date(dol_now(), '%y%m%d%H%M%S'), 'size' => 25)
|
||||
);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('AddStockAllProductCancel'), '', 'confirm_addstockcancel', $formquestion, 'yes', 1);
|
||||
}
|
||||
|
|
@ -582,7 +583,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
|
||||
if ($action == 'valid' && $permissiontoadd) {
|
||||
$nextref=$object->getNextNumRef();
|
||||
$nextref = $object->getNextNumRef();
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Validate'), $langs->transnoentities('ConfirmValidateStockTransfer', $nextref), 'confirm_validate', $formquestion, 0, 2);
|
||||
}
|
||||
|
||||
|
|
@ -646,8 +647,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_soc']); // Hide field already shown in banner
|
||||
|
||||
$object->fields['fk_soc']['visible']=0; // Already available in banner
|
||||
$object->fields['fk_project']['visible']=0; // Already available in banner
|
||||
$object->fields['fk_soc']['visible'] = 0; // Already available in banner
|
||||
$object->fields['fk_project']['visible'] = 0; // Already available in banner
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
// Incoterms
|
||||
|
|
@ -763,7 +764,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
$param = '';
|
||||
|
||||
$conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE=true; // Full display needed to see all column title details
|
||||
$conf->global->MAIN_DISABLE_WRAPPING_ON_COLUMN_TITLE = true; // Full display needed to see all column title details
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList($langs->trans('ProductRef'), 0, $_SERVER["PHP_SELF"], '', $param, '', '', $sortfield, $sortorder, 'tagtd maxwidthonsmartphone ');
|
||||
|
|
@ -927,7 +928,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$formproduct->loadWarehouses(); // Pour charger la totalité des entrepôts
|
||||
|
||||
// On stock ceux qui ne doivent pas être proposés dans la liste
|
||||
$TExcludedWarehouseSource=array();
|
||||
$TExcludedWarehouseSource = array();
|
||||
if (!empty($object->fk_warehouse_source)) {
|
||||
$source_ent = new Entrepot($db);
|
||||
$source_ent->fetch($object->fk_warehouse_source);
|
||||
|
|
@ -939,7 +940,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
}
|
||||
|
||||
// On stock ceux qui ne doivent pas être proposés dans la liste
|
||||
$TExcludedWarehouseDestination=array();
|
||||
$TExcludedWarehouseDestination = array();
|
||||
if (!empty($object->fk_warehouse_destination)) {
|
||||
$dest_ent = new Entrepot($db);
|
||||
$dest_ent->fetch($object->fk_warehouse_destination);
|
||||
|
|
@ -951,14 +952,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
}
|
||||
|
||||
// On vide le tableau pour qu'il se charge tout seul lors de l'appel à la fonction select_warehouses
|
||||
$formproduct->cache_warehouses=array();
|
||||
$formproduct->cache_warehouses = array();
|
||||
// In warehouse
|
||||
print '<td>';
|
||||
print $formproduct->selectWarehouses(empty($fk_warehouse_source) ? $object->fk_warehouse_source : $fk_warehouse_source, 'fk_warehouse_source', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseSource);
|
||||
print '</td>';
|
||||
|
||||
// On vide le tableau pour qu'il se charge tout seul lors de l'appel à la fonction select_warehouses
|
||||
$formproduct->cache_warehouses=array();
|
||||
$formproduct->cache_warehouses = array();
|
||||
// Out warehouse
|
||||
print '<td>';
|
||||
print $formproduct->selectWarehouses(empty($fk_warehouse_destination) ? $object->fk_warehouse_destination : $fk_warehouse_destination, 'fk_warehouse_destination', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, array(), 'minwidth200imp maxwidth200', $TExcludedWarehouseDestination);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -101,18 +102,16 @@ if ($action == 'updateMaskTask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/project/doc/pdf_".$modele.".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2023 Charlene Benke <charlene@patas_monkey.com>
|
||||
* Copyright (C) 2023 Christian Foellmann <christian@foellmann.de>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -38,9 +39,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langsLoad=array('projects', 'companies');
|
||||
$langsLoad = array('projects', 'companies');
|
||||
if (isModEnabled('eventorganization')) {
|
||||
$langsLoad[]='eventorganization';
|
||||
$langsLoad[] = 'eventorganization';
|
||||
}
|
||||
|
||||
$langs->loadLangs($langsLoad);
|
||||
|
|
@ -116,7 +117,7 @@ $permissiondellink = $user->hasRight('projet', 'creer'); // Used by the include
|
|||
* Actions
|
||||
*/
|
||||
|
||||
$parameters = array('id'=>$socid, 'objcanvas'=>$objcanvas);
|
||||
$parameters = array('id' => $socid, 'objcanvas' => $objcanvas);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -977,13 +978,13 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
if ($action == 'clone') {
|
||||
$formquestion = array(
|
||||
'text' => $langs->trans("ConfirmClone"),
|
||||
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid') > 0 ? GETPOSTINT('socid') : $object->socid, 'socid', '', "None", 0, 0, null, 0, 'minwidth200 maxwidth250')),
|
||||
array('type' => 'checkbox', 'name' => 'clone_contacts', 'label' => $langs->trans("CloneContacts"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_tasks', 'label' => $langs->trans("CloneTasks"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'move_date', 'label' => $langs->trans("CloneMoveDate"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_notes', 'label' => $langs->trans("CloneNotes"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_project_files', 'label' => $langs->trans("CloneProjectFiles"), 'value' => false),
|
||||
array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans("CloneTaskFiles"), 'value' => false)
|
||||
0 => array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid') > 0 ? GETPOSTINT('socid') : $object->socid, 'socid', '', "None", 0, 0, null, 0, 'minwidth200 maxwidth250')),
|
||||
1 => array('type' => 'checkbox', 'name' => 'clone_contacts', 'label' => $langs->trans("CloneContacts"), 'value' => true),
|
||||
2 => array('type' => 'checkbox', 'name' => 'clone_tasks', 'label' => $langs->trans("CloneTasks"), 'value' => true),
|
||||
3 => array('type' => 'checkbox', 'name' => 'move_date', 'label' => $langs->trans("CloneMoveDate"), 'value' => true),
|
||||
4 => array('type' => 'checkbox', 'name' => 'clone_notes', 'label' => $langs->trans("CloneNotes"), 'value' => true),
|
||||
5 => array('type' => 'checkbox', 'name' => 'clone_project_files', 'label' => $langs->trans("CloneProjectFiles"), 'value' => false),
|
||||
6 => array('type' => 'checkbox', 'name' => 'clone_task_files', 'label' => $langs->trans("CloneTaskFiles"), 'value' => false)
|
||||
);
|
||||
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("ToClone"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 400, 590);
|
||||
|
|
@ -1644,16 +1645,16 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
// Buttons Create
|
||||
if (!getDolGlobalString('PROJECT_HIDE_CREATE_OBJECT_BUTTON')) {
|
||||
$arrayforbutaction = array(
|
||||
10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
40 => array('lang'=>'supplier_proposal', 'enabled'=>isModEnabled("supplier_proposal"), 'perm'=>$user->hasRight('supplier_proposal', 'creer'), 'label' => 'AddSupplierProposal', 'url'=>'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
50 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_order"), 'perm'=>$user->hasRight('fournisseur', 'commande', 'creer'), 'label' => 'AddSupplierOrder', 'url'=>'/fourn/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
60 => array('lang'=>'suppliers', 'enabled'=>isModEnabled("supplier_invoice"), 'perm'=>$user->hasRight('fournisseur', 'facture', 'creer'), 'label' => 'AddSupplierInvoice', 'url'=>'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
70 => array('lang'=>'interventions', 'enabled'=>isModEnabled("intervention"), 'perm'=>$user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url'=>'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
80 => array('lang'=>'contracts', 'enabled'=>isModEnabled("contract"), 'perm'=>$user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url'=>'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
90 => array('lang'=>'trips', 'enabled'=>isModEnabled("expensereport"), 'perm'=>$user->hasRight('expensereport', 'creer'), 'label' => 'AddTrip', 'url'=>'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
100 => array('lang'=>'donations', 'enabled'=>isModEnabled("don"), 'perm'=>$user->hasRight('don', 'creer'), 'label' => 'AddDonation', 'url'=>'/don/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
10 => array('lang' => 'propal', 'enabled' => isModEnabled("propal"), 'perm' => $user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url' => '/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
20 => array('lang' => 'orders', 'enabled' => isModEnabled("order"), 'perm' => $user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url' => '/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
30 => array('lang' => 'bills', 'enabled' => isModEnabled("invoice"), 'perm' => $user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url' => '/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
40 => array('lang' => 'supplier_proposal', 'enabled' => isModEnabled("supplier_proposal"), 'perm' => $user->hasRight('supplier_proposal', 'creer'), 'label' => 'AddSupplierProposal', 'url' => '/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
50 => array('lang' => 'suppliers', 'enabled' => isModEnabled("supplier_order"), 'perm' => $user->hasRight('fournisseur', 'commande', 'creer'), 'label' => 'AddSupplierOrder', 'url' => '/fourn/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
60 => array('lang' => 'suppliers', 'enabled' => isModEnabled("supplier_invoice"), 'perm' => $user->hasRight('fournisseur', 'facture', 'creer'), 'label' => 'AddSupplierInvoice', 'url' => '/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
70 => array('lang' => 'interventions', 'enabled' => isModEnabled("intervention"), 'perm' => $user->hasRight('fichinter', 'creer'), 'label' => 'AddIntervention', 'url' => '/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
80 => array('lang' => 'contracts', 'enabled' => isModEnabled("contract"), 'perm' => $user->hasRight('contrat', 'creer'), 'label' => 'AddContract', 'url' => '/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
90 => array('lang' => 'trips', 'enabled' => isModEnabled("expensereport"), 'perm' => $user->hasRight('expensereport', 'creer'), 'label' => 'AddTrip', 'url' => '/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
100 => array('lang' => 'donations', 'enabled' => isModEnabled("don"), 'perm' => $user->hasRight('don', 'creer'), 'label' => 'AddDonation', 'url' => '/don/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid),
|
||||
);
|
||||
|
||||
$params = array('backtopage' => $_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -58,7 +59,7 @@ $projectstatic = new Project($db);
|
|||
// fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
$parameters = array('id'=>$id);
|
||||
$parameters = array('id' => $id);
|
||||
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
|
|
@ -267,7 +268,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
// Title
|
||||
$morehtmlref .= $projectstatic->title;
|
||||
// Thirdparty
|
||||
if (!empty($projectstatic->thirdparty->id) &&$projectstatic->thirdparty->id > 0) {
|
||||
if (!empty($projectstatic->thirdparty->id) && $projectstatic->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
|
@ -417,11 +418,11 @@ if ($id > 0 || !empty($ref)) {
|
|||
$formquestion = array(
|
||||
'text' => $langs->trans("ConfirmClone"),
|
||||
//array('type' => 'checkbox', 'name' => 'clone_contacts', 'label' => $langs->trans("CloneContacts"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_change_dt', 'label' => $langs->trans("CloneChanges"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_affectation', 'label' => $langs->trans("CloneAffectation"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_prog', 'label' => $langs->trans("CloneProgression"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_time', 'label' => $langs->trans("CloneTimes"), 'value' => true),
|
||||
array('type' => 'checkbox', 'name' => 'clone_file', 'label' => $langs->trans("CloneFile"), 'value' => true),
|
||||
0 => array('type' => 'checkbox', 'name' => 'clone_change_dt', 'label' => $langs->trans("CloneChanges"), 'value' => true),
|
||||
1 => array('type' => 'checkbox', 'name' => 'clone_affectation', 'label' => $langs->trans("CloneAffectation"), 'value' => true),
|
||||
2 => array('type' => 'checkbox', 'name' => 'clone_prog', 'label' => $langs->trans("CloneProgression"), 'value' => true),
|
||||
3 => array('type' => 'checkbox', 'name' => 'clone_time', 'label' => $langs->trans("CloneTimes"), 'value' => true),
|
||||
4 => array('type' => 'checkbox', 'name' => 'clone_file', 'label' => $langs->trans("CloneFile"), 'value' => true),
|
||||
|
||||
);
|
||||
|
||||
|
|
@ -638,7 +639,7 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
// Other attributes
|
||||
$cols = 3;
|
||||
$parameters = array('socid'=>$socid);
|
||||
$parameters = array('socid' => $socid);
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -120,18 +121,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/recruitment/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele."_".strtolower($tmpobjectkey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
/* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -91,18 +92,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir."core/modules/mymodule/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_".$modele;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2018-2021 Thibault FOUCART <support@ptibogxiv.net>
|
||||
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -206,10 +207,10 @@ class Stripe extends CommonObject
|
|||
try {
|
||||
if (empty($key)) { // If the Stripe connect account not set, we use common API usage
|
||||
//$customer = \Stripe\Customer::retrieve("$tiers");
|
||||
$customer = \Stripe\Customer::retrieve(array('id'=>"$tiers", 'expand[]'=>'sources'));
|
||||
$customer = \Stripe\Customer::retrieve(array('id' => "$tiers", 'expand[]' => 'sources'));
|
||||
} else {
|
||||
//$customer = \Stripe\Customer::retrieve("$tiers", array("stripe_account" => $key));
|
||||
$customer = \Stripe\Customer::retrieve(array('id'=>"$tiers", 'expand[]'=>'sources'), array("stripe_account" => $key));
|
||||
$customer = \Stripe\Customer::retrieve(array('id' => "$tiers", 'expand[]' => 'sources'), array("stripe_account" => $key));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// For example, we may have error: 'No such customer: cus_XXXXX; a similar object exists in live mode, but a test mode key was used to make this request.'
|
||||
|
|
@ -221,7 +222,7 @@ class Stripe extends CommonObject
|
|||
$dataforcustomer = array(
|
||||
"email" => $object->email,
|
||||
"description" => $object->name,
|
||||
"metadata" => array('dol_id'=>$object->id, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress)
|
||||
"metadata" => array('dol_id' => $object->id, 'dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress)
|
||||
);
|
||||
|
||||
$vatcleaned = $object->tva_intra ? $object->tva_intra : null;
|
||||
|
|
@ -256,7 +257,7 @@ class Stripe extends CommonObject
|
|||
$isineec = isInEEC($object);
|
||||
if ($object->country_code && $isineec) {
|
||||
//$taxids = $customer->allTaxIds($customer->id);
|
||||
$customer->createTaxId($customer->id, array('type'=>'eu_vat', 'value'=>$vatcleaned));
|
||||
$customer->createTaxId($customer->id, array('type' => 'eu_vat', 'value' => $vatcleaned));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -444,7 +445,7 @@ class Stripe extends CommonObject
|
|||
if (empty($paymentintent)) {
|
||||
// Try to create intent. See https://stripe.com/docs/api/payment_intents/create
|
||||
$ipaddress = getUserRemoteIP();
|
||||
$metadata = array('dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress);
|
||||
$metadata = array('dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress);
|
||||
if (is_object($object)) {
|
||||
$metadata['dol_type'] = $object->element;
|
||||
$metadata['dol_id'] = $object->id;
|
||||
|
|
@ -681,7 +682,7 @@ class Stripe extends CommonObject
|
|||
|
||||
if (empty($setupintent)) {
|
||||
$ipaddress = getUserRemoteIP();
|
||||
$metadata = array('dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress);
|
||||
$metadata = array('dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress);
|
||||
if (is_object($object)) {
|
||||
$metadata['dol_type'] = $object->element;
|
||||
$metadata['dol_id'] = $object->id;
|
||||
|
|
@ -877,19 +878,19 @@ class Stripe extends CommonObject
|
|||
|
||||
$dataforcard = array(
|
||||
"source" => array(
|
||||
'object'=>'card',
|
||||
'exp_month'=>$exp_date_month,
|
||||
'exp_year'=>$exp_date_year,
|
||||
'number'=>$number,
|
||||
'cvc'=>$cvc,
|
||||
'name'=>$cardholdername
|
||||
'object' => 'card',
|
||||
'exp_month' => $exp_date_month,
|
||||
'exp_year' => $exp_date_year,
|
||||
'number' => $number,
|
||||
'cvc' => $cvc,
|
||||
'name' => $cardholdername
|
||||
),
|
||||
"metadata" => array(
|
||||
'dol_type'=>$object->element,
|
||||
'dol_id'=>$object->id,
|
||||
'dol_version'=>DOL_VERSION,
|
||||
'dol_entity'=>$conf->entity,
|
||||
'ipaddress'=>$ipaddress
|
||||
'dol_type' => $object->element,
|
||||
'dol_id' => $object->id,
|
||||
'dol_version' => DOL_VERSION,
|
||||
'dol_entity' => $conf->entity,
|
||||
'ipaddress' => $ipaddress
|
||||
)
|
||||
);
|
||||
|
||||
|
|
@ -1022,7 +1023,7 @@ class Stripe extends CommonObject
|
|||
} elseif ($createifnotlinkedtostripe) {
|
||||
$iban = $obj->iban;
|
||||
$ipaddress = getUserRemoteIP();
|
||||
$metadata = array('dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>$ipaddress);
|
||||
$metadata = array('dol_version' => DOL_VERSION, 'dol_entity' => $conf->entity, 'ipaddress' => $ipaddress);
|
||||
if (is_object($object)) {
|
||||
$metadata['dol_type'] = $object->element;
|
||||
$metadata['dol_id'] = $object->id;
|
||||
|
|
@ -1032,7 +1033,7 @@ class Stripe extends CommonObject
|
|||
$description = 'SEPA for IBAN '.$iban;
|
||||
|
||||
$dataforcard = array(
|
||||
'type'=>'sepa_debit',
|
||||
'type' => 'sepa_debit',
|
||||
"sepa_debit" => array('iban' => $iban),
|
||||
'billing_details' => array(
|
||||
'name' => $soc->name,
|
||||
|
|
@ -1042,19 +1043,19 @@ class Stripe extends CommonObject
|
|||
);
|
||||
// Complete owner name
|
||||
if (!empty($soc->town)) {
|
||||
$dataforcard['billing_details']['address']['city']=$soc->town;
|
||||
$dataforcard['billing_details']['address']['city'] = $soc->town;
|
||||
}
|
||||
if (!empty($soc->country_code)) {
|
||||
$dataforcard['billing_details']['address']['country']=$soc->country_code;
|
||||
$dataforcard['billing_details']['address']['country'] = $soc->country_code;
|
||||
}
|
||||
if (!empty($soc->address)) {
|
||||
$dataforcard['billing_details']['address']['line1']=$soc->address;
|
||||
$dataforcard['billing_details']['address']['line1'] = $soc->address;
|
||||
}
|
||||
if (!empty($soc->zip)) {
|
||||
$dataforcard['billing_details']['address']['postal_code']=$soc->zip;
|
||||
$dataforcard['billing_details']['address']['postal_code'] = $soc->zip;
|
||||
}
|
||||
if (!empty($soc->state)) {
|
||||
$dataforcard['billing_details']['address']['state']=$soc->state;
|
||||
$dataforcard['billing_details']['address']['state'] = $soc->state;
|
||||
}
|
||||
|
||||
//$a = \Stripe\Stripe::getApiKey();
|
||||
|
|
@ -1084,7 +1085,7 @@ class Stripe extends CommonObject
|
|||
} else {
|
||||
// link customer and src
|
||||
//$cs = $this->getSetupIntent($description, $soc, $cu, '', $status);
|
||||
$dataforintent = array(['description'=> $description, 'payment_method_types' => ['sepa_debit'], 'customer' => $cu->id, 'payment_method' => $sepa->id], 'metadata'=>$metadata);
|
||||
$dataforintent = array(0 => ['description' => $description, 'payment_method_types' => ['sepa_debit'], 'customer' => $cu->id, 'payment_method' => $sepa->id], 'metadata' => $metadata);
|
||||
|
||||
$cs = $s->setupIntents->create($dataforintent);
|
||||
//$cs = $s->setupIntents->update($cs->id, ['payment_method' => $sepa->id]);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/* Copyright (C) 2023-2024 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2023-2024 Lionel Vessiller <lvessiller@easya.solutions>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -146,18 +147,16 @@ if ($action == 'updateMask') {
|
|||
// Search template files
|
||||
$file = '';
|
||||
$classname = '';
|
||||
$filefound = 0;
|
||||
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
|
||||
foreach ($dirmodels as $reldir) {
|
||||
$file = dol_buildpath($reldir . "core/modules/webportal/doc/pdf_" . $modele . "_" . strtolower($tmpobjectkey) . ".modules.php", 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = 1;
|
||||
$classname = "pdf_" . $modele . "_" . strtolower($tmpobjectkey);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($filefound) {
|
||||
if ($classname !== '') {
|
||||
require_once $file;
|
||||
|
||||
$module = new $classname($db);
|
||||
|
|
|
|||
Loading…
Reference in a new issue