diff --git a/dev/setup/apache/virtualhost b/dev/setup/apache/virtualhost index c3a2dff3e43..8c7682fe3d9 100644 --- a/dev/setup/apache/virtualhost +++ b/dev/setup/apache/virtualhost @@ -1,62 +1,93 @@ -#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" + + + 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 + + + # Leaving /public and /api, /dav, .well_known but also wrappers for document and viewimage accessible to everyone + + AuthType None + Require all granted + Satisfy any + + + AuthType None + Require all granted + Satisfy any + + + AuthType None + Require all granted + Satisfy any + + + AuthType None + Require all granted + Satisfy any + + + AuthType None + Require all granted + Satisfy any + -UseCanonicalName On - -AddDefaultCharset UTF-8 - -DocumentRoot "/home/.../htdocs" - - - AllowOverride None - Options -Indexes -MultiViews +FollowSymLinks -ExecCGI - Require all granted - - - - 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 - - - -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] diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php index daf20ce5aa2..787a9d6d820 100644 --- a/htdocs/admin/index.php +++ b/htdocs/admin/index.php @@ -47,6 +47,7 @@ llxHeader('', $langs->trans("Setup"), $wikihelp); print load_fiche_titre($langs->trans("SetupArea"), '', 'tools'); + if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) { $conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('//i', '
', $conf->global->MAIN_MOTD_SETUPPAGE); if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) { @@ -76,12 +77,15 @@ print $langs->trans("SetupDescription2", $langs->transnoentities("MenuCompanySet print "

"; print ''; -print '

'; +print '
'; // Show info setup company if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INFO_SOCIETE_COUNTRY)) { $setupcompanynotcomplete = 1; } + +print '
'; + print img_picto('', 'company', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/company.php?mainmenu=home'.(empty($setupcompanynotcomplete) ? '' : '&action=edit&token='.newToken()), $langs->transnoentities("Setup"), $langs->transnoentities("MenuCompanySetup")); print '

