Merge branch 'develop' into testsqlAndScript
This commit is contained in:
commit
76cdbc8bf1
50
ChangeLog
50
ChangeLog
@ -4,22 +4,59 @@ English Dolibarr ChangeLog
|
|||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 9.0.0 compared to 8.0.0 *****
|
***** ChangeLog for 9.0.0 compared to 8.0.0 *****
|
||||||
|
|
||||||
For Users:
|
For Users:
|
||||||
NEW: Stable module: Website
|
NEW: Stable module: Website
|
||||||
NEW: Stable module: WebDAV
|
NEW: Stable module: WebDAV
|
||||||
NEW: Stable module: Module Builder
|
NEW: Stable module: Module Builder
|
||||||
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
|
NEW: Dolibarr can provide information in page title when multicompany is enabled of not, making
|
||||||
Android application like DoliDroid able to provide native features for multicompany module
|
Android application like DoliDroid able to provide native features for multicompany module.
|
||||||
|
|
||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
Code changes to be more compatible with PSR2
|
* Code changes to be more compatible with PSR2
|
||||||
|
* Removed trigger USER_LOGOUT, USER_LOGIN, USER_LOGIN_FAILED (Some hooks are already dedicated for that)
|
||||||
|
|
||||||
|
WARNING:
|
||||||
|
|
||||||
|
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||||
|
* If you use some links like viewimages.php?modulepart=mycompany&file=... in you external modules, you must
|
||||||
|
replace them with links like viewimages.php?modulepart=mycompany&file=logos/... (note that link change only for
|
||||||
|
modulepart=mycompany that now works like others).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
***** ChangeLog for 8.0.1 compared to 8.0.0 *****
|
||||||
|
FIX: #9258
|
||||||
|
FIX: #9328
|
||||||
|
FIX: #9337
|
||||||
|
FIX: adding GROUP BY for PostgreSQL
|
||||||
|
FIX: API template for list pages in module builder
|
||||||
|
FIX: API template for record page to delete a record
|
||||||
|
FIX: a removed option was still in setup
|
||||||
|
FIX: badge on time spent on project and tasks
|
||||||
|
FIX: Delete file on smartphone
|
||||||
|
FIX: Fetch function will fetch comments
|
||||||
|
FIX: Fetch task will now fetch comments
|
||||||
|
FIX: $fk_account is always empty, must be $soc->fk_account
|
||||||
|
FIX: Force stripe api version to avoid trouble if we update stripe api
|
||||||
|
FIX: get_product_vat_for_country functions.lib.php
|
||||||
|
FIX: Get templates in a forced language
|
||||||
|
FIX: hook on dispatch order fourn
|
||||||
|
FIX: Language selection lost if error during creation of email template
|
||||||
|
FIX: Look and feel v8
|
||||||
|
FIX: propal.class.php
|
||||||
|
FIX: Add calls to fetchComments function
|
||||||
|
FIX: Remove fetchComments from project and task fetch function
|
||||||
|
FIX: remove internal property isextrafieldmanaged from API returns
|
||||||
|
FIX: sql error
|
||||||
|
FIX: table llx_chargessociales doesn't exists
|
||||||
|
FIX: trans on null object
|
||||||
|
FIX: vat rate code not returned by get_product_vat_for_country
|
||||||
|
FIX: warning for late template invoices to remove when suspended
|
||||||
|
FIX: Add hidden option MAIN_xxx_IN_SOURCE_ADDRESS to solve legal issues on PDF
|
||||||
|
FIX: Table llx_facture_rec_extrafields missing after migration
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
|
***** ChangeLog for 8.0.0 compared to 7.0.0 *****
|
||||||
|
|
||||||
For Users:
|
For Users:
|
||||||
NEW: Experimental module: Ticket
|
NEW: Experimental module: Ticket
|
||||||
NEW: Experimental module: WebDAV
|
NEW: Experimental module: WebDAV
|
||||||
@ -205,7 +242,8 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* Remove method Categorie:get_nb_categories() that was not used.
|
* Remove method Categorie:get_nb_categories() that was not used.
|
||||||
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
|
* Hook getnomurltooltip provide a duplicate feature compared to hook getNomUrl so all hooks getnomurltooltip
|
||||||
are now replaced with hook getNomUrl.
|
are now replaced with hook getNomUrl.
|
||||||
|
* The substitution key __CONTACTCIVNAME__ is no longer present, it has been replaced by __CONTACT_NAME_{TYPE}__
|
||||||
|
where {TYPE} is contact type code (BILLING, SHIPPING, CUSTOMER, ... see contact type dictionnary).
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
|
***** ChangeLog for 7.0.3 compared to 7.0.2 *****
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
# DOLIBARR ERP & CRM
|
# DOLIBARR ERP & CRM
|
||||||
|
|
||||||
 
|

