Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into 14.0
This commit is contained in:
commit
b1de75758f
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2011-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -91,19 +91,19 @@ $tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account
|
|||||||
$tabsqlsort = array();
|
$tabsqlsort = array();
|
||||||
$tabsqlsort[32] = "position ASC";
|
$tabsqlsort[32] = "position ASC";
|
||||||
|
|
||||||
// Nom des champs en resultat de select pour affichage du dictionnaire
|
// Name of the fields in the result of select to display the dictionary
|
||||||
$tabfield = array();
|
$tabfield = array();
|
||||||
$tabfield[32] = "code,label,range_account,category_type,formula,position,country";
|
$tabfield[32] = "code,label,range_account,category_type,formula,position,country";
|
||||||
|
|
||||||
// Nom des champs d'edition pour modification d'un enregistrement
|
// Name of editing fields for record modification
|
||||||
$tabfieldvalue = array();
|
$tabfieldvalue = array();
|
||||||
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id";
|
$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id";
|
||||||
|
|
||||||
// Nom des champs dans la table pour insertion d'un enregistrement
|
// Name of the fields in the table for inserting a record
|
||||||
$tabfieldinsert = array();
|
$tabfieldinsert = array();
|
||||||
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country";
|
$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country";
|
||||||
|
|
||||||
// Nom du rowid si le champ n'est pas de type autoincrement
|
// Name of the rowid if the field is not of type autoincrement
|
||||||
// Example: "" if id field is "rowid" and has autoincrement on
|
// Example: "" if id field is "rowid" and has autoincrement on
|
||||||
// "nameoffield" if id field is not "rowid" or has not autoincrement on
|
// "nameoffield" if id field is not "rowid" or has not autoincrement on
|
||||||
$tabrowid = array();
|
$tabrowid = array();
|
||||||
@ -151,7 +151,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||||||
if ($value == 'range_account' && empty($_POST['range_account'])) {
|
if ($value == 'range_account' && empty($_POST['range_account'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($value == 'country' || $value == 'country_id') {
|
if (($value == 'country' || $value == 'country_id') && (!empty($_POST['country_id']))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!GETPOSTISSET($value) || GETPOST($value) == '') {
|
if (!GETPOSTISSET($value) || GETPOST($value) == '') {
|
||||||
@ -176,6 +176,9 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||||||
if ($fieldnamekey == 'category_type') {
|
if ($fieldnamekey == 'category_type') {
|
||||||
$fieldnamekey = 'Calculated';
|
$fieldnamekey = 'Calculated';
|
||||||
}
|
}
|
||||||
|
if ($fieldnamekey == 'country') {
|
||||||
|
$fieldnamekey = 'Country';
|
||||||
|
}
|
||||||
|
|
||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||||
}
|
}
|
||||||
@ -263,7 +266,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si verif ok et action modify, on modifie la ligne
|
// If check ok and action modify, we modify the line
|
||||||
if ($ok && GETPOST('actionmodify', 'alpha')) {
|
if ($ok && GETPOST('actionmodify', 'alpha')) {
|
||||||
if ($tabrowid[$id]) {
|
if ($tabrowid[$id]) {
|
||||||
$rowidcol = $tabrowid[$id];
|
$rowidcol = $tabrowid[$id];
|
||||||
@ -430,12 +433,12 @@ print load_fiche_titre($titre, $linkback, $titlepicto);
|
|||||||
|
|
||||||
print '<span class="opacitymedium">'.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'</span><br><br>';
|
print '<span class="opacitymedium">'.$langs->trans("AccountingAccountGroupsDesc", $langs->transnoentitiesnoconv("ByPersonalizedAccountGroups")).'</span><br><br>';
|
||||||
|
|
||||||
// Confirmation de la suppression de la ligne
|
// Confirmation of the deletion of the line
|
||||||
if ($action == 'delete') {
|
if ($action == 'delete') {
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id > 0 ? '&search_country_id='.$search_country_id : ''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id.($search_country_id > 0 ? '&search_country_id='.$search_country_id : ''), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Complete requete recherche valeurs avec critere de tri
|
// Complete search query with sorting criteria
|
||||||
$sql = $tabsql[$id];
|
$sql = $tabsql[$id];
|
||||||
|
|
||||||
if ($search_country_id > 0) {
|
if ($search_country_id > 0) {
|
||||||
@ -634,14 +637,14 @@ if ($resql) {
|
|||||||
// Title of lines
|
// Title of lines
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
foreach ($fieldlist as $field => $value) {
|
foreach ($fieldlist as $field => $value) {
|
||||||
// Determine le nom du champ par rapport aux noms possibles
|
// Determines the name of the field in relation to the possible names
|
||||||
// dans les dictionnaires de donnees
|
// in data dictionaries
|
||||||
$showfield = 1; // By defaut
|
$showfield = 1; // By default
|
||||||
$class = "left";
|
$class = "left";
|
||||||
$sortable = 1;
|
$sortable = 1;
|
||||||
$valuetoshow = '';
|
$valuetoshow = '';
|
||||||
|
|
||||||
$valuetoshow = ucfirst($fieldlist[$field]); // By defaut
|
$valuetoshow = ucfirst($fieldlist[$field]); // By default
|
||||||
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
$valuetoshow = $langs->trans($valuetoshow); // try to translate
|
||||||
if ($fieldlist[$field] == 'source') {
|
if ($fieldlist[$field] == 'source') {
|
||||||
$valuetoshow = $langs->trans("Contact");
|
$valuetoshow = $langs->trans("Contact");
|
||||||
|
|||||||
@ -961,7 +961,7 @@ while ($i < min($num, $limit)) {
|
|||||||
// Firstname
|
// Firstname
|
||||||
if (!empty($arrayfields['d.firstname']['checked'])) {
|
if (!empty($arrayfields['d.firstname']['checked'])) {
|
||||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">';
|
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->firstname).'">';
|
||||||
print $memberstatic->getNomUrl(0, 0, 'card', 'fistname');
|
print $memberstatic->getNomUrl(0, 0, 'card', 'firstname');
|
||||||
//print $obj->firstname;
|
//print $obj->firstname;
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
if (!$i) {
|
if (!$i) {
|
||||||
|
|||||||
@ -2563,8 +2563,13 @@ class Propal extends CommonObject
|
|||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PDF
|
||||||
|
$hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
|
||||||
|
$hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
|
||||||
|
$hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
|
||||||
|
|
||||||
//$ret=$object->fetch($id); // Reload to get new records
|
//$ret=$object->fetch($id); // Reload to get new records
|
||||||
$this->generateDocument($modelpdf, $outputlangs);
|
$this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
@ -2651,8 +2656,13 @@ class Propal extends CommonObject
|
|||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PDF
|
||||||
|
$hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
|
||||||
|
$hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
|
||||||
|
$hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
|
||||||
|
|
||||||
//$ret=$object->fetch($id); // Reload to get new records
|
//$ret=$object->fetch($id); // Reload to get new records
|
||||||
$this->generateDocument($modelpdf, $outputlangs);
|
$this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->oldcopy = clone $this;
|
$this->oldcopy = clone $this;
|
||||||
|
|||||||
@ -309,7 +309,7 @@ class FormActions
|
|||||||
$tmpa = dol_getdate($actioncomm->datep);
|
$tmpa = dol_getdate($actioncomm->datep);
|
||||||
$tmpb = dol_getdate($actioncomm->datef);
|
$tmpb = dol_getdate($actioncomm->datef);
|
||||||
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) {
|
if ($tmpa['mday'] == $tmpb['mday'] && $tmpa['mon'] == $tmpb['mon'] && $tmpa['year'] == $tmpb['year']) {
|
||||||
if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes'] && $tmpa['seconds'] != $tmpb['seconds']) {
|
if ($tmpa['hours'] != $tmpb['hours'] || $tmpa['minutes'] != $tmpb['minutes']) {
|
||||||
print '-'.dol_print_date($actioncomm->datef, 'hour', 'tzuserrel');
|
print '-'.dol_print_date($actioncomm->datef, 'hour', 'tzuserrel');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -698,8 +698,14 @@ class RecruitmentJobPosition extends CommonObject
|
|||||||
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
|
$newlang = (GETPOST('lang_id', 'aZ09') ? GETPOST('lang_id', 'aZ09') : $this->thirdparty->default_lang);
|
||||||
$outputlangs->setDefaultLang($newlang);
|
$outputlangs->setDefaultLang($newlang);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PDF
|
||||||
|
$hidedetails = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0);
|
||||||
|
$hidedesc = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0);
|
||||||
|
$hideref = (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0);
|
||||||
|
|
||||||
//$ret=$object->fetch($id); // Reload to get new records
|
//$ret=$object->fetch($id); // Reload to get new records
|
||||||
$this->generateDocument($modelpdf, $outputlangs);
|
$this->generateDocument($modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error) {
|
if (!$error) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user