'; print $langs->trans("SetupDescription3b"); @@ -90,10 +94,13 @@ if (!empty($setupcompanynotcomplete)) { $warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"'); print '
'; } + +print '
'; + print '
'; print '
'; -print '
'; -print '
'; + +print '
'; // Show info setup module print img_picto('', 'cog', 'class="paddingright valignmiddle double"').' '.$langs->trans("SetupDescriptionLink", DOL_URL_ROOT.'/admin/modules.php?mainmenu=home', $langs->transnoentities("Setup"), $langs->transnoentities("Modules")); @@ -103,7 +110,9 @@ if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FO $warnpicto = img_warning($langs->trans("WarningEnableYourModulesApplications"), 'style="padding-right: 6px;"'); print '
'; } -print '
'; + +print '
'; + print '
'; print '
'; print '
'; diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index 83ab700f59a..578e1afa497 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -320,12 +320,12 @@ class BlockedLog $this->error++; } } elseif ($this->action == 'MODULE_SET') { - return 'System to track events into unalterable logs were enabled'; + return ''.$langs->trans("BlockedLogEnabled").''; } elseif ($this->action == 'MODULE_RESET') { if ($this->signature == '0000000000') { - return 'System to track events into unalterable logs were disabled after some recording were done. We saved a special Fingerprint to track the chain as broken.'; + return ''.$langs->trans("BlockedLogDisabled").''; } else { - return 'System to track events into unalterable logs were disabled. This is possible because no record were done yet.'; + return ''.$langs->trans("BlockedLogDisabledBis").''; } } diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 7d83a88ce55..cbd730e5d23 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -148,8 +148,17 @@ if (empty($reshook)) { $error = 0; // Set if we used free entry or predefined product - $idprod = (int) GETPOST('idprod', 'int'); - $bom_child = (int) GETPOST('bom_select', 'int'); + $bom_child_id = (int) GETPOST('bom_id', 'int'); + if ($bom_child_id > 0) { + $bom_child = new BOM($db); + $res = $bom_child->fetch($bom_child_id); + if ($res) { + $idprod = $bom_child->fk_product; + } + } else { + $idprod = (int) GETPOST('idprod', 'int'); + } + $qty = price2num(GETPOST('qty', 'alpha'), 'MS'); $qty_frozen = price2num(GETPOST('qty_frozen', 'alpha'), 'MS'); $disable_stock_change = GETPOST('disable_stock_change', 'int'); @@ -173,7 +182,7 @@ if (empty($reshook)) { $bomline = new BOMLine($db); $bomline->fk_bom = $id; $bomline->fk_product = $idprod; - $bomline->fk_bom_child = $bom_child; + $bomline->fk_bom_child = $bom_child_id; $bomline->qty = $qty; $bomline->qty_frozen = (int) $qty_frozen; $bomline->disable_stock_change = (int) $disable_stock_change; @@ -580,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('(-) '); + $(this).html(''); } else { $('[parentid="'+ id_bom_line +'"]').hide(); - $(this).html('(+) '); + $(this).html(''); } return false; @@ -596,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('(-) '); + $("[class^=collapse_bom]").html(''); return false; }); @@ -604,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('(+) '); + $("[class^=collapse_bom]").html(''); return false; }); diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index 0520c76dde2..4923e9d0ca2 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1064,26 +1064,41 @@ class BOM extends CommonObject $tmpproduct->cost_price = 0; $tmpproduct->pmp = 0; - $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading - if ($result < 0) { - $this->error = $tmpproduct->error; - return -1; - } - $line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); - if (empty($line->unit_cost)) { - if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) { - $line->unit_cost = $productFournisseur->fourn_unitprice; + if (empty($line->fk_bom_child)) { + $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading + if ($result < 0) { + $this->error = $tmpproduct->error; + return -1; + } + $line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp); + if (empty($line->unit_cost)) { + if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) { + $line->unit_cost = $productFournisseur->fourn_unitprice; + } + } + + $line->total_cost = price2num($line->qty * $line->unit_cost, 'MT'); + + $this->total_cost += $line->total_cost; + } else { + $bom_child= new BOM($this->db); + $res = $bom_child->fetch($line->fk_bom_child); + if ($res>0) { + $bom_child->calculateCosts(); + $this->total_cost += $bom_child->total_cost; + } else { + $this->error = $bom_child->error; + return -2; } } - $line->total_cost = price2num($line->qty * $line->unit_cost, 'MT'); - - $this->total_cost += $line->total_cost; } $this->total_cost = price2num($this->total_cost, 'MT'); - if ($this->qty) { + if ($this->qty > 0) { $this->unit_cost = price2num($this->total_cost / $this->qty, 'MU'); + } elseif ($this->qty < 0) { + $this->unit_cost = price2num($this->total_cost * $this->qty, 'MU'); } } } diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 7419c4618e0..0a3a3b34e7a 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -109,7 +109,7 @@ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { if (!empty($conf->global->BOM_SUB_BOM)) { print '
'.$langs->trans("or").'
'.$langs->trans("BOM"); // TODO Add component to select a BOM - print ''; + $form->select_bom(); } print ''; diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php index 82626c12fec..b72ed043581 100644 --- a/htdocs/bom/tpl/objectline_view.tpl.php +++ b/htdocs/bom/tpl/objectline_view.tpl.php @@ -41,7 +41,7 @@ if (empty($object) || !is_object($object)) { } -global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax; +global $forceall, $senderissupplier, $inputalsopricewithtax, $outputalsopricetotalwithtax, $langs; if (empty($dateSelector)) { $dateSelector = 0; @@ -83,8 +83,12 @@ $tmpproduct->fetch($line->fk_product); $tmpbom = new BOM($object->db); $res = $tmpbom->fetch($line->fk_bom_child); if ($tmpbom->id > 0) { + print $tmpproduct->getNomUrl(1); + print ' '.$langs->trans("or").' '; print $tmpbom->getNomUrl(1); - print '' . (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? '(+)' : '(-)') . ' '; + print ' '; + print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open')); + print ''; } else { print $tmpproduct->getNomUrl(1); print ' - '.$tmpproduct->label; @@ -176,7 +180,7 @@ if ($action == 'selectlines') { print ''; // Select of all the sub-BOM lines -$sql = 'SELECT rowid, fk_bom_child, fk_product FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; +$sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl'; $sql.= ' WHERE fk_bom ='. (int) $tmpbom->id; $resql = $object->db->query($sql); @@ -199,21 +203,23 @@ if ($resql) { print ''; } - // Product - print ''.$sub_bom_product->getNomUrl(1).''; - - // Sub-BOM - if ($sub_bom_line->fk_bom_child > 0) { - print ''.$sub_bom->getNomUrl(1).''; + // Product OR BOM + print ''; + if (!empty($obj->fk_bom_child)) { + print $sub_bom_product->getNomUrl(1); + print ' '.$langs->trans('or').' '; + print $sub_bom->getNomUrl(1); } else { - print ' '; + print $sub_bom_product->getNomUrl(1); + print ''; } // Qty - print ''.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).''; if ($sub_bom_line->qty_frozen > 0) { - print ''.$sub_bom_line->qty_frozen.''; + print ''.price($sub_bom_line->qty, 0, '', 0, 0).''; + print ''.$langs->trans('Yes').''; } else { + print ''.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).''; print ' '; } @@ -230,18 +236,20 @@ if ($resql) { // Cost price if it's defined if ($sub_bom_product->cost_price > 0) { print ''.price($sub_bom_product->cost_price * $line->qty).''; - $total_cost.= $sub_bom_product->cost_price * $line->qty; + $total_cost+= $sub_bom_product->cost_price * $line->qty; } elseif ($sub_bom_product->pmp > 0) { // PMP if cost price isn't defined print ''.price($sub_bom_product->pmp * $line->qty).''; $total_cost.= $sub_bom_product->pmp * $line->qty; } else { // Minimum purchase price if cost price and PMP aren't defined - $sql_supplier_price = 'SELECT MIN(price) AS min_price FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; + $sql_supplier_price = 'SELECT MIN(price) AS min_price, quantity AS qty FROM '.MAIN_DB_PREFIX.'product_fournisseur_price'; $sql_supplier_price.= ' WHERE fk_product = '. (int) $sub_bom_product->id; $resql_supplier_price = $object->db->query($sql_supplier_price); if ($resql_supplier_price) { $obj = $object->db->fetch_object($resql_supplier_price); - print ''.price($obj->min_price * $line->qty).''; - $total_cost+= $obj->min_price * $line->qty; + $line_cost = $obj->min_price/$obj->qty * $sub_bom_line->qty; + + print ''.price($line_cost).''; + $total_cost+= $line_cost; } } diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 52b93acdabb..627c2f0ce51 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -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 ''.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent, 3).''; + print ''.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent ? 1 : 0, 3).''; $rowspan = 4; if (empty($conf->global->AGENDA_DISABLE_LOCATION)) { @@ -1969,7 +1969,7 @@ if ($id > 0) { // Date start print ''.$langs->trans("DateActionStart").''; - 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 ''.$langs->trans("DateActionEnd").''; - if (!$object->fulldayevent) { + if (empty($object->fulldayevent)) { print dol_print_date($object->datef, 'dayhour', 'tzuser'); } else { print dol_print_date($object->datef, 'day', 'tzuser'); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 9ab13962bfa..19273648827 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -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").", "; diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 59c101c390d..c69d396cf26 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -194,11 +194,11 @@ if ($object->id > 0) { } // Full day event - print ''.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent, 3).''; + print ''.$langs->trans("EventOnFullDay").''.yn($object->fulldayevent ? 1 : 0, 3).''; // Date start print ''.$langs->trans("DateActionStart").''; - 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 ''.$langs->trans("DateActionEnd").''; - if (!$object->fulldayevent) { + if (empty($object->fulldayevent)) { print dol_print_date($object->datef, 'dayhour', 'tzuser'); } else { print dol_print_date($object->datef, 'day', 'tzuser'); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index e3b2c64c92a..c315a4fcd61 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -626,7 +626,7 @@ class Commande extends CommonOrder $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."commande"; - $sql .= " SET fk_statut = ".self::STATUS_DRAFT."',"; + $sql .= " SET fk_statut = ".self::STATUS_DRAFT.","; $sql .= " fk_user_modif = ".((int) $user->id); $sql .= " WHERE rowid = ".((int) $this->id); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 717b57ae8b1..febab2d5917 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1462,11 +1462,6 @@ if ($resql) { print ''; print $generic_commande->getNomUrl(1, ($search_status != 2 ? 0 : $obj->fk_statut), 0, 0, 0, 1, 1); - // Warning late icon and note - if ($generic_commande->hasDelay()) { - print img_picto($langs->trans("Late").' : '.$generic_commande->showDelay(), "warning"); - } - $filename = dol_sanitizeFileName($obj->ref); $filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref); $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; @@ -1590,6 +1585,10 @@ if ($resql) { if (!empty($arrayfields['c.date_commande']['checked'])) { print ''; print dol_print_date($db->jdate($obj->date_commande), 'day'); + // Warning late icon and note + if ($generic_commande->hasDelay()) { + print img_picto($langs->trans("Late").' : '.$generic_commande->showDelay(), "warning"); + } print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 332f68c1293..c68a686d2bf 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -210,11 +210,11 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) { print ''; print $tmpinvoice->getNomUrl(1, ''); print ''; - print ''; if ($tmpinvoice->hasDelay()) { + print ''; print img_warning($langs->trans("Late")); + print ''; } - print ''; print ''; $filename = dol_sanitizeFileName($obj->ref); $filedir = $conf->facture->dir_output.'/'.dol_sanitizeFileName($obj->ref); diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php index 4b44959bc1a..15c45d6055b 100644 --- a/htdocs/compta/tva/quadri_detail.php +++ b/htdocs/compta/tva/quadri_detail.php @@ -6,7 +6,7 @@ * Copyright (C) 2014 Ferran Marcet * Copyright (C) 2018-2021 Frédéric France * Copyright (C) 2019 Eric Seigne - * Copyright (C) 2021 Open-Dsi + * Copyright (C) 2021-2022 Open-Dsi * * 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 @@ -47,7 +47,7 @@ $langs->loadLangs(array("other", "compta", "banks", "bills", "companies", "produ $refresh = (GETPOSTISSET('submit') || GETPOSTISSET('vat_rate_show') || GETPOSTISSET('invoice_type')) ? true : false; $invoice_type = GETPOSTISSET('invoice_type') ? GETPOST('invoice_type', 'alpha') : ''; -$vat_rate_show = GETPOSTISSET('vat_rate_show') ? GETPOST('vat_rate_show', 'int') : -1; +$vat_rate_show = GETPOSTISSET('vat_rate_show') ? GETPOST('vat_rate_show', 'alphanohtml') : -1; include DOL_DOCUMENT_ROOT.'/compta/tva/initdatesforvat.inc.php'; @@ -409,7 +409,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { print ''; print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%'; print ' - ' . img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . ''; @@ -643,7 +643,7 @@ if (!is_array($x_coll) || !is_array($x_paye)) { print ''; print $langs->trans('Rate') . ' : ' . vatrate($rate) . '%'; print ' - ' . img_picto('', 'chevron-down', 'class="paddingrightonly"') . $langs->trans('VATReportShowByRateDetails') . ''; diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 27e8cc6bf95..b2c9543453b 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -387,7 +387,7 @@ class Contrat extends CommonObject if ($contratline->statut != ContratLigne::STATUS_OPEN) { $contratline->context = $this->context; - $result = $contratline->active_line($user, $date_start, -1, $comment); + $result = $contratline->active_line($user, $date_start, -1, $comment); // This call trigger LINECONTRACT_ACTIVATE if ($result < 0) { $error++; $this->error = $contratline->error; diff --git a/htdocs/core/ajax/selectsearchbox.php b/htdocs/core/ajax/selectsearchbox.php index 1814b476d06..ae4f7c41515 100644 --- a/htdocs/core/ajax/selectsearchbox.php +++ b/htdocs/core/ajax/selectsearchbox.php @@ -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 diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index 53cf5c79571..94695034cce 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -170,7 +170,7 @@ class box_scheduled_jobs extends ModeleBoxes ); $this->info_box_contents[$line][] = array( 'td' => 'class="center"', - 'textnoformat' => ($nbjobsinerror ? '
'.$nbjobsinerror.'
' : '
0
') + 'textnoformat' => ($nbjobsinerror ? '
'.$nbjobsinerror.'
' : '
0
') ); } else { $this->info_box_contents[0][0] = array( diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 9a011591afb..abd2c7dd502 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -804,9 +804,6 @@ class ExtraFields if ($elementtype == 'order_supplier') { $elementtype = 'commande_fournisseur'; } - if ($elementtype == 'stock_mouvement') { - $elementtype = 'movement'; - } $array_name_label = array(); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 91c45055296..6c4d5037bc3 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2367,6 +2367,69 @@ class Form } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + + /** + * Return list of BOM for customer in Ajax if Ajax activated or go to select_produits_list + * + * @param int $selected Preselected BOM id + * @param string $htmlname Name of HTML select field (must be unique in page). + * @param int $limit Limit on number of returned lines + * @param int $status Sell status -1=Return all bom, 0=Draft BOM, 1=Validated BOM + * @param int $type type of the BOM (-1=Return all BOM, 0=Return disassemble BOM, 1=Return manufacturing BOM) + * @param string $showempty '' to not show empty line. Translation key to show an empty line. '1' show empty line with no text. + * @param string $morecss Add more css on select + * @param string $nooutput No print, return the output into a string + * @param int $forcecombo Force to use combo box + * @return void|string + */ + public function select_bom($selected = '', $htmlname = 'bom_id', $limit = 0, $status = 1, $type = 1, $showempty = '1', $morecss = '', $nooutput = '', $forcecombo = 0) + { + // phpcs:enable + global $conf, $user, $langs, $db; + + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + + $error = 0; + $out = ''; + + if (!$forcecombo) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php'; + $out .= ajax_combobox($htmlname, $events, getDolGlobalInt("PRODUIT_USE_SEARCH_TO_SELECT")); + } + + $out .= ''."\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 .= ''; + if (array_key_exists($productId, $this->cache_lot)) { + foreach ($this->cache_lot[$productId] as $id => $arraytypes) { + if (empty($fk_entrepot) || $fk_entrepot == $arraytypes['entrepot_id']) { + $label = $arraytypes['entrepot_label'] . ' - '; + $label .= $arraytypes['batch']; + $out .= ''; + } } } } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ec9494e77b0..5db23396a1c 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -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) { @@ -5120,9 +5131,10 @@ class Product extends CommonObject * @param string $origin_element Origin element type * @param int $origin_id Origin id of element * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) - * @return int <0 if KO, >0 if OK + * @param array $extrafields Array of extrafields + * @return int <0 if KO, >0 if OK */ - public function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0) + public function correct_stock($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null) { // phpcs:enable if ($id_entrepot) { @@ -5145,6 +5157,11 @@ class Product extends CommonObject $result = $movementstock->_create($user, $this->id, $id_entrepot, $op[$movement], $movement, $price, $label, $inventorycode, '', '', '', '', false, 0, $disablestockchangeforsubproduct); if ($result >= 0) { + if ($extrafields) { + $array_options = $extrafields->getOptionalsFromPost('stock_mouvement'); + $movementstock->array_options = $array_options; + $movementstock->insertExtraFields(); + } $this->db->commit(); return 1; } else { @@ -5174,9 +5191,10 @@ class Product extends CommonObject * @param string $origin_element Origin element type * @param int $origin_id Origin id of element * @param int $disablestockchangeforsubproduct Disable stock change for sub-products of kit (usefull only if product is a subproduct) + * @param array $extrafields Array of extrafields * @return int <0 if KO, >0 if OK */ - public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0) + public function correct_stock_batch($user, $id_entrepot, $nbpiece, $movement, $label = '', $price = 0, $dlc = '', $dluo = '', $lot = '', $inventorycode = '', $origin_element = '', $origin_id = null, $disablestockchangeforsubproduct = 0, $extrafields = null) { // phpcs:enable if ($id_entrepot) { @@ -5199,6 +5217,11 @@ class Product extends CommonObject $result = $movementstock->_create($user, $this->id, $id_entrepot, $op[$movement], $movement, $price, $label, $inventorycode, '', $dlc, $dluo, $lot, false, 0, $disablestockchangeforsubproduct); if ($result >= 0) { + if ($extrafields) { + $array_options = $extrafields->getOptionalsFromPost('stock_mouvement'); + $movementstock->array_options = $array_options; + $movementstock->insertExtraFields(); + } $this->db->commit(); return 1; } else { diff --git a/htdocs/product/price.php b/htdocs/product/price.php index d21574e696e..45ecbd9bafa 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1278,22 +1278,30 @@ if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $a if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; + } else { + print '
' . $langs->trans("UpdateDefaultPrice") . '
'; } } if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; + } else { + print '
' . $langs->trans("AddCustomerPrice") . '
'; } } if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) { if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; + } else { + print '
' . $langs->trans("UpdateVAT") . '
'; } if ($user->rights->produit->creer || $user->rights->service->creer) { print ''; + } else { + print '
' . $langs->trans("UpdateLevelPrices") . '
'; } } } diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 62bfd626f82..23258aa1e86 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -39,14 +39,14 @@ $action = GETPOST('action', 'aZ09'); $sref = GETPOST("sref", 'alpha'); $snom = GETPOST("snom", 'alpha'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$type = GETPOST("type", "int"); +$type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT; $search_barcode = GETPOST("search_barcode", 'alpha'); -$catid = GETPOST('catid', 'int'); $toolowstock = GETPOST('toolowstock'); $tosell = GETPOST("tosell"); $tobuy = GETPOST("tobuy"); $fourn_id = GETPOST("fourn_id", 'int'); $sbarcode = GETPOST("sbarcode", 'int'); +$search_stock_physique = GETPOST('search_stock_physique', 'alpha'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -68,7 +68,11 @@ $offset = $limit * $page; // Load sale and categ filters $search_sale = GETPOST("search_sale"); -$search_categ = GETPOST("search_categ"); +if (GETPOSTISSET('catid')) { + $search_categ = GETPOST('catid', 'int'); +} else { + $search_categ = GETPOST('search_categ', 'int'); +} // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $canvas = GETPOST("canvas"); @@ -111,11 +115,10 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $tobuy = ""; $search_sale = ""; $search_categ = ""; - $type = ""; - $catid = ''; $toolowstock = ''; $fourn_id = ''; $sbarcode = ''; + $search_stock_physique = ''; } @@ -146,13 +149,22 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e ON s.fk_entrepot = e.rowid A if (!empty($conf->global->PRODUCT_USE_UNITS)) { $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_units as u on p.fk_unit = u.rowid'; } -// We'll need this table joined to the select in order to filter by categ -if ($search_categ) { - $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; -} $sql .= " WHERE p.entity IN (".getEntity('product').")"; -if ($search_categ) { - $sql .= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ +if (!empty($search_categ) && $search_categ != '-1') { + $sql .= " AND "; + if ($search_categ == -2) { + $sql .= " NOT EXISTS "; + } else { + $sql .= " EXISTS "; + } + $sql .= "("; + $sql .= " SELECT cp.fk_categorie, cp.fk_product"; + $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_product as cp"; + $sql .= " WHERE cp.fk_product = p.rowid"; // Join for the needed table to filter by categ + if ($search_categ > 0) { + $sql .= " AND cp.fk_categorie = " . ((int) $search_categ); + } + $sql .= ")"; } if ($sall) { $sql .= natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall); @@ -183,24 +195,32 @@ if (!empty($tobuy)) { if (!empty($canvas)) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } -if ($catid > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $catid); -} if ($fourn_id > 0) { $sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".((int) $fourn_id); } -// Insert categ filter -if ($search_categ > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_categ); -} $sql .= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,"; $sql .= " p.fk_product_type, p.tms, p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock"; // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +$sql_having = ''; if ($toolowstock) { - $sql .= " HAVING SUM(".$db->ifsql('s.reel IS NULL', '0', 's.reel').") < p.seuil_stock_alerte"; + $sql_having .= " HAVING SUM(".$db->ifsql('s.reel IS NULL', '0', 's.reel').") < p.seuil_stock_alerte"; +} +if ($search_stock_physique != '') { + //$natural_search_physique = natural_search('HAVING SUM(' . $db->ifsql('s.reel IS NULL', '0', 's.reel') . ')', $search_stock_physique, 1, 1); + $natural_search_physique = natural_search('SUM(' . $db->ifsql('s.reel IS NULL', '0', 's.reel') . ')', $search_stock_physique, 1, 1); + $natural_search_physique = " " . substr($natural_search_physique, 1, -1); // remove first "(" and last ")" characters + if (!empty($sql_having)) { + $sql_having .= " AND"; + } else { + $sql_having .= " HAVING"; + } + $sql_having .= $natural_search_physique; +} +if (!empty($sql_having)) { + $sql .= $sql_having; } $sql .= $db->order($sortfield, $sortorder); @@ -253,7 +273,7 @@ if ($resql) { if ($tobuy) { $param .= "&tobuy=".urlencode($tobuy); } - if ($type) { + if ($type != '') { $param .= "&type=".urlencode($type); } if ($fourn_id) { @@ -268,7 +288,7 @@ if ($resql) { if ($search_sale) { $param .= "&search_sale=".urlencode($search_sale); } - if ($search_categ) { + if (!empty($search_categ) && $search_categ != '-1') { $param .= "&search_categ=".urlencode($search_categ); } if ($toolowstock) { @@ -277,8 +297,8 @@ if ($resql) { if ($sbarcode) { $param .= "&sbarcode=".urlencode($sbarcode); } - if ($catid) { - $param .= "&catid=".urlencode($catid); + if ($search_stock_physique) { + $param .= '&search_stock_physique=' . urlencode($search_stock_physique); } llxHeader("", $texte, $helpurl); @@ -292,10 +312,10 @@ if ($resql) { print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'product', 0, '', '', $limit); - if (!empty($catid)) { + if ($search_categ > 0) { print "
"; $c = new Categorie($db); - $c->fetch($catid); + $c->fetch($search_categ); $ways = $c->print_all_ways(' > ', 'product/reassort.php'); print " > ".$ways[0]."
\n"; print "

