mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch 'develop' into qual/phan.2025.1.19-a
This commit is contained in:
commit
923649b1ec
|
|
@ -34,12 +34,12 @@ There is a lot of different solutions to install Dolibarr.
|
|||
|
||||
### Using packages
|
||||
|
||||
If you have low technical skills and you're looking to install Dolibarr ERP/CRM with just a few clicks, you can use one of the packaged versions:
|
||||
If you have low technical skills and you're looking to install Dolibarr ERP/CRM with just few clicks, you can use one of the packaged versions (see next chapter if you have IT knowledge) :
|
||||
|
||||
- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp))
|
||||
- [DoliDeb for Debian](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian)
|
||||
- [DoliDeb for Debian, Ubuntu](https://wiki.dolibarr.org/index.php/Dolibarr_for_Ubuntu_or_Debian)
|
||||
- DoliRpm for Red Hat, Fedora, OpenSuse, Mandriva or Mageia
|
||||
- The Docker image (see next chapter)
|
||||
- The Docker image (see chapter "Using Docker")
|
||||
|
||||
Releases can be downloaded from [official website](https://www.dolibarr.org/).
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
----- Dolibarr Makepack How To -----
|
||||
This documentation describe steps to build a BETA or RELEASE versions
|
||||
of Dolibarr. There is a chapter for BETA version and a chapter for RELEASE version.
|
||||
This documentation describe steps to build a BETA or RELEASE versions of Dolibarr.
|
||||
There is a chapter for BETA version and a chapter for RELEASE version.
|
||||
|
||||
|
||||
***** Prerequisites For Linux *****
|
||||
***** Prerequisites on Linux *****
|
||||
|
||||
Prerequisites to build tgz, debian and rpm packages:
|
||||
Prerequisites to build the tgz, debian and rpm packages:
|
||||
> apt-get install perl tar dpkg dpatch p7zip-full rpm zip php-cli
|
||||
|
||||
Prerequisites to build autoexe DoliWamp package from Linux (solution seems broken since Ubuntu 20.04):
|
||||
Prerequisites to build autoexe DoliWamp package from Linux (solution seems broken since Ubuntu 20.04+):
|
||||
> apt-get install wine q4wine
|
||||
> Launch "wine cmd" to check a drive Z: pointing to / exists.
|
||||
> Install InnoSetup
|
||||
|
|
@ -23,7 +23,7 @@ Prerequisites to build autoexe DoliWamp package from Linux (solution seems broke
|
|||
The .exe file will be build into directory build.
|
||||
|
||||
|
||||
***** Prerequisites For Windows *****
|
||||
***** Prerequisites on Windows *****
|
||||
|
||||
Prerequisites to build autoexe DoliWamp package from Windows:
|
||||
|
||||
|
|
@ -49,9 +49,9 @@ This files describe steps made by Dolibarr packaging team to make a beta version
|
|||
|
||||
- Check all files are committed.
|
||||
- Update version/info in ChangeLog, for this you can:
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch x.y repo), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/changelogtocopy"
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch x.y repo), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/changelogtocopy"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/changelogtocopy"
|
||||
Recopy the content of the output file into the file ChangeLog.
|
||||
- Note: To know number of lines changes: git diff --shortstat A B
|
||||
- Update version number with x.y.z-w in file htdocs/filefunc.inc.php
|
||||
|
|
@ -67,15 +67,15 @@ Recopy the content of the output file into the file ChangeLog.
|
|||
***** Actions to do a RELEASE *****
|
||||
|
||||
This files describe steps made by Dolibarr packaging team to make a complete release of Dolibarr, step by step.
|
||||
We suppose the branch x.y has already been created during the beta (see previous step).
|
||||
We suppose the branch x.y has already been created during the beta (see previous step) and we want to release a version x.y.z (with z >= 0)
|
||||
|
||||
- Check all files are committed.
|
||||
- Update version/info in ChangeLog, for this you can:
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a major new version x.y.0 (from a repo pn branch x.y), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/aaa"
|
||||
- Update version/info in ChangeLog, for this:
|
||||
To generate a changelog of a major new version x.y.0 (from a repo on branch develop), you can do "cd ~/git/dolibarr; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent develop) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/changelogtocopy"
|
||||
To generate a changelog of a major new version x.y.0 (from a repo pn branch x.y), you can do "cd ~/git/dolibarr_x.y; git log `diff -u <(git rev-list --first-parent x.(y-1).0) <(git rev-list --first-parent x.y.0) | sed -ne 's/^ //p' | head -1`.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/changelogtocopy"
|
||||
To generate a changelog of a maintenance version x.y.z, you can do "cd ~/git/dolibarr_x.y; git log x.y.z-1.. --no-merges --pretty=short --oneline | sed -e "s/^[0-9a-z]* //" | grep -e '^FIX\|NEW' | sort -u | sed 's/FIXED:/FIX:/g' | sed 's/FIXED :/FIX:/g' | sed 's/FIX :/FIX:/g' | sed 's/FIX /FIX: /g' | sed 's/NEW :/NEW:/g' | sed 's/NEW /NEW: /g' > /tmp/changelogtocopy"
|
||||
Recopy the content of the output file into the file ChangeLog.
|
||||
- Note: To know the number of lines changes: git diff --shortstat A B
|
||||
- Note: To know the number of lines changes: git diff --shortstat vA vB
|
||||
- Update version number with x.y.z in file htdocs/filefunc.inc.php
|
||||
- Commit all changes.
|
||||
|
||||
|
|
@ -84,6 +84,6 @@ Recopy the content of the output file into the file ChangeLog.
|
|||
- Check content of built packages.
|
||||
|
||||
- Run makepack-dolibarr.pl again with option to publish files on dolibarr foundation server (Dir /home/dolibarr/wwwroot/files/stable on www.dolibarr.org).
|
||||
- Run makepack-dolibarr.pl again with option to publish files on sourceforge. This will also add official tag.
|
||||
- Run makepack-dolibarr.pl again with option to publish files on sourceforge. This will also add the official tag x.y.z.
|
||||
|
||||
- Post a news on dolibarr.org/dolibarr.fr + social networks
|
||||
- Post a news in english dolibarr.org/dolibarr.fr web site by cloning a past news (the news will be propagated on social networks)
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ class AccountancyCategory // extends CommonObject
|
|||
{
|
||||
global $conf;
|
||||
$sql = "SELECT t.rowid, t.account_number, t.label";
|
||||
$sql .= " FROM ".$this->db->prefix().$this->table_element." as t";
|
||||
$sql .= " FROM ".$this->db->prefix()."accounting_account as t";
|
||||
$sql .= " WHERE t.fk_accounting_category = ".((int) $id);
|
||||
$sql .= " AND t.entity = ".$conf->entity;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* Copyright (C) 2011-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
|
||||
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2019-2024 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2019-2025 Frédéric France <frederic.france@free.fr>
|
||||
* Copyright (C) 2020-2022 Open-Dsi <support@open-dsi.fr>
|
||||
* Copyright (C) 2024 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
|
|
@ -716,6 +716,7 @@ if ($id == DICT_TYPE_CONTACT) {
|
|||
'project_task' => img_picto('', 'projecttask', 'class="pictofixedwidth"').$langs->trans('Task'),
|
||||
'propal' => img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans('Proposal'),
|
||||
'commande' => img_picto('', 'order', 'class="pictofixedwidth"').$langs->trans('Order'),
|
||||
'shipping' => img_picto('', 'dolly', 'class="pictofixedwidth"') . $langs->trans('Shipment'),
|
||||
'facture' => img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans('Bill'),
|
||||
'fichinter' => img_picto('', 'intervention', 'class="pictofixedwidth"').$langs->trans('InterventionCard'),
|
||||
'contrat' => img_picto('', 'contract', 'class="pictofixedwidth"').$langs->trans('Contract'),
|
||||
|
|
|
|||
|
|
@ -815,7 +815,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed = $user->hasRight('bom', 'read'); // If you can read, you can build the PDF to read content
|
||||
$delallowed = $user->hasRight('bom', 'write'); // If you can create/edit, you can remove a file on card
|
||||
print $formfile->showdocuments('bom', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
|
||||
print $formfile->showdocuments('bom', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang, '', $object);
|
||||
|
||||
// Show links to link elements
|
||||
$tmparray = $form->showLinkToObjectBlock($object, array(), array('bom'), 1);
|
||||
|
|
|
|||
|
|
@ -457,20 +457,19 @@ $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
|||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object)";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON a.fk_contact = sp.rowid";
|
||||
$sql .= " ,".MAIN_DB_PREFIX."c_actioncomm as c";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."c_actioncomm as c ON c.id = a.fk_action";
|
||||
// We must filter on resource table
|
||||
if ($resourceid > 0) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."element_resources as r";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_resources as r ON r.element_type = 'action' AND r.element_id = a.id";
|
||||
}
|
||||
// We must filter on assignment table
|
||||
if ($filtert > 0 || $usergroup > 0) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar ON ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
}
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
|
||||
}
|
||||
$sql .= " WHERE c.id = a.fk_action";
|
||||
$sql .= ' AND a.entity IN ('.getEntity('agenda').')';
|
||||
$sql .= " WHERE a.entity IN (".getEntity('agenda').")";
|
||||
// Condition on actioncode
|
||||
if (!empty($actioncode)) {
|
||||
if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
|
||||
|
|
@ -501,7 +500,7 @@ if (!empty($actioncode)) {
|
|||
}
|
||||
}
|
||||
if ($resourceid > 0) {
|
||||
$sql .= " AND r.element_type = 'action' AND r.element_id = a.id AND r.resource_id = ".((int) $resourceid);
|
||||
$sql .= " AND r.resource_id = ".((int) $resourceid);
|
||||
}
|
||||
if ($pid) {
|
||||
$sql .= " AND a.fk_project=".((int) $pid);
|
||||
|
|
@ -520,13 +519,9 @@ if ($search_sale && $search_sale != '-1') {
|
|||
}
|
||||
}
|
||||
// Search on socid
|
||||
if ($socid) {
|
||||
if ($socid > 0) {
|
||||
$sql .= " AND a.fk_soc = ".((int) $socid);
|
||||
}
|
||||
// We must filter on assignment table
|
||||
if ($filtert > 0 || $usergroup > 0) {
|
||||
$sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
}
|
||||
if ($type) {
|
||||
$sql .= " AND c.id = ".((int) $type);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -634,7 +634,7 @@ class Propal extends CommonObject
|
|||
*/
|
||||
public function addline($desc, $pu_ht, $qty, $txtva, $txlocaltax1 = 0.0, $txlocaltax2 = 0.0, $fk_product = 0, $remise_percent = 0.0, $price_base_type = 'HT', $pu_ttc = 0.0, $info_bits = 0, $type = 0, $rang = -1, $special_code = 0, $fk_parent_line = 0, $fk_fournprice = 0, $pa_ht = 0, $label = '', $date_start = '', $date_end = '', $array_options = array(), $fk_unit = null, $origin = '', $origin_id = 0, $pu_ht_devise = 0, $fk_remise_except = 0, $noupdateafterinsertline = 0)
|
||||
{
|
||||
global $mysoc, $conf, $langs;
|
||||
global $mysoc, $langs;
|
||||
|
||||
dol_syslog(get_class($this)."::addline propalid=$this->id, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_except=$remise_percent, price_base_type=$price_base_type, pu_ttc=$pu_ttc, info_bits=$info_bits, type=$type, fk_remise_except=".$fk_remise_except);
|
||||
|
||||
|
|
@ -659,7 +659,7 @@ class Propal extends CommonObject
|
|||
}
|
||||
|
||||
$remise_percent = price2num($remise_percent);
|
||||
$qty = (float) price2num($qty);
|
||||
$qty = (float) price2num($qty, 'MS');
|
||||
$pu_ht = price2num($pu_ht);
|
||||
$pu_ht_devise = price2num($pu_ht_devise);
|
||||
$pu_ttc = price2num($pu_ttc);
|
||||
|
|
@ -710,14 +710,14 @@ class Propal extends CommonObject
|
|||
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
||||
|
||||
if (getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$product = new Product($this->db);
|
||||
$result = $product->fetch($fk_product);
|
||||
if ($qty < $product->packaging) {
|
||||
$qty = $product->packaging;
|
||||
$tmpproduct = new Product($this->db);
|
||||
$result = $tmpproduct->fetch($fk_product);
|
||||
if (abs($qty) < $tmpproduct->packaging) {
|
||||
$qty = (float) $tmpproduct->packaging;
|
||||
} else {
|
||||
if (!empty($product->packaging) && (fmod((float) $qty, (float) $product->packaging) > 0.000001)) {
|
||||
$coeff = intval((float) $qty / $product->packaging) + 1;
|
||||
$qty = (float) $product->packaging * $coeff;
|
||||
if (!empty($tmpproduct->packaging) && $qty > $tmpproduct->packaging) {
|
||||
$coeff = intval(abs($qty) / $tmpproduct->packaging) + 1;
|
||||
$qty = price2num((float) $tmpproduct->packaging * $coeff, 'MS');
|
||||
setEventMessages($langs->trans('QtyRecalculatedWithPackaging'), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -373,10 +373,8 @@ class PropaleLigne extends CommonObjectLine
|
|||
$sql .= ' pd.localtax1_tx, pd.localtax2_tx, pd.total_localtax1, pd.total_localtax2,';
|
||||
$sql .= ' pd.fk_multicurrency, pd.multicurrency_code, pd.multicurrency_subprice, pd.multicurrency_total_ht, pd.multicurrency_total_tva, pd.multicurrency_total_ttc,';
|
||||
$sql .= ' p.ref as product_ref, p.label as product_label, p.description as product_desc,';
|
||||
$sql .= ' p.packaging,';
|
||||
$sql .= ' pd.date_start, pd.date_end, pd.product_type';
|
||||
if (getDolGlobalInt('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$sql .= ', p.packaging';
|
||||
}
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'propaldet as pd';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON pd.fk_product = p.rowid';
|
||||
$sql .= ' WHERE pd.rowid = '.((int) $rowid);
|
||||
|
|
@ -425,9 +423,7 @@ class PropaleLigne extends CommonObjectLine
|
|||
$this->product_desc = $objp->product_desc;
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
|
||||
if (getDolGlobalInt('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$this->packaging = $objp->packaging;
|
||||
}
|
||||
$this->packaging = $objp->packaging;
|
||||
|
||||
$this->date_start = $this->db->jdate($objp->date_start);
|
||||
$this->date_end = $this->db->jdate($objp->date_end);
|
||||
|
|
|
|||
|
|
@ -1635,14 +1635,14 @@ class Commande extends CommonOrder
|
|||
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
||||
|
||||
if (getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$product = new Product($this->db);
|
||||
$result = $product->fetch($fk_product);
|
||||
if ($qty < (float) $product->packaging) {
|
||||
$qty = $product->packaging;
|
||||
$tmpproduct = new Product($this->db);
|
||||
$result = $tmpproduct->fetch($fk_product);
|
||||
if (abs($qty) < $tmpproduct->packaging) {
|
||||
$qty = (float) $tmpproduct->packaging;
|
||||
} else {
|
||||
if (!empty($product->packaging) && (fmod((float) $qty, (float) $product->packaging) > 0.000001)) {
|
||||
$coeff = intval((float) $qty / $product->packaging) + 1;
|
||||
$qty = (float) $product->packaging * $coeff;
|
||||
if (!empty($tmpproduct->packaging) && $qty > $tmpproduct->packaging) {
|
||||
$coeff = intval(abs($qty) / $tmpproduct->packaging) + 1;
|
||||
$qty = price2num((float) $tmpproduct->packaging * $coeff, 'MS');
|
||||
setEventMessages($langs->trans('QtyRecalculatedWithPackaging'), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
|
@ -2130,7 +2130,7 @@ class Commande extends CommonOrder
|
|||
$sql .= ' l.fk_unit,';
|
||||
$sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc,';
|
||||
$sql .= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label as product_label, p.tosell as product_tosell, p.tobuy as product_tobuy, p.tobatch as product_tobatch, p.barcode as product_barcode,';
|
||||
$sql .= ' p.weight, p.weight_units, p.volume, p.volume_units';
|
||||
$sql .= ' p.weight, p.weight_units, p.volume, p.volume_units, p.packaging';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element_line.' as l';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
|
||||
$sql .= ' WHERE l.fk_commande = '.((int) $this->id);
|
||||
|
|
@ -2205,10 +2205,7 @@ class Commande extends CommonOrder
|
|||
$line->weight_units = $objp->weight_units;
|
||||
$line->volume = $objp->volume;
|
||||
$line->volume_units = $objp->volume_units;
|
||||
|
||||
if (getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$line->packaging = $objp->packaging;
|
||||
}
|
||||
$line->packaging = $objp->packaging;
|
||||
|
||||
$line->date_start = $this->db->jdate($objp->date_start);
|
||||
$line->date_end = $this->db->jdate($objp->date_end);
|
||||
|
|
|
|||
|
|
@ -174,10 +174,8 @@ class OrderLine extends CommonOrderLine
|
|||
$sql .= ' cd.fk_unit,';
|
||||
$sql .= ' cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc,';
|
||||
$sql .= ' p.ref as product_ref, p.label as product_label, p.description as product_desc, p.tobatch as product_tobatch,';
|
||||
$sql .= ' p.packaging,';
|
||||
$sql .= ' cd.date_start, cd.date_end, cd.vat_src_code';
|
||||
if (getDolGlobalInt('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$sql .= ', p.packaging';
|
||||
}
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'commandedet as cd';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
|
||||
$sql .= ' WHERE cd.rowid = '.((int) $rowid);
|
||||
|
|
@ -231,10 +229,7 @@ class OrderLine extends CommonOrderLine
|
|||
$this->product_desc = $objp->product_desc;
|
||||
$this->product_tobatch = $objp->product_tobatch;
|
||||
$this->fk_unit = $objp->fk_unit;
|
||||
|
||||
if (getDolGlobalInt('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$this->packaging = $objp->packaging;
|
||||
}
|
||||
$this->packaging = $objp->packaging;
|
||||
|
||||
$this->date_start = $this->db->jdate($objp->date_start);
|
||||
$this->date_end = $this->db->jdate($objp->date_end);
|
||||
|
|
|
|||
|
|
@ -891,11 +891,29 @@ if (empty($reshook)) {
|
|||
if ($line->product_type < 9 && $line->total_ht != 0) { // Remove lines with product_type greater than or equal to 9 and no need to create discount if amount is null
|
||||
$keyforvatrate = $line->tva_tx.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : '');
|
||||
|
||||
if (!isset($amount_ht[$keyforvatrate])) {
|
||||
$amount_ht[$keyforvatrate]=0;
|
||||
}
|
||||
$amount_ht[$keyforvatrate] += $line->total_ht;
|
||||
if (!isset($amount_tva[$keyforvatrate])) {
|
||||
$amount_tva[$keyforvatrate]=0;
|
||||
}
|
||||
$amount_tva[$keyforvatrate] += $line->total_tva;
|
||||
if (!isset($amount_ttc[$keyforvatrate])) {
|
||||
$amount_ttc[$keyforvatrate]=0;
|
||||
}
|
||||
$amount_ttc[$keyforvatrate] += $line->total_ttc;
|
||||
if (!isset($multicurrency_amount_ht[$keyforvatrate])) {
|
||||
$multicurrency_amount_ht[$keyforvatrate]=0;
|
||||
}
|
||||
$multicurrency_amount_ht[$keyforvatrate] += $line->multicurrency_total_ht;
|
||||
if (!isset($multicurrency_amount_tva[$keyforvatrate])) {
|
||||
$multicurrency_amount_tva[$keyforvatrate]=0;
|
||||
}
|
||||
$multicurrency_amount_tva[$keyforvatrate] += $line->multicurrency_total_tva;
|
||||
if (!isset($multicurrency_amount_ttc[$keyforvatrate])) {
|
||||
$multicurrency_amount_ttc[$keyforvatrate]=0;
|
||||
}
|
||||
$multicurrency_amount_ttc[$keyforvatrate] += $line->multicurrency_total_ttc;
|
||||
$i++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3999,14 +3999,14 @@ class Facture extends CommonInvoice
|
|||
$localtaxes_type = getLocalTaxesFromRate($txtva, 0, $this->thirdparty, $mysoc);
|
||||
|
||||
if (getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$product = new Product($this->db);
|
||||
$result = $product->fetch($fk_product);
|
||||
if ($qty < (float) $product->packaging) {
|
||||
$qty = $product->packaging;
|
||||
$tmpproduct = new Product($this->db);
|
||||
$result = $tmpproduct->fetch($fk_product);
|
||||
if (abs($qty) < $tmpproduct->packaging) {
|
||||
$qty = (float) $tmpproduct->packaging;
|
||||
} else {
|
||||
if (!empty($product->packaging) && (fmod((float) $qty, (float) $product->packaging) > 0.000001)) {
|
||||
$coeff = intval((float) $qty / $product->packaging) + 1;
|
||||
$qty = (float) $product->packaging * $coeff;
|
||||
if (!empty($tmpproduct->packaging) && $qty > $tmpproduct->packaging) {
|
||||
$coeff = intval(abs($qty) / $tmpproduct->packaging) + 1;
|
||||
$qty = price2num((float) $tmpproduct->packaging * $coeff, 'MS');
|
||||
setEventMessages($langs->trans('QtyRecalculatedWithPackaging'), null, 'mesgs');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,10 +215,8 @@ class FactureLigne extends CommonInvoiceLine
|
|||
$sql .= ' fd.multicurrency_total_ht,';
|
||||
$sql .= ' fd.multicurrency_total_tva,';
|
||||
$sql .= ' fd.multicurrency_total_ttc,';
|
||||
$sql .= ' p.ref as product_ref, p.label as product_label, p.description as product_desc';
|
||||
if (getDolGlobalInt('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$sql .= ', p.packaging';
|
||||
}
|
||||
$sql .= ' p.ref as product_ref, p.label as product_label, p.description as product_desc,';
|
||||
$sql .= ' p.packaging';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'facturedet as fd';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON fd.fk_product = p.rowid';
|
||||
$sql .= ' WHERE fd.rowid = '.((int) $rowid);
|
||||
|
|
@ -285,9 +283,7 @@ class FactureLigne extends CommonInvoiceLine
|
|||
$this->multicurrency_total_tva = $objp->multicurrency_total_tva;
|
||||
$this->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
|
||||
|
||||
if (getDolGlobalInt('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$this->packaging = $objp->packaging;
|
||||
}
|
||||
$this->packaging = $objp->packaging;
|
||||
|
||||
$this->fetch_optionals();
|
||||
|
||||
|
|
|
|||
|
|
@ -494,7 +494,7 @@ class ContratLigne extends CommonObjectLine
|
|||
$sql .= " t.label,"; // This field is not used. Only label of product
|
||||
$sql .= " p.ref as product_ref,";
|
||||
$sql .= " p.label as product_label,";
|
||||
$sql .= " p.description as product_desc,";
|
||||
$sql .= " p.description as product_description,";
|
||||
$sql .= " p.fk_product_type as product_type,";
|
||||
$sql .= " t.description,";
|
||||
$sql .= " t.date_commande,";
|
||||
|
|
|
|||
|
|
@ -409,6 +409,13 @@ if (!empty($filter_opcloture) && $filter_opcloture == ' BETWEEN ') {
|
|||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
|
||||
// Add where from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
//print $sql;
|
||||
|
||||
// Count total nb of records
|
||||
|
|
@ -524,6 +531,10 @@ if ($filter_datecloture_start != '') {
|
|||
}
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
|
|
|
|||
|
|
@ -773,7 +773,7 @@ class ExtraFields
|
|||
$sql = "ALTER TABLE ".$this->db->prefix().$table." ADD UNIQUE INDEX uk_".$table."_".$this->db->sanitize($attrname)." (".$this->db->sanitize($attrname).")";
|
||||
} else {
|
||||
dol_syslog(get_class($this).'::update_common', LOG_DEBUG);
|
||||
$sql = "ALTER TABLE ".$this->db->prefix().$table." DROP INDEX IF EXISTS uk_".$table."_".$this->db->sanitize($attrname);
|
||||
$sql = "ALTER TABLE ".$this->db->prefix().$table." DROP INDEX uk_".$table."_".$this->db->sanitize($attrname);
|
||||
}
|
||||
dol_syslog(get_class($this).'::update', LOG_DEBUG);
|
||||
$resql = $this->db->query($sql, 1, 'dml');
|
||||
|
|
|
|||
|
|
@ -934,9 +934,10 @@ class Form
|
|||
* @param int<0,1> $addspecialentries 1=Add dedicated entries for group of countries (like 'European Economic Community', ...)
|
||||
* @param string[] $exclude_country_code Array of country code (iso2) to exclude
|
||||
* @param int<0,1> $hideflags Hide flags
|
||||
* @param int<0,1> $forcecombo Force to load all values and output a standard combobox (with no beautification)
|
||||
* @return string HTML string with select
|
||||
*/
|
||||
public function select_country($selected = '', $htmlname = 'country_id', $htmloption = '', $maxlength = 0, $morecss = 'minwidth300', $usecodeaskey = '', $showempty = 1, $disablefavorites = 0, $addspecialentries = 0, $exclude_country_code = array(), $hideflags = 0)
|
||||
public function select_country($selected = '', $htmlname = 'country_id', $htmloption = '', $maxlength = 0, $morecss = 'minwidth300', $usecodeaskey = '', $showempty = 1, $disablefavorites = 0, $addspecialentries = 0, $exclude_country_code = array(), $hideflags = 0, $forcecombo = 0)
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs, $mysoc;
|
||||
|
|
@ -1048,8 +1049,10 @@ class Form
|
|||
}
|
||||
|
||||
// Make select dynamic
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
|
||||
if (empty($forcecombo)) {
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox('select' . $htmlname, array(), 0, 0, 'resolve');
|
||||
}
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
|
@ -1077,7 +1080,7 @@ class Form
|
|||
$langs->load("dict");
|
||||
|
||||
$out = '';
|
||||
$moreattrib = '';
|
||||
//$moreattrib = '';
|
||||
$incotermArray = array();
|
||||
|
||||
$sql = "SELECT rowid, code";
|
||||
|
|
@ -1130,7 +1133,7 @@ class Form
|
|||
|
||||
if ($conf->use_javascript_ajax && empty($disableautocomplete)) {
|
||||
$out .= ajax_multiautocompleter('location_incoterms', array(), DOL_URL_ROOT . '/core/ajax/locationincoterms.php') . "\n";
|
||||
$moreattrib .= ' autocomplete="off"';
|
||||
//$moreattrib .= ' autocomplete="off"';
|
||||
}
|
||||
$out .= '<input id="location_incoterms" class="maxwidthonsmartphone type="text" name="location_incoterms" value="' . $location_incoterms . '">' . "\n";
|
||||
|
||||
|
|
@ -2202,7 +2205,7 @@ class Form
|
|||
$sql .= " LEFT JOIN " . $this->db->prefix() . "entity as e ON e.rowid = u.entity";
|
||||
}
|
||||
// Condition here should be the same than into societe->getSalesRepresentatives().
|
||||
if ($userissuperadminentityone && $force_entity != 'default') {
|
||||
if ($userissuperadminentityone && $force_entity !== 'default') {
|
||||
if (!empty($force_entity)) {
|
||||
$sql .= " WHERE u.entity IN (0, " . $this->db->sanitize($force_entity) . ")";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1588,6 +1588,7 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
|
|||
}
|
||||
}
|
||||
} else {
|
||||
$ok = false; // to avoid false positive
|
||||
dol_syslog("No files to delete found", LOG_DEBUG);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ function dol_convertToWord($num, $langs, $currency = '', $centimes = false)
|
|||
} else {
|
||||
$TNum = explode('.', (string) $num);
|
||||
|
||||
$num = (int) $TNum[0];
|
||||
$num = abs((int) $TNum[0]);
|
||||
$words = array();
|
||||
$list1 = array(
|
||||
'',
|
||||
|
|
|
|||
|
|
@ -302,18 +302,23 @@ function dolSavePageContent($filetpl, Website $object, WebsitePage $objectpage,
|
|||
|
||||
// Add manifest.json. Do we have to add it only on home page ?
|
||||
$tplcontent .= '<?php if ($website->use_manifest) { print \'<link rel="manifest" href="/manifest.json.php" />\'."\n"; } ?>'."\n";
|
||||
$tplcontent .= '<!-- Include link to CSS file -->'."\n";
|
||||
// Add js
|
||||
$tplcontent .= '<link rel="stylesheet" href="/styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
|
||||
$tplcontent .= '<!-- Include link to JS file -->'."\n";
|
||||
$tplcontent .= '<script nonce="'.getNonce().'" async src="/javascript.js.php?website=<?php echo $websitekey; ?>"></script>'."\n";
|
||||
// Add headers
|
||||
|
||||
// Add HTML headers (must be before the Add of the common CSS and js). The common js may content javascript using jquery or a framework loaded by the HTML header.
|
||||
$tplcontent .= '<!-- Include HTML header from common file -->'."\n";
|
||||
$tplcontent .= '<?php if (file_exists(DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html")) include DOL_DATA_ROOT."/website/".$websitekey."/htmlheader.html"; ?>'."\n";
|
||||
$tplcontent .= '<!-- Include HTML header from page header block -->'."\n";
|
||||
$tplcontent .= preg_replace('/<\/?html>/ims', '', $objectpage->htmlheader)."\n";
|
||||
|
||||
// Add css
|
||||
$tplcontent .= '<!-- Include link to common CSS file -->'."\n";
|
||||
$tplcontent .= '<link rel="stylesheet" href="/styles.css.php?website=<?php echo $websitekey; ?>" type="text/css" />'."\n";
|
||||
|
||||
// Add js
|
||||
$tplcontent .= '<!-- Include link to common JS file -->'."\n";
|
||||
$tplcontent .= '<script nonce="'.getNonce().'" async src="/javascript.js.php?website=<?php echo $websitekey; ?>"></script>'."\n";
|
||||
$tplcontent .= '</head>'."\n";
|
||||
|
||||
// Page content
|
||||
$tplcontent .= '<!-- File content defined in Dolibarr website module editor -->'."\n";
|
||||
$tplcontent .= '<body id="bodywebsite" class="bodywebsite bodywebpage-'.$objectpage->ref.'">'."\n";
|
||||
$tplcontent .= $objectpage->content."\n";
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
|||
$desc = dol_htmlentitiesbr($text, 1);
|
||||
//print $outputlangs->convToOutputCharset($desc); exit;
|
||||
|
||||
$pdf->writeHTMLCell(180, 3, 10, $tab_top + 5, $outputlangs->convToOutputCharset($desc), 0, 1);
|
||||
$pdf->writeHTMLCell(180, 3, $this->posxdesc - 1, $tab_top + 5, $outputlangs->convToOutputCharset($desc), 0, 1);
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
$pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
|
||||
|
|
|
|||
|
|
@ -232,6 +232,7 @@ class modProjet extends DolibarrModules
|
|||
'p.rowid'=>"Numeric", 'p.ref'=>"Text", 'p.title'=>"Text",
|
||||
'p.usage_opportunity'=>'Boolean', 'p.usage_task'=>'Boolean', 'p.usage_bill_time'=>'Boolean',
|
||||
'p.datec'=>"Date", 'p.dateo'=>"Date", 'p.datee'=>"Date", 'p.fk_statut'=>'Status', 'cls.code'=>"Text", 'p.opp_percent'=>'Numeric', 'p.opp_amount'=>'Numeric', 'p.description'=>"Text", 'p.entity'=>'Numeric', 'p.budget_amount'=>'Numeric',
|
||||
'p.note_public'=>'Text', 'p.note_private'=>'Text',
|
||||
'pt.rowid'=>'Numeric', 'pt.ref'=>'Text', 'pt.label'=>'Text', 'pt.dateo'=>"Date", 'pt.datee'=>"Date", 'pt.duration_effective'=>"Duree", 'pt.planned_workload'=>"Numeric", 'pt.progress'=>"Numeric", 'pt.description'=>"Text",
|
||||
'ptt.rowid'=>'Numeric', 'ptt.element_date'=>'Date', 'ptt.element_duration'=>"Duree", 'ptt.fk_user'=>"FormSelect:select_dolusers", 'ptt.note'=>"Text"
|
||||
);
|
||||
|
|
@ -244,7 +245,8 @@ class modProjet extends DolibarrModules
|
|||
's.phone'=>'Phone', 's.email'=>'Email', 's.siren'=>'ProfId1', 's.siret'=>'ProfId2', 's.ape'=>'ProfId3', 's.idprof4'=>'ProfId4', 's.code_compta'=>'CustomerAccountancyCode', 's.code_compta_fournisseur'=>'SupplierAccountancyCode',
|
||||
'p.rowid'=>"ProjectId", 'p.ref'=>"RefProject", 'p.title'=>'ProjectLabel',
|
||||
'p.usage_opportunity'=>'ProjectFollowOpportunity', 'p.usage_task'=>'ProjectFollowTasks', 'p.usage_bill_time'=>'BillTime',
|
||||
'p.datec'=>"DateCreation", 'p.dateo'=>"DateStart", 'p.datee'=>"DateEnd", 'p.fk_statut'=>'ProjectStatus', 'cls.code'=>'OpportunityStatus', 'p.opp_percent'=>'OpportunityProbability', 'p.opp_amount'=>'OpportunityAmount', 'p.budget_amount'=>'Budget', 'p.description'=>"Description"
|
||||
'p.datec'=>"DateCreation", 'p.dateo'=>"DateStart", 'p.datee'=>"DateEnd", 'p.fk_statut'=>'ProjectStatus', 'cls.code'=>'OpportunityStatus', 'p.opp_percent'=>'OpportunityProbability', 'p.opp_amount'=>'OpportunityAmount', 'p.description'=>"Description", 'p.budget_amount'=>'Budget',
|
||||
'p.note_public'=>'NotePublic', 'p.note_private'=>'NotePrivate',
|
||||
);
|
||||
// Add multicompany field
|
||||
if (getDolGlobalString('MULTICOMPANY_ENTITY_IN_EXPORT_IF_SHARED')) {
|
||||
|
|
|
|||
|
|
@ -473,6 +473,14 @@ class doc_generic_task_odt extends ModelePDFTask
|
|||
return -1;
|
||||
}
|
||||
|
||||
// Add odtgeneration hook
|
||||
if (!is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('odtgeneration'));
|
||||
global $action;
|
||||
|
||||
if (!is_object($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,6 +228,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
|
|||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('odtgeneration'));
|
||||
global $action;
|
||||
|
||||
if (!is_object($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ if ($permission) {
|
|||
|
||||
// Prepare list
|
||||
|
||||
// TODO: replace this with 1 single direct SQL (for both eyernal and external string to use $db->sort($sortfield, $sortorder)
|
||||
// TODO: replace this with 1 single direct SQL (for both internal and external string to use $db->sort($sortfield, $sortorder)
|
||||
$list = array();
|
||||
foreach (array('internal', 'external') as $source) {
|
||||
if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) {
|
||||
|
|
|
|||
|
|
@ -386,17 +386,6 @@ if ($projectid > 0) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($project->public == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($project->budget_amount, '')) {
|
||||
|
|
@ -433,6 +422,17 @@ if ($projectid > 0) {
|
|||
print $project->location;
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($project->public == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
$objectconf = $object;
|
||||
|
|
@ -448,11 +448,6 @@ if ($projectid > 0) {
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield tdtop">'.$langs->trans("Description").'</td><td class="valuefield">';
|
||||
print dol_htmlentitiesbr($project->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="titlefield valignmiddle">'.$langs->trans("Categories").'</td><td class="valuefield">';
|
||||
|
|
@ -460,6 +455,16 @@ if ($projectid > 0) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($project->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($project->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($project->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td class="titlefield">';
|
||||
$typeofdata = 'checkbox:'.($project->accept_conference_suggestions ? ' checked="checked"' : '');
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
|
|
|
|||
|
|
@ -485,17 +485,6 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($projectstatic->budget_amount, '')) {
|
||||
|
|
@ -527,6 +516,17 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Location event
|
||||
print '<tr><td>'.$langs->trans("Location").'</td><td>';
|
||||
print $projectstatic->location;
|
||||
|
|
@ -548,11 +548,6 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print dol_htmlentitiesbr($projectstatic->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -560,6 +555,16 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($projectstatic->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($projectstatic->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($projectstatic->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td class="nowrap">';
|
||||
$typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
|
|
|
|||
|
|
@ -1608,6 +1608,13 @@ class Expedition extends CommonObject
|
|||
$error++;
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
// Delete linked contacts
|
||||
$res = $this->delete_linked_contact();
|
||||
if ($res < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expedition";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
|
|
|||
|
|
@ -2460,35 +2460,52 @@ class CommandeFournisseur extends CommonOrder
|
|||
}
|
||||
|
||||
$main = $this->db->prefix().'commande_fournisseurdet';
|
||||
$ef = $main."_extrafields";
|
||||
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = ".((int) $this->id).")";
|
||||
dol_syslog(get_class($this)."::delete extrafields lines", LOG_DEBUG);
|
||||
if (!$this->db->query($sql)) {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$error++;
|
||||
|
||||
if (!$error) {
|
||||
$sql1 = "UPDATE ".$this->db->prefix()."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet IN (SELECT rowid FROM ".$main." WHERE fk_commande = ".((int) $this->id).")";
|
||||
dol_syslog(__METHOD__." linked order lines", LOG_DEBUG);
|
||||
if (!$this->db->query($sql1)) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".$this->db->prefix()."commande_fournisseurdet WHERE fk_commande =".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if (!$this->db->query($sql)) {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
||||
$sql = "DELETE FROM ".$this->db->prefix()."commande_fournisseur WHERE rowid =".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if ($resql = $this->db->query($sql)) {
|
||||
if ($this->db->affected_rows($resql) < 1) {
|
||||
if (!$error) {
|
||||
$ef = $main."_extrafields";
|
||||
$sql = "DELETE FROM $ef WHERE fk_object IN (SELECT rowid FROM $main WHERE fk_commande = ".((int) $this->id).")";
|
||||
dol_syslog(get_class($this)."::delete extrafields lines", LOG_DEBUG);
|
||||
if (!$this->db->query($sql)) {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".$this->db->prefix()."commande_fournisseurdet WHERE fk_commande =".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if (!$this->db->query($sql)) {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".$this->db->prefix()."commande_fournisseur WHERE rowid =".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
if ($resql = $this->db->query($sql)) {
|
||||
if ($this->db->affected_rows($resql) < 1) {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
$error++;
|
||||
}
|
||||
|
||||
// Remove extrafields
|
||||
|
|
|
|||
|
|
@ -74,9 +74,11 @@ insert into llx_c_type_contact (element, source, code, libelle, active ) values
|
|||
insert into llx_c_type_contact (element, source, code, libelle, active ) values ('commande', 'external', 'SHIPPING', 'Contact client livraison commande', 1);
|
||||
|
||||
-- Shipment / Expedition
|
||||
insert into llx_c_type_contact (element, source, code, libelle, active ) values ('expedition', 'external', 'CUSTOMER', 'Customer shipping contact', 1);
|
||||
insert into llx_c_type_contact (element, source, code, libelle, active ) values ('expedition', 'external', 'SHIPPING', 'Loading facility', 1);
|
||||
insert into llx_c_type_contact (element, source, code, libelle, active ) values ('expedition', 'external', 'DELIVERY', 'Delivery facility', 1);
|
||||
insert into llx_c_type_contact (element, source, code, libelle, active ) values ('shipping', 'internal', 'SALESREPFOLL', 'Representative following-up shipping', 1);
|
||||
INSERT INTO llx_c_type_contact (element, source, code, libelle, active ) VALUES ('shipping', 'external', 'BILLING', 'Customer invoice contact', 1);
|
||||
insert into llx_c_type_contact (element, source, code, libelle, active ) values ('shipping', 'external', 'CUSTOMER', 'Customer shipping contact', 1);
|
||||
insert into llx_c_type_contact (element, source, code, libelle, active ) values ('shipping', 'external', 'SHIPPING', 'Loading facility', 1);
|
||||
insert into llx_c_type_contact (element, source, code, libelle, active ) values ('shipping', 'external', 'DELIVERY', 'Delivery facility', 1);
|
||||
|
||||
-- Intervention / Fichinter
|
||||
insert into llx_c_type_contact (element, source, code, libelle, active ) values ('fichinter', 'internal', 'INTERREPFOLL', 'Responsable suivi de l''intervention', 1);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,14 @@ ALTER TABLE llx_societe_account ADD UNIQUE INDEX uk_societe_account_login_websit
|
|||
|
||||
|
||||
-- V22 migration
|
||||
-- fix element
|
||||
UPDATE llx_c_type_contact set element='shipping' WHERE element='expedition';
|
||||
-- Shipment / Expedition
|
||||
INSERT INTO llx_c_type_contact (element, source, code, libelle, active ) VALUES ('shipping', 'internal', 'SALESREPFOLL', 'Representative following-up shipping', 1);
|
||||
INSERT INTO llx_c_type_contact (element, source, code, libelle, active ) VALUES ('shipping', 'external', 'BILLING', 'Customer invoice contact', 1);
|
||||
INSERT INTO llx_c_type_contact (element, source, code, libelle, active ) VALUES ('shipping', 'external', 'CUSTOMER', 'Customer shipping contact', 1);
|
||||
INSERT INTO llx_c_type_contact (element, source, code, libelle, active ) VALUES ('shipping', 'external', 'SHIPPING', 'Loading facility', 1);
|
||||
INSERT INTO llx_c_type_contact (element, source, code, libelle, active ) VALUES ('shipping', 'external', 'DELIVERY', 'Delivery facility', 1);
|
||||
|
||||
ALTER TABLE llx_holiday_config DROP INDEX idx_holiday_config;
|
||||
ALTER TABLE llx_holiday_config ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
|
||||
|
|
@ -49,4 +57,4 @@ ALTER TABLE llx_holiday_config ADD UNIQUE INDEX idx_holiday_config (entity, name
|
|||
|
||||
ALTER TABLE llx_societe_account ADD COLUMN ip varchar(250);
|
||||
|
||||
ALTER TABLE llx_product ADD COLUMN packaging float(24,8) DEFAULT NULL;
|
||||
ALTER TABLE llx_product ADD COLUMN packaging float(24,8) DEFAULT NULL;
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ AvailabilityTypeAV_1W=1 week
|
|||
AvailabilityTypeAV_2W=2 weeks
|
||||
AvailabilityTypeAV_3W=3 weeks
|
||||
AvailabilityTypeAV_1M=1 month
|
||||
##### Types ofe contacts #####
|
||||
##### Types of contacts #####
|
||||
TypeContact_propal_internal_SALESREPFOLL=Representative following-up proposal
|
||||
TypeContact_propal_external_BILLING=Customer invoice contact
|
||||
TypeContact_propal_external_CUSTOMER=Customer contact following-up proposal
|
||||
|
|
|
|||
|
|
@ -83,3 +83,9 @@ ShipmentDistribution=Shipment distribution
|
|||
ErrorTooManyCombinationBatchcode=No dispatch for line %s as too many combinations of warehouse, product, batch code was found (%s).
|
||||
ErrorNoCombinationBatchcode=Could not save the line %s as the combination of warehouse-product-lot/serial (%s, %s, %s) was not found in stock.
|
||||
ErrorTooMuchShipped=Quantity shipped should not be greater than quantity ordered for line %s
|
||||
##### Types of contacts #####
|
||||
TypeContact_shipping_internal_SALESREPFOLL=Representative following-up shipping
|
||||
TypeContact_shipping_external_BILLING=Customer invoice contact
|
||||
TypeContact_shipping_external_CUSTOMER=Customer contact following-up shipping
|
||||
TypeContact_shipping_external_SHIPPING=Customer contact for shipping
|
||||
TypeContact_shipping_external_DELIVERY=Customer contact for delivery
|
||||
|
|
|
|||
|
|
@ -241,7 +241,12 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
|
|||
}
|
||||
|
||||
// Add odtgeneration hook
|
||||
if (!is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('odtgeneration'));
|
||||
global $action;
|
||||
|
||||
if (!is_object($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
|
|
|
|||
|
|
@ -865,7 +865,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed = $user->hasRight('mrp', 'read'); // If you can read, you can build the PDF to read content
|
||||
$delallowed = $user->hasRight("mrp", "creer"); // If you can create/edit, you can remove a file on card
|
||||
print $formfile->showdocuments('mrp:mo', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $mysoc->default_lang);
|
||||
print $formfile->showdocuments('mrp:mo', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $mysoc->default_lang, '', $object);
|
||||
|
||||
// Show links to link elements
|
||||
$tmparray = $form->showLinkToObjectBlock($object, array(), array('mo'), 1);
|
||||
|
|
|
|||
|
|
@ -1590,14 +1590,14 @@ class Product extends CommonObject
|
|||
$sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
|
||||
}
|
||||
$sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null");
|
||||
$sql .= ", cost_price = ".($this->cost_price != '' ? $this->db->escape($this->cost_price) : 'null');
|
||||
$sql .= ", cost_price = ".($this->cost_price != '' ? ((float) $this->cost_price) : 'null');
|
||||
$sql .= ", fk_unit= ".(!$this->fk_unit ? 'NULL' : (int) $this->fk_unit);
|
||||
$sql .= ", price_autogen = ".(!$this->price_autogen ? 0 : 1);
|
||||
$sql .= ", fk_price_expression = ".($this->fk_price_expression != 0 ? (int) $this->fk_price_expression : 'NULL');
|
||||
$sql .= ", fk_user_modif = ".($user->id > 0 ? $user->id : 'NULL');
|
||||
$sql .= ", mandatory_period = ".($this->mandatory_period);
|
||||
if (getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING') && !empty($this->packaging)) {
|
||||
$sql .= ", packaging = " . (float) $this->packaging;
|
||||
$sql .= ", fk_user_modif = ".($user->id > 0 ? (int) $user->id : 'NULL');
|
||||
$sql .= ", mandatory_period = ".((int) $this->mandatory_period);
|
||||
if (getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$sql .= ", packaging = ".(float) $this->packaging;
|
||||
}
|
||||
// stock field is not here because it is a denormalized value from product_stock.
|
||||
$sql .= " WHERE rowid = ".((int) $id);
|
||||
|
|
@ -2893,15 +2893,12 @@ class Product extends CommonObject
|
|||
$sql .= " p.price_min, p.price_min_ttc, p.price_base_type, p.cost_price, p.default_vat_code, p.tva_tx, p.recuperableonly as tva_npr, p.localtax1_tx, p.localtax2_tx, p.localtax1_type, p.localtax2_type, p.tosell,";
|
||||
$sql .= " p.tobuy, p.fk_product_type, p.duration, p.fk_default_warehouse, p.fk_default_workstation, p.seuil_stock_alerte, p.canvas, p.net_measure, p.net_measure_units, p.weight, p.weight_units,";
|
||||
$sql .= " p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.last_main_doc,";
|
||||
$sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom, p.mandatory_period,";
|
||||
$sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom, p.mandatory_period, p.packaging,";
|
||||
if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
|
||||
$sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
|
||||
} else {
|
||||
$sql .= " ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export, ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export,";
|
||||
}
|
||||
if (getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING')) {
|
||||
$sql .= " p.packaging,";
|
||||
}
|
||||
|
||||
// For MultiCompany
|
||||
// PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
|
||||
|
|
@ -2959,7 +2956,7 @@ class Product extends CommonObject
|
|||
$sql .= " p.price_min, p.price_min_ttc, p.price_base_type, p.cost_price, p.default_vat_code, p.tva_tx, p.recuperableonly, p.localtax1_tx, p.localtax2_tx, p.localtax1_type, p.localtax2_type, p.tosell,";
|
||||
$sql .= " p.tobuy, p.fk_product_type, p.duration, p.fk_default_warehouse, p.fk_default_workstation, p.seuil_stock_alerte, p.canvas, p.net_measure, p.net_measure_units, p.weight, p.weight_units,";
|
||||
$sql .= " p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,";
|
||||
$sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom, p.mandatory_period,";
|
||||
$sql .= " p.surface, p.surface_units, p.volume, p.volume_units, p.barcode, p.fk_barcode_type, p.finished, p.fk_default_bom, p.mandatory_period, p.packaging,";
|
||||
if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
|
||||
$sql .= " p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export,";
|
||||
} else {
|
||||
|
|
@ -2971,8 +2968,8 @@ class Product extends CommonObject
|
|||
$sql .= " p.pmp,";
|
||||
}
|
||||
$sql .= " p.datec, p.tms, p.import_key, p.entity, p.desiredstock, p.tobatch, p.sell_or_eat_by_mandatory, p.batch_mask, p.fk_unit,";
|
||||
$sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf";
|
||||
$sql .= " ,p.price_label";
|
||||
$sql .= " p.fk_price_expression, p.price_autogen, p.model_pdf,";
|
||||
$sql .= " p.price_label";
|
||||
if (!$separatedStock) {
|
||||
$sql .= ", p.stock";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -279,12 +279,12 @@ if (empty($reshook)) {
|
|||
$error = 0;
|
||||
$pricestoupdate = array();
|
||||
|
||||
$psq = GETPOST('psqflag');
|
||||
$psq = empty($newpsq) ? 0 : $newpsq;
|
||||
$psq = GETPOSTINT('psqflag');
|
||||
|
||||
$maxpricesupplier = $object->min_recommended_price();
|
||||
|
||||
// Packaging
|
||||
$packaging = getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING') ? GETPOST('packaging') : null;
|
||||
$packaging = getDolGlobalString('PRODUCT_USE_CUSTOMER_PACKAGING') ? price2num(GETPOST('packaging', 'alpha'), 'MS') : null;
|
||||
|
||||
if (isModEnabled('dynamicprices')) {
|
||||
$object->fk_price_expression = empty($eid) ? 0 : $eid; //0 discards expression
|
||||
|
|
|
|||
|
|
@ -812,31 +812,6 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td class="maxwidthonsmartphone">';
|
||||
$array = array();
|
||||
if (!getDolGlobalString('PROJECT_DISABLE_PRIVATE_PROJECT')) {
|
||||
$array[0] = $langs->trans("PrivateProject");
|
||||
}
|
||||
if (!getDolGlobalString('PROJECT_DISABLE_PUBLIC_PROJECT')) {
|
||||
$array[1] = $langs->trans("SharedProject");
|
||||
}
|
||||
|
||||
if (count($array) > 0) {
|
||||
print $form->selectarray('public', $array, GETPOSTINT('public') ? 1 : 0, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print '<input type="hidden" name="public" id="public" value="'.(GETPOSTINT('public') ? 1 : 0).'">';
|
||||
|
||||
if (GETPOSTINT('public') == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
|
||||
// Opportunity status
|
||||
print '<tr class="classuseopportunity"><td><span class="fieldrequired">'.$langs->trans("OpportunityStatus").'</span></td>';
|
||||
|
|
@ -901,6 +876,31 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td class="maxwidthonsmartphone">';
|
||||
$array = array();
|
||||
if (!getDolGlobalString('PROJECT_DISABLE_PRIVATE_PROJECT')) {
|
||||
$array[0] = $langs->trans("PrivateProject");
|
||||
}
|
||||
if (!getDolGlobalString('PROJECT_DISABLE_PUBLIC_PROJECT')) {
|
||||
$array[1] = $langs->trans("SharedProject");
|
||||
}
|
||||
|
||||
if (count($array) > 0) {
|
||||
print $form->selectarray('public', $array, GETPOSTINT('public') ? 1 : 0, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print '<input type="hidden" name="public" id="public" value="'.(GETPOSTINT('public') ? 1 : 0).'">';
|
||||
|
||||
if (GETPOSTINT('public') == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Selection of Owner contact type
|
||||
print '<tr><td class="tdtop">'.$langs->trans("ProjectContactTypeManager").'</td>';
|
||||
print '<td>';
|
||||
|
|
@ -1210,31 +1210,6 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
$array = array();
|
||||
if (!getDolGlobalString('PROJECT_DISABLE_PRIVATE_PROJECT')) {
|
||||
$array[0] = $langs->trans("PrivateProject");
|
||||
}
|
||||
if (!getDolGlobalString('PROJECT_DISABLE_PUBLIC_PROJECT')) {
|
||||
$array[1] = $langs->trans("SharedProject");
|
||||
}
|
||||
|
||||
if (count($array) > 0) {
|
||||
print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print '<input type="hidden" id="public" name="public" value="'.$object->public.'">';
|
||||
|
||||
if ($object->public == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
|
||||
$classfortr = ($object->usage_opportunity ? '' : ' hideobject');
|
||||
// Opportunity status
|
||||
|
|
@ -1322,6 +1297,31 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
$array = array();
|
||||
if (!getDolGlobalString('PROJECT_DISABLE_PRIVATE_PROJECT')) {
|
||||
$array[0] = $langs->trans("PrivateProject");
|
||||
}
|
||||
if (!getDolGlobalString('PROJECT_DISABLE_PUBLIC_PROJECT')) {
|
||||
$array[1] = $langs->trans("SharedProject");
|
||||
}
|
||||
|
||||
if (count($array) > 0) {
|
||||
print $form->selectarray('public', $array, $object->public, 0, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
} else {
|
||||
print '<input type="hidden" id="public" name="public" value="'.$object->public.'">';
|
||||
|
||||
if ($object->public == 0) {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans("PrivateProject");
|
||||
} else {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans("SharedProject");
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other options
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
|
@ -1409,17 +1409,6 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') && !empty($object->usage_opportunity)) {
|
||||
// Opportunity status
|
||||
print '<tr><td>'.$langs->trans("OpportunityStatus");
|
||||
|
|
@ -1463,6 +1452,17 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
|
@ -1475,13 +1475,6 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($object->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -1489,6 +1482,16 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($object->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($object->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($object->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -424,17 +424,6 @@ if ($id > 0 || !empty($ref)) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') && !empty($object->usage_opportunity)) {
|
||||
// Opportunity status
|
||||
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
|
||||
|
|
@ -480,6 +469,17 @@ if ($id > 0 || !empty($ref)) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
|
@ -492,11 +492,6 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print dol_htmlentitiesbr($object->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -504,6 +499,16 @@ if ($id > 0 || !empty($ref)) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($object->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($object->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($object->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -311,18 +311,7 @@ if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') || !getDolGlobalString('PROJ
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) {
|
||||
if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') && !empty($object->usage_opportunity)) {
|
||||
// Opportunity status
|
||||
print '<tr><td>'.$langs->trans("OpportunityStatus").'</td><td>';
|
||||
$code = dol_getIdFromCode($db, $object->opp_status, 'c_lead_status', 'rowid', 'code');
|
||||
|
|
@ -368,6 +357,17 @@ if ($object->hasDelay()) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
|
@ -380,11 +380,6 @@ print '<div class="underbanner clearboth"></div>';
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print dol_htmlentitiesbr($object->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -392,6 +387,16 @@ if (isModEnabled('category')) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($object->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($object->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($object->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -670,17 +670,6 @@ if ($id > 0 || !empty($ref)) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (!is_null($object->budget_amount) && strcmp($object->budget_amount, '')) {
|
||||
|
|
@ -700,6 +689,17 @@ if ($id > 0 || !empty($ref)) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($object->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
|
@ -712,11 +712,6 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print dol_htmlentitiesbr($object->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -724,6 +719,16 @@ if ($id > 0 || !empty($ref)) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($object->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($object->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($object->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -255,17 +255,6 @@ if ($id > 0 || !empty($ref)) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
|
||||
|
|
@ -285,9 +274,23 @@ if ($id > 0 || !empty($ref)) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
$savobject = $object;
|
||||
$object = $projectstatic;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
$object = $savobject;
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
|
@ -297,11 +300,6 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($projectstatic->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -309,6 +307,16 @@ if ($id > 0 || !empty($ref)) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($projectstatic->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($projectstatic->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($projectstatic->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -212,17 +212,6 @@ if ($object->id > 0) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
|
||||
|
|
@ -242,9 +231,23 @@ if ($object->id > 0) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
$savobject = $object;
|
||||
$object = $projectstatic;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
$object = $savobject;
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
|
@ -254,11 +257,6 @@ if ($object->id > 0) {
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($projectstatic->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -266,6 +264,16 @@ if ($object->id > 0) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($projectstatic->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($projectstatic->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($projectstatic->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -202,17 +202,6 @@ if ($object->id > 0) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
|
||||
|
|
@ -232,9 +221,23 @@ if ($object->id > 0) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
$savobject = $object;
|
||||
$object = $projectstatic;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
$object = $savobject;
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
|
@ -244,11 +247,6 @@ if ($object->id > 0) {
|
|||
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($projectstatic->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -256,6 +254,16 @@ if ($object->id > 0) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($projectstatic->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($projectstatic->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($projectstatic->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -270,9 +270,9 @@ if ($action == 'remove_file' && $user->hasRight('projet', 'creer')) {
|
|||
|
||||
$ret = dol_delete_file($file);
|
||||
if ($ret) {
|
||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
|
||||
setEventMessages($langs->trans("FileWasRemoved", GETPOST('file')), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('file')), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -291,6 +291,7 @@ if ($action == 'reopen' && $user->hasRight('projet', 'creer')) {
|
|||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formother = new FormOther($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
|
@ -390,17 +391,6 @@ if ($id > 0 || !empty($ref)) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (isset($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
|
||||
|
|
@ -420,9 +410,23 @@ if ($id > 0 || !empty($ref)) {
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
$savobject = $object;
|
||||
$object = $projectstatic;
|
||||
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
$object = $savobject;
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
|
@ -433,11 +437,6 @@ if ($id > 0 || !empty($ref)) {
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($projectstatic->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
|
|
@ -445,6 +444,16 @@ if ($id > 0 || !empty($ref)) {
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($projectstatic->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($projectstatic->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($projectstatic->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -1006,17 +1006,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>' . $langs->trans("Budget") . '</td><td>';
|
||||
if (!is_null($projectstatic->budget_amount) && strcmp($projectstatic->budget_amount, '')) {
|
||||
|
|
@ -1036,6 +1025,17 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">' . $langs->trans("Visibility") . '</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
$savobject = $object;
|
||||
|
|
@ -1051,11 +1051,6 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print dol_htmlentitiesbr($projectstatic->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if (isModEnabled('category')) {
|
||||
print '<tr><td class="valignmiddle">' . $langs->trans("Categories") . '</td><td>';
|
||||
|
|
@ -1063,6 +1058,16 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
|
|||
print "</td></tr>";
|
||||
}
|
||||
|
||||
// Description
|
||||
print '<tr><td class="titlefield'.($projectstatic->description ? ' noborderbottom' : '').'" colspan="2">'.$langs->trans("Description").'</td></tr>';
|
||||
if ($projectstatic->description) {
|
||||
print '<tr><td class="nottitleforfield" colspan="2">';
|
||||
print '<div class="longmessagecut">';
|
||||
print dolPrintHTML($projectstatic->description);
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
|
|
|||
|
|
@ -238,7 +238,12 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
|
|||
}
|
||||
|
||||
// Add odtgeneration hook
|
||||
if (!is_object($hookmanager)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
|
||||
$hookmanager = new HookManager($this->db);
|
||||
}
|
||||
$hookmanager->initHooks(array('odtgeneration'));
|
||||
global $action;
|
||||
|
||||
if (!is_object($outputlangs)) {
|
||||
$outputlangs = $langs;
|
||||
|
|
|
|||
|
|
@ -2313,7 +2313,7 @@ datalist {
|
|||
|
||||
.linkobject { cursor: pointer; }
|
||||
|
||||
table.tableforfield tr:not(.liste_titre)>td:first-of-type, tr.trforfield:not(.liste_titre)>td:first-of-type, div.tableforfield div.tagtr:not(.liste_titre)>div.tagtd:first-of-type {
|
||||
table.tableforfield tr:not(.liste_titre)>td:first-of-type:not(.nottitleforfield), tr.trforfield:not(.liste_titre)>td:first-of-type, div.tableforfield div.tagtr:not(.liste_titre)>div.tagtd:first-of-type {
|
||||
color: var(--tableforfieldcolor);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,10 +129,11 @@ if (GETPOSTISSET('type')) {
|
|||
$original_file = str_replace("../", "/", $original_file);
|
||||
|
||||
// Cache or not
|
||||
if (GETPOST("cache", 'aZ09') || image_format_supported($original_file) >= 0) {
|
||||
$cachestring = GETPOST("cache", 'aZ09'); // May be 1, or an int, or a hash
|
||||
if ($cachestring || image_format_supported($original_file) >= 0) {
|
||||
// Important: Following code is to avoid page request by browser and PHP CPU at
|
||||
// each Dolibarr page access.
|
||||
header('Cache-Control: max-age=3600, public, must-revalidate');
|
||||
header('Cache-Control: max-age='.((is_numeric($cachestring) && (int) $cachestring > 1 && (int) $cachestring < 999999) ? $cachestring : '3600').', public, must-revalidate');
|
||||
header('Pragma: cache'); // This is to avoid having Pragma: no-cache
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user