Merge branch 'Dolibarr:develop' into develop

This commit is contained in:
mschamp 2022-01-31 19:55:03 +01:00 committed by GitHub
commit c83138ec70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 359 additions and 251 deletions

View File

@ -12,10 +12,9 @@ NEW: Online proposal signature
NEW: Can define some max limit on expense report (per period, per type or expense, ...)
NEW: Allow the use of __NEWREF__ to get for example the new reference a draft order will get after validation.
NEW: Add option to disable globaly some notifications emails.
NEW: #18326 Workflow: Close order on shipment closing.
NEW: #18401 Add __NEWREF__ subtitute to get new object reference.
NEW: #18403 Add __URL_SHIPMENT__ substitute to get the URL of a shipment
NEW: #18689 REST API module: add api key generate / modify pemrission.
NEW: #18689 REST API module: add api key generate / modify permission.
NEW: #18663 Make "L'Annuaire des Entreprises" the default provider for SIREN verification for French thirdparties.
NEW: #18046 Add tags on ticket/categories
NEW: #18326 Workflow: Close order on shipment closing.

View File

@ -1,62 +1,93 @@
<VirtualHost *:80>
#php_admin_value sendmail_path "/usr/sbin/sendmail -t -i"
#php_admin_value mail.force_extra_parameters "-f postmaster@mydomain.com"
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f postmaster@mydomain.com"
php_admin_value open_basedir /tmp/:/home/../htdocs
#php_admin_value sendmail_path "/usr/sbin/sendmail -t -i"
#php_admin_value mail.force_extra_parameters "-f postmaster@mydomain.com"
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f postmaster@mydomain.com"
php_admin_value open_basedir /tmp/:/home/.../htdocs:/home/.../dolibarr_documents:
ServerName myvirtualalias
ServerAlias myvirtualalias
UseCanonicalName On
KeepAlive On
KeepAliveTimeout 5
MaxKeepAliveRequests 20
AddDefaultCharset UTF-8
DocumentRoot "/home/.../htdocs"
<Directory /home/.../htdocs/>
AllowOverride None
Options -Indexes -MultiViews +FollowSymLinks -ExecCGI
Require all granted
ServerName myvirtualalias
ServerAlias myvirtualalias
# To restrict access by a HTTP basic auth
#AuthType Basic
#AuthName "Authenticate to backoffice"
#AuthUserFile /etc/apache2/.htpasswd
#require valid-user
</Directory>
# Leaving /public and /api, /dav, .well_known but also wrappers for document and viewimage accessible to everyone
<Directory /home/admin/wwwroot/dolibarr/htdocs/public/>
AuthType None
Require all granted
Satisfy any
</Directory>
<Directory /home/admin/wwwroot/dolibarr/htdocs/api/>
AuthType None
Require all granted
Satisfy any
</Directory>
<Directory /home/admin/wwwroot/dolibarr/htdocs/dav/>
AuthType None
Require all granted
Satisfy any
</Directory>
<Directory /home/admin/wwwroot/dolibarr/htdocs/.well-known/>
AuthType None
Require all granted
Satisfy any
</Directory>
<Files ~ "(document\.php|viewimage\.php|\.js\.php|\.json\.php|\.js|\.css\.php|\.css|\.gif|\.png|\.svg|\.woff2|favicon\.ico)$">
AuthType None
Require all granted
Satisfy any
</Files>
UseCanonicalName On
AddDefaultCharset UTF-8
DocumentRoot "/home/.../htdocs"
<Directory /home/.../htdocs/>
AllowOverride None
Options -Indexes -MultiViews +FollowSymLinks -ExecCGI
Require all granted
</Directory>
<Directory "/home/../htdocs/cache">
Deny from all
RemoveHandler .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml
AddType application/x-httpd-php-source .phtml .php .php3 .php4 .php5 .php6 .phps .cgi .exe .pl .asp .aspx .shtml .shtm .fcgi .fpl .jsp .htm .html .wml
</Directory>
ErrorLog /var/log/apache2/myvirtualalias_error_log
TransferLog /var/log/apache2/myvirtualalias_access_log
# Compress returned resources of type php pages, text file export, css and javascript
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
AddType text/javascript .jgz
AddEncoding gzip .jgz
ExpiresActive On
ExpiresByType image/x-icon A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/javascript A2592000
SSLEngine On
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
SSLCertificateFile /etc/letsencrypt/live/www.mydomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.mydomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.mydomain.com/chain.pem
#RewriteEngine on
#RewriteCond %{SERVER_PORT} ^80$
#RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
ErrorLog /var/log/apache2/myvirtualalias_error_log
TransferLog /var/log/apache2/myvirtualalias_access_log
# Compress returned resources of type php pages, text file export, css and javascript
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript application/x-javascript
AddType text/javascript .jgz
AddEncoding gzip .jgz
ExpiresActive On
ExpiresByType image/x-icon A2592000
ExpiresByType image/gif A2592000
ExpiresByType image/png A2592000
ExpiresByType image/jpeg A2592000
ExpiresByType text/css A2592000
ExpiresByType text/javascript A2592000
ExpiresByType application/x-javascript A2592000
ExpiresByType application/javascript A2592000
SSLEngine On
# A self-signed (snakeoil) certificate can be created by installing
# the ssl-cert package. See
# /usr/share/doc/apache2.2-common/README.Debian.gz for more info.
# If both key and certificate are stored in the same file, only the
# SSLCertificateFile directive is needed.
SSLCertificateFile /etc/letsencrypt/live/www.mydomain.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.mydomain.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www.mydomain.com/chain.pem
#RewriteEngine on
#RewriteCond %{SERVER_PORT} ^80$
#RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
</VirtualHost>

View File

@ -589,13 +589,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$(".collapse_bom").click(function() {
console.log("We click on collapse");
var id_bom_line = $(this).attr('id').replace('collapse-', '');
if($(this).text().indexOf('+') > 0) {
console.log($(this).html().indexOf('folder-open'));
if($(this).html().indexOf('folder-open') <= 0) {
$('[parentid="'+ id_bom_line +'"]').show();
$(this).html('(-)&nbsp;');
$(this).html('<?php echo dol_escape_js(img_picto('', 'folder-open')); ?>');
}
else {
$('[parentid="'+ id_bom_line +'"]').hide();
$(this).html('(+)&nbsp;');
$(this).html('<?php echo dol_escape_js(img_picto('', 'folder')); ?>');
}
return false;
@ -605,7 +606,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$("#show_all").click(function() {
console.log("We click on show all");
$("[class^=sub_bom_lines]").show();
$("[class^=collapse_bom]").html('(-)&nbsp;');
$("[class^=collapse_bom]").html('<?php echo dol_escape_js(img_picto('', 'folder-open')); ?>');
return false;
});
@ -613,7 +614,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$("#hide_all").click(function() {
console.log("We click on hide all");
$("[class^=sub_bom_lines]").hide();
$("[class^=collapse_bom]").html('(+)&nbsp;');
$("[class^=collapse_bom]").html('<?php echo dol_escape_js(img_picto('', 'folder')); ?>');
return false;
});

View File

@ -1091,7 +1091,6 @@ class BOM extends CommonObject
return -2;
}
}
}
$this->total_cost = price2num($this->total_cost, 'MT');

View File