"; @@ -306,7 +326,7 @@ if ($resql) { if (!empty($conf->categorie->enabled)) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); - $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ'); + $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); $moreforfilter .= '
'; } @@ -323,32 +343,6 @@ if ($resql) { print ''; } - $param = ''; - if ($tosell) { - $param .= "&tosell=".urlencode($tosell); - } - if ($tobuy) { - $param .= "&tobuy=".urlencode($tobuy); - } - if ($type) { - $param .= "&type=".urlencode($type); - } - if ($fourn_id) { - $param .= "&fourn_id=".urlencode($fourn_id); - } - if ($snom) { - $param .= "&snom=".urlencode($snom); - } - if ($sref) { - $param .= "&sref=".urlencode($sref); - } - if ($toolowstock) { - $param .= "&toolowstock=".urlencode($toolowstock); - } - if ($search_categ) { - $param .= "&search_categ=".urlencode($search_categ); - } - $formProduct = new FormProduct($db); $formProduct->loadWarehouses(); $warehouses_list = $formProduct->cache_warehouses; @@ -378,7 +372,10 @@ if ($resql) { // Stock limit print ' '; print ' '; - print ' '; + // Physical stock + print ''; + print ''; + print ''; if ($virtualdiffersfromphysical) { print ' '; } @@ -396,14 +393,14 @@ if ($resql) { //Line for column titles print ""; - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", $param, "", "", $sortfield, $sortorder); - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", '', $param, "", $sortfield, $sortorder); if (!empty($conf->service->enabled) && $type == 1) { - print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration", '', $param, "", $sortfield, $sortorder, 'center '); } - print_liste_field_titre("StockLimit", $_SERVER["PHP_SELF"], "p.seuil_stock_alerte", $param, "", '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock", $param, "", '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", $param, "", '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("StockLimit", $_SERVER["PHP_SELF"], "p.seuil_stock_alerte", '', $param, "", $sortfield, $sortorder, 'right '); + print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock", '', $param, "", $sortfield, $sortorder, 'right '); + print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", '', $param, "", $sortfield, $sortorder, 'right '); // Details per warehouse if (!empty($conf->global->STOCK_DETAIL_ON_WAREHOUSE)) { // TODO This should be moved into the selection of fields on page product/list (page product/stock will be removed and replaced with product/list with its own context) if ($nb_warehouse > 1) { @@ -413,15 +410,15 @@ if ($resql) { } } if ($virtualdiffersfromphysical) { - print_liste_field_titre("VirtualStock", $_SERVER["PHP_SELF"], "", $param, "", '', $sortfield, $sortorder, 'right ', 'VirtualStockDesc'); + print_liste_field_titre("VirtualStock", $_SERVER["PHP_SELF"], "", '', $param, "", $sortfield, $sortorder, 'right ', 'VirtualStockDesc'); } // Units if (!empty($conf->global->PRODUCT_USE_UNITS)) { - print_liste_field_titre("Unit", $_SERVER["PHP_SELF"], "unit_short", $param, "", 'align="right"', $sortfield, $sortorder); + print_liste_field_titre("Unit", $_SERVER["PHP_SELF"], "unit_short", '', $param, 'align="right"', $sortfield, $sortorder); } print_liste_field_titre(''); - print_liste_field_titre("ProductStatusOnSell", $_SERVER["PHP_SELF"], "p.tosell", $param, "", '', $sortfield, $sortorder, 'right '); - print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", $param, "", '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("ProductStatusOnSell", $_SERVER["PHP_SELF"], "p.tosell", '', $param, "", $sortfield, $sortorder, 'right '); + print_liste_field_titre("ProductStatusOnBuy", $_SERVER["PHP_SELF"], "p.tobuy", '', $param, "", $sortfield, $sortorder, 'right '); // Hook fields $parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 2bd62b2ce22..c5463e3e4e2 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -41,16 +41,16 @@ $action = GETPOST('action', 'aZ09'); $sref = GETPOST("sref", 'alpha'); $snom = GETPOST("snom", 'alpha'); $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); -$type = GETPOST("type", "int"); +$type = GETPOSTISSET('type') ? GETPOST('type', 'int') : Product::TYPE_PRODUCT; $search_barcode = GETPOST("search_barcode", 'alpha'); $search_warehouse = GETPOST('search_warehouse', 'alpha'); $search_batch = GETPOST('search_batch', 'alpha'); -$catid = GETPOST('catid', 'int'); $toolowstock = GETPOST('toolowstock'); $tosell = GETPOST("tosell"); $tobuy = GETPOST("tobuy"); $fourn_id = GETPOST("fourn_id", 'int'); $sbarcode = GETPOST("sbarcode", 'int'); +$search_stock_physique = GETPOST('search_stock_physique', 'alpha'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); @@ -72,7 +72,11 @@ $offset = $limit * $page; // Load sale and categ filters $search_sale = GETPOST("search_sale"); -$search_categ = GETPOST("search_categ"); +if (GETPOSTISSET('catid')) { + $search_categ = GETPOST('catid', 'int'); +} else { + $search_categ = GETPOST('search_categ', 'int'); +} // Get object canvas (By default, this is not defined, so standard usage of dolibarr) $canvas = GETPOST("canvas"); @@ -102,13 +106,12 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $tobuy = ""; $search_sale = ""; $search_categ = ""; - $type = ""; - $catid = ''; $toolowstock = ''; $search_batch = ''; $search_warehouse = ''; $fourn_id = ''; $sbarcode = ''; + $search_stock_physique = ''; } @@ -135,13 +138,22 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_stock as ps on p.rowid = ps.fk_pro $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'entrepot as e on ps.fk_entrepot = e.rowid'; // Link on unique key $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_batch as pb on pb.fk_product_stock = ps.rowid'; // Detail for each lot on each warehouse $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_lot as pl on pl.fk_product = p.rowid AND pl.batch = pb.batch'; // Link on unique key -// We'll need this table joined to the select in order to filter by categ -if ($search_categ > 0) { - $sql .= ", ".MAIN_DB_PREFIX."categorie_product as cp"; -} $sql .= " WHERE p.entity IN (".getEntity('product').")"; -if ($search_categ > 0) { - $sql .= " AND p.rowid = cp.fk_product"; // Join for the needed table to filter by categ +if (!empty($search_categ) && $search_categ != '-1') { + $sql .= " AND "; + if ($search_categ == -2) { + $sql .= " NOT EXISTS "; + } else { + $sql .= " EXISTS "; + } + $sql .= "("; + $sql .= " SELECT cp.fk_categorie, cp.fk_product"; + $sql .= " FROM " . MAIN_DB_PREFIX . "categorie_product as cp"; + $sql .= " WHERE cp.fk_product = p.rowid"; // Join for the needed table to filter by categ + if ($search_categ > 0) { + $sql .= " AND cp.fk_categorie = " . ((int) $search_categ); + } + $sql .= ")"; } if ($sall) { $sql .= natural_search(array('p.ref', 'p.label', 'p.description', 'p.note'), $sall); @@ -172,16 +184,9 @@ if (!empty($tobuy)) { if (!empty($canvas)) { $sql .= " AND p.canvas = '".$db->escape($canvas)."'"; } -if ($catid > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $catid); -} if ($fourn_id > 0) { $sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".((int) $fourn_id); } -// Insert categ filter -if ($search_categ > 0) { - $sql .= " AND cp.fk_categorie = ".((int) $search_categ); -} if ($search_warehouse) { $sql .= natural_search("e.ref", $search_warehouse); } @@ -195,8 +200,22 @@ $sql .= " ps.fk_entrepot,"; $sql .= " e.ref, e.lieu, e.fk_parent,"; $sql .= " pb.batch, pb.eatby, pb.sellby,"; $sql .= " pl.rowid, pl.eatby, pl.sellby"; +$sql_having = ''; if ($toolowstock) { - $sql .= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet + $sql_having .= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet +} +if ($search_stock_physique != '') { + $natural_search_physique = natural_search('SUM(' . $db->ifsql('pb.qty IS NULL', '0', 'pb.qty') . ')', $search_stock_physique, 1, 1); + $natural_search_physique = " " . substr($natural_search_physique, 1, -1); // remove first "(" and last ")" characters + if (!empty($sql_having)) { + $sql_having .= " AND"; + } else { + $sql_having .= " HAVING"; + } + $sql_having .= $natural_search_physique; +} +if (!empty($sql_having)) { + $sql .= $sql_having; } $sql .= $db->order($sortfield, $sortorder); @@ -248,7 +267,7 @@ if ($resql) { if ($tobuy) { $param .= "&tobuy=".urlencode($tobuy); } - if ($type) { + if ($type != '') { $param .= "&type=".urlencode($type); } if ($fourn_id) { @@ -269,18 +288,18 @@ if ($resql) { if ($search_warehouse) { $param .= "&search_warehouse=".urlencode($search_warehouse); } - if ($catid) { - $param .= "&catid=".urlencode($catid); - } if ($toolowstock) { $param .= "&toolowstock=".urlencode($toolowstock); } if ($search_sale) { $param .= "&search_sale=".urlencode($search_sale); } - if ($search_categ > 0) { + if (!empty($search_categ) && $search_categ != '-1') { $param .= "&search_categ=".urlencode($search_categ); } + if ($search_stock_physique) { + $param .= '&search_stock_physique=' . urlencode($search_stock_physique); + } /*if ($eatby) $param.="&eatby=".$eatby; if ($sellby) $param.="&sellby=".$sellby;*/ @@ -295,10 +314,10 @@ if ($resql) { print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'product', 0, '', '', $limit, 0, 0, 1); - if (!empty($catid)) { + if ($search_categ > 0) { print "
"; $c = new Categorie($db); - $c->fetch($catid); + $c->fetch($search_categ); $ways = $c->print_all_ways(' > ', 'product/reassortlot.php'); print " > ".$ways[0]."
\n"; print "

