Merge branch '13.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2021-02-17 14:28:19 +01:00
commit bfe71e8509
15 changed files with 121 additions and 98 deletions

View File

@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('errors', 'admin', 'modulebuilder')); $langs->loadLangs(array('errors', 'admin', 'modulebuilder', 'exports'));
$mode = GETPOST('mode', 'alpha'); $mode = GETPOST('mode', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');

View File

@ -1073,9 +1073,9 @@ if ($mode == 'deploy') {
} else { } else {
print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>'; print $langs->trans("ThisIsAlternativeProcessToFollow").'<br>';
print '<b>'.$langs->trans("StepNb", 1).'</b>: '; print '<b>'.$langs->trans("StepNb", 1).'</b>: ';
print $langs->trans("FindPackageFromWebSite", $fullurl).'<br>'; print str_replace('{s1}', $fullurl, $langs->trans("FindPackageFromWebSite", '{s1}')).'<br>';
print '<b>'.$langs->trans("StepNb", 2).'</b>: '; print '<b>'.$langs->trans("StepNb", 2).'</b>: ';
print $langs->trans("DownloadPackageFromWebSite", $fullurl).'<br>'; print str_replace('{s1}', $fullurl, $langs->trans("DownloadPackageFromWebSite", '{s1}')).'<br>';
print '<b>'.$langs->trans("StepNb", 3).'</b>: '; print '<b>'.$langs->trans("StepNb", 3).'</b>: ';
} }

View File

