diff --git a/build/makepack-howto.txt b/build/makepack-howto.txt index 477d129d459..d4e37e32629 100644 --- a/build/makepack-howto.txt +++ b/build/makepack-howto.txt @@ -8,12 +8,13 @@ This files describe steps made by Dolibarr packaging team to make a beta version of Dolibarr, step by step. - Check all files are commited. -- Update version/info in ChangeLog. -To generate a changelog of a major new version x.y.0 (from develop repo), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" -To generate a changelog of a major new version x.y.0 (from x.y repo), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" +- Update version/info in ChangeLog, for this you can: +To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" +To generate a changelog of a major new version x.y.0 (from a repo on branch x.y repo), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" -- To know number of lines changes: git diff --shortstat A B -- Update version number with x.y.z-w in htdocs/filefunc.inc.php +Recopy the content of the output file into the file ChangeLog. +- Note: To know number of lines changes: git diff --shortstat A B +- Update version number with x.y.z-w in file htdocs/filefunc.inc.php - Commit all changes. - Run makepack-dolibarr.pl to generate all packages. @@ -24,7 +25,6 @@ To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dol (/home/dolibarr/wwwroot/files/lastbuild). - Post a news on dolibarr.org/dolibarr.fr + social networks -- Send mail on mailings-list ***** Actions to do a RELEASE ***** @@ -32,12 +32,13 @@ This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step. - Check all files are commited. -- Update version/info in ChangeLog. -To generate a changelog of a major new version x.y.0 (from develop repo), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" -To generate a changelog of a major new version x.y.0 (from x.y repo), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" +- Update version/info in ChangeLog, for this you can: +To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" +To generate a changelog of a major new version x.y.0 (from a repo pn branch x.y), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa" -- To know number of lines changes: git diff --shortstat A B -- Update version number with x.y.z in htdocs/filefunc.inc.php +Recopy the content of the output file into the file ChangeLog. +- Note: To know the number of lines changes: git diff --shortstat A B +- Update version number with x.y.z in file htdocs/filefunc.inc.php - Commit all changes. - Run makepack-dolibarr.pl to generate all packages. @@ -52,4 +53,3 @@ To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dol on server to point to new files (used by some web sites). - Post a news on dolibarr.org/dolibarr.fr + social networks -- Send mail on mailings-list diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index d10e789f39c..e58cf45dd7e 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -435,7 +435,8 @@ foreach ($configfileparameters as $key => $value) { if (empty($valuetoshow)) { print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id'); } - print '   ('.$langs->trans("HashForPing").'='.md5('dolibarr'.$valuetoshow).')'; + print ''; + print '  => '.$langs->trans("HashForPing").''.md5('dolibarr'.$valuetoshow).''."\n"; } elseif ($newkey == 'dolibarr_main_prod') { print ${$newkey}; diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php index 9bf7dd7c117..81ba8e3b09d 100644 --- a/htdocs/api/class/api_documents.class.php +++ b/htdocs/api/class/api_documents.class.php @@ -611,6 +611,16 @@ class Documents extends DolibarrApi require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; $object = new FactureFournisseur($this->db); + } elseif ($modulepart == 'commande' || $modulepart == 'order') { + $modulepart = 'commande'; + + require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; + $object = new Commande($this->db); + } elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') { + $modulepart = 'supplier_order'; + + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; + $object = new CommandeFournisseur($this->db); } elseif ($modulepart == 'project') { require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; $object = new Project($this->db); @@ -669,7 +679,7 @@ class Documents extends DolibarrApi } // Special cases that need to use get_exdir to get real dir of object - // If future, all object should use this to define path of documents. + // In future, all object should use this to define path of documents. if ($modulepart == 'supplier_invoice') { $tmpreldir = get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier'); } diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 8ca3272dd78..0c61cf0a3c2 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -778,13 +778,13 @@ if ($action == 'create') { print ''; if ($conf->prelevement->enabled) { - print ''.$langs->trans("ICS").' ('.$langs->trans("StandingOrder").')'; + print ''.$form->textwithpicto($langs->trans("ICS"), $langs->trans("ICS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("StandingOrder")).')').''; print ''.$object->ics.''; print ''; } if ($conf->paymentbybanktransfer->enabled) { - print ''.$langs->trans("ICS").' ('.$langs->trans("BankTransfer").')'; + print ''.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').''; print ''.$object->ics_transfer.''; print ''; @@ -1082,12 +1082,12 @@ if ($action == 'create') { print ''; if ($conf->prelevement->enabled) { - print ''.$langs->trans("ICS").' ('.$langs->trans("StandingOrder").')'; + print ''.$form->textwithpicto($langs->trans("ICS"), $langs->trans("ICS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("StandingOrder")).')').''; print ''; } if ($conf->paymentbybanktransfer->enabled) { - print ''.$langs->trans("ICS").' ('.$langs->trans("BankTransfer").')'; + print ''.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').''; print ''; print ''.$langs->trans("SEPAXMLPlacePaymentTypeInformationInCreditTransfertransactionInformation").''; diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 35c6aa399fe..9bd37eafa36 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -32,8 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/vat.lib.php'; $langs->loadLangs(array('compta', 'banks', 'bills')); $id = GETPOST("id", 'int'); -$action = GETPOST("action", "alpha"); -$cancel = GETPOST('cancel'); +$action = GETPOST("action", "aZ09"); +$cancel = GETPOST('cancel', 'aZ09'); $refund = GETPOST("refund", "int"); if (empty($refund)) { @@ -143,7 +143,7 @@ $form = new Form($db); $title = $langs->trans("LT".$object->ltt)." - ".$langs->trans("Card"); $help_url = ''; -llxHeader("", $title, $helpurl); +llxHeader('', $title, $helpurl); if ($action == 'create') { print load_fiche_titre($langs->transcountry($lttype == 2 ? "newLT2Payment" : "newLT1Payment", $mysoc->country_code)); @@ -157,11 +157,13 @@ if ($action == 'create') { print ''; + // Date of payment print ""; print ''; + // End date of period print ''; @@ -173,20 +175,24 @@ if ($action == 'create') { print ''; if (!empty($conf->banque->enabled)) { - print ''; - + // Type payment print '\n"; print ""; + // Bank account + print ''; + // Number print ''."\n"; } + // Other attributes $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook diff --git a/htdocs/compta/localtax/list.php b/htdocs/compta/localtax/list.php index 6590e250832..6f6fc303262 100644 --- a/htdocs/compta/localtax/list.php +++ b/htdocs/compta/localtax/list.php @@ -63,6 +63,7 @@ if ($result) { $i = 0; $total = 0; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print '
'.$langs->trans("DatePayment").''; print $form->selectDate($datep, "datep", '', '', '', 'add', 1, 1); print '
'.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; print $form->selectDate($datev, "datev", '', '', '', 'add', 1, 1); print '
'.$langs->trans("Amount").'
'.$langs->trans("Account").''; - $form->select_comptes(GETPOST("accountid", "int"), "accountid", 0, "courant=1", 2); // Affiche liste des comptes courant - print '
'.$langs->trans("PaymentMode").''; - $form->select_types_paiements(GETPOST("paiementtype"), "paiementtype"); + $form->select_types_paiements(GETPOST("paiementtype"), "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx'); print "
'.$langs->trans("Account").''; + print img_picto('', 'bank_account', 'pictofixedwidth'); + $form->select_comptes(GETPOST("accountid", "int"), "accountid", 0, "courant=1", 2, '', 0, 'maxwidth500 widthcentpercentminusx'); // Affiche liste des comptes courant + print '
'.$langs->trans('Numero'); print ' ('.$langs->trans("ChequeOrTransferNumber").')'; print '
'; print ''; print ''; @@ -85,7 +86,7 @@ if ($result) { print '\n"; $total = $total + $obj->amount; - print ""; + print ''; print "\n"; $i++; @@ -94,6 +95,8 @@ if ($result) { print ''; print "
'.$langs->trans("Ref").''.dol_print_date($db->jdate($obj->datep), 'day')."".price($obj->amount)."'.price($obj->amount).'
'.price($total).'
"; + print ''; + $db->free($result); } else { dol_print_error($db); diff --git a/htdocs/compta/paiement_vat.php b/htdocs/compta/paiement_vat.php index ce224735927..28bc838c296 100644 --- a/htdocs/compta/paiement_vat.php +++ b/htdocs/compta/paiement_vat.php @@ -207,14 +207,15 @@ if ($action == 'create') { print ''; print ''.$langs->trans("PaymentMode").''; - $form->select_types_paiements(GETPOSTISSET("paiementtype") ? GETPOST("paiementtype", "int") : $tva->paiementtype, "paiementtype"); + $form->select_types_paiements(GETPOSTISSET("paiementtype") ? GETPOST("paiementtype", "int") : $tva->paiementtype, "paiementtype", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx'); print "\n"; print ''; print ''; print ''.$langs->trans('AccountToDebit').''; print ''; - $form->select_comptes(GETPOST("accountid") ? GETPOST("accountid", "int") : $tva->accountid, "accountid", 0, '', 1); // Show opend bank account list + print img_picto('', 'bank_account', 'pictofixedwidth'); + $form->select_comptes(GETPOST("accountid", "int") ? GETPOST("accountid", "int") : $tva->accountid, "accountid", 0, '', 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // Show opend bank account list print ''; // Number @@ -225,7 +226,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans("Comments").''; - print ''; + print ''; print ''; print ''; @@ -238,6 +239,7 @@ if ($action == 'create') { $num = 1; $i = 0; + print '
'; // You can use div-table-responsive-no-min if you dont need reserved height for your table print ''; print ''; //print ''; @@ -259,14 +261,14 @@ if ($action == 'create') { if ($objp->datev > 0) { print ''."\n"; } else { - print "\n"; + print ''."\n"; } - print '"; + print '"; - print '"; + print '"; - print '"; + print '"; print '
'.$langs->trans("SocialContribution").''.dol_print_date($objp->datev, 'day').'!!!!!!'.price($objp->amount)."'.price($objp->amount)."'.price($sumpaid)."'.price($sumpaid)."'.price($objp->amount - $sumpaid)."'.price($objp->amount - $sumpaid)."'; @@ -279,7 +281,7 @@ if ($action == 'create') { } */ $remaintopay = $objp->amount - $sumpaid; print ''; - print ''; + print ''; } else { print '-'; } @@ -303,6 +305,7 @@ if ($action == 'create') { } print "
"; + print '
'; // Bouton Save payment print '
'.$langs->trans("ClosePaidVATAutomatically"); diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 36d3afd42ad..4f9eb4e456e 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -922,7 +922,7 @@ class BonPrelevement extends CommonObject $sql = "SELECT substring(ref from char_length(ref) - 1)"; // To extract "YYMMXX" from "TYYMMXX" $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons"; - $sql .= " WHERE ref LIKE '%".$this->db->escape($ref)."%'"; + $sql .= " WHERE ref LIKE '_".$this->db->escape($ref)."%'"; $sql .= " AND entity = ".((int) $conf->entity); $sql .= " ORDER BY ref DESC LIMIT 1"; @@ -933,7 +933,7 @@ class BonPrelevement extends CommonObject $row = $this->db->fetch_row($resql); // Build the new ref - $ref = "T".$ref.str_pad(dol_substr("00".(intval($row[0]) + 1), 0, 2), 2, "0", STR_PAD_LEFT); + $ref = "T".$ref.sprintf("%02d", (intval($row[0]) + 1)); // $conf->abc->dir_output may be: // /home/ldestailleur/git/dolibarr_15.0/documents/abc/ diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 538b561e7fe..ed37c72c1c4 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -460,7 +460,7 @@ if ($action == 'create') { print '
'; print ''; - //print "
\n"; + print "\n"; // Label if ($refund == 1) { @@ -490,14 +490,15 @@ if ($action == 'create') { // Type payment print ''.$langs->trans("PaymentMode").''; - $form->select_types_paiements(GETPOST("type_payment"), "type_payment"); + $form->select_types_paiements(GETPOST("type_payment", 'int'), "type_payment", '', 0, 1, 0, 0, 1, 'maxwidth500 widthcentpercentminusx'); print "\n"; print ""; if (!empty($conf->banque->enabled)) { + // Bank account print ''.$langs->trans("BankAccount").''; print img_picto('', 'bank_account', 'pictofixedwidth'); - $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 1); // List of bank account available + $form->select_comptes(GETPOST("accountid", 'int'), "accountid", 0, "courant=1", 1, '', 0, 'maxwidth500 widthcentpercentminusx'); // List of bank account available print ''; } @@ -509,7 +510,7 @@ if ($action == 'create') { // Comments print ''; print ''.$langs->trans("Comments").''; - print ''; + print ''; print ''; // Other attributes diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b9812d8eec3..f86fcd88030 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9228,12 +9228,12 @@ class Form if (!empty($conf->gravatar->enabled) && $email && empty($noexternsourceoverwrite)) { // see https://gravatar.com/site/implement/images/php/ $ret .= ''; - $ret .= 'Gravatar avatar'; // gravatar need md5 hash + $ret .= ''; // gravatar need md5 hash } else { if ($nophoto == 'company') { - $ret .= '
'.img_picto('', 'company').'
'; + $ret .= '
'.img_picto('', 'company').'
'; } else { - $ret .= 'No photo'; + $ret .= ''; } } } diff --git a/htdocs/core/class/rssparser.class.php b/htdocs/core/class/rssparser.class.php index c3c434d1aed..93224b9f04d 100644 --- a/htdocs/core/class/rssparser.class.php +++ b/htdocs/core/class/rssparser.class.php @@ -227,11 +227,16 @@ class RssParser } else { try { $result = getURLContent($this->_urlRSS, 'GET', '', 1, array(), array('http', 'https'), 0); + if (!empty($result['content'])) { $str = $result['content']; + } elseif (!empty($result['curl_error_msg'])) { + $this->error = 'Error retrieving URL '.$this->_urlRSS.' - '.$result['curl_error_msg']; + return -1; } } catch (Exception $e) { - print 'Error retrieving URL '.$this->_urlRSS.' - '.$e->getMessage(); + $this->error = 'Error retrieving URL '.$this->_urlRSS.' - '.$e->getMessage(); + return -2; } } @@ -248,7 +253,8 @@ class RssParser } $xmlparser = xml_parser_create(''); - if (!is_resource($xmlparser)) { + + if (!is_resource($xmlparser) && !is_object($xmlparser)) { $this->error = "ErrorFailedToCreateParser"; return -1; } @@ -256,10 +262,11 @@ class RssParser xml_set_object($xmlparser, $this); xml_set_element_handler($xmlparser, 'feed_start_element', 'feed_end_element'); xml_set_character_data_handler($xmlparser, 'feed_cdata'); + $status = xml_parse($xmlparser, $str); xml_parser_free($xmlparser); $rss = $this; - //var_dump($rss->_format);exit; + //var_dump($status.' '.$rss->_format);exit; } } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 7e5746bf9bb..0aa8eb93d9d 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1904,7 +1904,7 @@ if ($action == 'create') { $currency_code = $conf->currency; $societe = ''; - if (GETPOST('socid') > 0) { + if (GETPOST('socid', 'int') > 0) { $societe = new Societe($db); $societe->fetch(GETPOST('socid', 'int')); if (!empty($conf->multicurrency->enabled) && !empty($societe->multicurrency_code)) { @@ -3466,10 +3466,9 @@ if ($action == 'create') { // Remainder to pay print ''; print ''; - if ($resteapayeraffiche >= 0) { - print $langs->trans('RemainderToPay'); - } else { - print $langs->trans('ExcessPaid'); + print $langs->trans('RemainderToPay'); + if ($resteapayeraffiche < 0) { + print ' ('.$langs->trans('NegativeIfExcessPaid').')'; } print ''; print ''; @@ -3479,10 +3478,9 @@ if ($action == 'create') { if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { print ''; print ''; - if ($resteapayeraffiche <= 0) { - print $langs->trans('RemainderToPayBackMulticurrency'); - } else { - print $langs->trans('ExcessPaidMulticurrency'); + print $langs->trans('RemainderToPayMulticurrency'); + if ($resteapayeraffiche < 0) { + print ' ('.$langs->trans('NegativeIfExcessPaid').')'; } print ''; print ''; @@ -3503,10 +3501,9 @@ if ($action == 'create') { // Remainder to pay back print ''; print ''; - if ($resteapayeraffiche <= 0) { - print $langs->trans('RemainderToPayBack'); - } else { - print $langs->trans('ExcessPaid'); + print $langs->trans('RemainderToPayBack'); + if ($resteapayeraffiche > 0) { + print ' ('.$langs->trans('NegativeIfExcessRefunded').')'; } print ''; print ''; @@ -3516,10 +3513,9 @@ if ($action == 'create') { if ($object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { print ''; print ''; - if ($resteapayeraffiche <= 0) { - print $langs->trans('RemainderToPayBackMulticurrency'); - } else { - print $langs->trans('ExcessPaidMulticurrency'); + print $langs->trans('RemainderToPayBackMulticurrency'); + if ($resteapayeraffiche> 0) { + print ' ('.$langs->trans('NegativeIfExcessRefunded').')'; } print ''; print ''; diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 33c000e4475..16d8a919dbe 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -615,12 +615,13 @@ jQuery(document).ready(function() { function init_needroot() { + console.log("init_needroot force_install_noedit="); /*alert(jQuery("#db_create_database").prop("checked")); */ if (jQuery("#db_create_database").is(":checked") || jQuery("#db_create_user").is(":checked")) { jQuery(".hideroot").show(); + if (empty($force_install_noedit)) { ?> jQuery(".needroot").removeAttr('disabled'); } diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 070f3a2c5da..4add688b880 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -559,6 +559,13 @@ DELETE FROM llx_rights_def WHERE module = 'hrm' AND perms = 'employee'; -- Sequence to fix the content of llx_bank.amount_main_currency +-- Note: amount is amount in currency of bank account +-- Note: pamount is always amount into the main currency +-- Note: pmulticurrencyamount is in currency of invoice +-- Note: amount_main_currency must be amount in main currency -- DROP TABLE tmp_bank; -- CREATE TABLE tmp_bank SELECT b.rowid, b.amount, p.rowid as pid, p.amount as pamount, p.multicurrency_amount as pmulticurrencyamount FROM llx_bank as b INNER JOIN llx_bank_url as bu ON bu.fk_bank=b.rowid AND bu.type = 'payment' INNER JOIN llx_paiement as p ON bu.url_id = p.rowid WHERE p.multicurrency_amount <> 0 AND p.multicurrency_amount <> p.amount; -- UPDATE llx_bank as b SET b.amount_main_currency = (SELECT tb.pamount FROM tmp_bank as tb WHERE tb.rowid = b.rowid) WHERE b.amount_main_currency IS NULL; +-- DROP TABLE tmp_bank2; +-- CREATE TABLE tmp_bank2 SELECT b.rowid, b.amount, p.rowid as pid, p.amount as pamount, p.multicurrency_amount as pmulticurrencyamount FROM llx_bank as b INNER JOIN llx_bank_url as bu ON bu.fk_bank=b.rowid AND bu.type = 'payment_supplier' INNER JOIN llx_paiementfourn as p ON bu.url_id = p.rowid WHERE p.multicurrency_amount <> 0 AND p.multicurrency_amount <> p.amount; +-- UPDATE llx_bank as b SET b.amount_main_currency = (SELECT tb.pamount FROM tmp_bank2 as tb WHERE tb.rowid = b.rowid) WHERE b.amount_main_currency IS NULL; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 1dc7d4e2092..0009cd00bcf 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2234,3 +2234,4 @@ TemplateforBusinessCards=Template for a business card in different size InventorySetup= Inventory Setup ExportUseLowMemoryMode=Use a low memory mode ExportUseLowMemoryModeHelp=Use the low memory mode to execute the exec of the dump (compression is done through a pipe instead of into the PHP memory). This method does not allow to check that file is completed and error message can't be reported if it fails. +HashForPing=Hash used for ping diff --git a/htdocs/langs/en_US/withdrawals.lang b/htdocs/langs/en_US/withdrawals.lang index 9d145ef354d..75cee952bcd 100644 --- a/htdocs/langs/en_US/withdrawals.lang +++ b/htdocs/langs/en_US/withdrawals.lang @@ -137,6 +137,7 @@ SEPAFRST=SEPA FRST ExecutionDate=Execution date CreateForSepa=Create direct debit file ICS=Creditor Identifier - ICS +IDS=Debitor Identifier END_TO_END="EndToEndId" SEPA XML tag - Unique id assigned per transaction USTRD="Unstructured" SEPA XML tag ADDDAYS=Add days to Execution Date @@ -154,4 +155,5 @@ ErrorCompanyHasDuplicateDefaultBAN=Company with id %s has more than one default ErrorICSmissing=Missing ICS in Bank account %s TotalAmountOfdirectDebitOrderDiffersFromSumOfLines=Total amount of direct debit order differs from sum of lines WarningSomeDirectDebitOrdersAlreadyExists=Warning: There is already some pending Direct Debit orders (%s) requested for an amount of %s -WarningSomeCreditTransferAlreadyExists=Warning: There is already some pending Credit Transfer (%s) requested for an amount of %s \ No newline at end of file +WarningSomeCreditTransferAlreadyExists=Warning: There is already some pending Credit Transfer (%s) requested for an amount of %s +UsedFor=Used for %s \ No newline at end of file diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 805d7b9e105..e2dd5f0f2b8 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -109,10 +109,11 @@ function testSqlAndScriptInject($val, $type) // We check string because some hacks try to obfuscate evil strings by inserting non printable chars. Example: 'java(ascci09)scr(ascii00)ipt' is processed like 'javascript' (whatever is place of evil ascii char) // We should use dol_string_nounprintableascii but function is not yet loaded/available // Example of valid UTF8 chars: - // utf8=utf8mb3: '\x0A', '\x0D', '\x7E' + // utf8=utf8mb3: '\x09', '\x0A', '\x0D', '\x7E' // utf8=utf8mb3: '\xE0\xA0\x80' // utf8mb4: '\xF0\x9D\x84\x9E' (but this may be refused by the database insert if pagecode is utf8=utf8mb3) - $newval = preg_replace('/[\x00-\x09\x0B-\x0C\x0E-\x1F\x7F]/u', '', $val); // /u operator makes UTF8 valid characters being ignored so are not included into the replace + $newval = preg_replace('/[\x00-\x08\x0B-\x0C\x0E-\x1F\x7F]/u', '', $val); // /u operator makes UTF8 valid characters being ignored so are not included into the replace + // Note that $newval may also be completely empty '' when non valid UTF8 are found. if ($newval != $val) { // If $val has changed after removing non valid UTF8 chars, it means we have an evil string. diff --git a/htdocs/product/card.php b/htdocs/product/card.php index efa14b1e582..fa69bbf0399 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1564,8 +1564,8 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Quality control if (!empty($conf->global->PRODUCT_LOT_ENABLE_QUALITY_CONTROL)) { - print ''.$langs->trans("LifeTime").''; - print ''.$langs->trans("QCFrequency").''; + print ''.$langs->trans("LifeTime").''; + print ''.$langs->trans("QCFrequency").''; } // Other attributes @@ -2611,19 +2611,19 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Custom code if (!$object->isService() && empty($conf->global->PRODUCT_DISABLE_CUSTOM_INFO)) { - print ''.$langs->trans("CustomCode").''.$object->customcode.''; + print ''.$langs->trans("CustomCode").''.$object->customcode.''; // Origin country code print ''.$langs->trans("Origin").''.getCountry($object->country_id, 0, $db); if (!empty($object->state_id)) { print ' - '.getState($object->state_id, 0, $db); } - print ''; + print ''; } // Quality Control if (!empty($conf->global->PRODUCT_LOT_ENABLE_QUALITY_CONTROL)) { - print ''.$langs->trans("LifeTime").''.$object->lifetime.''; + print ''.$langs->trans("LifeTime").''.$object->lifetime.''; print ''.$langs->trans("QCFrequency").''.$object->qc_frequency.''; }