|
||||||
|
|
||||||
|
|6|7|8|develop|
|
||||||
|
|----------|----------|----------|----------|
|
||||||
|
|||||
|
||||||
|
|
||||||
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
|
Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…).
|
||||||
|
|
||||||
|
|||||||
@ -238,9 +238,9 @@
|
|||||||
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
|
<!--<rule ref="PEAR.Commenting.FunctionComment.MissingReturn">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>-->
|
</rule>-->
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.Missing">
|
<!--<rule ref="PEAR.Commenting.FunctionComment.Missing">
|
||||||
<severity>0</severity>
|
<severity>0</severity>
|
||||||
</rule>
|
</rule>-->
|
||||||
|
|
||||||
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
|
<rule ref="PEAR.Commenting.FunctionComment.SpacingAfterParamType" />
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class autoTranslator
|
|||||||
// Translate
|
// Translate
|
||||||
//ini_set('default_charset','UTF-8');
|
//ini_set('default_charset','UTF-8');
|
||||||
ini_set('default_charset',$this->_outputpagecode);
|
ini_set('default_charset',$this->_outputpagecode);
|
||||||
$this->parse_refLangTranslationFiles();
|
$this->parseRefLangTranslationFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,8 +72,7 @@ class autoTranslator
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
private function parseRefLangTranslationFiles()
|
||||||
private function parse_refLangTranslationFiles()
|
|
||||||
{
|
{
|
||||||
|
|
||||||
$files = $this->getTranslationFilesArray($this->_refLang);
|
$files = $this->getTranslationFilesArray($this->_refLang);
|
||||||
|
|||||||
@ -121,6 +121,9 @@ if (empty($reshook))
|
|||||||
if ($country_code)
|
if ($country_code)
|
||||||
{
|
{
|
||||||
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
|
$sqlfile = DOL_DOCUMENT_ROOT.'/install/mysql/data/llx_accounting_account_'.strtolower($country_code).'.sql';
|
||||||
|
|
||||||
|
// FIXME Get the ADD rowid and pass it + num of comapny * 100 000 000 to run_sql as a new parameter to say to update sql on the fly to add offset to rowid and account_parent value.
|
||||||
|
|
||||||
$result = run_sql($sqlfile, 1, 0, 1);
|
$result = run_sql($sqlfile, 1, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
/* Copyright (C) 2014-2016 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -169,12 +170,12 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
|
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
|
||||||
print $form->select_date(($date_start ? $date_start : ''), 'fiscalyear');
|
print $form->selectDate(($date_start ? $date_start : ''), 'fiscalyear');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date end
|
// Date end
|
||||||
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
|
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
|
||||||
print $form->select_date(($date_end ? $date_end : - 1), 'fiscalyearend');
|
print $form->selectDate(($date_end ? $date_end : - 1), 'fiscalyearend');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -225,12 +226,12 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
|
print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
|
||||||
print $form->select_date($object->date_start ? $object->date_start : - 1, 'fiscalyear');
|
print $form->selectDate($object->date_start ? $object->date_start : - 1, 'fiscalyear');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date end
|
// Date end
|
||||||
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
|
print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
|
||||||
print $form->select_date($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
|
print $form->selectDate($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Statut
|
// Statut
|
||||||
|
|||||||
@ -128,16 +128,16 @@ complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,
|
|||||||
|
|
||||||
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
||||||
$elementList = array();
|
$elementList = array();
|
||||||
// Must match ids defined into eldy.lib.php
|
// Must match ids defined into eldy.lib.php
|
||||||
$sourceList = array(
|
$sourceList = array(
|
||||||
'1' => $langs->trans('AccountingJournalType1'),
|
'1' => $langs->trans('AccountingJournalType1'),
|
||||||
'2' => $langs->trans('AccountingJournalType2'),
|
'2' => $langs->trans('AccountingJournalType2'),
|
||||||
'3' => $langs->trans('AccountingJournalType3'),
|
'3' => $langs->trans('AccountingJournalType3'),
|
||||||
'4' => $langs->trans('AccountingJournalType4'),
|
'4' => $langs->trans('AccountingJournalType4'),
|
||||||
'5' => $langs->trans('AccountingJournalType5'),
|
'5' => $langs->trans('AccountingJournalType5'),
|
||||||
'8' => $langs->trans('AccountingJournalType8'),
|
'8' => $langs->trans('AccountingJournalType8'),
|
||||||
'9' => $langs->trans('AccountingJournalType9')
|
'9' => $langs->trans('AccountingJournalType9'),
|
||||||
);
|
);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -294,10 +294,10 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GETPOST('actioncancel'))
|
//if (GETPOST('actioncancel'))
|
||||||
{
|
//{
|
||||||
//$_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
// $_GET["id"]=GETPOST('id', 'int'); // Force affichage dictionnaire en cours d'edition
|
||||||
}
|
//}
|
||||||
|
|
||||||
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
if ($action == 'confirm_delete' && $confirm == 'yes') // delete
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
|
/* Copyright (C) 2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2016-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -193,9 +194,9 @@ else {
|
|||||||
|
|
||||||
$moreforfilter .= '<div class="divsearchfield">';
|
$moreforfilter .= '<div class="divsearchfield">';
|
||||||
$moreforfilter .= $langs->trans('DateStart') . ': ';
|
$moreforfilter .= $langs->trans('DateStart') . ': ';
|
||||||
$moreforfilter .= $form->select_date($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1, '', 1, 0, 1);
|
$moreforfilter .= $form->selectDate($search_date_start?$search_date_start:-1, 'date_start', 0, 0, 1, '', 1, 0);
|
||||||
$moreforfilter .= $langs->trans('DateEnd') . ': ';
|
$moreforfilter .= $langs->trans('DateEnd') . ': ';
|
||||||
$moreforfilter .= $form->select_date($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1, '', 1, 0, 1);
|
$moreforfilter .= $form->selectDate($search_date_end?$search_date_end:-1, 'date_end', 0, 0, 1, '', 1, 0);
|
||||||
$moreforfilter .= '</div>';
|
$moreforfilter .= '</div>';
|
||||||
|
|
||||||
if (! empty($moreforfilter)) {
|
if (! empty($moreforfilter)) {
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -350,7 +351,7 @@ if ($action == 'create')
|
|||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("Docdate") . '</td>';
|
print '<td class="titlefieldcreate fieldrequired">' . $langs->trans("Docdate") . '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1);
|
print $html->selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -432,7 +433,7 @@ if ($action == 'create')
|
|||||||
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
|
||||||
print '<input type="hidden" name="action" value="setdate">';
|
print '<input type="hidden" name="action" value="setdate">';
|
||||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||||
$form->select_date($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
|
print $form->selectDate($object->doc_date ? $object->doc_date : - 1, 'doc_date', '', '', '', "setdate");
|
||||||
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -465,11 +466,11 @@ if (! empty($arrayfields['t.doc_date']['checked']))
|
|||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From') . ' ';
|
print $langs->trans('From') . ' ';
|
||||||
print $form->select_date($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
|
print $form->selectDate($search_date_start?$search_date_start:-1, 'search_date_start', 0, 0, 1);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to') . ' ';
|
print $langs->trans('to') . ' ';
|
||||||
print $form->select_date($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
|
print $form->selectDate($search_date_end?$search_date_end:-1, 'search_date_end', 0, 0, 1);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -556,11 +557,11 @@ if (! empty($arrayfields['t.date_creation']['checked']))
|
|||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From') . ' ';
|
print $langs->trans('From') . ' ';
|
||||||
print $form->select_date($search_date_creation_start, 'date_creation_start', 0, 0, 1);
|
print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to') . ' ';
|
print $langs->trans('to') . ' ';
|
||||||
print $form->select_date($search_date_creation_end, 'date_creation_end', 0, 0, 1);
|
print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
@ -570,11 +571,11 @@ if (! empty($arrayfields['t.tms']['checked']))
|
|||||||
print '<td class="liste_titre center">';
|
print '<td class="liste_titre center">';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('From') . ' ';
|
print $langs->trans('From') . ' ';
|
||||||
print $form->select_date($search_date_modification_start, 'date_modification_start', 0, 0, 1);
|
print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '<div class="nowrap">';
|
print '<div class="nowrap">';
|
||||||
print $langs->trans('to') . ' ';
|
print $langs->trans('to') . ' ';
|
||||||
print $form->select_date($search_date_modification_end, 'date_modification_end', 0, 0, 1);
|
print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -287,10 +288,10 @@ print '</td>';
|
|||||||
print '<td class="liste_titre"></td>';
|
print '<td class="liste_titre"></td>';
|
||||||
print '<td class="liste_titre" align="center">';
|
print '<td class="liste_titre" align="center">';
|
||||||
print $langs->trans('From') . ': ';
|
print $langs->trans('From') . ': ';
|
||||||
print $form->select_date($search_date_start, 'search_date_start', 0, 0, 1);
|
print $form->selectDate($search_date_start, 'search_date_start', 0, 0, 1);
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print $langs->trans('to') . ': ';
|
print $langs->trans('to') . ': ';
|
||||||
print $form->select_date($search_date_end, 'search_date_end', 0, 0, 1);
|
print $form->selectDate($search_date_end, 'search_date_end', 0, 0, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="' . dol_escape_htmltag($search_doc_ref) . '"/></td>';
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_doc_ref" value="' . dol_escape_htmltag($search_doc_ref) . '"/></td>';
|
||||||
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="' . dol_escape_htmltag($search_label_operation) . '"/></td>';
|
print '<td class="liste_titre"><input type="text" size="7" class="flat" name="search_label_operation" value="' . dol_escape_htmltag($search_label_operation) . '"/></td>';
|
||||||
|
|||||||
@ -56,24 +56,69 @@ class AccountancyCategory // extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $table_element='c_accounting_category';
|
public $table_element='c_accounting_category';
|
||||||
|
|
||||||
public $id;
|
/**
|
||||||
|
* @var int ID
|
||||||
|
*/
|
||||||
|
public $id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $code;
|
public $code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string proper name for given parameter
|
* @var string Accountancy Category label
|
||||||
*/
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $range_account;
|
public $range_account;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $sens;
|
public $sens;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $category_type;
|
public $category_type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $formula;
|
public $formula;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $position;
|
public $position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $fk_country;
|
public $fk_country;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $active;
|
public $active;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $lines_cptbk;
|
public $lines_cptbk;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $lines_display;
|
public $lines_display;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var mixed Sample property 1
|
||||||
|
*/
|
||||||
public $sdc;
|
public $sdc;
|
||||||
|
|
||||||
|
|
||||||
@ -150,18 +195,18 @@ class AccountancyCategory // extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_accounting_category");
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_accounting_category");
|
||||||
|
|
||||||
if (! $notrigger)
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
{
|
// want this action call a trigger.
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
//if (! $notrigger)
|
||||||
// want this action call a trigger.
|
//{
|
||||||
|
|
||||||
//// Call triggers
|
// // Call triggers
|
||||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
//$interface=new Interfaces($this->db);
|
// $interface=new Interfaces($this->db);
|
||||||
//$result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
// $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf);
|
||||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
//// End call triggers
|
// // End call triggers
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -289,18 +334,17 @@ class AccountancyCategory // extends CommonObject
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
if (! $notrigger)
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
{
|
// want this action call a trigger.
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
//if (! $notrigger)
|
||||||
// want this action call a trigger.
|
//{
|
||||||
|
// // Call triggers
|
||||||
//// Call triggers
|
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
// $interface=new Interfaces($this->db);
|
||||||
//$interface=new Interfaces($this->db);
|
// $result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
||||||
//$result=$interface->run_triggers('MYOBJECT_MODIFY',$this,$user,$langs,$conf);
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// // End call triggers
|
||||||
//// End call triggers
|
//}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -345,18 +389,17 @@ class AccountancyCategory // extends CommonObject
|
|||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
if (! $notrigger)
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
{
|
// want this action call a trigger.
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
//if (! $notrigger)
|
||||||
// want this action call a trigger.
|
//{
|
||||||
|
// // Call triggers
|
||||||
//// Call triggers
|
// include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
||||||
//include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
|
// $interface=new Interfaces($this->db);
|
||||||
//$interface=new Interfaces($this->db);
|
// $result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
||||||
//$result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf);
|
// if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
||||||
//if ($result < 0) { $error++; $this->errors=$interface->errors; }
|
// // End call triggers
|
||||||
//// End call triggers
|
//}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
|
|||||||
@ -32,22 +32,22 @@ class AccountancySystem
|
|||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
public $error='';
|
public $error='';
|
||||||
|
|
||||||
var $rowid;
|
var $rowid;
|
||||||
var $fk_pcg_version;
|
var $fk_pcg_version;
|
||||||
var $pcg_type;
|
var $pcg_type;
|
||||||
var $pcg_subtype;
|
var $pcg_subtype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string proper name for given parameter
|
* @var string Accountancy System label
|
||||||
*/
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
var $account_number;
|
var $account_number;
|
||||||
var $account_parent;
|
var $account_parent;
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,9 @@ class AccountingAccount extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $table_element='accounting_account';
|
public $table_element='accounting_account';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
|
*/
|
||||||
public $picto = 'billr';
|
public $picto = 'billr';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -71,14 +74,19 @@ class AccountingAccount extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
var $rowid;
|
/**
|
||||||
var $datec; // Creation date
|
* @var int ID
|
||||||
var $fk_pcg_version;
|
*/
|
||||||
var $pcg_type;
|
public $rowid;
|
||||||
var $pcg_subtype;
|
|
||||||
var $account_number;
|
public $datec; // Creation date
|
||||||
var $account_parent;
|
public $fk_pcg_version;
|
||||||
var $account_category;
|
public $pcg_type;
|
||||||
|
public $pcg_subtype;
|
||||||
|
public $account_number;
|
||||||
|
public $account_parent;
|
||||||
|
public $account_category;
|
||||||
|
public $status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Label of account
|
* @var string Label of account
|
||||||
@ -96,7 +104,6 @@ class AccountingAccount extends CommonObject
|
|||||||
public $fk_user_modif;
|
public $fk_user_modif;
|
||||||
|
|
||||||
public $active; // duplicate with status
|
public $active; // duplicate with status
|
||||||
public $status;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -528,15 +535,16 @@ class AccountingAccount extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Account deactivated
|
* Account deactivated
|
||||||
*
|
*
|
||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function account_desactivate($id)
|
function account_desactivate($id)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$result = $this->checkUsage();
|
$result = $this->checkUsage();
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
@ -562,15 +570,16 @@ class AccountingAccount extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Account activated
|
* Account activated
|
||||||
*
|
*
|
||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function account_activate($id)
|
function account_activate($id)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
$sql = "UPDATE " . MAIN_DB_PREFIX . "accounting_account ";
|
||||||
@ -601,6 +610,7 @@ class AccountingAccount extends CommonObject
|
|||||||
return $this->LibStatut($this->status,$mode);
|
return $this->LibStatut($this->status,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@ -608,9 +618,9 @@ class AccountingAccount extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($statut,$mode=0)
|
function LibStatut($statut,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->loadLangs(array("users"));
|
$langs->loadLangs(array("users"));
|
||||||
|
|
||||||
@ -620,27 +630,27 @@ class AccountingAccount extends CommonObject
|
|||||||
if ($statut == 1) return $langs->trans('Enabled');
|
if ($statut == 1) return $langs->trans('Enabled');
|
||||||
if ($statut == 0) return $langs->trans('Disabled');
|
if ($statut == 0) return $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
elseif ($mode == 1)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return $langs->trans('Enabled');
|
if ($statut == 1) return $langs->trans('Enabled');
|
||||||
if ($statut == 0) return $langs->trans('Disabled');
|
if ($statut == 0) return $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
if ($statut == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
if ($statut == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
if ($statut == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
if ($statut == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||||
|
|||||||
@ -36,16 +36,27 @@ class AccountingJournal extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $table_element='accounting_journal';
|
public $table_element='accounting_journal';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Field with ID of parent key if this field has a parent
|
||||||
|
*/
|
||||||
public $fk_element = '';
|
public $fk_element = '';
|
||||||
|
|
||||||
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
public $ismultientitymanaged = 0; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
|
*/
|
||||||
public $picto = 'generic';
|
public $picto = 'generic';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int ID
|
||||||
|
*/
|
||||||
public $rowid;
|
public $rowid;
|
||||||
|
|
||||||
public $code;
|
public $code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string proper name for given parameter
|
* @var string Accounting Journal label
|
||||||
*/
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
@ -260,6 +271,7 @@ class AccountingJournal extends CommonObject
|
|||||||
return $this->LibType($this->nature,$mode);
|
return $this->LibType($this->nature,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return type of an accounting journal
|
* Return type of an accounting journal
|
||||||
*
|
*
|
||||||
@ -267,9 +279,9 @@ class AccountingJournal extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court
|
* @param int $mode 0=libelle long, 1=libelle court
|
||||||
* @return string Label of type
|
* @return string Label of type
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibType($nature,$mode=0)
|
function LibType($nature,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
$langs->loadLangs(array("accountancy"));
|
$langs->loadLangs(array("accountancy"));
|
||||||
|
|||||||
@ -35,22 +35,25 @@ class BookKeeping extends CommonObject
|
|||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
public $error;
|
public $error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[] Error codes (or messages)
|
* @var string[] Error codes (or messages)
|
||||||
*/
|
*/
|
||||||
public $errors = array();
|
public $errors = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Id to identify managed objects
|
* @var string Id to identify managed objects
|
||||||
*/
|
*/
|
||||||
public $element = 'accountingbookkeeping';
|
public $element = 'accountingbookkeeping';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element = 'accounting_bookkeeping';
|
public $table_element = 'accounting_bookkeeping';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Entity
|
||||||
|
*/
|
||||||
public $entity;
|
public $entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,8 +65,7 @@ class BookKeeping extends CommonObject
|
|||||||
* @var int ID
|
* @var int ID
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public $doc_date;
|
public $doc_date;
|
||||||
public $date_lim_reglement;
|
public $date_lim_reglement;
|
||||||
public $doc_type;
|
public $doc_type;
|
||||||
@ -333,18 +335,15 @@ class BookKeeping extends CommonObject
|
|||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error) {
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
|
// want this action to call a trigger.
|
||||||
|
//if (! $error && ! $notrigger) {
|
||||||
|
|
||||||
if (! $notrigger) {
|
// // Call triggers
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||||
// want this action to call a trigger.
|
// if ($result < 0) $error++;
|
||||||
|
// // End call triggers
|
||||||
// // Call triggers
|
//}
|
||||||
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
|
||||||
// if ($result < 0) $error++;
|
|
||||||
// // End call triggers
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -564,15 +563,15 @@ class BookKeeping extends CommonObject
|
|||||||
if (! $error) {
|
if (! $error) {
|
||||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode);
|
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . $this->table_element . $mode);
|
||||||
|
|
||||||
if (! $notrigger) {
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// want this action to call a trigger.
|
||||||
// want this action to call a trigger.
|
//if (! $notrigger) {
|
||||||
|
|
||||||
// // Call triggers
|
// // Call triggers
|
||||||
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
// $result=$this->call_trigger('MYOBJECT_CREATE',$user);
|
||||||
// if ($result < 0) $error++;
|
// if ($result < 0) $error++;
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
@ -1129,15 +1128,15 @@ class BookKeeping extends CommonObject
|
|||||||
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
dol_syslog(__METHOD__ . ' ' . join(',', $this->errors), LOG_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $error && ! $notrigger) {
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
// want this action calls a trigger.
|
||||||
// want this action calls a trigger.
|
//if (! $error && ! $notrigger) {
|
||||||
|
|
||||||
// // Call triggers
|
// // Call triggers
|
||||||
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
// $result=$this->call_trigger('MYOBJECT_MODIFY',$user);
|
||||||
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
//}
|
||||||
|
|
||||||
// Commit or rollback
|
// Commit or rollback
|
||||||
if ($error) {
|
if ($error) {
|
||||||
@ -1203,17 +1202,15 @@ class BookKeeping extends CommonObject
|
|||||||
|
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
if (! $error) {
|
// Uncomment this and change MYOBJECT to your own tag if you
|
||||||
if (! $notrigger) {
|
// want this action calls a trigger.
|
||||||
// Uncomment this and change MYOBJECT to your own tag if you
|
//if (! $error && ! $notrigger) {
|
||||||
// want this action calls a trigger.
|
|
||||||
|
|
||||||
// // Call triggers
|
// // Call triggers
|
||||||
// $result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
// $result=$this->call_trigger('MYOBJECT_DELETE',$user);
|
||||||
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
// if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
|
||||||
// // End call triggers
|
// // End call triggers
|
||||||
}
|
//}
|
||||||
}
|
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.$mode;
|
$sql = 'DELETE FROM ' . MAIN_DB_PREFIX . $this->table_element.$mode;
|
||||||
@ -1551,15 +1548,16 @@ class BookKeeping extends CommonObject
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Export bookkeping
|
* Export bookkeping
|
||||||
*
|
*
|
||||||
* @param string $model Model
|
* @param string $model Model
|
||||||
* @return int Result
|
* @return int Result
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function export_bookkeping($model = 'ebp')
|
function export_bookkeping($model = 'ebp')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||||
@ -1704,11 +1702,12 @@ class BookKeeping extends CommonObject
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of accounts with label by chart of accounts
|
* Return list of accounts with label by chart of accounts
|
||||||
*
|
*
|
||||||
* @param string $selectid Preselected chart of accounts
|
* @param string $selectid Preselected chart of accounts
|
||||||
* @param string $htmlname Name of field in html form
|
* @param string $htmlname Name of field in html form
|
||||||
* @param int $showempty Add an empty field
|
* @param int $showempty Add an empty field
|
||||||
* @param array $event Event options
|
* @param array $event Event options
|
||||||
* @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1)
|
* @param int $select_in Value is a aa.rowid (0 default) or aa.account_number (1)
|
||||||
@ -1716,9 +1715,9 @@ class BookKeeping extends CommonObject
|
|||||||
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
* @param int $aabase Set accounting_account base class to display empty=all or from 1 to 8 will display only account beginning by this number
|
||||||
* @return string String with HTML select
|
* @return string String with HTML select
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
|
function select_account($selectid, $htmlname = 'account', $showempty = 0, $event = array(), $select_in = 0, $select_out = 0, $aabase = '')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php';
|
||||||
@ -1775,15 +1774,16 @@ class BookKeeping extends CommonObject
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Description of a root accounting account
|
* Description of a root accounting account
|
||||||
*
|
*
|
||||||
* @param string $account Accounting account
|
* @param string $account Accounting account
|
||||||
* @return string Root account
|
* @return string Root account
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_compte_racine($account = null)
|
function get_compte_racine($account = null)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||||
|
|
||||||
@ -1816,15 +1816,16 @@ class BookKeeping extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Description of accounting account
|
* Description of accounting account
|
||||||
*
|
*
|
||||||
* @param string $account Accounting account
|
* @param string $account Accounting account
|
||||||
* @return string Account desc
|
* @return string Account desc
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_compte_desc($account = null)
|
function get_compte_desc($account = null)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
$pcgver = $conf->global->CHARTOFACCOUNTS;
|
||||||
@ -1862,7 +1863,11 @@ class BookKeeping extends CommonObject
|
|||||||
*/
|
*/
|
||||||
class BookKeepingLine
|
class BookKeepingLine
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @var int ID
|
||||||
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
public $doc_date = '';
|
public $doc_date = '';
|
||||||
public $doc_type;
|
public $doc_type;
|
||||||
public $doc_ref;
|
public $doc_ref;
|
||||||
|
|||||||
@ -153,7 +153,7 @@ $y = $year_current;
|
|||||||
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
|
$buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' . $year_current . '&action=validatehistory">' . $langs->trans("ValidateHistory") . '</a>';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -229,7 +229,7 @@ print '<br>';
|
|||||||
|
|
||||||
|
|
||||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -309,7 +309,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||||
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|||||||
@ -150,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
|
|||||||
|
|
||||||
|
|
||||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -221,7 +221,7 @@ print '<br>';
|
|||||||
|
|
||||||
|
|
||||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||||
|
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
@ -297,7 +297,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||||
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|||||||
@ -55,7 +55,7 @@ if ($conf->accounting->enabled)
|
|||||||
print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
|
print $langs->trans("AccountancyAreaDescIntro")."<br>\n";
|
||||||
print "<br>\n";print "<br>\n";
|
print "<br>\n";print "<br>\n";
|
||||||
|
|
||||||
print_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
|
print load_fiche_titre('<span class="fa fa-calendar-check-o"></span> '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."<br>\n";
|
||||||
print '<hr>';
|
print '<hr>';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ if ($conf->accounting->enabled)
|
|||||||
|
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
print_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
|
print load_fiche_titre('<span class="fa fa-calendar"></span> '.$langs->trans("AccountancyAreaDescActionFreq"), '', '');
|
||||||
print '<hr>';
|
print '<hr>';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step = 0;
|
$step = 0;
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -852,7 +852,8 @@ if (empty($action) || $action == 'view') {
|
|||||||
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||||
|
|
||||||
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
||||||
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
|
||||||
|
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||||
|
|
||||||
$varlink = 'id_journal=' . $id_journal;
|
$varlink = 'id_journal=' . $id_journal;
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -534,7 +535,8 @@ if (empty($action) || $action == 'view') {
|
|||||||
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
$description.= $langs->trans("DescJournalOnlyBindedVisible").'<br>';
|
||||||
|
|
||||||
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
||||||
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
|
||||||
|
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||||
|
|
||||||
$varlink = 'id_journal=' . $id_journal;
|
$varlink = 'id_journal=' . $id_journal;
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -726,7 +727,8 @@ if (empty($action) || $action == 'view') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
||||||
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
|
||||||
|
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||||
|
|
||||||
$varlink = 'id_journal=' . $id_journal;
|
$varlink = 'id_journal=' . $id_journal;
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -656,7 +657,8 @@ if (empty($action) || $action == 'view') {
|
|||||||
$description .= $langs->trans("DepositsAreIncluded");
|
$description .= $langs->trans("DepositsAreIncluded");
|
||||||
|
|
||||||
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
$listofchoices=array('notyet'=>$langs->trans("NotYetInGeneralLedger"), 'already'=>$langs->trans("AlreadyInGeneralLedger"));
|
||||||
$period = $form->select_date($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0, 1). ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
$period = $form->selectDate($date_start?$date_start:-1, 'date_start', 0, 0, 0, '', 1, 0) . ' - ' . $form->selectDate($date_end?$date_end:-1, 'date_end', 0, 0, 0, '', 1, 0);
|
||||||
|
$period .= ' - ' .$langs->trans("JournalizationInLedgerStatus").' '. $form->selectarray('in_bookkeeping', $listofchoices, $in_bookkeeping, 1);
|
||||||
|
|
||||||
$varlink = 'id_journal=' . $id_journal;
|
$varlink = 'id_journal=' . $id_journal;
|
||||||
|
|
||||||
|
|||||||
@ -150,7 +150,7 @@ $buttonbind = '<a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?year=' .
|
|||||||
|
|
||||||
|
|
||||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
|
||||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -221,7 +221,7 @@ print '<br>';
|
|||||||
|
|
||||||
|
|
||||||
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||||
//print_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesBound"), '', '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
@ -295,7 +295,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) // This part of code looks strange.
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
print_barre_liste($langs->trans("OtherInfo"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
|
||||||
//print_fiche_titre($langs->trans("OtherInfo"), '', '');
|
//print load_fiche_titre($langs->trans("OtherInfo"), '', '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|||||||
@ -33,8 +33,8 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("members");
|
$langs->loadLangs(array("admin","members"));
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@ -33,8 +33,8 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("members");
|
$langs->loadLangs(array("admin","members"));
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@ -28,8 +28,8 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
|
||||||
$langs->load("members");
|
// Load translation files required by the page
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("admin","members"));
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|||||||
@ -31,8 +31,8 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
|
||||||
$langs->load("members");
|
// Load translation files required by the page
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("admin","members"));
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|||||||
@ -31,8 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||||
|
|
||||||
$langs->load("members");
|
// Load translation files required by the page
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("admin","members"));
|
||||||
|
|
||||||
$action=GETPOST('action', 'alpha');
|
$action=GETPOST('action', 'alpha');
|
||||||
|
|
||||||
|
|||||||
@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||||
|
|
||||||
$langs->load("companies");
|
// Load translation files required by the page
|
||||||
$langs->load("members");
|
$langs->loadLangs(array("companies","members"));
|
||||||
|
|
||||||
$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('rowid','int');
|
$id = GETPOST('id','int')?GETPOST('id','int'):GETPOST('rowid','int');
|
||||||
|
|
||||||
|
|||||||
@ -75,16 +75,17 @@ abstract class ActionsAdherentCardCommon
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
|
/**
|
||||||
* Set content of ->tpl array, to use into template
|
* Set content of ->tpl array, to use into template
|
||||||
*
|
*
|
||||||
* @param string $action Type of action
|
* @param string $action Type of action
|
||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @return string HTML output
|
* @return string HTML output
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function assign_values(&$action, $id)
|
function assign_values(&$action, $id)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $langs, $user, $canvas;
|
global $conf, $langs, $user, $canvas;
|
||||||
global $form, $formcompany, $objsoc;
|
global $form, $formcompany, $objsoc;
|
||||||
|
|
||||||
@ -233,14 +234,15 @@ abstract class ActionsAdherentCardCommon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Assign POST values into object
|
* Assign POST values into object
|
||||||
*
|
*
|
||||||
* @return string HTML output
|
* @return string HTML output
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
private function assign_post()
|
private function assign_post()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs, $mysoc;
|
global $langs, $mysoc;
|
||||||
|
|
||||||
$this->object->old_name = $_POST["old_name"];
|
$this->object->old_name = $_POST["old_name"];
|
||||||
|
|||||||
@ -67,6 +67,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Assign custom values for canvas
|
* Assign custom values for canvas
|
||||||
*
|
*
|
||||||
@ -74,9 +75,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
* @param int $id Id
|
* @param int $id Id
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function assign_values(&$action, $id)
|
function assign_values(&$action, $id)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $limit, $offset, $sortfield, $sortorder;
|
global $limit, $offset, $sortfield, $sortorder;
|
||||||
global $conf, $db, $langs, $user;
|
global $conf, $db, $langs, $user;
|
||||||
global $form;
|
global $form;
|
||||||
@ -121,6 +122,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fetch datas list and save into ->list_datas
|
* Fetch datas list and save into ->list_datas
|
||||||
*
|
*
|
||||||
@ -130,9 +132,9 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
|
|||||||
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
function LoadListDatas($limit, $offset, $sortfield, $sortorder)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
//$this->getFieldList();
|
//$this->getFieldList();
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2018 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
* Copyright (C) 2012 Marcos García <marcosgdf@gmail.com>
|
||||||
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2012-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -980,7 +981,7 @@ else
|
|||||||
|
|
||||||
// Birthday
|
// Birthday
|
||||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||||
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
|
print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Public profil
|
// Public profil
|
||||||
@ -1218,7 +1219,7 @@ else
|
|||||||
|
|
||||||
// Birthday
|
// Birthday
|
||||||
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
|
||||||
$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
|
print $form->selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Public profil
|
// Public profil
|
||||||
|
|||||||
@ -53,67 +53,73 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
|
||||||
var $mesgs;
|
public $mesgs;
|
||||||
|
|
||||||
var $login;
|
public $login;
|
||||||
|
|
||||||
//! Clear password in memory
|
//! Clear password in memory
|
||||||
var $pass;
|
public $pass;
|
||||||
//! Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0)
|
//! Clear password in database (defined if DATABASE_PWD_ENCRYPTED=0)
|
||||||
var $pass_indatabase;
|
public $pass_indatabase;
|
||||||
//! Encrypted password in database (always defined)
|
//! Encrypted password in database (always defined)
|
||||||
var $pass_indatabase_crypted;
|
public $pass_indatabase_crypted;
|
||||||
|
|
||||||
var $societe;
|
public $societe;
|
||||||
var $company;
|
public $company;
|
||||||
var $address;
|
public $address;
|
||||||
var $zip;
|
public $zip;
|
||||||
var $town;
|
public $town;
|
||||||
|
|
||||||
var $state_id; // Id of department
|
public $state_id; // Id of department
|
||||||
var $state_code; // Code of department
|
public $state_code; // Code of department
|
||||||
var $state; // Label of department
|
public $state; // Label of department
|
||||||
|
|
||||||
var $email;
|
public $email;
|
||||||
var $skype;
|
public $skype;
|
||||||
var $phone;
|
public $phone;
|
||||||
var $phone_perso;
|
public $phone_perso;
|
||||||
var $phone_mobile;
|
public $phone_mobile;
|
||||||
|
|
||||||
var $morphy;
|
public $morphy;
|
||||||
var $public;
|
public $public;
|
||||||
var $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
|
public $statut; // -1:brouillon, 0:resilie, >=1:valide,paye
|
||||||
var $photo;
|
public $photo;
|
||||||
|
|
||||||
var $datec;
|
public $datec;
|
||||||
var $datem;
|
public $datem;
|
||||||
var $datefin;
|
public $datefin;
|
||||||
var $datevalid;
|
public $datevalid;
|
||||||
var $birth;
|
public $birth;
|
||||||
|
|
||||||
var $note_public;
|
public $note_public;
|
||||||
var $note_private;
|
public $note_private;
|
||||||
|
|
||||||
var $typeid; // Id type adherent
|
public $typeid; // Id type adherent
|
||||||
var $type; // Libelle type adherent
|
public $type; // Libelle type adherent
|
||||||
var $need_subscription;
|
public $need_subscription;
|
||||||
|
|
||||||
var $user_id;
|
public $user_id;
|
||||||
var $user_login;
|
public $user_login;
|
||||||
|
|
||||||
var $fk_soc;
|
/**
|
||||||
|
* @var int Thirdparty ID
|
||||||
|
*/
|
||||||
|
public $fk_soc;
|
||||||
|
|
||||||
// Fields loaded by fetch_subscriptions()
|
// Fields loaded by fetch_subscriptions()
|
||||||
var $first_subscription_date;
|
public $first_subscription_date;
|
||||||
var $first_subscription_amount;
|
public $first_subscription_amount;
|
||||||
var $last_subscription_date;
|
public $last_subscription_date;
|
||||||
var $last_subscription_date_start;
|
public $last_subscription_date_start;
|
||||||
var $last_subscription_date_end;
|
public $last_subscription_date_end;
|
||||||
var $last_subscription_amount;
|
public $last_subscription_amount;
|
||||||
var $subscriptions=array();
|
public $subscriptions=array();
|
||||||
|
|
||||||
var $oldcopy; // To contains a clone of this when we need to save old properties of object
|
public $oldcopy; // To contains a clone of this when we need to save old properties of object
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int Entity
|
||||||
|
*/
|
||||||
public $entity;
|
public $entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,6 +138,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function sending an email has the adherent with the text supplied in parameter.
|
* Function sending an email has the adherent with the text supplied in parameter.
|
||||||
*
|
*
|
||||||
@ -147,9 +154,9 @@ class Adherent extends CommonObject
|
|||||||
* @param string $errors_to erros to
|
* @param string $errors_to erros to
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='')
|
function send_an_email($text, $subject, $filename_list=array(), $mimetype_list=array(), $mimefilename_list=array(), $addr_cc="", $addr_bcc="", $deliveryreceipt=0, $msgishtml=-1, $errors_to='')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
// Detect if message is HTML
|
// Detect if message is HTML
|
||||||
@ -638,6 +645,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Update denormalized last subscription date.
|
* Update denormalized last subscription date.
|
||||||
* This function is called when we delete a subscription for example.
|
* This function is called when we delete a subscription for example.
|
||||||
@ -645,9 +653,9 @@ class Adherent extends CommonObject
|
|||||||
* @param User $user User making change
|
* @param User $user User making change
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function update_end_date($user)
|
function update_end_date($user)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
// Search for last subscription id and end date
|
// Search for last subscription id and end date
|
||||||
@ -993,15 +1001,16 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Method to load member from its login
|
* Method to load member from its login
|
||||||
*
|
*
|
||||||
* @param string $login login of member
|
* @param string $login login of member
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_login($login)
|
function fetch_login($login)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
|
||||||
@ -1023,6 +1032,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Method to load member from its name
|
* Method to load member from its name
|
||||||
*
|
*
|
||||||
@ -1030,9 +1040,9 @@ class Adherent extends CommonObject
|
|||||||
* @param string $lastname Lastname
|
* @param string $lastname Lastname
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_name($firstname,$lastname)
|
function fetch_name($firstname,$lastname)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."adherent";
|
||||||
@ -1195,6 +1205,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Fonction qui recupere pour un adherent les parametres
|
* Fonction qui recupere pour un adherent les parametres
|
||||||
* first_subscription_date
|
* first_subscription_date
|
||||||
@ -1204,9 +1215,9 @@ class Adherent extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int <0 si KO, >0 si OK
|
* @return int <0 si KO, >0 si OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_subscriptions()
|
function fetch_subscriptions()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
@ -1750,14 +1761,15 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to add member into external tools mailing-list, spip, etc.
|
* Function to add member into external tools mailing-list, spip, etc.
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function add_to_abo()
|
function add_to_abo()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
||||||
@ -1808,14 +1820,15 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to delete a member from external tools like mailing-list, spip, etc.
|
* Function to delete a member from external tools like mailing-list, spip, etc.
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function del_to_abo()
|
function del_to_abo()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/mailmanspip/class/mailmanspip.class.php';
|
||||||
@ -1988,6 +2001,7 @@ class Adherent extends CommonObject
|
|||||||
return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode);
|
return $this->LibStatut($this->statut,$this->need_subscription,$this->datefin,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
@ -1997,9 +2011,9 @@ class Adherent extends CommonObject
|
|||||||
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
* @param int $mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long, 5=Libelle court + Picto
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
|
function LibStatut($statut,$need_subscription,$date_end_subscription,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
@ -2013,7 +2027,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($statut == 0) return $langs->trans("MemberStatusResiliated");
|
if ($statut == 0) return $langs->trans("MemberStatusResiliated");
|
||||||
}
|
}
|
||||||
if ($mode == 1)
|
elseif ($mode == 1)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
|
if ($statut == -1) return $langs->trans("MemberStatusDraftShort");
|
||||||
if ($statut >= 1)
|
if ($statut >= 1)
|
||||||
@ -2024,7 +2038,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($statut == 0) return $langs->trans("MemberStatusResiliatedShort");
|
if ($statut == 0) return $langs->trans("MemberStatusResiliatedShort");
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort");
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraftShort");
|
||||||
if ($statut >= 1)
|
if ($statut >= 1)
|
||||||
@ -2035,7 +2049,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort");
|
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliatedShort");
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||||
if ($statut >= 1)
|
if ($statut >= 1)
|
||||||
@ -2046,7 +2060,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5');
|
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
|
if ($statut == -1) return img_picto($langs->trans('MemberStatusDraft'),'statut0').' '.$langs->trans("MemberStatusDraft");
|
||||||
if ($statut >= 1)
|
if ($statut >= 1)
|
||||||
@ -2057,7 +2071,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated");
|
if ($statut == 0) return img_picto($langs->trans('MemberStatusResiliated'),'statut5').' '.$langs->trans("MemberStatusResiliated");
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||||
if ($statut >= 1)
|
if ($statut >= 1)
|
||||||
@ -2068,7 +2082,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
|
if ($statut == 0) return '<span class="hideonsmartphone">'.$langs->trans("MemberStatusResiliated").' </span>'.img_picto($langs->trans('MemberStatusResiliated'),'statut5');
|
||||||
}
|
}
|
||||||
if ($mode == 6)
|
elseif ($mode == 6)
|
||||||
{
|
{
|
||||||
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
if ($statut == -1) return $langs->trans("MemberStatusDraft").' '.img_picto($langs->trans('MemberStatusDraft'),'statut0');
|
||||||
if ($statut >= 1)
|
if ($statut >= 1)
|
||||||
@ -2082,14 +2096,15 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Charge indicateurs this->nb de tableau de bord
|
* Charge indicateurs this->nb de tableau de bord
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function load_state_board()
|
function load_state_board()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->nb=array();
|
$this->nb=array();
|
||||||
@ -2117,15 +2132,16 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||||
*
|
*
|
||||||
* @param User $user Objet user
|
* @param User $user Objet user
|
||||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function load_board($user)
|
function load_board($user)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
if ($user->societe_id) return -1; // protection pour eviter appel par utilisateur externe
|
||||||
@ -2260,6 +2276,7 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||||
*
|
*
|
||||||
@ -2269,9 +2286,9 @@ class Adherent extends CommonObject
|
|||||||
* 2=Return key only (uid=qqq)
|
* 2=Return key only (uid=qqq)
|
||||||
* @return string DN
|
* @return string DN
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function _load_ldap_dn($info,$mode=0)
|
function _load_ldap_dn($info,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
$dn='';
|
$dn='';
|
||||||
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS."=".$info[$conf->global->LDAP_KEY_MEMBERS].",".$conf->global->LDAP_MEMBER_DN;
|
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS."=".$info[$conf->global->LDAP_KEY_MEMBERS].",".$conf->global->LDAP_MEMBER_DN;
|
||||||
@ -2281,14 +2298,15 @@ class Adherent extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Initialise tableau info (tableau des attributs LDAP)
|
* Initialise tableau info (tableau des attributs LDAP)
|
||||||
*
|
*
|
||||||
* @return array Tableau info des attributs
|
* @return array Tableau info des attributs
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function _load_ldap_info()
|
function _load_ldap_info()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$info=array();
|
$info=array();
|
||||||
@ -2618,6 +2636,7 @@ class Adherent extends CommonObject
|
|||||||
$outputlangs = new Translate('', $conf);
|
$outputlangs = new Translate('', $conf);
|
||||||
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
|
$outputlangs->setDefaultLang(empty($adherent->thirdparty->default_lang) ? $mysoc->default_lang : $adherent->thirdparty->default_lang);
|
||||||
$outputlangs->loadLangs(array("main", "members"));
|
$outputlangs->loadLangs(array("main", "members"));
|
||||||
|
dol_syslog("sendReminderForExpiredSubscription Language set to ".$outputlangs->defaultlang);
|
||||||
|
|
||||||
$arraydefaultmessage=null;
|
$arraydefaultmessage=null;
|
||||||
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;
|
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_REMIND_EXPIRATION;
|
||||||
|
|||||||
@ -36,13 +36,17 @@ class AdherentType extends CommonObject
|
|||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element = 'adherent_type';
|
public $table_element = 'adherent_type';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
public $element = 'adherent_type';
|
public $element = 'adherent_type';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
|
*/
|
||||||
public $picto = 'group';
|
public $picto = 'group';
|
||||||
|
|
||||||
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -51,19 +55,25 @@ class AdherentType extends CommonObject
|
|||||||
* @see label
|
* @see label
|
||||||
*/
|
*/
|
||||||
public $libelle;
|
public $libelle;
|
||||||
|
|
||||||
/** @var string Label */
|
/** @var string Label */
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Subsription required (0 or 1)
|
* @var int Subsription required (0 or 1)
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
*/
|
*/
|
||||||
public $subscription;
|
public $subscription;
|
||||||
|
|
||||||
/** @var string Public note */
|
/** @var string Public note */
|
||||||
public $note;
|
public $note;
|
||||||
|
|
||||||
/** @var integer Can vote */
|
/** @var integer Can vote */
|
||||||
public $vote;
|
public $vote;
|
||||||
|
|
||||||
/** @var string Email sent during validation */
|
/** @var string Email sent during validation */
|
||||||
public $mail_valid;
|
public $mail_valid;
|
||||||
|
|
||||||
/** @var array Array of members */
|
/** @var array Array of members */
|
||||||
public $members=array();
|
public $members=array();
|
||||||
|
|
||||||
@ -290,14 +300,15 @@ class AdherentType extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of members' type
|
* Return list of members' type
|
||||||
*
|
*
|
||||||
* @return array List of types of members
|
* @return array List of types of members
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function liste_array()
|
function liste_array()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$adherenttypes = array();
|
$adherenttypes = array();
|
||||||
@ -422,6 +433,7 @@ class AdherentType extends CommonObject
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
|
||||||
*
|
*
|
||||||
@ -431,9 +443,9 @@ class AdherentType extends CommonObject
|
|||||||
* 2=Return key only (uid=qqq)
|
* 2=Return key only (uid=qqq)
|
||||||
* @return string DN
|
* @return string DN
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function _load_ldap_dn($info,$mode=0)
|
function _load_ldap_dn($info,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
$dn='';
|
$dn='';
|
||||||
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS_TYPES."=".$info[$conf->global->LDAP_KEY_MEMBERS_TYPES].",".$conf->global->LDAP_MEMBER_TYPE_DN;
|
if ($mode==0) $dn=$conf->global->LDAP_KEY_MEMBERS_TYPES."=".$info[$conf->global->LDAP_KEY_MEMBERS_TYPES].",".$conf->global->LDAP_MEMBER_TYPE_DN;
|
||||||
@ -443,14 +455,15 @@ class AdherentType extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions
|
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions
|
||||||
*
|
*
|
||||||
* @return array Tableau info des attributs
|
* @return array Tableau info des attributs
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function _load_ldap_info()
|
function _load_ldap_info()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$info=array();
|
$info=array();
|
||||||
|
|||||||
@ -36,21 +36,24 @@ class Subscription extends CommonObject
|
|||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
public $element='subscription';
|
public $element='subscription';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element='subscription';
|
public $table_element='subscription';
|
||||||
|
|
||||||
public $picto='payment';
|
|
||||||
|
|
||||||
var $datec; // Date creation
|
/**
|
||||||
var $datem; // Date modification
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
var $dateh; // Subscription start date (date subscription)
|
*/
|
||||||
var $datef; // Subscription end date
|
public $picto='payment';
|
||||||
var $fk_adherent;
|
|
||||||
var $amount;
|
public $datec; // Date creation
|
||||||
var $fk_bank;
|
public $datem; // Date modification
|
||||||
|
public $dateh; // Subscription start date (date subscription)
|
||||||
|
public $datef; // Subscription end date
|
||||||
|
public $fk_adherent;
|
||||||
|
public $amount;
|
||||||
|
public $fk_bank;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -363,15 +366,16 @@ class Subscription extends CommonObject
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Renvoi le libelle d'un statut donne
|
* Renvoi le libelle d'un statut donne
|
||||||
*
|
*
|
||||||
* @param int $statut Id statut
|
* @param int $statut Id statut
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($statut)
|
function LibStatut($statut)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
@ -33,9 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||||
|
|
||||||
$langs->load("members");
|
// Load translation files required by the page
|
||||||
$langs->load("companies");
|
$langs->loadLangs(array("companies","members","other"));
|
||||||
$langs->load('other');
|
|
||||||
|
|
||||||
$id=GETPOST('id','int');
|
$id=GETPOST('id','int');
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
|
|||||||
@ -29,8 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
|
|
||||||
$langs->load("companies");
|
// Load translation files required by the page
|
||||||
$langs->load("members");
|
$langs->loadLangs(array("companies","members"));
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$result=restrictedArea($user,'adherent');
|
$result=restrictedArea($user,'adherent');
|
||||||
|
|||||||
@ -29,10 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||||
|
|
||||||
$langs->load("companies");
|
// Load translation files required by the page
|
||||||
$langs->load("members");
|
$langs->loadLangs(array("companies","members","ldap","admin"));
|
||||||
$langs->load("ldap");
|
|
||||||
$langs->load("admin");
|
|
||||||
|
|
||||||
$rowid = GETPOST('id','int');
|
$rowid = GETPOST('id','int');
|
||||||
$action = GETPOST('action','aZ09');
|
$action = GETPOST('action','aZ09');
|
||||||
|
|||||||
@ -48,6 +48,7 @@ $search=GETPOST("search",'alpha');
|
|||||||
$search_ref=GETPOST("search_ref",'alpha');
|
$search_ref=GETPOST("search_ref",'alpha');
|
||||||
$search_lastname=GETPOST("search_lastname",'alpha');
|
$search_lastname=GETPOST("search_lastname",'alpha');
|
||||||
$search_firstname=GETPOST("search_firstname",'alpha');
|
$search_firstname=GETPOST("search_firstname",'alpha');
|
||||||
|
$search_civility=GETPOST("search_civility",'alpha');
|
||||||
$search_login=GETPOST("search_login",'alpha');
|
$search_login=GETPOST("search_login",'alpha');
|
||||||
$search_address=GETPOST("search_address",'alpha');
|
$search_address=GETPOST("search_address",'alpha');
|
||||||
$search_zip=GETPOST("search_zip",'alpha');
|
$search_zip=GETPOST("search_zip",'alpha');
|
||||||
@ -105,6 +106,7 @@ $fieldstosearchall = array(
|
|||||||
if($db->type == 'pgsql') unset($fieldstosearchall['d.rowid']);
|
if($db->type == 'pgsql') unset($fieldstosearchall['d.rowid']);
|
||||||
$arrayfields=array(
|
$arrayfields=array(
|
||||||
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
|
||||||
|
'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0),
|
||||||
'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
|
'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
|
||||||
'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
|
'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
|
||||||
'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
|
'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
|
||||||
@ -121,7 +123,7 @@ $arrayfields=array(
|
|||||||
'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0),
|
'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0),
|
||||||
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
|
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
|
||||||
/*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0),
|
/*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0),
|
||||||
'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
|
'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
|
||||||
'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>500),
|
'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>500),
|
||||||
'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||||
'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||||
@ -160,6 +162,7 @@ if (empty($reshook))
|
|||||||
$search_ref="";
|
$search_ref="";
|
||||||
$search_lastname="";
|
$search_lastname="";
|
||||||
$search_firstname="";
|
$search_firstname="";
|
||||||
|
$search_civility="";
|
||||||
$search_login="";
|
$search_login="";
|
||||||
$search_company="";
|
$search_company="";
|
||||||
$search_type="";
|
$search_type="";
|
||||||
@ -203,7 +206,7 @@ $memberstatic=new Adherent($db);
|
|||||||
$now=dol_now();
|
$now=dol_now();
|
||||||
|
|
||||||
$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,";
|
$sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.societe as company, d.fk_soc,";
|
||||||
$sql.= " d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
|
$sql.= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
|
||||||
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
|
$sql.= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
|
||||||
$sql.= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
|
$sql.= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
|
||||||
$sql.= " t.libelle as type, t.subscription,";
|
$sql.= " t.libelle as type, t.subscription,";
|
||||||
@ -234,6 +237,7 @@ if ($search_ref)
|
|||||||
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")";
|
if (is_numeric($search_ref)) $sql.= " AND (d.rowid = ".$db->escape($search_ref).")";
|
||||||
else $sql.=" AND 1 = 2"; // Always wrong
|
else $sql.=" AND 1 = 2"; // Always wrong
|
||||||
}
|
}
|
||||||
|
if ($search_civility) $sql.= natural_search("d.civility", $search_civility);
|
||||||
if ($search_firstname) $sql.= natural_search("d.firstname", $search_firstname);
|
if ($search_firstname) $sql.= natural_search("d.firstname", $search_firstname);
|
||||||
if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname);
|
if ($search_lastname) $sql.= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname);
|
||||||
if ($search_login) $sql.= natural_search("d.login", $search_login);
|
if ($search_login) $sql.= natural_search("d.login", $search_login);
|
||||||
@ -322,6 +326,7 @@ if ($sall != "") $param.="&sall=".urlencode($sall);
|
|||||||
if ($statut != "") $param.="&statut=".urlencode($statut);
|
if ($statut != "") $param.="&statut=".urlencode($statut);
|
||||||
if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
|
if ($search_ref) $param.="&search_ref=".urlencode($search_ref);
|
||||||
if ($search_nom) $param.="&search_nom=".urlencode($search_nom);
|
if ($search_nom) $param.="&search_nom=".urlencode($search_nom);
|
||||||
|
if ($search_civility) $param.="&search_civility=".urlencode($search_civility);
|
||||||
if ($search_firstname) $param.="&search_firstname=".urlencode($search_firstname);
|
if ($search_firstname) $param.="&search_firstname=".urlencode($search_firstname);
|
||||||
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
|
if ($search_lastname) $param.="&search_lastname=".urlencode($search_lastname);
|
||||||
if ($search_login) $param.="&search_login=".urlencode($search_login);
|
if ($search_login) $param.="&search_login=".urlencode($search_login);
|
||||||
@ -427,37 +432,36 @@ if (! empty($arrayfields['d.ref']['checked']))
|
|||||||
print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
print '<input class="flat maxwidth50" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
if (! empty($arrayfields['d.civility']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre" align="left">';
|
||||||
|
print '<input class="flat maxwidth25" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).'"></td>';
|
||||||
|
}
|
||||||
if (! empty($arrayfields['d.firstname']['checked']))
|
if (! empty($arrayfields['d.firstname']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat maxwidth50" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'"></td>';
|
print '<input class="flat maxwidth50" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'"></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['d.lastname']['checked']))
|
if (! empty($arrayfields['d.lastname']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat maxwidth50" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
|
print '<input class="flat maxwidth50" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['d.company']['checked']))
|
if (! empty($arrayfields['d.company']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
|
print '<input class="flat maxwidth50" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['d.login']['checked']))
|
if (! empty($arrayfields['d.login']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat maxwidth50" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
|
print '<input class="flat maxwidth50" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['d.morphy']['checked']))
|
if (! empty($arrayfields['d.morphy']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($arrayfields['t.libelle']['checked']))
|
if (! empty($arrayfields['t.libelle']['checked']))
|
||||||
{
|
{
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
@ -568,6 +572,7 @@ print "</tr>\n";
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID",$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder);
|
if (! empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID",$_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],'d.rowid','',$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'],$_SERVER["PHP_SELF"],'d.rowid','',$param,'',$sortfield,$sortorder);
|
||||||
|
if (! empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'],$_SERVER["PHP_SELF"],'d.civility','',$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'],$_SERVER["PHP_SELF"],'d.firstname','',$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'],$_SERVER["PHP_SELF"],'d.lastname','',$param,'',$sortfield,$sortorder);
|
||||||
if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.societe','',$param,'',$sortfield,$sortorder);
|
if (! empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'],$_SERVER["PHP_SELF"],'d.societe','',$param,'',$sortfield,$sortorder);
|
||||||
@ -605,6 +610,7 @@ while ($i < min($num, $limit))
|
|||||||
$datefin=$db->jdate($obj->datefin);
|
$datefin=$db->jdate($obj->datefin);
|
||||||
$memberstatic->id=$obj->rowid;
|
$memberstatic->id=$obj->rowid;
|
||||||
$memberstatic->ref=$obj->rowid;
|
$memberstatic->ref=$obj->rowid;
|
||||||
|
$memberstatic->civility_id=$obj->civility;
|
||||||
$memberstatic->lastname=$obj->lastname;
|
$memberstatic->lastname=$obj->lastname;
|
||||||
$memberstatic->firstname=$obj->firstname;
|
$memberstatic->firstname=$obj->firstname;
|
||||||
$memberstatic->statut=$obj->statut;
|
$memberstatic->statut=$obj->statut;
|
||||||
@ -630,10 +636,17 @@ while ($i < min($num, $limit))
|
|||||||
// Ref
|
// Ref
|
||||||
if (! empty($arrayfields['d.ref']['checked']))
|
if (! empty($arrayfields['d.ref']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>";
|
print "<td>";
|
||||||
print $memberstatic->getNomUrl(-1, 0, 'card', 'ref');
|
print $memberstatic->getNomUrl(-1, 0, 'card', 'ref');
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
}
|
}
|
||||||
|
// Civility
|
||||||
|
if (! empty($arrayfields['d.civility']['checked']))
|
||||||
|
{
|
||||||
|
print "<td>";
|
||||||
|
print $obj->civility;
|
||||||
|
print "</td>\n";
|
||||||
|
}
|
||||||
// Firstname
|
// Firstname
|
||||||
if (! empty($arrayfields['d.firstname']['checked']))
|
if (! empty($arrayfields['d.firstname']['checked']))
|
||||||
{
|
{
|
||||||
@ -658,12 +671,12 @@ while ($i < min($num, $limit))
|
|||||||
// Login
|
// Login
|
||||||
if (! empty($arrayfields['d.login']['checked']))
|
if (! empty($arrayfields['d.login']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$obj->login."</td>\n";
|
print "<td>".$obj->login."</td>\n";
|
||||||
}
|
}
|
||||||
// Moral/Physique
|
// Moral/Physique
|
||||||
if (! empty($arrayfields['d.morphy']['checked']))
|
if (! empty($arrayfields['d.morphy']['checked']))
|
||||||
{
|
{
|
||||||
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
|
print "<td>".$memberstatic->getmorphylib($obj->morphy)."</td>\n";
|
||||||
}
|
}
|
||||||
// Type label
|
// Type label
|
||||||
if (! empty($arrayfields['t.libelle']['checked']))
|
if (! empty($arrayfields['t.libelle']['checked']))
|
||||||
|
|||||||
@ -28,9 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||||
|
|
||||||
$langs->load("companies");
|
// Load translation files required by the page
|
||||||
$langs->load("members");
|
$langs->loadLangs(array("companies","members","bills"));
|
||||||
$langs->load("bills");
|
|
||||||
|
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
$id=GETPOST('id','int');
|
$id=GETPOST('id','int');
|
||||||
|
|||||||
@ -44,8 +44,8 @@ $year = strftime("%Y", time());
|
|||||||
$startyear=$year-2;
|
$startyear=$year-2;
|
||||||
$endyear=$year;
|
$endyear=$year;
|
||||||
|
|
||||||
$langs->load("members");
|
// Load translation files required by the page
|
||||||
$langs->load("companies");
|
$langs->loadLangs(array("companies","members"));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -45,8 +45,8 @@ $year = strftime("%Y", time());
|
|||||||
$startyear=$year-2;
|
$startyear=$year-2;
|
||||||
$endyear=$year;
|
$endyear=$year;
|
||||||
|
|
||||||
$langs->load("members");
|
// Load translation files required by the page
|
||||||
$langs->load("companies");
|
$langs->loadLangs(array("companies","members"));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -46,8 +46,8 @@ $year = strftime("%Y", time());
|
|||||||
$startyear=$year-2;
|
$startyear=$year-2;
|
||||||
$endyear=$year;
|
$endyear=$year;
|
||||||
|
|
||||||
$langs->load("members");
|
// Load translation files required by the page
|
||||||
$langs->load("companies");
|
$langs->loadLangs(array("companies","members"));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -895,7 +896,7 @@ if ($rowid > 0)
|
|||||||
$datefrom=dol_time_plus_duree($object->datefin,1,'d');
|
$datefrom=dol_time_plus_duree($object->datefin,1,'d');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print $form->select_date($datefrom,'','','','',"subscription",1,1,1);
|
print $form->selectDate($datefrom, '', '', '', '', "subscription", 1, 1);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
// Date end subscription
|
// Date end subscription
|
||||||
@ -908,7 +909,7 @@ if ($rowid > 0)
|
|||||||
$dateto=-1; // By default, no date is suggested
|
$dateto=-1; // By default, no date is suggested
|
||||||
}
|
}
|
||||||
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td>';
|
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td>';
|
||||||
print $form->select_date($dateto,'end','','','',"subscription",1,0,1);
|
print $form->selectDate($dateto, 'end', '', '', '', "subscription", 1, 0);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
|
|
||||||
if ($adht->subscription)
|
if ($adht->subscription)
|
||||||
@ -1009,7 +1010,7 @@ if ($rowid > 0)
|
|||||||
|
|
||||||
// Date of payment
|
// Date of payment
|
||||||
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
|
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
|
||||||
print $form->select_date(isset($paymentdate)?$paymentdate:-1,'payment',0,0,1,'subscription',1,1,1);
|
print $form->selectDate(isset($paymentdate)?$paymentdate:-1, 'payment', 0, 0, 1, 'subscription', 1, 1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
print '<tr class="bankswitchclass2"><td>'.$langs->trans('Numero');
|
print '<tr class="bankswitchclass2"><td>'.$langs->trans('Numero');
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -29,10 +30,8 @@ if (! empty($conf->banque->enabled)) {
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->load("companies");
|
// Load translation files required by the page
|
||||||
$langs->load("bills");
|
$langs->loadLangs(array("companies","members","bills","users"));
|
||||||
$langs->load("members");
|
|
||||||
$langs->load("users");
|
|
||||||
|
|
||||||
$adh = new Adherent($db);
|
$adh = new Adherent($db);
|
||||||
$object = new Subscription($db);
|
$object = new Subscription($db);
|
||||||
@ -211,13 +210,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
|
|||||||
|
|
||||||
// Date start subscription
|
// Date start subscription
|
||||||
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
|
print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
|
||||||
$form->select_date($object->dateh,'datesub',1,1,0,'update',1);
|
print $form->selectDate($object->dateh, 'datesub', 1, 1, 0, 'update', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Date end subscription
|
// Date end subscription
|
||||||
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="2">';
|
print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="2">';
|
||||||
$form->select_date($object->datef,'datesubend',0,0,0,'update',1);
|
print $form->selectDate($object->datef, 'datesubend', 0, 0, 0, 'update', 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
|||||||
@ -28,10 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/adherents/class/subscription.class.php';
|
||||||
|
|
||||||
$langs->load("companies");
|
// Load translation files required by the page
|
||||||
$langs->load("bills");
|
$langs->loadLangs(array("companies","members","bills","users"));
|
||||||
$langs->load("members");
|
|
||||||
$langs->load("users");
|
|
||||||
|
|
||||||
if (!$user->rights->adherent->lire)
|
if (!$user->rights->adherent->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -29,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/ldap.lib.php';
|
||||||
|
|
||||||
$langs->load("members");
|
// Load translation files required by the page
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("admin","members","ldap"));
|
||||||
$langs->load("ldap");
|
|
||||||
|
|
||||||
$id = GETPOST('rowid', 'int');
|
$id = GETPOST('rowid', 'int');
|
||||||
$action = GETPOST('action','alpha');
|
$action = GETPOST('action','alpha');
|
||||||
|
|||||||
@ -356,7 +356,7 @@ print '<tr class="oddeven">'."\n";
|
|||||||
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
|
print '<td>'.$langs->trans("AGENDA_DEFAULT_VIEW").'</td>'."\n";
|
||||||
print '<td align="center"> </td>'."\n";
|
print '<td align="center"> </td>'."\n";
|
||||||
print '<td align="right">'."\n";
|
print '<td align="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, $conf->global->AGENDA_DEFAULT_VIEW);
|
print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -306,7 +306,7 @@ if (! empty($conf->product->enabled))
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
print '<td>'.$langs->trans("SetDefaultBarcodeTypeProducts").'</td>';
|
||||||
print '<td width="60" align="right">';
|
print '<td width="60" align="right">';
|
||||||
$formbarcode->select_barcode_type($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE,"PRODUIT_DEFAULT_BARCODE_TYPE",1);
|
print $formbarcode->selectBarcodeType($conf->global->PRODUIT_DEFAULT_BARCODE_TYPE, "PRODUIT_DEFAULT_BARCODE_TYPE", 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ if (! empty($conf->societe->enabled))
|
|||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
|
print '<td>'.$langs->trans("SetDefaultBarcodeTypeThirdParties").'</td>';
|
||||||
print '<td width="60" align="right">';
|
print '<td width="60" align="right">';
|
||||||
print $formbarcode->select_barcode_type($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY,"GENBARCODE_BARCODETYPE_THIRDPARTY",1);
|
print $formbarcode->selectBarcodeType($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY, "GENBARCODE_BARCODETYPE_THIRDPARTY", 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ $error=0;
|
|||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('admincompany','globaladmin'));
|
$hookmanager->initHooks(array('admincompany','globaladmin'));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
@ -397,7 +398,7 @@ if ($action == 'edit' || $action == 'updateedit')
|
|||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
|
||||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
|
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('/thumbs/'.$mysoc->logo_mini).'">';
|
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||||
@ -791,7 +792,7 @@ else
|
|||||||
}
|
}
|
||||||
else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini))
|
||||||
{
|
{
|
||||||
print '<img class="img_logo" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('/thumbs/'.$mysoc->logo_mini).'">';
|
print '<img class="img_logo" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -122,6 +122,13 @@ $modules=array(
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$labelmeteo = array(0=>$langs->trans("No"), 1=>$langs->trans("Yes"), 2=>$langs->trans("OnMobileOnly"));
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Actions
|
||||||
|
*/
|
||||||
|
|
||||||
if ($action == 'update')
|
if ($action == 'update')
|
||||||
{
|
{
|
||||||
foreach($modules as $module => $delays)
|
foreach($modules as $module => $delays)
|
||||||
@ -201,9 +208,10 @@ if ($action == 'edit')
|
|||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
$var=false;
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '</td></tr>';
|
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
|
||||||
|
print $form->selectarray('MAIN_DISABLE_METEO', $labelmeteo, (empty($conf->global->MAIN_DISABLE_METEO)?0:$conf->global->MAIN_DISABLE_METEO));
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
}
|
}
|
||||||
@ -241,7 +249,9 @@ else
|
|||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td class="center" width="120px">'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">' . yn($conf->global->MAIN_DISABLE_METEO) . '</td></tr>';
|
print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td class="center">';
|
||||||
|
print $labelmeteo[$conf->global->MAIN_DISABLE_METEO];
|
||||||
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
|
|||||||
@ -163,15 +163,16 @@ class Dolistore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return tree of Dolistore categories. $this->categories must have been loaded before.
|
* Return tree of Dolistore categories. $this->categories must have been loaded before.
|
||||||
*
|
*
|
||||||
* @param int $parent Id of parent category
|
* @param int $parent Id of parent category
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_categories($parent = 0)
|
function get_categories($parent = 0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if (!isset($this->categories)) die('not possible');
|
if (!isset($this->categories)) die('not possible');
|
||||||
if ($parent != 0) {
|
if ($parent != 0) {
|
||||||
$html = '<ul>';
|
$html = '<ul>';
|
||||||
@ -211,14 +212,15 @@ class Dolistore
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of product formated for output
|
* Return list of product formated for output
|
||||||
*
|
*
|
||||||
* @return string HTML output
|
* @return string HTML output
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_products()
|
function get_products()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs, $conf;
|
global $langs, $conf;
|
||||||
$html = "";
|
$html = "";
|
||||||
$parity = "pair";
|
$parity = "pair";
|
||||||
@ -293,38 +295,41 @@ class Dolistore
|
|||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* get previous link
|
* get previous link
|
||||||
*
|
*
|
||||||
* @param string $text symbol previous
|
* @param string $text symbol previous
|
||||||
* @return string html previous link
|
* @return string html previous link
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_previous_link($text = '<<')
|
function get_previous_link($text = '<<')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
|
return '<a href="'.$this->get_previous_url().'" class="button">'.$text.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* get next link
|
* get next link
|
||||||
*
|
*
|
||||||
* @param string $text symbol next
|
* @param string $text symbol next
|
||||||
* @return string html next link
|
* @return string html next link
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_next_link($text = '>>')
|
function get_next_link($text = '>>')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
|
return '<a href="'.$this->get_next_url().'" class="button">'.$text.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* get previous url
|
* get previous url
|
||||||
*
|
*
|
||||||
* @return string previous url
|
* @return string previous url
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
function get_previous_url()
|
||||||
function get_previous_url()
|
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$param_array = array();
|
$param_array = array();
|
||||||
if ($this->start < $this->per_page) {
|
if ($this->start < $this->per_page) {
|
||||||
$sub = 0;
|
$sub = 0;
|
||||||
@ -340,14 +345,15 @@ class Dolistore
|
|||||||
return $this->url."&".$param;
|
return $this->url."&".$param;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* get next url
|
* get next url
|
||||||
*
|
*
|
||||||
* @return string next url
|
* @return string next url
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_next_url()
|
function get_next_url()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$param_array = array();
|
$param_array = array();
|
||||||
if (count($this->products) < $this->per_page) {
|
if (count($this->products) < $this->per_page) {
|
||||||
$add = 0;
|
$add = 0;
|
||||||
@ -363,6 +369,7 @@ class Dolistore
|
|||||||
return $this->url."&".$param;
|
return $this->url."&".$param;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* version compare
|
* version compare
|
||||||
*
|
*
|
||||||
@ -370,9 +377,9 @@ class Dolistore
|
|||||||
* @param string $v2 version 2
|
* @param string $v2 version 2
|
||||||
* @return int result of compare
|
* @return int result of compare
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function version_compare($v1, $v2)
|
function version_compare($v1, $v2)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$v1 = explode('.', $v1);
|
$v1 = explode('.', $v1);
|
||||||
$v2 = explode('.', $v2);
|
$v2 = explode('.', $v2);
|
||||||
$ret = 0;
|
$ret = 0;
|
||||||
|
|||||||
@ -1,7 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2012 Mikael Carlavan <contact@mika-carl.fr>
|
/* Copyright (C) 2012 Mikael Carlavan <contact@mika-carl.fr>
|
||||||
* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
|
* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
|
||||||
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
|
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -182,8 +183,8 @@ if ($action != 'edit')
|
|||||||
|
|
||||||
echo '<td>'.$form->selectExpense('', 'fk_c_type_fees', 0, 1, 1).'</td>';
|
echo '<td>'.$form->selectExpense('', 'fk_c_type_fees', 0, 1, 1).'</td>';
|
||||||
echo '<td>'.$form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0).'</td>';
|
echo '<td>'.$form->selectarray('code_expense_rules_type', $tab_rules_type, '', 0).'</td>';
|
||||||
echo '<td>'.$form->select_date(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0, 1).'</td>';
|
echo '<td>'.$form->selectDate(strtotime(date('Y-m-01', dol_now())), 'start', '', '', 0, '', 1, 0).'</td>';
|
||||||
echo '<td>'.$form->select_date(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0, 1).'</td>';
|
echo '<td>'.$form->selectDate(strtotime(date('Y-m-t', dol_now())), 'end', '', '', 0, '', 1, 0).'</td>';
|
||||||
echo '<td><input type="text" value="" name="amount" class="amount" />'.$conf->currency.'</td>';
|
echo '<td><input type="text" value="" name="amount" class="amount" />'.$conf->currency.'</td>';
|
||||||
echo '<td>'.$form->selectyesno('restrictive', 0, 1).'</td>';
|
echo '<td>'.$form->selectyesno('restrictive', 0, 1).'</td>';
|
||||||
echo '<td align="right"><input type="submit" class="button" value="'.$langs->trans('Add').'" /></td>';
|
echo '<td align="right"><input type="submit" class="button" value="'.$langs->trans('Add').'" /></td>';
|
||||||
@ -270,7 +271,7 @@ foreach ($rules as $rule)
|
|||||||
echo '<td>';
|
echo '<td>';
|
||||||
if ($action == 'edit' && $object->id == $rule->id)
|
if ($action == 'edit' && $object->id == $rule->id)
|
||||||
{
|
{
|
||||||
echo $form->select_date(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0, 1);
|
print $form->selectDate(strtotime(date('Y-m-d', $object->dates)), 'start', '', '', 0, '', 1, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -282,7 +283,7 @@ foreach ($rules as $rule)
|
|||||||
echo '<td>';
|
echo '<td>';
|
||||||
if ($action == 'edit' && $object->id == $rule->id)
|
if ($action == 'edit' && $object->id == $rule->id)
|
||||||
{
|
{
|
||||||
echo $form->select_date(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0, 1);
|
print $form->selectDate(strtotime(date('Y-m-d', $object->datee)), 'end', '', '', 0, '', 1, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
/* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2015 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
||||||
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -30,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("errors");
|
$langs->loadLangs(array("admin", "errors", "holiday"));
|
||||||
$langs->load("holiday");
|
|
||||||
|
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) accessforbidden();
|
||||||
|
|
||||||
@ -341,7 +339,6 @@ print "</tr>\n";
|
|||||||
|
|
||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
$var=true;
|
|
||||||
foreach ($dirmodels as $reldir)
|
foreach ($dirmodels as $reldir)
|
||||||
{
|
{
|
||||||
foreach (array('','/doc') as $valdir)
|
foreach (array('','/doc') as $valdir)
|
||||||
@ -379,7 +376,6 @@ foreach ($dirmodels as $reldir)
|
|||||||
|
|
||||||
if ($modulequalified)
|
if ($modulequalified)
|
||||||
{
|
{
|
||||||
$var = !$var;
|
|
||||||
print '<tr class="oddeven"><td width="100">';
|
print '<tr class="oddeven"><td width="100">';
|
||||||
print (empty($module->name)?$name:$module->name);
|
print (empty($module->name)?$name:$module->name);
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
@ -474,7 +470,6 @@ print '<tr class="liste_titre">';
|
|||||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||||
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
|
print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
$var=true;
|
|
||||||
|
|
||||||
$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
|
$substitutionarray=pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
|
||||||
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
|
$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
|
||||||
@ -482,7 +477,6 @@ $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
|
|||||||
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
|
foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
|
||||||
$htmltext.='</i>';
|
$htmltext.='</i>';
|
||||||
|
|
||||||
$var=! $var;
|
|
||||||
print '<tr class="oddeven"><td colspan="2">';
|
print '<tr class="oddeven"><td colspan="2">';
|
||||||
print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
|
print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -133,6 +134,9 @@ if ($action == 'update')
|
|||||||
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black)
|
if (GETPOST('THEME_ELDY_USE_HOVER') == '') dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", '0', 'chaine', 0, '', $conf->entity); // If empty, we set to '0' ('000000' is for black)
|
||||||
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
|
else dolibarr_set_const($db, "THEME_ELDY_USE_HOVER", $_POST["THEME_ELDY_USE_HOVER"], 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
|
if (GETPOST('THEME_ELDY_USE_CHECKED') == '') dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", '0', 'chaine', 0, '', $conf->entity);
|
||||||
|
else dolibarr_set_const($db, "THEME_ELDY_USE_CHECKED", $_POST["THEME_ELDY_USE_CHECKED"], 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", $_POST["main_size_shortliste_limit"],'chaine',0,'',$conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
|
dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity);
|
||||||
@ -413,7 +417,7 @@ if ($action == 'edit') // Edit
|
|||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
|
||||||
if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
|
if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
|
||||||
print ' ';
|
print ' ';
|
||||||
print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
|
print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||||
@ -561,7 +565,7 @@ else // Show
|
|||||||
print $conf->global->MAIN_LOGIN_BACKGROUND;
|
print $conf->global->MAIN_LOGIN_BACKGROUND;
|
||||||
if ($conf->global->MAIN_LOGIN_BACKGROUND && is_file($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND))
|
if ($conf->global->MAIN_LOGIN_BACKGROUND && is_file($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND))
|
||||||
{
|
{
|
||||||
print '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode($conf->global->MAIN_LOGIN_BACKGROUND).'">';
|
print '<img class="img_logo paddingleft valignmiddle" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,9 +28,8 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/menubase.class.php';
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("other","admin"));
|
||||||
$langs->load('other');
|
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@ -27,8 +27,8 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
|
||||||
|
|
||||||
$langs->load("other");
|
// Load translation files required by the page
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("other","admin"));
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@ -24,9 +24,8 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
$langs->load("users");
|
// Load translation files required by the page
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("user","other","admin"));
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@ -598,17 +598,18 @@ if ($mode == 'common')
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Print a separator if we change family
|
// Print a separator if we change family
|
||||||
if ($familykey!=$oldfamily)
|
if ($familykey != $oldfamily) {
|
||||||
{
|
if ($oldfamily) {
|
||||||
if ($oldfamily) print '</table></div><br>';
|
print '</table></div><br>';
|
||||||
|
}
|
||||||
|
|
||||||
$familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
|
$familytext = empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label'];
|
||||||
print_fiche_titre($familytext, '', '');
|
print load_fiche_titre($familytext, '', '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
|
print '<table class="tagtable liste" summary="list_of_modules">'."\n";
|
||||||
|
|
||||||
$atleastoneforfamily=0;
|
$atleastoneforfamily=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$atleastoneforfamily++;
|
$atleastoneforfamily++;
|
||||||
|
|||||||
@ -171,7 +171,7 @@ llxHeader('', $langs->trans($page_name));
|
|||||||
|
|
||||||
// Subheader
|
// Subheader
|
||||||
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||||
print_fiche_titre($langs->trans($page_name), $linkback);
|
print load_fiche_titre($langs->trans($page_name), $linkback);
|
||||||
|
|
||||||
// Configuration header
|
// Configuration header
|
||||||
$head = multicurrencyAdminPrepareHead();
|
$head = multicurrencyAdminPrepareHead();
|
||||||
|
|||||||
@ -32,11 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('admin', 'languages', 'other'));
|
$langs->loadLangs(array('admin', 'languages', 'other', 'companies', 'products', 'members'));
|
||||||
|
|
||||||
$langs->load("companies");
|
|
||||||
$langs->load("products");
|
|
||||||
$langs->load("members");
|
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@ -75,7 +75,7 @@ if ($action == 'update')
|
|||||||
llxHeader('',$langs->trans('SalariesSetup'));
|
llxHeader('',$langs->trans('SalariesSetup'));
|
||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
if (! empty($conf->accounting->enabled)) $formaccounting = New FormAccounting($db);
|
if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
|
||||||
|
|
||||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||||
print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup');
|
print load_fiche_titre($langs->trans('SalariesSetup'),$linkback,'title_setup');
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2012 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2013-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -32,17 +32,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->load("orders");
|
$langs->loadLangs(array("admin", "other", "bills", "orders", "suppliers"));
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
$langs->load("admin");
|
|
||||||
$langs->load("other");
|
|
||||||
$langs->load("bills");
|
|
||||||
$langs->load("orders");
|
|
||||||
$langs->load("suppliers");
|
|
||||||
|
|
||||||
$extrafields = new ExtraFields($db);
|
$extrafields = new ExtraFields($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
|
|||||||
@ -28,10 +28,8 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("help");
|
$langs->loadLangs(array("help","members","other","admin"));
|
||||||
$langs->load("members");
|
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
|
|
||||||
@ -196,7 +194,7 @@ if ($showpromotemessage)
|
|||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
if ((empty($tmp[2]) && (strpos($tmp[1], '0') === 0)) || (strpos($tmp[2], '0') === 0))
|
if ((empty($tmp[2]) && (strpos($tmp[1], '0') === 0)) || (strpos($tmp[2], '0') === 0))
|
||||||
{
|
{
|
||||||
print $langs->trans("TitleExampleForMajorRelease").':<br>';
|
print $langs->trans("TitleExampleForMajorRelease").':<br>';
|
||||||
|
|||||||
@ -26,9 +26,8 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("install");
|
$langs->loadLangs(array("install","other","admin"));
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -24,9 +24,8 @@
|
|||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("user");
|
$langs->loadLangs(array("install","user","admin"));
|
||||||
$langs->load("install");
|
|
||||||
|
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
|
|||||||
@ -29,9 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("install");
|
$langs->loadLangs(array("install","other","admin"));
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
|
|
||||||
|
|||||||
@ -422,7 +422,7 @@ if (! $error && $xml)
|
|||||||
$outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
|
$outcurrentchecksum = '<span class="'.$resultcode.'">'.$checksumget.'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
|
print load_fiche_titre($langs->trans("GlobalChecksum")).'<br>';
|
||||||
print $langs->trans("ExpectedChecksum").' = '. $outexpectedchecksum .'<br>';
|
print $langs->trans("ExpectedChecksum").' = '. $outexpectedchecksum .'<br>';
|
||||||
print $langs->trans("CurrentChecksum").' = '. $outcurrentchecksum;
|
print $langs->trans("CurrentChecksum").' = '. $outcurrentchecksum;
|
||||||
|
|
||||||
@ -438,4 +438,3 @@ llxFooter();
|
|||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
exit($error);
|
exit($error);
|
||||||
|
|
||||||
|
|||||||
@ -25,9 +25,8 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("install");
|
$langs->loadLangs(array("install","other","admin"));
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -26,9 +26,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("install");
|
$langs->loadLangs(array("install","other","admin"));
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("other");
|
$langs->loadLangs(array("other","admin"));
|
||||||
|
|
||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("companies");
|
$langs->loadLangs(array("companies","admin"));
|
||||||
|
|
||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -40,10 +41,8 @@ if ($user->societe_id > 0)
|
|||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("companies");
|
$langs->loadLangs(array("companies","admin","users","other"));
|
||||||
$langs->load("users");
|
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
// Load variable for pagination
|
// Load variable for pagination
|
||||||
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
@ -237,7 +236,7 @@ if ($result)
|
|||||||
// Lignes des champs de filtres
|
// Lignes des champs de filtres
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
|
|
||||||
print '<td class="liste_titre" width="15%">'.$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).$form->select_date($date_end,'date_end',0,0,0,'',1,0,1).'</td>';
|
print '<td class="liste_titre" width="15%">'.$form->selectDate($date_start,'date_start',0,0,0,'',1,0).$form->selectDate($date_end,'date_end',0,0,0,'',1,0).'</td>';
|
||||||
|
|
||||||
print '<td align="left" class="liste_titre">';
|
print '<td align="left" class="liste_titre">';
|
||||||
print '<input class="flat" type="text" size="10" name="search_code" value="'.$search_code.'">';
|
print '<input class="flat" type="text" size="10" name="search_code" value="'.$search_code.'">';
|
||||||
|
|||||||
@ -25,7 +25,8 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
|
|
||||||
$langs->load("install");
|
// Load translation files required by the page
|
||||||
|
$langs->loadLangs(array("companies","install","users","other"));
|
||||||
|
|
||||||
if (! $user->admin)
|
if (! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
@ -40,10 +41,6 @@ if ($user->societe_id > 0)
|
|||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->load("companies");
|
|
||||||
$langs->load("users");
|
|
||||||
$langs->load("other");
|
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
$sortfield = GETPOST("sortfield",'alpha');
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$sortorder = GETPOST("sortorder",'alpha');
|
||||||
$page = GETPOST("page",'int');
|
$page = GETPOST("page",'int');
|
||||||
|
|||||||
@ -27,8 +27,8 @@ require_once DOL_DOCUMENT_ROOT . '/core/lib/admin.lib.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php';
|
require_once DOL_DOCUMENT_ROOT . '/core/lib/geturl.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("other");
|
$langs->loadLangs(array("admin","other"));
|
||||||
|
|
||||||
$action=GETPOST('action','alpha');
|
$action=GETPOST('action','alpha');
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ print $langs->trans("CurrentVersion").' : <strong>'.DOL_VERSION.'</strong><br>';
|
|||||||
if (function_exists('curl_init'))
|
if (function_exists('curl_init'))
|
||||||
{
|
{
|
||||||
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||||
|
|
||||||
if ($action == 'getlastversion')
|
if ($action == 'getlastversion')
|
||||||
{
|
{
|
||||||
if ($sfurl)
|
if ($sfurl)
|
||||||
@ -95,7 +95,7 @@ if (function_exists('curl_init'))
|
|||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show version
|
// Show version
|
||||||
print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>';
|
print $langs->trans("LastStableVersion").' : <b>'. (($version != '0.0')?$version:$langs->trans("Unknown")) .'</b><br>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -271,15 +271,16 @@ class DolibarrApi
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Function to forge a SQL criteria
|
* Function to forge a SQL criteria
|
||||||
*
|
*
|
||||||
* @param array $matches Array of found string by regex search
|
* @param array $matches Array of found string by regex search
|
||||||
* @return string Forged criteria. Example: "t.field like 'abc%'"
|
* @return string Forged criteria. Example: "t.field like 'abc%'"
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
static function _forge_criteria_callback($matches)
|
static function _forge_criteria_callback($matches)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
//dol_syslog("Convert matches ".$matches[1]);
|
//dol_syslog("Convert matches ".$matches[1]);
|
||||||
|
|||||||
@ -59,15 +59,16 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
*/
|
*/
|
||||||
public static $user = '';
|
public static $user = '';
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
|
||||||
/**
|
/**
|
||||||
* Check access
|
* Check access
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws RestException
|
* @throws RestException
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
|
|
||||||
public function __isAllowed()
|
public function __isAllowed()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $db;
|
global $conf, $db;
|
||||||
|
|
||||||
$login = '';
|
$login = '';
|
||||||
@ -165,15 +166,16 @@ class DolibarrApiAccess implements iAuthenticate
|
|||||||
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
|
return in_array(static::$role, (array) $requirefortest) || static::$role == 'admin';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName
|
||||||
/**
|
/**
|
||||||
* @return string string to be used with WWW-Authenticate header
|
* @return string string to be used with WWW-Authenticate header
|
||||||
* @example Basic
|
* @example Basic
|
||||||
* @example Digest
|
* @example Digest
|
||||||
* @example OAuth
|
* @example OAuth
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName
|
|
||||||
public function __getWWWAuthenticateString()
|
public function __getWWWAuthenticateString()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -95,18 +95,36 @@ class Asset extends CommonObject
|
|||||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,),
|
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,),
|
||||||
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Active', '-1'=>'Cancel')),
|
'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Active', '-1'=>'Cancel')),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int ID
|
||||||
|
*/
|
||||||
public $rowid;
|
public $rowid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string Ref
|
||||||
|
*/
|
||||||
public $ref;
|
public $ref;
|
||||||
|
|
||||||
public $entity;
|
public $entity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string proper name for given parameter
|
* @var string Asset label
|
||||||
*/
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
public $amount;
|
public $amount;
|
||||||
public $fk_soc;
|
|
||||||
|
/**
|
||||||
|
* @var int Thirdparty ID
|
||||||
|
*/
|
||||||
|
public $fk_soc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string description
|
||||||
|
*/
|
||||||
public $description;
|
public $description;
|
||||||
|
|
||||||
public $note_public;
|
public $note_public;
|
||||||
public $note_private;
|
public $note_private;
|
||||||
public $date_creation;
|
public $date_creation;
|
||||||
@ -338,6 +356,7 @@ class Asset extends CommonObject
|
|||||||
return $this->LibStatut($this->status,$mode);
|
return $this->LibStatut($this->status,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return the status
|
* Return the status
|
||||||
*
|
*
|
||||||
@ -345,43 +364,37 @@ class Asset extends CommonObject
|
|||||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
static function LibStatut($status,$mode=0)
|
static function LibStatut($status,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0 || $mode == 1)
|
||||||
{
|
|
||||||
$prefix='';
|
|
||||||
if ($status == 1) return $langs->trans('Enabled');
|
|
||||||
if ($status == 0) return $langs->trans('Disabled');
|
|
||||||
}
|
|
||||||
if ($mode == 1)
|
|
||||||
{
|
{
|
||||||
if ($status == 1) return $langs->trans('Enabled');
|
if ($status == 1) return $langs->trans('Enabled');
|
||||||
if ($status == 0) return $langs->trans('Disabled');
|
if ($status == 0) return $langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 2)
|
elseif ($mode == 2)
|
||||||
{
|
{
|
||||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 3)
|
elseif ($mode == 3)
|
||||||
{
|
{
|
||||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5');
|
||||||
}
|
}
|
||||||
if ($mode == 4)
|
elseif ($mode == 4)
|
||||||
{
|
{
|
||||||
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
if ($status == 1) return img_picto($langs->trans('Enabled'),'statut4').' '.$langs->trans('Enabled');
|
||||||
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
if ($status == 0) return img_picto($langs->trans('Disabled'),'statut5').' '.$langs->trans('Disabled');
|
||||||
}
|
}
|
||||||
if ($mode == 5)
|
elseif ($mode == 5)
|
||||||
{
|
{
|
||||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||||
}
|
}
|
||||||
if ($mode == 6)
|
elseif ($mode == 6)
|
||||||
{
|
{
|
||||||
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
if ($status == 1) return $langs->trans('Enabled').' '.img_picto($langs->trans('Enabled'),'statut4');
|
||||||
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
if ($status == 0) return $langs->trans('Disabled').' '.img_picto($langs->trans('Disabled'),'statut5');
|
||||||
|
|||||||
@ -33,25 +33,34 @@ class AssetType extends CommonObject
|
|||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element = 'asset_type';
|
public $table_element = 'asset_type';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
public $element = 'asset_type';
|
public $element = 'asset_type';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
|
*/
|
||||||
public $picto = 'group';
|
public $picto = 'group';
|
||||||
|
|
||||||
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
|
|
||||||
/** @var string Label */
|
/** @var string Label */
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
/** @var string Accountancy code asset */
|
/** @var string Accountancy code asset */
|
||||||
public $accountancy_code_asset;
|
public $accountancy_code_asset;
|
||||||
|
|
||||||
/** @var string Accountancy code depreciation asset */
|
/** @var string Accountancy code depreciation asset */
|
||||||
public $accountancy_code_depreciation_asset;
|
public $accountancy_code_depreciation_asset;
|
||||||
|
|
||||||
/** @var string Accountancy code depreciation expense */
|
/** @var string Accountancy code depreciation expense */
|
||||||
public $accountancy_code_depreciation_expense;
|
public $accountancy_code_depreciation_expense;
|
||||||
|
|
||||||
/** @var string Public note */
|
/** @var string Public note */
|
||||||
public $note;
|
public $note;
|
||||||
|
|
||||||
/** @var array Array of asset */
|
/** @var array Array of asset */
|
||||||
public $asset=array();
|
public $asset=array();
|
||||||
|
|
||||||
@ -282,14 +291,15 @@ class AssetType extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return list of asset's type
|
* Return list of asset's type
|
||||||
*
|
*
|
||||||
* @return array List of types of members
|
* @return array List of types of members
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function liste_array()
|
function liste_array()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$assettypes = array();
|
$assettypes = array();
|
||||||
|
|||||||
@ -178,19 +178,19 @@ if ($action == 'builddoc')
|
|||||||
{
|
{
|
||||||
// List of values to scan for a replacement
|
// List of values to scan for a replacement
|
||||||
$substitutionarray = array (
|
$substitutionarray = array (
|
||||||
'%LOGIN%'=>$user->login,
|
'%LOGIN%' => $user->login,
|
||||||
'%COMPANY%'=>$mysoc->name,
|
'%COMPANY%' => $mysoc->name,
|
||||||
'%ADDRESS%'=>$mysoc->address,
|
'%ADDRESS%' => $mysoc->address,
|
||||||
'%ZIP%'=>$mysoc->zip,
|
'%ZIP%' => $mysoc->zip,
|
||||||
'%TOWN%'=>$mysoc->town,
|
'%TOWN%' => $mysoc->town,
|
||||||
'%COUNTRY%'=>$mysoc->country,
|
'%COUNTRY%' => $mysoc->country,
|
||||||
'%COUNTRY_CODE%'=>$mysoc->country_code,
|
'%COUNTRY_CODE%' => $mysoc->country_code,
|
||||||
'%EMAIL%'=>$mysoc->email,
|
'%EMAIL%' => $mysoc->email,
|
||||||
'%YEAR%'=>$year,
|
'%YEAR%' => $year,
|
||||||
'%MONTH%'=>$month,
|
'%MONTH%' => $month,
|
||||||
'%DAY%'=>$day,
|
'%DAY%' => $day,
|
||||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
'%DOL_MAIN_URL_ROOT%' => DOL_MAIN_URL_ROOT,
|
||||||
'%SERVER%'=>"http://".$_SERVER["SERVER_NAME"]."/"
|
'%SERVER%' => "http://".$_SERVER["SERVER_NAME"]."/",
|
||||||
);
|
);
|
||||||
complete_substitutions_array($substitutionarray, $langs);
|
complete_substitutions_array($substitutionarray, $langs);
|
||||||
|
|
||||||
@ -416,7 +416,7 @@ print $langs->trans("BarcodeType").' ';
|
|||||||
print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
|
print '</div><div class="tagtd" style="overflow: hidden; white-space: nowrap; max-width: 300px;">';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formbarcode.class.php';
|
||||||
$formbarcode = new FormBarCode($db);
|
$formbarcode = new FormBarCode($db);
|
||||||
$formbarcode->select_barcode_type($fk_barcode_type, 'fk_barcode_type', 1);
|
print $formbarcode->selectBarcodeType($fk_barcode_type, 'fk_barcode_type', 1);
|
||||||
print '</div></div>';
|
print '</div></div>';
|
||||||
|
|
||||||
// Barcode value
|
// Barcode value
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
|
/* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
|
||||||
* Copyright (C) 2017-2018 Laurent Destailleur <eldy@destailleur.fr>
|
* Copyright (C) 2017-2018 Laurent Destailleur <eldy@destailleur.fr>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -372,10 +373,10 @@ print '<td class="liste_titre"> </td>';
|
|||||||
|
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
//print $langs->trans("from").': ';
|
//print $langs->trans("from").': ';
|
||||||
$form->select_date($search_start,'search_start');
|
print $form->selectDate($search_start,'search_start');
|
||||||
//print '<br>';
|
//print '<br>';
|
||||||
//print $langs->trans("to").': ';
|
//print $langs->trans("to").': ';
|
||||||
$form->select_date($search_end,'search_end');
|
print $form->selectDate($search_end,'search_end');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// User
|
// User
|
||||||
|
|||||||
@ -39,6 +39,7 @@ class BlockedLog
|
|||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entity
|
* Entity
|
||||||
* @var int
|
* @var int
|
||||||
@ -46,7 +47,7 @@ class BlockedLog
|
|||||||
public $entity;
|
public $entity;
|
||||||
|
|
||||||
public $error = '';
|
public $error = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string[] Error codes (or messages)
|
* @var string[] Error codes (or messages)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -29,17 +29,21 @@
|
|||||||
class Bookmark extends CommonObject
|
class Bookmark extends CommonObject
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
public $element='bookmark';
|
public $element='bookmark';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element='bookmark';
|
public $table_element='bookmark';
|
||||||
|
|
||||||
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
public $picto = 'bookmark';
|
|
||||||
|
/**
|
||||||
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
|
*/
|
||||||
|
public $picto = 'bookmark';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
@ -50,14 +54,18 @@ class Bookmark extends CommonObject
|
|||||||
* @var int ID
|
* @var int ID
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
var $fk_user;
|
/**
|
||||||
var $datec;
|
* @var int User ID
|
||||||
var $url;
|
*/
|
||||||
var $target; // 0=replace, 1=new window
|
public $fk_user;
|
||||||
var $title;
|
|
||||||
var $position;
|
public $datec;
|
||||||
var $favicon;
|
public $url;
|
||||||
|
public $target; // 0=replace, 1=new window
|
||||||
|
public $title;
|
||||||
|
public $position;
|
||||||
|
public $favicon;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -36,9 +36,8 @@ if ( $_SESSION['uid'] <= 0 )
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$langs->load("companies");
|
// Load translation files required by the page
|
||||||
$langs->load("compta");
|
$langs->loadLangs(array("companies","compta","cashdesk"));
|
||||||
$langs->load("cashdesk");
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -37,7 +37,12 @@ class Facturation
|
|||||||
* int $prix => Prix HT du produit en cours
|
* int $prix => Prix HT du produit en cours
|
||||||
* int $tva => 'rowid' du taux de tva dans llx_c_tva
|
* int $tva => 'rowid' du taux de tva dans llx_c_tva
|
||||||
*/
|
*/
|
||||||
public $id;
|
|
||||||
|
/**
|
||||||
|
* @var int ID
|
||||||
|
*/
|
||||||
|
public $id;
|
||||||
|
|
||||||
protected $ref;
|
protected $ref;
|
||||||
protected $qte;
|
protected $qte;
|
||||||
protected $stock;
|
protected $stock;
|
||||||
|
|||||||
@ -28,8 +28,8 @@
|
|||||||
require_once '../main.inc.php';
|
require_once '../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("cashdesk");
|
$langs->loadLangs(array("admin","cashdesk"));
|
||||||
|
|
||||||
// Test if user logged
|
// Test if user logged
|
||||||
if ( $_SESSION['uid'] > 0 )
|
if ( $_SESSION['uid'] > 0 )
|
||||||
@ -63,7 +63,7 @@ top_htmlhead('','',0,0,'',$arrayofcss);
|
|||||||
<?php
|
<?php
|
||||||
if (! empty($mysoc->logo_small))
|
if (! empty($mysoc->logo_small))
|
||||||
{
|
{
|
||||||
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">';
|
print '<img class="logopos" alt="Logo company" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -30,9 +30,8 @@ include '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
|
require_once DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/cashdesk/class/Auth.class.php';
|
||||||
|
|
||||||
$langs->load("main");
|
// Load translation files required by the page
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("main","admin","cashdesk"));
|
||||||
$langs->load("cashdesk");
|
|
||||||
|
|
||||||
$username = GETPOST("txtUsername");
|
$username = GETPOST("txtUsername");
|
||||||
$password = GETPOST("pwdPassword");
|
$password = GETPOST("pwdPassword");
|
||||||
@ -119,7 +118,7 @@ if ( $retour >= 0 )
|
|||||||
$_SESSION['firstname'] = $tab['firstname'];
|
$_SESSION['firstname'] = $tab['firstname'];
|
||||||
$_SESSION['CASHDESK_ID_THIRDPARTY'] = ($thirdpartyid > 0 ? $thirdpartyid : '');
|
$_SESSION['CASHDESK_ID_THIRDPARTY'] = ($thirdpartyid > 0 ? $thirdpartyid : '');
|
||||||
$_SESSION['CASHDESK_ID_WAREHOUSE'] = ($warehouseid > 0 ? $warehouseid : '');
|
$_SESSION['CASHDESK_ID_WAREHOUSE'] = ($warehouseid > 0 ? $warehouseid : '');
|
||||||
|
|
||||||
$_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : '');
|
$_SESSION['CASHDESK_ID_BANKACCOUNT_CASH'] = ($bankid_cash > 0 ? $bankid_cash : '');
|
||||||
$_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] = ($bankid_cheque > 0 ? $bankid_cheque : '');
|
$_SESSION['CASHDESK_ID_BANKACCOUNT_CHEQUE'] = ($bankid_cheque > 0 ? $bankid_cheque : '');
|
||||||
$_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] = ($bankid_cb > 0 ? $bankid_cb : '');
|
$_SESSION['CASHDESK_ID_BANKACCOUNT_CB'] = ($bankid_cb > 0 ? $bankid_cb : '');
|
||||||
@ -135,8 +134,8 @@ if ( $retour >= 0 )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$langs->load("errors");
|
// Load translation files required by the page
|
||||||
$langs->load("other");
|
$langs->loadLangs(array("other","errors"));
|
||||||
$retour=$langs->trans("ErrorBadLoginPassword");
|
$retour=$langs->trans("ErrorBadLoginPassword");
|
||||||
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
|
header('Location: '.DOL_URL_ROOT.'/cashdesk/index.php?err='.urlencode($retour).'&user='.$username.'&socid='.$thirdpartyid.'&warehouseid='.$warehouseid);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2015 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2015 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -26,10 +27,8 @@ if (empty($langs) || ! is_object($langs))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
$langs->load("main");
|
$langs->loadLangs(array("main","bills","cashdesk"));
|
||||||
$langs->load("bills");
|
|
||||||
$langs->load("cashdesk");
|
|
||||||
|
|
||||||
// Object $form must de defined
|
// Object $form must de defined
|
||||||
|
|
||||||
@ -204,7 +203,7 @@ $langs->load("cashdesk");
|
|||||||
<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("Reported"); ?>" onclick="javascript: verifClic('DIF');" />
|
<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("Reported"); ?>" onclick="javascript: verifClic('DIF');" />
|
||||||
<?php
|
<?php
|
||||||
print $langs->trans("DateDue").' :';
|
print $langs->trans("DateDue").' :';
|
||||||
print $form->select_date(-1,'txtDatePaiement',0,0,0,'paymentmode',1,0,1);
|
print $form->selectDate(-1,'txtDatePaiement',0,0,0,'paymentmode',1,0);
|
||||||
print '</div>';
|
print '</div>';
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -28,9 +28,8 @@ if (empty($langs) || ! is_object($langs))
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||||
|
|
||||||
$langs->load("main");
|
// Load translation files required by the page
|
||||||
$langs->load("bills");
|
$langs->loadLangs(array("main","bills","cashdesk"));
|
||||||
$langs->load("cashdesk");
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -63,9 +63,8 @@ if (!empty($_SESSION["CASHDESK_ID_WAREHOUSE"]) && ! empty($conf->stock->enabled)
|
|||||||
$warehouseLink = $warehouse->getNomUrl(1);
|
$warehouseLink = $warehouse->getNomUrl(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
$langs->load("cashdesk");
|
$langs->loadLangs(array("main","cashdesk"));
|
||||||
$langs->load("main");
|
|
||||||
|
|
||||||
print "\n".'<!-- menu.tpl.php -->'."\n";
|
print "\n".'<!-- menu.tpl.php -->'."\n";
|
||||||
print '<div class="menu_bloc">';
|
print '<div class="menu_bloc">';
|
||||||
|
|||||||
@ -27,8 +27,8 @@ if (empty($langs) || ! is_object($langs))
|
|||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||||
|
|
||||||
$langs->load("main");
|
// Load translation files required by the page
|
||||||
$langs->load('cashdesk');
|
$langs->loadLangs(array("main","cashdesk"));
|
||||||
|
|
||||||
top_httphead('text/html');
|
top_httphead('text/html');
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ $object->fetch($facid);
|
|||||||
|
|
||||||
<div class="entete">
|
<div class="entete">
|
||||||
<div class="logo">
|
<div class="logo">
|
||||||
<?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('/thumbs/'.$mysoc->logo_small).'">'; ?>
|
<?php print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">'; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="infos">
|
<div class="infos">
|
||||||
<p class="address"><?php echo $mysoc->name; ?><br>
|
<p class="address"><?php echo $mysoc->name; ?><br>
|
||||||
|
|||||||
@ -23,10 +23,8 @@ if (empty($langs) || ! is_object($langs))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
$langs->load("main");
|
$langs->loadLangs(array("main","bills","banks"));
|
||||||
$langs->load("bills");
|
|
||||||
$langs->load("banks");
|
|
||||||
|
|
||||||
// Object $form must de defined
|
// Object $form must de defined
|
||||||
|
|
||||||
|
|||||||
@ -24,9 +24,8 @@ if (empty($langs) || ! is_object($langs))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load translation files required by the page
|
||||||
$langs->load("main");
|
$langs->loadLangs(array("main","bills"));
|
||||||
$langs->load("bills");
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -51,8 +51,11 @@ class Categorie extends CommonObject
|
|||||||
const TYPE_USER = 'user';
|
const TYPE_USER = 'user';
|
||||||
const TYPE_PROJECT = 'project';
|
const TYPE_PROJECT = 'project';
|
||||||
const TYPE_ACCOUNT = 'bank_account';
|
const TYPE_ACCOUNT = 'bank_account';
|
||||||
const TYPE_BANK_LINE = 'bank_line';
|
const TYPE_BANK_LINE = 'bank_line';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
|
*/
|
||||||
public $picto = 'category';
|
public $picto = 'category';
|
||||||
|
|
||||||
|
|
||||||
@ -161,11 +164,15 @@ class Categorie extends CommonObject
|
|||||||
public $fk_parent;
|
public $fk_parent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string proper name for given parameter
|
* @var string Category label
|
||||||
*/
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var string description
|
||||||
|
*/
|
||||||
public $description;
|
public $description;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Color
|
* @var string Color
|
||||||
*/
|
*/
|
||||||
@ -510,112 +517,27 @@ class Categorie extends CommonObject
|
|||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_societe";
|
|
||||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
|
||||||
if (!$this->db->query($sql))
|
|
||||||
{
|
|
||||||
$this->error=$this->db->lasterror();
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_fournisseur";
|
|
||||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
|
||||||
if (!$this->db->query($sql))
|
|
||||||
{
|
|
||||||
$this->error=$this->db->lasterror();
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_product";
|
|
||||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
|
||||||
if (!$this->db->query($sql))
|
|
||||||
{
|
|
||||||
$this->error=$this->db->lasterror();
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_member";
|
|
||||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
|
||||||
if (!$this->db->query($sql))
|
|
||||||
{
|
|
||||||
$this->error=$this->db->lasterror();
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact";
|
|
||||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
|
||||||
if (!$this->db->query($sql))
|
|
||||||
{
|
|
||||||
$this->error=$this->db->lasterror();
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact";
|
|
||||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
|
||||||
if (!$this->db->query($sql))
|
|
||||||
{
|
|
||||||
$this->error=$this->db->lasterror();
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
|
|
||||||
$sql .= " WHERE fk_categorie = ".$this->id;
|
|
||||||
if (!$this->db->query($sql))
|
|
||||||
{
|
|
||||||
$this->error=$this->db->lasterror();
|
|
||||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (! $error)
|
|
||||||
{
|
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class";
|
|
||||||
$sql .= " WHERE fk_categ = ".$this->id;
|
|
||||||
if (!$this->db->query($sql))
|
|
||||||
{
|
|
||||||
$this->error=$this->db->lasterror();
|
|
||||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! $error)
|
$arraydelete = array(
|
||||||
{
|
'categorie_societe' => 'fk_categorie',
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang";
|
'categorie_fournisseur' => 'fk_categorie',
|
||||||
$sql .= " WHERE fk_category = ".$this->id;
|
'categorie_product' => 'fk_categorie',
|
||||||
if (!$this->db->query($sql))
|
'categorie_member' => 'fk_categorie',
|
||||||
{
|
'categorie_contact' => 'fk_categorie',
|
||||||
$this->error=$this->db->lasterror();
|
'categorie_account' => 'fk_categorie',
|
||||||
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
'bank_class' => 'fk_categ',
|
||||||
$error++;
|
'categorie_lang' => 'fk_category',
|
||||||
}
|
'categorie' => 'rowid',
|
||||||
}
|
);
|
||||||
|
foreach ($arraydelete as $key => $value) {
|
||||||
// Delete category
|
$sql = "DELETE FROM " . MAIN_DB_PREFIX . $key;
|
||||||
if (! $error)
|
$sql .= " WHERE ".$value." = ".$this->id;
|
||||||
{
|
if (!$this->db->query($sql)) {
|
||||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie";
|
$this->errors[] = $this->db->lasterror();
|
||||||
$sql .= " WHERE rowid = ".$this->id;
|
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
|
||||||
if (!$this->db->query($sql))
|
$error++;
|
||||||
{
|
}
|
||||||
$this->error=$this->db->lasterror();
|
}
|
||||||
$error++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Removed extrafields
|
// Removed extrafields
|
||||||
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
|
||||||
@ -640,6 +562,7 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Link an object to the category
|
* Link an object to the category
|
||||||
*
|
*
|
||||||
@ -647,9 +570,9 @@ class Categorie extends CommonObject
|
|||||||
* @param string $type Type of category ('product', ...)
|
* @param string $type Type of category ('product', ...)
|
||||||
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
|
* @return int 1 : OK, -1 : erreur SQL, -2 : id not defined, -3 : Already linked
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function add_type($obj, $type)
|
function add_type($obj, $type)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
@ -742,6 +665,7 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Delete object from category
|
* Delete object from category
|
||||||
*
|
*
|
||||||
@ -750,9 +674,9 @@ class Categorie extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return int 1 if OK, -1 if KO
|
* @return int 1 if OK, -1 if KO
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function del_type($obj,$type)
|
function del_type($obj,$type)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $user,$langs,$conf;
|
global $user,$langs,$conf;
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
@ -966,14 +890,15 @@ class Categorie extends CommonObject
|
|||||||
return $categories;
|
return $categories;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return childs of a category
|
* Return childs of a category
|
||||||
*
|
*
|
||||||
* @return array|int <0 KO, array ok
|
* @return array|int <0 KO, array ok
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_filles()
|
function get_filles()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
||||||
$sql.= " WHERE fk_parent = ".$this->id;
|
$sql.= " WHERE fk_parent = ".$this->id;
|
||||||
|
|
||||||
@ -996,14 +921,15 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load this->motherof that is array(id_son=>id_parent, ...)
|
* Load this->motherof that is array(id_son=>id_parent, ...)
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
private function load_motherof()
|
private function load_motherof()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$this->motherof=array();
|
$this->motherof=array();
|
||||||
@ -1031,6 +957,7 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Rebuilding the category tree as an array
|
* Rebuilding the category tree as an array
|
||||||
* Return an array of table('id','id_mere',...) trie selon arbre et avec:
|
* Return an array of table('id','id_mere',...) trie selon arbre et avec:
|
||||||
@ -1046,9 +973,9 @@ class Categorie extends CommonObject
|
|||||||
*
|
*
|
||||||
* @return array Array of categories. this->cats and this->motherof are set.
|
* @return array Array of categories. this->cats and this->motherof are set.
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_full_arbo($type, $markafterid=0)
|
function get_full_arbo($type, $markafterid=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf, $langs;
|
global $conf, $langs;
|
||||||
|
|
||||||
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
|
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
|
||||||
@ -1123,6 +1050,7 @@ class Categorie extends CommonObject
|
|||||||
return $this->cats;
|
return $this->cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* For category id_categ and its childs available in this->cats, define property fullpath and fulllabel
|
* For category id_categ and its childs available in this->cats, define property fullpath and fulllabel
|
||||||
*
|
*
|
||||||
@ -1130,9 +1058,9 @@ class Categorie extends CommonObject
|
|||||||
* @param int $protection Deep counter to avoid infinite loop
|
* @param int $protection Deep counter to avoid infinite loop
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function build_path_from_id_categ($id_categ,$protection=1000)
|
function build_path_from_id_categ($id_categ,$protection=1000)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
|
dol_syslog(get_class($this)."::build_path_from_id_categ id_categ=".$id_categ." protection=".$protection, LOG_DEBUG);
|
||||||
|
|
||||||
if (! empty($this->cats[$id_categ]['fullpath']))
|
if (! empty($this->cats[$id_categ]['fullpath']))
|
||||||
@ -1166,14 +1094,15 @@ class Categorie extends CommonObject
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Display content of $this->cats
|
* Display content of $this->cats
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function debug_cats()
|
function debug_cats()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
// Display $this->cats
|
// Display $this->cats
|
||||||
foreach($this->cats as $key => $val)
|
foreach($this->cats as $key => $val)
|
||||||
{
|
{
|
||||||
@ -1188,6 +1117,7 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns all categories
|
* Returns all categories
|
||||||
*
|
*
|
||||||
@ -1195,9 +1125,9 @@ class Categorie extends CommonObject
|
|||||||
* @param boolean $parent Just parent categories if true
|
* @param boolean $parent Just parent categories if true
|
||||||
* @return array Table of Object Category
|
* @return array Table of Object Category
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_all_categories($type=null, $parent=false)
|
function get_all_categories($type=null, $parent=false)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
|
if (! is_numeric($type)) $type = $this->MAP_ID[$type];
|
||||||
|
|
||||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."categorie";
|
||||||
@ -1226,14 +1156,15 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Check if no category with same label already exists for this cat's parent or root and for this cat's type
|
* Check if no category with same label already exists for this cat's parent or root and for this cat's type
|
||||||
*
|
*
|
||||||
* @return integer 1 if already exist, 0 otherwise, -1 if error
|
* @return integer 1 if already exist, 0 otherwise, -1 if error
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function already_exists()
|
function already_exists()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$type=$this->type;
|
$type=$this->type;
|
||||||
|
|
||||||
if (! is_numeric($type)) $type=$this->MAP_ID[$type];
|
if (! is_numeric($type)) $type=$this->MAP_ID[$type];
|
||||||
@ -1276,18 +1207,20 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns the top level categories (which are not girls)
|
* Returns the top level categories (which are not girls)
|
||||||
*
|
*
|
||||||
* @param int $type Type of category (0, 1, ...)
|
* @param int $type Type of category (0, 1, ...)
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_main_categories($type=null)
|
function get_main_categories($type=null)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
return $this->get_all_categories($type, true);
|
return $this->get_all_categories($type, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns the path of the category, with the names of the categories
|
* Returns the path of the category, with the names of the categories
|
||||||
* separated by $sep (" >> " by default)
|
* separated by $sep (" >> " by default)
|
||||||
@ -1297,9 +1230,9 @@ class Categorie extends CommonObject
|
|||||||
* @param int $nocolor 0
|
* @param int $nocolor 0
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function print_all_ways($sep = " >> ", $url='', $nocolor=0)
|
function print_all_ways($sep = " >> ", $url='', $nocolor=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$ways = array();
|
$ways = array();
|
||||||
|
|
||||||
$allways = $this->get_all_ways(); // Load array of categories
|
$allways = $this->get_all_ways(); // Load array of categories
|
||||||
@ -1346,14 +1279,15 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns an array containing the list of parent categories
|
* Returns an array containing the list of parent categories
|
||||||
*
|
*
|
||||||
* @return int|array <0 KO, array OK
|
* @return int|array <0 KO, array OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_meres()
|
function get_meres()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$parents = array();
|
$parents = array();
|
||||||
|
|
||||||
$sql = "SELECT fk_parent FROM ".MAIN_DB_PREFIX."categorie";
|
$sql = "SELECT fk_parent FROM ".MAIN_DB_PREFIX."categorie";
|
||||||
@ -1381,15 +1315,16 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Returns in a table all possible paths to get to the category
|
* Returns in a table all possible paths to get to the category
|
||||||
* starting with the major categories represented by Tables of categories
|
* starting with the major categories represented by Tables of categories
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_all_ways()
|
function get_all_ways()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$ways = array();
|
$ways = array();
|
||||||
|
|
||||||
$parents=$this->get_meres();
|
$parents=$this->get_meres();
|
||||||
@ -1596,6 +1531,7 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Deplace fichier uploade sous le nom $files dans le repertoire sdir
|
* Deplace fichier uploade sous le nom $files dans le repertoire sdir
|
||||||
*
|
*
|
||||||
@ -1603,9 +1539,9 @@ class Categorie extends CommonObject
|
|||||||
* @param string $file Nom du fichier uploade
|
* @param string $file Nom du fichier uploade
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function add_photo($sdir, $file)
|
function add_photo($sdir, $file)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$dir = $sdir .'/'. get_exdir($this->id,2,0,0,$this,'category') . $this->id ."/";
|
$dir = $sdir .'/'. get_exdir($this->id,2,0,0,$this,'category') . $this->id ."/";
|
||||||
@ -1646,6 +1582,7 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return tableau de toutes les photos de la categorie
|
* Return tableau de toutes les photos de la categorie
|
||||||
*
|
*
|
||||||
@ -1653,9 +1590,9 @@ class Categorie extends CommonObject
|
|||||||
* @param int $nbmax Nombre maximum de photos (0=pas de max)
|
* @param int $nbmax Nombre maximum de photos (0=pas de max)
|
||||||
* @return array Tableau de photos
|
* @return array Tableau de photos
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function liste_photos($dir,$nbmax=0)
|
function liste_photos($dir,$nbmax=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
include_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$nbphoto=0;
|
$nbphoto=0;
|
||||||
@ -1702,15 +1639,16 @@ class Categorie extends CommonObject
|
|||||||
return $tabobj;
|
return $tabobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Efface la photo de la categorie et sa vignette
|
* Efface la photo de la categorie et sa vignette
|
||||||
*
|
*
|
||||||
* @param string $file Path to file
|
* @param string $file Path to file
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function delete_photo($file)
|
function delete_photo($file)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
|
$dir = dirname($file).'/'; // Chemin du dossier contenant l'image d'origine
|
||||||
@ -1731,15 +1669,16 @@ class Categorie extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load size of image file
|
* Load size of image file
|
||||||
*
|
*
|
||||||
* @param string $file Path to file
|
* @param string $file Path to file
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function get_image_size($file)
|
function get_image_size($file)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$infoImg = getimagesize($file); // Recuperation des infos de l'image
|
$infoImg = getimagesize($file); // Recuperation des infos de l'image
|
||||||
$this->imgWidth = $infoImg[0]; // Largeur de l'image
|
$this->imgWidth = $infoImg[0]; // Largeur de l'image
|
||||||
$this->imgHeight = $infoImg[1]; // Hauteur de l'image
|
$this->imgHeight = $infoImg[1]; // Hauteur de l'image
|
||||||
|
|||||||
@ -28,9 +28,8 @@ require '../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
// Load translation files required by the page
|
||||||
$langs->load("other");
|
$langs->loadLangs(array("admin","other","website"));
|
||||||
$langs->load("website");
|
|
||||||
|
|
||||||
if (! $user->admin) accessforbidden();
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,8 @@
|
|||||||
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
|
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -689,9 +690,13 @@ if ($action == 'create')
|
|||||||
$datep=($datep?$datep:$object->datep);
|
$datep=($datep?$datep:$object->datep);
|
||||||
if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0);
|
if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0);
|
||||||
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>';
|
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>';
|
||||||
if (GETPOST("afaire") == 1) $form->select_date($datep,'ap',1,1,0,"action",1,1,0,0,'fulldayend');
|
if (GETPOST("afaire") == 1) {
|
||||||
else if (GETPOST("afaire") == 2) $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldayend');
|
print $form->selectDate($datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldayend');
|
||||||
else $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
|
} elseif (GETPOST("afaire") == 2) {
|
||||||
|
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||||
|
} else {
|
||||||
|
print $form->selectDate($datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart');
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Date end
|
// Date end
|
||||||
@ -702,12 +707,17 @@ if ($action == 'create')
|
|||||||
$datef=dol_time_plus_duree($datep, $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS, 'h');
|
$datef=dol_time_plus_duree($datep, $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS, 'h');
|
||||||
}
|
}
|
||||||
print '<tr><td><span id="dateend"'.(GETPOST("actioncode") == 'AC_RDV'?' class="fieldrequired"':'').'>'.$langs->trans("DateActionEnd").'</span></td><td>';
|
print '<tr><td><span id="dateend"'.(GETPOST("actioncode") == 'AC_RDV'?' class="fieldrequired"':'').'>'.$langs->trans("DateActionEnd").'</span></td><td>';
|
||||||
if (GETPOST("afaire") == 1) $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
if (GETPOST("afaire") == 1) {
|
||||||
else if (GETPOST("afaire") == 2) $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||||
else $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
} elseif (GETPOST("afaire") == 2) {
|
||||||
|
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||||
|
} else {
|
||||||
|
print $form->selectDate($datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$userepeatevent=($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); // Dev in progress
|
// Dev in progress
|
||||||
|
$userepeatevent=($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0);
|
||||||
if ($userepeatevent)
|
if ($userepeatevent)
|
||||||
{
|
{
|
||||||
// Repeat
|
// Repeat
|
||||||
@ -1057,30 +1067,38 @@ if ($id > 0)
|
|||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td colspan="3">';
|
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td colspan="3">';
|
||||||
if (GETPOST("afaire") == 1) $form->select_date($datep?$datep:$object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
|
if (GETPOST("afaire") == 1) {
|
||||||
else if (GETPOST("afaire") == 2) $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
|
print $form->selectDate($datep?$datep:$object->datep, 'ap', 1, 1, 0, "action", 1, 1, 0, 'fulldaystart');
|
||||||
else $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
|
} elseif (GETPOST("afaire") == 2) {
|
||||||
|
print $form->selectDate($datep?$datep:$object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart');
|
||||||
|
} else {
|
||||||
|
print $form->selectDate($datep?$datep:$object->datep, 'ap', 1, 1, 1, "action", 1, 1, 0, 'fulldaystart');
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// Date end
|
// Date end
|
||||||
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
|
||||||
if (GETPOST("afaire") == 1) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
if (GETPOST("afaire") == 1) {
|
||||||
else if (GETPOST("afaire") == 2) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
print $form->selectDate($datef?$datef:$object->datef, 'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||||
//else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend','ap');
|
} elseif (GETPOST("afaire") == 2) {
|
||||||
else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
|
print $form->selectDate($datef?$datef:$object->datef,'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||||
|
} else {
|
||||||
|
print $form->selectDate($datef?$datef:$object->datef,'p2', 1, 1, 1, "action", 1, 1, 0, 'fulldayend');
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
$userepeatevent=($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0); // Dev in progress
|
// Dev in progress
|
||||||
|
$userepeatevent=($conf->global->MAIN_FEATURES_LEVEL == 2 ? 1 : 0);
|
||||||
if ($userepeatevent)
|
if ($userepeatevent)
|
||||||
{
|
{
|
||||||
// Repeat
|
// Repeat
|
||||||
print '<tr><td>'.$langs->trans("RepeatEvent").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("RepeatEvent").'</td><td colspan="3">';
|
||||||
print '<input type="hidden" name="recurid" value="'.$object->recurid.'">';
|
print '<input type="hidden" name="recurid" value="'.$object->recurid.'">';
|
||||||
$arrayrecurrulefreq=array(
|
$arrayrecurrulefreq = array(
|
||||||
'no'=>$langs->trans("No"),
|
'no'=>$langs->trans("No"),
|
||||||
'MONTHLY'=>$langs->trans("EveryMonth"),
|
'MONTHLY'=>$langs->trans("EveryMonth"),
|
||||||
'WEEKLY'=>$langs->trans("EveryWeek"),
|
'WEEKLY'=>$langs->trans("EveryWeek"),
|
||||||
//'DAYLY'=>$langs->trans("EveryDay")
|
//'DAYLY'=>$langs->trans("EveryDay"),
|
||||||
);
|
);
|
||||||
$selectedrecurrulefreq='no';
|
$selectedrecurrulefreq='no';
|
||||||
$selectedrecurrulebymonthday='';
|
$selectedrecurrulebymonthday='';
|
||||||
$selectedrecurrulebyday='';
|
$selectedrecurrulebyday='';
|
||||||
|
|||||||
@ -35,24 +35,28 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
|||||||
class ActionComm extends CommonObject
|
class ActionComm extends CommonObject
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
public $element='action';
|
public $element='action';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element = 'actioncomm';
|
public $table_element = 'actioncomm';
|
||||||
|
|
||||||
public $table_rowid = 'id';
|
public $table_rowid = 'id';
|
||||||
public $picto='action';
|
|
||||||
|
/**
|
||||||
|
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
|
||||||
|
*/
|
||||||
|
public $picto = 'action';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $ismultientitymanaged = 1;
|
public $ismultientitymanaged = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty
|
* 0=Default, 1=View may be restricted to sales representative only if no permission to see all or to company of external user if external user, 2=Same than 1 but accept record if fksoc is empty
|
||||||
* @var integer
|
* @var integer
|
||||||
@ -63,7 +67,7 @@ class ActionComm extends CommonObject
|
|||||||
* Id of the event
|
* Id of the event
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Id of the event. Use $id as possible
|
* Id of the event. Use $id as possible
|
||||||
@ -78,7 +82,7 @@ class ActionComm extends CommonObject
|
|||||||
var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
|
var $code; // Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string proper name for given parameter
|
* @var string Agenda event label
|
||||||
*/
|
*/
|
||||||
public $label;
|
public $label;
|
||||||
|
|
||||||
@ -694,14 +698,15 @@ class ActionComm extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Initialize this->userassigned array with list of id of user assigned to event
|
* Initialize this->userassigned array with list of id of user assigned to event
|
||||||
*
|
*
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function fetch_userassigned()
|
function fetch_userassigned()
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
$sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
|
$sql ="SELECT fk_actioncomm, element_type, fk_element, answer_status, mandatory, transparency";
|
||||||
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
|
$sql.=" FROM ".MAIN_DB_PREFIX."actioncomm_resources";
|
||||||
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
|
$sql.=" WHERE element_type = 'user' AND fk_actioncomm = ".$this->id;
|
||||||
@ -1017,6 +1022,7 @@ class ActionComm extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
* Load indicators for dashboard (this->nbtodo and this->nbtodolate)
|
||||||
*
|
*
|
||||||
@ -1024,10 +1030,10 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord
|
* @param int $load_state_board Charge indicateurs this->nb de tableau de bord
|
||||||
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
* @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function load_board($user, $load_state_board=0)
|
function load_board($user, $load_state_board=0)
|
||||||
{
|
{
|
||||||
global $conf, $langs;
|
// phpcs:enable
|
||||||
|
global $conf, $langs;
|
||||||
|
|
||||||
if(empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp";
|
if(empty($load_state_board)) $sql = "SELECT a.id, a.datep as dp";
|
||||||
else {
|
else {
|
||||||
@ -1142,6 +1148,7 @@ class ActionComm extends CommonObject
|
|||||||
return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep);
|
return $this->LibStatut($this->percentage,$mode,$hidenastatus,$this->datep);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return label of action status
|
* Return label of action status
|
||||||
*
|
*
|
||||||
@ -1151,9 +1158,9 @@ class ActionComm extends CommonObject
|
|||||||
* @param int $datestart Date start of event
|
* @param int $datestart Date start of event
|
||||||
* @return string Label
|
* @return string Label
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function LibStatut($percent,$mode,$hidenastatus=0,$datestart='')
|
function LibStatut($percent,$mode,$hidenastatus=0,$datestart='')
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if ($mode == 0)
|
if ($mode == 0)
|
||||||
@ -1351,6 +1358,7 @@ class ActionComm extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Export events from database into a cal file.
|
* Export events from database into a cal file.
|
||||||
*
|
*
|
||||||
@ -1361,9 +1369,9 @@ class ActionComm extends CommonObject
|
|||||||
* @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...)
|
* @param array $filters Array of filters. Exemple array('notolderthan'=>99, 'year'=>..., 'idfrom'=>..., 'notactiontype'=>'systemauto', 'project'=>123, ...)
|
||||||
* @return int <0 if error, nb of events in new file if ok
|
* @return int <0 if error, nb of events in new file if ok
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
function build_exportfile($format,$type,$cachedelay,$filename,$filters)
|
function build_exportfile($format,$type,$cachedelay,$filename,$filters)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $conf,$langs,$dolibarr_main_url_root,$mysoc;
|
global $conf,$langs,$dolibarr_main_url_root,$mysoc;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php";
|
require_once DOL_DOCUMENT_ROOT ."/core/lib/xcal.lib.php";
|
||||||
|
|||||||
@ -34,17 +34,17 @@ class ActionCommReminder extends CommonObject
|
|||||||
* @var string ID to identify managed object
|
* @var string ID to identify managed object
|
||||||
*/
|
*/
|
||||||
public $element = 'actioncomm_reminder';
|
public $element = 'actioncomm_reminder';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Name of table without prefix where object is stored
|
* @var string Name of table without prefix where object is stored
|
||||||
*/
|
*/
|
||||||
public $table_element = 'actioncomm_reminder';
|
public $table_element = 'actioncomm_reminder';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array Does actioncommreminder support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
* @var array Does actioncommreminder support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||||
*/
|
*/
|
||||||
public $ismultientitymanaged = 0;
|
public $ismultientitymanaged = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string String with name of icon for actioncommreminder. Must be the part after the 'object_' into object_actioncommreminder.png
|
* @var string String with name of icon for actioncommreminder. Must be the part after the 'object_' into object_actioncommreminder.png
|
||||||
*/
|
*/
|
||||||
@ -84,7 +84,12 @@ class ActionCommReminder extends CommonObject
|
|||||||
public $rowid;
|
public $rowid;
|
||||||
public $dateremind;
|
public $dateremind;
|
||||||
public $typeremind;
|
public $typeremind;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var int User ID
|
||||||
|
*/
|
||||||
public $fk_user;
|
public $fk_user;
|
||||||
|
|
||||||
public $offsetvalue;
|
public $offsetvalue;
|
||||||
public $offsetunit;
|
public $offsetunit;
|
||||||
public $status;
|
public $status;
|
||||||
@ -168,6 +173,7 @@ class ActionCommReminder extends CommonObject
|
|||||||
return $this->LibStatut($this->status,$mode);
|
return $this->LibStatut($this->status,$mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return the status
|
* Return the status
|
||||||
*
|
*
|
||||||
@ -175,9 +181,9 @@ class ActionCommReminder extends CommonObject
|
|||||||
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
* @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto, 6=Long label + Picto
|
||||||
* @return string Label of status
|
* @return string Label of status
|
||||||
*/
|
*/
|
||||||
// phpcs:ignore PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
|
|
||||||
static function LibStatut($status,$mode=0)
|
static function LibStatut($status,$mode=0)
|
||||||
{
|
{
|
||||||
|
// phpcs:enable
|
||||||
global $langs;
|
global $langs;
|
||||||
|
|
||||||
if ($mode == 0 || $mode == 1)
|
if ($mode == 0 || $mode == 1)
|
||||||
|
|||||||
@ -219,7 +219,7 @@ class AgendaEvents extends DolibarrApi
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update Agenda Event general fields (won't touch lines of expensereport)
|
* Update Agenda Event general fields
|
||||||
*
|
*
|
||||||
* @param int $id Id of Agenda Event to update
|
* @param int $id Id of Agenda Event to update
|
||||||
* @param array $request_data Datas
|
* @param array $request_data Datas
|
||||||
@ -236,20 +236,20 @@ class AgendaEvents extends DolibarrApi
|
|||||||
throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
|
throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->expensereport->fetch($id);
|
$result = $this->actioncomm->fetch($id);
|
||||||
if ( ! $result ) {
|
if ( ! $result ) {
|
||||||
throw new RestException(404, 'expensereport not found');
|
throw new RestException(404, 'actioncomm not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) {
|
if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
foreach($request_data as $field => $value) {
|
foreach($request_data as $field => $value) {
|
||||||
if ($field == 'id') continue;
|
if ($field == 'id') continue;
|
||||||
$this->expensereport->$field = $value;
|
$this->actioncomm->$field = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->expensereport->update($id, DolibarrApiAccess::$user,1,'','','update'))
|
if ($this->actioncomm->update($id, DolibarrApiAccess::$user,1,'','','update'))
|
||||||
return $this->get($id);
|
return $this->get($id);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user