Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
b7c242c210
@ -200,11 +200,14 @@ if ($action == 'add') {
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$help_url = 'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
|
||||
$title = $langs->trans('MenuBankInternalTransfer');
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
|
||||
print ' <script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(".selectbankaccount").change(function() {
|
||||
@ -273,7 +276,6 @@ print ' <script type="text/javascript">
|
||||
});
|
||||
</script>';
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
print load_fiche_titre($langs->trans("MenuBankInternalTransfer"), '', 'bank_account');
|
||||
|
||||
@ -290,9 +292,13 @@ print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablemouvbank" class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("TransferFrom").'</td><td>'.$langs->trans("TransferTo").'</td><td>'.$langs->trans("Type").'</td><td>'.$langs->trans("Date").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Amount").'</td>';
|
||||
print '<td style="display:none" class="multicurrency">'.$langs->trans("AmountToOthercurrency").'</td>';
|
||||
print '<th>'.$langs->trans("TransferFrom").'</th>';
|
||||
print '<th>'.$langs->trans("TransferTo").'</th>';
|
||||
print '<th>'.$langs->trans("Type").'</th>';
|
||||
print '<th>'.$langs->trans("Date").'</th>';
|
||||
print '<th>'.$langs->trans("Description").'</th>';
|
||||
print '<th class="right">'.$langs->trans("Amount").'</th>';
|
||||
//print '<td class="hideobject" class="multicurrency">'.$langs->trans("AmountToOthercurrency").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
for ($i = 1 ; $i < $MAXLINES; $i++) {
|
||||
@ -312,19 +318,18 @@ for ($i = 1 ; $i < $MAXLINES; $i++) {
|
||||
$classi .= ' hidejs hideobject';
|
||||
}
|
||||
|
||||
|
||||
print '<tr class="oddeven '.$classi.'"><td>';
|
||||
print '<tr class="oddeven nowraponall '.$classi.'"><td>';
|
||||
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||
$form->select_comptes(($errori[$i] ? GETPOST($i.'_account_from', 'int') : ''), $i.'_account_from', 0, '', 1, ($errori[$i] ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||
print '</td>';
|
||||
|
||||
print "<td>\n";
|
||||
print '<td class="nowraponall">';
|
||||
print img_picto('', 'bank_account', 'class="paddingright"');
|
||||
$form->select_comptes(($errori[$i] ? GETPOST($i.'_account_to', 'int') : ''), $i.'_account_to', 0, '', 1, ($errori[$i] ? 'view=view' : ''), isModEnabled('multicurrency') ? 1 : 0, 'minwidth100');
|
||||
print "</td>\n";
|
||||
|
||||
// Payment mode
|
||||
print "<td>\n";
|
||||
print '<td class="nowraponall">';
|
||||
$idpaymentmodetransfer = dol_getIdFromCode($db, 'VIR', 'c_paiement');
|
||||
$form->select_types_paiements(($errori[$i] ? GETPOST($i.'_type', 'aZ09') : $idpaymentmodetransfer), $i.'_type', '', 0, 1, 0, 0, 1, 'minwidth100');
|
||||
print "</td>\n";
|
||||
|
||||
@ -88,16 +88,16 @@ class box_birthdays extends ModeleBoxes
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth as datea, date_format(u.birth, '%d') as daya, 'birth' as typea, u.email, u.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
$sql .= " AND u.statut = 1";
|
||||
$sql .= " AND u.statut = ".User::STATUS_ENABLED;
|
||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||
$sql .= ' UNION ';
|
||||
$sql .= "SELECT u.rowid, u.firstname, u.lastname, u.dateemployment as datea, date_format(u.dateemployment, '%d') as daya, 'employment' as typea, u.email, u.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.entity IN (".getEntity('user').")";
|
||||
$sql .= " AND u.statut = 1";
|
||||
$sql .= " AND u.statut = ".User::STATUS_ENABLED;
|
||||
$sql .= dolSqlDateFilter('u.dateemployment', 0, $tmparray['mon'], 0);
|
||||
|
||||
$sql .= " ORDER BY daya ASC";
|
||||
$sql .= " ORDER BY daya ASC"; // We want to have date of the month sorted by the day without taking into consideration the year
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@ -85,12 +85,12 @@ class box_birthdays_members extends ModeleBoxes
|
||||
if ($user->rights->adherent->lire) {
|
||||
$tmparray = dol_getdate(dol_now(), true);
|
||||
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth";
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, u.birth, date_format(u.birth, '%d') as daya, u.email, u.statut as status, u.datefin";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as u";
|
||||
$sql .= " WHERE u.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND u.statut = ".Adherent::STATUS_VALIDATED;
|
||||
$sql .= dolSqlDateFilter('u.birth', 0, $tmparray['mon'], 0);
|
||||
$sql .= " ORDER BY DAY(u.birth) ASC";
|
||||
$sql .= " ORDER BY daya ASC"; // We want to have date of the month sorted by the day without taking into consideration the year
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
|
||||
dol_syslog(get_class($this)."::loadBox", LOG_DEBUG);
|
||||
@ -104,9 +104,16 @@ class box_birthdays_members extends ModeleBoxes
|
||||
$memberstatic->id = $objp->rowid;
|
||||
$memberstatic->firstname = $objp->firstname;
|
||||
$memberstatic->lastname = $objp->lastname;
|
||||
$memberstatic->email = $objp->email;
|
||||
$memberstatic->status = $objp->status;
|
||||
$memberstatic->statut = $memberstatic->status;
|
||||
$memberstatic->datefin = $this->db->jdate($objp->datefin);
|
||||
//$memberstatic->need_subscription = 1;
|
||||
$dateb = $this->db->jdate($objp->birth);
|
||||
$age = date('Y', dol_now()) - date('Y', $dateb);
|
||||
|
||||
$typea = '<i class="fas fa-birthday-cake inline-block"></i>';
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => '',
|
||||
'text' => $memberstatic->getNomUrl(1),
|
||||
@ -118,6 +125,12 @@ class box_birthdays_members extends ModeleBoxes
|
||||
'text' => dol_print_date($dateb, "day", 'tzserver').' - '.$age.' '.$langs->trans('DurationYears')
|
||||
);
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="center nowraponall"',
|
||||
'text' => $typea,
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
/*$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $memberstatic->LibStatut($objp->status, 3)
|
||||
|
||||
@ -112,6 +112,11 @@ class DolGraph
|
||||
$this->datacolor = array(array(120, 130, 150), array(160, 160, 180), array(190, 190, 220));
|
||||
$this->bgcolor = array(235, 235, 224);
|
||||
|
||||
// For small screen, we prefer a default with of 300
|
||||
if (!empty($conf->dol_optimize_smallscreen)) {
|
||||
$this->width = 300;
|
||||
}
|
||||
|
||||
// Load color of the theme
|
||||
$color_file = DOL_DOCUMENT_ROOT . '/theme/' . $conf->theme . '/theme_vars.inc.php';
|
||||
if (is_readable($color_file)) {
|
||||
|
||||
@ -6729,8 +6729,8 @@ class Form
|
||||
}
|
||||
|
||||
// Zone de saisie manuelle de la date
|
||||
$retstring .= '<div class="nowrap inline-block divfordateinput">';
|
||||
$retstring .= '<input id="' . $prefix . '" name="' . $prefix . '" type="text" class="maxwidthdate" maxlength="11" value="' . $formated_date . '"';
|
||||
$retstring .= '<div class="nowraponall inline-block divfordateinput">';
|
||||
$retstring .= '<input id="'.$prefix.'" name="'.$prefix.'" type="text" class="maxwidthdate" maxlength="11" value="'.$formated_date.'"';
|
||||
$retstring .= ($disabled ? ' disabled' : '');
|
||||
$retstring .= ($placeholder ? ' placeholder="' . dol_escape_htmltag($placeholder) . '"' : '');
|
||||
$retstring .= ' onChange="dpChangeDay(\'' . dol_escape_js($prefix) . '\',\'' . dol_escape_js($langs->trans("FormatDateShortJavaInput")) . '\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
|
||||
|
||||
@ -98,7 +98,7 @@ class FormMargin
|
||||
}
|
||||
|
||||
$pv = $line->total_ht;
|
||||
$pa_ht = (($pv < 0 || ($pv == 0 && $object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE)) ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
|
||||
$pa_ht = (($pv < 0 || ($pv == 0 && in_array($object->element, array('facture', 'facture_fourn')) && $object->type == $object::TYPE_CREDIT_NOTE)) ? -$line->pa_ht : $line->pa_ht); // We choosed to have line->pa_ht always positive in database, so we guess the correct sign
|
||||
if (getDolGlobalInt('INVOICE_USE_SITUATION') == 1) { // Special case for old situation mode
|
||||
if (($object->element == 'facture' && $object->type == $object::TYPE_SITUATION)
|
||||
|| ($object->element == 'facture' && $object->type == $object::TYPE_CREDIT_NOTE && getDolGlobalInt('INVOICE_USE_SITUATION_CREDIT_NOTE') && $object->situation_counter > 0)) {
|
||||
|
||||
@ -102,8 +102,14 @@ $(document).ready(function () {
|
||||
</script>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"' : '' ?>>
|
||||
<div class="login_center center"<?php
|
||||
if (empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||
$backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
|
||||
// old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
|
||||
$backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
|
||||
print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';
|
||||
}
|
||||
?>>
|
||||
<div class="login_vertical_align">
|
||||
|
||||
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
||||
|
||||
@ -134,7 +134,14 @@ $(document).ready(function () {
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<div class="login_center center"<?php print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));"' : '' ?>>
|
||||
<div class="login_center center"<?php
|
||||
if (empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||
$backstyle = 'background: linear-gradient('.($conf->browser->layout == 'phone' ? '0deg' : '4deg').', rgb(240,240,240) 52%, rgb('.$colorbackhmenu1.') 52.1%);';
|
||||
// old style: $backstyle = 'background-image: linear-gradient(rgb('.$colorbackhmenu1.',0.3), rgb(240,240,240));';
|
||||
$backstyle = getDolGlobalString('MAIN_LOGIN_BACKGROUND_STYLE', $backstyle);
|
||||
print empty($conf->global->MAIN_LOGIN_BACKGROUND) ? ' style="background-size: cover; background-position: center center; background-attachment: fixed; background-repeat: no-repeat; '.$backstyle.'"' : '';
|
||||
}
|
||||
?>>
|
||||
<div class="login_vertical_align">
|
||||
|
||||
<form id="login" name="login" method="POST" action="<?php echo $php_self; ?>">
|
||||
|
||||
@ -4051,8 +4051,8 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::updateline", LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if (!$error) {
|
||||
$result = $this->insertExtraFields();
|
||||
if ($result < 0) {
|
||||
@ -4061,7 +4061,6 @@ class CommandeFournisseurLigne extends CommonOrderLine
|
||||
}
|
||||
|
||||
if (!$error && !$notrigger) {
|
||||
global $user;
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('LINEORDER_SUPPLIER_MODIFY', $user);
|
||||
if ($result < 0) {
|
||||
|
||||
@ -668,7 +668,7 @@ if (!defined('NOLOGIN')) {
|
||||
} else {
|
||||
// Authentication mode
|
||||
if (empty($dolibarr_main_authentication)) {
|
||||
$dolibarr_main_authentication = 'http,dolibarr';
|
||||
$dolibarr_main_authentication = 'dolibarr';
|
||||
}
|
||||
// Authentication mode: forceuser
|
||||
if ($dolibarr_main_authentication == 'forceuser' && empty($dolibarr_auto_user)) {
|
||||
|
||||
@ -78,7 +78,7 @@ $conf->file->main_limit_users = $dolibarr_main_limit_users;
|
||||
$conf->file->mailing_limit_sendbyweb = empty($dolibarr_mailing_limit_sendbyweb) ? 0 : $dolibarr_mailing_limit_sendbyweb;
|
||||
$conf->file->mailing_limit_sendbycli = empty($dolibarr_mailing_limit_sendbycli) ? 0 : $dolibarr_mailing_limit_sendbycli;
|
||||
$conf->file->mailing_limit_sendbyday = empty($dolibarr_mailing_limit_sendbyday) ? 0 : $dolibarr_mailing_limit_sendbyday;
|
||||
$conf->file->main_authentication = empty($dolibarr_main_authentication) ? '' : $dolibarr_main_authentication; // Identification mode
|
||||
$conf->file->main_authentication = empty($dolibarr_main_authentication) ? 'dolibarr' : $dolibarr_main_authentication; // Identification mode
|
||||
$conf->file->main_force_https = empty($dolibarr_main_force_https) ? '' : $dolibarr_main_force_https; // Force https
|
||||
$conf->file->strict_mode = empty($dolibarr_strict_mode) ? '' : $dolibarr_strict_mode; // Force php strict mode (for debug)
|
||||
$conf->file->instance_unique_id = empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id; // Unique id of instance
|
||||
|
||||
@ -4252,7 +4252,7 @@ class Product extends CommonObject
|
||||
$sql = "SELECT MAX(rang) as max_rank FROM ".$this->db->prefix()."product_association";
|
||||
$sql .= " WHERE fk_product_pere = ".((int) $id_pere);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql > 0) {
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$rank = $obj->max_rank + 1;
|
||||
//Addition of a product with the highest rank +1
|
||||
|
||||
@ -544,6 +544,16 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
|
||||
$this->assertTrue($ok, 'Found a preg_grep with a param that is a $var but without preg_quote in file '.$file['relativename'].'.');
|
||||
|
||||
|
||||
// Test we don't have "if ($resql >"
|
||||
$ok=true;
|
||||
$matches=array();
|
||||
preg_match_all('/if \(\$resql >/', $filecontent, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $key => $val) {
|
||||
$ok=false;
|
||||
break;
|
||||
}
|
||||
$this->assertTrue($ok, 'Found a if $resql with a > operator (when $resql is a boolean or resource) in file '.$file['relativename'].'. Please remove the > ... part.');
|
||||
|
||||
// Test we don't have empty($user->hasRight
|
||||
$ok=true;
|
||||
$matches=array();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user