@ -83,10 +83,12 @@ $tmpproduct->fetch($line->fk_product);
$tmpbom = new BOM($object->db);
$res = $tmpbom->fetch($line->fk_bom_child);
if ($tmpbom->id > 0) {
print '<a class="collapse_bom" id="collapse-'.$line->id.'" href="#">' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . '&nbsp;</a>';
print $tmpproduct->getNomUrl(1);
print ' '.$langs->trans('or').' ';
print ' '.$langs->trans("or").' ';
print $tmpbom->getNomUrl(1);
print ' <a class="collapse_bom" id="collapse-'.$line->id.'" href="#">';
print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open'));
print '</a>';
} else {
print $tmpproduct->getNomUrl(1);
print ' - '.$tmpproduct->label;

View File

@ -280,7 +280,7 @@ if (empty($reshook) && $action == 'add') {
if (!$error) {
// Initialisation objet actioncomm
$object->priority = GETPOSTISSET("priority") ? GETPOST("priority", "int") : 0;
$object->fulldayevent = (!empty($fulldayevent) ? 1 : 0);
$object->fulldayevent = ($fulldayevent ? 1 : 0);
$object->location = GETPOST("location", 'alphanohtml');
$object->label = GETPOST('label', 'alphanohtml');
@ -1960,7 +1960,7 @@ if ($id > 0) {
}
// Full day event
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td>'.yn($object->fulldayevent, 3).'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td>'.yn($object->fulldayevent ? 1 : 0, 3).'</td></tr>';
$rowspan = 4;
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
@ -1969,7 +1969,7 @@ if ($id > 0) {
// Date start
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td>';
if (!$object->fulldayevent) {
if (empty($object->fulldayevent)) {
print dol_print_date($object->datep, 'dayhour', 'tzuser');
} else {
print dol_print_date($object->datep, 'day', 'tzuser');
@ -1982,7 +1982,7 @@ if ($id > 0) {
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td>';
if (!$object->fulldayevent) {
if (empty($object->fulldayevent)) {
print dol_print_date($object->datef, 'dayhour', 'tzuser');
} else {
print dol_print_date($object->datef, 'day', 'tzuser');

View File

@ -555,7 +555,11 @@ class ActionComm extends CommonObject
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
$sql .= ($userownerid > 0 ? $userownerid : "null").", ";
$sql .= ($userdoneid > 0 ? $userdoneid : "null").", ";
$sql .= "'".$this->db->escape($this->label)."','".$this->db->escape($this->percentage)."','".$this->db->escape($this->priority)."','".$this->db->escape($this->fulldayevent)."','".$this->db->escape($this->location)."', ";
$sql .= "'".$this->db->escape($this->label)."', ";
$sql .= "'".$this->db->escape($this->percentage)."', ";
$sql .= "'".$this->db->escape($this->priority)."', ";
$sql .= "'".$this->db->escape($this->fulldayevent)."', ";
$sql .= "'".$this->db->escape($this->location)."', ";
$sql .= "'".$this->db->escape($this->transparency)."', ";
$sql .= (!empty($this->fk_element) ? ((int) $this->fk_element) : "null").", ";
$sql .= (!empty($this->elementtype) ? "'".$this->db->escape($this->elementtype)."'" : "null").", ";

View File

@ -194,11 +194,11 @@ if ($object->id > 0) {
}
// Full day event
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent, 3).'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent ? 1 : 0, 3).'</td></tr>';
// Date start
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td colspan="3">';
if (!$object->fulldayevent) {
if (empty($object->fulldayevent)) {
print dol_print_date($object->datep, 'dayhour', 'tzuser');
} else {
print dol_print_date($object->datep, 'day', 'tzuser');
@ -211,7 +211,7 @@ if ($object->id > 0) {
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
if (!$object->fulldayevent) {
if (empty($object->fulldayevent)) {
print dol_print_date($object->datef, 'dayhour', 'tzuser');
} else {
print dol_print_date($object->datef, 'day', 'tzuser');

View File

@ -65,58 +65,58 @@ $arrayresult = array();
// Define $searchform
if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->rights->adherent->lire) {
$arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (((!empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->rights->societe->lire) {
$arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->societe->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->rights->societe->lire) {
$arrayresult['searchintocontact'] = array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('', 'object_contact').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintocontact'] = array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('', 'object_contact', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (((!empty($conf->product->enabled) && $user->rights->produit->lire) || (!empty($conf->service->enabled) && $user->rights->service->lire))
&& empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) {
$arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
// search on lot/serial numbers
if ( ! empty($conf->productbatch->enabled) ) {
$arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_lot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_lot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
}
if (!empty($conf->mrp->enabled) && $user->rights->mrp->read && empty($conf->global->MAIN_SEARCHFORM_MRP_DISABLED)) {
$arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintomo'] = array('position'=>35, 'shortcut'=>'', 'img'=>'object_mrp', 'label'=>$langs->trans("SearchIntoMO", $search_boxvalue), 'text'=>img_picto('', 'object_mrp', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMO", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/mrp/mo_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_PROJECT_DISABLED) && $user->rights->projet->lire) {
$arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintoprojects'] = array('position'=>40, 'shortcut'=>'Q', 'img'=>'object_project', 'label'=>$langs->trans("SearchIntoProjects", $search_boxvalue), 'text'=>img_picto('', 'object_project', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProjects", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->projet->enabled) && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLED) && $user->rights->projet->lire) {
$arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintotasks'] = array('position'=>45, 'img'=>'object_projecttask', 'label'=>$langs->trans("SearchIntoTasks", $search_boxvalue), 'text'=>img_picto('', 'object_projecttask', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTasks", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/projet/tasks/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->propal->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->rights->propal->lire) {
$arrayresult['searchintopropal'] = array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintopropal'] = array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->rights->commande->lire) {
$arrayresult['searchintoorder'] = array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintoorder'] = array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->expedition->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->rights->expedition->lire) {
$arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->rights->facture->lire) {
$arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->rights->supplier_proposal->lire) {
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_supplier_proposal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_supplier_proposal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED)) {
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_supplier_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_supplier_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->lire)) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) {
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_supplier_invoice', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_supplier_invoice', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
// Customer payments
@ -125,7 +125,7 @@ if (!empty($conf->facture->enabled) && empty($conf->global->MAIN_SEARCHFORM_CUST
'position'=>170,
'img'=>'object_payment',
'label'=>$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
'url'=>DOL_URL_ROOT.'/compta/paiement/list.php?leftmenu=customers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
@ -135,7 +135,7 @@ if (((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_S
'position'=>175,
'img'=>'object_payment',
'label'=>$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
'url'=>DOL_URL_ROOT.'/fourn/paiement/list.php?leftmenu=suppliers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
@ -145,29 +145,29 @@ if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_SEARCHFORM_MISC_
'position'=>180,
'img'=>'object_payment',
'label'=>$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment').' '.$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
'url'=>DOL_URL_ROOT.'/compta/bank/various_payment/list.php?leftmenu=tax_various'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->rights->contrat->lire) {
$arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->ficheinter->enabled) && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->rights->ficheinter->lire) {
$arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->rights->ticket->read) {
$arrayresult['searchintotickets'] = array('position'=>145, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintotickets'] = array('position'=>145, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
// HR
if (!empty($conf->user->enabled) && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->rights->user->user->lire) {
$arrayresult['searchintouser'] = array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('', 'object_user').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintouser'] = array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('', 'object_user', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->expensereport->enabled) && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->rights->expensereport->lire) {
$arrayresult['searchintoexpensereport'] = array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('', 'object_trip').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintoexpensereport'] = array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('', 'object_trip', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
if (!empty($conf->holiday->enabled) && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->rights->holiday->read) {
$arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
$arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : ''));
}
// Execute hook addSearchEntry

View File

@ -6335,7 +6335,7 @@ class Form
if (empty($conf->global->MAIN_POPUP_CALENDAR_ON_FOCUS)) {
$retstring .= "
showOn: 'button', /* both has problem with autocompletion */
buttonImage: '".DOL_URL_ROOT."/theme/".$conf->theme."/img/object_calendarday.png',
buttonImage: '".DOL_URL_ROOT."/theme/".dol_escape_js($conf->theme)."/img/object_calendarday.png',
buttonImageOnly: true";
}
$retstring .= "
@ -6348,7 +6348,7 @@ class Form
$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(\''.$prefix.'\',\''.$langs->trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
$retstring .= ' onChange="dpChangeDay(\''.dol_escape_js($prefix).'\',\''.dol_escape_js($langs->trans("FormatDateShortJavaInput")).'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
$retstring .= '>';
// Icone calendrier
@ -8082,6 +8082,31 @@ class Form
}
}
// Try also magic suggest
$out .= '<select id="'.$htmlname.'" class="multiselect'.($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n";
if (is_array($array) && !empty($array)) {
if ($value_as_key) {
$array = array_combine($array, $array);
}
if (!empty($array)) {
foreach ($array as $key => $value) {
$newval = ($translate ? $langs->trans($value) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out .= '<option value="'.$key.'"';
if (is_array($selected) && !empty($selected) && in_array((string) $key, $selected) && ((string) $key != '')) {
$out .= ' selected';
}
$out .= ' data-html="'.dol_escape_htmltag($newval).'"';
$out .= '>';
$out .= dol_htmlentitiesbr($newval);
$out .= '</option>'."\n";
}
}
}
$out .= '</select>'."\n";
// Add code for jquery to use multiselect
if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) {
$out .= "\n".'<!-- JS CODE TO ENABLE select for id '.$htmlname.', addjscombo='.$addjscombo.' -->';
@ -8136,31 +8161,6 @@ class Form
$out .= '</script>';
}
// Try also magic suggest
$out .= '<select id="'.$htmlname.'" class="multiselect'.($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n";
if (is_array($array) && !empty($array)) {
if ($value_as_key) {
$array = array_combine($array, $array);
}
if (!empty($array)) {
foreach ($array as $key => $value) {
$newval = ($translate ? $langs->trans($value) : $value);
$newval = ($key_in_label ? $key.' - '.$newval : $newval);
$out .= '<option value="'.$key.'"';
if (is_array($selected) && !empty($selected) && in_array((string) $key, $selected) && ((string) $key != '')) {
$out .= ' selected';
}
$out .= ' data-html="'.dol_escape_htmltag($newval).'"';
$out .= '>';
$out .= dol_htmlentitiesbr($newval);
$out .= '</option>'."\n";
}
}
}
$out .= '</select>'."\n";
return $out;
}

View File

@ -1232,8 +1232,8 @@ function dol_string_unaccent($str)
*
* @param string $str String to clean
* @param string $newstr String to replace forbidden chars with
* @param array|string $badcharstoreplace List of forbidden characters to replace
* @param array|string $badcharstoremove List of forbidden characters to remove
* @param array|string $badcharstoreplace Array of forbidden characters to replace. Use '' to keep default list.
* @param array|string $badcharstoremove Array of forbidden characters to remove. Use '' to keep default list.
* @return string Cleaned string
*
* @see dol_sanitizeFilename(), dol_string_unaccent(), dol_string_nounprintableascii()
@ -2890,15 +2890,15 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
// Use dictionary definition for picto $dictsocialnetworks[$type]['icon']
$htmllink .= '<span class="fa paddingright '.($dictsocialnetworks[$type]['icon'] ? $dictsocialnetworks[$type]['icon'] : 'fa-link').'"></span>';
if ($type == 'skype') {
$htmllink .= $value;
$htmllink .= dol_escape_htmltag($value);
$htmllink .= '&nbsp;';
$htmllink .= '<a href="skype:';
$htmllink .= $value;
$htmllink .= '?call" alt="'.$langs->trans("Call").'&nbsp;'.$value.'" title="'.$langs->trans("Call").'&nbsp;'.$value.'">';
$htmllink .= dol_string_nospecial($value, '_', '', array('@'));
$htmllink .= '?call" alt="'.$langs->trans("Call").'&nbsp;'.$value.'" title="'.dol_escape_htmltag($langs->trans("Call").' '.$value).'">';
$htmllink .= '<img src="'.DOL_URL_ROOT.'/theme/common/skype_callbutton.png" border="0">';
$htmllink .= '</a><a href="skype:';
$htmllink .= $value;
$htmllink .= '?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$value.'" title="'.$langs->trans("Chat").'&nbsp;'.$value.'">';
$htmllink .= dol_string_nospecial($value, '_', '', array('@'));
$htmllink .= '?chat" alt="'.$langs->trans("Chat").'&nbsp;'.$value.'" title="'.dol_escape_htmltag($langs->trans("Chat").' '.$value).'">';
$htmllink .= '<img class="paddingleft" src="'.DOL_URL_ROOT.'/theme/common/skype_chatbutton.png" border="0">';
$htmllink .= '</a>';
if (($cid || $socid) && !empty($conf->agenda->enabled) && $user->rights->agenda->myactions->create) {
@ -2912,9 +2912,9 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
} else {
if (!empty($dictsocialnetworks[$type]['url'])) {
$link = str_replace('{socialid}', $value, $dictsocialnetworks[$type]['url']);
$htmllink .= '&nbsp;<a href="'.$link.'" target="_blank" rel="noopener noreferrer">'.$value.'</a>';
$htmllink .= '&nbsp;<a href="'.$link.'" target="_blank" rel="noopener noreferrer">'.dol_escape_htmltag($value).'</a>';
} else {
$htmllink .= $value;
$htmllink .= dol_escape_htmltag($value);
}
}
$htmllink .= '</div>';

View File

@ -157,7 +157,7 @@ if (!function_exists('dol_loginfunction')) {
// Note: $conf->css looks like '/theme/eldy/style.css.php'
/*
$conf->css = "/theme/".(GETPOST('theme','alpha')?GETPOST('theme','alpha'):$conf->theme)."/style.css.php";
$conf->css = "/theme/".(GETPOST('theme','aZ09')?GETPOST('theme','aZ09'):$conf->theme)."/style.css.php";
$themepath=dol_buildpath($conf->css,1);
if (! empty($conf->modules_parts['theme'])) // Using this feature slow down application
{

View File

@ -179,18 +179,11 @@ class modFicheinter extends DolibarrModules
'fd.rowid'=>'InterLineId',
'fd.date'=>"InterLineDate", 'fd.duree'=>"InterLineDuration", 'fd.description'=>"InterLineDesc"
);
//$this->export_TypeFields_array[$r]=array(
// 's.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
// 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text',
// 's.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",
// 'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",
// 'fd.total_ht'=>"Numeric"
//);
$this->export_TypeFields_array[$r] = array(
's.rowid'=>"Numeric", 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 's.fk_pays'=>'List:c_country:label', 's.phone'=>'Text', 's.siren'=>'Text',
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text',
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.datec'=>"Date",
'f.duree'=>"Duree", 'f.fk_statut'=>'Numeric', 'f.description'=>"Text", 'f.datee'=>"Date", 'f.dateo'=>"Date", 'f.fulldayevent'=>"Boolean",
'f.duree'=>"Duree", 'f.fk_statut'=>'Numeric', 'f.description'=>"Text", 'f.datee'=>"Date", 'f.dateo'=>"Date", 'f.fulldayevent'=>"Text",
'pj.ref'=>'Text', 'pj.title'=>'Text',
'fd.rowid'=>"Numeric", 'fd.date'=>"Date", 'fd.duree'=>"Duree", 'fd.description'=>"Text", 'fd.total_ht'=>"Numeric"
);

View File

@ -47,7 +47,7 @@ class modReception extends DolibarrModules
$this->module_position = '40';
// Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module)
$this->name = preg_replace('/^mod/i', '', get_class($this));
$this->description = "Gestion des réceptions fournisseurs";
$this->description = "ReceptionDescription";
// Possible values for version are: 'development', 'experimental', 'dolibarr' or version
$this->version = 'dolibarr';

View File

@ -30,11 +30,16 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
// DDOS protection
$size = (int) $_SERVER['CONTENT_LENGTH'];
if ($size > 10000) {
http_response_code(413);
exit;
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
header('Cache-Control: Public, must-revalidate');
header("Content-type: text/html; charset=".$conf->file->character_set_client);
@ -87,7 +92,7 @@ if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$disablenofollow = 0;
}
print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disablenofollow);
print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
$colorbackhmenu1 = '60,70,100'; // topmenu

View File

@ -27,6 +27,12 @@ if (empty($conf) || !is_object($conf)) {
exit;
}
// DDOS protection
$size = (int) $_SERVER['CONTENT_LENGTH'];
if ($size > 10000) {
http_response_code(413);
exit;
}
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
@ -60,7 +66,18 @@ $php_self = str_replace('action=validatenewpassword', '', $php_self);
$titleofpage = $langs->trans('SendNewPassword');
print top_htmlhead('', $titleofpage);
// Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second
$arrayofjs = array();
$disablenofollow = 1;
if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) {
$disablenofollow = 0;
}
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$disablenofollow = 0;
}
print top_htmlhead('', $titleofpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
$colorbackhmenu1 = '60,70,100'; // topmenu

View File

@ -35,7 +35,7 @@ $langs->load("externalsite");
$mainmenu = GETPOST('mainmenu', "aZ09");
$leftmenu = GETPOST('leftmenu', "aZ09");
$idmenu = GETPOST('idmenu', 'int');
$theme = GETPOST('theme', 'alpha');
$theme = GETPOST('theme', 'aZ09');
$codelang = GETPOST('lang', 'aZ09');
$keyforcontent = GETPOST('keyforcontent', 'aZ09');

View File

@ -7,6 +7,7 @@
* Copyright (C) 2014-2017 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020-2021 Udo Tamm <dev@dolibit.de>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -784,6 +785,12 @@ if (empty($reshook)) {
$result = $object->update($user);
if ($result >= 0 && $oldstatus == Holiday::STATUS_APPROVED) { // holiday was already validated, status 3, so we must increase back the balance
// Call trigger
$result = $object->call_trigger('HOLIDAY_CANCEL', $user);
if ($result < 0) {
$error++;
}
// Calculcate number of days consummed
$nbopenedday = num_open_day($object->date_debut_gmt, $object->date_fin_gmt, 0, 1, $object->halfday);

View File

@ -9,7 +9,7 @@
-- Copyright (C) 2013 Cedric Gross <c.gross@kreiz-it.fr>
-- Copyright (C) 2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
-- Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
-- Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
-- Copyright (C) 2021-2022 Anthony Berton <anthony.berton@bb2a.fr>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
@ -166,3 +166,11 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_MODIFY','Task modified','Executed when a project task is modified','project',151);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('TASK_DELETE','Task deleted','Executed when a project task is deleted','project',152);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ACTION_CREATE','Action added','Executed when an action is added to the agenda','agenda',700);
-- oliday
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CREATE','Holiday created','Executed when a holiday is created','holiday',800);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_MODIFY','Holiday modified','Executed when a holiday is modified','holiday',801);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Holiday validated','Executed when a holiday is validated','holiday',802);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Holiday aprouved','Executed when a holiday is aprouved','holiday',803);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CANCEL','Holiday canceled','Executed when a holiday is canceled','holiday',802);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_DELETE','Holiday deleted','Executed when a holiday is deleted','holiday',804);

View File

@ -494,3 +494,10 @@ INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) value
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_DELETE','User update','Executed when a user is deleted','user',303);
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_NEW_PASSWORD','User update','Executed when a user is change password','user',304);
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('USER_ENABLEDISABLE','User update','Executed when a user is enable or disable','user',305);
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CREATE','Holiday created','Executed when a holiday is created','holiday',800);
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_MODIFY','Holiday modified','Executed when a holiday is modified','holiday',801);
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_VALIDATE','Holiday validated','Executed when a holiday is validated','holiday',802);
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_APPROVE','Holiday aprouved','Executed when a holiday is aprouved','holiday',803);
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_CANCEL','Holiday canceled','Executed when a holiday is canceled','holiday',802);
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) values ('HOLIDAY_DELETE','Holiday deleted','Executed when a holiday is deleted','holiday',804);

View File

@ -27,7 +27,7 @@ ConfirmCloneBillOfMaterials=Are you sure you want to clone the bill of materials
ConfirmCloneMo=Are you sure you want to clone the Manufacturing Order %s ?
ManufacturingEfficiency=Manufacturing efficiency
ConsumptionEfficiency=Consumption efficiency
ValueOfMeansLoss=Value of 0.95 means an average of 5%% of loss during the production
ValueOfMeansLoss=Value of 0.95 means an average of 5%% of loss during the manufacturing or the disassembly
ValueOfMeansLossForProductProduced=Value of 0.95 means an average of 5%% of loss of produced product
DeleteBillOfMaterials=Delete Bill Of Materials
DeleteMo=Delete Manufacturing Order

View File

@ -1,5 +1,6 @@
# Dolibarr language file - Source file is en_US - receptions
ReceptionsSetup=Product Reception setup
ReceptionDescription=Vendor reception management (Create reception documents)
ReceptionsSetup=Vendor Reception setup
RefReception=Ref. reception
Reception=Reception
Receptions=Receptions

View File

@ -1098,8 +1098,8 @@ if (!defined('NOLOGIN')) {
// Case forcing style from url
if (GETPOST('theme', 'alpha')) {
$conf->theme = GETPOST('theme', 'alpha', 1);
if (GETPOST('theme', 'aZ09')) {
$conf->theme = GETPOST('theme', 'aZ09', 1);
$conf->css = "/theme/".$conf->theme."/style.css.php";
}
@ -1404,11 +1404,11 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0)
* @param int $disablehead Disable head output
* @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
* @param int $disablejmobile Disable jmobile (No more used)
* @param int $disableforlogin Do not load heavy js and css for login pages
* @param int $disablenofollow Disable no follow tag
* @return void
*/
function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disablejmobile = 0, $disablenofollow = 0)
function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disableforlogin = 0, $disablenofollow = 0)
{
global $db, $conf, $langs, $user, $mysoc, $hookmanager;
@ -1646,15 +1646,16 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
} else {
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/js/jquery-ui.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
}
if (!defined('DISABLE_JQUERY_TABLEDND')) {
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
}
// jQuery jnotify
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) {
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/jnotify/jquery.jnotify.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
}
// Table drag and drop lines
if (empty($disableforlogin) && !defined('DISABLE_JQUERY_TABLEDND')) {
print '<script src="'.DOL_URL_ROOT.'/includes/jquery/plugins/tablednd/jquery.tablednd.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
}
// Chart
if ((empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'chart') && !defined('DISABLE_JS_GRAPH')) {
if (empty($disableforlogin) && (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'chart') && !defined('DISABLE_JS_GRAPH')) {
print '<script src="'.DOL_URL_ROOT.'/includes/nnnick/chartjs/dist/Chart.min.js'.($ext ? '?'.$ext : '').'"></script>'."\n";
}
@ -1694,7 +1695,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
if (!$disablejs && !empty($conf->use_javascript_ajax)) {
// CKEditor
if ((!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) {
if (empty($disableforlogin) && (!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) {
print '<!-- Includes JS for CKEditor -->'."\n";
$pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/';
$jsckeditor = 'ckeditor.js';
@ -1704,8 +1705,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
}
print '<script>';
print '/* enable ckeditor by main.inc.php */';
print 'var CKEDITOR_BASEPATH = \''.$pathckeditor.'\';'."\n";
print 'var ckeditorConfig = \''.dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js'.($ext ? '?'.$ext : ''), 1).'\';'."\n"; // $themesubdir='' in standard usage
print 'var CKEDITOR_BASEPATH = \''.dol_escape_js($pathckeditor).'\';'."\n";
print 'var ckeditorConfig = \''.dol_escape_js(dol_buildpath($themesubdir.'/theme/'.$conf->theme.'/ckeditor/config.js'.($ext ? '?'.$ext : ''), 1)).'\';'."\n"; // $themesubdir='' in standard usage
print 'var ckeditorFilebrowserBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
print 'var ckeditorFilebrowserImageBrowseUrl = \''.DOL_URL_ROOT.'/core/filemanagerdol/browser/default/browser.php?Type=Image&Connector='.DOL_URL_ROOT.'/core/filemanagerdol/connectors/php/connector.php\';'."\n";
print '</script>'."\n";

View File

@ -1870,40 +1870,40 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (empty($conf->global->PRODUCT_DISABLE_WEIGHT)) {
// Brut Weight
print '<tr><td>'.$langs->trans("Weight").'</td><td>';
print '<input name="weight" size="5" value="'.$object->weight.'"> ';
print $formproduct->selectMeasuringUnits("weight_units", "weight", $object->weight_units, 0, 2);
print '<input name="weight" size="5" value="'.(GETPOSTISSET('weight') ? GETPOST('weight') : $object->weight).'"> ';
print $formproduct->selectMeasuringUnits("weight_units", "weight", GETPOSTISSET('weight_units') ? GETPOST('weight_units') : $object->weight_units, 0, 2);
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_SIZE)) {
// Brut Length
print '<tr><td>'.$langs->trans("Length").' x '.$langs->trans("Width").' x '.$langs->trans("Height").'</td><td>';
print '<input name="size" size="5" value="'.$object->length.'">x';
print '<input name="sizewidth" size="5" value="'.$object->width.'">x';
print '<input name="sizeheight" size="5" value="'.$object->height.'"> ';
print $formproduct->selectMeasuringUnits("size_units", "size", $object->length_units, 0, 2);
print '<input name="size" size="5" value="'.(GETPOSTISSET('size') ? GETPOST('size') : $object->length).'">x';
print '<input name="sizewidth" size="5" value="'.(GETPOSTISSET('sizewidth') ? GETPOST('sizewidth') : $object->width).'">x';
print '<input name="sizeheight" size="5" value="'.(GETPOSTISSET('sizeheight') ? GETPOST('sizeheight') : $object->height).'"> ';
print $formproduct->selectMeasuringUnits("size_units", "size", GETPOSTISSET('size_units') ? GETPOST('size_units') : $object->length_units, 0, 2);
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_SURFACE)) {
// Brut Surface
print '<tr><td>'.$langs->trans("Surface").'</td><td>';
print '<input name="surface" size="5" value="'.$object->surface.'"> ';
print $formproduct->selectMeasuringUnits("surface_units", "surface", $object->surface_units, 0, 2);
print '<input name="surface" size="5" value="'.(GETPOSTISSET('surface') ? GETPOST('surface') : $object->surface).'"> ';
print $formproduct->selectMeasuringUnits("surface_units", "surface", GETPOSTISSET('surface_units') ? GETPOST('surface_units') : $object->surface_units, 0, 2);
print '</td></tr>';
}
if (empty($conf->global->PRODUCT_DISABLE_VOLUME)) {
// Brut Volume
print '<tr><td>'.$langs->trans("Volume").'</td><td>';
print '<input name="volume" size="5" value="'.$object->volume.'"> ';
print $formproduct->selectMeasuringUnits("volume_units", "volume", $object->volume_units, 0, 2);
print '<input name="volume" size="5" value="'.(GETPOSTISSET('volume') ? GETPOST('volume') : $object->volume).'"> ';
print $formproduct->selectMeasuringUnits("volume_units", "volume", GETPOSTISSET('volume_units') ? GETPOST('volume_units') : $object->volume_units, 0, 2);
print '</td></tr>';
}
if (!empty($conf->global->PRODUCT_ADD_NET_MEASURE)) {
// Net Measure
print '<tr><td>'.$langs->trans("NetMeasure").'</td><td>';
print '<input name="net_measure" size="5" value="'.$object->net_measure.'"> ';
print $formproduct->selectMeasuringUnits("net_measure_units", "", $object->net_measure_units, 0, 0);
print '<input name="net_measure" size="5" value="'.(GETPOSTISSET('net_measure') ? GETPOST('net_measure') : $object->net_measure).'"> ';
print $formproduct->selectMeasuringUnits("net_measure_units", "", GETPOSTISSET('net_measure_units') ? GETPOST('net_measure_units') : $object->net_measure_units, 0, 0);
print '</td></tr>';
}
}

View File

@ -860,6 +860,8 @@ class Product extends CommonObject
*/
public function verify()
{
global $langs;
$this->errors = array();
$result = 0;
@ -870,6 +872,15 @@ class Product extends CommonObject
$result = -2;
}
$arrayofnonnegativevalue = array('weight'=>'Weight', 'width'=>'Width', 'height'=>'Height', 'length'=>'Length', 'surface'=>'Surface', 'volume'=>'Volume');
foreach ($arrayofnonnegativevalue as $key => $value) {
if (property_exists($this, $key) && $this->$key < 0) {
$langs->load("other");
$this->errors[] = $langs->trans("FieldCannotBeNegative", $langs->transnoentitiesnoconv($value));
$result = -4;
}
}
$rescode = $this->check_barcode($this->barcode, $this->barcode_type_code);
if ($rescode) {
if ($rescode == -1) {

View File

@ -119,7 +119,7 @@ if (empty($reshook)) {
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element == 'action' && $resource_type == 'dolresource' && intval($busy) == 1) {
$eventDateStart = $objstat->datep;
$eventDateEnd = $objstat->datef;
$isFullDayEvent = intval($objstat->fulldayevent);
$isFullDayEvent = $objstat->fulldayevent;
if (empty($eventDateEnd)) {
if ($isFullDayEvent) {
$eventDateStartArr = dol_getdate($eventDateStart);
@ -194,7 +194,7 @@ if (empty($reshook)) {
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type == 'action' && $object->resource_type == 'dolresource' && intval($object->busy) == 1) {
$eventDateStart = $object->objelement->datep;
$eventDateEnd = $object->objelement->datef;
$isFullDayEvent = intval($objstat->fulldayevent);
$isFullDayEvent = $objstat->fulldayevent;
if (empty($eventDateEnd)) {
if ($isFullDayEvent) {
$eventDateStartArr = dol_getdate($eventDateStart);
@ -376,11 +376,11 @@ if (!$ret) {
}
// Full day event
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent, 3).'</td></tr>';
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent ? 1 : 0, 3).'</td></tr>';
// Date start
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td colspan="3">';
if (!$act->fulldayevent) {
if (empty($act->fulldayevent)) {
print dol_print_date($act->datep, 'dayhour', 'tzuser');
} else {
print dol_print_date($act->datep, 'day', 'tzuser');
@ -393,7 +393,7 @@ if (!$ret) {
// Date end
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
if (!$act->fulldayevent) {
if (empty($act->fulldayevent)) {
print dol_print_date($act->datef, 'dayhour', 'tzuser');
} else {
print dol_print_date($act->datef, 'day', 'tzuser');

View File

@ -79,8 +79,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$month = '';
}
// Customer or supplier selected in drop box
$thirdTypeSelect = GETPOST("third_select_id");
$type_element = GETPOST('type_element') ?GETPOST('type_element') : '';
$thirdTypeSelect = GETPOST("third_select_id", 'az09');
$type_element = GETPOST('type_element') ? GETPOST('type_element') : '';
// Load translation files required by the page
$langs->loadLangs(array("companies", "bills", "orders", "suppliers", "propal", "interventions", "contracts", "products"));
@ -441,9 +441,9 @@ if ($sql_select) {
print '<td class="liste_titre left">';
print '<input class="flat" type="text" name="sref" size="8" value="'.$sref.'">';
print '</td>';
print '<td class="liste_titre nowrap center">'; // date
print '<td class="liste_titre nowrap center valignmiddle">'; // date
print $formother->select_month($month ? $month : -1, 'month', 1, 0, 'valignmiddle');
$formother->select_year($year ? $year : -1, 'year', 1, 20, 1);
$formother->select_year($year ? $year : -1, 'year', 1, 20, 1, 0, 0, '', 'valignmiddle maxwidth75imp marginleftonly');
print '</td>';
print '<td class="liste_titre center">';
print '</td>';
@ -463,7 +463,7 @@ if ($sql_select) {
// Titles with sort buttons
print '<tr class="liste_titre">';
print_liste_field_titre('Ref', $_SERVER['PHP_SELF'], 'doc_number', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, 'width="150"', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Date', $_SERVER['PHP_SELF'], 'dateprint', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Status', $_SERVER['PHP_SELF'], 'fk_statut', '', $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre('Product', $_SERVER['PHP_SELF'], '', '', $param, '', $sortfield, $sortorder, 'left ');
print_liste_field_titre('Quantity', $_SERVER['PHP_SELF'], 'prod_qty', '', $param, '', $sortfield, $sortorder, 'right ');
@ -500,6 +500,8 @@ if ($sql_select) {
print $documentstaticline->getLibStatut(5);
} elseif ($type_element == 'invoice') {
print $documentstatic->getLibStatut(5, $objp->paid);
} elseif ($type_element == 'supplier_invoice') {
print $documentstatic->getLibStatut(5, $objp->paid);
} else {
print $documentstatic->getLibStatut(5);
}
@ -673,7 +675,7 @@ if ($sql_select) {
print '<td colspan="3"></td>';
print '<td class="right">'.$total_qty.'</td>';
print '<td class="right">'.price($total_ht).'</td>';
print '<td class="right">'.price($total_ht / (empty($total_qty) ? 1 : $total_qty)).'</td>';
print '<td class="right">'.price(price2num($total_ht / (empty($total_qty) ? 1 : $total_qty), 'MU')).'</td>';
print "</table>";
print '</div>';

View File

@ -739,7 +739,7 @@ class SupplierProposal extends CommonObject
if ($price_base_type == 'TTC') {
$pu = $pu_ttc;
}
//Fetch current line from the database and then clone the object and set it in $oldline property
$line = new SupplierProposalLine($this->db);
$line->fetch($rowid);

View File

@ -59,7 +59,7 @@ if (!empty($conf->global->THEME_DARKMODEENABLED)) {
print "@media (prefers-color-scheme: dark) {";
}
print ":root {
--colorbackhmenu1: #1d1e20;
--colorbackhmenu1: #3d3e40;
--colorbackvmenu1: #2b2c2e;
--colorbacktitle1: #2b2d2f;
--colorbacktabcard1: #1d1e20; /* Must be same than colorbackbody */
@ -154,8 +154,9 @@ table.liste th.wrapcolumntitle.liste_titre:not(.maxwidthsearch), table.liste td.
max-width: 100px;
text-overflow: ellipsis;
}
.liste_titre input[name=month_date_when], .liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
/*.liste_titre input[name=month_date_when], .liste_titre input[name=monthvalid], .liste_titre input[name=search_ordermonth], .liste_titre input[name=search_deliverymonth],
.liste_titre input[name=search_smonth], .liste_titre input[name=search_month], .liste_titre input[name=search_emonth], .liste_titre input[name=smonth], .liste_titre input[name=month], .liste_titre select[name=month],
.liste_titre select[name=year],
.liste_titre input[name=month_lim], .liste_titre input[name=month_start], .liste_titre input[name=month_end], .liste_titre input[name=month_create],
.liste_titre input[name=search_month_lim], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end], .liste_titre input[name=search_month_create],
.liste_titre input[name=search_month_update], .liste_titre input[name=search_month_start], .liste_titre input[name=search_month_end],
@ -166,6 +167,7 @@ table.liste th.wrapcolumntitle.liste_titre:not(.maxwidthsearch), table.liste td.
.liste_titre input[name=search_day_create], .liste_titre input[name=search_day_start], .liste_titre input[name=search_day_end],
.liste_titre input[name=search_day_date_when], .liste_titre input[name=search_month_date_when], .liste_titre input[name=search_year_date_when],
.liste_titre input[name=search_dtstartday], .liste_titre input[name=search_dtendday], .liste_titre input[name=search_dtstartmonth], .liste_titre input[name=search_dtendmonth],
*/
select#date_startday, select#date_startmonth, select#date_endday, select#date_endmonth, select#reday, select#remonth,
input, input.flat, form.flat select, select, select.flat, .dataTables_length label select {
border: none;

View File

@ -85,8 +85,8 @@ if (empty($dolibarr_nocache)) {
header('Cache-Control: no-cache');
}
if (GETPOST('theme', 'alpha')) {
$conf->theme = GETPOST('theme', 'alpha'); // If theme was forced on URL
if (GETPOST('theme', 'aZ09')) {
$conf->theme = GETPOST('theme', 'aZ09'); // If theme was forced on URL
}
if (GETPOST('lang', 'aZ09')) {
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL

View File

@ -233,7 +233,7 @@ span.butActionNewRefused>span.fa, span.butActionNewRefused>span.fa:hover
background: var(--butactiondeletebg);
/* border: 1px solid #633; */
color: #633;
vertical-align: middle;
/* vertical-align: middle; */
}
.butActionDelete:hover {

View File

@ -86,8 +86,8 @@ if (empty($dolibarr_nocache)) {
header('Cache-Control: no-cache');
}
if (GETPOST('theme', 'alpha')) {
$conf->theme = GETPOST('theme', 'alpha'); // If theme was forced on URL
if (GETPOST('theme', 'aZ09')) {
$conf->theme = GETPOST('theme', 'aZ09'); // If theme was forced on URL
}
if (GETPOST('lang', 'aZ09')) {
$langs->setDefaultLang(GETPOST('lang', 'aZ09')); // If language was forced on URL

View File

@ -1,8 +1,9 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2020 Tobias Sekan <tobias.sekan@startmail.com>
* Copyright (C) 2021-2022 Anthony Berton <anthony.berton@bb2a.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -64,27 +65,27 @@ $v->setUid('DOLIBARR-USERID-'.$user2->id);
$v->setName($user2->lastname, $user2->firstname, "", $user2->civility_code, "");
$v->setFormattedName($user2->getFullName($langs, 1));
$v->setPhoneNumber($user2->phone_pro, "TYPE=WORK;VOICE");
//$v->setPhoneNumber($user2->phone_perso,"TYPE=HOME;VOICE");
$v->setPhoneNumber($user2->phone_mobile, "TYPE=CELL;VOICE");
$v->setPhoneNumber($user2->fax, "TYPE=WORK;FAX");
$v->setPhoneNumber($user2->office_phone, "TYPE=WORK;VOICE");
$v->setPhoneNumber($user2->personal_mobile, "TYPE=HOME;VOICE");
$v->setPhoneNumber($user2->user_mobile, "TYPE=CELL;VOICE");
$v->setPhoneNumber($user2->office_fax, "TYPE=WORK;FAX");
$country = $user2->country_code ? $user2->country : '';
$v->setAddress("", "", $user2->address, $user2->town, $user2->state, $user2->zip, $country, "TYPE=WORK;POSTAL");
$v->setLabel("", "", $user2->address, $user2->town, $user2->state, $user2->zip, $country, "TYPE=WORK");
$v->setEmail($user2->email);
$v->setEmail($user2->email, "TYPE=WORK");
$v->setNote($user2->note);
$v->setTitle($user2->poste);
// Data from linked company
if ($company->id) {
$v->setURL($company->url, "TYPE=WORK");
if (!$user2->phone_pro) {
if (!$user2->office_phone) {
$v->setPhoneNumber($company->phone, "TYPE=WORK;VOICE");
}
if (!$user2->fax) {
if (!$user2->office_fax) {
$v->setPhoneNumber($company->fax, "TYPE=WORK;FAX");
}
if (!$user2->zip) {
@ -96,16 +97,16 @@ if ($company->id) {
// was set before, don't set twice
} elseif (empty(trim($user2->email))) {
// when user e-mail is empty, use only company e-mail
$v->setEmail($company->email);
$v->setEmail($company->email, "TYPE=WORK");
} elseif (strtolower(end(explode("@", $user2->email))) == strtolower(end(explode("@", $company->email)))) {
// when e-mail domain of user and company are the same, use user e-mail at first (and company e-mail at second)
$v->setEmail($user2->email);
$v->setEmail($user2->email, "TYPE=WORK");
// support by Microsoft Outlook (2019 and possible earlier)
$v->setEmail($company->email, 'INTERNET');
} else {
// when e-mail of user and company complete different use company e-mail at first (and user e-mail at second)
$v->setEmail($company->email);
$v->setEmail($company->email, "TYPE=WORK");
// support by Microsoft Outlook (2019 and possible earlier)
$v->setEmail($user2->email, 'INTERNET');
@ -118,7 +119,7 @@ if ($company->id) {
}
// Personal informations
$v->setPhoneNumber($user2->phone_perso, "TYPE=HOME;VOICE");
$v->setPhoneNumber($user2->personal_mobile, "TYPE=HOME;VOICE");
if ($user2->birth) {
$v->setBirthday($user2->birth);
}

View File

@ -2787,7 +2787,7 @@ if (!GETPOST('hide_websitemenu')) {
print '<input type="submit" id="savefile" class="button buttonforacesave button-save" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
}
if ($action != 'preview') {
print '<input type="submit" class="button button-cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="cancel">';
print '<input type="submit" class="button button-cancel small" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="cancel">';
}
}
@ -3123,7 +3123,7 @@ if (!GETPOST('hide_websitemenu')) {
print '<input type="submit" id="savefile" class="button buttonforacesave button-save" value="'.dol_escape_htmltag($langs->trans("Save")).'" name="update">';
}
if ($action != 'preview') {
print '<input type="submit" class="button button-cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="cancel">';
print '<input type="submit" class="button button-cancel small" value="'.dol_escape_htmltag($langs->trans("Cancel")).'" name="cancel">';
}
}
@ -3545,8 +3545,8 @@ if ($action == 'createsite') {
if ($action == 'createsite') {
print '<div class="center">';
print '<input type="submit" class="button" name="addcontainer" value="'.$langs->trans("Create").'">';
print '<input class="button button-cancel" type="submit" name="preview" value="'.$langs->trans("Cancel").'">';
print '<input type="submit" class="button small" name="addcontainer" value="'.$langs->trans("Create").'">';
print '<input class="button button-cancel small" type="submit" name="preview" value="'.$langs->trans("Cancel").'">';
print '</div>';
}
@ -3574,8 +3574,8 @@ if ($action == 'importsite') {
print '<input type="hidden" name="max_file_size" value="'.$conf->maxfilesize.'">';
print '<input class="flat minwidth400" type="file" name="userfile[]" accept=".zip">';
print '<input type="submit" class="button" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">';
print '<input type="submit" class="button button-cancel" name="preview" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '<input type="submit" class="button small" name="buttonsubmitimportfile" value="'.dol_escape_htmltag($langs->trans("Upload")).'">';
print '<input type="submit" class="button button-cancel small" name="preview" value="'.dol_escape_htmltag($langs->trans("Cancel")).'">';
print '<br><br><br>';
@ -3630,29 +3630,6 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
if ($action == 'createcontainer') {
print '<br>';
if (!empty($conf->use_javascript_ajax)) {
print '<input type="radio" name="radiocreatefrom" id="checkboxcreatefromfetching" value="checkboxcreatefromfetching"'.(GETPOST('radiocreatefrom') == 'checkboxcreatefromfetching' ? ' checked' : '').'> ';
}
print '<label for="checkboxcreatefromfetching"><span class="opacitymediumxx">'.$langs->trans("CreateByFetchingExternalPage").'</span></label><br>';
print '<hr class="tablecheckboxcreatefromfetching'.$hiddenfromfetchingafterload.'">';
print '<table class="tableforfield centpercent tablecheckboxcreatefromfetching'.$hiddenfromfetchingafterload.'">';
print '<tr><td class="titlefield">';
print $langs->trans("URL");
print '</td><td>';
print info_admin($langs->trans("OnlyEditionOfSourceForGrabbedContentFuture"), 0, 0, 'warning');
print '<input class="flat minwidth500" type="text" name="externalurl" value="'.dol_escape_htmltag(GETPOST('externalurl', 'alpha')).'" placeholder="https://externalsite/pagetofetch"> ';
print '<br><input class="flat paddingtop" type="checkbox" name="grabimages" value="1" checked="checked"> '.$langs->trans("GrabImagesInto");
print ' ';
print $langs->trans("ImagesShouldBeSavedInto").' ';
$arraygrabimagesinto = array('root'=>$langs->trans("WebsiteRootOfImages"), 'subpage'=>$langs->trans("SubdirOfPage"));
print $form->selectarray('grabimagesinto', $arraygrabimagesinto, GETPOSTISSET('grabimagesinto') ? GETPOST('grabimagesinto') : 'root', 0, 0, 0, '', 0, 0, 0, '', '', 1);
print '<br>';
print '<input class="button" style="margin-top: 5px" type="submit" name="fetchexternalurl" value="'.dol_escape_htmltag($langs->trans("FetchAndCreate")).'">';
print '</td></tr>';
print '</table>';
print '<br>';
if (!empty($conf->use_javascript_ajax)) {
print '<input type="radio" name="radiocreatefrom" id="checkboxcreatemanually" value="checkboxcreatemanually"'.(GETPOST('radiocreatefrom') == 'checkboxcreatemanually' ? ' checked' : '').'> ';
}
@ -3819,7 +3796,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
if (empty($object->lang) && empty($object->otherlang)) {
$onlykeys = null; // We keep full list of languages
}
print $formadmin->select_language($pagelang ? $pagelang : '', 'WEBSITE_LANG', 0, null, '1', 0, 0, 'minwidth200', 0, 0, 0, $onlykeys, 1);
print img_picto('', 'language', 'class="pictofixedwidth"').$formadmin->select_language($pagelang ? $pagelang : '', 'WEBSITE_LANG', 0, null, '1', 0, 0, 'minwidth200', 0, 0, 0, $onlykeys, 1);
$htmltext = $langs->trans("AvailableLanguagesAreDefinedIntoWebsiteProperties");
print $form->textwithpicto('', $htmltext);
print '</td></tr>';
@ -3907,7 +3884,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
}
print '<tr><td class="toptd">'.$form->editfieldkey('Categories', 'categories', '', $objectpage, 0).'</td><td>';
print img_picto('', 'category', 'class="paddingright"');
print img_picto('', 'category', 'class="pictofixedwidth"');
print $form->multiselectarray('categories', $cate_arbo, (GETPOSTISSET('categories') ? GETPOST('categories', 'array') : $arrayselected), null, null, 'minwidth200 widthcentpercentminusxx');
print "</td></tr>";
}
@ -3983,16 +3960,42 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
if ($action == 'createcontainer') {
print '<div class="center tablecheckboxcreatemanually'.$hiddenmanuallyafterload.'">';
print '<input type="submit" class="button" name="addcontainer" value="'.$langs->trans("Create").'">';
print '<input class="button button-cancel" type="submit" name="preview" value="'.$langs->trans("Cancel").'">';
print '<input type="submit" class="button small" name="addcontainer" value="'.$langs->trans("Create").'">';
print '<input class="button button-cancel small" type="submit" name="preview" value="'.$langs->trans("Cancel").'">';
print '</div>';
print '<br>';
if (!empty($conf->use_javascript_ajax)) {
print '<input type="radio" name="radiocreatefrom" id="checkboxcreatefromfetching" value="checkboxcreatefromfetching"'.(GETPOST('radiocreatefrom') == 'checkboxcreatefromfetching' ? ' checked' : '').'> ';
}
print '<label for="checkboxcreatefromfetching"><span class="opacitymediumxx">'.$langs->trans("CreateByFetchingExternalPage").'</span></label><br>';
print '<hr class="tablecheckboxcreatefromfetching'.$hiddenfromfetchingafterload.'">';
print '<table class="tableforfield centpercent tablecheckboxcreatefromfetching'.$hiddenfromfetchingafterload.'">';
print '<tr><td class="titlefield">';
print $langs->trans("URL");
print '</td><td>';
print info_admin($langs->trans("OnlyEditionOfSourceForGrabbedContentFuture"), 0, 0, 'warning');
print '<input class="flat minwidth500" type="text" name="externalurl" value="'.dol_escape_htmltag(GETPOST('externalurl', 'alpha')).'" placeholder="https://externalsite/pagetofetch"> ';
print '<br><input class="flat paddingtop" type="checkbox" name="grabimages" value="1" checked="checked"> '.$langs->trans("GrabImagesInto");
print ' ';
print $langs->trans("ImagesShouldBeSavedInto").' ';
$arraygrabimagesinto = array('root'=>$langs->trans("WebsiteRootOfImages"), 'subpage'=>$langs->trans("SubdirOfPage"));
print $form->selectarray('grabimagesinto', $arraygrabimagesinto, GETPOSTISSET('grabimagesinto') ? GETPOST('grabimagesinto') : 'root', 0, 0, 0, '', 0, 0, 0, '', '', 1);
print '<br>';
print '<input class="button" style="margin-top: 5px" type="submit" name="fetchexternalurl" value="'.dol_escape_htmltag($langs->trans("FetchAndCreate")).'">';
print '</td></tr>';
print '</table>';
}
if ($action == 'createcontainer') {
print '<script type="text/javascript">
jQuery(document).ready(function() {
var disableautofillofalias = 0;
var selectedm = \'\';
var selectedf = \'\';
jQuery("#WEBSITE_TITLE").keyup(function() {
if (disableautofillofalias == 0)
{
@ -4009,17 +4012,31 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties
disableautofillofalias = 1;
});
jQuery("#checkboxcreatefromfetching,#checkboxcreatemanually").change(function() {
console.log("we select a method to create a new container"+jQuery("#checkboxcreatefromfetching:checked").val())
if (typeof(jQuery("#checkboxcreatefromfetching:checked").val()) != \'undefined\')
{
jQuery(".tablecheckboxcreatefromfetching").show();
jQuery(".tablecheckboxcreatemanually").hide();
jQuery("#checkboxcreatefromfetching,#checkboxcreatemanually").click(function() {
console.log("we select a method to create a new container "+jQuery("#checkboxcreatefromfetching:checked").val())
jQuery(".tablecheckboxcreatefromfetching").hide();
jQuery(".tablecheckboxcreatemanually").hide();
if (typeof(jQuery("#checkboxcreatefromfetching:checked").val()) != \'undefined\') {
console.log("show a");
if (selectedf != \'createfromfetching\') {
jQuery(".tablecheckboxcreatefromfetching").show();
selectedf = \'createfromfetching\';
selectedm = \'\';
} else {
jQuery(".tablecheckboxcreatefromfetching").hide();
selectedf = \'\';
}
}
if (typeof(jQuery("#checkboxcreatemanually:checked").val()) != \'undefined\')
{
jQuery(".tablecheckboxcreatefromfetching").hide();
jQuery(".tablecheckboxcreatemanually").show();
if (typeof(jQuery("#checkboxcreatemanually:checked").val()) != \'undefined\') {
console.log("show b");
if (selectedm != \'createmanually\') {
jQuery(".tablecheckboxcreatemanually").show();
selectedm = \'createmanually\';
selectedf = \'\';
} else {
jQuery(".tablecheckboxcreatemanually").hide();
selectedm = \'\';
}
}
});
});