"; @@ -309,7 +328,7 @@ if ($resql) { if (!empty($conf->categorie->enabled)) { $moreforfilter .= '
'; $moreforfilter .= img_picto($langs->trans('Categories'), 'category', 'class="pictofixedwidth"'); - $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ'); + $moreforfilter .= $htmlother->select_categories(Categorie::TYPE_PRODUCT, $search_categ, 'search_categ', 1); $moreforfilter .= '
'; } //$moreforfilter.=$langs->trans("StockTooLow").' '; @@ -342,14 +361,17 @@ if ($resql) { } print ''; print ''; - print ' '; - print ' '; if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { print ' '; } if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { print ' '; } + // Physical stock + print ''; + print ''; + print ''; + print ' '; print ' '; print ' '; print ''; @@ -360,21 +382,21 @@ if ($resql) { //Line for column titles print ""; - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", $param, "", "", $sortfield, $sortorder); - print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", $param, "", "", $sortfield, $sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref", '', $param, "", $sortfield, $sortorder); + print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label", '', $param, "", $sortfield, $sortorder); if (!empty($conf->service->enabled) && $type == 1) { - print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration", '', $param, "", $sortfield, $sortorder, 'center '); } - print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref", $param, "", '', $sortfield, $sortorder); + print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref", '', $param, "", $sortfield, $sortorder); //print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'',$sortfield,$sortorder, 'right ); - print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch", '', $param, "", $sortfield, $sortorder, 'center '); if (empty($conf->global->PRODUCT_DISABLE_SELLBY)) { - print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pb.sellby", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("SellByDate", $_SERVER["PHP_SELF"], "pb.sellby", '', $param, "", $sortfield, $sortorder, 'center '); } if (empty($conf->global->PRODUCT_DISABLE_EATBY)) { - print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", $param, "", '', $sortfield, $sortorder, 'center '); + print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby", '', $param, "", $sortfield, $sortorder, 'center '); } - print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", $param, "", '', $sortfield, $sortorder, 'right '); + print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stock_physique", '', $param, "", $sortfield, $sortorder, 'right '); // TODO Add info of running suppliers/customers orders //print_liste_field_titre("TheoreticalStock",$_SERVER["PHP_SELF"], "stock_theorique",$param,"",'',$sortfield,$sortorder, 'right '); print_liste_field_titre(''); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 405528a3480..73c6751262a 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -139,6 +139,9 @@ $arrayfields = array( //'m.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500), //'m.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500) ); + +include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; + if (!empty($conf->global->PRODUCT_DISABLE_SELLBY)) { unset($arrayfields['pl.sellby']); } @@ -381,7 +384,9 @@ if ($action == "correct_stock") { $batch, GETPOST('inventorycode', 'alphanohtml'), $origin_element, - $origin_id + $origin_id, + 0, + $extrafields ); // We do not change value of stock for a correction } else { $result = $product->correct_stock( @@ -393,7 +398,9 @@ if ($action == "correct_stock") { price2num(GETPOST('unitprice'), 'MT'), GETPOST('inventorycode', 'alphanohtml'), $origin_element, - $origin_id + $origin_id, + 0, + $extrafields ); // We do not change value of stock for a correction } @@ -500,7 +507,11 @@ if ($action == "transfert_stock" && !$cancel) { $eatby, $sellby, $batch, - GETPOST('inventorycode') + GETPOST('inventorycode'), + '', + null, + 0, + $extrafields ); // Add stock $result2 = $product->correct_stock_batch( @@ -513,7 +524,11 @@ if ($action == "transfert_stock" && !$cancel) { $eatby, $sellby, $batch, - GETPOST('inventorycode', 'alphanohtml') + GETPOST('inventorycode', 'alphanohtml'), + '', + null, + 0, + $extrafields ); } } else { @@ -525,7 +540,11 @@ if ($action == "transfert_stock" && !$cancel) { 1, GETPOST("label", 'san_alpha'), $pricesrc, - GETPOST('inventorycode', 'alphanohtml') + GETPOST('inventorycode', 'alphanohtml'), + '', + null, + 0, + $extrafields ); // Add stock @@ -536,7 +555,11 @@ if ($action == "transfert_stock" && !$cancel) { 0, GETPOST("label", 'san_alpha'), $pricedest, - GETPOST('inventorycode', 'alphanohtml') + GETPOST('inventorycode', 'alphanohtml'), + '', + null, + 0, + $extrafields ); } if (!$error && $result1 >= 0 && $result2 >= 0) { @@ -1434,6 +1457,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { } // Extra fields + $object = $movement; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); diff --git a/htdocs/product/stock/tpl/extrafields_add.tpl.php b/htdocs/product/stock/tpl/extrafields_add.tpl.php new file mode 100644 index 00000000000..62921f0a6e0 --- /dev/null +++ b/htdocs/product/stock/tpl/extrafields_add.tpl.php @@ -0,0 +1,51 @@ + + * Copyright (C) 2014 Juanjo Menent + * + * 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 + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Need to have following variables defined: + * $object (invoice, order, ...) + * $action + * $conf + * $langs + * + * $parameters + * $cols + */ + +// Protection to avoid direct call of template +if (empty($conf) || !is_object($conf)) { + print "Error, template page can't be called as URL"; + exit; +} + +?> + +executeHooks('formObjectOptions', $parameters, $movement, $action); // Note that $action and $object may have been modified by hook +print $hookmanager->resPrint; +if (empty($reshook)) { + $params = array(); + if (isset($tpl_context)) $params['tpl_context'] = $tpl_context; + $params['cols'] = $parameters['colspanvalue']; + print $movement->showOptionals($extrafields, 'create', $params); +} + +?> + diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php index 00699b95e18..eb84df7d14e 100644 --- a/htdocs/product/stock/tpl/stockcorrection.tpl.php +++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php @@ -179,6 +179,9 @@ print '\n"; exec('cat /test.txt; ls /dev/std*; sleep 1;', $out, $ret); print $ret."
\n"; print_r($out); +print '
'; print '

