Merge remote-tracking branch 'upstream/develop' into 16b4-php8_1

This commit is contained in:
Alexandre SPANGARO 2022-06-19 06:47:29 +02:00
commit 0903f390c1
320 changed files with 1766 additions and 1376 deletions

View File

@ -275,6 +275,13 @@ RESTLER:
with
$loaders = array_unique(static::$rogueLoaders, SORT_REGULAR);
* Replace CommentParser.php line 423
elseif (count($value) && is_numeric($value[0]))
with
elseif (count($value) && isset($value[0]) && is_numeric($value[0]))
+With swagger 2 provided into /explorer:

View File

@ -7,7 +7,7 @@
# To run the fix manually: cd ~/git/dolibarr; phpcbf -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true "fileordir"
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep -v '/includes/'| grep \\\\.php`
DIRPHPCS=""
AUTOFIX=1

View File

@ -98,7 +98,6 @@ if (!empty($conf->loan->enabled)) {
$list_account[] = 'ACCOUNTING_ACCOUNT_SUSPENSE';
if (!empty($conf->societe->enabled)) {
$list_account[] = '---Deposits---';
$list_account[] = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT';
}
/*
@ -106,7 +105,7 @@ if (!empty($conf->societe->enabled)) {
*/
if ($action == 'update') {
$error = 0;
// Process $list_account_main
foreach ($list_account_main as $constname) {
$constvalue = GETPOST($constname, 'alpha');
@ -114,7 +113,7 @@ if ($action == 'update') {
$error++;
}
}
// Process $list_account
foreach ($list_account as $constname) {
$reg = array();
if (preg_match('/---(.*)---/', $constname, $reg)) { // This is a separator
@ -128,6 +127,13 @@ if ($action == 'update') {
}
}
$constname = 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT';
$constvalue = GETPOST($constname, 'int');
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}
if (!$error) {
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
} else {
@ -246,10 +252,24 @@ foreach ($list_account as $key) {
}
}
// Customer deposit account
print '<tr class="oddeven value">';
// Param
print '<td>';
print img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT');
print '</td>';
// Value
print '<td class="right">'; // Do not force class=right, or it align also the content of the select box
print $formaccounting->select_account(getDolGlobalString('ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT'), 'ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT', 1, '', 1, 1, 'minwidth100 maxwidth300 maxwidthonsmartphone', 'accounts');
print '</td>';
print '</tr>';
if (!empty($conf->societe->enabled)) {
print '<tr class="oddeven">';
print '<td>' . img_picto('', 'bill', 'class="pictofixedwidth"') . $langs->trans("UseAuxiliaryAccountOnCustomerDeposit") . '</td>';
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT)) {
if (getDolGlobalInt('ACCOUNTING_ACCOUNT_CUSTOMER_USE_AUXILIARY_ON_DEPOSIT')) {
print '<td class="right"><a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?token=' . newToken() . '&action=setdisableauxiliaryaccountoncustomerdeposit&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', 'warning');
print '</a></td>';
@ -264,7 +284,7 @@ if (!empty($conf->societe->enabled)) {
print "</table>\n";
print "</div>\n";
print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Modify').'"></div>';
print '<div class="center"><input type="submit" class="button button-edit" name="button" value="'.$langs->trans('Save').'"></div>';
print '</form>';

View File

@ -1,9 +1,9 @@
<?php
/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
/* Copyright (C) 2013 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.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
@ -174,7 +174,9 @@ if ($action == 'validatehistory') {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_sell_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_sell_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity);
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND l.product_type <= 2";
$sql .= " AND f.entity IN (".getEntity('invoice', 0).")"; // We don't share object for accountancy
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}

View File

@ -305,8 +305,16 @@ if ($result) {
// get_url may return -1 which is not traversable
if (is_array($links) && count($links) > 0) {
$is_sc = false;
foreach ($links as $v) {
if ($v['type'] == 'sc') {
$is_sc = true;
break;
}
}
// Now loop on each link of record in bank (code similar to bankentries_list.php)
foreach ($links as $key => $val) {
if ($links[$key]['type'] == 'user' && !$is_sc) continue;
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
// So we excluded 'company' and 'user' here. We want only payment lines

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2021 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2013-2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
@ -171,8 +171,10 @@ if ($action == 'validatehistory') {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa ON " . $alias_product_perentity . ".accountancy_code_buy = aa.account_number AND aa.active = 1 AND aa.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa.entity = ".$conf->entity;
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa2 ON " . $alias_product_perentity . ".accountancy_code_buy_intra = aa2.account_number AND aa2.active = 1 AND aa2.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa2.entity = ".$conf->entity;
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa3 ON " . $alias_product_perentity . ".accountancy_code_buy_export = aa3.account_number AND aa3.active = 1 AND aa3.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa3.entity = ".$conf->entity;
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0 AND l.product_type <= 2 AND f.entity = ".((int) $conf->entity);
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND l.product_type <= 2";
$sql .= " AND f.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
@ -373,10 +375,14 @@ $sql .= " AND ff.fk_statut > 0";
$sql .= " AND ffd.product_type <= 2";
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
$sql .= " AND aa.account_number IS NULL";
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.")";
} else {
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.",".FactureFournisseur::TYPE_REPLACEMENT.",".FactureFournisseur::TYPE_CREDIT_NOTE.",".FactureFournisseur::TYPE_DEPOSIT.")";
}
$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label";
$sql .= ' ORDER BY aa.account_number';
dol_syslog('htdocs/accountancy/supplier/index.php');
dol_syslog('htdocs/accountancy/supplier/index.php', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
@ -474,11 +480,17 @@ $sql .= " AND ff.datef <= '".$db->idate($search_date_end)."'";
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
$sql .= " AND ff.fk_statut > 0";
$sql .= " AND ffd.product_type <= 2";
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")";
} else {
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")";
}
$sql .= " AND aa.account_number IS NOT NULL";
$sql .= " GROUP BY ffd.fk_code_ventilation,aa.account_number,aa.label";
$sql .= ' ORDER BY aa.account_number';
dol_syslog('htdocs/accountancy/supplier/index.php');
$resql = $db->query($sql);
@ -494,13 +506,15 @@ if ($resql) {
print length_accountg($row[0]);
}
print '</td>';
print '<td>';
print '<td class="left">';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
} else {
print $row[1];
}
print '</td>';
for ($i = 2; $i <= 13; $i++) {
print '<td class="right nowraponall amount">';
print price($row[$i]);
@ -523,7 +537,6 @@ print "</table>\n";
print '</div>';
if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange. Why showing a report that should rely on result of this step ?
print '<br>';
print '<br>';
@ -560,9 +573,14 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
$sql .= " AND ff.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
$sql .= " AND ff.fk_statut > 0";
$sql .= " AND ffd.product_type <= 2";
$sql .= " AND ff.entity IN (".getEntity('facture_fourn', 0).")"; // We don't share object for accountancy
if (!empty($conf->global->FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS)) {
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.")";
} else {
$sql .= " AND ff.type IN (".FactureFournisseur::TYPE_STANDARD.", ".FactureFournisseur::TYPE_REPLACEMENT.", ".FactureFournisseur::TYPE_CREDIT_NOTE.", ".FactureFournisseur::TYPE_DEPOSIT.")";
}
dol_syslog('htdocs/accountancy/supplier/index.php');
$resql = $db->query($sql);

View File

@ -511,7 +511,7 @@ $tabcond[25] = !empty($conf->website->enabled);
//$tabcond[26]= !empty($conf->product->enabled);
$tabcond[27] = !empty($conf->societe->enabled);
$tabcond[28] = !empty($conf->holiday->enabled);
$tabcond[29] = !empty($conf->projet->enabled);
$tabcond[29] = !empty($conf->project->enabled);
$tabcond[30] = !empty($conf->label->enabled);
//$tabcond[31]= !empty($conf->accounting->enabled);
$tabcond[32] = (!empty($conf->holiday->enabled) || !empty($conf->hrm->enabled));

View File

@ -550,7 +550,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
'recordjoinpiece'=>'AttachJoinedDocumentsToObject',
'recordevent'=>'RecordEvent');
$arrayoftypesnocondition = $arrayoftypes;
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$arrayoftypes['project'] = 'CreateLeadAndThirdParty';
}
$arrayoftypesnocondition['project'] = 'CreateLeadAndThirdParty';

View File

@ -148,7 +148,7 @@ if ($action == 'updateMask') {
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
$res3 = 0;
if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
if (!empty($conf->project->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
$res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
}
@ -471,7 +471,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
print '</td></tr>'."\n";
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
print '<tr class="oddeven"><td>';
print $langs->trans('ProjectIsRequiredOnExpenseReports');
print '</td><td class="right">';

View File

@ -99,6 +99,8 @@ if ($action == 'update') {
$error = 0;
if ($mode == 'template') {
//dolibarr_del_const($db, "MAIN_THEME", 0); // To be sure we don't have this constant set for all entities
dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", getDolGlobalInt('MAIN_IHM_PARAMS_REV') + 1, 'chaine', 0, '', $conf->entity);

View File

@ -185,7 +185,7 @@ if (!empty($conf->recruitment->enabled) && !empty($user->rights->recruitment->re
if (!empty($conf->societe->enabled) && !empty($user->rights->societe->lire)) {
$elementList['thirdparty'] = img_picto('', 'company', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToThirdparty'));
}
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$elementList['project'] = img_picto('', 'project', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToProject'));
}
if (!empty($conf->propal->enabled) && !empty($user->rights->propal->lire)) {

View File

@ -108,7 +108,7 @@ if ($action == 'update') {
dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
}
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
if (GETPOST('PDF_SHOW_PROJECT_REF_OR_LABEL') == 'no') {
dolibarr_del_const($db, "PDF_SHOW_PROJECT", $conf->entity);
dolibarr_del_const($db, "PDF_SHOW_PROJECT_TITLE", $conf->entity);
@ -482,7 +482,7 @@ print '<input type="text" class="maxwidth50" name="MAIN_DOCUMENTS_LOGO_HEIGHT" v
print '</td></tr>';
// Show project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
print '<tr class="oddeven"><td>'.$langs->trans("PDF_SHOW_PROJECT").'</td><td>';
$tmparray = array('no' => 'No', 'showprojectref' => 'RefProject', 'showprojectlabel' => 'ShowProjectLabel');
$showprojectref = empty($conf->global->PDF_SHOW_PROJECT) ? (empty($conf->global->PDF_SHOW_PROJECT_TITLE) ? 'no' : 'showprojectlabel') : 'showprojectref';

View File

@ -95,7 +95,7 @@ $tabfield[1] = "ref,description,virtualhost,position,date_creation";
// Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue = array();
$tabfieldvalue[1] = "ref,description,virtualhost,position";
$tabfieldvalue[1] = "ref,description,virtualhost,position,entity";
// Nom des champs dans la table pour insertion d'un enregistrement
$tabfieldinsert = array();

View File

@ -300,7 +300,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
// Clone
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&socid=' . $object->socid . '&action=clone&token=' . newToken(), '', $permissiontoadd);
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'] . '?id=' . $object->id . (!empty($socid) ? '&socid=' . $socid : '') . '&action=clone&token=' . newToken(), '', $permissiontoadd);
// Delete (need delete permission, or if draft, just need create/modify permission)
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'] . '?id=' . $object->id . '&action=delete&token=' . newToken(), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));

View File

@ -150,7 +150,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
if (! empty($conf->project->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';

View File

@ -476,7 +476,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $soc->getNomUrl(1);
// Project
if (! empty($conf->projet->enabled))
if (! empty($conf->project->enabled))
{
$langs->load("projects");
$morehtmlref.='<br>'.$langs->trans('Project') . ' ';

View File

@ -175,11 +175,10 @@ class Categorie extends CommonObject
);
/**
* @var array Object table mapping from type string (table llx_...) when value of key does not match table name.
*
* @note Move to const array when PHP 5.6 will be our minimum target
* @var array Object table mapping from type string (table llx_...) when value of key does not match table name.
* This array may be completed by external modules with hook "constructCategory"
*/
public static $MAP_OBJ_TABLE = array(
public $MAP_OBJ_TABLE = array(
'customer' => 'societe',
'supplier' => 'societe',
'member' => 'adherent',

View File

@ -1234,7 +1234,7 @@ if ($action == 'create') {
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$projectid = GETPOST('projectid', 'int');
@ -1737,7 +1737,7 @@ if ($id > 0) {
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
print '<tr><td class="titlefieldcreate">'.$langs->trans("Project").'</td><td>';
@ -1762,7 +1762,7 @@ if ($id > 0) {
print '<tr>';
print '<td>'.$langs->trans("LinkedObject").'</td>';
if ($object->elementtype == 'task' && !empty($conf->projet->enabled)) {
if ($object->elementtype == 'task' && !empty($conf->project->enabled)) {
print '<td id="project-task-input-container" >';
$urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility
@ -1946,7 +1946,7 @@ if ($id > 0) {
// Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
$morehtmlref .= $langs->trans('Project').' ';

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -159,7 +159,7 @@ if ($object->id > 0) {
// Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
$morehtmlref .= $langs->trans('Project').': ';

View File

@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -848,7 +848,6 @@ if ($resql) {
$event->fk_project = $obj->fk_project;
$event->socid = $obj->fk_soc;
$event->thirdparty_id = $obj->fk_soc;
$event->contact_id = $obj->fk_contact;
// Defined date_start_in_calendar and date_end_in_calendar property

View File

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -86,7 +86,7 @@ $morehtmlref = '<div class="refidno">';
// Thirdparty
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
//$morehtmlref.='<br>'.$langs->trans('Project') . ' ';
$morehtmlref .= $langs->trans('Project').': ';

View File

@ -987,10 +987,10 @@ while ($i < $imaxinloop) {
if (!empty($arrayfields['a.datep']['checked'])) {
print '<td class="center nowraponall">';
if (empty($obj->fulldayevent)) {
print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuser');
print dol_print_date($db->jdate($obj->dp), $formatToUse, 'tzuserrel');
} else {
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser'));
print dol_print_date($db->jdate($obj->dp), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuserrel'));
}
$late = 0;
if ($actionstatic->hasDelay() && $actionstatic->percentage >= 0 && $actionstatic->percentage < 100 ) {
@ -1006,10 +1006,10 @@ while ($i < $imaxinloop) {
if (!empty($arrayfields['a.datep2']['checked'])) {
print '<td class="center nowraponall">';
if (empty($obj->fulldayevent)) {
print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuser');
print dol_print_date($db->jdate($obj->dp2), $formatToUse, 'tzuserrel');
} else {
$tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT');
print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuser'));
print dol_print_date($db->jdate($obj->dp2), $formatToUse, ($tzforfullday ? $tzforfullday : 'tzuserrel'));
}
print '</td>';
}
@ -1091,11 +1091,11 @@ while ($i < $imaxinloop) {
// Date creation
if (!empty($arrayfields['a.datec']['checked'])) {
// Status/Percent
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuser').'</td>';
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour', 'tzuserrel').'</td>';
}
// Date update
if (!empty($arrayfields['a.tms']['checked'])) {
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuser').'</td>';
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem), 'dayhour', 'tzuserrel').'</td>';
}
if (!empty($arrayfields['a.percent']['checked'])) {
// Status/Percent

View File

@ -78,7 +78,7 @@ if (!empty($conf->expedition->enabled)) {
if (isModEnabled('facture')) {
$langs->load("bills");
}
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
}
if (!empty($conf->ficheinter->enabled)) {

View File

@ -640,10 +640,10 @@ if ($object->fetch($id) >= 0) {
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td class="tdoverflowmax150">'.img_picto('$obj->email', 'email', 'class="paddingright"').$obj->email.'</td>';
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">'.$obj->lastname.'</td>';
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">'.$obj->firstname.'</td>';
print '<td>'.$obj->other.'</td>';
print '<td class="tdoverflowmax150">'.img_picto('$obj->email', 'email', 'class="paddingright"').dol_escape_htmltag($obj->email).'</td>';
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->lastname).'">'.dol_escape_htmltag($obj->lastname).'</td>';
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">'.dol_escape_htmltag($obj->firstname).'</td>';
print '<td>'.dol_escape_htmltag($obj->other).'</td>';
print '<td class="center tdoverflowmax150">';
if (empty($obj->source_id) || empty($obj->source_type)) {
print empty($obj->source_url) ? '' : $obj->source_url; // For backward compatibility

View File

@ -50,7 +50,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/signature.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -124,7 +124,7 @@ $usercancreateorder = $user->rights->commande->creer;
$usercancreateinvoice = $user->rights->facture->creer;
$usercancreatecontract = $user->rights->contrat->creer;
$usercancreateintervention = $user->hasRight('ficheinter', 'creer');
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
$usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $usercancreate; // Used by the include of actions_dellink.inc.php
@ -1522,7 +1522,7 @@ $form = new Form($db);
$formfile = new FormFile($db);
$formpropal = new FormPropal($db);
$formmargin = new FormMargin($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@ -1779,7 +1779,7 @@ if ($action == 'create') {
print '</td></tr>';
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
print '<tr class="field_projectid">';
print '<td class="titlefieldcreate">'.$langs->trans("Project").'</td><td class="valuefieldcreate">';
@ -2211,7 +2211,7 @@ if ($action == 'create') {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/comm/propal/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherProposals").'</a>)';
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br><span class="paddingrightonly">'.$langs->trans('Project').'</span>';
if ($usercancreate) {

View File

@ -297,7 +297,7 @@ class Propal extends CommonObject
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>22),
'ref_ext' =>array('type'=>'varchar(255)', 'label'=>'RefExt', 'enabled'=>1, 'visible'=>0, 'position'=>40),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'position'=>23),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>24),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>24),
'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>25),
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
'datep' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
@ -1367,7 +1367,7 @@ class Propal extends CommonObject
$object->mode_reglement_id = (!empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
$object->fk_delivery_address = '';
/*if (!empty($conf->projet->enabled))
/*if (!empty($conf->project->enabled))
{
$project = new Project($db);
if ($this->fk_project > 0 && $project->fetch($this->fk_project)) {

View File

@ -137,7 +137,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -136,7 +136,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {

View File

@ -28,7 +28,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {

View File

@ -204,8 +204,8 @@ $checkedtypetiers = 0;
$arrayfields = array(
'p.ref'=>array('label'=>"Ref", 'checked'=>1),
'p.ref_client'=>array('label'=>"RefCustomer", 'checked'=>1),
'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
'pr.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)),
'pr.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1)),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1),
's.town'=>array('label'=>"Town", 'checked'=>-1),

View File

@ -29,7 +29,7 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -107,7 +107,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {

View File

@ -48,7 +48,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->propal->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -1492,7 +1492,7 @@ $form = new Form($db);
$formfile = new FormFile($db);
$formorder = new FormOrder($db);
$formmargin = new FormMargin($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@ -1755,8 +1755,7 @@ if ($action == 'create' && $usercancreate) {
// Shipping Method
if (isModEnabled('expedition')) {
print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
print img_picto('', 'object_dolly', 'class="pictofixedwidth"');
print $form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
print img_picto('', 'object_dolly', 'class="pictofixedwidth"').$form->selectShippingMethod($shipping_method_id, 'shipping_method_id', '', 1, '', 0, 'maxwidth200 widthcentpercentminusx');
print '</td></tr>';
}
@ -1778,7 +1777,7 @@ if ($action == 'create' && $usercancreate) {
// TODO How record was recorded OrderMode (llx_c_input_method)
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
print '<tr>';
print '<td>'.$langs->trans("Project").'</td><td>';
@ -2246,7 +2245,7 @@ if ($action == 'create' && $usercancreate) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/commande/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherOrders").'</a>)';
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($usercancreate) {

View File

@ -314,7 +314,7 @@ class Commande extends CommonOrder
'ref_int' =>array('type'=>'varchar(255)', 'label'=>'RefInt', 'enabled'=>1, 'visible'=>0, 'position'=>27), // deprecated
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>20),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>25),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>25),
'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60),
'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62),
'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
@ -2123,9 +2123,9 @@ class Commande extends CommonOrder
$line->product_ref = $objp->product_ref;
$line->product_label = $objp->product_label;
$line->product_desc = $objp->product_desc;
$line->product_tosell = $objp->product_tosell;
$line->product_tobuy = $objp->product_tobuy;
$line->product_desc = $objp->product_desc;
$line->product_tobatch = $objp->product_tobatch;
$line->product_barcode = $objp->product_barcode;

View File

@ -131,7 +131,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {

View File

@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -130,7 +130,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {

View File

@ -27,7 +27,7 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -83,7 +83,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {

View File

@ -165,8 +165,8 @@ $checkedtypetiers = 0;
$arrayfields = array(
'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20),
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>20),
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>25),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31),
's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35),
@ -1821,8 +1821,9 @@ if ($resql) {
$total_ht = 0;
$total_margin = 0;
$imaxinloop = ($limit ? min($num, $limit) : $num);
$last_num = min($num, $limit);
while ($i < $last_num) {
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
$notshippable = 0;
@ -2457,6 +2458,17 @@ if ($resql) {
// Show total line
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
// If no record found
if ($num == 0) {
$colspan = 1;
foreach ($arrayfields as $key => $val) {
if (!empty($val['checked'])) {
$colspan++;
}
}
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
}
$db->free($resql);
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);

View File

@ -28,7 +28,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/order.lib.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -102,7 +102,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {

View File

@ -1206,7 +1206,7 @@ class Account extends CommonObject
* Return current sold
*
* @param int $option 1=Exclude future operation date (this is to exclude input made in advance and have real account sold)
* @param tms $date_end Date until we want to get bank account sold
* @param int $date_end Date until we want to get bank account sold
* @param string $field dateo or datev
* @return int current sold (value date <= today)
*/

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -311,7 +311,7 @@ $form = new Form($db);
if (!empty($conf->accounting->enabled)) {
$formaccounting = new FormAccounting($db);
}
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@ -481,7 +481,7 @@ if ($action == 'create') {
print '</td></tr>';
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
// Associated project
@ -553,7 +553,7 @@ if ($id) {
$morehtmlref = '<div class="refidno">';
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->banque->modifier) {

View File

@ -97,7 +97,7 @@ if ($object->id) {
$morehtmlref = '<div class="refidno">';
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' : ';
if ($user->rights->banque->modifier && 0) {

View File

@ -57,7 +57,7 @@ print dol_get_fiche_head($head, 'info', $langs->trans("VariousPayment"), -1, $ob
$morehtmlref = '<div class="refidno">';
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= $langs->trans('Project').' : ';
if ($user->rights->banque->modifier && 0) {

View File

@ -161,7 +161,7 @@ $arrayfields = array(
'datep' =>array('label'=>"DatePayment", 'checked'=>1, 'position'=>120),
'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130),
'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140),
'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->projet->enabled)),
'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->project->enabled)),
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>!empty($conf->banque->enabled)),
'entry' =>array('label'=>"BankTransactionLine", 'checked'=>1, 'position'=>310, "enabled"=>!empty($conf->banque->enabled)),
'account' =>array('label'=>"AccountAccountingShort", 'checked'=>1, 'position'=>400, "enabled"=>!empty($conf->accounting->enabled)),

View File

@ -29,7 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/trip.lib.php';
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -422,7 +422,7 @@ if ($action == 'create') {
print '</td></tr>';
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load('projects');
print '<tr>';
print '<td>';

View File

@ -34,7 +34,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture-rec.class.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
//include_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
}
@ -924,7 +924,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), $help_url);
$form = new Form($db);
$formother = new FormOther($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
$companystatic = new Societe($db);
@ -954,7 +954,7 @@ if ($action == 'create') {
print dol_get_fiche_head(null, '', '', 0);
$rowspan = 4;
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$rowspan++;
}
if ($object->fk_account > 0) {
@ -1047,7 +1047,7 @@ if ($action == 'create') {
}
// Project
if (!empty($conf->projet->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
if (!empty($conf->project->enabled) && is_object($object->thirdparty) && $object->thirdparty->id > 0) {
$projectid = GETPOST('projectid') ?GETPOST('projectid') : $object->fk_project;
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td>';
@ -1203,7 +1203,7 @@ if ($action == 'create') {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {

View File

@ -54,7 +54,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (!empty($conf->commande->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
}
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -1030,7 +1030,7 @@ if (empty($reshook)) {
$object->date = $dateinvoice;
$object->date_pointoftax = $date_pointoftax;
$object->note_public = trim(GETPOST('note_public', 'restricthtml'));
// We do not copy the private note
$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
$object->ref_client = GETPOST('ref_client', 'alphanohtml');
$object->model_pdf = GETPOST('model', 'alphanohtml');
$object->fk_project = GETPOST('projectid', 'int');
@ -1083,7 +1083,7 @@ if (empty($reshook)) {
$object->date = $dateinvoice;
$object->date_pointoftax = $date_pointoftax;
$object->note_public = trim(GETPOST('note_public', 'restricthtml'));
// We do not copy the private note
$object->note_private = trim(GETPOST('note_private', 'restricthtml'));
$object->ref_client = GETPOST('ref_client');
$object->model_pdf = GETPOST('model');
$object->fk_project = GETPOST('projectid', 'int');
@ -2874,7 +2874,7 @@ $formmargin = new FormMargin($db);
$soc = new Societe($db);
$paymentstatic = new Paiement($db);
$bankaccountstatic = new Account($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@ -3658,7 +3658,7 @@ if ($action == 'create') {
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load('projects');
print '<tr><td>'.$langs->trans('Project').'</td><td colspan="2">';
print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
@ -4284,7 +4284,7 @@ if ($action == 'create') {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$object->thirdparty->id.'&search_societe='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherBills").'</a>)';
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($usercancreate) {
@ -4711,36 +4711,36 @@ if ($action == 'create') {
if (!empty($conf->multicurrency->enabled) && ($object->multicurrency_code != $conf->currency)) {
// Multicurrency Amount HT
print '<tr><td class="titlefieldmiddle">'.$form->editfieldkey('MulticurrencyAmountHT', 'multicurrency_total_ht', '', $object, 0).'</td>';
print '<td class="nowrap amountcard">'.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '<td class="nowrap right amountcard">'.price($sign * $object->multicurrency_total_ht, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '</tr>';
// Multicurrency Amount VAT
print '<tr><td>'.$form->editfieldkey('MulticurrencyAmountVAT', 'multicurrency_total_tva', '', $object, 0).'</td>';
print '<td class="nowrap amountcard">'.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '<td class="nowrap right amountcard">'.price($sign * $object->multicurrency_total_tva, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '</tr>';
// Multicurrency Amount TTC
print '<tr><td>'.$form->editfieldkey('MulticurrencyAmountTTC', 'multicurrency_total_ttc', '', $object, 0).'</td>';
print '<td class="nowrap amountcard">'.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '<td class="nowrap right amountcard">'.price($sign * $object->multicurrency_total_ttc, '', $langs, 0, -1, -1, (!empty($object->multicurrency_code) ? $object->multicurrency_code : $conf->currency)).'</td>';
print '</tr>';
}
// Amount
print '<tr><td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
print '<td class="nowrap amountcard">'.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '<td class="nowrap right amountcard">'.price($sign * $object->total_ht, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
// Vat
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td colspan="3" class="nowrap amountcard">'.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td colspan="3" class="nowrap right amountcard">'.price($sign * $object->total_tva, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '</tr>';
// Amount Local Taxes
if (($mysoc->localtax1_assuj == "1" && $mysoc->useLocalTax(1)) || $object->total_localtax1 != 0) { // Localtax1
print '<tr><td>'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
print '<td class="nowrap amountcard">'.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '<td class="nowrap right amountcard">'.price($sign * $object->total_localtax1, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
}
if (($mysoc->localtax2_assuj == "1" && $mysoc->useLocalTax(2)) || $object->total_localtax2 != 0) { // Localtax2
print '<tr><td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
print '<td class="nowrap amountcard">'.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '<td class="nowrap right amountcard">'.price($sign * $object->total_localtax2, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
}
// Revenue stamp
@ -4796,14 +4796,14 @@ if ($action == 'create') {
}
// Total with tax
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td class="nowrap amountcard">'.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td class="nowrap right amountcard">'.price($sign * $object->total_ttc, 1, '', 1, - 1, - 1, $conf->currency).'</td></tr>';
print '</table>';
$nbrows = 8;
$nbcols = 3;
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$nbrows++;
}
if (!empty($conf->banque->enabled)) {

View File

@ -181,7 +181,7 @@ class FactureRec extends CommonInvoice
'total_ht' =>array('type'=>'double(24,8)', 'label'=>'Total', 'enabled'=>1, 'visible'=>-1, 'position'=>70, 'isameasure'=>1),
'total_ttc' =>array('type'=>'double(24,8)', 'label'=>'Total ttc', 'enabled'=>1, 'visible'=>-1, 'position'=>75, 'isameasure'=>1),
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Fk user author', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>85),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Fk projet', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>85),
'fk_cond_reglement' =>array('type'=>'integer', 'label'=>'Fk cond reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'fk_mode_reglement' =>array('type'=>'integer', 'label'=>'Fk mode reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
'date_lim_reglement' =>array('type'=>'date', 'label'=>'Date lim reglement', 'enabled'=>1, 'visible'=>-1, 'position'=>100),

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -137,7 +137,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -138,7 +138,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {

View File

@ -28,7 +28,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -97,7 +97,7 @@ $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_cl
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {

View File

@ -257,7 +257,7 @@ llxHeader('', $langs->trans("RepeatableInvoices"), 'ch-facture.html#s-fac-factur
$form = new Form($db);
$formother = new FormOther($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
$companystatic = new Societe($db);

View File

@ -215,8 +215,8 @@ $arrayfields = array(
'f.date_valid'=>array('label'=>"DateValidation", 'checked'=>0, 'position'=>22),
'f.date_lim_reglement'=>array('label'=>"DateDue", 'checked'=>1, 'position'=>25),
'f.date_closing'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>30),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>40),
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>41),
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>40),
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->project->enabled) ? 0 : 1), 'position'=>41),
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>50),
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>51),
's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>55),
@ -1091,7 +1091,7 @@ if ($resql) {
$param .= '&search_categ_cus='.urlencode($search_categ_cus);
}
if (!empty($search_fac_rec_source_title)) {
$param .= '&$search_fac_rec_source_title='.urlencode($search_fac_rec_source_title);
$param .= '&search_fac_rec_source_title='.urlencode($search_fac_rec_source_title);
}
// Add $param from extra fields

View File

@ -29,7 +29,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -114,7 +114,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1, 'customer');
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {

View File

@ -349,7 +349,7 @@ if ($object->id > 0) {
}
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($usercancreate) {

View File

@ -564,8 +564,12 @@ while ($i < min($num, $limit)) {
// Bank transaction
if (!empty($arrayfields['transaction']['checked'])) {
$bankline->fetch($objp->fk_bank);
print '<td>'.$bankline->getNomUrl(1, 0).'</td>';
print '<td>';
if ($objp->fk_bank > 0) {
$bankline->fetch($objp->fk_bank);
print $bankline->getNomUrl(1, 0);
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -1488,7 +1488,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, ' <NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf);
fputs($this->file, ' <CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf);
fputs($this->file, ' <InitgPty>'.$CrLf);
fputs($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf);
fputs($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ''))).'</Nm>'.$CrLf);
fputs($this->file, ' <Id>'.$CrLf);
fputs($this->file, ' <PrvtId>'.$CrLf);
fputs($this->file, ' <Othr>'.$CrLf);
@ -1604,7 +1604,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, ' <NbOfTxs>'.$i.'</NbOfTxs>'.$CrLf);
fputs($this->file, ' <CtrlSum>'.$this->total.'</CtrlSum>'.$CrLf);
fputs($this->file, ' <InitgPty>'.$CrLf);
fputs($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf);
fputs($this->file, ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ''))).'</Nm>'.$CrLf);
fputs($this->file, ' <Id>'.$CrLf);
fputs($this->file, ' <PrvtId>'.$CrLf);
fputs($this->file, ' <Othr>'.$CrLf);
@ -1854,16 +1854,16 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .= ' </FinInstnId>'.$CrLf;
$XML_DEBITOR .= ' </DbtrAgt>'.$CrLf;
$XML_DEBITOR .= ' <Dbtr>'.$CrLf;
$XML_DEBITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom)))).'</Nm>'.$CrLf;
$XML_DEBITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ''))).'</Nm>'.$CrLf;
$XML_DEBITOR .= ' <PstlAdr>'.$CrLf;
$XML_DEBITOR .= ' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
$addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => ""));
if (trim($addressline1)) {
$XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ''), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
if (trim($addressline2)) {
$XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ''), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
$XML_DEBITOR .= ' </PstlAdr>'.$CrLf;
$XML_DEBITOR .= ' </Dbtr>'.$CrLf;
@ -1929,10 +1929,10 @@ class BonPrelevement extends CommonObject
$addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : ''.$row_town), array(CHR(13) => ", ", CHR(10) => ""));
if (trim($addressline1)) {
$XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ''), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
if (trim($addressline2)) {
$XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ''), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
$XML_CREDITOR .= ' </PstlAdr>'.$CrLf;
$XML_CREDITOR .= ' </Cdtr>'.$CrLf;
@ -2096,16 +2096,16 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' </PmtTpInf>'.$CrLf;
$XML_SEPA_INFO .= ' <ReqdColltnDt>'.$dateTime_ETAD.'</ReqdColltnDt>'.$CrLf;
$XML_SEPA_INFO .= ' <Cdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ''))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => ""));
if ($addressline1) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ''), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
if ($addressline2) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ''), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </Cdtr>'.$CrLf;
@ -2123,8 +2123,8 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS))).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS), '')).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), '')).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/
$XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV
@ -2162,16 +2162,16 @@ class BonPrelevement extends CommonObject
}
$XML_SEPA_INFO .= ' <ReqdExctnDt>'.dol_print_date($dateTime_ETAD, 'dayrfc').'</ReqdExctnDt>'.$CrLf;
$XML_SEPA_INFO .= ' <Dbtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ''))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => ""));
if ($addressline1) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ''), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
if ($addressline2) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2)), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline2), ''), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </Dbtr>'.$CrLf;
@ -2189,8 +2189,8 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale)))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS))).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN)).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ADDRESS), '')).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_string_nospecial(dol_string_unaccent($conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN), '')).'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' </UltmtCdtr>'.$CrLf;*/
$XML_SEPA_INFO .= ' <ChrgBr>SLEV</ChrgBr>'.$CrLf; // Field "Responsible of fees". Must be SLEV

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/paymentsocialcontribution
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -333,7 +333,7 @@ $form = new Form($db);
$formfile = new FormFile($db);
$formsocialcontrib = new FormSocialContrib($db);
$bankaccountstatic = new Account($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@ -407,7 +407,7 @@ if ($action == 'create') {
print '<td>'.img_picto('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($fk_user, 'userid', 1).'</td></tr>';
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
// Associated project
@ -540,7 +540,7 @@ if ($id > 0) {
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->tax->charges->creer) {

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -101,7 +101,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) {
*/
$form = new Form($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@ -121,7 +121,7 @@ if ($object->id) {
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_project)) {

View File

@ -25,7 +25,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -68,7 +68,7 @@ if ($action == 'setlib' && $user->rights->tax->charges->creer) {
$form = new Form($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@ -90,7 +90,7 @@ $morehtmlref = '<div class="refidno">';
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_project)) {

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -100,7 +100,7 @@ $arrayfields = array(
'cs.fk_type' =>array('label'=>"Type", 'checked'=>1, 'position'=>30),
'cs.date_ech' =>array('label'=>"Date", 'checked'=>1, 'position'=>40),
'cs.periode' =>array('label'=>"PeriodEndDate", 'checked'=>1, 'position'=>50),
'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->projet->enabled))),
'p.ref' =>array('label'=>"ProjectRef", 'checked'=>1, 'position'=>60, 'enable'=>(!empty($conf->project->enabled))),
'cs.fk_user' =>array('label'=>"Employee", 'checked'=>1, 'position'=>70),
'cs.fk_mode_reglement' =>array('checked'=>-1, 'position'=>80, 'label'=>"DefaultPaymentMode"),
'cs.amount' =>array('label'=>"Amount", 'checked'=>1, 'position'=>100),
@ -179,7 +179,7 @@ $formother = new FormOther($db);
$bankstatic = new Account($db);
$formsocialcontrib = new FormSocialContrib($db);
$chargesociale_static = new ChargeSociales($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$projectstatic = new Project($db);
}
@ -187,7 +187,7 @@ llxHeader('', $langs->trans("SocialContributions"));
$sql = "SELECT cs.rowid, cs.fk_type as type, cs.fk_user,";
$sql .= " cs.amount, cs.date_ech, cs.libelle as label, cs.paye, cs.periode, cs.fk_account,";
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$sql .= " p.rowid as project_id, p.ref as project_ref, p.title as project_label,";
}
$sql .= " c.libelle as type_label, c.accountancy_code as type_accountancy_code,";
@ -197,7 +197,7 @@ $sql .= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,";
$sql .= " ".MAIN_DB_PREFIX."chargesociales as cs";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON (cs.fk_account = ba.rowid)";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement as pay ON (cs.fk_mode_reglement = pay.id)';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = cs.fk_projet";
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid";
@ -211,7 +211,7 @@ if ($search_ref) {
if ($search_label) {
$sql .= natural_search("cs.libelle", $search_label);
}
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
if ($search_project_ref != '') {
$sql .= natural_search("p.ref", $search_project_ref);
}
@ -247,7 +247,7 @@ if ($search_typeid > 0) {
$sql .= " AND cs.fk_type = ".((int) $search_typeid);
}
$sql .= " GROUP BY cs.rowid, cs.fk_type, cs.fk_user, cs.amount, cs.date_ech, cs.libelle, cs.paye, cs.periode, cs.fk_account, c.libelle, c.accountancy_code, ba.label, ba.ref, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.clos, pay.code, u.lastname";
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$sql .= ", p.rowid, p.ref, p.title";
}
$sql .= $db->order($sortfield, $sortorder);
@ -553,7 +553,7 @@ while ($i < min($num, $limit)) {
$chargesociale_static->label = $obj->label;
$chargesociale_static->type_label = $obj->type_label;
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$projectstatic->id = $obj->project_id;
$projectstatic->ref = $obj->project_ref;
$projectstatic->title = $obj->project_label;

View File

@ -25,7 +25,7 @@ require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -93,7 +93,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= $form->editfieldkey("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', 0, 1);
$morehtmlref .= $form->editfieldval("Label", 'lib', $object->label, $object, $user->rights->tax->charges->creer, 'string', '', null, null, '', 1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' : ';
if (!empty($object->fk_project)) {

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -102,7 +102,7 @@ if ($action == 'setlib' && $permissiontoadd) {
*/
$form = new Form($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}

View File

@ -27,7 +27,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -110,7 +110,7 @@ if (empty($reshook)) {
$form = new Form($db);
$formfile = new FormFile($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@ -171,7 +171,7 @@ if ($id > 0) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {

View File

@ -44,7 +44,7 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
if (!empty($conf->propal->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
}
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
}
@ -1002,7 +1002,7 @@ llxHeader('', $langs->trans("Contract"), $help_url);
$form = new Form($db);
$formfile = new FormFile($db);
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$formproject = new FormProjets($db);
}
@ -1161,7 +1161,7 @@ if ($action == 'create') {
print "</td></tr>";
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load('projects');
$formproject = new FormProjets($db);
@ -1321,7 +1321,7 @@ if ($action == 'create') {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {

View File

@ -233,7 +233,7 @@ class Contrat extends CommonObject
'datec' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>40),
'date_contrat' =>array('type'=>'datetime', 'label'=>'Date contrat', 'enabled'=>1, 'visible'=>-1, 'position'=>45),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>70),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->projet->enabled', 'visible'=>-1, 'position'=>75),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>'$conf->project->enabled', 'visible'=>-1, 'position'=>75),
'fk_commercial_signature' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative Signature', 'enabled'=>1, 'visible'=>-1, 'position'=>80),
'fk_commercial_suivi' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'SaleRepresentative follower', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>90),
@ -1058,7 +1058,7 @@ class Contrat extends CommonObject
if (count($exp->linkedObjectsIds['commande']) > 0) {
foreach ($exp->linkedObjectsIds['commande'] as $key => $value) {
$originforcontact = 'commande';
$originidforcontact = $value->id;
$originidforcontact = $value;
break; // We take first one
}
}

View File

@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -154,7 +154,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {

View File

@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -144,7 +144,7 @@ if ($object->id) {
$morehtmlref .= ' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
}
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {

View File

@ -27,7 +27,7 @@
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/contract.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
}
@ -111,7 +111,7 @@ if ($id > 0 || !empty($ref)) {
// Thirdparty
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1);
// Project
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->contrat->creer) {

View File

@ -144,7 +144,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
if (!empty($noback)) {
if (empty($noback)) {
header("Location: " . $urltogo);
exit;
}
@ -266,7 +266,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
$action = 'view';
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
if ($urltogo) {
if ($urltogo && !$noback) {
header("Location: " . $urltogo);
exit;
}
@ -320,7 +320,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
// Delete OK
setEventMessages("RecordDeleted", null, 'mesgs');
if (!empty($noback)) {
if (empty($noback)) {
header("Location: " . $backurlforlist);
exit;
}
@ -366,7 +366,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto
setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs');
if (!empty($noback)) {
if (empty($noback)) {
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
exit;
}
@ -507,7 +507,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd))
$newid = $result;
}
if (!empty($noback)) {
if (empty($noback)) {
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $newid); // Open record of new object
exit;
}

View File

@ -26,7 +26,7 @@
// $id must be defined
// $object must be defined and must have a method generateDocument().
// $permissiontoadd must be defined
// $upload_dir must be defined (example $conf->projet->dir_output . "/";)
// $upload_dir must be defined (example $conf->project->dir_output . "/";)
// $hidedetails, $hidedesc, $hideref and $moreparams may have been set or not.
if (!empty($permissioncreate) && empty($permissiontoadd)) {

View File

@ -31,7 +31,7 @@
// $parameters, $object, $action must be defined for the hook.
// $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined
// $uploaddir may be defined (example to $conf->projet->dir_output."/";)
// $uploaddir may be defined (example to $conf->project->dir_output."/";)
// $toselect may be defined
// $diroutputmassaction may be defined
@ -455,7 +455,7 @@ if (!$error && $massaction == 'confirm_presend') {
//var_dump($oneemailperrecipient); var_dump($listofqualifiedobj); var_dump($listofqualifiedref);
foreach ($looparray as $objectid => $objecttmp) { // $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
// Make substitution in email content
if (!empty($conf->projet->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) {
if (!empty($conf->project->enabled) && method_exists($objecttmp, 'fetch_projet') && is_null($objecttmp->project)) {
$objecttmp->fetch_projet();
}
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $objecttmp);

View File

@ -252,9 +252,9 @@ if ($type == 'directory') {
} elseif ($module == 'salaries') {
$upload_dir = $conf->salaries->dir_output;
} elseif ($module == 'project') {
$upload_dir = $conf->projet->dir_output;
$upload_dir = $conf->project->dir_output;
} elseif ($module == 'project_task') {
$upload_dir = $conf->projet->dir_output;
$upload_dir = $conf->project->dir_output;
} elseif ($module == 'fichinter') {
$upload_dir = $conf->ficheinter->dir_output;
} elseif ($module == 'user') {

View File

@ -89,10 +89,10 @@ if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->glob
$arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) {
if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) {
$arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) {
if (!empty($conf->project->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) {
$arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}

View File

@ -133,7 +133,7 @@ class box_dolibarr_state_board extends ModeleBoxes
'supplier_orders' => !empty($conf->supplier_order->enabled) && $user->rights->fournisseur->commande->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_ORDERS_STATS),
'supplier_invoices' => !empty($conf->supplier_invoice->enabled) && $user->rights->fournisseur->facture->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_INVOICES_STATS),
'supplier_proposals' => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->lire && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_PROPOSAL_STATS),
'projects' => !empty($conf->projet->enabled) && $user->rights->projet->lire,
'projects' => !empty($conf->project->enabled) && $user->rights->projet->lire,
'expensereports' => !empty($conf->expensereport->enabled) && $user->rights->expensereport->lire,
'holidays' => !empty($conf->holiday->enabled) && $user->rights->holiday->read,
'ticket' => !empty($conf->ticket->enabled) && $user->rights->ticket->read,

View File

@ -84,6 +84,7 @@ class box_project extends ModeleBoxes
$textHead = $langs->trans("OpenedProjects");
$this->info_box_head = array('text' => $textHead, 'limit'=> dol_strlen($textHead));
$i = 0;
// list the summary of the orders
if ($user->rights->projet->lire) {
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@ -113,7 +114,6 @@ class box_project extends ModeleBoxes
if ($result) {
$num = $this->db->num_rows($result);
$i = 0;
while ($i < min($num, $max)) {
$objp = $this->db->fetch_object($result);

View File

@ -168,17 +168,18 @@ abstract class CommonInvoice extends CommonObject
/**
* Return amount (with tax) of all deposits invoices used by invoice.
* Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on (not recommended).
* Should always be empty, except if option FACTURE_DEPOSITS_ARE_JUST_PAYMENTS is on for sale invoices (not recommended),
* of FACTURE_SUPPLIER_DEPOSITS_ARE_JUST_PAYMENTS is on for purchase invoices (not recommended).
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return float <0 and set ->error if KO, Sum of deposits amount otherwise
*/
public function getSumDepositsUsed($multicurrency = 0)
{
if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') {
/*if ($this->element == 'facture_fourn' || $this->element == 'invoice_supplier') {
// FACTURE_DEPOSITS_ARE_JUST_PAYMENTS was never supported for purchase invoice, so we can return 0 with no need of SQL for this case.
return 0.0;
}
}*/
require_once DOL_DOCUMENT_ROOT.'/core/class/discount.class.php';

View File

@ -186,6 +186,12 @@ abstract class CommonObject
*/
public $projet;
/**
* @deprecated
* @see fk_project
*/
public $fk_projet;
/**
* @var Contact a related contact
* @see fetch_contact()
@ -7556,11 +7562,15 @@ abstract class CommonObject
if ($classname && class_exists($classname)) {
$object = new $classname($this->db);
if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong
$object->fetch($value, '', '', '', 0, 1, 1);
$result = $object->fetch($value, '', '', '', 0, 1, 1);
} else {
$object->fetch($value);
$result = $object->fetch($value);
}
if ($result > 0) {
$value = $object->getNomUrl($getnomurlparam, $getnomurlparam2);
} else {
$value = '';
}
$value = $object->getNomUrl($getnomurlparam, $getnomurlparam2);
}
} else {
dol_syslog('Error bad setup of extrafield', LOG_WARNING);

View File

@ -72,11 +72,23 @@ abstract class CommonOrderLine extends CommonObjectLine
*/
public $product_label;
/**
* Boolean that indicates whether the product is available for sale '1' or not '0'
* @var int
*/
public $product_tosell=0;
/**
* Boolean that indicates whether the product is available for purchase '1' or not '0'
* @var int
*/
public $product_tobuy=0;
/**
* Product description
* @var string
*/
public $product_desc;
public $product_desc;
/**
* Product use lot

View File

@ -144,6 +144,10 @@ class EvalMath
*/
public function evaluate($expr)
{
if (empty($expr)) {
return false;
}
$this->last_error = null;
$this->last_error_code = null;
$expr = trim($expr);
@ -366,18 +370,14 @@ class EvalMath
}
/**
* evaluate postfix notation
* Evaluate postfix notation
*
* @param string $tokens Expression
* @param string $tokens An array of expression to evaluate ('operators'). The operand are into ->stack.
* @param array $vars Array
* @return string Output
*/
private function pfx($tokens, $vars = array())
{
if ($tokens == false) {
return false;
}
$stack = new EvalMathStack();
foreach ($tokens as $token) { // nice and easy

View File

@ -60,6 +60,11 @@ class ExtraFields
*/
public $attribute_choice;
/**
* @var array array to store extrafields definition
* @deprecated
*/
public $attribute_list;
/**
* @var array New array to store extrafields definition
@ -1709,7 +1714,9 @@ class ExtraFields
$toprint = array();
if (is_array($value_arr)) {
foreach ($value_arr as $keyval => $valueval) {
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
if (!empty($valueval)) {
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #bbb">'.$param['options'][$valueval].'</li>';
}
}
}
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';

View File

@ -72,7 +72,7 @@ class FileUpload
} elseif ($element == 'project_task') {
$pathname = 'projet';
$filename = 'task';
$dir_output = $conf->projet->dir_output;
$dir_output = $conf->project->dir_output;
$parentForeignKey = 'fk_project';
$parentClass = 'Project';
$parentElement = 'projet';

View File

@ -47,6 +47,9 @@ class FormTicket
*/
public $db;
/**
* @var string The track_id of the ticket. Used also for the $keytoavoidconflict to name session vars to upload files.
*/
public $track_id;
/**
@ -612,7 +615,7 @@ class FormTicket
}
if ($subelement != 'project') {
if (!empty($conf->projet->enabled) && !$this->ispublic) {
if (!empty($conf->project->enabled) && !$this->ispublic) {
$formproject = new FormProjets($this->db);
print '<tr><td><label for="project"><span class="">'.$langs->trans("Project").'</span></label></td><td>';
print img_picto('', 'project').$formproject->select_projects(-1, GETPOST('projectid', 'int'), 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
@ -1211,7 +1214,7 @@ class FormTicket
dol_delete_dir_recursive($upload_dir);
}
$keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined
$keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid
unset($_SESSION["listofpaths".$keytoavoidconflict]);
unset($_SESSION["listofnames".$keytoavoidconflict]);
unset($_SESSION["listofmimes".$keytoavoidconflict]);
@ -1269,7 +1272,7 @@ class FormTicket
$listofpaths = array();
$listofnames = array();
$listofmimes = array();
$keytoavoidconflict = empty($this->trackid) ? '' : '-'.$this->trackid; // this->trackid must be defined
$keytoavoidconflict = empty($this->track_id) ? '' : '-'.$this->track_id; // track_id instead of trackid
if (GETPOST('mode', 'alpha') == 'init' || (GETPOST('modelmailselected', 'alpha') && GETPOST('modelmailselected', 'alpha') != '-1')) {
if (!empty($arraydefaultmessage->joinfiles) && is_array($this->param['fileinit'])) {

View File

@ -33,6 +33,13 @@ abstract class Stats
protected $lastfetchdate = array(); // Dates of cache file read by methods
public $cachefilesuffix = ''; // Suffix to add to name of cache file (to avoid file name conflicts)
/**
* @param int $year number
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return int value
*/
protected abstract function getNbByMonth($year, $format = 0);
/**
* Return nb of elements by month for several years
*
@ -123,6 +130,13 @@ abstract class Stats
return $data;
}
/**
* @param int $year year number
* @param int $format 0=Label of abscissa is a translated text, 1=Label of abscissa is month number, 2=Label of abscissa is first letter of month
* @return int value
*/
protected abstract function getAmountByMonth($year, $format = 0);
/**
* Return amount of elements by month for several years.
* Criterias used to build request are defined into the constructor of parent class into xxx/class/xxxstats.class.php
@ -460,7 +474,6 @@ abstract class Stats
return $data;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Return the amount per month for a given year

View File

@ -300,13 +300,13 @@ class Validate
/**
* Check for all values in db
*
* @param array $values Boolean to validate
* @param integer $id of element
* @param string $classname the class name
* @param string $classpath the class path
* @return boolean Validity is ok or not
* @throws Exception
*/
public function isFetchable($values, $classname, $classpath)
public function isFetchable($id, $classname, $classpath)
{
if (!empty($classpath)) {
if (dol_include_once($classpath)) {
@ -319,7 +319,7 @@ class Validate
return false;
}
if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $values)) {
if (!empty($object->table_element) && $object->isExistingObject($object->table_element, $id)) {
return true;
} else { $this->error = $this->outputLang->trans('RequireValidExistingElement'); }
} else { $this->error = $this->outputLang->trans('BadSetupOfFieldClassNotFoundForValidation'); }

View File

@ -138,7 +138,7 @@ function societe_prepare_head(Societe $object)
$h++;
}
if (!empty($conf->projet->enabled) && (!empty($user->rights->projet->lire))) {
if (!empty($conf->project->enabled) && (!empty($user->rights->projet->lire))) {
$nbProject = 0;
// Enable caching of thirdrparty count projects
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
@ -781,11 +781,11 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel
$i = -1;
if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
if (!empty($conf->project->enabled) && $user->rights->projet->lire) {
$langs->load("projects");
$newcardbutton = '';
if (!empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) {
if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&amp;action=create&amp;backtopage='.urlencode($backtopage));
}

View File

@ -57,7 +57,7 @@ function contact_prepare_head(Contact $object)
$head[$tab][2] = 'perso';
$tab++;
if (!empty($conf->projet->enabled) && (!empty($user->rights->projet->lire))) {
if (!empty($conf->project->enabled) && $user->hasRight('project', 'lire')) {
$nbProject = 0;
// Enable caching of thirdrparty count projects
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
@ -170,11 +170,11 @@ function show_contacts_projects($conf, $langs, $db, $object, $backtopage = '', $
$i = -1;
if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
if (!empty($conf->project->enabled) && $user->rights->projet->lire) {
$langs->load("projects");
$newcardbutton = '';
if (!empty($conf->projet->enabled) && $user->rights->projet->creer && empty($nocreatelink)) {
if (!empty($conf->project->enabled) && $user->rights->projet->creer && empty($nocreatelink)) {
$newcardbutton .= dolGetButtonTitle($langs->trans('AddProject'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&amp;action=create&amp;backtopage='.urlencode($backtopage));
}

View File

@ -322,20 +322,28 @@ function convertSecondToTime($iSecond, $format = 'all', $lengthOfDay = 86400, $l
* Generate a SQL string to make a filter into a range (for second of date until last second of date).
* This method allows to maje SQL request that will deal correctly the timezone of server.
*
* @param string $datefield Name of SQL field where apply sql date filter
* @param int $day_date Day date
* @param int $month_date Month date
* @param int $year_date Year date
* @param int $excludefirstand Exclude first and
* @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ.
* Note: In database, dates are always fot the server TZ.
* @return string $sqldate String with SQL filter
* @param string $datefield Name of SQL field where apply sql date filter
* @param int|string $day_date Day date (Can be 0 or '' for filter on a month)
* @param int|string $month_date Month date (Can be 0 or '' for filter on a year)
* @param int|string $year_date Year date
* @param int $excludefirstand Exclude first and
* @param mixed $gm False or 0 or 'tzserver' = Input date fields are date info in the server TZ. True or 1 or 'gmt' = Input are date info in GMT TZ.
* Note: In database, dates are always fot the server TZ.
* @return string $sqldate String with SQL filter
*/
function dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand = 0, $gm = false)
{
global $db;
$sqldate = "";
$sqldate = '';
$day_date = intval($day_date);
$month_date = intval($month_date);
$year_date = intval($year_date);
if ($month_date > 0) {
if ($month_date > 12) { // protection for bad value of month
return " AND 1 = 2";
}
if ($year_date > 0 && empty($day_date)) {
$sqldate .= ($excludefirstand ? "" : " AND ").$datefield." BETWEEN '".$db->idate(dol_get_first_day($year_date, $month_date, $gm));
$sqldate .= "' AND '".$db->idate(dol_get_last_day($year_date, $month_date, $gm))."'";

View File

@ -78,12 +78,12 @@ function doc_getlinedesc($line, $outputlangs, $hideref = 0, $hidedesc = 0, $issu
if ($desc == '(CREDIT_NOTE)' && $line->fk_remise_except) {
$discount = new DiscountAbsolute($db);
$discount->fetch($line->fk_remise_except);
$sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source;
$sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source;
$libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $sourceref);
} elseif ($desc == '(DEPOSIT)' && $line->fk_remise_except) {
$discount = new DiscountAbsolute($db);
$discount->fetch($line->fk_remise_except);
$sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source;
$sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source;
$libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref);
// Add date of deposit
if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) {

View File

@ -1443,7 +1443,7 @@ function dol_delete_preview($object)
} elseif ($object->element == 'invoice_supplier') {
$dir = $conf->fournisseur->facture->dir_output;
} elseif ($object->element == 'project') {
$dir = $conf->projet->dir_output;
$dir = $conf->project->dir_output;
} elseif ($object->element == 'shipping') {
$dir = $conf->expedition->dir_output.'/sending';
} elseif ($object->element == 'delivery') {
@ -1525,7 +1525,7 @@ function dol_meta_create($object)
} elseif ($object->element == 'invoice_supplier') {
$dir = $conf->fournisseur->dir_output.'/facture';
} elseif ($object->element == 'project') {
$dir = $conf->projet->dir_output;
$dir = $conf->project->dir_output;
} elseif ($object->element == 'shipping') {
$dir = $conf->expedition->dir_output.'/sending';
} elseif ($object->element == 'delivery') {
@ -2812,7 +2812,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
}
$original_file = $conf->commande->multidir_output[$entity].'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."commande WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('order').")";
} elseif ($modulepart == 'project' && !empty($conf->projet->dir_output)) {
} elseif ($modulepart == 'project' && !empty($conf->project->dir_output)) {
// Wrapping pour les projets
if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
@ -2824,9 +2824,9 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$accessallowed = checkUserAccessToObject($user, array('projet'), $tmpproject->id, 'projet&project', '', '', 'rowid', '');
}
}
$original_file = $conf->projet->dir_output.'/'.$original_file;
$original_file = $conf->project->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")";
} elseif ($modulepart == 'project_task' && !empty($conf->projet->dir_output)) {
} elseif ($modulepart == 'project_task' && !empty($conf->project->dir_output)) {
if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
// If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project
@ -2837,7 +2837,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$accessallowed = checkUserAccessToObject($user, array('projet_task'), $tmptask->id, 'projet_task&project', '', '', 'rowid', '');
}
}
$original_file = $conf->projet->dir_output.'/'.$original_file;
$original_file = $conf->project->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")";
} elseif (($modulepart == 'commande_fournisseur' || $modulepart == 'order_supplier') && !empty($conf->fournisseur->commande->dir_output)) {
// Wrapping pour les commandes fournisseurs

View File

@ -132,6 +132,9 @@ function getEntity($element, $shared = 1, $currentobject = null)
case 'order_supplier':
$element = 'supplier_order';
break; // "/fourn/class/fournisseur.commande.class.php"
case 'invoice_supplier':
$element = 'supplier_invoice';
break; // "/fourn/class/fournisseur.facture.class.php"
}
if (is_object($mc)) {
@ -7313,7 +7316,7 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__CANDIDATE_FIRSTNAME__'] = '__CANDIDATE_FIRSTNAME__';
$substitutionarray['__CANDIDATE_LASTNAME__'] = '__CANDIDATE_LASTNAME__';
}
if (!empty($conf->projet->enabled)) { // Most objects
if (!empty($conf->project->enabled)) { // Most objects
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
$substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__';
$substitutionarray['__PROJECT_NAME__'] = '__PROJECT_NAME__';
@ -8505,7 +8508,7 @@ function verifCond($strToEvaluate)
//dol_eval($str, 0, 1, '2'); // The dol_eval must contains all the global $xxx used into a condition
//var_dump($strToEvaluate);
$rep = dol_eval($strToEvaluate, 1, 1, '1'); // The dol_eval must contains all the global $xxx for all variables $xxx found into the string condition
$rights = (($rep && strpos($rep, 'Bad string syntax to evaluate') === false) ? true : false);
$rights = $rep && (!is_string($rep) || strpos($rep, 'Bad string syntax to evaluate') === false);
//var_dump($rights);
}
return $rights;
@ -8949,8 +8952,12 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
foreach ($conf->modules_parts['tabs'][$type] as $value) {
$values = explode(':', $value);
$reg = array();
if ($mode == 'add' && !preg_match('/^\-/', $values[1])) {
if (count($values) == 6) { // new declaration with permissions: $value='objecttype:+tabname1:Title1:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__'
if (count($values) == 6) {
// new declaration with permissions:
// $value='objecttype:+tabname1:Title1:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__'
// $value='objecttype:+tabname1:Title1,class,pathfile,method:langfile@mymodule:$user->rights->mymodule->read:/mymodule/mynewtab1.php?id=__ID__'
if ($values[0] != $type) {
continue;
}
@ -8964,7 +8971,7 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
complete_substitutions_array($substitutionarray, $langs, $object, array('needforkey'=>$values[2]));
$label = make_substitutions($reg[1], $substitutionarray);
} else {
$labeltemp = explode(':', $values[2]);
$labeltemp = explode(',', $values[2]);
$label = $langs->trans($labeltemp[0]);
if (!empty($labeltemp[1]) && is_object($object) && !empty($object->id)) {
dol_include_once($labeltemp[2]);

View File

@ -1490,12 +1490,12 @@ function pdf_getlinedesc($object, $i, $outputlangs, $hideref = 0, $hidedesc = 0,
if ($desc == '(CREDIT_NOTE)' && $object->lines[$i]->fk_remise_except) {
$discount = new DiscountAbsolute($db);
$discount->fetch($object->lines[$i]->fk_remise_except);
$sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source;
$sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source;
$libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromCreditNote", $sourceref);
} elseif ($desc == '(DEPOSIT)' && $object->lines[$i]->fk_remise_except) {
$discount = new DiscountAbsolute($db);
$discount->fetch($object->lines[$i]->fk_remise_except);
$sourceref = !empty($discount->discount_type) ? $discount->ref_invoive_supplier_source : $discount->ref_facture_source;
$sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source;
$libelleproduitservice = $outputlangs->transnoentitiesnoconv("DiscountFromDeposit", $sourceref);
// Add date of deposit
if (!empty($conf->global->INVOICE_ADD_DEPOSIT_DATE)) {

View File

@ -186,7 +186,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (!empty($conf->tax->enabled)) {
$nbElements += $project->getElementCount('chargesociales', 'chargesociales');
}
if (!empty($conf->projet->enabled)) {
if (!empty($conf->project->enabled)) {
$nbElements += $project->getElementCount('project_task', 'projet_task');
}
if (!empty($conf->stock->enabled)) {
@ -275,7 +275,7 @@ function project_prepare_head(Project $project, $moreparam = '')
} else {
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$upload_dir = $conf->projet->dir_output."/".dol_sanitizeFileName($project->ref);
$upload_dir = $conf->project->dir_output."/".dol_sanitizeFileName($project->ref);
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
$nbLinks = Link::count($db, $project->element, $project->id);
$totalAttached = $nbFiles + $nbLinks;
@ -401,7 +401,7 @@ function task_prepare_head($object)
}
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/document.php?id='.$object->id.(GETPOST('withproject') ? '&withproject=1' : '');
$filesdir = $conf->projet->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref);
$filesdir = $conf->project->dir_output."/".dol_sanitizeFileName($object->project->ref).'/'.dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
$nbFiles = count(dol_dir_list($filesdir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));

View File

@ -774,7 +774,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$checkonentitydone = 1;
}
if (in_array($feature, $checkproject)) {
if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) {
if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) {
$projectid = $objectid;
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@ -795,7 +795,7 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl
$checkonentitydone = 1;
}
if (in_array($feature, $checktask)) {
if (!empty($conf->projet->enabled) && empty($user->rights->projet->all->lire)) {
if (!empty($conf->project->enabled) && empty($user->rights->projet->all->lire)) {
$task = new Task($db);
$task->fetch($objectid);
$projectid = $task->fk_project;

View File

@ -372,7 +372,12 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '</th></tr>';
}
print '<tr><td colspan="'.$colspan.'">';
print '<tr><td colspan="'.$colspan.'" class="center">';
if (!empty($conf->global->MAIN_FORCETHEME)) {
$langs->load("errors");
print $langs->trans("WarningThemeForcedTo", $conf->global->MAIN_FORCETHEME);
}
print '<table class="nobordernopadding" width="100%"><tr><td><div class="center">';

View File

@ -15,7 +15,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 2__+MAX_llx_menu__, 'societe|fournisseur|supplier_order|supplier_invoice', '($conf->societe->enabled && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS) || !empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || $conf->supplier_order->enabled || $conf->supplier_invoice->enabled))', __HANDLER__, 'top', 'companies', '', 0, '/societe/index.php?mainmenu=companies&amp;leftmenu=', 'ThirdParties', -1, 'companies', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 20, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 3__+MAX_llx_menu__, 'product|service', '$conf->product->enabled || $conf->service->enabled', __HANDLER__, 'top', 'products', '', 0, '/product/index.php?mainmenu=products&amp;leftmenu=', 'ProductsPipeServices', -1, 'products', '$user->rights->produit->lire||$user->rights->service->lire', '', 0, 30, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 16__+MAX_llx_menu__, 'bom|mrp', '$conf->bom->enabled || $conf->mrp->enabled', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&amp;leftmenu=', 'MRP', -1, 'mrp', '$user->rights->bom->read||$user->rights->mrp->read', '', 0, 31, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->projet->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&amp;leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 7__+MAX_llx_menu__, 'projet', '$conf->project->enabled', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&amp;leftmenu=', 'Projects', -1, 'projects', '$user->rights->projet->lire', '', 2, 32, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', '$conf->propal->enabled || $conf->commande->enabled || $conf->supplier_order->enabled || $conf->contrat->enabled || $conf->ficheinter->enabled', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&amp;leftmenu=', 'Commercial', -1, 'commercial', '$user->rights->societe->lire || $user->rights->societe->contact->lire', '', 2, 40, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', '$conf->comptabilite->enabled || $conf->accounting->enabled || $conf->facture->enabled || $conf->don->enabled || $conf->tax->enabled || $conf->salaries->enabled || $conf->supplier_invoice->enabled || $conf->loan->enabled || $conf->banque->enabled', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&amp;leftmenu=', 'MenuFinancial', -1, 'compta', '$user->rights->facture->lire|| $user->rights->don->lire || $user->rights->tax->charges->lire || $user->rights->salaries->read || $user->rights->loan->read || $user->rights->banque->lire', '', 2, 50, __ENTITY__);
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ( 14__+MAX_llx_menu__, 'banque|prelevement', '$conf->banque->enabled || $conf->prelevement->enabled', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&amp;leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->rights->banque->lire || $user->rights->prelevement->bons->lire', '', 0, 52, __ENTITY__);
@ -404,19 +404,19 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
-- Project
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&amp;leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&amp;leftmenu=projects&amp;action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&amp;leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&amp;leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&amp;leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&amp;leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&amp;leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&amp;leftmenu=projects&amp;action=create', 'New', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3602__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&amp;leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 0', __HANDLER__, 'left', 3603__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&amp;leftmenu=projects&search_opp_status=openedopp&search_status=99', 'ListOpenLeads', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && $conf->global->PROJECT_USE_OPPORTUNITIES != 2', __HANDLER__, 'left', 3604__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/list.php?mainmenu=project&amp;leftmenu=projects&search_opp_status=notopenedopp&search_status=99', 'ListOpenProjects', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled', __HANDLER__, 'left', 3605__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/stats/index.php?mainmenu=project&amp;leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&amp;leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&amp;leftmenu=projects&amp;action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&amp;leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&amp;leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3700__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/index.php?mainmenu=project&amp;leftmenu=projects', 'Activities', 0, 'projects', '$user->rights->projet->lire', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3701__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks.php?mainmenu=project&amp;leftmenu=projects&amp;action=create', 'NewTask', 1, 'projects', '$user->rights->projet->creer', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3702__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/list.php?mainmenu=project&amp;leftmenu=projects', 'List', 1, 'projects', '$user->rights->projet->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3704__+MAX_llx_menu__, 'project', '', 3700__+MAX_llx_menu__, '/projet/tasks/stats/index.php?mainmenu=project&amp;leftmenu=projects', 'Statistics', 1, 'projects', '$user->rights->projet->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->projet->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&amp;leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->project->enabled && !$conf->global->PROJECT_HIDE_TASKS', __HANDLER__, 'left', 3400__+MAX_llx_menu__, 'project', '', 7__+MAX_llx_menu__, '/projet/activity/perweek.php?mainmenu=project&amp;leftmenu=projects', 'NewTimeSpent', 0, 'projects', '$user->rights->projet->lire', '', 2, 3, __ENTITY__);
-- Project - Categories
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->categorie->enabled', __HANDLER__, 'left', 3804__+MAX_llx_menu__, 'project', 'cat', 7__+MAX_llx_menu__, '/categories/index.php?mainmenu=project&amp;leftmenu=cat&amp;type=6', 'Categories', 0, 'categories', '$user->rights->categorie->lire', '', 2, 4, __ENTITY__);

View File

@ -2211,6 +2211,7 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme
$newmenu->add("/projet/tasks/stats/index.php?leftmenu=projects", $langs->trans("Statistics"), 1, $user->rights->projet->lire);
$newmenu->add("/projet/activity/perweek.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("NewTimeSpent"), 0, $user->rights->projet->lire, '', 'project', 'timespent', 0, '', '', '', img_picto('', 'timespent', 'class="pictofixedwidth"'));
$newmenu->add("/projet/tasks/time.php?leftmenu=tasks".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $user->rights->projet->lire);
}
}
}

View File

@ -611,6 +611,9 @@ class pdf_einstein extends ModelePDFCommandes
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
}
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {

View File

@ -835,6 +835,9 @@ class pdf_eratosthene extends ModelePDFCommandes
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
}
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == $pageposafter) {

View File

@ -437,6 +437,9 @@ class pdf_strato extends ModelePDFContract
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
}
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {

View File

@ -574,6 +574,9 @@ class pdf_storm extends ModelePDFDeliveryOrder
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
}
}
if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
if ($pagenb == 1) {

Some files were not shown because too many files have changed in this diff Show More