@ -238,7 +238,7 @@ if (empty($reshook))
elseif ($action == 'add' && $usercancreate) elseif ($action == 'add' && $usercancreate)
{ {
$datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')); $datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
$datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year')); $date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$selectedLines = GETPOST('toselect', 'array'); $selectedLines = GETPOST('toselect', 'array');
if ($datecommande == '') { if ($datecommande == '') {
@ -271,8 +271,8 @@ if (empty($reshook))
$object->fk_account = GETPOST('fk_account', 'int'); $object->fk_account = GETPOST('fk_account', 'int');
$object->availability_id = GETPOST('availability_id'); $object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id'); $object->demand_reason_id = GETPOST('demand_reason_id');
$object->date_livraison = $datelivraison; // deprecated $object->date_livraison = $date_delivery; // deprecated
$object->delivery_date = $datelivraison; $object->delivery_date = $date_delivery;
$object->shipping_method_id = GETPOST('shipping_method_id', 'int'); $object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->warehouse_id = GETPOST('warehouse_id', 'int'); $object->warehouse_id = GETPOST('warehouse_id', 'int');
$object->fk_delivery_address = GETPOST('fk_address'); $object->fk_delivery_address = GETPOST('fk_address');
@ -1628,7 +1628,7 @@ if ($action == 'create' && $usercancreate)
print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>'; print '<tr><td>'.$langs->trans("DateDeliveryPlanned").'</td>';
print '<td colspan="3">'; print '<td colspan="3">';
$date_delivery = ($date_delivery ? $date_delivery : $object->date_delivery); $date_delivery = ($date_delivery ? $date_delivery : $object->date_delivery);
print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print $form->selectDate($date_delivery ? $date_delivery : -1, 'liv_', 1, 1, 1);
print "</td>\n"; print "</td>\n";
print '</tr>'; print '</tr>';

View File

@ -4120,7 +4120,7 @@ if ($action == 'create')
if ($objectidnext > 0) { if ($objectidnext > 0) {
$facthatreplace = new Facture($db); $facthatreplace = new Facture($db);
$facthatreplace->fetch($objectidnext); $facthatreplace->fetch($objectidnext);
print ' <span class="opacitymediumbycolor paddingleft">('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')</span>'; print ' <span class="opacitymediumbycolor paddingleft">('.str_replace('{s1}', $facthatreplace->getNomUrl(1), $langs->transnoentities("ReplacedByInvoice", '{s1}')).')</span>';
} }
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) { if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
@ -4128,7 +4128,10 @@ if ($action == 'create')
$result = $discount->fetch(0, $object->id); $result = $discount->fetch(0, $object->id);
if ($result > 0) { if ($result > 0) {
print ' <span class="opacitymediumbycolor paddingleft">'; print ' <span class="opacitymediumbycolor paddingleft">';
print $langs->transnoentities("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')); $s = $langs->trans("CreditNoteConvertedIntoDiscount", '{s1}', '{s2}');
$s = str_replace('{s1}', $object->getLibType(1), $s);
$s = str_replace('{s2}', $discount->getNomUrl(1, 'discount'), $s);
print $s;
print '</span><br>'; print '</span><br>';
} }
} }
@ -4139,7 +4142,9 @@ if ($action == 'create')
$result = $tmptemplate->fetch($object->fk_fac_rec_source); $result = $tmptemplate->fetch($object->fk_fac_rec_source);
if ($result > 0) { if ($result > 0) {
print ' <span class="opacitymediumbycolor paddingleft">'; print ' <span class="opacitymediumbycolor paddingleft">';
print $langs->transnoentities("GeneratedFromTemplate", '<a href="'.DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$tmptemplate->id.'">'.dol_escape_htmltag($tmptemplate->ref).'</a>'); $s = $langs->transnoentities("GeneratedFromTemplate", '{s1}');
$s = str_replace('{s1}', '<a href="'.DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$tmptemplate->id.'">'.dol_escape_htmltag($tmptemplate->ref).'</a>', $s);
print $s;
print '</span>'; print '</span>';
} }
} }

View File

@ -1192,6 +1192,16 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
{ {
if ($nophperrors) $ok = @unlink($filename); if ($nophperrors) $ok = @unlink($filename);
else $ok = unlink($filename); else $ok = unlink($filename);
// If it fails and it is because of the missing write permission on parent dir
if (!$ok && file_exists(dirname($filename)) && !(fileperms(dirname($filename)) & 0200)) {
dol_syslog("Error in deletion, but parent directory exists with no permission to write, we try to change permission on parent directory and retry...", LOG_DEBUG);
@chmod(dirname($filename), fileperms(dirname($filename)) | 0200);
// Now we retry deletion
if ($nophperrors) $ok = @unlink($filename);
else $ok = unlink($filename);
}
if ($ok) if ($ok)
{ {
dol_syslog("Removed file ".$filename, LOG_DEBUG); dol_syslog("Removed file ".$filename, LOG_DEBUG);

View File

@ -47,7 +47,7 @@ class InterfaceContactRoles extends DolibarrTriggers
$this->description = "Triggers of this module auto link contact to company."; $this->description = "Triggers of this module auto link contact to company.";
// 'development', 'experimental', 'dolibarr' or version // 'development', 'experimental', 'dolibarr' or version
$this->version = self::VERSION_DOLIBARR; $this->version = self::VERSION_DOLIBARR;
$this->picto = 'action'; $this->picto = 'company';
} }
/** /**

View File

@ -2530,7 +2530,12 @@ if ($action == 'create')
$discount = new DiscountAbsolute($db); $discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, 0, $object->id); $result = $discount->fetch(0, 0, $object->id);
if ($result > 0) { if ($result > 0) {
print ' '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).'<br>'; print ' <span class="opacitymediumbycolor paddingleft">';
$s = $langs->trans("CreditNoteConvertedIntoDiscount", '{s1}', '{s2}');
$s = str_replace('{s1}', $object->getLibType(1), $s);
$s = str_replace('{s2}', $discount->getNomUrl(1, 'discount'), $s);
print $s;
print '</span><br>';
} }
} }
print '</td></tr>'; print '</td></tr>';

View File

@ -37,7 +37,7 @@ CREATE TABLE llx_recruitment_recruitmentcandidature(
date_birth date, date_birth date,
remuneration_requested integer, remuneration_requested integer,
remuneration_proposed integer, remuneration_proposed integer,
email_msgid varchar(255), email_msgid varchar(175), -- Do not use a too large value, it generates trouble with unique index
fk_recruitment_origin INTEGER NULL fk_recruitment_origin INTEGER NULL
-- END MODULEBUILDER FIELDS -- END MODULEBUILDER FIELDS
) ENGINE=innodb; ) ENGINE=innodb;

View File

@ -402,7 +402,7 @@ if ($id > 0 || $ref)
print '<div class="fichecenter">'; print '<div class="fichecenter">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield centpercent">';
// Cost price. Can be used for margin module for option "calculate margin on explicit cost price // Cost price. Can be used for margin module for option "calculate margin on explicit cost price
print '<tr><td>'; print '<tr><td>';
@ -415,14 +415,14 @@ if ($id > 0 || $ref)
print '</td></tr>'; print '</td></tr>';
// PMP // PMP
print '<tr><td class="titlefield">'.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).'</td>'; print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).'</td>';
print '<td>'; print '<td>';
if ($object->pmp > 0) print price($object->pmp).' '.$langs->trans("HT"); if ($object->pmp > 0) print price($object->pmp).' '.$langs->trans("HT");
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
// Best buying Price // Best buying Price
print '<tr><td class="titlefield">'.$langs->trans("BuyingPriceMin").'</td>'; print '<tr><td class="titlefieldcreate">'.$langs->trans("BuyingPriceMin").'</td>';
print '<td colspan="2">'; print '<td colspan="2">';
$product_fourn = new ProductFournisseur($db); $product_fourn = new ProductFournisseur($db);
if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0) if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0)
@ -462,7 +462,7 @@ if ($id > 0 || $ref)
print '<table class="border centpercent">'; print '<table class="border centpercent">';
// Supplier // Supplier
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Supplier").'</td><td>'; print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Supplier").'</td><td>';
if ($rowid) if ($rowid)
{ {
$supplier = new Fournisseur($db); $supplier = new Fournisseur($db);
@ -729,7 +729,7 @@ END;
// Option to define a transport cost on supplier price // Option to define a transport cost on supplier price
print '<tr>'; print '<tr>';
print '<td>'.$langs->trans('BarcodeValue').'</td>'; print '<td>'.$langs->trans('BarcodeValue').'</td>';
print '<td><input class="flat" name="barcode" value="'.($rowid ? $object->supplier_barcode : '').'"></td>'; print '<td>'.img_picto('', 'barcode', 'class="pictofixedwidth"').'<input class="flat" name="barcode" value="'.($rowid ? $object->supplier_barcode : '').'"></td>';
print '</tr>'; print '</tr>';
$formbarcode = new FormBarCode($db); $formbarcode = new FormBarCode($db);

View File

@ -9,7 +9,7 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
session_cache_limiter('public'); session_cache_limiter('public');
require_once '../../../main.inc.php'; require_once '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
?> ?>
@ -19,13 +19,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="Documentation and examples for theme."> <meta name="description" content="Documentation and examples for theme.">
<link href="../style.css.php" rel="stylesheet">
<link href="doc.css" rel="stylesheet"> <link href="<?php echo DOL_URL_ROOT ?>/theme/eldy/style.css.php" rel="stylesheet">
</head> </head>
<body class="docpage" > <body class="docpage" style="padding: 20px;">
<main role="main" > <main role="main" >
<h1 class="bd-title" id="content">Badges</h1> <h1 class="bd-title" id="content">Badges</h1>
<p class="bd-lead">Documentation and examples for badges, our small count and labeling component.</p> <p class="bd-lead">Documentation and examples for badges, our small count and labeling component.</p>
@ -33,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<h2 id="example">Example</h2> <h2 id="example">Example</h2>
<p>Badges scale to match the size of the immediate parent element by using relative font sizing and em units.</p> <p>Badges scale to match the size of the immediate parent element by using relative font sizing and em units.</p>
<div class="bd-example"> <div class="bd-example">
<h1>Example heading <span class="badge badge-secondary">New</span></h1> <h1>Example heading <span class="badge badge-secondary">New</span></h1>
<h2>Example heading <span class="badge badge-secondary">New</span></h2> <h2>Example heading <span class="badge badge-secondary">New</span></h2>
@ -42,39 +40,39 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<h5>Example heading <span class="badge badge-secondary">New</span></h5> <h5>Example heading <span class="badge badge-secondary">New</span></h5>
<h6>Example heading <span class="badge badge-secondary">New</span></h6> <h6>Example heading <span class="badge badge-secondary">New</span></h6>
</div> </div>
<figure class="highlight"> <figure class="highlight">
<pre> <pre>
&lt;h1&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h1&gt; &lt;h1&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h1&gt;
&lt;h2&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h2&gt; &lt;h2&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h2&gt;
&lt;h3&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h3&gt; &lt;h3&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h3&gt;
&lt;h4&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h4&gt; &lt;h4&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h4&gt;
&lt;h5&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h5&gt; &lt;h5&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h5&gt;
&lt;h6&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h6&gt; &lt;h6&gt;Example heading &lt;span class=&quot;badge badge-secondary&quot;&gt;New&lt;/span&gt;&lt;/h6&gt;
</pre> </pre>
</figure> </figure>
<p>Badges can be used as part of links or buttons to provide a counter.</p> <p>Badges can be used as part of links or buttons to provide a counter.</p>
<div class="bd-example"> <div class="bd-example">
<button type="button" class="button"> <button type="button" class="button">
Notifications <span class="badge badge-primary">4</span> Notifications <span class="badge badge-primary">4</span>
</button> </button>
</div> </div>
<figure class="highlight"><pre> <figure class="highlight"><pre>
&lt;button type=&quot;button&quot; class=&quot;button&quot;&gt; &lt;button type=&quot;button&quot; class=&quot;button&quot;&gt;
Notifications &lt;span class=&quot;badge badge-primary&quot;&gt;4&lt;/span&gt; Notifications &lt;span class=&quot;badge badge-primary&quot;&gt;4&lt;/span&gt;
&lt;/button&gt; &lt;/button&gt;
</pre></figure> </pre></figure>
<div class="warning"> <div class="warning">
<p>Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button.</p> <p>Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button.</p>
<p>Unless the context is clear (as with the “Notifications” example, where it is understood that the “4” is the number of notifications), consider including additional context with a visually hidden piece of additional text.</p> <p>Unless the context is clear (as with the “Notifications” example, where it is understood that the “4” is the number of notifications), consider including additional context with a visually hidden piece of additional text.</p>
<p><strong>Remember to use aria-label attribute for accessibility in Dolibarr. Don't forget to use aria-hidden on icons included in badges</strong></p> <p><strong>Remember to use aria-label attribute for accessibility in Dolibarr. Don't forget to use aria-hidden on icons included in badges</strong></p>
</div> </div>
@ -84,26 +82,26 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<span class="sr-only">unread messages</span> <span class="sr-only">unread messages</span>
</button> </button>
</div> </div>
<figure class="highlight"> <figure class="highlight">
<pre> <pre>
&lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot;&gt; &lt;button type=&quot;button&quot; class=&quot;btn btn-primary&quot;&gt;
Profile &lt;span class=&quot;badge badge-light&quot; aria-label=&quot;9 unread messages&quot; &gt;9&lt;/span&gt; Profile &lt;span class=&quot;badge badge-light&quot; aria-label=&quot;9 unread messages&quot; &gt;9&lt;/span&gt;
&lt;span class=&quot;sr-only&quot;&gt;unread messages&lt;/span&gt; &lt;span class=&quot;sr-only&quot;&gt;unread messages&lt;/span&gt;
&lt;/button&gt; &lt;/button&gt;
</pre> </pre>
</figure> </figure>
<h2 id="contextual-variations">Contextual variations</h2> <h2 id="contextual-variations">Contextual variations</h2>
<p>Add any of the below mentioned modifier classes to change the appearance of a badge.</p> <p>Add any of the below mentioned modifier classes to change the appearance of a badge.</p>
<div class="bd-example"> <div class="bd-example">
<span class="badge badge-primary">Primary</span> <span class="badge badge-primary">Primary</span>
<span class="badge badge-secondary">Secondary</span> <span class="badge badge-secondary">Secondary</span>
<span class="badge badge-success">Success</span> <span class="badge badge-success">Success</span>
@ -113,10 +111,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<span class="badge badge-light">Light</span> <span class="badge badge-light">Light</span>
<span class="badge badge-dark">Dark</span> <span class="badge badge-dark">Dark</span>
</div> </div>
<figure class="highlight"> <figure class="highlight">
<pre> <pre>
&lt;span class=&quot;badge badge-primary&quot;&gt;Primary&lt;/span&gt; &lt;span class=&quot;badge badge-primary&quot;&gt;Primary&lt;/span&gt;
&lt;span class=&quot;badge badge-secondary&quot;&gt;Secondary&lt;/span&gt; &lt;span class=&quot;badge badge-secondary&quot;&gt;Secondary&lt;/span&gt;
&lt;span class=&quot;badge badge-success&quot;&gt;Success&lt;/span&gt; &lt;span class=&quot;badge badge-success&quot;&gt;Success&lt;/span&gt;
@ -125,22 +123,22 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
&lt;span class=&quot;badge badge-info&quot;&gt;Info&lt;/span&gt; &lt;span class=&quot;badge badge-info&quot;&gt;Info&lt;/span&gt;
&lt;span class=&quot;badge badge-light&quot;&gt;Light&lt;/span&gt; &lt;span class=&quot;badge badge-light&quot;&gt;Light&lt;/span&gt;
&lt;span class=&quot;badge badge-dark&quot;&gt;Dark&lt;/span&gt; &lt;span class=&quot;badge badge-dark&quot;&gt;Dark&lt;/span&gt;
</pre> </pre>
</figure> </figure>
<div class="warning"> <div class="warning">
<h5 id="conveying-meaning-to-assistive-technologies">Conveying meaning to assistive technologies</h5> <h5 id="conveying-meaning-to-assistive-technologies">Conveying meaning to assistive technologies</h5>
<p>Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the .sr-only class.</p> <p>Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the .sr-only class.</p>
</div> </div>
<h2 id="contextual-variations">Default status</h2> <h2 id="contextual-variations">Default status</h2>
<p>Add any of the below mentioned modifier classes to change the appearance of a badge to be linked to a default status.</p> <p>Add any of the below mentioned modifier classes to change the appearance of a badge to be linked to a default status.</p>
<div class="bd-example"> <div class="bd-example">
<?php for ($i = 0; $i <= 9; $i++): ?> <?php for ($i = 0; $i <= 9; $i++): ?>
<span class="badge badge-status<?php print $i; ?>" >status-<?php print $i; ?></span> <span class="badge badge-status<?php print $i; ?>" >status-<?php print $i; ?></span>
@ -152,14 +150,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
&lt;span class="badge badge-status<?php print $i; ?>" &gt;status<?php print $i; ?>&lt;/span&gt; &lt;span class="badge badge-status<?php print $i; ?>" &gt;status<?php print $i; ?>&lt;/span&gt;
<?php endfor; ?> <?php endfor; ?>
</pre></figure> </pre></figure>
<h2 id="pill-badges">Pill badges</h2> <h2 id="pill-badges">Pill badges</h2>
<p>Use the .badge-pill modifier class to make badges more rounded (with a larger border-radius and additional horizontal padding).</p> <p>Use the .badge-pill modifier class to make badges more rounded (with a larger border-radius and additional horizontal padding).</p>
<div class="bd-example"> <div class="bd-example">
<span class="badge badge-pill badge-primary">Primary</span> <span class="badge badge-pill badge-primary">Primary</span>
<span class="badge badge-pill badge-secondary">Secondary</span> <span class="badge badge-pill badge-secondary">Secondary</span>
<span class="badge badge-pill badge-success">Success</span> <span class="badge badge-pill badge-success">Success</span>
@ -168,16 +166,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<span class="badge badge-pill badge-info">Info</span> <span class="badge badge-pill badge-info">Info</span>
<span class="badge badge-pill badge-light">Light</span> <span class="badge badge-pill badge-light">Light</span>
<span class="badge badge-pill badge-dark">Dark</span> <span class="badge badge-pill badge-dark">Dark</span>
<?php for ($i = 0; $i <= 9; $i++): ?> <?php for ($i = 0; $i <= 9; $i++): ?>
<span class="badge badge-pill badge-status<?php print $i; ?>" >status<?php print $i; ?></span> <span class="badge badge-pill badge-status<?php print $i; ?>" >status<?php print $i; ?></span>
<?php endfor; ?> <?php endfor; ?>
</div> </div>
<figure class="highlight"> <figure class="highlight">
<pre> <pre>
&lt;span class=&quot;badge badge-pill badge-primary&quot;&gt;Primary&lt;/span&gt; &lt;span class=&quot;badge badge-pill badge-primary&quot;&gt;Primary&lt;/span&gt;
&lt;span class=&quot;badge badge-pill badge-secondary&quot;&gt;Secondary&lt;/span&gt; &lt;span class=&quot;badge badge-pill badge-secondary&quot;&gt;Secondary&lt;/span&gt;
&lt;span class=&quot;badge badge-pill badge-success&quot;&gt;Success&lt;/span&gt; &lt;span class=&quot;badge badge-pill badge-success&quot;&gt;Success&lt;/span&gt;
@ -190,15 +188,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
&lt;span class="badge badge-pill badge-status<?php print $i; ?>" &gt;status<?php print $i; ?>&lt;/span&gt; &lt;span class="badge badge-pill badge-status<?php print $i; ?>" &gt;status<?php print $i; ?>&lt;/span&gt;
<?php endfor; ?> <?php endfor; ?>
</pre></figure> </pre></figure>
<h2 id="dot-badges">Dot badges</h2> <h2 id="dot-badges">Dot badges</h2>
<p>.dot-pill modifier class to make badges circle.</p> <p>.dot-pill modifier class to make badges circle.</p>
<div class="bd-example"> <div class="bd-example">
<span class="badge badge-dot badge-primary"></span> <span class="badge badge-dot badge-primary"></span>
<span class="badge badge-dot badge-secondary"></span> <span class="badge badge-dot badge-secondary"></span>
<span class="badge badge-dot badge-success"></span> <span class="badge badge-dot badge-success"></span>
@ -207,16 +205,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<span class="badge badge-dot badge-info"></span> <span class="badge badge-dot badge-info"></span>
<span class="badge badge-dot badge-light"></span> <span class="badge badge-dot badge-light"></span>
<span class="badge badge-dot badge-dark"></span> <span class="badge badge-dot badge-dark"></span>
<?php for ($i = 0; $i <= 9; $i++): ?> <?php for ($i = 0; $i <= 9; $i++): ?>
<span class="badge badge-dot badge-status<?php print $i; ?>" ></span> <span class="badge badge-dot badge-status<?php print $i; ?>" ></span>
<?php endfor; ?> <?php endfor; ?>
</div> </div>
<figure class="highlight"> <figure class="highlight">
<pre> <pre>
&lt;span class=&quot;badge badge-dot badge-primary&quot;&gt;&lt;/span&gt; &lt;span class=&quot;badge badge-dot badge-primary&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;badge badge-dot badge-secondary&quot;&gt;&lt;/span&gt; &lt;span class=&quot;badge badge-dot badge-secondary&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;badge badge-dot badge-success&quot;&gt;&lt;/span&gt; &lt;span class=&quot;badge badge-dot badge-success&quot;&gt;&lt;/span&gt;
@ -229,23 +227,23 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
&lt;span class="badge badge-dot badge-status<?php print $i; ?>" &gt;&lt;/span&gt; &lt;span class="badge badge-dot badge-status<?php print $i; ?>" &gt;&lt;/span&gt;
<?php endfor; ?> <?php endfor; ?>
</pre></figure> </pre></figure>
<div class="warning"> <div class="warning">
<p>Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button.</p> <p>Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button.</p>
<p>Unless the context is clear (as with the “Notifications” example, where it is understood that the “4” is the number of notifications), consider including additional context with a visually hidden piece of additional text.</p> <p>Unless the context is clear (as with the “Notifications” example, where it is understood that the “4” is the number of notifications), consider including additional context with a visually hidden piece of additional text.</p>
<p><strong>Remember to use aria-label attribute for accessibility in Dolibarr. Don't forget to use aria-hidden on icons included in badges</strong></p> <p><strong>Remember to use aria-label attribute for accessibility in Dolibarr. Don't forget to use aria-hidden on icons included in badges</strong></p>
</div> </div>
<h2 id="links">Links</h2> <h2 id="links">Links</h2>
<p>Using the contextual .badge-* classes on an &lt;a&gt; element quickly provide <em>actionable</em> badges with hover and focus states.</p> <p>Using the contextual .badge-* classes on an &lt;a&gt; element quickly provide <em>actionable</em> badges with hover and focus states.</p>
<div class="bd-example"> <div class="bd-example">
<a href="#" class="badge badge-primary">Primary</a> <a href="#" class="badge badge-primary">Primary</a>
<a href="#" class="badge badge-secondary">Secondary</a> <a href="#" class="badge badge-secondary">Secondary</a>
<a href="#" class="badge badge-success">Success</a> <a href="#" class="badge badge-success">Success</a>
@ -257,9 +255,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<?php for ($i = 0; $i <= 9; $i++): ?> <?php for ($i = 0; $i <= 9; $i++): ?>
<a href="#" class="badge badge-status<?php print $i; ?>" >status<?php print $i; ?></a> <a href="#" class="badge badge-status<?php print $i; ?>" >status<?php print $i; ?></a>
<?php endfor; ?> <?php endfor; ?>
</div> </div>
<figure class="highlight"><pre> <figure class="highlight"><pre>
&lt;a href=&quot;#&quot; class=&quot;badge badge-primary&quot;&gt;Primary&lt;/a&gt; &lt;a href=&quot;#&quot; class=&quot;badge badge-primary&quot;&gt;Primary&lt;/a&gt;
&lt;a href=&quot;#&quot; class=&quot;badge badge-secondary&quot;&gt;Secondary&lt;/a&gt; &lt;a href=&quot;#&quot; class=&quot;badge badge-secondary&quot;&gt;Secondary&lt;/a&gt;
@ -280,12 +278,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'primary') ?> <?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'primary') ?>
<?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'danger', 'pill') ?> <?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'danger', 'pill') ?>
<?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'warning', 'dot') ?> <?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'warning', 'dot') ?>
<figure class="highlight"><pre> <figure class="highlight"><pre>
&lt;?php print dolGetBadge('your label for accessibility', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'danger', 'pill') ?&gt; &lt;?php print dolGetBadge('your label for accessibility', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'danger', 'pill') ?&gt;
&lt;?php print dolGetBadge('your label for accessibility', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'warning', 'dot') ?&gt; &lt;?php print dolGetBadge('your label for accessibility', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'warning', 'dot') ?&gt;
</pre></figure> </pre></figure>
<h2 id="helper">Use status helper function</h2> <h2 id="helper">Use status helper function</h2>
<p>Using the dolGetStatus function provide in core/lib/functions.lib.php. This function is recommended for code uniformisation and easy maintain</p> <p>Using the dolGetStatus function provide in core/lib/functions.lib.php. This function is recommended for code uniformisation and easy maintain</p>
<?php <?php
@ -311,8 +309,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 6) ?></p> <p><?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4', 6) ?></p>
<?php $conf->global->MAIN_STATUS_USES_CSS = $saveGlobalConf; ?> <?php $conf->global->MAIN_STATUS_USES_CSS = $saveGlobalConf; ?>
<figure class="highlight"><pre> <figure class="highlight"><pre>
&lt;?php print dolGetStatus('your label for accessibility', 'your label', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'status4') ?&gt; &lt;?php print dolGetStatus('your label for accessibility', 'your label', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'status4') ?&gt;
&lt;?php print dolGetStatus('your label for accessibility', 'your label', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'status4',1) ?&gt; &lt;?php print dolGetStatus('your label for accessibility', 'your label', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'status4',1) ?&gt;
@ -323,8 +321,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
&lt;?php print dolGetStatus('your label for accessibility', 'your label', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'status4',6) ?&gt; &lt;?php print dolGetStatus('your label for accessibility', 'your label', 'your label &lt;u&gt;with&lt;/u&gt; &lt;em&gt;html&lt;/em&gt;', 'status4',6) ?&gt;
</pre></figure> </pre></figure>
</main> </main>
</body> </body>
</html> </html>

View File

@ -1121,14 +1121,18 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$("#radiocompany").click(function() { $("#radiocompany").click(function() {
$(".individualline").hide(); $(".individualline").hide();
$("#typent_id").val(0); $("#typent_id").val(0);
$("#typent_id").change();
$("#effectif_id").val(0); $("#effectif_id").val(0);
$("#effectif_id").change();
$("#TypeName").html(document.formsoc.ThirdPartyName.value); $("#TypeName").html(document.formsoc.ThirdPartyName.value);
document.formsoc.private.value=0; document.formsoc.private.value=0;
}); });
$("#radioprivate").click(function() { $("#radioprivate").click(function() {
$(".individualline").show(); $(".individualline").show();
$("#typent_id").val(id_te_private); $("#typent_id").val(id_te_private);
$("#typent_id").change();
$("#effectif_id").val(id_ef15); $("#effectif_id").val(id_ef15);
$("#effectif_id").change();
$("#TypeName").html(document.formsoc.LastName.value); $("#TypeName").html(document.formsoc.LastName.value);
document.formsoc.private.value=1; document.formsoc.private.value=1;
}); });

View File

@ -133,9 +133,9 @@ define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
if (empty($character_set_client)) $character_set_client = "UTF-8"; if (empty($character_set_client)) $character_set_client = "UTF-8";
$conf->file->character_set_client = strtoupper($character_set_client); $conf->file->character_set_client = strtoupper($character_set_client);
if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set = ($conf->db->type == 'mysql' ? 'latin1' : ''); // Old installation if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set = ($conf->db->type == 'mysqli' ? 'utf8' : ''); // Old installation
$conf->db->character_set = $dolibarr_main_db_character_set; $conf->db->character_set = $dolibarr_main_db_character_set;
if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation = ($conf->db->type == 'mysql' ? 'latin1_swedish_ci' : ''); // Old installation if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation = ($conf->db->type == 'mysqli' ? 'utf8_unicode_ci' : ''); // Old installation
$conf->db->dolibarr_main_db_collation = $dolibarr_main_db_collation; $conf->db->dolibarr_main_db_collation = $dolibarr_main_db_collation;
if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption = 0; if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption = 0;
$conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption; $conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption;

View File

@ -1,5 +0,0 @@
/* Simple css for Doc page */
body.docpage{
background: #fff;
padding:20px;
}

View File

@ -39,6 +39,9 @@ require_once __DIR__.'/../../main.inc.php';
top_httphead('text/json'); top_httphead('text/json');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');
$manifest = new stdClass(); $manifest = new stdClass();

View File

@ -42,6 +42,9 @@ $appli = constant('DOL_APPLICATION_TITLE');
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE; if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE;
top_httphead('text/json'); top_httphead('text/json');
// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
if (empty($dolibarr_nocache)) header('Cache-Control: max-age=10800, public, must-revalidate');
else header('Cache-Control: no-cache');
?> ?>
{ {