Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
066e04f33d
@ -213,7 +213,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/website
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
%_datadir/dolibarr/htdocs/*.patch
|
||||
%_datadir/dolibarr/htdocs/*.php
|
||||
|
||||
@ -293,7 +293,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/website
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
%_datadir/dolibarr/htdocs/*.patch
|
||||
%_datadir/dolibarr/htdocs/*.php
|
||||
|
||||
@ -210,7 +210,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/website
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
%_datadir/dolibarr/htdocs/*.patch
|
||||
%_datadir/dolibarr/htdocs/*.php
|
||||
|
||||
@ -221,7 +221,7 @@ done >>%{name}.lang
|
||||
%_datadir/dolibarr/htdocs/user
|
||||
%_datadir/dolibarr/htdocs/variants
|
||||
%_datadir/dolibarr/htdocs/webservices
|
||||
%_datadir/dolibarr/htdocs/websites
|
||||
%_datadir/dolibarr/htdocs/website
|
||||
%_datadir/dolibarr/htdocs/*.ico
|
||||
%_datadir/dolibarr/htdocs/*.patch
|
||||
%_datadir/dolibarr/htdocs/*.php
|
||||
|
||||
@ -138,7 +138,6 @@ $form = new Form($db);
|
||||
// $linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'title_setup');
|
||||
|
||||
|
||||
print "\n".'<script type="text/javascript" language="javascript">'."\n";
|
||||
print 'jQuery(document).ready(function () {'."\n";
|
||||
print ' function initfields()'."\n";
|
||||
@ -187,7 +186,6 @@ print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
|
||||
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
|
||||
/*
|
||||
* Main Options
|
||||
*/
|
||||
|
||||
@ -160,6 +160,8 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
||||
$search_date_creation_end = '';
|
||||
$search_date_modification_start = '';
|
||||
$search_date_modification_end = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
}
|
||||
|
||||
// Must be after the remove filter action, before the export.
|
||||
@ -248,6 +250,14 @@ if (! empty($search_date_modification_end)) {
|
||||
$tmp=dol_getdate($search_date_modification_end);
|
||||
$param .= '&date_modification_endmonth=' . $tmp['mon'] . '&date_modification_endday=' . $tmp['mday'] . '&date_modification_endyear=' . $tmp['year'];
|
||||
}
|
||||
if (! empty($search_debit)) {
|
||||
$filter['t.debit'] = $search_debit;
|
||||
$param .= '&search_debit=' . $search_debit;
|
||||
}
|
||||
if (! empty($search_credit)) {
|
||||
$filter['t.credit'] = $search_credit;
|
||||
$param .= '&search_credit=' . $search_credit;
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping') {
|
||||
|
||||
@ -507,12 +517,16 @@ if (! empty($arrayfields['t.label_operation']['checked']))
|
||||
// Debit
|
||||
if (! empty($arrayfields['t.debit']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="text" class="flat" name="search_debit" size="4" value="'.dol_escape_htmltag($search_debit).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Credit
|
||||
if (! empty($arrayfields['t.credit']['checked']))
|
||||
{
|
||||
print '<td class="liste_titre center"> </td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print '<input type="text" class="flat" name="search_credit" size="4" value="'.dol_escape_htmltag($search_credit).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Code journal
|
||||
if (! empty($arrayfields['t.code_journal']['checked']))
|
||||
|
||||
@ -7,8 +7,9 @@
|
||||
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||
* Copyright (C) 2016-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com> MAJ QUADRATUS EXPORT 2015
|
||||
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
|
||||
* Copyright (C) 2017 Frédéric France <frederic.france@netlogic.fr>
|
||||
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -43,7 +44,7 @@ class AccountancyExport
|
||||
/**
|
||||
* @var Type of export. Defined by $conf->global->ACCOUNTING_EXPORT_MODELCSV
|
||||
*/
|
||||
public static $EXPORT_TYPE_NORMAL = 1; // Classic CSV
|
||||
public static $EXPORT_TYPE_NORMAL = 1; // Classic CSV
|
||||
public static $EXPORT_TYPE_CEGID = 2;
|
||||
public static $EXPORT_TYPE_COALA = 3;
|
||||
public static $EXPORT_TYPE_BOB50 = 4;
|
||||
@ -82,7 +83,7 @@ class AccountancyExport
|
||||
|
||||
$this->db = &$db;
|
||||
$this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$this->end_line = empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?"\n":($conf->global->ACCOUNTING_EXPORT_ENDLINE==1?"\n":"\r\n");
|
||||
$this->end_line = empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?"\n":($conf->global->ACCOUNTING_EXPORT_ENDLINE==1?"\n":"\r\n");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -104,70 +105,70 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'),
|
||||
self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'),
|
||||
self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Array with all export type available (key + label) and parameters for config
|
||||
*
|
||||
* @return array of type
|
||||
*/
|
||||
public static function getTypeConfig() {
|
||||
global $conf, $langs;
|
||||
/**
|
||||
* Array with all export type available (key + label) and parameters for config
|
||||
*
|
||||
* @return array of type
|
||||
*/
|
||||
public static function getTypeConfig() {
|
||||
global $conf, $langs;
|
||||
|
||||
return array (
|
||||
'param' => array(
|
||||
self::$EXPORT_TYPE_NORMAL => array(
|
||||
'label' => $langs->trans('Modelcsv_normal'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
|
||||
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
|
||||
),
|
||||
self::$EXPORT_TYPE_CEGID => array(
|
||||
'label' => $langs->trans('Modelcsv_CEGID'),
|
||||
),
|
||||
self::$EXPORT_TYPE_COALA => array(
|
||||
'label' => $langs->trans('Modelcsv_COALA'),
|
||||
),
|
||||
self::$EXPORT_TYPE_BOB50 => array(
|
||||
'label' => $langs->trans('Modelcsv_bob50'),
|
||||
),
|
||||
self::$EXPORT_TYPE_CIEL => array(
|
||||
'label' => $langs->trans('Modelcsv_ciel'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
self::$EXPORT_TYPE_QUADRATUS => array(
|
||||
'label' => $langs->trans('Modelcsv_quadratus'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
self::$EXPORT_TYPE_EBP => array(
|
||||
'label' => $langs->trans('Modelcsv_ebp'),
|
||||
),
|
||||
self::$EXPORT_TYPE_COGILOG => array(
|
||||
'label' => $langs->trans('Modelcsv_cogilog'),
|
||||
),
|
||||
self::$EXPORT_TYPE_AGIRIS => array(
|
||||
'label' => $langs->trans('Modelcsv_agiris'),
|
||||
),
|
||||
self::$EXPORT_TYPE_CONFIGURABLE => array(
|
||||
'label' => $langs->trans('Modelcsv_configurable'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
|
||||
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
|
||||
),
|
||||
),
|
||||
'cr'=> array (
|
||||
'1' => $langs->trans("Unix"),
|
||||
'2' => $langs->trans("Windows")
|
||||
),
|
||||
'format' => array (
|
||||
'csv' => $langs->trans("csv"),
|
||||
'txt' => $langs->trans("txt")
|
||||
),
|
||||
);
|
||||
}
|
||||
return array (
|
||||
'param' => array(
|
||||
self::$EXPORT_TYPE_NORMAL => array(
|
||||
'label' => $langs->trans('Modelcsv_normal'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
|
||||
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
|
||||
),
|
||||
self::$EXPORT_TYPE_CEGID => array(
|
||||
'label' => $langs->trans('Modelcsv_CEGID'),
|
||||
),
|
||||
self::$EXPORT_TYPE_COALA => array(
|
||||
'label' => $langs->trans('Modelcsv_COALA'),
|
||||
),
|
||||
self::$EXPORT_TYPE_BOB50 => array(
|
||||
'label' => $langs->trans('Modelcsv_bob50'),
|
||||
),
|
||||
self::$EXPORT_TYPE_CIEL => array(
|
||||
'label' => $langs->trans('Modelcsv_ciel'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
self::$EXPORT_TYPE_QUADRATUS => array(
|
||||
'label' => $langs->trans('Modelcsv_quadratus'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
self::$EXPORT_TYPE_EBP => array(
|
||||
'label' => $langs->trans('Modelcsv_ebp'),
|
||||
),
|
||||
self::$EXPORT_TYPE_COGILOG => array(
|
||||
'label' => $langs->trans('Modelcsv_cogilog'),
|
||||
),
|
||||
self::$EXPORT_TYPE_AGIRIS => array(
|
||||
'label' => $langs->trans('Modelcsv_agiris'),
|
||||
),
|
||||
self::$EXPORT_TYPE_CONFIGURABLE => array(
|
||||
'label' => $langs->trans('Modelcsv_configurable'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => empty($conf->global->ACCOUNTING_EXPORT_FORMAT)?'txt':$conf->global->ACCOUNTING_EXPORT_FORMAT,
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV' => empty($conf->global->ACCOUNTING_EXPORT_SEPARATORCSV)?',':$conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => empty($conf->global->ACCOUNTING_EXPORT_ENDLINE)?1:$conf->global->ACCOUNTING_EXPORT_ENDLINE,
|
||||
'ACCOUNTING_EXPORT_DATE' => empty($conf->global->ACCOUNTING_EXPORT_DATE)?'%d%m%Y':$conf->global->ACCOUNTING_EXPORT_DATE,
|
||||
),
|
||||
),
|
||||
'cr'=> array (
|
||||
'1' => $langs->trans("Unix"),
|
||||
'2' => $langs->trans("Windows")
|
||||
),
|
||||
'format' => array (
|
||||
'csv' => $langs->trans("csv"),
|
||||
'txt' => $langs->trans("txt")
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download the export
|
||||
@ -218,7 +219,7 @@ class AccountancyExport
|
||||
case self::$EXPORT_TYPE_AGIRIS :
|
||||
$this->exportAgiris($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_CONFIGURABLE :
|
||||
case self::$EXPORT_TYPE_CONFIGURABLE :
|
||||
$this->exportConfigurable($TData);
|
||||
break;
|
||||
default:
|
||||
@ -261,8 +262,8 @@ class AccountancyExport
|
||||
public function exportCegid($objectLines) {
|
||||
foreach ( $objectLines as $line ) {
|
||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
$separator = ";";
|
||||
$end_line = "\n";
|
||||
$separator = ";";
|
||||
$end_line = "\n";
|
||||
|
||||
print $date . $separator;
|
||||
print $line->code_journal . $separator;
|
||||
@ -286,8 +287,8 @@ class AccountancyExport
|
||||
public function exportCogilog($objectLines) {
|
||||
foreach ( $objectLines as $line ) {
|
||||
$date = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
$separator = ";";
|
||||
$end_line = "\n";
|
||||
$separator = ";";
|
||||
$end_line = "\n";
|
||||
|
||||
print $line->code_journal . $separator;
|
||||
print $date . $separator;
|
||||
@ -318,8 +319,8 @@ class AccountancyExport
|
||||
*/
|
||||
public function exportCoala($objectLines) {
|
||||
// Coala export
|
||||
$separator = ";";
|
||||
$end_line = "\n";
|
||||
$separator = ";";
|
||||
$end_line = "\n";
|
||||
|
||||
foreach ( $objectLines as $line ) {
|
||||
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||
@ -346,8 +347,8 @@ class AccountancyExport
|
||||
public function exportBob50($objectLines) {
|
||||
|
||||
// Bob50
|
||||
$separator = ";";
|
||||
$end_line = "\n";
|
||||
$separator = ";";
|
||||
$end_line = "\n";
|
||||
|
||||
foreach ( $objectLines as $line ) {
|
||||
print $line->piece_num . $separator;
|
||||
@ -426,7 +427,7 @@ class AccountancyExport
|
||||
|
||||
$end_line ="\r\n";
|
||||
|
||||
//elarifr we should use dol_now function not time however this is wrong date to transfert in accounting
|
||||
//We should use dol_now function not time however this is wrong date to transfert in accounting
|
||||
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
foreach ( $TData as $data ) {
|
||||
@ -440,7 +441,7 @@ class AccountancyExport
|
||||
$Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2);
|
||||
$Tab['folio'] = '000';
|
||||
|
||||
//elarifr we use invoice date $data->doc_date not $date_ecriture which is the transfert date
|
||||
//We use invoice date $data->doc_date not $date_ecriture which is the transfert date
|
||||
//maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ?
|
||||
//$Tab['date_ecriture'] = $date_ecriture;
|
||||
$Tab['date_ecriture'] = dol_print_date($data->doc_date, '%d%m%y');
|
||||
@ -507,7 +508,7 @@ class AccountancyExport
|
||||
public function exportEbp($objectLines) {
|
||||
|
||||
$separator = ',';
|
||||
$end_line = "\n";
|
||||
$end_line = "\n";
|
||||
|
||||
foreach ( $objectLines as $line ) {
|
||||
|
||||
@ -539,7 +540,7 @@ class AccountancyExport
|
||||
public function exportAgiris($objectLines) {
|
||||
|
||||
$separator = ';';
|
||||
$end_line = "\n";
|
||||
$end_line = "\n";
|
||||
|
||||
foreach ( $objectLines as $line ) {
|
||||
|
||||
@ -566,35 +567,35 @@ class AccountancyExport
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : Configurable
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportConfigurable($objectLines) {
|
||||
global $conf;
|
||||
/**
|
||||
* Export format : Configurable
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportConfigurable($objectLines) {
|
||||
global $conf;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$tab = array();
|
||||
// export configurable
|
||||
$date = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$tab[] = $line->piece_num;
|
||||
$tab[] = $date;
|
||||
$tab[] = $line->doc_ref;
|
||||
$tab[] = $line->label_operation;
|
||||
$tab[] = length_accountg($line->numero_compte);
|
||||
$tab[] = length_accounta($line->subledger_account);
|
||||
$tab[] = price($line->debit);
|
||||
$tab[] = price($line->credit);
|
||||
$tab[] = price($line->montant);
|
||||
$tab[] = $line->code_journal;
|
||||
foreach ($objectLines as $line) {
|
||||
$tab = array();
|
||||
// export configurable
|
||||
$date = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$tab[] = $line->piece_num;
|
||||
$tab[] = $date;
|
||||
$tab[] = $line->doc_ref;
|
||||
$tab[] = $line->label_operation;
|
||||
$tab[] = length_accountg($line->numero_compte);
|
||||
$tab[] = length_accounta($line->subledger_account);
|
||||
$tab[] = price($line->debit);
|
||||
$tab[] = price($line->credit);
|
||||
$tab[] = price($line->montant);
|
||||
$tab[] = $line->code_journal;
|
||||
|
||||
$separator = $this->separator;
|
||||
print implode($separator, $tab) . $this->end_line;
|
||||
}
|
||||
}
|
||||
$separator = $this->separator;
|
||||
print implode($separator, $tab) . $this->end_line;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@ -536,12 +536,12 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Button to write into Ledger
|
||||
if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
|
||||
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
print '<br>'.img_warning().' '.$langs->trans("SomeMandatoryStepsOfSetupWereNotDone");
|
||||
print ' : '.$langs->trans("AccountancyAreaDescMisc", 4, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
||||
}
|
||||
print '<div class="tabsAction tabsActionNoBottom">';
|
||||
if (empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) || $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT == '-1') {
|
||||
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
|
||||
print '<input type="button" class="butActionRefused" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="' . $langs->trans("WriteBookKeeping") . '" />';
|
||||
}
|
||||
else {
|
||||
if ($in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="writebookkeeping" value="' . $langs->trans("WriteBookKeeping") . '" onclick="writebookkeeping();" />';
|
||||
@ -571,7 +571,7 @@ if (empty($action) || $action == 'view') {
|
||||
print '<br>';
|
||||
|
||||
$i = 0;
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<div class="div-table-responsive">';
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print "<td></td>";
|
||||
|
||||
@ -79,9 +79,10 @@ class AdherentStats extends Stats
|
||||
* Return the number of proposition by month for a given year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of nb each month
|
||||
*/
|
||||
function getNbByMonth($year)
|
||||
function getNbByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -93,7 +94,7 @@ class AdherentStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getNbByMonth($year, $sql);
|
||||
return $this->_getNbByMonth($year, $sql, $format);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -116,12 +117,13 @@ class AdherentStats extends Stats
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the number of subscriptions by month for a given year
|
||||
* Return the number of subscriptions by month for a given year
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of amount each month
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
function getAmountByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -133,7 +135,7 @@ class AdherentStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
return $this->_getAmountByMonth($year, $sql);
|
||||
return $this->_getAmountByMonth($year, $sql, $format);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -69,6 +69,8 @@ if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
|
||||
|
||||
$s=$mysoc->country_id.':'.$mysoc->country_code.':'.$mysoc->country_label;
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_COUNTRY", $s,'chaine',0,'',$conf->entity);
|
||||
|
||||
activateModulesRequiredByCountry($mysoc->country_code);
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_INFO_SOCIETE_NOM", GETPOST("nom",'nohtml'),'chaine',0,'',$conf->entity);
|
||||
@ -981,12 +983,13 @@ else
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="titlefield">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"use_vat\" disabled value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</td>";
|
||||
print '<tr class="oddeven"><td class="titlefield">';
|
||||
print "<input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"use_vat\" disabled value=\"1\"".(empty($conf->global->FACTURE_TVAOPTION)?"":" checked")."> ".$langs->trans("VATIsUsed")."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"use_vat\">".$langs->trans("VATIsUsedDesc")."</label></td></tr>";
|
||||
@ -995,7 +998,8 @@ else
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"no_vat\" disabled value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</td>";
|
||||
print '<tr class="oddeven"><td class="titlefield">';
|
||||
print "<input class=\"oddeven\" type=\"radio\" name=\"optiontva\" id=\"no_vat\" disabled value=\"0\"".(empty($conf->global->FACTURE_TVAOPTION)?" checked":"")."> ".$langs->trans("VATIsNotUsed")."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label=\"no_vat\">".$langs->trans("VATIsNotUsedDesc")."</label></td></tr>";
|
||||
@ -1015,12 +1019,13 @@ else
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="titlefield">'.$langs->transcountry("LocalTax1Management",$mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" disabled value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
|
||||
print "<tr class=\"oddeven\"><td>";
|
||||
print "<input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax1\" id=\"lt1\" disabled value=\"localtax1on\"".(($conf->global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on")?" checked":"")."> ".$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td></label for=\"lt1\">".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
|
||||
@ -1048,7 +1053,8 @@ else
|
||||
print "</td></tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<tr class="oddeven"><td>';
|
||||
print "<input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax1\" id=\"nolt1\" disabled value=\"localtax1off\"".((empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off")?" checked":"")."> ".$langs->transcountry("LocalTax1IsNotUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"no_lt1\">".$langs->transcountry("LocalTax1IsNotUsedDesc",$mysoc->country_code)."</label></td></tr>";
|
||||
@ -1065,12 +1071,13 @@ else
|
||||
print '<br>';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="titlefield">'.$langs->transcountry("LocalTax2Management",$mysoc->country_code).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
print "<tr class=\"oddeven\"><td width=\"160\"><input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" disabled value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
|
||||
print "<tr class=\"oddeven\"><td>";
|
||||
print "<input class=\"oddeven\" type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" disabled value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on")?" checked":"")."> ".$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code)."</td>";
|
||||
print '<td colspan="2">';
|
||||
print "<table>";
|
||||
print "<tr><td><label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."</label></td></tr>";
|
||||
|
||||
@ -94,6 +94,8 @@ $hookmanager->initHooks(array('adminmodules','globaladmin'));
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
@ -236,8 +238,7 @@ if ($action == 'set' && $user->admin)
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mode=".$mode.$param.($page_y?'&page_y='.$page_y:''));
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action == 'reset' && $user->admin)
|
||||
else if ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes')
|
||||
{
|
||||
$result=unActivateModule($value);
|
||||
if ($result) setEventMessages($result, null, 'errors');
|
||||
@ -423,6 +424,22 @@ foreach ($modulesdir as $dir)
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'reset_confirm' && $user->admin)
|
||||
{
|
||||
if(!empty($modules[$value])) {
|
||||
$objMod = $modules[$value];
|
||||
|
||||
if(!empty($objMod->langfiles)) $langs->loadLangs($objMod->langfiles);
|
||||
|
||||
$form = new Form($db);
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?value='.$value.'&mode='.$mode.$param, $langs->trans('ConfirmUnactivation'), $langs->trans(GETPOST('confirm_message_code')), 'reset', '', 'no', 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
print $formconfirm;
|
||||
|
||||
asort($orders);
|
||||
//var_dump($orders);
|
||||
//var_dump($categ);
|
||||
@ -679,9 +696,20 @@ if ($mode == 'common')
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset&value=' . $modName . '&mode=' . $mode . $param . '">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a>';
|
||||
if(!empty($objMod->warnings_unactivation[$mysoc->country_code]) && method_exists($objMod, 'alreadyUsed') && $objMod->alreadyUsed()) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset_confirm&confirm_message_code='.$objMod->warnings_unactivation[$mysoc->country_code].'&value=' . $modName . '&mode=' . $mode . $param . '">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a>';
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$objMod->numero.'&module_position='.$module_position.'&action=reset&value=' . $modName . '&mode=' . $mode .'&confirm=yes' . $param . '">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ LOG INALTERABLE
|
||||
|
||||
## Fonctionnalité
|
||||
|
||||
Ce module tace, en temps réel, certains évènements métiers dans une log non reversible (que vous ne pouvez pas modifier une fois enregistré) de type blockchain.
|
||||
Ce module trace, en temps réel, certains évènements métiers dans une log inaltérable (que vous ne pouvez pas modifier une fois enregistrés) de type blockchain.
|
||||
Ce module est requis pour la compatibilité avec les exigences légales de certains pays (comme la France avec la loi Fincance 2016 - Norme NF535).
|
||||
|
||||
|
||||
@ -15,9 +15,9 @@ Ce module est requis pour la compatibilité avec les exigences légales de certa
|
||||
|
||||
Remarque: Le type des événements tracés est probablement plus large que la plupart des exigences légales mais permet d'être prêt pour d'éventuel élargissement
|
||||
de ces exigences.
|
||||
Vous pouvez aussi lire et recherche au sein de la log dédiée.
|
||||
Vous pouvez aussi lire et faire des recherches au sein de la log inaltérable.
|
||||
|
||||
Tous les enregistrements de la logs inaltérable sont liés avec le précédent dnas une Blockchain, et leur contenu fait parti de la signature inclue dans le lien,
|
||||
aussi, une fois le module activé et le premier enregistrement réalisé, il ne sera plus possible d'effacer ni modifié un enregistrement dans la log
|
||||
inaltérable sans corrompre la chaine. Dès lors qu'un enregistrement est invalide, tous les suivants seront également considérés invalides.
|
||||
Tous les enregistrements de la logs inaltérable sont liés avec le précédent dans une Blockchain, et leur contenu fait parti de la signature inclue dans ce lien,
|
||||
aussi, une fois le module activé et le premier enregistrement réalisé, il ne sera plus possible d'effacer ni modifier un enregistrement dans la log
|
||||
inaltérable sans corrompre toute la chaine. Dès lors qu'un enregistrement est invalide, tous les suivants pourront également être considérés invalides par votre administration.
|
||||
|
||||
|
||||
@ -41,7 +41,10 @@ $action = GETPOST('action','alpha');
|
||||
if (preg_match('/set_(.*)/',$action,$reg))
|
||||
{
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, GETPOST($code), 'chaine', 0, '', $conf->entity) > 0)
|
||||
$values = GETPOST($code);
|
||||
if(is_array($values))$values = implode(',', $values);
|
||||
|
||||
if (dolibarr_set_const($db, $code, $values, 'chaine', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
@ -115,6 +118,35 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY)) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$langs->trans("BlockedLogDisableNotAllowedForCountry").'</td>';
|
||||
print '<td align="right" width="300">';
|
||||
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<input type="hidden" name="action" value="set_BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY">';
|
||||
|
||||
$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label, favorite";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."c_country";
|
||||
$sql.= " WHERE active > 0";
|
||||
|
||||
$countryArray=array();
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
{
|
||||
$countryArray[$obj->code_iso] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:''));
|
||||
}
|
||||
}
|
||||
|
||||
$seledted = empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY) ? array() : explode(',',$conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY);
|
||||
|
||||
print $form->multiselectarray('BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY', $countryArray, $seledted);
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</form>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
@ -34,6 +34,12 @@ $langs->load("blockedlog");
|
||||
if (! $user->admin) accessforbidden();
|
||||
|
||||
$action = GETPOST('action','alpha');
|
||||
$contextpage= GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'myobjectlist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage','alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss','aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
$search=array();
|
||||
|
||||
$showonlyerrors = GETPOST('showonlyerrors','int');
|
||||
|
||||
// Load variable for pagination
|
||||
@ -49,6 +55,14 @@ $pagenext = $page + 1;
|
||||
if (empty($sortfield)) $sortfield='rowid';
|
||||
if (empty($sortorder)) $sortorder='DESC';
|
||||
|
||||
$search_start = -1;
|
||||
if(GETPOST('search_startyear')!='') $search_start = dol_mktime(0, 0, 0, GETPOST('search_startmonth'), GETPOST('search_startday'), GETPOST('search_startyear'));
|
||||
|
||||
$search_end = -1;
|
||||
if(GETPOST('search_endyear')!='') $search_end= dol_mktime(23, 59, 59, GETPOST('search_endmonth'), GETPOST('search_endday'), GETPOST('search_endyear'));
|
||||
|
||||
|
||||
|
||||
$block_static = new BlockedLog($db);
|
||||
|
||||
|
||||
@ -56,7 +70,16 @@ $block_static = new BlockedLog($db);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if($action === 'downloadblockchain') {
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$search_start = -1;
|
||||
$search_end = -1;
|
||||
$toselect='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
if ($action === 'downloadblockchain') {
|
||||
|
||||
$auth = new BlockedLogAuthority($db);
|
||||
|
||||
@ -128,10 +151,10 @@ else if($action === 'downloadcsv') {
|
||||
* View
|
||||
*/
|
||||
|
||||
$blocks = $block_static->getLog('all', 0, GETPOST('all','alpha') ? 0 : 50, $sortfield, $sortorder);
|
||||
|
||||
$form=new Form($db);
|
||||
|
||||
$blocks = $block_static->getLog('all', 0, GETPOST('all','alpha') ? 0 : 50, $sortfield, $sortorder, $search_start, $search_end);
|
||||
|
||||
llxHeader('',$langs->trans("BlockedLogSetup"));
|
||||
|
||||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
|
||||
@ -145,6 +168,20 @@ print $langs->trans("FingerprintsDesc")."<br>\n";
|
||||
|
||||
print '<br>';
|
||||
|
||||
$param='';
|
||||
if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
|
||||
if ($search_start > 0) $param.='&search_startyear='.urlencode(GETPOST('search_startyear','int')).'&search_startmonth='.urlencode(GETPOST('search_startmonth','int')).'&search_startday='.urlencode(GETPOST('search_startday','int'));
|
||||
if ($search_end > 0) $param.='&search_endyear='.urlencode(GETPOST('search_endyear','int')).'&search_endmonth='.urlencode(GETPOST('search_endmonth','int')).'&search_endday='.urlencode(GETPOST('search_endday','int'));
|
||||
foreach($search as $key => $val)
|
||||
{
|
||||
$param.= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
|
||||
// Add $param from extra fields
|
||||
//include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
|
||||
|
||||
print '<div align="right">';
|
||||
print ' <a href="?all=1">'.$langs->trans('ShowAllFingerPrintsMightBeTooLong').'</a>';
|
||||
print ' | <a href="?all=1&showonlyerrors=1">'.$langs->trans('ShowAllFingerPrintsErrorsMightBeTooLong').'</a>';
|
||||
@ -154,19 +191,39 @@ print ' </div>';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre_filter">';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_date($search_start,'search_start');
|
||||
print $form->select_date($search_end,'search_end');
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre" colspan="7"> </td>';
|
||||
|
||||
// Action column
|
||||
print '<td class="liste_titre" align="middle">';
|
||||
$searchpicto=$form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList($langs->trans('#'), 0, $_SERVER["PHP_SELF"],'rowid','','','',$sortfield,$sortorder,'minwidth50 ')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Date'), 0, $_SERVER["PHP_SELF"],'date_creation','','','',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Author'), 0, $_SERVER["PHP_SELF"],'user_fullname','','','',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Action'), 0, $_SERVER["PHP_SELF"],'','','','',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Ref'), 0, $_SERVER["PHP_SELF"],'ref_object','','','',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"],'','','','',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"],'','','','align="right"',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"],'','','','align="center"',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Fingerprint'), 0, $_SERVER["PHP_SELF"],'','','','',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList('<span id="blockchainstatus"></span>', 0, $_SERVER["PHP_SELF"],'','','','',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('#'), 0, $_SERVER["PHP_SELF"],'rowid','',$param,'',$sortfield,$sortorder,'minwidth50 ')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Date'), 0, $_SERVER["PHP_SELF"],'date_creation','',$param,'',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Author'), 0, $_SERVER["PHP_SELF"],'user_fullname','',$param,'',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Action'), 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Ref'), 0, $_SERVER["PHP_SELF"],'ref_object','',$param,'',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList('', 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Amount'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="right"',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('DataOfArchivedEvent'), 0, $_SERVER["PHP_SELF"],'','',$param,'align="center"',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList($langs->trans('Fingerprint'), 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n";
|
||||
print getTitleFieldOfList('<span id="blockchainstatus"></span>', 0, $_SERVER["PHP_SELF"],'','',$param,'',$sortfield,$sortorder,'')."\n";
|
||||
print '</tr>';
|
||||
|
||||
$loweridinerror=0;
|
||||
@ -226,6 +283,9 @@ foreach($blocks as &$block) {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<script type="text/javascript">
|
||||
|
||||
@ -580,9 +580,11 @@ class BlockedLog
|
||||
* @param int $limit max number of element, 0 for all
|
||||
* @param string $sortfield sort field
|
||||
* @param string $sortorder sort order
|
||||
* @param int $search_start start time limit
|
||||
* @param int $search_end end time limit
|
||||
* @return array array of object log
|
||||
*/
|
||||
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '')
|
||||
public function getLog($element, $fk_object, $limit = 0, $sortfield = '', $sortorder = '', $search_start = -1, $search_end = -1)
|
||||
{
|
||||
global $conf, $cachedlogs;
|
||||
|
||||
@ -610,8 +612,10 @@ class BlockedLog
|
||||
WHERE element='".$element."' AND fk_object=".(int) $fk_object;
|
||||
}
|
||||
|
||||
if($search_start > 0) $sql.=" AND date_creation >= '".$this->db->idate($search_start)."'";
|
||||
if($search_end > 0) $sql.=" AND date_creation <= '".$this->db->idate($search_end)."'";
|
||||
|
||||
$sql.=$this->db->order($sortfield, $sortorder);
|
||||
//($order<0 ? ' ORDER BY rowid DESC ' : ' ORDER BY rowid ASC ');
|
||||
|
||||
if($limit > 0 )$sql.=' LIMIT '.$limit;
|
||||
|
||||
|
||||
@ -75,7 +75,7 @@ function printBookmarksList($aDb, $aLangs)
|
||||
$ret.= '<select name="bookmark" id="boxbookmark" class="flat boxcombo vmenusearchselectcombo" alt="Bookmarks">';
|
||||
$ret.= '<option hidden value="listbookmarks" class="optiongrey" selected rel="'.DOL_URL_ROOT.'/bookmarks/list.php">'.$langs->trans('Bookmarks').'</option>';
|
||||
$ret.= '<option value="listbookmark" class="optionblue" rel="'.dol_escape_htmltag(DOL_URL_ROOT.'/bookmarks/list.php').'" ';
|
||||
$ret.= ' html="'.dol_escape_htmltag('<span class="fa fa-star-o"></span> '.dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...').'">';
|
||||
$ret.= ' data-html="'.dol_escape_htmltag('<span class="fa fa-star-o"></span> '.dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...').'">';
|
||||
$ret.= dol_escape_htmltag($user->rights->bookmark->creer ? $langs->trans('EditBookmarks') : $langs->trans('ListOfBookmarks')).'...</option>';
|
||||
// Url to go on create new bookmark page
|
||||
if (! empty($user->rights->bookmark->creer))
|
||||
@ -83,7 +83,7 @@ function printBookmarksList($aDb, $aLangs)
|
||||
//$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&urlsource='.urlencode($url).'&url='.urlencode($url);
|
||||
$urltoadd=DOL_URL_ROOT.'/bookmarks/card.php?action=create&url='.urlencode($url);
|
||||
$ret.= '<option value="newbookmark" class="optionblue" rel="'.dol_escape_htmltag($urltoadd).'"';
|
||||
$ret.= ' html="'.dol_escape_htmltag('<span class="fa fa-star-o"></span> '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
|
||||
$ret.= ' data-html="'.dol_escape_htmltag('<span class="fa fa-star-o"></span> '.$langs->trans('AddThisPageToBookmarks').'...').'">'.dol_escape_htmltag($langs->trans('AddThisPageToBookmarks').'...').'</option>';
|
||||
}
|
||||
// Menu with all bookmarks
|
||||
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
|
||||
@ -98,7 +98,7 @@ function printBookmarksList($aDb, $aLangs)
|
||||
while ($i < $conf->global->BOOKMARKS_SHOW_IN_MENU && $obj = $db->fetch_object($resql))
|
||||
{
|
||||
$ret.='<option name="bookmark'.$obj->rowid.'" value="'.$obj->rowid.'" '.($obj->target == 1?' target="_blank"':'').' rel="'.dol_escape_htmltag($obj->url).'"';
|
||||
//$ret.=' html="'.dol_escape_htmltag('<span class="fa fa-print"></span> '.$obj->title).'"';
|
||||
//$ret.=' data-html="'.dol_escape_htmltag('<span class="fa fa-print"></span> '.$obj->title).'"';
|
||||
$ret.='>';
|
||||
$ret.=dol_escape_htmltag($obj->title);
|
||||
$ret.='</option>';
|
||||
|
||||
@ -168,10 +168,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||
// Purge search criteria
|
||||
if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
|
||||
{
|
||||
$actioncode='';
|
||||
//$actioncode='';
|
||||
$search_title='';
|
||||
$datestart='';
|
||||
$dateend='';
|
||||
$status='';
|
||||
$search_array_options=array();
|
||||
}
|
||||
|
||||
|
||||
@ -2262,10 +2262,10 @@ if ($action == 'create')
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#">' . $langs->trans('Validate') . '</a></div>';
|
||||
}
|
||||
// Create event
|
||||
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
/*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
|
||||
}
|
||||
}*/
|
||||
// Edit
|
||||
if ($object->statut == Propal::STATUS_VALIDATED && $user->rights->propal->creer) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=modif">' . $langs->trans('Modify') . '</a></div>';
|
||||
|
||||
@ -683,6 +683,7 @@ class Propal extends CommonObject
|
||||
|
||||
// Anciens indicateurs: $price, $remise (a ne plus utiliser)
|
||||
$price = $pu;
|
||||
$remise = 0;
|
||||
if ($remise_percent > 0)
|
||||
{
|
||||
$remise = round(($pu * $remise_percent / 100), 2);
|
||||
@ -1983,7 +1984,7 @@ class Propal extends CommonObject
|
||||
$sql.= " SET fk_availability = '".$id."'";
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(__METHOD__.' availability('.$availability_id.')', LOG_DEBUG);
|
||||
dol_syslog(__METHOD__.' availability('.$id.')', LOG_DEBUG);
|
||||
$resql=$this->db->query($sql);
|
||||
if (!$resql)
|
||||
{
|
||||
@ -3103,6 +3104,7 @@ class Propal extends CommonObject
|
||||
global $langs;
|
||||
$langs->load("propal");
|
||||
|
||||
$statuttrans='';
|
||||
if ($statut==self::STATUS_DRAFT) $statuttrans='statut0';
|
||||
if ($statut==self::STATUS_VALIDATED) $statuttrans='statut1';
|
||||
if ($statut==self::STATUS_SIGNED) $statuttrans='statut3';
|
||||
@ -3151,6 +3153,9 @@ class Propal extends CommonObject
|
||||
$langs->load("propal");
|
||||
$now=dol_now();
|
||||
|
||||
$delay_warning = 0;
|
||||
$statut = 0;
|
||||
$label = '';
|
||||
if ($mode == 'opened') {
|
||||
$delay_warning=$conf->propal->cloture->warning_delay;
|
||||
$statut = self::STATUS_VALIDATED;
|
||||
@ -3981,9 +3986,9 @@ class PropaleLigne extends CommonObjectLine
|
||||
* @param int $notrigger 1=Does not execute triggers, 0= execute triggers
|
||||
* @return int <0 if ko, >0 if ok
|
||||
*/
|
||||
function delete($user=null, $notrigger=0)
|
||||
function delete(User $user, $notrigger=0)
|
||||
{
|
||||
global $conf,$user;
|
||||
global $conf;
|
||||
|
||||
$error=0;
|
||||
$this->db->begin();
|
||||
|
||||
@ -64,27 +64,27 @@ class PropaleStats extends Stats
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
$object=new Propal($this->db);
|
||||
|
||||
|
||||
$this->from = MAIN_DB_PREFIX.$object->table_element." as p";
|
||||
$this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl";
|
||||
$this->field_date='p.datep';
|
||||
$this->field='total_ht';
|
||||
$this->field_line='total_ht';
|
||||
|
||||
|
||||
$this->where.= " p.fk_statut > 0";
|
||||
}
|
||||
if ($mode == 'supplier')
|
||||
{
|
||||
$object=new SupplierProposal($this->db);
|
||||
|
||||
|
||||
$this->from = MAIN_DB_PREFIX.$object->table_element." as p";
|
||||
$this->from_line = MAIN_DB_PREFIX.$object->table_element_line." as tl";
|
||||
$this->field_date='p.date_valid';
|
||||
$this->field='total_ht';
|
||||
$this->field_line='total_ht';
|
||||
|
||||
|
||||
$this->where.= " p.fk_statut > 0"; // Validated, accepted, refused and closed
|
||||
}
|
||||
}
|
||||
//$this->where.= " AND p.fk_soc = s.rowid AND p.entity = ".$conf->entity;
|
||||
$this->where.= " AND p.entity IN (".getEntity('propal').")";
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND p.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
@ -100,9 +100,10 @@ class PropaleStats extends Stats
|
||||
* Return propals number by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array with number by month
|
||||
*/
|
||||
function getNbByMonth($year)
|
||||
function getNbByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -114,7 +115,7 @@ class PropaleStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
$res=$this->_getNbByMonth($year, $sql, $format);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -141,10 +142,11 @@ class PropaleStats extends Stats
|
||||
/**
|
||||
* Return the propals amount by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @return array Array with amount by month
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array with amount by month
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
function getAmountByMonth($year, $format)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -156,7 +158,7 @@ class PropaleStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getAmountByMonth($year, $sql);
|
||||
$res=$this->_getAmountByMonth($year, $sql, $format);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
@ -2465,12 +2465,12 @@ if ($action == 'create' && $user->rights->commande->creer)
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id=' . $object->id . '&action=modif">' . $langs->trans('Modify') . '</a></div>';
|
||||
}
|
||||
// Create event
|
||||
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a
|
||||
/*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a
|
||||
// "workflow" action so should appears somewhere else on
|
||||
// page.
|
||||
{
|
||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a>';
|
||||
}
|
||||
}*/
|
||||
|
||||
// Create intervention
|
||||
if ($conf->ficheinter->enabled) {
|
||||
|
||||
@ -60,8 +60,8 @@ class CommandeStats extends Stats
|
||||
|
||||
$this->socid = ($socid > 0 ? $socid : 0);
|
||||
$this->userid = $userid;
|
||||
$this->cachefilesuffix = $mode;
|
||||
|
||||
$this->cachefilesuffix = $mode;
|
||||
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
$object=new Commande($this->db);
|
||||
@ -82,7 +82,7 @@ class CommandeStats extends Stats
|
||||
}
|
||||
//$this->where.= " AND c.fk_soc = s.rowid AND c.entity = ".$conf->entity;
|
||||
$this->where.= ' AND c.entity IN ('.getEntity('commande').')';
|
||||
|
||||
|
||||
if (!$user->rights->societe->client->voir && !$this->socid) $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||
if ($this->socid)
|
||||
{
|
||||
@ -95,9 +95,10 @@ class CommandeStats extends Stats
|
||||
* Return orders number by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array with number by month
|
||||
*/
|
||||
function getNbByMonth($year)
|
||||
function getNbByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -109,7 +110,7 @@ class CommandeStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
$res=$this->_getNbByMonth($year, $sql, $format);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -136,10 +137,11 @@ class CommandeStats extends Stats
|
||||
/**
|
||||
* Return the orders amount by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @return array Array with amount by month
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array with amount by month
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
function getAmountByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -151,7 +153,7 @@ class CommandeStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getAmountByMonth($year, $sql);
|
||||
$res=$this->_getAmountByMonth($year, $sql, $format);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -217,6 +219,6 @@ class CommandeStats extends Stats
|
||||
|
||||
return $this->_getAllByProduct($sql);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2010 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) 2013 Charles-Fr BENKE <charles.fr@benke.fr>
|
||||
*
|
||||
@ -180,9 +180,9 @@ dol_fiche_end();
|
||||
|
||||
|
||||
// Affiche tableau
|
||||
print '<div class="floatright">'.$link.'</div>';
|
||||
|
||||
print load_fiche_titre('', $link, '');
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="liste_titre">'.$langs->trans("Month").'</td>';
|
||||
@ -238,7 +238,7 @@ for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||
print "</tr>\n";
|
||||
|
||||
print "</table>";
|
||||
|
||||
print "</div>";
|
||||
|
||||
print '<br>';
|
||||
|
||||
@ -358,7 +358,7 @@ else
|
||||
$data_year_0[$i] = isset($tblyear[0][substr("0".($i+1),-2)]) ? $tblyear[0][substr("0".($i+1),-2)] : 0;
|
||||
$data_year_1[$i] = isset($tblyear[1][substr("0".($i+1),-2)]) ? $tblyear[1][substr("0".($i+1),-2)] : 0;
|
||||
$data_year_2[$i] = isset($tblyear[2][substr("0".($i+1),-2)]) ? $tblyear[2][substr("0".($i+1),-2)] : 0;
|
||||
$labels[$i] = dol_print_date(dol_mktime(12,0,0,$i+1,1,2000),"%b");
|
||||
$labels[$i] = $langs->transnoentitiesnoconv("MonthVeryShort".sprintf("%02d", $i+1));
|
||||
$datamin[$i] = 0;
|
||||
}
|
||||
|
||||
@ -446,7 +446,7 @@ else
|
||||
$data_year_0[$i] = isset($tblyear[0][substr("0".($i+1),-2)]) ? $tblyear[0][substr("0".($i+1),-2)] : 0;
|
||||
$data_year_1[$i] = isset($tblyear[1][substr("0".($i+1),-2)]) ? $tblyear[1][substr("0".($i+1),-2)] : 0;
|
||||
$data_year_2[$i] = isset($tblyear[2][substr("0".($i+1),-2)]) ? $tblyear[2][substr("0".($i+1),-2)] : 0;
|
||||
$labels[$i] = dol_print_date(dol_mktime(12,0,0,$i+1,1,2000),"%b");
|
||||
$labels[$i] = $langs->transnoentitiesnoconv("MonthVeryShort".sprintf("%02d", $i+1));
|
||||
$datamin[$i] = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -266,12 +266,12 @@ class PaymentVarious extends CommonObject
|
||||
$this->fk_user_modif='';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create in database
|
||||
*
|
||||
* @param User $user User that create
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
/**
|
||||
* Create in database
|
||||
*
|
||||
* @param User $user User that create
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function create($user)
|
||||
{
|
||||
global $conf,$langs;
|
||||
@ -338,6 +338,7 @@ class PaymentVarious extends CommonObject
|
||||
if ($this->note) $sql.= ", '".$this->db->escape($this->note)."'";
|
||||
$sql.= ", '".$this->db->escape($this->label)."'";
|
||||
$sql.= ", '".$this->db->escape($this->accountancy_code)."'";
|
||||
$sql.= ", ".($this->fk_project > 0? $this->fk_project : 0);
|
||||
$sql.= ", ".$user->id;
|
||||
$sql.= ", '".$this->db->idate($now)."'";
|
||||
$sql.= ", NULL";
|
||||
@ -407,10 +408,10 @@ class PaymentVarious extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PAYMENT_VARIOUS_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
// Call trigger
|
||||
$result=$this->call_trigger('PAYMENT_VARIOUS_CREATE',$user);
|
||||
if ($result < 0) $error++;
|
||||
// End call triggers
|
||||
|
||||
}
|
||||
else $error++;
|
||||
@ -437,8 +438,8 @@ class PaymentVarious extends CommonObject
|
||||
/**
|
||||
* Update link between payment various and line generate into llx_bank
|
||||
*
|
||||
* @param int $id_bank Id bank account
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $id_bank Id bank account
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function update_fk_bank($id_bank)
|
||||
{
|
||||
@ -517,18 +518,18 @@ class PaymentVarious extends CommonObject
|
||||
/**
|
||||
* Send name clicable (with possibly the picto)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param string $option link option
|
||||
* @return string Chaine with URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param string $option link option
|
||||
* @return string Chaine with URL
|
||||
*/
|
||||
function getNomUrl($withpicto=0,$option='')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result='';
|
||||
$label=$langs->trans("ShowVariousPayment").': '.$this->ref;
|
||||
$label=$langs->trans("ShowVariousPayment").': '.$this->ref;
|
||||
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?id='.$this->id.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkend='</a>';
|
||||
|
||||
$result .= $linkstart;
|
||||
@ -542,8 +543,8 @@ class PaymentVarious extends CommonObject
|
||||
/**
|
||||
* Information on record
|
||||
*
|
||||
* @param int $id Id of record
|
||||
* @return void
|
||||
* @param int $id Id of record
|
||||
* @return void
|
||||
*/
|
||||
function info($id)
|
||||
{
|
||||
|
||||
@ -223,7 +223,7 @@ if ($action=="dl" && $numref > 0)
|
||||
$payment = new Paiement($db);
|
||||
$payment->fetch($val['url_id']);
|
||||
$arraybill = $payment->getBillsArray();
|
||||
if (count($arraybill) > 0)
|
||||
if (is_array($arraybill) && count($arraybill) > 0)
|
||||
{
|
||||
foreach ($arraybill as $billid)
|
||||
{
|
||||
@ -260,7 +260,7 @@ if ($action=="dl" && $numref > 0)
|
||||
$payment = new PaiementFourn($db);
|
||||
$payment->fetch($val['url_id']);
|
||||
$arraybill = $payment->getBillsArray();
|
||||
if (count($arraybill) > 0)
|
||||
if (is_array($arraybill) && count($arraybill) > 0)
|
||||
{
|
||||
foreach ($arraybill as $billid)
|
||||
{
|
||||
@ -373,11 +373,22 @@ if ($id > 0) $param.='&id='.urlencode($id);
|
||||
|
||||
if (empty($numref))
|
||||
{
|
||||
$sortfield='numr';
|
||||
$sortorder='DESC';
|
||||
|
||||
// List of all standing receipts
|
||||
$sql = "SELECT DISTINCT(b.num_releve) as numr";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= " WHERE b.fk_account = ".$object->id;
|
||||
$sql.= " ORDER BY numr DESC";
|
||||
$sql.=$db->order($sortfield,$sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||
{
|
||||
$result = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($result);
|
||||
}
|
||||
|
||||
$sql.= $db->plimit($conf->liste_limit+1,$offset);
|
||||
|
||||
@ -413,7 +424,7 @@ if (empty($numref))
|
||||
print '</div>';
|
||||
|
||||
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$object->id, $sortfield, $sortorder,'',$numrows);
|
||||
print_barre_liste('', $page, $_SERVER["PHP_SELF"], "&account=".$object->id, $sortfield, $sortorder,'',$numrows, $totalnboflines, '');
|
||||
|
||||
print '<form name="aaa" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
@ -423,7 +434,7 @@ if (empty($numref))
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("AccountStatement").'</td>';
|
||||
print '<td>'.$langs->trans("Ref").'</td>';
|
||||
print '<td align="right">'.$langs->trans("InitialBankBalance").'</td>';
|
||||
print '<td align="right">'.$langs->trans("EndBankBalance").'</td>';
|
||||
print '<td></td>';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/bank/various_expenses/card.php
|
||||
* \ingroup bank
|
||||
* \brief Page of various expenses
|
||||
* \file htdocs/compta/bank/various_expenses/card.php
|
||||
* \ingroup bank
|
||||
* \brief Page of various expenses
|
||||
*/
|
||||
|
||||
require '../../../main.inc.php';
|
||||
@ -40,8 +40,8 @@ $langs->loadLangs(array("compta", "banks", "bills", "users", "accountancy"));
|
||||
// Get parameters
|
||||
$id = GETPOST('id', 'int');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
$accountid=GETPOST("accountid") > 0 ? GETPOST("accountid","int") : 0;
|
||||
$label=GETPOST("label","alpha");
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -17,9 +17,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/bank/various_payment/document.php
|
||||
* \ingroup banque
|
||||
* \brief Page of linked files onto various_payment
|
||||
* \file htdocs/compta/bank/various_payment/document.php
|
||||
* \ingroup bank
|
||||
* \brief Page of linked files onto various payment
|
||||
*/
|
||||
|
||||
require '../../../main.inc.php';
|
||||
@ -28,9 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
||||
|
||||
$langs->load("other");
|
||||
$langs->load("bank");
|
||||
$langs->load("companies");
|
||||
$langs->loadLangs(array("compta", "banks", "bills", "users", "accountancy"));
|
||||
|
||||
$id = GETPOST('id','int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
@ -38,9 +36,9 @@ $action = GETPOST('action','alpha');
|
||||
$confirm = GETPOST('confirm','alpha');
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST("socid","int");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'salaries', $id, '');
|
||||
|
||||
$result = restrictedArea($user, 'banque', '', '', '');
|
||||
|
||||
// Get parameters
|
||||
$sortfield = GETPOST('sortfield','alpha');
|
||||
@ -74,8 +72,9 @@ include_once DOL_DOCUMENT_ROOT . '/core/actions_linkedfiles.inc.php';
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader("",$langs->trans("VariousPayment"));
|
||||
|
||||
$title = $langs->trans("VariousPayment") . ' - ' . $langs->trans("Documents");
|
||||
$help_url = '';
|
||||
llxHeader("",$title,$help_url);
|
||||
|
||||
if ($object->id)
|
||||
{
|
||||
@ -83,6 +82,46 @@ if ($object->id)
|
||||
|
||||
dol_fiche_head($head, 'documents', $langs->trans("VariousPayment"), 0, 'payment');
|
||||
|
||||
$morehtmlref='<div class="refidno">';
|
||||
// Project
|
||||
if (! empty($conf->projet->enabled))
|
||||
{
|
||||
$langs->load("projects");
|
||||
$morehtmlref.=$langs->trans('Project') . ' ';
|
||||
if ($user->rights->tax->charges->creer)
|
||||
{
|
||||
if ($action != 'classify')
|
||||
$morehtmlref.='<a href="' . $_SERVER['PHP_SELF'] . '?action=classify&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
|
||||
$morehtmlref.='<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref.='<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref.='<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
$morehtmlref.=$formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref.='<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref.='</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref.='<a href="'.DOL_URL_ROOT.'/projet/card.php?id=' . $object->fk_project . '" title="' . $langs->trans('ShowProject') . '">';
|
||||
$morehtmlref.=$proj->ref;
|
||||
$morehtmlref.='</a>';
|
||||
} else {
|
||||
$morehtmlref.='';
|
||||
}
|
||||
}
|
||||
}
|
||||
$morehtmlref.='</div>';
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', $morehtmlref, '', 0, '', $morehtmlright);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
// Construit liste des fichiers
|
||||
$filearray=dol_dir_list($upload_dir,"files",0,'','(\.meta|_preview.*\.png)$',$sortfield,(strtolower($sortorder)=='desc'?SORT_DESC:SORT_ASC),1);
|
||||
@ -92,30 +131,22 @@ if ($object->id)
|
||||
$totalsize+=$file['size'];
|
||||
}
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
|
||||
print '<table class="border" width="100%">';
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/various_payment/index.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
|
||||
print '</div>';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
|
||||
print '</td></tr>';
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
// Societe
|
||||
//print "<tr><td>".$langs->trans("Company")."</td><td>".$object->client->getNomUrl(1)."</td></tr>";
|
||||
|
||||
print '<tr><td>'.$langs->trans("NbOfAttachedFiles").'</td><td colspan="3">'.count($filearray).'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("TotalSizeOfAttachedFiles").'</td><td colspan="3">'.$totalsize.' '.$langs->trans("bytes").'</td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
$modulepart = 'banque';
|
||||
$permission = $user->rights->banque->modifier;
|
||||
$param = '&id=' . $object->id;
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||
dol_fiche_end();
|
||||
|
||||
$modulepart = 'banque';
|
||||
$permission = $user->rights->banque->modifier;
|
||||
$param = '&id=' . $object->id;
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/tpl/document_actions_post_headers.tpl.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -17,9 +17,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/bank/various_payment/index.php
|
||||
* \ingroup bank
|
||||
* \brief List of various payments
|
||||
* \file htdocs/compta/bank/various_payment/index.php
|
||||
* \ingroup bank
|
||||
* \brief List of various payments
|
||||
*/
|
||||
|
||||
require '../../../main.inc.php';
|
||||
@ -92,7 +92,7 @@ $form = new Form($db);
|
||||
$variousstatic = new PaymentVarious($db);
|
||||
$accountstatic = new Account($db);
|
||||
|
||||
$sql = "SELECT v.rowid, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code,";
|
||||
$sql = "SELECT v.rowid, v.sens, v.amount, v.label, v.datep as datep, v.datev as datev, v.fk_typepayment as type, v.num_payment, v.fk_bank, v.accountancy_code,";
|
||||
$sql.= " ba.rowid as bid, ba.ref as bref, ba.number as bnumber, ba.account_number as bank_account_number, ba.fk_accountancy_journal as accountancy_journal, ba.label as blabel,";
|
||||
$sql.= " pst.code as payment_code";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
||||
@ -102,9 +102,9 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.row
|
||||
$sql.= " WHERE v.entity IN (".getEntity('payment_various').")";
|
||||
|
||||
// Search criteria
|
||||
if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
|
||||
if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
|
||||
if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
|
||||
if ($search_ref) $sql.=" AND v.rowid=".$search_ref;
|
||||
if ($search_label) $sql.=natural_search(array('v.label'), $search_label);
|
||||
if ($search_amount_deb) $sql.=natural_search("v.amount", $search_amount_deb, 1);
|
||||
if ($search_amount_cred) $sql.=natural_search("v.amount", $search_amount_cred, 1);
|
||||
if ($search_account > 0) $sql .=" AND b.fk_account=".$search_account;
|
||||
if ($filtre) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
/* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -16,9 +16,9 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/compta/bank/various_payment/info.php
|
||||
* \ingroup salaries
|
||||
* \brief Page with info about salaries contribution
|
||||
* \file htdocs/compta/bank/various_payment/info.php
|
||||
* \ingroup bank
|
||||
* \brief Page with info about various payment
|
||||
*/
|
||||
|
||||
require '../../../main.inc.php';
|
||||
@ -26,18 +26,15 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
$langs->load("compta");
|
||||
$langs->load("bills");
|
||||
$langs->load("salaries");
|
||||
$langs->loadLangs(array("compta", "banks", "bills", "users", "accountancy"));
|
||||
|
||||
$id=GETPOST('id','int');
|
||||
$action=GETPOST('action','aZ09');
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid','int');
|
||||
$socid = GETPOST("socid","int");
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'salaries', '', '', '');
|
||||
|
||||
$result = restrictedArea($user, 'banque', '', '', '');
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -91,9 +91,10 @@ class DeplacementStats extends Stats
|
||||
* Renvoie le nombre de facture par mois pour une annee donnee
|
||||
*
|
||||
* @param string $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getNbByMonth($year)
|
||||
function getNbByMonth($year, $format=0)
|
||||
{
|
||||
$sql = "SELECT MONTH(dated) as dm, count(*)";
|
||||
$sql.= " FROM ".$this->from;
|
||||
@ -102,7 +103,7 @@ class DeplacementStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
$res=$this->_getNbByMonth($year, $sql, $format);
|
||||
//var_dump($res);print '<br>';
|
||||
return $res;
|
||||
}
|
||||
@ -112,9 +113,10 @@ class DeplacementStats extends Stats
|
||||
* Renvoie le montant de facture par mois pour une annee donnee
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
function getAmountByMonth($year, $format=0)
|
||||
{
|
||||
$sql = "SELECT date_format(dated,'%m') as dm, sum(".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
@ -123,7 +125,7 @@ class DeplacementStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getAmountByMonth($year, $sql);
|
||||
$res=$this->_getAmountByMonth($year, $sql, $format);
|
||||
//var_dump($res);print '<br>';
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -64,15 +64,9 @@ if (! empty($conf->accounting->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountingjournal.class.php';
|
||||
}
|
||||
|
||||
$langs->load('bills');
|
||||
$langs->load('companies');
|
||||
$langs->load('compta');
|
||||
$langs->load('products');
|
||||
$langs->load('banks');
|
||||
$langs->load('main');
|
||||
if (!empty($conf->incoterm->enabled)) $langs->load('incoterm');
|
||||
if (! empty($conf->margin->enabled))
|
||||
$langs->load('margins');
|
||||
$langs->loadLangs(array('bills','companies','compta','products','banks','main'));
|
||||
if (! empty($conf->incoterm->enabled)) $langs->load('incoterm');
|
||||
if (! empty($conf->margin->enabled)) $langs->load('margins');
|
||||
|
||||
$projectid = (GETPOST('projectid','int') ? GETPOST('projectid', 'int') : 0);
|
||||
|
||||
@ -4410,11 +4404,9 @@ else if ($id > 0 || ! empty($ref))
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="' . $langs->trans("NotAllowed") . '">' . $langs->trans('Delete') . '</a></div>';
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
// Select mail models is same action as presend
|
||||
if (GETPOST('modelselected','alpha')) {
|
||||
|
||||
@ -2259,6 +2259,7 @@ class Facture extends CommonInvoice
|
||||
else $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $idwarehouse, $this->lines[$i]->qty, $this->lines[$i]->subprice, $langs->trans("InvoiceValidatedInDolibarr",$num));
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->error = $mouvP->error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,9 +93,10 @@ class FactureStats extends Stats
|
||||
* Return orders number by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getNbByMonth($year)
|
||||
function getNbByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -107,7 +108,7 @@ class FactureStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
$res=$this->_getNbByMonth($year, $sql, $format);
|
||||
//var_dump($res);print '<br>';
|
||||
return $res;
|
||||
}
|
||||
@ -136,10 +137,11 @@ class FactureStats extends Stats
|
||||
/**
|
||||
* Return the invoices amount by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @return array Array with amount by month
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array with amount by month
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
function getAmountByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -151,7 +153,7 @@ class FactureStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getAmountByMonth($year, $sql);
|
||||
$res=$this->_getAmountByMonth($year, $sql, $format);
|
||||
//var_dump($res);print '<br>';
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -550,7 +550,7 @@ if ($object->id > 0)
|
||||
*/
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
// Add a withdraw request
|
||||
// Add a transfer request
|
||||
if ($object->statut > Facture::STATUS_DRAFT && $object->paye == 0 && $num == 0)
|
||||
{
|
||||
if ($resteapayer > 0)
|
||||
@ -588,7 +588,7 @@ if ($object->id > 0)
|
||||
print "</div><br>\n";
|
||||
|
||||
|
||||
print $langs->trans("DoStandingOrdersBeforePayments").'<br><br>';
|
||||
print '<div class="opacitymedium">'.$langs->trans("DoStandingOrdersBeforePayments").'</div><br>';
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -46,14 +46,14 @@ $confirm=GETPOST('confirm', 'alpha');
|
||||
// Security check
|
||||
$fieldname = (! empty($ref)?'ref':'rowid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','',$fieldname);
|
||||
$result = restrictedArea($user, 'cheque', $id, 'bordereau_cheque','','fk_user_author',$fieldname);
|
||||
|
||||
$sortfield=GETPOST('sortfield', 'alpha');
|
||||
$sortorder=GETPOST('sortorder', 'alpha');
|
||||
$page=GETPOST('page', 'int');
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="b.dateo,b.rowid";
|
||||
if ($page < 0) { $page = 0 ; }
|
||||
if (empty($page) || $page == -1) { $page = 0; }
|
||||
$limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
@ -490,53 +490,55 @@ if ($action == 'new')
|
||||
|
||||
if (count($lines[$bid]))
|
||||
{
|
||||
foreach ($lines[$bid] as $lid => $value)
|
||||
{
|
||||
$account_id = $bid;
|
||||
if (! isset($accounts[$bid]))
|
||||
$accounts[$bid]=0;
|
||||
$accounts[$bid] += 1;
|
||||
foreach ($lines[$bid] as $lid => $value)
|
||||
{
|
||||
//$account_id = $bid; FIXME not used
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.dol_print_date($value["date"],'day').'</td>';
|
||||
print '<td>'.$value["numero"]."</td>\n";
|
||||
print '<td>'.$value["emetteur"]."</td>\n";
|
||||
print '<td>'.$value["banque"]."</td>\n";
|
||||
print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
|
||||
// FIXME $accounts[$bid] is a label !
|
||||
/*if (! isset($accounts[$bid]))
|
||||
$accounts[$bid]=0;
|
||||
$accounts[$bid] += 1;*/
|
||||
|
||||
// Link to payment
|
||||
print '<td align="center">';
|
||||
$paymentstatic->id=$value["paymentid"];
|
||||
$paymentstatic->ref=$value["paymentid"];
|
||||
if ($paymentstatic->id)
|
||||
{
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
// Link to bank transaction
|
||||
print '<td align="center">';
|
||||
$accountlinestatic->rowid=$value["id"];
|
||||
if ($accountlinestatic->rowid)
|
||||
{
|
||||
print $accountlinestatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.dol_print_date($value["date"],'day').'</td>';
|
||||
print '<td>'.$value["numero"]."</td>\n";
|
||||
print '<td>'.$value["emetteur"]."</td>\n";
|
||||
print '<td>'.$value["banque"]."</td>\n";
|
||||
print '<td align="right">'.price($value["amount"], 0, $langs, 1, -1, -1, $conf->currency).'</td>';
|
||||
|
||||
print '<td align="center">';
|
||||
print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">';
|
||||
print '</td>' ;
|
||||
print '</tr>';
|
||||
// Link to payment
|
||||
print '<td align="center">';
|
||||
$paymentstatic->id=$value["paymentid"];
|
||||
$paymentstatic->ref=$value["paymentid"];
|
||||
if ($paymentstatic->id)
|
||||
{
|
||||
print $paymentstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
// Link to bank transaction
|
||||
print '<td align="center">';
|
||||
$accountlinestatic->rowid=$value["id"];
|
||||
if ($accountlinestatic->rowid)
|
||||
{
|
||||
print $accountlinestatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
print ' ';
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
print '<td align="center">';
|
||||
print '<input id="'.$value["id"].'" class="flat checkforremise_'.$bid.'" checked type="checkbox" name="toRemise[]" value="'.$value["id"].'">';
|
||||
print '</td>' ;
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
@ -688,10 +690,12 @@ else
|
||||
{
|
||||
while ($objp = $db->fetch_object($resql))
|
||||
{
|
||||
$account_id = $objp->bid;
|
||||
if (! isset($accounts[$objp->bid]))
|
||||
//$account_id = $objp->bid; FIXME not used
|
||||
|
||||
// FIXME $accounts[$objp->bid] is a label
|
||||
/*if (! isset($accounts[$objp->bid]))
|
||||
$accounts[$objp->bid]=0;
|
||||
$accounts[$objp->bid] += 1;
|
||||
$accounts[$objp->bid] += 1;*/
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td align="center">'.$i.'</td>';
|
||||
|
||||
@ -1052,7 +1052,7 @@ class Paiement extends CommonObject
|
||||
if ($mode == 'withlistofinvoices')
|
||||
{
|
||||
$arraybill = $this->getBillsArray();
|
||||
if (count($arraybill) > 0)
|
||||
if (is_array($arraybill) && count($arraybill) > 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$facturestatic=new Facture($this->db);
|
||||
|
||||
@ -95,7 +95,7 @@ if ($action != 'create' && $action != 'edit')
|
||||
|
||||
if ($action == 'create')
|
||||
{
|
||||
print "<br>";
|
||||
print '<div name="topofform"></div><br>';
|
||||
print load_fiche_titre($langs->trans('NewAttribute'));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php';
|
||||
@ -108,7 +108,7 @@ if ($action == 'create')
|
||||
/* ************************************************************************** */
|
||||
if ($action == 'edit' && ! empty($attrname))
|
||||
{
|
||||
print "<br>";
|
||||
print '<div name="topofform"></div><br>';
|
||||
print load_fiche_titre($langs->trans("FieldEdition", $attrname));
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php';
|
||||
|
||||
@ -1198,6 +1198,11 @@ class Contrat extends CommonObject
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->fk_commercial_signature) && $this->commercial_signature_id > 0) $this->fk_commercial_signature = $this->commercial_signature_id;
|
||||
if (empty($this->fk_commercial_suivi) && $this->commercial_suivi_id > 0) $this->fk_commercial_suivi = $this->commercial_suivi_id;
|
||||
if (empty($this->fk_soc) && $this->socid > 0) $this->fk_soc = $this->socid;
|
||||
if (empty($this->fk_project) && $this->projet > 0) $this->fk_project = $this->projet;
|
||||
|
||||
if (isset($this->ref)) $this->ref=trim($this->ref);
|
||||
if (isset($this->ref_customer)) $this->ref_customer=trim($this->ref_customer);
|
||||
if (isset($this->ref_supplier)) $this->ref_supplier=trim($this->ref_supplier);
|
||||
@ -1205,7 +1210,7 @@ class Contrat extends CommonObject
|
||||
if (isset($this->entity)) $this->entity=trim($this->entity);
|
||||
if (isset($this->statut)) $this->statut=(int) $this->statut;
|
||||
if (isset($this->fk_soc)) $this->fk_soc=trim($this->fk_soc);
|
||||
if (isset($this->fk_projet)) $this->fk_projet=trim($this->fk_projet);
|
||||
if (isset($this->fk_project)) $this->fk_project=trim($this->fk_project);
|
||||
if (isset($this->fk_commercial_signature)) $this->fk_commercial_signature=trim($this->fk_commercial_signature);
|
||||
if (isset($this->fk_commercial_suivi)) $this->fk_commercial_suivi=trim($this->fk_commercial_suivi);
|
||||
if (isset($this->fk_user_mise_en_service)) $this->fk_user_mise_en_service=trim($this->fk_user_mise_en_service);
|
||||
@ -1231,7 +1236,7 @@ class Contrat extends CommonObject
|
||||
$sql.= " fin_validite=".(dol_strlen($this->fin_validite)!=0 ? "'".$this->db->idate($this->fin_validite)."'" : 'null').",";
|
||||
$sql.= " date_cloture=".(dol_strlen($this->date_cloture)!=0 ? "'".$this->db->idate($this->date_cloture)."'" : 'null').",";
|
||||
$sql.= " fk_soc=".(isset($this->fk_soc)?$this->fk_soc:"null").",";
|
||||
$sql.= " fk_projet=".(isset($this->fk_projet)?$this->fk_projet:"null").",";
|
||||
$sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").",";
|
||||
$sql.= " fk_commercial_signature=".(isset($this->fk_commercial_signature)?$this->fk_commercial_signature:"null").",";
|
||||
$sql.= " fk_commercial_suivi=".(isset($this->fk_commercial_suivi)?$this->fk_commercial_suivi:"null").",";
|
||||
$sql.= " fk_user_mise_en_service=".(isset($this->fk_user_mise_en_service)?$this->fk_user_mise_en_service:"null").",";
|
||||
|
||||
@ -230,14 +230,14 @@ foreach($listofstatus as $status)
|
||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">'.$total.'</td></tr>';
|
||||
print "</table><br>";
|
||||
|
||||
/**
|
||||
* Draft contratcs
|
||||
*/
|
||||
|
||||
// Draft contracts
|
||||
|
||||
if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||
{
|
||||
$sql = "SELECT c.rowid as ref, c.rowid,";
|
||||
$sql = "SELECT c.rowid, c.ref,";
|
||||
$sql.= " s.nom as name, s.rowid as socid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";
|
||||
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql.= " WHERE s.rowid = c.fk_soc";
|
||||
$sql.= " AND c.entity IN (".getEntity('contract', 0).")";
|
||||
@ -263,15 +263,18 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven"><td class="nowrap">';
|
||||
|
||||
$staticcontrat->ref=$obj->ref;
|
||||
$staticcontrat->id=$obj->rowid;
|
||||
print $staticcontrat->getNomUrl(1,'');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
|
||||
$companystatic->id=$obj->socid;
|
||||
$companystatic->name=$obj->name;
|
||||
$companystatic->client=1;
|
||||
|
||||
print '<tr class="oddeven"><td class="nowrap">';
|
||||
print $staticcontrat->getNomUrl(1,'');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print $companystatic->getNomUrl(1,'',16);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -557,7 +557,7 @@ if ($resql)
|
||||
$parameters=array('arrayfields'=>$arrayfields);
|
||||
$reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.date_creation","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['c.datec']['checked'])) print_liste_field_titre($arrayfields['c.datec']['label'],$_SERVER["PHP_SELF"],"c.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['c.tms']['checked'])) print_liste_field_titre($arrayfields['c.tms']['label'],$_SERVER["PHP_SELF"],"c.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['lower_planned_end_date']['checked'])) print_liste_field_titre($arrayfields['lower_planned_end_date']['label'],$_SERVER["PHP_SELF"],"lower_planned_end_date","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
|
||||
if (! empty($arrayfields['status']['checked']))
|
||||
@ -714,7 +714,7 @@ if ($resql)
|
||||
// Date
|
||||
if (! empty($arrayfields['c.date_contrat']['checked']))
|
||||
{
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day').'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').'</td>';
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
@ -742,7 +742,7 @@ if ($resql)
|
||||
if (! empty($arrayfields['lower_planned_end_date']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day');
|
||||
print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb)
|
||||
{
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear, $startyear, (GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
|
||||
$filenamenb = $dir."/".$prefix."invoicesnbinyear-".$endyear.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$endyear.'.png';
|
||||
@ -164,7 +164,7 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot)
|
||||
{
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
|
||||
$filenamenb = $dir."/".$prefix."invoicesamountinyear-".$endyear.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$endyear.'.png';
|
||||
|
||||
@ -123,7 +123,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb)
|
||||
{
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
|
||||
$filenamenb = $dir."/".$prefix."invoicessuppliernbinyear-".$year.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
|
||||
@ -163,7 +163,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot)
|
||||
{
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
|
||||
$filenamenb = $dir."/".$prefix."invoicessupplieramountinyear-".$year.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountinyear-'.$year.'.png';
|
||||
|
||||
@ -126,7 +126,7 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb)
|
||||
{
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
|
||||
$filenamenb = $dir."/".$prefix."ordersnbinyear-".$endyear.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png';
|
||||
@ -164,7 +164,7 @@ class box_graph_orders_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot)
|
||||
{
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
|
||||
$filenamenb = $dir."/".$prefix."ordersamountinyear-".$endyear.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png';
|
||||
|
||||
@ -125,7 +125,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb)
|
||||
{
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
|
||||
$filenamenb = $dir."/".$prefix."orderssuppliernbinyear-".$endyear.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersnbinyear-'.$endyear.'.png';
|
||||
@ -163,7 +163,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot)
|
||||
{
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
|
||||
$filenamenb = $dir."/".$prefix."orderssupplieramountinyear-".$endyear.".png";
|
||||
if ($mode == 'customer') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=orderstats&file=ordersamountinyear-'.$endyear.'.png';
|
||||
|
||||
@ -123,7 +123,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($shownb)
|
||||
{
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data1 = $stats->getNbByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
$datatype1 = array_pad(array(), ($endyear-$startyear+1), 'bars');
|
||||
|
||||
$filenamenb = $dir."/".$prefix."propalsnbinyear-".$endyear.".png";
|
||||
@ -162,7 +162,7 @@ class box_graph_propales_permonth extends ModeleBoxes
|
||||
// Build graphic number of object. $data = array(array('Lib',val1,val2,val3),...)
|
||||
if ($showtot)
|
||||
{
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)));
|
||||
$data2 = $stats->getAmountByMonthWithPrevYear($endyear,$startyear,(GETPOST('action','aZ09')==$refreshaction?-1:(3600*24)), ($WIDTH<300?2:0));
|
||||
$datatype2 = array_pad(array(), ($endyear-$startyear+1), 'bars');
|
||||
//$datatype2 = array('lines','bars');
|
||||
|
||||
|
||||
@ -4505,8 +4505,10 @@ abstract class CommonObject
|
||||
//Eliminate copied source object extra_fields that do not exist in target object
|
||||
$new_array_options=array();
|
||||
foreach ($this->array_options as $key => $value) {
|
||||
if (in_array(substr($key,8), array_keys($target_extrafields))) // We remove the 'options_' from $key
|
||||
if (in_array(substr($key,8), array_keys($target_extrafields))) // We remove the 'options_' from $key for test
|
||||
$new_array_options[$key] = $value;
|
||||
elseif (in_array($key, array_keys($target_extrafields))) // We test on $key that does not contains the 'options_' prefix
|
||||
$new_array_options['options_'.$key] = $value;
|
||||
}
|
||||
|
||||
foreach($new_array_options as $key => $value)
|
||||
@ -4759,12 +4761,17 @@ abstract class CommonObject
|
||||
|
||||
$objectid = $this->id;
|
||||
|
||||
$label=$val['label'];
|
||||
$type =$val['type'];
|
||||
$size =$val['css'];
|
||||
$label= $val['label'];
|
||||
$type = $val['type'];
|
||||
$size = $val['css'];
|
||||
|
||||
// Convert var to be able to share same code than showInputField of extrafields
|
||||
if (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) int varchar
|
||||
if (preg_match('/varchar\((\d+)\)/', $type, $reg))
|
||||
{
|
||||
$type = 'varchar'; // convert varchar(xx) int varchar
|
||||
$size = $reg[1];
|
||||
}
|
||||
elseif (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) int varchar
|
||||
if (is_array($val['arrayofkeyval'])) $type='select';
|
||||
if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) $type='link';
|
||||
|
||||
@ -4833,6 +4840,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
//var_dump($showsize.' '.$size);
|
||||
|
||||
if (in_array($type,array('date','datetime')))
|
||||
{
|
||||
@ -4862,6 +4870,12 @@ abstract class CommonObject
|
||||
$out='<input type="text" class="flat '.$showsize.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam?$moreparam:'').'>';
|
||||
}
|
||||
elseif ($type == 'text')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor($keyprefix.$key.$keysuffix,$value,'',200,'dolibarr_notes','In',false,false,0,ROWS_5,'90%');
|
||||
$out=$doleditor->Create(1);
|
||||
}
|
||||
elseif ($type == 'html')
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor=new DolEditor($keyprefix.$key.$keysuffix,$value,'',200,'dolibarr_notes','In',false,false,! empty($conf->fckeditor->enabled) && $conf->global->FCKEDITOR_ENABLE_SOCIETE,ROWS_5,'90%');
|
||||
@ -5285,12 +5299,17 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
$objectid = $this->id;
|
||||
$label=$val['label'];
|
||||
$type =$val['type'];
|
||||
$size =$val['css'];
|
||||
$label = $val['label'];
|
||||
$type = $val['type'];
|
||||
$size = $val['css'];
|
||||
|
||||
// Convert var to be able to share same code than showOutputField of extrafields
|
||||
if (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) int varchar
|
||||
if (preg_match('/varchar\((\d+)\)/', $type, $reg))
|
||||
{
|
||||
$type = 'varchar'; // convert varchar(xx) int varchar
|
||||
$size = $reg[1];
|
||||
}
|
||||
elseif (preg_match('/varchar/', $type)) $type = 'varchar'; // convert varchar(xx) int varchar
|
||||
if (is_array($val['arrayofkeyval'])) $type='select';
|
||||
if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) $type='link';
|
||||
|
||||
@ -5325,20 +5344,42 @@ abstract class CommonObject
|
||||
{
|
||||
if ($type == 'date')
|
||||
{
|
||||
$showsize=10;
|
||||
//$showsize=10;
|
||||
$showsize = 'minwidth100imp';
|
||||
}
|
||||
elseif ($type == 'datetime')
|
||||
{
|
||||
$showsize=19;
|
||||
//$showsize=19;
|
||||
$showsize = 'minwidth200imp';
|
||||
}
|
||||
elseif ($type == 'int' || $type == 'integer')
|
||||
elseif (in_array($type,array('int','double','price')))
|
||||
{
|
||||
$showsize=10;
|
||||
//$showsize=10;
|
||||
$showsize = 'maxwidth75';
|
||||
}
|
||||
elseif ($type == 'url')
|
||||
{
|
||||
$showsize='minwidth400';
|
||||
}
|
||||
elseif ($type == 'boolean')
|
||||
{
|
||||
$showsize='';
|
||||
}
|
||||
else
|
||||
{
|
||||
$showsize=round($size);
|
||||
if ($showsize > 48) $showsize=48;
|
||||
if (round($size) < 12)
|
||||
{
|
||||
$showsize = 'minwidth100';
|
||||
}
|
||||
else if (round($size) <= 48)
|
||||
{
|
||||
$showsize = 'minwidth200';
|
||||
}
|
||||
else
|
||||
{
|
||||
//$showsize=48;
|
||||
$showsize = 'minwidth400';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -5579,7 +5620,7 @@ abstract class CommonObject
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($type == 'text')
|
||||
elseif ($type == 'text' || $type == 'html')
|
||||
{
|
||||
$value=dol_htmlentitiesbr($value);
|
||||
}
|
||||
|
||||
@ -271,10 +271,23 @@ class DolEditor
|
||||
$out.= ' var aceEditor = window.ace.edit("'.$this->htmlname.'aceeditorid");
|
||||
var StatusBar = window.ace.require("ace/ext/statusbar").StatusBar; // Init status bar. Need lib ext-statusbar
|
||||
var statusBar = new StatusBar(aceEditor, document.getElementById("statusBar'.$this->htmlname.'")); // Init status bar. Need lib ext-statusbar
|
||||
jQuery(".morelines'.$this->htmlname.'").click(function() {
|
||||
console.log("We click on more lines");
|
||||
var aceEditor = window.ace.edit("'.$this->htmlname.'aceeditorid");
|
||||
aceEditor.setOptions({ maxLines: 500 });
|
||||
var oldNbOfLines = 0
|
||||
jQuery(".morelines'.$this->htmlname.'").click(function() {
|
||||
var aceEditorClicked = window.ace.edit("'.$this->htmlname.'aceeditorid");
|
||||
currentline = aceEditorClicked.getOption("maxLines");
|
||||
if (oldNbOfLines == 0)
|
||||
{
|
||||
oldNbOfLines = currentline;
|
||||
}
|
||||
console.log("We click on more lines, oldNbOfLines is "+oldNbOfLines+", we have currently "+currentline);
|
||||
if (currentline < 500)
|
||||
{
|
||||
aceEditorClicked.setOptions({ maxLines: 500 });
|
||||
}
|
||||
else
|
||||
{
|
||||
aceEditorClicked.setOptions({ maxLines: oldNbOfLines });
|
||||
}
|
||||
});
|
||||
})';
|
||||
$out.= '</script>'."\n";
|
||||
|
||||
@ -145,7 +145,7 @@ class ExtraFields
|
||||
* @param string $computed Computed value
|
||||
* @param string $entity Entity of extrafields
|
||||
* @param string $langfile Language file
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list=-1, $ishidden=0, $computed='', $entity='', $langfile='')
|
||||
{
|
||||
@ -234,6 +234,7 @@ class ExtraFields
|
||||
} else {
|
||||
$typedb=$type;
|
||||
$lengthdb=$length;
|
||||
if ($type == 'varchar' && empty($lengthdb)) $lengthdb='255';
|
||||
}
|
||||
$field_desc = array(
|
||||
'type'=>$typedb,
|
||||
@ -1362,12 +1363,12 @@ class ExtraFields
|
||||
if ($type == 'date')
|
||||
{
|
||||
$showsize=10;
|
||||
$value=dol_print_date($value,'day');
|
||||
$value=dol_print_date($value, 'day', 'tzuser');
|
||||
}
|
||||
elseif ($type == 'datetime')
|
||||
{
|
||||
$showsize=19;
|
||||
$value=dol_print_date($value,'dayhour');
|
||||
$value=dol_print_date($value, 'dayhour', 'tzuser');
|
||||
}
|
||||
elseif ($type == 'int')
|
||||
{
|
||||
@ -1389,7 +1390,7 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'mail')
|
||||
{
|
||||
$value=dol_print_email($value,0,0,0,64,1,1);
|
||||
$value=dol_print_email($value, 0, 0, 0, 64, 1, 1);
|
||||
}
|
||||
elseif ($type == 'url')
|
||||
{
|
||||
@ -1401,7 +1402,7 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'price')
|
||||
{
|
||||
$value=price($value,0,$langs,0,0,-1,$conf->currency);
|
||||
$value=price($value, 0, $langs, 0, 0, -1, $conf->currency);
|
||||
}
|
||||
elseif ($type == 'select')
|
||||
{
|
||||
|
||||
@ -5462,7 +5462,7 @@ class Form
|
||||
$out.='<option value="'.$key.'"';
|
||||
$out.=$style.$disabled;
|
||||
if ($id != '' && $id == $key && ! $disabled) $out.=' selected'; // To preselect a value
|
||||
if ($nohtmlescape) $out.=' html="'.dol_escape_htmltag($selectOptionValue).'"';
|
||||
if ($nohtmlescape) $out.=' data-html="'.dol_escape_htmltag($selectOptionValue).'"';
|
||||
$out.='>';
|
||||
//var_dump($selectOptionValue);
|
||||
$out.=$selectOptionValue;
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016-2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
|
||||
* 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
|
||||
@ -958,10 +958,10 @@ class FormFile
|
||||
if ($object->element == 'invoice_supplier') $relativepath=get_exdir($object->id,2,0,0,$object,'invoice_supplier').$relativepath; // TODO Call using a defined value for $relativepath
|
||||
if ($object->element == 'project_task') $relativepath='Call_not_supported_._Call_function_using_a_defined_relative_path_.';
|
||||
}
|
||||
// For backward compatiblity, we detect file is stored into an old path
|
||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $file['level1name'] == 'photos')
|
||||
// For backward compatiblity, we detect file stored into an old path
|
||||
if (! empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO) && $filearray[0]['level1name'] == 'photos')
|
||||
{
|
||||
$relativepath=preg_replace('/^.*\/produit\//','',$file['path']).'/';
|
||||
$relativepath=preg_replace('/^.*\/produit\//','',$filearray[0]['path']).'/';
|
||||
}
|
||||
// Defined relative dir to DOL_DATA_ROOT
|
||||
$relativedir = '';
|
||||
|
||||
@ -521,9 +521,19 @@ class FormMail extends Form
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set the default "From"
|
||||
$defaultfrom='';
|
||||
$reshook=$hookmanager->executeHooks('getDefaultFromEmail', $parameters, $this);
|
||||
if (empty($reshook))
|
||||
{
|
||||
$defaultfrom = $this->fromtype;
|
||||
}
|
||||
if (! empty($hookmanager->resArray['defaultfrom'])) $defaultfrom=$hookmanager->resArray['defaultfrom'];
|
||||
|
||||
// Using combo here make the '<email>' no more visible on list.
|
||||
//$out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200onsmartphone', 1, '', $disablebademails);
|
||||
$out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200onsmartphone', 0, '', $disablebademails);
|
||||
//$out.= ' '.$form->selectarray('fromtype', $liste, $this->fromtype, 0, 0, 0, '', 0, 0, 0, '', 'fromforsendingprofile maxwidth200onsmartphone', 1, '', $disablebademails);
|
||||
$out.= ' '.$form->selectarray('fromtype', $liste, $defaultfrom, 0, 0, 0, '', 0, 0, 0, '', 'fromforsendingprofile maxwidth200onsmartphone', 0, '', $disablebademails);
|
||||
}
|
||||
|
||||
$out.= "</td></tr>\n";
|
||||
|
||||
@ -520,8 +520,8 @@ class Menubase
|
||||
$sql.= " ORDER BY m.position, m.rowid";
|
||||
//print $sql;
|
||||
|
||||
//$tmp1=microtime(true);
|
||||
//print '>>> 1 0<br>';
|
||||
//$tmp1=microtime(true);
|
||||
//print '>>> 1 0<br>';
|
||||
dol_syslog(get_class($this)."::menuLoad mymainmenu=".$mymainmenu." myleftmenu=".$myleftmenu." type_user=".$type_user." menu_handler=".$menu_handler." tabMenu size=".count($tabMenu)."", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
@ -558,7 +558,8 @@ class Menubase
|
||||
// Define $title
|
||||
if ($enabled)
|
||||
{
|
||||
$title = $langs->trans($menu['titre']);
|
||||
$title = $langs->trans($menu['titre']); // If $menu['titre'] start with $, a dol_eval is done.
|
||||
//var_dump($title.'-'.$menu['titre']);
|
||||
if ($title == $menu['titre']) // Translation not found
|
||||
{
|
||||
if (! empty($menu['langs'])) // If there is a dedicated translation file
|
||||
@ -567,6 +568,9 @@ class Menubase
|
||||
$langs->load($menu['langs']);
|
||||
}
|
||||
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$menu['titre'] = make_substitutions($menu['titre'], $substitarray);
|
||||
|
||||
if (preg_match("/\//",$menu['titre'])) // To manage translation when title is string1/string2
|
||||
{
|
||||
$tab_titre = explode("/",$menu['titre']);
|
||||
@ -584,8 +588,8 @@ class Menubase
|
||||
$title = $langs->trans($menu['titre']);
|
||||
}
|
||||
}
|
||||
//$tmp4=microtime(true);
|
||||
//print '>>> 3 '.($tmp4 - $tmp3).'<br>';
|
||||
//$tmp4=microtime(true);
|
||||
//print '>>> 3 '.($tmp4 - $tmp3).'<br>';
|
||||
|
||||
// We complete tabMenu
|
||||
$tabMenu[$b]['rowid'] = $menu['rowid'];
|
||||
|
||||
@ -39,9 +39,10 @@ abstract class Stats
|
||||
* @param int $endyear Start year
|
||||
* @param int $startyear End year
|
||||
* @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save)
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getNbByMonthWithPrevYear($endyear,$startyear,$cachedelay=0)
|
||||
function getNbByMonthWithPrevYear($endyear, $startyear, $cachedelay=0, $format=0)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
@ -76,7 +77,6 @@ abstract class Stats
|
||||
dol_syslog(get_class($this).'::'.__FUNCTION__." cache file ".$newpathofdestfile." is not found or older than now - cachedelay (".$nowgmt." - ".$cachedelay.") so we can't use it.");
|
||||
}
|
||||
}
|
||||
|
||||
// Load file into $data
|
||||
if ($foundintocache) // Cache file found and is not too old
|
||||
{
|
||||
@ -88,7 +88,7 @@ abstract class Stats
|
||||
$year=$startyear;
|
||||
while ($year <= $endyear)
|
||||
{
|
||||
$datay[$year] = $this->getNbByMonth($year);
|
||||
$datay[$year] = $this->getNbByMonth($year, $format);
|
||||
$year++;
|
||||
}
|
||||
|
||||
@ -133,9 +133,10 @@ abstract class Stats
|
||||
* @param int $endyear Start year
|
||||
* @param int $startyear End year
|
||||
* @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save)
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getAmountByMonthWithPrevYear($endyear,$startyear,$cachedelay=0)
|
||||
function getAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay=0, $format=0)
|
||||
{
|
||||
global $conf,$user,$langs;
|
||||
|
||||
@ -182,7 +183,7 @@ abstract class Stats
|
||||
$year=$startyear;
|
||||
while($year <= $endyear)
|
||||
{
|
||||
$datay[$year] = $this->getAmountByMonth($year);
|
||||
$datay[$year] = $this->getAmountByMonth($year, $format);
|
||||
$year++;
|
||||
}
|
||||
|
||||
@ -409,11 +410,13 @@ abstract class Stats
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param string $sql SQL
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is a number
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of nb each month
|
||||
*/
|
||||
function _getNbByMonth($year, $sql, $format=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result=array();
|
||||
$res=array();
|
||||
|
||||
@ -446,8 +449,11 @@ abstract class Stats
|
||||
|
||||
for ($i = 1 ; $i < 13 ; $i++)
|
||||
{
|
||||
$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),($format?"%m":"%b"));
|
||||
$month=dol_substr($month,0,3);
|
||||
if ($format == 0) $month=$langs->transnoentitiesnoconv('MonthShort'.sprintf("%02d", $i));
|
||||
elseif ($format == 1) $month=$i;
|
||||
elseif ($format == 2) $month=$langs->transnoentitiesnoconv('MonthVeryShort'.sprintf("%02d", $i));
|
||||
//$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),($format?"%m":"%b"));
|
||||
//$month=dol_substr($month,0,3);
|
||||
$data[$i-1] = array($month, $res[$i]);
|
||||
}
|
||||
|
||||
@ -460,11 +466,13 @@ abstract class Stats
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param string $sql SQL
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is a number
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array
|
||||
*/
|
||||
function _getAmountByMonth($year, $sql, $format=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result=array();
|
||||
$res=array();
|
||||
|
||||
@ -495,8 +503,11 @@ abstract class Stats
|
||||
|
||||
for ($i = 1 ; $i < 13 ; $i++)
|
||||
{
|
||||
$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),($format?"%m":"%b"));
|
||||
$month=dol_substr($month,0,3);
|
||||
if ($format == 0) $month=$langs->transnoentitiesnoconv('MonthShort'.sprintf("%02d", $i));
|
||||
elseif ($format == 1) $month=$i;
|
||||
elseif ($format == 2) $month=$langs->transnoentitiesnoconv('MonthVeryShort'.sprintf("%02d", $i));
|
||||
//$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),($format?"%m":"%b"));
|
||||
//$month=dol_substr($month,0,3);
|
||||
$data[$i-1] = array($month, $res[$i]);
|
||||
}
|
||||
|
||||
@ -508,11 +519,13 @@ abstract class Stats
|
||||
*
|
||||
* @param int $year Year
|
||||
* @param string $sql SQL
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is a number
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array
|
||||
*/
|
||||
function _getAverageByMonth($year, $sql, $format=0)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result=array();
|
||||
$res=array();
|
||||
|
||||
@ -542,8 +555,11 @@ abstract class Stats
|
||||
|
||||
for ($i = 1 ; $i < 13 ; $i++)
|
||||
{
|
||||
$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),($format?"%m":"%b"));
|
||||
$month=dol_substr($month,0,3);
|
||||
if ($format == 0) $month=$langs->transnoentitiesnoconv('MonthShort'.sprintf("%02d", $i));
|
||||
elseif ($format == 1) $month=$i;
|
||||
elseif ($format == 2) $month=$langs->transnoentitiesnoconv('MonthVeryShort'.sprintf("%02d", $i));
|
||||
//$month=dol_print_date(dol_mktime(12,0,0,$i,1,$year),($format?"%m":"%b"));
|
||||
//$month=dol_substr($month,0,3);
|
||||
$data[$i-1] = array($month, $res[$i]);
|
||||
}
|
||||
|
||||
|
||||
@ -635,7 +635,7 @@ class Translate
|
||||
}
|
||||
else // Translation is not available
|
||||
{
|
||||
if ($key[0] == '$') { return dol_eval($key,1); }
|
||||
//if ($key[0] == '$') { return dol_eval($key,1); }
|
||||
return $this->getTradFromKey($key);
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,7 +105,8 @@ print '
|
||||
li.lilevel1 {
|
||||
padding: 1em 15px 0.5em 40px;
|
||||
border-top: 1px solid #aaa;
|
||||
margin-right: 20px;
|
||||
margin-right: 0px;
|
||||
margin-left: 0px;
|
||||
border-right: 0px ! important;
|
||||
}
|
||||
li.lilevel1:first-child {
|
||||
@ -121,13 +122,13 @@ print '
|
||||
display: block;
|
||||
}
|
||||
li.lilevel2 a {
|
||||
padding: 0 15px 0.5em 40px;
|
||||
padding: 0.7em 15px 0.7em 40px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
}
|
||||
li.lilevel3 a {
|
||||
padding: 0.2em 15px 8px 60px;
|
||||
padding: 0.2em 15px 0.2em 60px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
@ -139,7 +140,7 @@ print '
|
||||
display: block;
|
||||
}
|
||||
li.lilevel5 a {
|
||||
padding: 0.2em 15px 8px 60px;
|
||||
padding: 0.2em 15px 0.2em 60px;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
|
||||
@ -1132,6 +1132,80 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate external modules mandatroy when country is country_code
|
||||
*
|
||||
* @param string $country_code CountryCode
|
||||
* @return int 1
|
||||
*/
|
||||
function activateModulesRequiredByCountry($country_code)
|
||||
{
|
||||
global $db, $conf, $langs;
|
||||
|
||||
$modulesdir = dolGetModulesDirs();
|
||||
|
||||
foreach ($modulesdir as $dir)
|
||||
{
|
||||
// Load modules attributes in arrays (name, numero, orders) from dir directory
|
||||
dol_syslog("Scan directory ".$dir." for modules");
|
||||
$handle=@opendir(dol_osencode($dir));
|
||||
if (is_resource($handle))
|
||||
{
|
||||
while (($file = readdir($handle))!==false)
|
||||
{
|
||||
if (is_readable($dir.$file) && substr($file, 0, 3) == 'mod' && substr($file, dol_strlen($file) - 10) == '.class.php')
|
||||
{
|
||||
$modName = substr($file, 0, dol_strlen($file) - 10);
|
||||
|
||||
if ($modName)
|
||||
{
|
||||
include_once $dir.$file;
|
||||
$objMod = new $modName($db);
|
||||
|
||||
if ($objMod->numero > 0)
|
||||
{
|
||||
$j = $objMod->numero;
|
||||
}
|
||||
else
|
||||
{
|
||||
$j = 1000 + $i;
|
||||
}
|
||||
|
||||
$modulequalified=1;
|
||||
|
||||
// We discard modules according to features level (PS: if module is activated we always show it)
|
||||
$const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod)));
|
||||
|
||||
if ($objMod->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
|
||||
if ($objMod->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
|
||||
if(!empty($conf->global->$const_name)) $modulequalified=0; // already activated
|
||||
|
||||
if ($modulequalified)
|
||||
{
|
||||
// Load languages files of module
|
||||
if (isset($objMod->automatic_activation) && is_array($objMod->automatic_activation) && isset($objMod->automatic_activation[$country_code]))
|
||||
{
|
||||
activateModule($modName);
|
||||
|
||||
setEventMessage($objMod->automatic_activation[$country_code],'warnings');
|
||||
}
|
||||
|
||||
}
|
||||
else dol_syslog("Module ".get_class($objMod)." not qualified");
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_syslog("htdocs/admin/modules.php: Failed to open directory ".$dir.". See permission and open_basedir option.", LOG_WARNING);
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add external modules to list of contact element
|
||||
*
|
||||
|
||||
@ -417,7 +417,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
|
||||
/* Code to add class of origin OPTION propagated to the new select2 <li> tag */
|
||||
if (data.element) { $(container).addClass($(data.element).attr("class")); }
|
||||
//console.log(data.html);
|
||||
if ($(data.element).attr("html") != undefined) return htmlEntityDecodeJs($(data.element).attr("html")); // If property html set, we decode html entities and use this
|
||||
if ($(data.element).attr("data-html") != undefined) return htmlEntityDecodeJs($(data.element).attr("data-html")); // If property html set, we decode html entities and use this
|
||||
return data.text;
|
||||
},
|
||||
templateSelection: function (selection) { /* Format visible output of selected value */
|
||||
|
||||
@ -67,8 +67,24 @@ function bank_prepare_head(Account $object)
|
||||
|
||||
if ($object->courant != Account::TYPE_CASH)
|
||||
{
|
||||
$nbReceipts=0;
|
||||
|
||||
// List of all standing receipts
|
||||
$sql = "SELECT COUNT(DISTINCT(b.num_releve)) as nb";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql.= " WHERE b.fk_account = ".$object->id;
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) $nbReceipts = $obj->nb;
|
||||
$db->free($resql);
|
||||
}
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/compta/bank/releve.php?account=".$object->id;
|
||||
$head[$h][1] = $langs->trans("AccountStatements");
|
||||
if (($nbReceipts) > 0) $head[$h][1].= ' <span class="badge">'.($nbReceipts).'</span>';
|
||||
$head[$h][2] = 'statement';
|
||||
$h++;
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ function GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NU
|
||||
}
|
||||
|
||||
// Substitution variables for GETPOST (used to get final url with variable parameters or final default value with variable paramaters)
|
||||
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOUNTRYID__, __USERID__, __ENTITYID__, ...
|
||||
// Example of variables: __DAY__, __MONTH__, __YEAR__, __MYCOMPANY_COUNTRY_ID__, __USER_ID__, ...
|
||||
// We do this only if var is a GET. If it is a POST, may be we want to post the text with vars as the setup text.
|
||||
if (! is_array($out) && empty($_POST[$paramname]) && empty($noreplace))
|
||||
{
|
||||
@ -485,7 +485,7 @@ function GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NU
|
||||
elseif ($reg[1] == 'NEXT_DAY') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_day($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['day']; }
|
||||
elseif ($reg[1] == 'NEXT_MONTH') { $tmp=dol_getdate(dol_now(), true); $tmp2=dol_get_next_month($tmp['mday'], $tmp['mon'], $tmp['year']); $newout = $tmp2['month']; }
|
||||
elseif ($reg[1] == 'NEXT_YEAR') { $tmp=dol_getdate(dol_now(), true); $newout = ($tmp['year'] + 1); }
|
||||
elseif ($reg[1] == 'MYCOUNTRY_ID' || $reg[1] == 'MYCOUNTRYID')
|
||||
elseif ($reg[1] == 'MYCOMPANY_COUNTRY_ID' || $reg[1] == 'MYCOUNTRY_ID' || $reg[1] == 'MYCOUNTRYID')
|
||||
{
|
||||
$newout = $mysoc->country_id;
|
||||
}
|
||||
@ -493,11 +493,11 @@ function GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NU
|
||||
{
|
||||
$newout = $user->id;
|
||||
}
|
||||
elseif ($reg[1] == 'SUPERVISOR_ID' || $reg[1] == 'SUPERVISORID')
|
||||
elseif ($reg[1] == 'USER_SUPERVISOR_ID' || $reg[1] == 'SUPERVISOR_ID' || $reg[1] == 'SUPERVISORID')
|
||||
{
|
||||
$newout = $user->fk_user;
|
||||
}
|
||||
elseif ($reg[1] == 'ENTITYID')
|
||||
elseif ($reg[1] == 'ENTITY_ID' || $reg[1] == 'ENTITYID')
|
||||
{
|
||||
$newout = $conf->entity;
|
||||
}
|
||||
|
||||
@ -123,7 +123,8 @@ function getURLContent($url,$postorget='GET',$param='',$followlocation=1,$addhea
|
||||
$request = curl_getinfo($ch, CURLINFO_HEADER_OUT); // Reading of request must be done after sending request
|
||||
|
||||
dol_syslog("getURLContent request=".$request);
|
||||
dol_syslog("getURLContent response=".$response);
|
||||
//dol_syslog("getURLContent response =".response); // This may contains binary data, so we dont output it
|
||||
dol_syslog("getURLContent response size=".strlen($response)); // This may contains binary data, so we dont output it
|
||||
|
||||
$rep=array();
|
||||
if (curl_errno($ch))
|
||||
@ -173,5 +174,38 @@ function getDomainFromURL($url)
|
||||
$tmpdomain = preg_replace('/\/.*$/i', '', $tmpdomain); // Remove part after domain
|
||||
$tmpdomain = preg_replace('/\.[^\.]+$/', '', $tmpdomain); // Remove first level domain (.com, .net, ...)
|
||||
$tmpdomain = preg_replace('/^[^\.]+\./', '', $tmpdomain); // Remove part www. before domain name
|
||||
|
||||
return $tmpdomain;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function root url from a long url
|
||||
* For example: https://www.abc.mydomain.com/dir/page.html return 'https://www.abc.mydomain.com'
|
||||
* For example: http://www.abc.mydomain.com/ return 'https://www.abc.mydomain.com'
|
||||
*
|
||||
* @param string $url Full URL.
|
||||
* @return string Returns root url
|
||||
*/
|
||||
function getRootURLFromURL($url)
|
||||
{
|
||||
$prefix='';
|
||||
$tmpurl = $url;
|
||||
if (preg_match('/^(https?:\/\/)/i', $tmpurl, $reg)) $prefix = $reg[1];
|
||||
$tmpurl = preg_replace('/^https?:\/\//i', '', $tmpurl); // Remove http(s)://
|
||||
$tmpurl = preg_replace('/\/.*$/i', '', $tmpurl); // Remove part after domain
|
||||
|
||||
return $prefix.$tmpurl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to remove comments into HTML content
|
||||
*
|
||||
* @param string $content Text content
|
||||
* @return string Returns text without HTML comments
|
||||
*/
|
||||
function removeHtmlComment($content)
|
||||
{
|
||||
$content = preg_replace('/<!--[^\-]+-->/', '', $content);
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
@ -243,9 +243,9 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
|
||||
{
|
||||
foreach($feature2 as $subfeature)
|
||||
{
|
||||
if (empty($user->rights->$feature->$subfeature->creer)
|
||||
&& empty($user->rights->$feature->$subfeature->write)
|
||||
&& empty($user->rights->$feature->$subfeature->create)) { $createok=0; $nbko++; }
|
||||
if (empty($user->rights->$feature->$subfeature->creer)
|
||||
&& empty($user->rights->$feature->$subfeature->write)
|
||||
&& empty($user->rights->$feature->$subfeature->create)) { $createok=0; $nbko++; }
|
||||
else { $createok=1; break; } // Break to bypass second test if the first is ok
|
||||
}
|
||||
}
|
||||
@ -308,6 +308,9 @@ function restrictedArea($user, $features, $objectid=0, $tableandshare='', $featu
|
||||
else if ($feature == 'ftp')
|
||||
{
|
||||
if (! $user->rights->ftp->write) $deleteok=0;
|
||||
}else if ($feature == 'salaries')
|
||||
{
|
||||
if (! $user->rights->salaries->delete) $deleteok=0;
|
||||
}
|
||||
else if ($feature == 'salaries')
|
||||
{
|
||||
|
||||
@ -578,7 +578,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
|
||||
}
|
||||
else
|
||||
{
|
||||
$default='ffffff';
|
||||
$default='f0f0f0';
|
||||
if ($conf->theme == 'md') $default='ffffff';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -29,14 +29,19 @@
|
||||
*
|
||||
* @param Website $website Web site object
|
||||
* @param string $content Content to replace
|
||||
* @param int $removephppart 0=Replace PHP sections with a PHP badge. 1=Remove completely PHP sections.
|
||||
* @return boolean True if OK
|
||||
*/
|
||||
function dolWebsiteReplacementOfLinks($website, $content)
|
||||
function dolWebsiteReplacementOfLinks($website, $content, $removephppart=0)
|
||||
{
|
||||
// Replace php code. Note $content may come from database and does not contains body tags.
|
||||
$replacewith='...php...';
|
||||
if ($removephppart) $replacewith='';
|
||||
$content = preg_replace('/value="<\?php((?!\?>).)*\?>\n*/ims', 'value="'.$replacewith.'"', $content);
|
||||
|
||||
$content = preg_replace('/value="<\?php((?!\?>).)*\?>\n*/ims', 'value="...php..."', $content);
|
||||
$content = preg_replace('/<\?php((?!\?>).)*\?>\n*/ims', '<span style="background: #ddd; border: 1px solid #ccc; border-radius: 4px;">...php...</span>', $content);
|
||||
$replacewith='<span style="background: #ddd; border: 1px solid #ccc; border-radius: 4px;">...php...</span>';
|
||||
if ($removephppart) $replacewith='';
|
||||
$content = preg_replace('/<\?php((?!\?>).)*\?>\n*/ims', $replacewith, $content);
|
||||
|
||||
// Replace relative link / with dolibarr URL
|
||||
$content = preg_replace('/(href=")\/\"/', '\1'.DOL_URL_ROOT.'/website/index.php?website='.$website->ref.'&pageid='.$website->fk_default_home.'"', $content, -1, $nbrep);
|
||||
@ -225,7 +230,16 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
|
||||
{
|
||||
if (preg_match('/^data:image/i', $regs[2][$key])) continue; // We do nothing for such images
|
||||
|
||||
$urltograbbis = $urltograb.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key];
|
||||
if (preg_match('/^\//', $regs[2][$key]))
|
||||
{
|
||||
$urltograbdirrootwithoutslash = getRootURLFromURL($urltograb);
|
||||
$urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot
|
||||
}
|
||||
else
|
||||
{
|
||||
$urltograbbis = $urltograb.'/'.$regs[2][$key]; // We use dir of grabbed file
|
||||
}
|
||||
|
||||
$linkwithoutdomain = $regs[2][$key];
|
||||
$filetosave = $conf->medias->multidir_output[$conf->entity].'/image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key];
|
||||
if (preg_match('/^http/', $regs[2][$key]))
|
||||
@ -251,7 +265,13 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
|
||||
if ($tmpgeturl['curl_error_no'])
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($tmpgeturl['curl_error_msg'], null, 'errors');
|
||||
setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['curl_error_msg'], null, 'errors');
|
||||
$action='create';
|
||||
}
|
||||
elseif ($tmpgeturl['http_code'] != '200')
|
||||
{
|
||||
$error++;
|
||||
setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors');
|
||||
$action='create';
|
||||
}
|
||||
else
|
||||
@ -281,7 +301,15 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
|
||||
{
|
||||
if (preg_match('/^data:image/i', $regs[2][$key])) continue; // We do nothing for such images
|
||||
|
||||
$urltograbbis = $urltograb.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key];
|
||||
if (preg_match('/^\//', $regs[2][$key]))
|
||||
{
|
||||
$urltograbdirrootwithoutslash = getRootURLFromURL($urltograb);
|
||||
$urltograbbis = $urltograbdirrootwithoutslash.$regs[2][$key]; // We use dirroot
|
||||
}
|
||||
else
|
||||
{
|
||||
$urltograbbis = $urltograb.'/'.$regs[2][$key]; // We use dir of grabbed file
|
||||
}
|
||||
|
||||
$linkwithoutdomain = $regs[2][$key];
|
||||
$filetosave = $conf->medias->multidir_output[$conf->entity].'/image/'.$object->ref.'/'.$objectpage->pageurl.(preg_match('/^\//', $regs[2][$key])?'':'/').$regs[2][$key];
|
||||
@ -309,7 +337,13 @@ function getAllImages($object, $objectpage, $urltograb, &$tmp, &$action, $modify
|
||||
if ($tmpgeturl['curl_error_no'])
|
||||
{
|
||||
$error++;
|
||||
setEventMessages($tmpgeturl['curl_error_msg'], null, 'errors');
|
||||
setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['curl_error_msg'], null, 'errors');
|
||||
$action='create';
|
||||
}
|
||||
elseif ($tmpgeturl['http_code'] != '200')
|
||||
{
|
||||
$error++;
|
||||
setEventMessages('Error getting '.$urltograbbis.': '.$tmpgeturl['http_code'], null, 'errors');
|
||||
$action='create';
|
||||
}
|
||||
else
|
||||
|
||||
@ -73,12 +73,9 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
|
||||
$showmode=dol_auguria_showmenu($type_user,$newTabMenu[$i],$listofmodulesforexternal);
|
||||
if ($showmode == 1)
|
||||
{
|
||||
// $menu_array[$i]['url'] can be a relative url, a full external url or a dynamic value like '$conf->global->APARAM)
|
||||
if (preg_match('/^\$conf->global->([^\?]+)/', $newTabMenu[$i]['url'], $reg))
|
||||
{
|
||||
$keyforsconst=$reg[1];
|
||||
$newTabMenu[$i]['url'] = $conf->global->$keyforsconst;
|
||||
}
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray);
|
||||
|
||||
$url = $shorturl = $newTabMenu[$i]['url'];
|
||||
|
||||
@ -105,11 +102,6 @@ function print_auguria_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$m
|
||||
if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/','',$shorturl);
|
||||
}
|
||||
|
||||
$url=preg_replace('/__LOGIN__/',$user->login,$url);
|
||||
$shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
|
||||
$url=preg_replace('/__USERID__/',$user->id,$url);
|
||||
$shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
|
||||
|
||||
// TODO Find a generic solution
|
||||
if (preg_match('/search_project_user=__search_project_user__/', $shorturl))
|
||||
{
|
||||
@ -511,10 +503,13 @@ function print_left_auguria_menu($db,$menu_array_before,$menu_array_after,&$tabM
|
||||
}
|
||||
}
|
||||
|
||||
// $menu_array[$i]['url'] can be a relative url, a full external url. We try substitution
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$menu_array[$i]['url'] = make_substitutions($menu_array[$i]['url'], $substitarray);
|
||||
|
||||
// Add mainmenu in GET url. This make to go back on correct menu even when using Back on browser.
|
||||
$url=dol_buildpath($menu_array[$i]['url'],1);
|
||||
$url=preg_replace('/__LOGIN__/',$user->login,$url);
|
||||
$url=preg_replace('/__USERID__/',$user->id,$url);
|
||||
|
||||
if (! preg_match('/mainmenu=/i',$menu_array[$i]['url']))
|
||||
{
|
||||
|
||||
@ -157,9 +157,11 @@ class MenuManager
|
||||
print '<li class="lilevel0">';
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$val['url'] = make_substitutions($val['url'], $substitarray);
|
||||
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
$canonurl=preg_replace('/\?.*$/','',$val['url']);
|
||||
|
||||
print '<a class="alilevel0" href="#">';
|
||||
@ -233,9 +235,11 @@ class MenuManager
|
||||
|
||||
if ($showmenu) // Visible (option to hide when not allowed is off or allowed)
|
||||
{
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$val2['url'] = make_substitutions($val2['url'], $substitarray);
|
||||
|
||||
$relurl2=dol_buildpath($val2['url'],1);
|
||||
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
|
||||
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
|
||||
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
|
||||
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
|
||||
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
|
||||
|
||||
@ -273,7 +273,6 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
|
||||
$menu->add('/adherents/index.php?mainmenu=members&leftmenu=', $langs->trans("MenuMembers"), 0, $showmode, $atarget, "members", '', 100, $id, $idsel, $classname);
|
||||
}
|
||||
|
||||
|
||||
// Show personalized menus
|
||||
$menuArbo = new Menubase($db,'eldy');
|
||||
$newTabMenu = $menuArbo->menuTopCharger('','',$type_user,'eldy',$tabMenu); // Return tabMenu with only top entries
|
||||
@ -286,6 +285,10 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
|
||||
$showmode=isVisibleToUserType($type_user,$newTabMenu[$i],$listofmodulesforexternal);
|
||||
if ($showmode == 1)
|
||||
{
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$newTabMenu[$i]['url'] = make_substitutions($newTabMenu[$i]['url'], $substitarray);
|
||||
|
||||
// url = url from host, shorturl = relative path into dolibarr sources
|
||||
$url = $shorturl = $newTabMenu[$i]['url'];
|
||||
if (! preg_match("/^(http:\/\/|https:\/\/)/i",$newTabMenu[$i]['url'])) // Do not change url content for external links
|
||||
@ -301,10 +304,6 @@ function print_eldy_menu($db,$atarget,$type_user,&$tabMenu,&$menu,$noout=0,$mode
|
||||
$shorturl = $url;
|
||||
if (DOL_URL_ROOT) $shorturl = preg_replace('/^'.preg_quote(DOL_URL_ROOT,'/').'/','',$shorturl);
|
||||
}
|
||||
$url=preg_replace('/__LOGIN__/',$user->login,$url);
|
||||
$shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
|
||||
$url=preg_replace('/__USERID__/',$user->id,$url);
|
||||
$shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
|
||||
|
||||
// Define the class (top menu selected or not)
|
||||
if (! empty($_SESSION['idmenu']) && $newTabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
|
||||
@ -518,10 +517,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$langs->load("users");
|
||||
|
||||
// Home - dashboard
|
||||
$newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fa fa-bar-chart paddingright"></i>');
|
||||
$newmenu->add("/index.php?mainmenu=home&leftmenu=home", $langs->trans("MyDashboard"), 0, 1, '', $mainmenu, 'home', 0, '', '', '', '<i class="fa fa-bar-chart fa-fw paddingright"></i>');
|
||||
|
||||
// Setup
|
||||
$newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup');
|
||||
$newmenu->add("/admin/index.php?mainmenu=home&leftmenu=setup", $langs->trans("Setup"), 0, $user->admin, '', $mainmenu, 'setup', 0, '', '', '', '<i class="fa fa-wrench fa-fw paddingright"></i>');
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="setup")
|
||||
{
|
||||
$langs->load("admin");
|
||||
@ -558,7 +557,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
}
|
||||
|
||||
// System tools
|
||||
$newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("AdminTools"), 0, $user->admin, '', $mainmenu, 'admintools');
|
||||
$newmenu->add("/admin/tools/index.php?mainmenu=home&leftmenu=admintools", $langs->trans("AdminTools"), 0, $user->admin, '', $mainmenu, 'admintools', 0, '', '', '', '<i class="fa fa-server fa-fw paddingright"></i>');
|
||||
if ($usemenuhider || empty($leftmenu) || preg_match('/^admintools/',$leftmenu))
|
||||
{
|
||||
$langs->load("admin");
|
||||
@ -591,7 +590,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
}
|
||||
}
|
||||
|
||||
$newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users');
|
||||
$newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->rights->user->user->lire, '', $mainmenu, 'users', 0, '', '', '', '<i class="fa fa-users fa-fw paddingright"></i>');
|
||||
if ($user->rights->user->user->lire)
|
||||
{
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="users")
|
||||
@ -1357,7 +1356,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm');
|
||||
$newmenu->add("/holiday/card.php?action=request", $langs->trans("New"), 1,$user->rights->holiday->write);
|
||||
$newmenu->add("/holiday/list.php?leftmenu=hrm", $langs->trans("List"), 1,$user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/list.php?select_statut=2&leftmenu=hrm", $langs->trans("ListToApprove"), 2, $user->rights->holiday->read);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?select_statut=1&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?select_statut=2&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?select_statut=3&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?select_statut=4&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="hrm") $newmenu->add("/holiday/list.php?select_statut=5&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/define_holiday.php?action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/view_log.php?action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday);
|
||||
}
|
||||
@ -1379,7 +1382,12 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$newmenu->add("/expensereport/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport');
|
||||
$newmenu->add("/expensereport/card.php?action=create&leftmenu=expensereport&mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer);
|
||||
$newmenu->add("/expensereport/list.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("List"), 1, $user->rights->expensereport->lire);
|
||||
$newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("ListToApprove"), 2, $user->rights->expensereport->approve);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=0&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Draft"), 2, $user->rights->expensereport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=2&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Validated"), 2, $user->rights->expensereport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=5&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Approved"), 2, $user->rights->expensereport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=6&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Paid"), 2, $user->rights->expensereport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->rights->expensereport->lire);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu=="expensereport") $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->rights->expensereport->lire);
|
||||
$newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire);
|
||||
}
|
||||
|
||||
@ -1598,12 +1606,10 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
}
|
||||
}
|
||||
|
||||
// $menu_array[$i]['url'] can be a relative url, a full external url or a dynamic value like '$conf->global->APARAM)
|
||||
if (preg_match('/^\$conf->global->([^\?]+)/', $menu_array[$i]['url'], $reg))
|
||||
{
|
||||
$keyforsconst=$reg[1];
|
||||
$menu_array[$i]['url'] = $conf->global->$keyforsconst;
|
||||
}
|
||||
// $menu_array[$i]['url'] can be a relative url, a full external url. We try substitution
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$menu_array[$i]['url'] = make_substitutions($menu_array[$i]['url'], $substitarray);
|
||||
|
||||
$url = $shorturl = $menu_array[$i]['url'];
|
||||
|
||||
@ -1626,11 +1632,8 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
$url = dol_buildpath($url,1).($param?'?'.$param:'');
|
||||
$shorturl = $shorturl.($param?'?'.$param:'');
|
||||
}
|
||||
//var_dump($url);
|
||||
|
||||
$url=preg_replace('/__LOGIN__/',$user->login,$url);
|
||||
$shorturl=preg_replace('/__LOGIN__/',$user->login,$shorturl);
|
||||
$url=preg_replace('/__USERID__/',$user->id,$url);
|
||||
$shorturl=preg_replace('/__USERID__/',$user->id,$shorturl);
|
||||
|
||||
print '<!-- Process menu entry with mainmenu='.$menu_array[$i]['mainmenu'].', leftmenu='.$menu_array[$i]['leftmenu'].', level='.$menu_array[$i]['level'].' enabled='.$menu_array[$i]['enabled'].', position='.$menu_array[$i]['position'].' -->'."\n";
|
||||
|
||||
@ -1656,6 +1659,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Menu level > 0
|
||||
if ($menu_array[$i]['level'] > 0)
|
||||
{
|
||||
|
||||
@ -165,9 +165,11 @@ class MenuManager
|
||||
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$val['url'] = make_substitutions($val['url'], $substitarray);
|
||||
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
$canonurl=preg_replace('/\?.*$/','',$val['url']);
|
||||
|
||||
print '<a class="alilevel0" href="#">';
|
||||
@ -243,9 +245,11 @@ class MenuManager
|
||||
|
||||
if ($showmenu) // Visible (option to hide when not allowed is off or allowed)
|
||||
{
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$val2['url'] = make_substitutions($val2['url'], $substitarray);
|
||||
|
||||
$relurl2=dol_buildpath($val2['url'],1);
|
||||
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
|
||||
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
|
||||
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
|
||||
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
|
||||
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
|
||||
|
||||
@ -150,11 +150,13 @@ class MenuManager
|
||||
print '<ul class="ulmenu" data-inset="true">';
|
||||
print '<li class="lilevel0">';
|
||||
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$val['url'] = make_substitutions($val['url'], $substitarray);
|
||||
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
$canonurl=preg_replace('/\?.*$/','',$val['url']);
|
||||
|
||||
print '<a class="alilevel0" href="#">';
|
||||
@ -249,9 +251,11 @@ class MenuManager
|
||||
|
||||
if ($showmenu) // Visible (option to hide when not allowed is off or allowed)
|
||||
{
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$val2['url'] = make_substitutions($val2['url'], $substitarray);
|
||||
|
||||
$relurl2=dol_buildpath($val2['url'],1);
|
||||
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
|
||||
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
|
||||
$canonurl2=preg_replace('/\?.*$/','',$val2['url']);
|
||||
//var_dump($val2['url'].' - '.$canonurl2.' - '.$val2['level']);
|
||||
if (in_array($canonurl2,array('/admin/index.php','/admin/tools/index.php','/core/tools.php'))) $relurl2='';
|
||||
@ -447,11 +451,14 @@ class MenuManager
|
||||
{
|
||||
print '<ul class="ulmenu" data-inset="true">';
|
||||
print '<li class="lilevel0">';
|
||||
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$val['url'] = make_substitutions($val['url'], $substitarray);
|
||||
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
$relurl=preg_replace('/__LOGIN__/',$user->login,$relurl);
|
||||
$relurl=preg_replace('/__USERID__/',$user->id,$relurl);
|
||||
|
||||
print '<a href="#">'.$val['titre'].'</a>'."\n";
|
||||
// Search submenu fot this entry
|
||||
@ -474,9 +481,11 @@ class MenuManager
|
||||
}
|
||||
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
$substitarray = array('__LOGIN__' => $user->login, '__USER_ID__' => $user->id, '__USER_SUPERVISOR_ID__' => $user->fk_user);
|
||||
$substitarray['__USERID__'] = $user->id; // For backward compatibility
|
||||
$val2['url'] = make_substitutions($val2['url'], $substitarray);
|
||||
|
||||
$relurl2=dol_buildpath($val2['url'],1);
|
||||
$relurl2=preg_replace('/__LOGIN__/',$user->login,$relurl2);
|
||||
$relurl2=preg_replace('/__USERID__/',$user->id,$relurl2);
|
||||
//var_dump($val2);
|
||||
print '<li><a href="'.$relurl2.'">'.$val2['titre'].'</a></li>'."\n";
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ class modBlockedLog extends DolibarrModules
|
||||
*/
|
||||
function __construct($db)
|
||||
{
|
||||
global $langs,$conf;
|
||||
global $langs,$conf,$mysoc;
|
||||
|
||||
$this->db = $db;
|
||||
$this->numero = 3200;
|
||||
@ -69,11 +69,25 @@ class modBlockedLog extends DolibarrModules
|
||||
$this->depends = array('always'=>'modFacture'); // List of modules id that must be enabled if this module is enabled
|
||||
$this->requiredby = array(); // List of modules id to disable if this one is disabled
|
||||
$this->conflictwith = array(); // List of modules id this module is in conflict with
|
||||
$this->langfiles = array();
|
||||
$this->langfiles = array('blockedlog');
|
||||
|
||||
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
|
||||
$this->warnings_unactivation = array('FR'=>'BlockedLogAreRequiredByYourCountryLegislation');
|
||||
|
||||
// Currently, activation is not automatic because only companies (in France) making invoices to non business customers must
|
||||
// enable this module.
|
||||
// It is automatic only if $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY is on.
|
||||
if (! empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY))
|
||||
{
|
||||
$this->automatic_activation = array('FR'=>'BlockedLogActivatedBecauseRequiredByYourCountryLegislation');
|
||||
}
|
||||
|
||||
$this->always_enabled = !empty($conf->blockedlog->enabled) && !empty($conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY) && in_array($mysoc->country_code, explode(',', $conf->global->BLOCKEDLOG_DISABLE_NOT_ALLOWED_FOR_COUNTRY));
|
||||
|
||||
// Constants
|
||||
//-----------
|
||||
|
||||
$this->const = array();
|
||||
|
||||
// New pages on tabs
|
||||
// -----------------
|
||||
@ -87,4 +101,51 @@ class modBlockedLog extends DolibarrModules
|
||||
//------------------
|
||||
$this->menu = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if module was already used before unactivation linked to warnings_unactivation property
|
||||
*/
|
||||
function alreadyUsed() {
|
||||
|
||||
$res = $this->db->query("SELECT count(*) as nb FROM ".MAIN_DB_PREFIX."blockedlog");
|
||||
if($res!==false) {
|
||||
$obj = $this->db->fetch_object($res);
|
||||
return ($obj->nb > 0);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function called when module is disabled.
|
||||
* The remove function removes tabs, constants, boxes, permissions and menus from Dolibarr database.
|
||||
* Data directories are not deleted
|
||||
*
|
||||
* @param string $options Options when enabling module ('', 'noboxes')
|
||||
* @return int 1 if OK, 0 if KO
|
||||
*/
|
||||
function remove($options = '') {
|
||||
|
||||
global $user;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/blockedlog/class/blockedlog.class.php';
|
||||
|
||||
$object=new stdClass;
|
||||
$object->id = 1;
|
||||
$object->element = 'module';
|
||||
$object->ref = 'module';
|
||||
$object->date = time();
|
||||
|
||||
$b=new BlockedLog($this->db);
|
||||
$b->setObjectData($object, 'MODULE_RESET', -1);
|
||||
|
||||
$res = $b->create($user);
|
||||
if($res<=0) {
|
||||
$this->error = $b->error;
|
||||
return $res;
|
||||
}
|
||||
|
||||
return $this->_remove(array(), $options);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ class modExternalSite extends DolibarrModules
|
||||
$this->menu[$r]=array(
|
||||
'fk_menu'=>0,
|
||||
'type'=>'top',
|
||||
'titre'=>'$conf->global->EXTERNALSITE_LABEL',
|
||||
'titre'=>'__[EXTERNALSITE_LABEL]__',
|
||||
'mainmenu'=>'externalsite',
|
||||
'url'=>'/externalsite/frames.php',
|
||||
'langs'=>'other',
|
||||
|
||||
@ -50,7 +50,6 @@ class modUser extends DolibarrModules
|
||||
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
|
||||
$this->name = preg_replace('/^mod/i','',get_class($this));
|
||||
$this->description = "Gestion des utilisateurs (requis)";
|
||||
$this->always_enabled = true; // Can't be disabled
|
||||
|
||||
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
|
||||
$this->version = 'dolibarr';
|
||||
@ -69,6 +68,7 @@ class modUser extends DolibarrModules
|
||||
$this->depends = array();
|
||||
$this->requiredby = array();
|
||||
$this->langfiles = array("main","users","companies","members",'salaries');
|
||||
$this->always_enabled = true; // Can't be disabled
|
||||
|
||||
// Constants
|
||||
$this->const = array();
|
||||
@ -204,13 +204,13 @@ class modUser extends DolibarrModules
|
||||
$this->rights[$r][4] = 'user';
|
||||
$this->rights[$r][5] = 'export';
|
||||
|
||||
|
||||
|
||||
// Menus
|
||||
//-------
|
||||
|
||||
|
||||
$this->menu = 1; // This module add menu entries. They are coded into menu manager.
|
||||
|
||||
|
||||
|
||||
|
||||
// Exports
|
||||
//--------
|
||||
$r=0;
|
||||
@ -230,7 +230,7 @@ class modUser extends DolibarrModules
|
||||
$this->export_sql_start[$r]='SELECT DISTINCT ';
|
||||
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'user as u';
|
||||
$this->export_sql_end[$r] .=' WHERE u.entity IN ('.getEntity('user').')';
|
||||
|
||||
|
||||
// Imports
|
||||
//--------
|
||||
$r=0;
|
||||
@ -266,7 +266,7 @@ class modUser extends DolibarrModules
|
||||
$this->import_regex_array[$r]=array('u.employee'=>'^[0|1]','u.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$');
|
||||
$this->import_examplevalues_array[$r]=array('u.lastname'=>"Doe",'u.firstname'=>'John','u.login'=>'jdoe','u.employee'=>'0 or 1','u.status'=>"0 (closed) or 1 (active)",'u.fk_soc'=>'0 (internal user) or company name (external user)','u.datec'=>dol_print_date(dol_now(),'%Y-%m-%d'),'u.address'=>"61 jump street",'u.zip'=>"123456",'u.town'=>"Big town",'u.fk_country'=>'US, FR, DE...','u.office_phone'=>"0101010101",'u.office_fax'=>"0101010102",'u.email'=>"test@mycompany.com",'u.salary'=>"10000",'u.note'=>"This is an example of note for record",'u.datec'=>"2015-01-01 or 2015-01-01 12:30:00");
|
||||
$this->import_updatekeys_array[$r]=array('u.lastname'=>'Lastname','u.firstname'=>'Firstname','u.login'=>'Login');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ if ($action == 'presend')
|
||||
{
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
$outputlangs->load('commercial');
|
||||
$outputlangs->loadLangs(array('commercial','bills','orders','contracts','members','propal','supplier_proposal','interventions'));
|
||||
}
|
||||
|
||||
$topicmail='';
|
||||
@ -98,7 +98,7 @@ if ($action == 'presend')
|
||||
|
||||
dol_fiche_head('');
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
// Create form for email
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->param['langsmodels']=(empty($newlang)?$langs->defaultlang:$newlang);
|
||||
|
||||
@ -35,14 +35,14 @@ foreach($object->fields as $key => $val)
|
||||
print '<td';
|
||||
print ' class="titlefieldcreate';
|
||||
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||
if ($val['type'] == 'text') print ' tdtop';
|
||||
if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop';
|
||||
print '"';
|
||||
print '>';
|
||||
print $langs->trans($val['label']);
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (in_array($val['type'], array('int', 'integer'))) $value = GETPOST($key, 'int');
|
||||
elseif ($val['type'] == 'text') $value = GETPOST($key, 'none');
|
||||
elseif ($val['type'] == 'text' || $val['type'] == 'html') $value = GETPOST($key, 'none');
|
||||
else $value = GETPOST($key, 'alpha');
|
||||
print $object->showInputField($val, $key, $value, '', '', '', 0);
|
||||
print '</td>';
|
||||
|
||||
@ -34,13 +34,14 @@ foreach($object->fields as $key => $val)
|
||||
print '<tr><td';
|
||||
print ' class="titlefieldcreate';
|
||||
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||
if ($val['type'] == 'text') print ' tdtop';
|
||||
if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop';
|
||||
print '"';
|
||||
print '>'.$langs->trans($val['label']).'</td>';
|
||||
print '<td>';
|
||||
if (in_array($val['type'], array('int', 'integer'))) $value = GETPOSTISSET($key)?GETPOST($key, 'int'):$object->$key;
|
||||
elseif ($val['type'] == 'text') $value = GETPOSTISSET($key)?GETPOST($key,'none'):$object->$key;
|
||||
elseif ($val['type'] == 'text' || $val['type'] == 'html') $value = GETPOSTISSET($key)?GETPOST($key,'none'):$object->$key;
|
||||
else $value = GETPOSTISSET($key)?GETPOST($key, 'alpha'):$object->$key;
|
||||
//var_dump($val.' '.$key.' '.$value);
|
||||
print $object->showInputField($val, $key, $value, '', '', '', 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
* $action
|
||||
* $conf
|
||||
* $langs
|
||||
*
|
||||
* $keyforbreak may be defined to key to switch on second column
|
||||
*/
|
||||
?>
|
||||
<!-- BEGIN PHP TEMPLATE commonfields_view.tpl.php -->
|
||||
@ -37,6 +39,7 @@ foreach($object->fields as $key => $val)
|
||||
print '<tr><td';
|
||||
print ' class="titlefield';
|
||||
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||
if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop';
|
||||
print '"';
|
||||
print '>'.$langs->trans($val['label']).'</td>';
|
||||
print '<td>';
|
||||
@ -45,7 +48,7 @@ foreach($object->fields as $key => $val)
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
//if ($key == 'targetsrcfile3') break; // key used for break on second column
|
||||
if (! empty($keyforbreak) && $key == $keyforbreak) break; // key used for break on second column
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
@ -60,7 +63,7 @@ foreach($object->fields as $key => $val)
|
||||
{
|
||||
if ($alreadyoutput)
|
||||
{
|
||||
//if ($key == 'targetsrcfile3') $alreadyoutput = 0; // key used for break on second column
|
||||
if (! empty($keyforbreak) && $key == $keyforbreak) $alreadyoutput = 0; // key used for break on second column
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -73,6 +76,7 @@ foreach($object->fields as $key => $val)
|
||||
print '<tr><td';
|
||||
print ' class="titlefield';
|
||||
if ($val['notnull'] > 0) print ' fieldrequired';
|
||||
if ($val['type'] == 'text' || $val['type'] == 'html') print ' tdtop';
|
||||
print '"';
|
||||
print '>'.$langs->trans($val['label']).'</td>';
|
||||
print '<td>';
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to show all columns of extrafields from $obj, $extrafields and $db
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
@ -10,7 +11,15 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
if ($align) print ' align="'.$align.'"';
|
||||
print '>';
|
||||
$tmpkey='options_'.$key;
|
||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '');
|
||||
if (in_array($extrafields->attribute_type[$key], array('date', 'datetime', 'timestamp')))
|
||||
{
|
||||
$value = $db->jdate($obj->$tmpkey);
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = $obj->$tmpkey;
|
||||
}
|
||||
print $extrafields->showOutputField($key, $value, '');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! empty($val['isameasure']))
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to show all columns of extrafields for the search title line
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to complete $param for extrafields
|
||||
foreach ($search_array_options as $key => $val)
|
||||
{
|
||||
$crit=$val;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to complete the sql search criterias from extrafields
|
||||
foreach ($search_array_options as $key => $val)
|
||||
{
|
||||
$crit=$val;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to show all columns of extrafields for the title line
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
|
||||
@ -42,7 +42,7 @@ class DonationStats extends Stats
|
||||
var $from;
|
||||
var $field;
|
||||
var $where;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -55,13 +55,13 @@ class DonationStats extends Stats
|
||||
function __construct($db, $socid, $mode, $userid=0)
|
||||
{
|
||||
global $user, $conf;
|
||||
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
|
||||
$this->socid = ($socid > 0 ? $socid : 0);
|
||||
$this->userid = $userid;
|
||||
$this->cachefilesuffix = $mode;
|
||||
|
||||
$this->cachefilesuffix = $mode;
|
||||
|
||||
$object=new Don($this->db);
|
||||
$this->from = MAIN_DB_PREFIX.$object->table_element." as d";
|
||||
//$this->from.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
@ -77,9 +77,10 @@ class DonationStats extends Stats
|
||||
* Return shipment number by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array with number by month
|
||||
*/
|
||||
function getNbByMonth($year)
|
||||
function getNbByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -90,7 +91,7 @@ class DonationStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
$res=$this->_getNbByMonth($year, $sql, $format);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ class ExpeditionStats extends Stats
|
||||
var $from;
|
||||
var $field;
|
||||
var $where;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -55,13 +55,13 @@ class ExpeditionStats extends Stats
|
||||
function __construct($db, $socid, $mode, $userid=0)
|
||||
{
|
||||
global $user, $conf;
|
||||
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
|
||||
$this->socid = ($socid > 0 ? $socid : 0);
|
||||
$this->userid = $userid;
|
||||
$this->cachefilesuffix = $mode;
|
||||
|
||||
$this->cachefilesuffix = $mode;
|
||||
|
||||
$object=new Expedition($this->db);
|
||||
$this->from = MAIN_DB_PREFIX.$object->table_element." as c";
|
||||
//$this->from.= ", ".MAIN_DB_PREFIX."societe as s";
|
||||
@ -82,9 +82,10 @@ class ExpeditionStats extends Stats
|
||||
* Return shipment number by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array with number by month
|
||||
*/
|
||||
function getNbByMonth($year)
|
||||
function getNbByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -96,7 +97,7 @@ class ExpeditionStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
$res=$this->_getNbByMonth($year, $sql, $format);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
@ -60,9 +60,9 @@ class ExpenseReportStats extends Stats
|
||||
$this->field='total_ht';
|
||||
|
||||
//$this->where = " e.fk_statut > 0";
|
||||
//$this->where.= " AND e.date_valid > '2000-01-01'"; // To filter only correct "valid date". If date is invalid, the group by on it will fails. Launch a repair.php if you have.
|
||||
//$this->where.= " AND e.date_valid > '2000-01-01'"; // To filter only correct "valid date". If date is invalid, the group by on it will fails. Launch a repair.php if you have.
|
||||
$this->where.= ' e.entity IN ('.getEntity('expensereport').')';
|
||||
|
||||
|
||||
//$this->where.= " AND entity = ".$conf->entity;
|
||||
if ($this->socid)
|
||||
{
|
||||
@ -100,10 +100,11 @@ class ExpenseReportStats extends Stats
|
||||
/**
|
||||
* Renvoie le nombre de facture par mois pour une annee donnee
|
||||
*
|
||||
* @param string $year Year to scan
|
||||
* @return array Array of values
|
||||
* @param string $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getNbByMonth($year)
|
||||
function getNbByMonth($year, $format=0)
|
||||
{
|
||||
$sql = "SELECT MONTH(".$this->db->ifsql('e.date_valid IS NULL','e.date_create','e.date_valid').") as dm, count(*)";
|
||||
$sql.= " FROM ".$this->from;
|
||||
@ -112,7 +113,7 @@ class ExpenseReportStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
$res=$this->_getNbByMonth($year, $sql, $format);
|
||||
//var_dump($res);print '<br>';
|
||||
return $res;
|
||||
}
|
||||
@ -122,9 +123,10 @@ class ExpenseReportStats extends Stats
|
||||
* Renvoie le montant de facture par mois pour une annee donnee
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array of values
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
function getAmountByMonth($year, $format=0)
|
||||
{
|
||||
$sql = "SELECT date_format(".$this->db->ifsql('e.date_valid IS NULL','e.date_create','e.date_valid').",'%m') as dm, sum(".$this->field.")";
|
||||
$sql.= " FROM ".$this->from;
|
||||
@ -133,7 +135,7 @@ class ExpenseReportStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getAmountByMonth($year, $sql);
|
||||
$res=$this->_getAmountByMonth($year, $sql, $format);
|
||||
//var_dump($res);print '<br>';
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -54,7 +54,6 @@ if ($action == 'update')
|
||||
|
||||
$i+=dolibarr_set_const($db,'EXTERNALSITE_LABEL',trim($label),'chaine',0,'',$conf->entity);
|
||||
$i+=dolibarr_set_const($db,'EXTERNALSITE_URL',trim($exturl),'chaine',0,'',$conf->entity);
|
||||
//$i+=dolibarr_set_const($db,'EXTERNALSITE_LABEL',trim($_POST["EXTERNALSITE_LABEL"]),'chaine',0,'',$conf->entity);
|
||||
|
||||
if ($i >= 2)
|
||||
{
|
||||
|
||||
@ -59,8 +59,8 @@ class FichinterStats extends Stats
|
||||
|
||||
$this->socid = ($socid > 0 ? $socid : 0);
|
||||
$this->userid = $userid;
|
||||
$this->cachefilesuffix = $mode;
|
||||
|
||||
$this->cachefilesuffix = $mode;
|
||||
|
||||
$this->where.= " c.entity = ".$conf->entity;
|
||||
if ($mode == 'customer')
|
||||
{
|
||||
@ -83,9 +83,10 @@ class FichinterStats extends Stats
|
||||
* Return intervention number by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array with number by month
|
||||
*/
|
||||
function getNbByMonth($year)
|
||||
function getNbByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -97,7 +98,7 @@ class FichinterStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getNbByMonth($year, $sql);
|
||||
$res=$this->_getNbByMonth($year, $sql, $format);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -124,10 +125,11 @@ class FichinterStats extends Stats
|
||||
/**
|
||||
* Return the intervention amount by month for a year
|
||||
*
|
||||
* @param int $year Year to scan
|
||||
* @return array Array with amount by month
|
||||
* @param int $year Year to scan
|
||||
* @param int $format 0=Label of absiss is a translated text, 1=Label of absiss is month number, 2=Label of absiss is first letter of month
|
||||
* @return array Array with amount by month
|
||||
*/
|
||||
function getAmountByMonth($year)
|
||||
function getAmountByMonth($year, $format=0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -139,7 +141,7 @@ class FichinterStats extends Stats
|
||||
$sql.= " GROUP BY dm";
|
||||
$sql.= $this->db->order('dm','DESC');
|
||||
|
||||
$res=$this->_getAmountByMonth($year, $sql);
|
||||
$res=$this->_getAmountByMonth($year, $sql, $format);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@ -205,6 +207,6 @@ class FichinterStats extends Stats
|
||||
|
||||
return $this->_getAllByProduct($sql);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2186,10 +2186,10 @@ elseif (! empty($object->id))
|
||||
}
|
||||
}
|
||||
// Create event
|
||||
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
/*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
|
||||
}
|
||||
}*/
|
||||
|
||||
// Modify
|
||||
if ($object->statut == 1)
|
||||
|
||||
@ -2832,10 +2832,10 @@ else
|
||||
}
|
||||
|
||||
// Create event
|
||||
if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
/*if ($conf->agenda->enabled && ! empty($conf->global->MAIN_ADD_EVENT_ON_ELEMENT_CARD)) // Add hidden condition because this is not a "workflow" action so should appears somewhere else on page.
|
||||
{
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create&origin=' . $object->element . '&originid=' . $object->id . '&socid=' . $object->socid . '">' . $langs->trans("AddAction") . '</a></div>';
|
||||
}
|
||||
}*/
|
||||
|
||||
// Clone
|
||||
if ($action != 'edit' && $user->rights->fournisseur->facture->creer)
|
||||
|
||||
@ -500,6 +500,14 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->to_p
|
||||
$dashboardlines[] = $board->load_board($user,'topay');
|
||||
}
|
||||
|
||||
$object=new stdClass();
|
||||
$parameters=array();
|
||||
$action='';
|
||||
$reshook=$hookmanager->executeHooks('addOpenElementsDashboardLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook == 0) {
|
||||
$dashboardlines = array_merge($dashboardlines, $hookmanager->resArray);
|
||||
}
|
||||
|
||||
// Calculate total nb of late
|
||||
$totallate=$totaltodo=0;
|
||||
$var=true;
|
||||
@ -551,7 +559,7 @@ if (! empty($valid_dashboardlines))
|
||||
$boxwork.='<tr class="nohover"><td class="tdboxstats nohover flexcontainer centpercent">';
|
||||
foreach($valid_dashboardlines as $board)
|
||||
{
|
||||
if (empty($boad->nbtodo)) $nbworkboardempty++;
|
||||
if (empty($board->nbtodo)) $nbworkboardempty++;
|
||||
|
||||
$textlate = $langs->trans("NActionsLate",$board->nbtodolate);
|
||||
$textlate.= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')';
|
||||
|
||||
@ -370,7 +370,7 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA32', 1204, '', 0, '', 'Province de Driouch', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA33', 1204, '', 0, '', 'Province de Figuig', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA34', 1204, '', 0, '', 'Province de Jerada', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA35', 1204, '', 0, '', 'Province de Nadorgg', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA35', 1204, '', 0, '', 'Province de Nador', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA36', 1204, '', 0, '', 'Province de Taourirt', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA37', 1216, '', 0, '', 'Province d''Aousserd', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA38', 1216, '', 0, '', 'Province d''Oued Ed-Dahab', 1);
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
|
||||
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
-- Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@zendsi.com>
|
||||
-- Copyright (C) 2015-2017 Juanjo Menent <jmenent@2byte.es>
|
||||
--
|
||||
@ -29,7 +29,7 @@
|
||||
--
|
||||
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('VT', 'Sale Journal', 2, 1);
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('AC', 'Purhcase Journal', 3, 1);
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('AC', 'Purchase Journal', 3, 1);
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('BQ', 'Bank Journal', 4, 1);
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('OD', 'Other Journal', 1, 1);
|
||||
INSERT INTO llx_accounting_journal (code, label, nature, active) VALUES ('AN', 'Has new Journal', 9, 1);
|
||||
|
||||
@ -120,7 +120,7 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7116,'PCG','IMMO','XXXXXX','2351',7115,'Mobilier de bureau','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7117,'PCG','IMMO','XXXXXX','2352',7115,'Matériel de bureau','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7118,'PCG','IMMO','XXXXXX','2355',7115,'Matériel Informatique','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7119,'PCG','IMMO','XXXXXX','2356',7115,'Agencement, installations et aménagements divers (de biens n'appartenant pas à l''entreprise)','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7119,'PCG','IMMO','XXXXXX','2356',7115,'Agencement, installations et aménagements divers (de biens n''appartenant pas à l''entreprise)','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7120,'PCG','IMMO','XXXXXX','2358',7115,'Autres mobiliers, matériel de bureau et aménagements divers','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7121,'PCG','IMMO','XXXXXX','238',7090,'Autres immobilisations corporelles','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7122,'PCG','IMMO','XXXXXX','239',7090,'Immobilisations corporelles en cours','1');
|
||||
@ -648,7 +648,7 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7644,'PCG','EXPENSE','XXXXXX','6581',7643,'Pénalités sur marchés et dédits','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7645,'PCG','EXPENSE','XXXXXX','65811',7644,'Pénalités sur marchés','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7646,'PCG','EXPENSE','XXXXXX','65812',7644,'Dédits','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7647,'PCG','EXPENSE','XXXXXX','6582',7643,'Rappels d''impôts (autres qu'impôts sur les résultats)','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7647,'PCG','EXPENSE','XXXXXX','6582',7643,'Rappels d''impôts (autres qu''impôts sur les résultats)','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7648,'PCG','EXPENSE','XXXXXX','6583',7643,'Pénalités et amendes fiscales ou pénales','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7649,'PCG','EXPENSE','XXXXXX','65831',7648,'Pénalités et amendes fiscales ou pénales','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7650,'PCG','EXPENSE','XXXXXX','65833',7648,'Pénalités et amendes pénales','1');
|
||||
@ -806,7 +806,7 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7802,'PCG','INCOME','XXXXXX','7581',7801,'Pénalités et dédits reçus','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7803,'PCG','INCOME','XXXXXX','75811',7802,'Pénalités reçus sur marché','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7804,'PCG','INCOME','XXXXXX','75812',7802,'Dédits reçus','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7805,'PCG','INCOME','XXXXXX','7582',7801,'Dégrèvements d''impôts (autres qu'impôts sur résultat)','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7805,'PCG','INCOME','XXXXXX','7582',7801,'Dégrèvements d''impôts (autres qu''impôts sur résultat)','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7806,'PCG','INCOME','XXXXXX','7585',7801,'Rentrées sur créances soldées','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7807,'PCG','INCOME','XXXXXX','7586',7801,'Dons, libéralités et lots reçus','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7808,'PCG','INCOME','XXXXXX','75861',7807,'Dons','1');
|
||||
@ -833,11 +833,11 @@ INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7829,'PCG','INCOME','XXXXXX','7597',7812,'Transfert de charges non courantes','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7830,'PCG','INCOME','XXXXXX','7598',7812,'Reprises non courantes des exercices antérieurs','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7831,'PCG','RESU','XXXXXX','8','','Comptes de résultats','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7832,'PCG','RESU','XXXXXX','81',7831,'Résultat s'exploitation','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7832,'PCG','RESU','XXXXXX','81',7831,'Résultat d''exploitation','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7833,'PCG','RESU','XXXXXX','811',7832,'Marge brute','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7834,'PCG','RESU','XXXXXX','814',7832,'Valeur ajoutée','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7835,'PCG','RESU','XXXXXX','817',7832,'Excédent brut s'exploitation','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7836,'PCG','RESU','XXXXXX','8171',7835,'Excédent brut s'exploitation (créditeur)','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7835,'PCG','RESU','XXXXXX','817',7832,'Excédent brut d''exploitation','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7836,'PCG','RESU','XXXXXX','8171',7835,'Excédent brut d''exploitation (créditeur)','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7837,'PCG','RESU','XXXXXX','8179',7835,'Insuffusance brute d''exploitation (débiteur)','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7838,'PCG','RESU','XXXXXX','83',7831,'Résultat financier','1');
|
||||
INSERT INTO llx_accounting_account (rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (7839,'PCG','RESU','XXXXXX','84',7831,'Résultat courant','1');
|
||||
|
||||
@ -541,8 +541,8 @@ INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype,
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9536,'PCT','INCOME','XXXXXX','7','','Produits','1');
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9537,'PCT','INCOME','XXXXXX','70',9536,'Ventes de produits fabriqués, prestations de services, marchandises','1');
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9538,'PCT','INCOME','XXXXXX','701',9537,'Ventes de produits finis','1');
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9539,'PCT','INCOME','XXXXXX','7011',,'Produits finis achevés','1');
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9540,'PCT','INCOME','XXXXXX','7012',,'Produits finis non achevés (contrat de longue durée)','1');
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9539,'PCT','INCOME','XXXXXX','7011','','Produits finis achevés','1');
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9540,'PCT','INCOME','XXXXXX','7012','','Produits finis non achevés (contrat de longue durée)','1');
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9541,'PCT','INCOME','XXXXXX','702',9537,'Ventes de produits intermédiaires','1');
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9542,'PCT','INCOME','XXXXXX','703',9537,'Ventes de produits résiduels','1');
|
||||
INSERT INTO llx_accounting_account(rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number, account_parent, label, active) VALUES (9543,'PCT','INCOME','XXXXXX','704',9537,'Travaux','1');
|
||||
|
||||
@ -26,22 +26,22 @@
|
||||
-- Coef expense
|
||||
--
|
||||
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (1,4, 1, 0.41, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (2,4, 2, 0.244, 824);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (3,4, 3, 0.286, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (1,4, 1, 0.41, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (2,4, 2, 0.244, 824);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (3,4, 3, 0.286, 0);
|
||||
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (4,5, 4, 0.493, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (5,5, 5, 0.277, 1082);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (6,5, 6, 0.332, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (4,5, 4, 0.493, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (5,5, 5, 0.277, 1082);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (6,5, 6, 0.332, 0);
|
||||
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (7,6, 7, 0.543, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (8,6, 8, 0.305, 1180);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (9,6, 9, 0.364, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (7,6, 7, 0.543, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (8,6, 8, 0.305, 1180);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (9,6, 9, 0.364, 0);
|
||||
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (10,7, 10, 0.568, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (11,7, 11, 0.32, 1244);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (12,7, 12, 0.382, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (10,7, 10, 0.568, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (11,7, 11, 0.32, 1244);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (12,7, 12, 0.382, 0);
|
||||
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (13,8, 13, 0.595, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (14,8, 14, 0.337, 1288);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, offset) values (15,8, 15, 0.401, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (13,8, 13, 0.595, 0);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (14,8, 14, 0.337, 1288);
|
||||
INSERT INTO llx_expensereport_ik (rowid,fk_c_exp_tax_cat, fk_range, coef, ikoffset) values (15,8, 15, 0.401, 0);
|
||||
@ -248,7 +248,7 @@ INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, nc
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA32', 1204, '', 0, '', 'Province de Driouch', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA33', 1204, '', 0, '', 'Province de Figuig', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA34', 1204, '', 0, '', 'Province de Jerada', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA35', 1204, '', 0, '', 'Province de Nadorgg', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA35', 1204, '', 0, '', 'Province de Nador', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA36', 1204, '', 0, '', 'Province de Taourirt', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA37', 1216, '', 0, '', 'Province d''Aousserd', 1);
|
||||
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES('MA38', 1216, '', 0, '', 'Province d''Oued Ed-Dahab', 1);
|
||||
|
||||
@ -50,7 +50,7 @@ CREATE TABLE llx_accounting_bookkeeping_tmp
|
||||
journal_label varchar(255), -- FEC:JournalLib
|
||||
piece_num integer NOT NULL, -- FEC:EcritureNum
|
||||
validated tinyint DEFAULT 0 NOT NULL, -- | 0 line not validated / 1 line validated (No deleting / No modification)
|
||||
date_validated datetime -- FEC:ValidDate
|
||||
date_validated datetime, -- FEC:ValidDate
|
||||
import_key varchar(14),
|
||||
extraparams varchar(255) -- for other parameters with json format
|
||||
) ENGINE=innodb;
|
||||
|
||||
@ -26,7 +26,7 @@ CREATE TABLE llx_blockedlog
|
||||
amounts double(24,8) NOT NULL,
|
||||
element varchar(50),
|
||||
fk_user integer,
|
||||
user_fullname varchar(255);
|
||||
user_fullname varchar(255),
|
||||
fk_object integer,
|
||||
ref_object varchar(255),
|
||||
date_object datetime,
|
||||
|
||||
@ -26,7 +26,7 @@ create table llx_user
|
||||
ref_ext varchar(50), -- reference into an external system (not used by dolibarr)
|
||||
ref_int varchar(50), -- reference into an internal system (deprecated)
|
||||
|
||||
employee tinyint DEFAULT 1, -- 1 if user is an employee
|
||||
employee tinyint DEFAULT 1, -- 1 if user is an employee
|
||||
fk_establishment integer DEFAULT 0,
|
||||
|
||||
datec datetime,
|
||||
@ -34,21 +34,21 @@ create table llx_user
|
||||
fk_user_creat integer,
|
||||
fk_user_modif integer,
|
||||
login varchar(50) NOT NULL,
|
||||
pass_encoding varchar(24);
|
||||
pass_encoding varchar(24),
|
||||
pass varchar(128),
|
||||
pass_crypted varchar(128),
|
||||
pass_temp varchar(128), -- temporary password when asked for forget password
|
||||
pass_temp varchar(128), -- temporary password when asked for forget password
|
||||
api_key varchar(128), -- key to use REST API by this user
|
||||
gender varchar(10),
|
||||
civility varchar(6),
|
||||
lastname varchar(50),
|
||||
firstname varchar(50),
|
||||
address varchar(255), -- user personal address
|
||||
zip varchar(25), -- zipcode
|
||||
town varchar(50), -- town
|
||||
fk_state integer DEFAULT 0, --
|
||||
fk_country integer DEFAULT 0, --
|
||||
birth date, -- birthday
|
||||
address varchar(255), -- user personal address
|
||||
zip varchar(25), -- zipcode
|
||||
town varchar(50), -- town
|
||||
fk_state integer DEFAULT 0,
|
||||
fk_country integer DEFAULT 0,
|
||||
birth date, -- birthday
|
||||
job varchar(128),
|
||||
skype varchar(255),
|
||||
office_phone varchar(20),
|
||||
@ -62,7 +62,7 @@ create table llx_user
|
||||
fk_soc integer,
|
||||
fk_socpeople integer,
|
||||
fk_member integer,
|
||||
fk_user integer, -- Hierarchic parent
|
||||
fk_user integer, -- Hierarchic parent
|
||||
note_public text,
|
||||
note text DEFAULT NULL,
|
||||
model_pdf varchar(255) DEFAULT NULL,
|
||||
@ -72,22 +72,22 @@ create table llx_user
|
||||
ldap_sid varchar(255) DEFAULT NULL,
|
||||
openid varchar(255),
|
||||
statut tinyint DEFAULT 1,
|
||||
photo varchar(255), -- filename or url of photo
|
||||
photo varchar(255), -- filename or url of photo
|
||||
lang varchar(6),
|
||||
color varchar(6),
|
||||
barcode varchar(255) DEFAULT NULL,
|
||||
fk_barcode_type integer DEFAULT 0,
|
||||
accountancy_code varchar(32) NULL,
|
||||
nb_holiday integer DEFAULT 0,
|
||||
nb_holiday integer DEFAULT 0,
|
||||
thm double(24,8),
|
||||
tjm double(24,8),
|
||||
|
||||
salary double(24,8), -- denormalized value coming from llx_user_employment
|
||||
salaryextra double(24,8), -- denormalized value coming from llx_user_employment
|
||||
dateemployment date, -- denormalized value coming from llx_user_employment
|
||||
weeklyhours double(16,8), -- denormalized value coming from llx_user_employment
|
||||
salary double(24,8), -- denormalized value coming from llx_user_employment
|
||||
salaryextra double(24,8), -- denormalized value coming from llx_user_employment
|
||||
dateemployment date, -- denormalized value coming from llx_user_employment
|
||||
weeklyhours double(16,8), -- denormalized value coming from llx_user_employment
|
||||
|
||||
import_key varchar(14), -- import key
|
||||
import_key varchar(14), -- import key
|
||||
default_range integer,
|
||||
default_c_exp_tax_cat integer
|
||||
)ENGINE=innodb;
|
||||
|
||||
@ -244,7 +244,6 @@ ErrorAccountingJournalIsAlreadyUse=This journal is already use
|
||||
## Export
|
||||
ExportDraftJournal=Export draft journal
|
||||
Modelcsv=Model of export
|
||||
OptionsDeactivatedForThisExportModel=For this export model, options are deactivated
|
||||
Selectmodelcsv=Select a model of export
|
||||
Modelcsv_normal=Classic export
|
||||
Modelcsv_CEGID=Export towards CEGID Expert Comptabilité
|
||||
@ -254,7 +253,7 @@ Modelcsv_ciel=Export towards Sage Ciel Compta or Compta Evolution
|
||||
Modelcsv_quadratus=Export towards Quadratus QuadraCompta
|
||||
Modelcsv_ebp=Export towards EBP
|
||||
Modelcsv_cogilog=Export towards Cogilog
|
||||
Modelcsv_agiris=Export towards Agiris (Test)
|
||||
Modelcsv_agiris=Export towards Agiris
|
||||
Modelcsv_configurable=Export Configurable
|
||||
ChartofaccountsId=Chart of accounts Id
|
||||
|
||||
|
||||
@ -1765,3 +1765,4 @@ ResourceSetup=Configuration du module Resource
|
||||
UseSearchToSelectResource=Use a search form to choose a resource (rather than a drop-down list).
|
||||
DisabledResourceLinkUser=Disabled resource link to user
|
||||
DisabledResourceLinkContact=Disabled resource link to contact
|
||||
ConfirmUnactivation=Confirm module reset
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
BlockedLog=Non Reversible Logs
|
||||
BlockedLog=Unalterable Logs
|
||||
Field=Field
|
||||
BlockedLogDesc=This module tracks some events into a non reversible log (that you can't modify once recorded) into a block chain, in real time. This module provides compatibility with requirements of laws of some countries (like France with the law Fincance 2016 - Norme NF535).
|
||||
BlockedLogDesc=This module tracks some events into an unalterable log (that you can't modify once recorded) into a block chain, in real time. This module provides compatibility with requirements of laws of some countries (like France with the law Fincance 2016 - Norme NF535).
|
||||
Fingerprints=Archived events and fingerprints
|
||||
FingerprintsDesc=Archived business events and fingerprints
|
||||
CompanyInitialKey=Company initial key (hash of genesis block)
|
||||
@ -26,4 +26,7 @@ DownloadLogCSV=Download archive logs (CSV)
|
||||
logDOC_PREVIEW=Preview of a validated document in order to print or download
|
||||
logDOC_DOWNLOAD=Download of a validated document in order to print or send
|
||||
DataOfArchivedEvent=Full datas of archived event
|
||||
ImpossibleToReloadObject=Object (type %s, id %s) removed
|
||||
ImpossibleToReloadObject=Object (type %s, id %s) removed
|
||||
BlockedLogAreRequiredByYourCountryLegislation=Unalterable Logs module may be required by the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit.
|
||||
BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Unalterable Logs module was activated because of the legislation of your country. Disabling this module may render any future transactions invalid with respect to the law and the use of legal software as they can not be validated by a tax audit.
|
||||
BlockedLogDisableNotAllowedForCountry=Disable not allowed for this countries
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user