'."\n"; + print "*** TRY TO RUN CLAMDSCAN
\n"; $ret = 0; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index e9dc03d7571..2d7c46e0c85 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -1048,9 +1048,17 @@ if ($action == 'create') { print "\n"; } + // $objectsrc->lines contains the line of the purchase order + // $dispatchLines is list of lines with dispatching detail (with product, qty and warehouse). One purchase order line may have n of this dispatch lines. + + $arrayofpurchaselinealreadyoutput= array(); + + // $_POST contains fk_commandefourndet_X_Y where Y is num of product line and X is number of splitted line $indiceAsked = 1; - while ($indiceAsked <= $numAsked) { + while ($indiceAsked <= $numAsked) { // Loop on $dispatchLines. Warning: $dispatchLines must be sorted by fk_commandefourndet (it is a regroupment key on output) $product = new Product($db); + + // We search the purchase order line that is linked to the dispatchLines foreach ($objectsrc->lines as $supplierLine) { if ($dispatchLines[$indiceAsked]['fk_commandefourndet'] == $supplierLine->id) { $line = $supplierLine; @@ -1072,7 +1080,6 @@ if ($action == 'create') { print ''."\n"; print ''."\n"; - // Product label if ($line->fk_product > 0) { // If predefined product $product->fetch($line->fk_product); @@ -1081,42 +1088,45 @@ if ($action == 'create') { print ''; print ''; // ancre pour retourner sur la ligne - print ''; + if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice + print ''; - // Show product and description - $product_static = $product; + // Show product and description + $product_static = $product; - $text = $product_static->getNomUrl(1); - $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); - $description = ($conf->global->PRODUIT_DESC_IN_FORM ? '' : dol_htmlentitiesbr($line->desc)); - print $form->textwithtooltip($text, $description, 3, '', '', $i); + $text = $product_static->getNomUrl(1); + $text .= ' - '.(!empty($line->label) ? $line->label : $line->product_label); + $description = ($conf->global->PRODUIT_DESC_IN_FORM ? '' : dol_htmlentitiesbr($line->desc)); + print $form->textwithtooltip($text, $description, 3, '', '', $i); - // Show range - print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); + // Show range + print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); - // Add description in form - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { - print ($line->desc && $line->desc != $line->product_label) ? '
'.dol_htmlentitiesbr($line->desc) : ''; + // Add description in form + if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + print ($line->desc && $line->desc != $line->product_label) ? '
'.dol_htmlentitiesbr($line->desc) : ''; + } } - print ''; } else { print ""; - if ($type == 1) { - $text = img_object($langs->trans('Service'), 'service'); - } else { - $text = img_object($langs->trans('Product'), 'product'); - } + if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice + if ($type == 1) { + $text = img_object($langs->trans('Service'), 'service'); + } else { + $text = img_object($langs->trans('Product'), 'product'); + } - if (!empty($line->label)) { - $text .= ' '.$line->label.''; - print $form->textwithtooltip($text, $line->desc, 3, '', '', $i); - } else { - print $text.' '.nl2br($line->desc); - } + if (!empty($line->label)) { + $text .= ' '.$line->label.''; + print $form->textwithtooltip($text, $line->desc, 3, '', '', $i); + } else { + print $text.' '.nl2br($line->desc); + } - // Show range - print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); + // Show range + print_date_range($db->jdate($line->date_start), $db->jdate($line->date_end)); + } print "\n"; } @@ -1127,8 +1137,11 @@ if ($action == 'create') { print ''; print ''; - // Qty - print ''.$line->qty; + // Qty in source purchase order line + print ''; + if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice + print $line->qty; + } print ''; print ''; print ''; @@ -1138,7 +1151,9 @@ if ($action == 'create') { // Qty already received print ''; $quantityDelivered = $objectsrc->receptions[$line->id]; - print $quantityDelivered; + if (! array_key_exists($line->id, $arrayofpurchaselinealreadyoutput)) { // Add test to avoid to show qty twice + print $quantityDelivered; + } print ''; print ''; @@ -1214,6 +1229,9 @@ if ($action == 'create') { } } } + + $arrayofpurchaselinealreadyoutput[$line->id] = $line->id; + print "\n"; $extralabelslines = $extrafields->attributes[$line->table_element]; @@ -1775,7 +1793,9 @@ if ($action == 'create') { //var_dump($alreadysent); } - // Loop on each product to send/sent + $arrayofpurchaselinealreadyoutput = array(); + + // Loop on each product to send/sent. Warning: $lines must be sorted by ->fk_commandefourndet (it is a regroupment key on output) for ($i = 0; $i < $num_prod; $i++) { print ''; // id of order line print ''; @@ -1797,32 +1817,35 @@ if ($action == 'create') { } print ''; - - $text = $lines[$i]->product->getNomUrl(1); - $text .= ' - '.$label; - $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($lines[$i]->product->description)); - print $form->textwithtooltip($text, $description, 3, '', '', $i); - print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : 0, !empty($lines[$i]->date_end) ? $lines[$i]->date_end : 0); - if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { - print (!empty($lines[$i]->product->description) && $lines[$i]->description != $lines[$i]->product->description) ? '
'.dol_htmlentitiesbr($lines[$i]->description) : ''; + if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) { + $text = $lines[$i]->product->getNomUrl(1); + $text .= ' - '.$label; + $description = (!empty($conf->global->PRODUIT_DESC_IN_FORM) ? '' : dol_htmlentitiesbr($lines[$i]->product->description)); + print $form->textwithtooltip($text, $description, 3, '', '', $i); + print_date_range(!empty($lines[$i]->date_start) ? $lines[$i]->date_start : 0, !empty($lines[$i]->date_end) ? $lines[$i]->date_end : 0); + if (!empty($conf->global->PRODUIT_DESC_IN_FORM)) { + print (!empty($lines[$i]->product->description) && $lines[$i]->description != $lines[$i]->product->description) ? '
'.dol_htmlentitiesbr($lines[$i]->description) : ''; + } } print "\n"; } else { print ""; - if ($lines[$i]->product_type == Product::TYPE_SERVICE) { - $text = img_object($langs->trans('Service'), 'service'); - } else { - $text = img_object($langs->trans('Product'), 'product'); - } + if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) { + if ($lines[$i]->product_type == Product::TYPE_SERVICE) { + $text = img_object($langs->trans('Service'), 'service'); + } else { + $text = img_object($langs->trans('Product'), 'product'); + } - if (!empty($lines[$i]->label)) { - $text .= ' '.$lines[$i]->label.''; - print $form->textwithtooltip($text, $lines[$i]->description, 3, '', '', $i); - } else { - print $text.' '.nl2br($lines[$i]->description); - } + if (!empty($lines[$i]->label)) { + $text .= ' '.$lines[$i]->label.''; + print $form->textwithtooltip($text, $lines[$i]->description, 3, '', '', $i); + } else { + print $text.' '.nl2br($lines[$i]->description); + } - print_date_range($lines[$i]->date_start, $lines[$i]->date_end); + print_date_range($lines[$i]->date_start, $lines[$i]->date_end); + } print "\n"; } @@ -1834,33 +1857,39 @@ if ($action == 'create') { // Qty ordered - print ''.$lines[$i]->qty_asked.''; + print ''; + if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) { + print $lines[$i]->qty_asked; + } + print ''; // Qty in other receptions (with reception and warehouse used) if ($origin && $origin_id > 0) { print ''; - foreach ($alreadysent as $key => $val) { - if ($lines[$i]->fk_commandefourndet == $key) { - $j = 0; - foreach ($val as $receptionline_id => $receptionline_var) { - if ($receptionline_var['reception_id'] == $lines[$i]->fk_reception) { - continue; // We want to show only "other receptions" - } + if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) { + foreach ($alreadysent as $key => $val) { + if ($lines[$i]->fk_commandefourndet == $key) { + $j = 0; + foreach ($val as $receptionline_id => $receptionline_var) { + if ($receptionline_var['reception_id'] == $lines[$i]->fk_reception) { + continue; // We want to show only "other receptions" + } - $j++; - if ($j > 1) { - print '
'; - } - $reception_static->fetch($receptionline_var['reception_id']); - print $reception_static->getNomUrl(1); - print ' - '.$receptionline_var['qty']; + $j++; + if ($j > 1) { + print '
'; + } + $reception_static->fetch($receptionline_var['reception_id']); + print $reception_static->getNomUrl(1); + print ' - '.$receptionline_var['qty']; - $htmltext = $langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($receptionline_var['date_valid'], 'dayhour')); - if (!empty($conf->stock->enabled) && $receptionline_var['warehouse'] > 0) { - $warehousestatic->fetch($receptionline_var['warehouse']); - $htmltext .= '
'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1, '', 0, 1); + $htmltext = $langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($receptionline_var['date_valid'], 'dayhour')); + if (!empty($conf->stock->enabled) && $receptionline_var['warehouse'] > 0) { + $warehousestatic->fetch($receptionline_var['warehouse']); + $htmltext .= '
'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1, '', 0, 1); + } + print ' '.$form->textwithpicto('', $htmltext, 1); } - print ' '.$form->textwithpicto('', $htmltext, 1); } } } @@ -1990,6 +2019,8 @@ if ($action == 'create') { } print ""; + $arrayofpurchaselinealreadyoutput[$lines[$i]->fk_commandefourndet] = $lines[$i]->fk_commandefourndet; + // Display lines extrafields $extralabelslines = $extrafields->attributes[$lines[$i]->table_element]; if (!empty($extralabelslines) && is_array($extralabelslines) && count($extralabelslines) > 0) { diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php index 7e58c75d35f..d0ca6416390 100644 --- a/htdocs/resource/element_resource.php +++ b/htdocs/resource/element_resource.php @@ -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 ''.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent, 3).''; + print ''.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent ? 1 : 0, 3).''; // Date start print ''.$langs->trans("DateActionStart").''; - 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 ''.$langs->trans("DateActionEnd").''; - if (!$act->fulldayevent) { + if (empty($act->fulldayevent)) { print dol_print_date($act->datef, 'dayhour', 'tzuser'); } else { print dol_print_date($act->datef, 'day', 'tzuser'); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b6c483fc026..43e9bb30314 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2542,7 +2542,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''; print ''.$idprof.''; $key = 'idprof'.$i; - print showValueWithClipboardCPButton(dol_escape_htmltag($object->$key)); + print dol_print_profids($object->$key, 'ProfId'.$i, $object->country_code, 1); if ($object->$key) { if ($object->id_prof_check($i, $object) > 0) { print '   '.$object->id_prof_url($i, $object); @@ -2655,7 +2655,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print ''.$langs->trans('VATIntra').''; if ($object->tva_intra) { $s = ''; - $s .= showValueWithClipboardCPButton(dol_escape_htmltag($object->tva_intra)); + $s .= dol_print_profids($object->tva_intra, 'VATIntra', $object->country_code, 1); $s .= ''; if (empty($conf->global->MAIN_DISABLEVATCHECK) && isInEEC($object)) { diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index 596f9b6f3c6..3624f80187d 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -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 ''; print ''; print ''; - print ''; // date + print ''; // 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 ''; print ''; print ''; @@ -463,7 +463,7 @@ if ($sql_select) { // Titles with sort buttons print ''; 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 ''; print ''.$total_qty.''; print ''.price($total_ht).''; - print ''.price($total_ht / (empty($total_qty) ? 1 : $total_qty)).''; + print ''.price(price2num($total_ht / (empty($total_qty) ? 1 : $total_qty), 'MU')).''; print ""; print ''; diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index ea10b4d7137..057b32e89ca 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -725,6 +725,9 @@ class SupplierProposal extends CommonObject $total_ttc = $tabprice[2]; $total_localtax1 = $tabprice[9]; $total_localtax2 = $tabprice[10]; + $pu_ht = $tabprice[3]; + $pu_tva = $tabprice[4]; + $pu_ttc = $tabprice[5]; // MultiCurrency $multicurrency_total_ht = $tabprice[16]; @@ -732,6 +735,11 @@ class SupplierProposal extends CommonObject $multicurrency_total_ttc = $tabprice[18]; $pu_ht_devise = $tabprice[19]; + $pu = $pu_ht; + 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); diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 02d25d30797..f1d4f62587f 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -290,7 +290,7 @@ if ($action == 'valid' && $user->rights->facture->creer) { $payment->datepaye = $now; $payment->fk_account = $bankaccount; $payment->amounts[$invoice->id] = $amountofpayment; - if ($pay == 'cash') { + if ($pay == 'LIQ') { $payment->pos_change = price2num(GETPOST('excess', 'alpha')); } diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index a26fe1aa2fa..fde749b7520 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -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; @@ -255,6 +257,12 @@ input:invalid, select:invalid, input.--error , select.--error { border-color: #ea1212; } +section.setupsection { + padding: 20px; + background-color: var(--colorbacktitle1); + border-radius: 5px; +} + .field-error-icon { color: #ea1212; !important; } /* Focus definitions must be after standard definition */ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 7394cbe697f..78745c70531 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -474,6 +474,18 @@ input.short { width: 40px; } +input:invalid, select:invalid, input.--error , select.--error { + border-color: #ea1212; +} + +section.setupsection { + padding: 20px; + background-color: var(--colorbacktitle1); + border-radius: 5px; +} + +.field-error-icon { color: #ea1212; !important; } + textarea { border-radius: 0; border-top:solid 1px var(--inputbordercolor); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 690bcb5cad2..f1d33f4eeb0 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -1479,31 +1479,6 @@ if ($action == 'create' || $action == 'presend') { $morehtmlright = ''; $help = ""; $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, $arrayoffamiliestoexclude, $object); - if ($object->fk_soc > 0) { - $substitutionarray['__THIRDPARTY_NAME__'] = $object->thirdparty->name; - } - $substitutionarray['__USER_SIGNATURE__'] = $user->signature; - $substitutionarray['__TICKET_TRACKID__'] = $object->track_id; - $substitutionarray['__TICKET_REF__'] = $object->ref; - $substitutionarray['__TICKET_SUBJECT__'] = $object->subject; - $substitutionarray['__TICKET_TYPE__'] = $object->type_code; - $substitutionarray['__TICKET_SEVERITY__'] = $object->severity_code; - $substitutionarray['__TICKET_CATEGORY__'] = $object->category_code; // For backward compatibility - $substitutionarray['__TICKET_ANALYTIC_CODE__'] = $object->category_code; - $substitutionarray['__TICKET_MESSAGE__'] = $object->message; - $substitutionarray['__TICKET_PROGRESSION__'] = $object->progress; - if ($object->fk_user_assign > 0) { - $userstat->fetch($object->fk_user_assign); - $substitutionarray['__TICKET_USER_ASSIGN__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); - } - - if ($object->fk_user_create > 0) { - $userstat->fetch($object->fk_user_create); - $substitutionarray['__TICKET_USER_CREATE__'] = dolGetFirstLastname($userstat->firstname, $userstat->lastname); - } - foreach ($substitutionarray as $key => $val) { - $help .= $key.' -> '.$langs->trans($val).'
'; - } $morehtmlright .= $form->textwithpicto(''.$langs->trans("TicketMessageSubstitutionReplacedByGenericValues").'', $help, 1, 'helpclickable', '', 0, 3, 'helpsubstitution'); print '
'; diff --git a/htdocs/user/vcard.php b/htdocs/user/vcard.php index 57778c44259..0f9085d0b52 100644 --- a/htdocs/user/vcard.php +++ b/htdocs/user/vcard.php @@ -1,8 +1,9 @@ - * Copyright (C) 2004-2010 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin +/* Copyright (C) 2004 Rodolphe Quiedeville + * Copyright (C) 2004-2010 Laurent Destailleur + * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2020 Tobias Sekan + * Copyright (C) 2021-2022 Anthony Berton * * 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); } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index af2f3a96ae1..dab79faee3b 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -2787,7 +2787,7 @@ if (!GETPOST('hide_websitemenu')) { print ''; } if ($action != 'preview') { - print ''; + print ''; } } @@ -3123,7 +3123,7 @@ if (!GETPOST('hide_websitemenu')) { print ''; } if ($action != 'preview') { - print ''; + print ''; } } @@ -3545,8 +3545,8 @@ if ($action == 'createsite') { if ($action == 'createsite') { print '
'; - print ''; - print ''; + print ''; + print ''; print '
'; } @@ -3574,8 +3574,8 @@ if ($action == 'importsite') { print ''; print ''; - print ''; - print ''; + print ''; + print ''; print '


'; @@ -3630,29 +3630,6 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties if ($action == 'createcontainer') { print '
'; - if (!empty($conf->use_javascript_ajax)) { - print ' '; - } - print '
'; - print '
'; - print ''; - print ''; - print '
'; - print $langs->trans("URL"); - print ''; - print info_admin($langs->trans("OnlyEditionOfSourceForGrabbedContentFuture"), 0, 0, 'warning'); - print ' '; - print '
'.$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 '
'; - print ''; - print '
'; - - print '
'; - if (!empty($conf->use_javascript_ajax)) { print ' '; } @@ -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 ''; @@ -3907,7 +3884,7 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties } print ''.$form->editfieldkey('Categories', 'categories', '', $objectpage, 0).''; - 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 ""; } @@ -3983,16 +3960,42 @@ if ($action == 'editmeta' || $action == 'createcontainer') { // Edit properties if ($action == 'createcontainer') { print '
'; - print ''; - print ''; + print ''; + print ''; print '
'; + + + print '
'; + + if (!empty($conf->use_javascript_ajax)) { + print ' '; + } + print '
'; + print '
'; + print ''; + print ''; + print '
'; + print $langs->trans("URL"); + print ''; + print info_admin($langs->trans("OnlyEditionOfSourceForGrabbedContentFuture"), 0, 0, 'warning'); + print ' '; + print '
'.$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 '
'; + print ''; + print '
'; } if ($action == 'createcontainer') { print '