Merge branch 'develop' of github.com:Dolibarr/dolibarr into NEW_stockstransfers
This commit is contained in:
commit
4614b0dd65
6
.github/CONTRIBUTING.md
vendored
6
.github/CONTRIBUTING.md
vendored
@ -116,13 +116,13 @@ a process to follow to optimize the chance to have PRs merged efficiently...
|
||||
|
||||
Also, some code changes need a prior approbation:
|
||||
|
||||
* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-yoda in your issue) to see if such a library can be accepted.
|
||||
* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-jedi in your issue) to see if such a library can be accepted.
|
||||
|
||||
* if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@dolibarr-yoda) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest.
|
||||
* if you add a new tables or fields, you MUST first submit a standalone PR with the data structure changes you plan to add/modify (and only data structure changes). Start development only once this data structure has been accepted.
|
||||
|
||||
Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case).
|
||||
|
||||
If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of PR (but it can be analyzed for discussion).
|
||||
If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of the PR (but it can be analyzed for discussion).
|
||||
|
||||
If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration.
|
||||
|
||||
|
||||
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
8
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -1,18 +1,18 @@
|
||||
# Instructions
|
||||
*This is a template to help you make good pull requests. You may use [Github Markdown](https://help.github.com/articles/getting-started-with-writing-and-formatting-on-github/) syntax to format your issue report.*
|
||||
*Please:*
|
||||
- *only keep the "Fix", "Close" or "New" section*
|
||||
- *only keep the "FIX", "CLOSE" or "NEW" section* (use uppercase to have the PR appears into the ChangeLog, lowercase will not appears)
|
||||
- *follow the project [contributing guidelines](/.github/CONTRIBUTING.md)*
|
||||
- *replace the bracket enclosed texts with meaningful information*
|
||||
|
||||
|
||||
# Fix #[*issue_number Short description*]
|
||||
# FIX|Fix #[*issue_number Short description*]
|
||||
[*Long description*]
|
||||
|
||||
|
||||
# Close #[*issue_number Short description*]
|
||||
# CLOSE|Close #[*issue_number Short description*]
|
||||
[*Long description*]
|
||||
|
||||
|
||||
# New [*Short description*]
|
||||
# NEW|New [*Short description*]
|
||||
[*Long description*]
|
||||
|
||||
42
ChangeLog
42
ChangeLog
@ -17,6 +17,48 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines.
|
||||
|
||||
|
||||
***** ChangeLog for 14.0.3 compared to 14.0.2 *****
|
||||
|
||||
FIX: #18698 Supplier invoice list - "alert" checkbox not working
|
||||
FIX: #18735
|
||||
FIX: #18767 : Member delete
|
||||
FIX: #18854
|
||||
FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds.
|
||||
FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
|
||||
FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it
|
||||
FIX: Accountancy - Option of export popup are inverted
|
||||
FIX: Accountancy - Some correction on export name
|
||||
FIX: Accountancy - Trunc code_journal to 2 in format XIMPORT (Ciel, Sage50)
|
||||
FIX: add warehouse in projects' overview count
|
||||
FIX: autocalculation of the supplier price in main currency.
|
||||
FIX: avoid warning if $categories is an id
|
||||
FIX: Bad use of a forced contact of another company on PDF/ODT documents
|
||||
FIX: Button text on proposal card to create a invoice
|
||||
FIX: calculateCosts of BOM must not be included into fetch
|
||||
FIX: check if greater 0
|
||||
FIX: default language defined for IN country
|
||||
FIX: fetch of product with modulebuilder load too much data
|
||||
FIX: Filter on categories
|
||||
FIX: indentation
|
||||
FIX: init hookmanager after loading $conf values
|
||||
FIX: legal issue on expense report pdf (must also show price without tax)
|
||||
FIX: missing filter status=1 on rss feeds
|
||||
FIX: move fetch_optionnal into $ac_static->fetch()
|
||||
FIX: payment using wrong type in takepos when too many payment mode
|
||||
FIX: Product accountancy affectation with product_perentity activated (PR #18620)
|
||||
FIX: products/services card: hidden extrafields were overridden
|
||||
FIX: Propal list - Problem of pagination on date
|
||||
FIX: selected lines on supplier invoice create
|
||||
FIX: Selection of type "people" for membership must hide the company
|
||||
FIX: select list of orders not complete when field type of company is on
|
||||
FIX: support of localtax on expense report
|
||||
FIX: task time: can't filter by user with pgsql + show error message
|
||||
FIX: task time: keep on using natural_search
|
||||
FIX: Test when date of invoie is in future (pb with TZ and offset)
|
||||
FIX: translation into email for member at membership validation.
|
||||
FIX: unprivileged user can see task associated with a not allowed project
|
||||
FIX: user without permission can set ticket subject
|
||||
|
||||
***** ChangeLog for 14.0.2 compared to 14.0.1 *****
|
||||
|
||||
FIX: #18353 Invoice list translation issue
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
"nnnick/chartjs" : "^2.9",
|
||||
"stripe/stripe-php" : "6.43.1",
|
||||
"maximebf/debugbar" : "1.15.1",
|
||||
"symfony/var-dumper" : "3"
|
||||
"symfony/var-dumper" : "3.2"
|
||||
},
|
||||
"require-dev" : {
|
||||
"php-parallel-lint/php-parallel-lint" : "^0",
|
||||
|
||||
4
composer.lock
generated
4
composer.lock
generated
@ -591,7 +591,7 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v3.0.0",
|
||||
"version": "v3.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
@ -616,7 +616,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
"dev-master": "3.2-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
|
||||
@ -188,7 +188,10 @@ with:
|
||||
with
|
||||
} elseif (($key == '/Index') AND ($v[0] == PDF_TYPE_ARRAY AND count($v[1]) >= 2)) {
|
||||
|
||||
|
||||
* Fix php fatal error on php 8.0 on tcpdi.php
|
||||
while (list($k, $v) = each($value[1])) {
|
||||
with
|
||||
foreach ($value[1] as $k => $v) {
|
||||
|
||||
JSGANTT:
|
||||
--------
|
||||
|
||||
@ -914,7 +914,8 @@ class AccountancyExport
|
||||
print "ValidDate".$separator;
|
||||
print "Montantdevise".$separator;
|
||||
print "Idevise".$separator;
|
||||
print "DateLimitReglmt";
|
||||
print "DateLimitReglmt".$separator;
|
||||
print "NumFacture".$separator;
|
||||
print $end_line;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
@ -927,6 +928,22 @@ class AccountancyExport
|
||||
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Customer invoice
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$invoice = new Facture($db);
|
||||
$invoice->fetch($line->fk_doc);
|
||||
|
||||
$refInvoice = $invoice->ref;
|
||||
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||
// Supplier invoice
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
$invoice = new FactureFournisseur($db);
|
||||
$invoice->fetch($line->fk_doc);
|
||||
|
||||
$refInvoice = $invoice->ref_supplier;
|
||||
}
|
||||
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal . $separator;
|
||||
|
||||
@ -984,6 +1001,9 @@ class AccountancyExport
|
||||
// FEC_suppl:DateLimitReglmt
|
||||
print $date_limit_payment;
|
||||
|
||||
// FEC_suppl:NumFacture
|
||||
print dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1) . $separator;
|
||||
|
||||
print $end_line;
|
||||
}
|
||||
}
|
||||
@ -1020,7 +1040,8 @@ class AccountancyExport
|
||||
print "ValidDate".$separator;
|
||||
print "Montantdevise".$separator;
|
||||
print "Idevise".$separator;
|
||||
print "DateLimitReglmt";
|
||||
print "DateLimitReglmt".$separator;
|
||||
print "NumFacture".$separator;
|
||||
print $end_line;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
@ -1033,6 +1054,22 @@ class AccountancyExport
|
||||
$date_validation = dol_print_date($line->date_validation, '%Y%m%d');
|
||||
$date_limit_payment = dol_print_date($line->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
if ($line->doc_type == 'customer_invoice') {
|
||||
// Customer invoice
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$invoice = new Facture($db);
|
||||
$invoice->fetch($line->fk_doc);
|
||||
|
||||
$refInvoice = $invoice->ref;
|
||||
} elseif ($line->doc_type == 'supplier_invoice') {
|
||||
// Supplier invoice
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
$invoice = new FactureFournisseur($db);
|
||||
$invoice->fetch($line->fk_doc);
|
||||
|
||||
$refInvoice = $invoice->ref_supplier;
|
||||
}
|
||||
|
||||
// FEC:JournalCode
|
||||
print $line->code_journal . $separator;
|
||||
|
||||
@ -1090,6 +1127,10 @@ class AccountancyExport
|
||||
// FEC_suppl:DateLimitReglmt
|
||||
print $date_limit_payment;
|
||||
|
||||
// FEC_suppl:NumFacture
|
||||
print dol_trunc(self::toAnsi($refInvoice), 17, 'right', 'UTF-8', 1) . $separator;
|
||||
|
||||
|
||||
print $end_line;
|
||||
}
|
||||
}
|
||||
|
||||
@ -639,7 +639,7 @@ if ($result) {
|
||||
|
||||
// Vat rate
|
||||
$code_vat_differ='';
|
||||
if ($product_static->tva_tx !== $facture_static_det->tva_tx) {
|
||||
if ($product_static->tva_tx !== $facture_static_det->tva_tx && ! empty($facture_static_det->tva_tx)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||
}
|
||||
print '<td style="'.$code_vat_differ.'" class="right">';
|
||||
|
||||
@ -682,7 +682,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Vat rate
|
||||
if ($objp->vat_tx_l != $objp->vat_tx_p) {
|
||||
if ($objp->vat_tx_l != $objp->vat_tx_p && ! empty($objp->vat_tx_l)) { // Note: having a vat rate of 0 is often the normal case when sells is intra b2b or to export
|
||||
$code_vat_differ = 'font-weight:bold; text-decoration:blink; color:red';
|
||||
}
|
||||
print '<td style="'.$code_vat_differ.'" class="right">';
|
||||
|
||||
@ -2012,7 +2012,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Generated documents
|
||||
$filename = dol_sanitizeFileName($object->ref);
|
||||
//$filename = 'tmp_cards.php';
|
||||
$filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member');
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$genallowed = $user->rights->adherent->lire;
|
||||
@ -2046,14 +2045,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
$MAX = 10;
|
||||
|
||||
$morehtmlright = '<a href="'.DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id.'">';
|
||||
$morehtmlright .= $langs->trans("SeeAll");
|
||||
$morehtmlright .= '</a>';
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/adherents/agenda.php?id='.$object->id);
|
||||
|
||||
// List of actions on element
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
|
||||
$formactions = new FormActions($db);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, $socid, 1, 'listactions', $MAX, '', $morehtmlright);
|
||||
$somethingshown = $formactions->showactions($object, $object->element, $socid, 1, 'listactions', $MAX, '', $morehtmlcenter);
|
||||
|
||||
print '</div></div></div>';
|
||||
}
|
||||
|
||||
@ -39,6 +39,7 @@ $day = dol_print_date($now, '%d');
|
||||
$foruserid = GETPOST('foruserid', 'alphanohtml');
|
||||
$foruserlogin = GETPOST('foruserlogin', 'alphanohtml');
|
||||
$mode = GETPOST('mode', 'aZ09');
|
||||
$modelcard = GETPOST("modelcard", 'aZ09'); // Doc template to use for business cards
|
||||
$model = GETPOST("model", 'aZ09'); // Doc template to use for business cards
|
||||
$modellabel = GETPOST("modellabel", 'aZ09'); // Doc template to use for address sheet
|
||||
$mesg = '';
|
||||
@ -84,10 +85,10 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
||||
$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
|
||||
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
||||
if (is_numeric($foruserid)) {
|
||||
$sql .= " AND d.rowid=".(int) $foruserid;
|
||||
$sql .= " AND d.rowid = ".(int) $foruserid;
|
||||
}
|
||||
if ($foruserlogin) {
|
||||
$sql .= " AND d.login='".$db->escape($foruserlogin)."'";
|
||||
$sql .= " AND d.login = '".$db->escape($foruserlogin)."'";
|
||||
}
|
||||
$sql .= " ORDER BY d.rowid ASC";
|
||||
|
||||
@ -143,7 +144,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
||||
'__MONTH__'=>$month,
|
||||
'__DAY__'=>$day,
|
||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
||||
'__SERVER__'=>"http://".$_SERVER["SERVER_NAME"]."/"
|
||||
'__SERVER__'=>"https://".$_SERVER["SERVER_NAME"]."/"
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $langs, $adherentstatic);
|
||||
|
||||
@ -155,7 +156,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
||||
$textright = make_substitutions($conf->global->ADHERENT_CARD_TEXT_RIGHT, $substitutionarray);
|
||||
|
||||
if (is_numeric($foruserid) || $foruserlogin) {
|
||||
$nb = $_Avery_Labels[$model]['NX'] * $_Avery_Labels[$model]['NY'];
|
||||
$nb = $_Avery_Labels[$model]['NX'] * $_Avery_Labels[$model]['NY']; // $_Avery_Labels is defined into an include
|
||||
if ($nb <= 0) {
|
||||
$nb = 1; // Protection to avoid empty page
|
||||
}
|
||||
@ -209,7 +210,19 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
||||
}
|
||||
|
||||
// Build and output PDF
|
||||
if (empty($mode) || $mode == 'card' || $mode == 'cardlogin') {
|
||||
$outputlangs = $langs;
|
||||
|
||||
if (empty($mode) || $mode == 'card') {
|
||||
if (!count($arrayofmembers)) {
|
||||
$mesg = $langs->trans("ErrorRecordNotFound");
|
||||
}
|
||||
if (empty($modelcard) || $modelcard == '-1') {
|
||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE"));
|
||||
}
|
||||
if (!$mesg) {
|
||||
$result = members_card_pdf_create($db, $arrayofmembers, $modelcard, $outputlangs, '', 'standard', 'tmp_cards');
|
||||
}
|
||||
} elseif ($mode == 'cardlogin') {
|
||||
if (!count($arrayofmembers)) {
|
||||
$mesg = $langs->trans("ErrorRecordNotFound");
|
||||
}
|
||||
@ -217,7 +230,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
|
||||
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DescADHERENT_CARD_TYPE"));
|
||||
}
|
||||
if (!$mesg) {
|
||||
$result = members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs);
|
||||
$result = members_card_pdf_create($db, $arrayofmembers, $model, $outputlangs, '', 'standard', 'tmp_cards_login');
|
||||
}
|
||||
} elseif ($mode == 'label') {
|
||||
if (!count($arrayofmembers)) {
|
||||
@ -275,7 +288,7 @@ foreach (array_keys($_Avery_Labels) as $codecards) {
|
||||
$arrayoflabels[$codecards] = $_Avery_Labels[$codecards]['name'];
|
||||
}
|
||||
asort($arrayoflabels);
|
||||
print $form->selectarray('model', $arrayoflabels, (GETPOST('model') ? GETPOST('model') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print $form->selectarray('modelcard', $arrayoflabels, (GETPOST('modelcard') ? GETPOST('modelcard') : (empty($conf->global->ADHERENT_CARD_TYPE) ? '' : $conf->global->ADHERENT_CARD_TYPE)), 1, 0, 0, '', 0, 0, 0, '', '', 1);
|
||||
print '<br><input type="submit" class="button" value="'.$langs->trans("BuildDoc").'">';
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -2338,12 +2338,12 @@ class Adherent extends CommonObject
|
||||
}
|
||||
} elseif ($status == self::STATUS_RESILIATED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans("MemberStatusResiliated");
|
||||
$labelStatusShort = $langs->trans("MemberStatusResiliatedShort");
|
||||
$labelStatus = $langs->transnoentitiesnoconv("MemberStatusResiliated");
|
||||
$labelStatusShort = $langs->transnoentitiesnoconv("MemberStatusResiliatedShort");
|
||||
} elseif ($status == self::STATUS_EXCLUDED) {
|
||||
$statusType = 'status10';
|
||||
$labelStatus = $langs->trans("MemberStatusExcluded");
|
||||
$labelStatusShort = $langs->trans("MemberStatusExcludedShort");
|
||||
$labelStatus = $langs->transnoentitiesnoconv("MemberStatusExcluded");
|
||||
$labelStatusShort = $langs->transnoentitiesnoconv("MemberStatusExcludedShort");
|
||||
}
|
||||
|
||||
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
|
||||
|
||||
@ -737,10 +737,10 @@ class AdherentType extends CommonObject
|
||||
}
|
||||
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
$this->labelStatus[0] = $langs->trans("ActivityCeased");
|
||||
$this->labelStatus[1] = $langs->trans("InActivity");
|
||||
$this->labelStatusShort[0] = $langs->trans("ActivityCeased");
|
||||
$this->labelStatusShort[1] = $langs->trans("InActivity");
|
||||
$this->labelStatus[0] = $langs->transnoentitiesnoconv("ActivityCeased");
|
||||
$this->labelStatus[1] = $langs->transnoentitiesnoconv("InActivity");
|
||||
$this->labelStatusShort[0] = $langs->transnoentitiesnoconv("ActivityCeased");
|
||||
$this->labelStatusShort[1] = $langs->transnoentitiesnoconv("InActivity");
|
||||
}
|
||||
|
||||
return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status], '', $statusType, $mode);
|
||||
|
||||
@ -161,40 +161,40 @@ if ($mode) {
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($mode == 'memberbycountry') {
|
||||
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
||||
'code'=>$obj->code,
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'code'=>$obj->code,
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
);
|
||||
}
|
||||
if ($mode == 'memberbyregion') { //+
|
||||
$data[] = array(
|
||||
'label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
||||
'label2'=>($obj->label2 ? $obj->label2 : $langs->trans("Unknown")),
|
||||
'label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label :'<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label2'=>($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'),
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
);
|
||||
}
|
||||
if ($mode == 'memberbystate') {
|
||||
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
||||
'label2'=>($obj->label2 ? $obj->label2 : $langs->trans("Unknown")),
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label2'=>($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'),
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
);
|
||||
}
|
||||
if ($mode == 'memberbytown') {
|
||||
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? $langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : $langs->trans("Unknown"))),
|
||||
'label2'=>($obj->label2 ? $obj->label2 : $langs->trans("Unknown")),
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
$data[] = array('label'=>(($obj->code && $langs->trans("Country".$obj->code) != "Country".$obj->code) ? img_picto('', DOL_URL_ROOT.'/theme/common/flags/'.strtolower($obj->code).'.png', '', 1).' '.$langs->trans("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label_en'=>(($obj->code && $langsen->transnoentitiesnoconv("Country".$obj->code) != "Country".$obj->code) ? $langsen->transnoentitiesnoconv("Country".$obj->code) : ($obj->label ? $obj->label : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>')),
|
||||
'label2'=>($obj->label2 ? $obj->label2 : '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>'),
|
||||
'nb'=>$obj->nb,
|
||||
'lastdate'=>$db->jdate($obj->lastdate),
|
||||
'lastsubscriptiondate'=>$db->jdate($obj->lastsubscriptiondate)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
echo "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
echo "<!-- BEGIN PHP TEMPLATE adherents/tpl/linkedopjectblock.tpl.php -->\n";
|
||||
|
||||
global $user;
|
||||
|
||||
@ -35,7 +35,7 @@ $total = 0;
|
||||
foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
echo '<tr class="oddeven">';
|
||||
echo '<td>'.$langs->trans("Subscription").'</td>';
|
||||
echo '<td>'.$objectlink->getNomUrl(1).'</td>';
|
||||
echo '<td class="nowraponall">'.$objectlink->getNomUrl(1).'</td>';
|
||||
echo '<td class="center"></td>';
|
||||
echo '<td class="center">'.dol_print_date($objectlink->dateh, 'day').'</td>';
|
||||
echo '<td class="right">';
|
||||
|
||||
@ -94,7 +94,7 @@ $formcompany = new FormCompany($db);
|
||||
$countrynotdefined = '<span class="error">'.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')</span>';
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountantDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
/**
|
||||
* Edit parameters
|
||||
|
||||
@ -378,7 +378,7 @@ $head = company_admin_prepare_head();
|
||||
print dol_get_fiche_head($head, 'company', $langs->trans("Company"), -1, 'company');
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("CompanyFundationDesc", $langs->transnoentities("Save"))."</span><br>\n";
|
||||
print "<br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
|
||||
/**
|
||||
@ -457,7 +457,7 @@ print '</td></tr>'."\n";
|
||||
// Email
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input class="maxwidth150" name="mail" id="email" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
|
||||
print '<input class="width300" name="mail" id="email" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
|
||||
@ -133,7 +133,6 @@ foreach ($listofnetworks as $key => $value) {
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print $form->buttonsSaveCancel("Save", '');
|
||||
|
||||
|
||||
@ -259,7 +259,7 @@ if ($result) {
|
||||
|
||||
print "\n";
|
||||
|
||||
print '<tr class="oddeven"><td>'.$obj->name.'</td>'."\n";
|
||||
print '<tr class="oddeven" data-checkbox-id="check_'.$i.'"><td>'.$obj->name.'</td>'."\n";
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
|
||||
@ -1457,6 +1457,10 @@ if ($id) {
|
||||
print $tdsoffields;
|
||||
|
||||
|
||||
// Line to enter new values
|
||||
print '<!-- line to add new entry -->';
|
||||
print '<tr class="oddeven nodrag nodrop nohover">';
|
||||
|
||||
$obj = new stdClass();
|
||||
// If data was already input, we define them in obj to populate input fields.
|
||||
if (GETPOST('actionadd')) {
|
||||
@ -1476,9 +1480,6 @@ if ($id) {
|
||||
unset($fieldlist[2]); // Remove field ??? if dictionary Regions
|
||||
}
|
||||
|
||||
// Line to enter new values
|
||||
print '<!-- line to add new entry -->';
|
||||
print '<tr class="oddeven nodrag nodrop nohover">';
|
||||
|
||||
if (empty($reshook)) {
|
||||
fieldList($fieldlist, $obj, $tabname[$id], 'add');
|
||||
|
||||
@ -530,7 +530,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($val['isameasure'])) {
|
||||
if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
|
||||
@ -107,6 +107,8 @@ $head = security_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'audit', '', -1);
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
print getTitleFieldOfList("LogEvents", 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, '')."\n";
|
||||
|
||||
@ -299,6 +299,8 @@ $head = ihm_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, $mode, '', -1, '');
|
||||
|
||||
print '<br>';
|
||||
|
||||
clearstatcache();
|
||||
|
||||
if ($mode == 'template') {
|
||||
@ -451,11 +453,11 @@ if ($mode == 'other') {
|
||||
print '</table>' . "\n";
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
// Other
|
||||
@ -577,9 +579,9 @@ if ($mode == 'login') {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmax45">';
|
||||
print $langs->trans("Parameter");
|
||||
print '</td><td class="titlefieldmiddle">';
|
||||
print '</td><td>';
|
||||
print $langs->trans("Value");
|
||||
print '</td></tr>';
|
||||
|
||||
@ -630,7 +632,6 @@ if ($mode == 'login') {
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input class="button button-save reposition" type="submit" name="submit" value="' . $langs->trans("Save") . '">';
|
||||
print '</div>';
|
||||
|
||||
@ -83,7 +83,8 @@ if (empty($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_INF
|
||||
$setupcompanynotcomplete = 1;
|
||||
}
|
||||
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 '<br><br>'.$langs->trans("SetupDescription3b");
|
||||
print '<br><br>';
|
||||
print $langs->trans("SetupDescription3b");
|
||||
if (!empty($setupcompanynotcomplete)) {
|
||||
$langs->load("errors");
|
||||
$warnpicto = img_warning($langs->trans("WarningMandatorySetupNotComplete"), 'style="padding-right: 6px;"');
|
||||
@ -92,6 +93,7 @@ if (!empty($setupcompanynotcomplete)) {
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
// 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"));
|
||||
|
||||
@ -292,7 +292,7 @@ if ($action == 'edit') {
|
||||
print dol_get_fiche_head($head, 'common', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
|
||||
clearstatcache();
|
||||
@ -543,7 +543,7 @@ if ($action == 'edit') {
|
||||
print dol_get_fiche_head($head, 'common', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
@ -243,7 +243,7 @@ if ($action == 'edit') {
|
||||
print dol_get_fiche_head($head, 'common_emailing', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
|
||||
clearstatcache();
|
||||
@ -412,7 +412,7 @@ if ($action == 'edit') {
|
||||
print dol_get_fiche_head($head, 'common_emailing', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
@ -597,7 +597,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($val['isameasure'])) {
|
||||
if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ if ($action == 'edit') {
|
||||
print dol_get_fiche_head($head, 'common_ticket', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
|
||||
clearstatcache();
|
||||
@ -387,7 +387,7 @@ if ($action == 'edit') {
|
||||
print dol_get_fiche_head($head, 'common_ticket', '', -1);
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("EMailsDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
@ -81,7 +81,7 @@ $head = company_admin_prepare_head();
|
||||
print dol_get_fiche_head($head, 'openinghours', $langs->trans("Company"), -1, 'company');
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("OpeningHoursDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
print "<br><br>\n";
|
||||
|
||||
if (empty($action) || $action == 'edit' || $action == 'updateedit') {
|
||||
/**
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012-2107 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2021 Anthony Berton <bertonanthony@gmail.com>
|
||||
*
|
||||
* 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
|
||||
@ -165,6 +166,10 @@ if ($action == 'update') {
|
||||
dolibarr_set_const($db, "PDF_SHOW_LINK_TO_ONLINE_PAYMENT", GETPOST('PDF_SHOW_LINK_TO_ONLINE_PAYMENT', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if (GETPOSTISSET('PDF_USE_A')) {
|
||||
dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
@ -534,6 +539,14 @@ if ($conf->use_javascript_ajax) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_A").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('PDF_USE_A');
|
||||
} else {
|
||||
print $form->selectyesno('PDF_USE_A', (empty($conf->global->PDF_USE_A) ? 0 : $conf->global->PDF_USE_A), 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -41,17 +41,12 @@ if (!$user->admin) {
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($cancel) {
|
||||
$action = '';
|
||||
}
|
||||
|
||||
if ($action == 'update') {
|
||||
if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) {
|
||||
dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity);
|
||||
@ -62,6 +57,9 @@ if ($action == 'update') {
|
||||
if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) {
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (GETPOSTISSET('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) {
|
||||
dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOST("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
@ -92,45 +90,47 @@ $tooltiptext = '';
|
||||
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print load_fiche_titre($langs->trans("Proposal"), '', '');
|
||||
if (!empty($conf->propal->enabled)) {
|
||||
print load_fiche_titre($langs->trans("Proposal"), '', '');
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE");
|
||||
print ' <span class="opacitymedium">('.$langs->trans("RandomlySelectedIfSeveral").')</span>';
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE);
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE");
|
||||
print ' <span class="opacitymedium">('.$langs->trans("RandomlySelectedIfSeveral").')</span>';
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
/*
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING);
|
||||
}
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
/*
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING);
|
||||
}
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
print $form->buttonsSaveCancel();
|
||||
*/
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
|
||||
@ -95,6 +95,7 @@ $head = security_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'proxy', '', -1);
|
||||
|
||||
print '<br>';
|
||||
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
|
||||
@ -188,8 +188,9 @@ $head = security_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'passwords', '', -1);
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Choix du gestionnaire du generateur de mot de passe
|
||||
// Select manager to generate passwords
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
@ -101,9 +101,9 @@ $head = security_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'file', '', -1);
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Upload options
|
||||
$var = false;
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
@ -153,8 +153,8 @@ if (ini_get('safe_mode') && !empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
|
||||
dol_syslog("safe_mode is on, basedir is ".$basedir.", safe_mode_exec_dir is ".ini_get('safe_mode_exec_dir'), LOG_WARNING);
|
||||
}
|
||||
}
|
||||
print '<input type="text" '.(defined('MAIN_ANTIVIRUS_COMMAND') ? 'disabled ' : '').'name="MAIN_ANTIVIRUS_COMMAND" class="minwidth500imp" value="'.(!empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ?dol_escape_htmltag($conf->global->MAIN_ANTIVIRUS_COMMAND) : '').'">';
|
||||
if (defined('MAIN_ANTIVIRUS_COMMAND')) {
|
||||
print '<input type="text" '.((defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) ? 'disabled ' : '').'name="MAIN_ANTIVIRUS_COMMAND" class="minwidth500imp" value="'.(!empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ?dol_escape_htmltag($conf->global->MAIN_ANTIVIRUS_COMMAND) : '').'">';
|
||||
if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
|
||||
print '<br><span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
@ -94,6 +94,7 @@ $head = security_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'misc', '', -1);
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Other Options
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
@ -644,7 +644,7 @@ print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MainDefaultWarehouse").'</td>';
|
||||
print '<td class="right">';
|
||||
print $formproduct->selectWarehouses($conf->global->MAIN_DEFAULT_WAREHOUSE, 'default_warehouse', '', 1, 0, 0, '', 0, 0, array(), 'left reposition');
|
||||
print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" class="button button-edit small" value="'.$langs->trans("Modify").'">';
|
||||
print "</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -306,7 +306,7 @@ print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').
|
||||
print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1);
|
||||
if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
|
||||
print ' - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
|
||||
if (defined('MAIN_ANTIVIRUS_COMMAND')) {
|
||||
if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
|
||||
print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006-2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2018 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2006-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
*
|
||||
* 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
|
||||
@ -441,6 +441,11 @@ if (in_array($type, array('mysql', 'mysqli'))) {
|
||||
'id' => 'radio_compression_bzip',
|
||||
'label' => $langs->trans("Bzip2")
|
||||
);
|
||||
$compression['zstd'] = array(
|
||||
'function' => 'zstd_compress',
|
||||
'id' => 'radio_compression_zstd',
|
||||
'label' => $langs->trans("Zstd")
|
||||
);
|
||||
$compression['none'] = array(
|
||||
'function' => '',
|
||||
'id' => 'radio_compression_none',
|
||||
|
||||
@ -2,20 +2,21 @@
|
||||
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/tools/export.php
|
||||
|
||||
@ -2,20 +2,21 @@
|
||||
/* Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/admin/tools/export_files.php
|
||||
@ -41,7 +42,7 @@ $file = trim(GETPOST('zipfilename_template', 'alpha'));
|
||||
$compression = GETPOST('compression', 'aZ09');
|
||||
|
||||
$file = dol_sanitizeFileName($file);
|
||||
$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2)$/i', '', $file);
|
||||
$file = preg_replace('/(\.zip|\.tar|\.tgz|\.gz|\.tar\.gz|\.bz2|\.zst)$/i', '', $file);
|
||||
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
@ -137,7 +138,7 @@ if ($compression == 'zip') {
|
||||
$errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir);
|
||||
}
|
||||
}
|
||||
} elseif (in_array($compression, array('gz', 'bz'))) {
|
||||
} elseif (in_array($compression, array('gz', 'bz', 'zstd'))) {
|
||||
$userlogin = ($user->login ? $user->login : 'unknown');
|
||||
|
||||
$outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method
|
||||
@ -156,9 +157,10 @@ if ($compression == 'zip') {
|
||||
} else {
|
||||
if ($compression == 'gz') {
|
||||
$cmd = "gzip -f ".$outputdir."/".$file;
|
||||
}
|
||||
if ($compression == 'bz') {
|
||||
} elseif ($compression == 'bz') {
|
||||
$cmd = "bzip2 -f ".$outputdir."/".$file;
|
||||
} elseif ($compression == 'zstd') {
|
||||
$cmd = "zstd -z -9 -q --rm ".$outputdir."/".$file;
|
||||
}
|
||||
|
||||
$result = $utils->executeCLI($cmd, $outputfile);
|
||||
|
||||
@ -458,7 +458,7 @@ if ($mode == 'searchkey') {
|
||||
}
|
||||
|
||||
//print 'param='.$param.' $_SERVER["PHP_SELF"]='.$_SERVER["PHP_SELF"].' num='.$num.' page='.$page.' nbtotalofrecords='.$nbtotalofrecords." sortfield=".$sortfield." sortorder=".$sortorder;
|
||||
$title = $langs->trans("TranslationKeySearch");
|
||||
$title = $langs->trans("Translation");
|
||||
if ($nbtotalofrecords > 0) {
|
||||
$title .= ' <span class="opacitymedium colorblack paddingleft">('.$nbtotalofrecords.' / '.$nbtotalofrecordswithoutfilters.' - '.$nbtotaloffiles.' '.$langs->trans("Files").')</span>';
|
||||
}
|
||||
|
||||
@ -390,11 +390,11 @@ class Asset extends CommonObject
|
||||
|
||||
$langs->load("contracts");
|
||||
$labelStatus = array();
|
||||
$labelStatus[self::STATUS_DRAFT] = $langs->trans('Disabled');
|
||||
$labelStatus[self::STATUS_VALIDATED] = $langs->trans('Enabled');
|
||||
$labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
||||
$labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
||||
$labelStatusShort = array();
|
||||
$labelStatusShort[self::STATUS_DRAFT] = $langs->trans('Disabled');
|
||||
$labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Enabled');
|
||||
$labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('Disabled');
|
||||
$labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Enabled');
|
||||
|
||||
$statusType = 'status0';
|
||||
if ($status == self::STATUS_VALIDATED) {
|
||||
|
||||
@ -523,7 +523,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($val['isameasure'])) {
|
||||
if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
|
||||
@ -390,7 +390,7 @@ if ($action == 'create') {
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
print '<tbody>';
|
||||
print "</table>\n";
|
||||
|
||||
@ -655,7 +655,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($val['isameasure'])) {
|
||||
if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
print "<!-- BEGIN PHP TEMPLATE bom/tpl/linkedopjectblock.tpl.php -->\n";
|
||||
|
||||
global $user, $db;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
|
||||
@ -154,9 +154,9 @@ if ($action == 'create') {
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
|
||||
print load_fiche_titre($langs->trans("NewBookmark"));
|
||||
print load_fiche_titre($langs->trans("NewBookmark"), '', 'bookmark');
|
||||
|
||||
print dol_get_fiche_head($head, $hselected, $langs->trans("Bookmark"), -1, 'bookmark');
|
||||
print dol_get_fiche_head(null, 'bookmark', '', 0, '');
|
||||
|
||||
print '<table class="border centpercent tableforfieldcreate">';
|
||||
|
||||
@ -164,23 +164,23 @@ if ($action == 'create') {
|
||||
dol_set_focus('#titlebookmark');
|
||||
|
||||
// Url
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat quatrevingtpercent" name="url" value="'.dol_escape_htmltag($url).'"></td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</span></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("UrlOrLink").'</td><td><input class="flat quatrevingtpercent minwidth500" name="url" value="'.dol_escape_htmltag($url).'"></td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("UseAnExternalHttpLinkOrRelativeDolibarrLink").'</span></td></tr>';
|
||||
|
||||
// Target
|
||||
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
|
||||
$liste = array(0=>$langs->trans("ReplaceWindow"), 1=>$langs->trans("OpenANewWindow"));
|
||||
print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1);
|
||||
print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : 1, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
|
||||
print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>';
|
||||
|
||||
// Owner
|
||||
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300');
|
||||
print '</td><td class="hideonsmartphone"> </td></tr>';
|
||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx');
|
||||
print '</td><td class="hideonsmartphone"></td></tr>';
|
||||
|
||||
// Position
|
||||
print '<tr><td>'.$langs->trans("Position").'</td><td>';
|
||||
print '<input class="flat" name="position" size="5" value="'.(GETPOSTISSET("position") ? GETPOST("position", 'int') : $object->position).'">';
|
||||
print '</td><td class="hideonsmartphone"> </td></tr>';
|
||||
print '<input class="flat width50" name="position" value="'.(GETPOSTISSET("position") ? GETPOST("position", 'int') : $object->position).'">';
|
||||
print '</td><td class="hideonsmartphone"></td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
@ -266,7 +266,7 @@ if ($user->rights->categorie->creer) {
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -75,8 +75,13 @@ if ($complete == 'na' || $complete == -2) {
|
||||
$complete = -1;
|
||||
}
|
||||
|
||||
$datep = dol_mktime($fulldayevent ? '00' : $aphour, $fulldayevent ? '00' : $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime($fulldayevent ? '23' : $p2hour, $fulldayevent ? '59' : $p2min, $fulldayevent ? '59' : '0', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
if ($fulldayevent) {
|
||||
$datep = dol_mktime('00', '00', 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
} else {
|
||||
$datep = dol_mktime($aphour, $apmin, 0, GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'));
|
||||
$datef = dol_mktime($p2hour, $p2min, '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'));
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = GETPOST('socid', 'int');
|
||||
@ -1298,7 +1303,7 @@ if ($action == 'create') {
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -1465,18 +1465,18 @@ class ActionComm extends CommonObject
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$labelStatus = $langs->trans('StatusNotApplicable');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('StatusNotApplicable');
|
||||
if ($percent == -1 && !$hidenastatus) {
|
||||
$labelStatus = $langs->trans('StatusNotApplicable');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('StatusNotApplicable');
|
||||
} elseif ($percent == 0) {
|
||||
$labelStatus = $langs->trans('StatusActionToDo').' (0%)';
|
||||
$labelStatus = $langs->transnoentitiesnoconv('StatusActionToDo').' (0%)';
|
||||
} elseif ($percent > 0 && $percent < 100) {
|
||||
$labelStatus = $langs->trans('StatusActionInProcess').' ('.$percent.'%)';
|
||||
$labelStatus = $langs->transnoentitiesnoconv('StatusActionInProcess').' ('.$percent.'%)';
|
||||
} elseif ($percent >= 100) {
|
||||
$labelStatus = $langs->trans('StatusActionDone').' (100%)';
|
||||
$labelStatus = $langs->transnoentitiesnoconv('StatusActionDone').' (100%)';
|
||||
}
|
||||
|
||||
$labelStatusShort = $langs->trans('StatusNotApplicable');
|
||||
$labelStatusShort = $langs->transnoentitiesnoconv('StatusNotApplicable');
|
||||
if ($percent == -1 && !$hidenastatus) {
|
||||
$labelStatusShort = $langs->trans('NA');
|
||||
} elseif ($percent == 0) {
|
||||
|
||||
@ -228,18 +228,18 @@ class ActionCommReminder extends CommonObject
|
||||
// phpcs:enable
|
||||
global $langs;
|
||||
|
||||
$labelStatus = $langs->trans('ToDo');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('ToDo');
|
||||
if ($status == 1) {
|
||||
$labelStatus = $langs->trans('Done');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Done');
|
||||
} elseif ($status == -1) {
|
||||
$labelStatus = $langs->trans('Error');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Error');
|
||||
}
|
||||
|
||||
$labelStatusShort = $langs->trans('ToDo');
|
||||
$labelStatusShort = $langs->transnoentitiesnoconv('ToDo');
|
||||
if ($status == 1) {
|
||||
$labelStatus = $langs->trans('Done');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Done');
|
||||
} elseif ($status == -1) {
|
||||
$labelStatus = $langs->trans('Error');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Error');
|
||||
}
|
||||
|
||||
$statusType = 'status5';
|
||||
|
||||
@ -490,7 +490,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
|
||||
@ -625,22 +625,6 @@ print $nav;
|
||||
//print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid);
|
||||
//print dol_get_fiche_end();
|
||||
|
||||
// Add link to show birthdays
|
||||
/*
|
||||
$link = '';
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
{
|
||||
$newparam=$param; // newparam is for birthday links
|
||||
$newparam=preg_replace('/showbirthday=[0-1]/i','showbirthday='.(empty($showbirthday)?1:0),$newparam);
|
||||
if (! preg_match('/showbirthday=/i',$newparam)) $newparam.='&showbirthday=1';
|
||||
$link='<a href="'.$_SERVER['PHP_SELF'];
|
||||
$link.='?'.$newparam;
|
||||
$link.='">';
|
||||
if (empty($showbirthday)) $link.=$langs->trans("AgendaShowBirthdayEvents");
|
||||
else $link.=$langs->trans("AgendaHideBirthdayEvents");
|
||||
$link.='</a>';
|
||||
}
|
||||
*/
|
||||
|
||||
$s = $newtitle;
|
||||
|
||||
@ -656,7 +640,7 @@ if (empty($reshook)) {
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
|
||||
@ -416,7 +416,7 @@ $massactionbutton = '';
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
|
||||
@ -426,7 +426,7 @@ $massactionbutton = '';
|
||||
$viewmode = '';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoactionview block"');
|
||||
$viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="imgforviewmode pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
|
||||
@ -726,7 +726,7 @@ if ($action == 'create') {
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit');
|
||||
print $object->showOptionals($extrafields, 'create');
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -776,8 +776,8 @@ class Mailing extends CommonObject
|
||||
global $langs;
|
||||
$langs->load("mailing");
|
||||
|
||||
$labelStatus = $langs->trans($this->statuts[$status]);
|
||||
$labelStatusShort = $langs->trans($this->statuts[$status]);
|
||||
$labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]);
|
||||
$labelStatusShort = $langs->transnoentitiesnoconv($this->statuts[$status]);
|
||||
|
||||
$statusType = 'status'.$status;
|
||||
if ($status == 2) {
|
||||
@ -808,16 +808,16 @@ class Mailing extends CommonObject
|
||||
$labelStatus = array();
|
||||
$labelStatusShort = array();
|
||||
|
||||
$labelStatus[-1] = $langs->trans('MailingStatusError');
|
||||
$labelStatus[0] = $langs->trans('MailingStatusNotSent');
|
||||
$labelStatus[1] = $langs->trans('MailingStatusSent');
|
||||
$labelStatus[2] = $langs->trans('MailingStatusRead');
|
||||
$labelStatus[3] = $langs->trans('MailingStatusNotContact');
|
||||
$labelStatusShort[-1] = $langs->trans('MailingStatusError');
|
||||
$labelStatusShort[0] = $langs->trans('MailingStatusNotSent');
|
||||
$labelStatusShort[1] = $langs->trans('MailingStatusSent');
|
||||
$labelStatusShort[2] = $langs->trans('MailingStatusRead');
|
||||
$labelStatusShort[3] = $langs->trans('MailingStatusNotContact');
|
||||
$labelStatus[-1] = $langs->transnoentitiesnoconv('MailingStatusError');
|
||||
$labelStatus[0] = $langs->transnoentitiesnoconv('MailingStatusNotSent');
|
||||
$labelStatus[1] = $langs->transnoentitiesnoconv('MailingStatusSent');
|
||||
$labelStatus[2] = $langs->transnoentitiesnoconv('MailingStatusRead');
|
||||
$labelStatus[3] = $langs->transnoentitiesnoconv('MailingStatusNotContact');
|
||||
$labelStatusShort[-1] = $langs->transnoentitiesnoconv('MailingStatusError');
|
||||
$labelStatusShort[0] = $langs->transnoentitiesnoconv('MailingStatusNotSent');
|
||||
$labelStatusShort[1] = $langs->transnoentitiesnoconv('MailingStatusSent');
|
||||
$labelStatusShort[2] = $langs->transnoentitiesnoconv('MailingStatusRead');
|
||||
$labelStatusShort[3] = $langs->transnoentitiesnoconv('MailingStatusNotContact');
|
||||
|
||||
$statusType = 'status'.$status;
|
||||
if ($status == -1) {
|
||||
|
||||
@ -2079,6 +2079,8 @@ if ($action == 'create') {
|
||||
$absolute_discount = price2num($absolute_discount, 'MT');
|
||||
$absolute_creditnote = price2num($absolute_creditnote, 'MT');
|
||||
|
||||
$caneditfield = ($object->statut != Propal::STATUS_SIGNED && $object->statut != Propal::STATUS_BILLED);
|
||||
|
||||
$thirdparty = $soc;
|
||||
$discount_type = 0;
|
||||
$backtopage = urlencode($_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
@ -2092,12 +2094,12 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DatePropal');
|
||||
print '</td>';
|
||||
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
if ($action != 'editdate' && $usercancreate && $caneditfield) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdate&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetDate'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdate' && $usercancreate) {
|
||||
if ($action == 'editdate' && $usercancreate && $caneditfield) {
|
||||
print '<form name="editdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setdate">';
|
||||
@ -2119,12 +2121,12 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('DateEndPropal');
|
||||
print '</td>';
|
||||
if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
if ($action != 'editecheance' && $usercancreate && $caneditfield) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editecheance&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editecheance' && $usercancreate) {
|
||||
if ($action == 'editecheance' && $usercancreate && $caneditfield) {
|
||||
print '<form name="editecheance" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setecheance">';
|
||||
@ -2149,12 +2151,12 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentConditionsShort');
|
||||
print '</td>';
|
||||
if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
if ($action != 'editconditions' && $usercancreate && $caneditfield) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editconditions&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editconditions' && $usercancreate) {
|
||||
if ($action == 'editconditions' && $usercancreate && $caneditfield) {
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'cond_reglement_id');
|
||||
} else {
|
||||
$form->form_conditions_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->cond_reglement_id, 'none');
|
||||
@ -2168,12 +2170,12 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('PaymentMode');
|
||||
print '</td>';
|
||||
if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
if ($action != 'editmode' && $usercancreate && $caneditfield) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editmode&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefieldcreate">';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editmode' && $usercancreate) {
|
||||
if ($action == 'editmode' && $usercancreate && $caneditfield) {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'mode_reglement_id', 'CRDT', 1, 1);
|
||||
} else {
|
||||
$form->form_modes_reglement($_SERVER['PHP_SELF'].'?id='.$object->id, $object->mode_reglement_id, 'none');
|
||||
@ -2183,26 +2185,27 @@ if ($action == 'create') {
|
||||
// Delivery date
|
||||
$langs->load('deliveries');
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker');
|
||||
print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate && $caneditfield, 'datepicker');
|
||||
print '</td><td class="valuefield">';
|
||||
print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate, 'datepicker');
|
||||
print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->delivery_date, $object, $usercancreate && $caneditfield, 'datepicker');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Delivery delay
|
||||
print '<tr class="fielddeliverydelay"><td>';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('AvailabilityPeriod');
|
||||
if (!empty($conf->commande->enabled)) {
|
||||
print ' ('.$langs->trans('AfterOrder').')';
|
||||
print $form->textwithpicto($langs->trans('AvailabilityPeriod'), $langs->trans('AvailabilityPeriod').' ('.$langs->trans('AfterOrder').')');
|
||||
} else {
|
||||
print $langs->trans('AvailabilityPeriod');
|
||||
}
|
||||
print '</td>';
|
||||
if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
if ($action != 'editavailability' && $usercancreate && $caneditfield) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editavailability&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editavailability' && $usercancreate) {
|
||||
if ($action == 'editavailability' && $usercancreate && $caneditfield) {
|
||||
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1);
|
||||
} else {
|
||||
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1);
|
||||
@ -2217,12 +2220,12 @@ if ($action == 'create') {
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('SendingMethod');
|
||||
print '</td>';
|
||||
if ($action != 'editshippingmethod' && $usercancreate) {
|
||||
if ($action != 'editshippingmethod' && $usercancreate && $caneditfield) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editshippingmethod&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->trans('SetShippingMode'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
if ($action == 'editshippingmethod' && $usercancreate) {
|
||||
if ($action == 'editshippingmethod' && $usercancreate && $caneditfield) {
|
||||
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'shipping_method_id', 1);
|
||||
} else {
|
||||
$form->formSelectShippingMethod($_SERVER['PHP_SELF'].'?id='.$object->id, $object->shipping_method_id, 'none');
|
||||
@ -2254,12 +2257,12 @@ if ($action == 'create') {
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print $langs->trans('Source');
|
||||
print '</td>';
|
||||
if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
|
||||
if ($action != 'editdemandreason' && $usercancreate) {
|
||||
print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=editdemandreason&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).'</a></td>';
|
||||
}
|
||||
print '</tr></table>';
|
||||
print '</td><td class="valuefield">';
|
||||
if ($object->statut == Propal::STATUS_DRAFT && $action == 'editdemandreason' && $usercancreate) {
|
||||
if ($action == 'editdemandreason' && $usercancreate) {
|
||||
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1);
|
||||
} else {
|
||||
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none');
|
||||
@ -2356,13 +2359,13 @@ if ($action == 'create') {
|
||||
if ($totalWeight) {
|
||||
print '<tr><td>'.$langs->trans("CalculatedWeight").'</td>';
|
||||
print '<td class="valuefield">';
|
||||
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no');
|
||||
print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no', 0);
|
||||
print '</td></tr>';
|
||||
}
|
||||
if ($totalVolume) {
|
||||
print '<tr><td>'.$langs->trans("CalculatedVolume").'</td>';
|
||||
print '<td class="valuefield">';
|
||||
print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND) ? $conf->global->MAIN_VOLUME_DEFAULT_ROUND : -1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no');
|
||||
print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, isset($conf->global->MAIN_VOLUME_DEFAULT_ROUND) ? $conf->global->MAIN_VOLUME_DEFAULT_ROUND : -1, isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no', 0);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -2372,7 +2375,7 @@ if ($action == 'create') {
|
||||
print '<table width="100%" class="nobordernopadding"><tr><td>';
|
||||
print $langs->trans('IncotermLabel');
|
||||
print '<td><td class="right">';
|
||||
if ($usercancreate) {
|
||||
if ($action != 'editincoterm' && $usercancreate && $caneditfield) {
|
||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
|
||||
} else {
|
||||
print ' ';
|
||||
@ -2380,10 +2383,10 @@ if ($action == 'create') {
|
||||
print '</td></tr></table>';
|
||||
print '</td>';
|
||||
print '<td class="valuefield">';
|
||||
if ($action != 'editincoterm') {
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
|
||||
} else {
|
||||
if ($action == 'editincoterm' && $usercancreate && $caneditfield) {
|
||||
print $form->select_incoterms((!empty($object->fk_incoterms) ? $object->fk_incoterms : ''), (!empty($object->location_incoterms) ? $object->location_incoterms : ''), $_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
} else {
|
||||
print $form->textwithpicto($object->display_incoterms(), $object->label_incoterms, 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
}
|
||||
|
||||
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
print "<!-- BEGIN PHP TEMPLATE comm/propal/tpl/linkedopjectblock.tpl.php -->\n";
|
||||
|
||||
global $user;
|
||||
|
||||
|
||||
@ -1646,13 +1646,19 @@ if ($action == 'create' && $usercancreate) {
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
|
||||
// Delivery delay
|
||||
print '<tr class="fielddeliverydelay"><td>'.$langs->trans('AvailabilityPeriod').'</td><td>';
|
||||
print img_picto('', 'clock', 'class="pictofixedwidth"');
|
||||
$form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
|
||||
print '</td></tr>';
|
||||
|
||||
// Terms of the settlement
|
||||
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
|
||||
print img_picto('', 'paiment');
|
||||
$form->select_conditions_paiements($cond_reglement_id, 'cond_reglement_id', - 1, 1);
|
||||
print '</td></tr>';
|
||||
|
||||
// Mode de reglement
|
||||
// Payment mode
|
||||
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
|
||||
print img_picto('', 'bank', 'class="pictofixedwidth"');
|
||||
$form->select_types_paiements($mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx');
|
||||
@ -1665,12 +1671,6 @@ if ($action == 'create' && $usercancreate) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Delivery delay
|
||||
print '<tr class="fielddeliverydelay"><td>'.$langs->trans('AvailabilityPeriod').'</td><td>';
|
||||
print img_picto('', 'clock', 'class="pictofixedwidth"');
|
||||
$form->selectAvailabilityDelay($availability_id, 'availability_id', '', 1, 'maxwidth200 widthcentpercentminusx');
|
||||
print '</td></tr>';
|
||||
|
||||
// Shipping Method
|
||||
if (!empty($conf->expedition->enabled)) {
|
||||
print '<tr><td>'.$langs->trans('SendingMethod').'</td><td>';
|
||||
@ -1737,7 +1737,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
}
|
||||
};
|
||||
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
||||
// Template to use by default
|
||||
@ -2148,7 +2148,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
print '</form>';
|
||||
} else {
|
||||
print $object->date ? dol_print_date($object->date, 'day') : ' ';
|
||||
if ($object->hasDelay()) {
|
||||
if ($object->hasDelay() && empty($object->delivery_date)) { // If there is a delivery date planned, warning should be on this date
|
||||
print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning");
|
||||
}
|
||||
}
|
||||
@ -2176,6 +2176,18 @@ if ($action == 'create' && $usercancreate) {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Delivery delay
|
||||
print '<tr class="fielddeliverydelay"><td>';
|
||||
$editenable = $usercancreate;
|
||||
print $form->editfieldkey("AvailabilityPeriod", 'availability', '', $object, $editenable);
|
||||
print '</td><td class="valuefield">';
|
||||
if ($action == 'editavailability') {
|
||||
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1);
|
||||
} else {
|
||||
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Shipping Method
|
||||
if (!empty($conf->expedition->enabled)) {
|
||||
print '<tr><td>';
|
||||
@ -2209,6 +2221,18 @@ if ($action == 'create' && $usercancreate) {
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Source reason (why we have an order)
|
||||
print '<tr><td>';
|
||||
$editenable = $usercancreate;
|
||||
print $form->editfieldkey("Source", 'demandreason', '', $object, $editenable);
|
||||
print '</td><td class="valuefield">';
|
||||
if ($action == 'editdemandreason') {
|
||||
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1);
|
||||
} else {
|
||||
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Terms of payment
|
||||
print '<tr><td>';
|
||||
$editenable = $usercancreate;
|
||||
@ -2274,30 +2298,6 @@ if ($action == 'create' && $usercancreate) {
|
||||
}
|
||||
}
|
||||
|
||||
// Delivery delay
|
||||
print '<tr class="fielddeliverydelay"><td>';
|
||||
$editenable = $usercancreate;
|
||||
print $form->editfieldkey("AvailabilityPeriod", 'availability', '', $object, $editenable);
|
||||
print '</td><td class="valuefield">';
|
||||
if ($action == 'editavailability') {
|
||||
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'availability_id', 1);
|
||||
} else {
|
||||
$form->form_availability($_SERVER['PHP_SELF'].'?id='.$object->id, $object->availability_id, 'none', 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Source reason (why we have an ordrer)
|
||||
print '<tr><td>';
|
||||
$editenable = $usercancreate;
|
||||
print $form->editfieldkey("Channel", 'demandreason', '', $object, $editenable);
|
||||
print '</td><td class="valuefield">';
|
||||
if ($action == 'editdemandreason') {
|
||||
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'demand_reason_id', 1);
|
||||
} else {
|
||||
$form->formInputReason($_SERVER['PHP_SELF'].'?id='.$object->id, $object->demand_reason_id, 'none');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// TODO Order mode (how we receive order). Not yet implemented
|
||||
/*
|
||||
print '<tr><td>';
|
||||
|
||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
print "<!-- BEGIN PHP TEMPLATE commande/tpl/linkedopjectblock.tpl.php -->\n";
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
|
||||
@ -463,7 +463,7 @@ if ($action == 'create') {
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
if (empty($reshook)) {
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -1125,12 +1125,12 @@ class Account extends CommonObject
|
||||
$langs->load('banks');
|
||||
|
||||
if ($status == self::STATUS_OPEN) {
|
||||
$label = $langs->trans("StatusAccountOpened");
|
||||
$labelshort = $langs->trans("StatusAccountOpened");
|
||||
$label = $langs->transnoentitiesnoconv("StatusAccountOpened");
|
||||
$labelshort = $langs->transnoentitiesnoconv("StatusAccountOpened");
|
||||
$statusType = 'status4';
|
||||
} else {
|
||||
$label = $langs->trans("StatusAccountClosed");
|
||||
$labelshort = $langs->trans("StatusAccountClosed");
|
||||
$label = $langs->transnoentitiesnoconv("StatusAccountClosed");
|
||||
$labelshort = $langs->transnoentitiesnoconv("StatusAccountClosed");
|
||||
$statusType = 'status5';
|
||||
}
|
||||
|
||||
|
||||
@ -578,7 +578,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
if (!empty($val['isameasure'])) {
|
||||
if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
|
||||
@ -378,10 +378,10 @@ class CashControl extends CommonObject
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
//$langs->load("mymodule");
|
||||
$this->labelStatus[0] = $langs->trans('Draft');
|
||||
$this->labelStatus[1] = $langs->trans('Closed');
|
||||
$this->labelStatusShort[0] = $langs->trans('Draft');
|
||||
$this->labelStatusShort[1] = $langs->trans('Closed');
|
||||
$this->labelStatus[0] = $langs->transnoentitiesnoconv('Draft');
|
||||
$this->labelStatus[1] = $langs->transnoentitiesnoconv('Closed');
|
||||
$this->labelStatusShort[0] = $langs->transnoentitiesnoconv('Draft');
|
||||
$this->labelStatusShort[1] = $langs->transnoentitiesnoconv('Closed');
|
||||
}
|
||||
|
||||
$statusType = 'status0';
|
||||
|
||||
@ -3651,7 +3651,7 @@ if ($action == 'create') {
|
||||
}
|
||||
};
|
||||
|
||||
print $object->showOptionals($extrafields, 'edit', $parameters);
|
||||
print $object->showOptionals($extrafields, 'create', $parameters);
|
||||
}
|
||||
|
||||
// Template to use by default
|
||||
|
||||
@ -1461,56 +1461,55 @@ class FactureRec extends CommonInvoice
|
||||
global $langs;
|
||||
$langs->load('bills');
|
||||
|
||||
$labelStatus = $langs->trans('Active');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Active');
|
||||
$statusType = 'status0';
|
||||
|
||||
//print "$recur,$status,$mode,$alreadypaid,$type";
|
||||
if ($mode == 0) {
|
||||
$prefix = '';
|
||||
if ($recur) {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$labelStatus = $langs->trans('Active');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Active');
|
||||
}
|
||||
} else {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$labelStatus = $langs->trans("Draft");
|
||||
$labelStatus = $langs->transnoentitiesnoconv("Draft");
|
||||
}
|
||||
}
|
||||
} elseif ($mode == 1) {
|
||||
$prefix = 'Short';
|
||||
if ($recur) {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$labelStatus = $langs->trans('Active');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Active');
|
||||
}
|
||||
} else {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$labelStatus = $langs->trans("Draft");
|
||||
$labelStatus = $langs->transnoentitiesnoconv("Draft");
|
||||
}
|
||||
}
|
||||
} elseif ($mode == 2) {
|
||||
if ($recur) {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$statusType = 'status4';
|
||||
$labelStatus = $langs->trans('Active');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Active');
|
||||
}
|
||||
} else {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$statusType = 'status0';
|
||||
$labelStatus = $langs->trans('Draft');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Draft');
|
||||
}
|
||||
}
|
||||
} elseif ($mode == 3) {
|
||||
@ -1518,18 +1517,18 @@ class FactureRec extends CommonInvoice
|
||||
$prefix = 'Short';
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$statusType = 'status4';
|
||||
$labelStatus = $langs->trans('Active');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Active');
|
||||
}
|
||||
} else {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$statusType = 'status0';
|
||||
$labelStatus = $langs->trans('Draft');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Draft');
|
||||
}
|
||||
}
|
||||
} elseif ($mode == 4) {
|
||||
@ -1537,18 +1536,18 @@ class FactureRec extends CommonInvoice
|
||||
if ($recur) {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$statusType = 'status4';
|
||||
$labelStatus = $langs->trans('Active');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Active');
|
||||
}
|
||||
} else {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$statusType = 'status0';
|
||||
$labelStatus = $langs->trans('Draft');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Draft');
|
||||
}
|
||||
}
|
||||
} elseif ($mode == 5 || $mode == 6) {
|
||||
@ -1559,25 +1558,23 @@ class FactureRec extends CommonInvoice
|
||||
if ($recur) {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$statusType = 'status4';
|
||||
$labelStatus = $langs->trans('Active');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Active');
|
||||
}
|
||||
} else {
|
||||
if ($status == self::STATUS_SUSPENDED) {
|
||||
$statusType = 'status6';
|
||||
$labelStatus = $langs->trans('Disabled');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Disabled');
|
||||
} else {
|
||||
$statusType = 'status0';
|
||||
$labelStatus = $langs->trans('Draft');
|
||||
$labelStatus = $langs->transnoentitiesnoconv('Draft');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($labelStatusShort)) {
|
||||
$labelStatusShort = $labelStatus;
|
||||
}
|
||||
$labelStatusShort = $labelStatus;
|
||||
|
||||
return dolGetStatus($labelStatus, $labelStatusShort, '', $statusType, $mode);
|
||||
}
|
||||
|
||||
@ -110,6 +110,10 @@ if ($mode == 'supplier') {
|
||||
if ($object_status != '' && $object_status >= 0) {
|
||||
$stats->where .= ' AND f.fk_statut IN ('.$db->sanitize($object_status).')';
|
||||
}
|
||||
if (is_array($custcats) && !empty($custcats)) {
|
||||
$stats->from .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_fournisseur as cat ON (f.fk_soc = cat.fk_soc)';
|
||||
$stats->where .= ' AND cat.fk_categorie IN ('.$db->sanitize(implode(',', $custcats)).')';
|
||||
}
|
||||
}
|
||||
|
||||
// Build graphic number of object
|
||||
@ -119,10 +123,10 @@ $data = $stats->getNbByMonthWithPrevYear($endyear, $startyear);
|
||||
|
||||
$filenamenb = $dir."/invoicesnbinyear-".$year.".png";
|
||||
if ($mode == 'customer') {
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesnbinyear-'.$year.'.png';
|
||||
}
|
||||
if ($mode == 'supplier') {
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesnbinyear-'.$year.'.png';
|
||||
$fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicesnbinyear-'.$year.'.png';
|
||||
}
|
||||
|
||||
$px1 = new DolGraph();
|
||||
|
||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedopjectblock.tpl.php -->\n";
|
||||
|
||||
global $user;
|
||||
global $noMoreLinkedObjectBlockAfter;
|
||||
|
||||
@ -24,7 +24,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
}
|
||||
|
||||
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
print "<!-- BEGIN PHP TEMPLATE compta/facture/tpl/linkedopjectblockForRec.tpl.php -->\n";
|
||||
|
||||
|
||||
global $user;
|
||||
|
||||
@ -1005,10 +1005,10 @@ class RemiseCheque extends CommonObject
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
$langs->load('compta');
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('ToValidate');
|
||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->trans('Validated');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('ToValidate');
|
||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans('Validated');
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('ToValidate');
|
||||
$this->labelStatus[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('ToValidate');
|
||||
$this->labelStatusShort[self::STATUS_VALIDATED] = $langs->transnoentitiesnoconv('Validated');
|
||||
}
|
||||
|
||||
$statusType = 'status'.$status;
|
||||
|
||||
@ -2346,16 +2346,16 @@ class BonPrelevement extends CommonObject
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
//$langs->load("mymodule");
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->trans('StatusWaiting');
|
||||
$this->labelStatus[self::STATUS_TRANSFERED] = $langs->trans('StatusTrans');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans('StatusWaiting');
|
||||
$this->labelStatusShort[self::STATUS_TRANSFERED] = $langs->trans('StatusTrans');
|
||||
$this->labelStatus[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('StatusWaiting');
|
||||
$this->labelStatus[self::STATUS_TRANSFERED] = $langs->transnoentitiesnoconv('StatusTrans');
|
||||
$this->labelStatusShort[self::STATUS_DRAFT] = $langs->transnoentitiesnoconv('StatusWaiting');
|
||||
$this->labelStatusShort[self::STATUS_TRANSFERED] = $langs->transnoentitiesnoconv('StatusTrans');
|
||||
if ($this->type == 'bank-transfer') {
|
||||
$this->labelStatus[self::STATUS_DEBITED] = $langs->trans('StatusDebited');
|
||||
$this->labelStatusShort[self::STATUS_DEBITED] = $langs->trans('StatusDebited');
|
||||
$this->labelStatus[self::STATUS_DEBITED] = $langs->transnoentitiesnoconv('StatusDebited');
|
||||
$this->labelStatusShort[self::STATUS_DEBITED] = $langs->transnoentitiesnoconv('StatusDebited');
|
||||
} else {
|
||||
$this->labelStatus[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
|
||||
$this->labelStatusShort[self::STATUS_CREDITED] = $langs->trans('StatusCredited');
|
||||
$this->labelStatus[self::STATUS_CREDITED] = $langs->transnoentitiesnoconv('StatusCredited');
|
||||
$this->labelStatusShort[self::STATUS_CREDITED] = $langs->transnoentitiesnoconv('StatusCredited');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -137,11 +137,11 @@ class LignePrelevement
|
||||
return $langs->trans($this->statuts[$status]);
|
||||
} elseif ($mode == 1) {
|
||||
if ($status == 0) {
|
||||
return img_picto($langs->trans($this->statuts[$status]), 'statut1', 'class="valignmiddle"').' '.$langs->trans($this->statuts[$status]); // Waiting
|
||||
return img_picto($langs->trans($this->statuts[$status]), 'statut1', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->statuts[$status]); // Waiting
|
||||
} elseif ($status == 2) {
|
||||
return img_picto($langs->trans($this->statuts[$status]), 'statut6', 'class="valignmiddle"').' '.$langs->trans($this->statuts[$status]); // Credited
|
||||
return img_picto($langs->trans($this->statuts[$status]), 'statut6', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->statuts[$status]); // Credited
|
||||
} elseif ($status == 3) {
|
||||
return img_picto($langs->trans($this->statuts[$status]), 'statut8', 'class="valignmiddle"').' '.$langs->trans($this->statuts[$status]); // Refused
|
||||
return img_picto($langs->trans($this->statuts[$status]), 'statut8', 'class="valignmiddle"').' '.$langs->transnoentitiesnoconv($this->statuts[$status]); // Refused
|
||||
}
|
||||
} elseif ($mode == 2) {
|
||||
if ($status == 0) {
|
||||
@ -153,11 +153,11 @@ class LignePrelevement
|
||||
}
|
||||
} elseif ($mode == 3) {
|
||||
if ($status == 0) {
|
||||
return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut1', 'class="valignmiddle"');
|
||||
return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut1', 'class="valignmiddle"');
|
||||
} elseif ($status == 2) {
|
||||
return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut6', 'class="valignmiddle"');
|
||||
return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut6', 'class="valignmiddle"');
|
||||
} elseif ($status == 3) {
|
||||
return $langs->trans($this->statuts[$status]).' '.img_picto($langs->trans($this->statuts[$status]), 'statut8', 'class="valignmiddle"');
|
||||
return $langs->trans($this->statuts[$status]).' '.img_picto($langs->transnoentitiesnoconv($this->statuts[$status]), 'statut8', 'class="valignmiddle"');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -220,6 +220,9 @@ if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param.='&limit='.urlencode($limit);
|
||||
}
|
||||
$param = "&id=".urlencode($id);
|
||||
|
||||
// Lines of title fields
|
||||
|
||||
@ -525,15 +525,15 @@ class ChargeSociales extends CommonObject
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
//$langs->load("mymodule");
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans('Unpaid');
|
||||
$this->labelStatus[self::STATUS_PAID] = $langs->trans('Paid');
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid');
|
||||
$this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid');
|
||||
if ($status == self::STATUS_UNPAID && $alreadypaid > 0) {
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
}
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('Unpaid');
|
||||
$this->labelStatusShort[self::STATUS_PAID] = $langs->trans('Paid');
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('Unpaid');
|
||||
$this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('Paid');
|
||||
if ($status == self::STATUS_UNPAID && $alreadypaid > 0) {
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -866,15 +866,15 @@ class Tva extends CommonObject
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
//$langs->load("mymodule");
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans('BillStatusNotPaid');
|
||||
$this->labelStatus[self::STATUS_PAID] = $langs->trans('BillStatusPaid');
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid');
|
||||
$this->labelStatus[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid');
|
||||
if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) {
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
|
||||
$this->labelStatus[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
}
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans('BillStatusNotPaid');
|
||||
$this->labelStatusShort[self::STATUS_PAID] = $langs->trans('BillStatusPaid');
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv('BillStatusNotPaid');
|
||||
$this->labelStatusShort[self::STATUS_PAID] = $langs->transnoentitiesnoconv('BillStatusPaid');
|
||||
if ($status == self::STATUS_UNPAID && $alreadypaid <> 0) {
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->trans("BillStatusStarted");
|
||||
$this->labelStatusShort[self::STATUS_UNPAID] = $langs->transnoentitiesnoconv("BillStatusStarted");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1558,8 +1558,8 @@ class Contact extends CommonObject
|
||||
$statusType = 'status5';
|
||||
}
|
||||
|
||||
$label = $langs->trans($labelStatus[$status]);
|
||||
$labelshort = $langs->trans($labelStatusShort[$status]);
|
||||
$label = $langs->transnoentitiesnoconv($labelStatus[$status]);
|
||||
$labelshort = $langs->transnoentitiesnoconv($labelStatusShort[$status]);
|
||||
|
||||
return dolGetStatus($label, $labelshort, '', $statusType, $mode);
|
||||
}
|
||||
|
||||
@ -2770,20 +2770,20 @@ class ContratLigne extends CommonObjectLine
|
||||
$langs->load("contracts");
|
||||
|
||||
if ($status == self::STATUS_INITIAL) {
|
||||
$labelStatus = $langs->trans("ServiceStatusInitial");
|
||||
$labelStatusShort = $langs->trans("ServiceStatusInitial");
|
||||
$labelStatus = $langs->transnoentities("ServiceStatusInitial");
|
||||
$labelStatusShort = $langs->transnoentities("ServiceStatusInitial");
|
||||
} elseif ($status == self::STATUS_OPEN && $expired == -1) {
|
||||
$labelStatus = $langs->trans("ServiceStatusRunning");
|
||||
$labelStatusShort = $langs->trans("ServiceStatusRunning");
|
||||
$labelStatus = $langs->transnoentities("ServiceStatusRunning");
|
||||
$labelStatusShort = $langs->transnoentities("ServiceStatusRunning");
|
||||
} elseif ($status == self::STATUS_OPEN && $expired == 0) {
|
||||
$labelStatus = $langs->trans("ServiceStatusNotLate");
|
||||
$labelStatusShort = $langs->trans("ServiceStatusNotLateShort");
|
||||
$labelStatus = $langs->transnoentities("ServiceStatusNotLate");
|
||||
$labelStatusShort = $langs->transnoentities("ServiceStatusNotLateShort");
|
||||
} elseif ($status == self::STATUS_OPEN && $expired == 1) {
|
||||
$labelStatus = $langs->trans("ServiceStatusLate");
|
||||
$labelStatusShort = $langs->trans("ServiceStatusLateShort");
|
||||
$labelStatus = $langs->transnoentities("ServiceStatusLate");
|
||||
$labelStatusShort = $langs->transnoentities("ServiceStatusLateShort");
|
||||
} elseif ($status == self::STATUS_CLOSED) {
|
||||
$labelStatus = $langs->trans("ServiceStatusClosed");
|
||||
$labelStatusShort = $langs->trans("ServiceStatusClosed");
|
||||
$labelStatus = $langs->transnoentities("ServiceStatusClosed");
|
||||
$labelStatusShort = $langs->transnoentities("ServiceStatusClosed");
|
||||
}
|
||||
|
||||
$statusType = 'status'.$status;
|
||||
|
||||
@ -23,7 +23,7 @@ if (empty($conf) || !is_object($conf)) {
|
||||
}
|
||||
|
||||
|
||||
print "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
print "<!-- BEGIN PHP TEMPLATE contrat/tpl/linkedopjectblock.tpl.php -->\n";
|
||||
|
||||
|
||||
global $user;
|
||||
|
||||
132
htdocs/core/ajax/onlineSign.php
Normal file
132
htdocs/core/ajax/onlineSign.php
Normal file
@ -0,0 +1,132 @@
|
||||
<?php
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file /htdocs/core/ajax/onlineSign.php
|
||||
* \brief File to make Ajax action on Knowledge Management
|
||||
*/
|
||||
|
||||
if (!defined('NOTOKENRENEWAL')) {
|
||||
define('NOTOKENRENEWAL', '1'); // Disables token renewal
|
||||
}
|
||||
if (!defined('NOREQUIREHTML')) {
|
||||
define('NOREQUIREHTML', '1');
|
||||
}
|
||||
if (!defined('NOREQUIREAJAX')) {
|
||||
define('NOREQUIREAJAX', '1');
|
||||
}
|
||||
if (!defined('NOREQUIRESOC')) {
|
||||
define('NOREQUIRESOC', '1');
|
||||
}
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
define('NOCSRFCHECK', '1');
|
||||
}
|
||||
// Do not check anti CSRF attack test
|
||||
if (!defined('NOREQUIREMENU')) {
|
||||
define('NOREQUIREMENU', '1');
|
||||
}
|
||||
// If there is no need to load and show top and left menu
|
||||
if (!defined("NOLOGIN")) {
|
||||
define("NOLOGIN", '1');
|
||||
}
|
||||
if (!defined('NOIPCHECK')) {
|
||||
define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||
}
|
||||
if (!defined('NOBROWSERNOTIF')) {
|
||||
define('NOBROWSERNOTIF', '1');
|
||||
}
|
||||
include '../../main.inc.php';
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$signature = GETPOST('signaturebase64');
|
||||
$ref = GETPOST('ref', 'aZ09');
|
||||
$mode = GETPOST('mode', 'aZ09');
|
||||
$error = 0;
|
||||
$response = "";
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// None
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
if ($action == "importSignature") {
|
||||
if (!empty($signature) && $signature[0] == "image/png;base64") {
|
||||
$signature = $signature[1];
|
||||
$data = base64_decode($signature);
|
||||
$upload_dir = DOL_DATA_ROOT."/".$mode."/".$ref."/";
|
||||
$date = dol_print_date(dol_now(), "%Y%m%d%H%M%S");
|
||||
$filename = "signatures/".$date."_signature.png";
|
||||
if (!is_dir($upload_dir."signatures/")) {
|
||||
if (!mkdir($upload_dir."signatures/")) {
|
||||
$response ="error mkdir";
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
if (!$error) {
|
||||
$return = file_put_contents($upload_dir.$filename, $data);
|
||||
if ($return == false) {
|
||||
$response = 'error file_put_content';
|
||||
} else {
|
||||
if ($mode == "propale") {
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
|
||||
$object = new Propal($db);
|
||||
$object->fetch(0, $ref);
|
||||
|
||||
$pdf = pdf_getInstance();
|
||||
$pdf->Open();
|
||||
$pdf->AddPage();
|
||||
$pagecount = $pdf->setSourceFile($upload_dir.$ref.".pdf");
|
||||
|
||||
$tppl = $pdf->importPage(1);
|
||||
$pdf->useTemplate($tppl);
|
||||
$pdf->Image($upload_dir.$filename, 129, 239.6, 60, 15);
|
||||
$pdf->Close();
|
||||
$pdf->Output($upload_dir.$ref."_signed-".$date.".pdf", "F");
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."propal";
|
||||
$sql .= " SET fk_statut = ".((int) $object::STATUS_SIGNED).", note_private = '".$object->note_private."', date_signature='".$db->idate(dol_now())."'";
|
||||
$sql .= " WHERE rowid = ".((int) $object->id);
|
||||
|
||||
dol_syslog(__METHOD__, LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
} else {
|
||||
$num = $db->affected_rows($resql);
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
$response = "success";
|
||||
setEventMessage("PropalSigned");
|
||||
} else {
|
||||
$db->rollback();
|
||||
$response = "error sql";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$response = 'error signature_not_found';
|
||||
}
|
||||
}
|
||||
echo $response;
|
||||
@ -162,7 +162,7 @@ class box_actions extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][2] = array(
|
||||
'td' => 'class="center nowraponall"',
|
||||
'text' => dol_print_date($datelimite, "dayhour", 'tzuserrel'),
|
||||
'text' => $datelimite ? dol_print_date($datelimite, "dayhour", 'tzuserrel') : '',
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ class box_graph_nb_ticket_last_x_days extends ModeleBoxes
|
||||
|
||||
|
||||
$param_day = 'DOLUSERCOOKIE_ticket_last_days';
|
||||
if ($_POST[$param_day]) {
|
||||
if (!empty($_POST[$param_day])) {
|
||||
if ($_POST[$param_day] >= 15) {
|
||||
$days = 14;
|
||||
} else {
|
||||
|
||||
@ -161,7 +161,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-dolly" ></i> '.dol_print_date($delivery_date, 'day', 'tzuserrel').'</span>',
|
||||
'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-dolly" ></i> '.($delivery_date ? dol_print_date($delivery_date, 'day', 'tzuserrel') : '').'</span>',
|
||||
'asis' => 1
|
||||
);
|
||||
|
||||
|
||||
@ -3637,22 +3637,19 @@ abstract class CommonObject
|
||||
$origin = 'order_supplier';
|
||||
}
|
||||
|
||||
$targettype = $this->element;
|
||||
|
||||
$parameters = array('sourcetype'=>$sourcetype, 'sourceid'=>$sourceid, 'targettype'=>$targettype, 'targetid'=>$targetid);
|
||||
// Hook for explicitly set the targettype if it must be differtent than $this->element
|
||||
$reshook = $hookmanager->executeHooks('setLinkedObjectSourceTargetType', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (!empty($hookmanager->resArray['targettype'])) $targettype = $hookmanager->resArray['targettype'];
|
||||
if (!empty($hookmanager->resArray['sourcetype'])) $sourcetype = $hookmanager->resArray['sourcetype'];
|
||||
}
|
||||
|
||||
// Elements of the core modules which have `$module` property but may to which we don't want to prefix module part to the element name for finding the linked object in llx_element_element.
|
||||
// It's because an entry for this element may be exist in llx_element_element before this modification (version <=14.2) and ave named only with their element name in fk_source or fk_target.
|
||||
$coremodule = array('knowledgemanagement', 'partnership', 'workstation', 'ticket', 'recruitment', 'eventorganization');
|
||||
// Add module part to target type if object has $module property and isn't in core modules.
|
||||
$targettype = ((!empty($this->module) && ! in_array($this->module, $coremodule)) ? $this->module.'_' : '').$this->element;
|
||||
|
||||
$parameters = array('targettype'=>$targettype);
|
||||
// Hook for explicitly set the targettype if it must be differtent than $this->element
|
||||
$reshook = $hookmanager->executeHooks('setLinkedObjectSourceTargetType', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook > 0) {
|
||||
if (!empty($hookmanager->resArray['targettype'])) $targettype = $hookmanager->resArray['targettype'];
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
$error = 0;
|
||||
|
||||
@ -9059,10 +9056,15 @@ abstract class CommonObject
|
||||
$className = str_replace('@', '', $deleteFromObject[0]);
|
||||
$filePath = $deleteFromObject[1];
|
||||
$columnName = $deleteFromObject[2];
|
||||
$TMoreSQL = array();
|
||||
$more_sql = $deleteFromObject[3];
|
||||
if (!empty($more_sql)) {
|
||||
$TMoreSQL['customsql'] = $more_sql;
|
||||
}
|
||||
if (dol_include_once($filePath)) {
|
||||
$childObject = new $className($this->db);
|
||||
if (method_exists($childObject, 'deleteByParentField')) {
|
||||
$result = $childObject->deleteByParentField($this->id, $columnName);
|
||||
$result = $childObject->deleteByParentField($this->id, $columnName, $TMoreSQL);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
$this->errors[] = $childObject->error;
|
||||
@ -9144,10 +9146,12 @@ abstract class CommonObject
|
||||
*
|
||||
* @param int $parentId Parent Id
|
||||
* @param string $parentField Name of Foreign key parent column
|
||||
* @param array $filter an array filter
|
||||
* @param string $filtermode AND or OR
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @throws Exception
|
||||
*/
|
||||
public function deleteByParentField($parentId = 0, $parentField = '')
|
||||
public function deleteByParentField($parentId = 0, $parentField = '', $filter = array(), $filtermode = "AND")
|
||||
{
|
||||
global $user;
|
||||
|
||||
@ -9160,6 +9164,23 @@ abstract class CommonObject
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " WHERE ".$parentField." = ".(int) $parentId;
|
||||
|
||||
// Manage filters
|
||||
$sqlwhere = array();
|
||||
if (count($filter) > 0) {
|
||||
foreach ($filter as $key => $value) {
|
||||
if ($key == 'customsql') {
|
||||
$sqlwhere[] = $value;
|
||||
} elseif (strpos($value, '%') === false) {
|
||||
$sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")";
|
||||
} else {
|
||||
$sqlwhere[] = $key." LIKE '%".$this->db->escape($value)."%'";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($sqlwhere) > 0) {
|
||||
$sql .= " AND (".implode(" ".$filtermode." ", $sqlwhere).")";
|
||||
}
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->errors[] = $this->db->lasterror();
|
||||
|
||||
@ -836,11 +836,13 @@ class Conf
|
||||
// Note: Set MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL=1 to have a renewal of token at each page call instead of each session (not recommended)
|
||||
}
|
||||
|
||||
if (defined('MAIN_ANTIVIRUS_COMMAND')) {
|
||||
$this->global->MAIN_ANTIVIRUS_COMMAND = constant('MAIN_ANTIVIRUS_COMMAND');
|
||||
}
|
||||
if (defined('MAIN_ANTIVIRUS_PARAM')) {
|
||||
$this->global->MAIN_ANTIVIRUS_PARAM = constant('MAIN_ANTIVIRUS_PARAM');
|
||||
if (!defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
|
||||
if (defined('MAIN_ANTIVIRUS_COMMAND')) {
|
||||
$this->global->MAIN_ANTIVIRUS_COMMAND = constant('MAIN_ANTIVIRUS_COMMAND');
|
||||
}
|
||||
if (defined('MAIN_ANTIVIRUS_PARAM')) {
|
||||
$this->global->MAIN_ANTIVIRUS_PARAM = constant('MAIN_ANTIVIRUS_PARAM');
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($this->global->MAIN_TZUSERINPUTKEY)) {
|
||||
|
||||
@ -1384,7 +1384,7 @@ class DolGraph
|
||||
|
||||
$textoflegend = $arrayofgroupslegend[$i]['legendwithgroup'];
|
||||
} else {
|
||||
$textoflegend = $this->Legend[$i];
|
||||
$textoflegend = !empty($this->Legend[$i]) ? $this->Legend[$i] : '';
|
||||
}
|
||||
|
||||
if ($usecolorvariantforgroupby) {
|
||||
@ -1519,7 +1519,7 @@ class DolGraph
|
||||
if (empty($conf->dol_optimize_smallscreen)) {
|
||||
return ($defaultsize ? $defaultsize : '500');
|
||||
} else {
|
||||
return (empty($_SESSION['dol_screen_width']) ? '280' : ($_SESSION['dol_screen_width'] - 40));
|
||||
return (empty($_SESSION['dol_screenwidth']) ? '280' : ($_SESSION['dol_screenwidth'] - 40));
|
||||
}
|
||||
}
|
||||
if ($direction == 'height') {
|
||||
|
||||
@ -326,9 +326,9 @@ class EmailSenderProfile extends CommonObject
|
||||
global $langs;
|
||||
|
||||
if ($status == 1) {
|
||||
$label = $labelshort = $langs->trans('Enabled');
|
||||
$label = $labelshort = $langs->transnoentitiesnoconv('Enabled');
|
||||
} else {
|
||||
$label = $labelshort = $langs->trans('Disabled');
|
||||
$label = $labelshort = $langs->transnoentitiesnoconv('Disabled');
|
||||
}
|
||||
|
||||
$statusType = 'status'.$status;
|
||||
|
||||
@ -2079,9 +2079,15 @@ class ExtraFields
|
||||
}
|
||||
|
||||
$enabled = 1;
|
||||
if (isset($this->attributes[$object->table_element]['list'][$key])) {
|
||||
$enabled = dol_eval($this->attributes[$object->table_element]['list'][$key], 1);
|
||||
if (isset($this->attributes[$object->table_element]['enabled'][$key])) { // 'enabled' is often a condition on module enabled or not
|
||||
$enabled = dol_eval($this->attributes[$object->table_element]['enabled'][$key], 1);
|
||||
}
|
||||
|
||||
$visibility = 1;
|
||||
if (isset($this->attributes[$object->table_element]['list'][$key])) { // 'list' is option for visibility
|
||||
$visibility = dol_eval($this->attributes[$object->table_element]['list'][$key], 1);
|
||||
}
|
||||
|
||||
$perms = 1;
|
||||
if (isset($this->attributes[$object->table_element]['perms'][$key])) {
|
||||
$perms = dol_eval($this->attributes[$object->table_element]['perms'][$key], 1);
|
||||
@ -2089,6 +2095,9 @@ class ExtraFields
|
||||
if (empty($enabled)) {
|
||||
continue;
|
||||
}
|
||||
if (empty($visibility)) {
|
||||
continue;
|
||||
}
|
||||
if (empty($perms)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -5159,7 +5159,8 @@ class Form
|
||||
print '<input type="hidden" name="action" value="setavailability">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$this->selectAvailabilityDelay($selected, $htmlname, -1, $addempty);
|
||||
print '<input type="submit" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" name="modify" class="button smallpaddingimp" value="'.$langs->trans("Modify").'">';
|
||||
print '<input type="submit" name="cancel" class="button smallpaddingimp" value="'.$langs->trans("Cancel").'">';
|
||||
print '</form>';
|
||||
} else {
|
||||
if ($selected) {
|
||||
@ -9307,11 +9308,12 @@ class Form
|
||||
*
|
||||
* @param string $save_label Alternative label for save button
|
||||
* @param string $cancel_label Alternative label for cancel button
|
||||
* @param array $morefields Add additional buttons between save and cancel
|
||||
* @param array $morebuttons Add additional buttons between save and cancel
|
||||
* @param bool $withoutdiv Option to remove enclosing centered div
|
||||
* @param string $morecss More CSS
|
||||
* @return string Html code with the buttons
|
||||
*/
|
||||
public function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel', $morefields = array(), $withoutdiv = 0)
|
||||
public function buttonsSaveCancel($save_label = 'Save', $cancel_label = 'Cancel', $morebuttons = array(), $withoutdiv = 0, $morecss = '')
|
||||
{
|
||||
global $langs;
|
||||
|
||||
@ -9335,8 +9337,8 @@ class Form
|
||||
|
||||
!empty($save_label) ? $buttons[] = $save : '';
|
||||
|
||||
if (!empty($morefields)) {
|
||||
$buttons[] = $morefields;
|
||||
if (!empty($morebuttons)) {
|
||||
$buttons[] = $morebuttons;
|
||||
}
|
||||
|
||||
!empty($cancel_label) ? $buttons[] = $cancel : '';
|
||||
@ -9345,7 +9347,7 @@ class Form
|
||||
|
||||
foreach ($buttons as $button) {
|
||||
$addclass = empty($button['addclass']) ? '' : $button['addclass'];
|
||||
$retstring .= '<input type="submit" class="button button-'.$button['name'].' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
|
||||
$retstring .= '<input type="submit" class="button button-'.$button['name'].($morecss ? ' '.$morecss : '').' '.$addclass.'" name="'.$button['name'].'" value="'.dol_escape_htmltag($langs->trans($button['label_key'])).'">';
|
||||
}
|
||||
$retstring .= $withoutdiv ? '': '</div>';
|
||||
|
||||
|
||||
@ -792,6 +792,7 @@ class FormMail extends Form
|
||||
if (count($listofpaths)) {
|
||||
foreach ($listofpaths as $key => $val) {
|
||||
$relativepathtofile = substr($val, (strlen(DOL_DATA_ROOT) - strlen($val)));
|
||||
|
||||
if ($conf->entity > 1) {
|
||||
$relativepathtofile = str_replace($conf->entity.'/', '', $relativepathtofile);
|
||||
}
|
||||
@ -802,6 +803,7 @@ class FormMail extends Form
|
||||
$out .= '<div id="attachfile_'.$key.'">';
|
||||
// Preview of attachment
|
||||
$out .= img_mime($listofnames[$key]).' '.$listofnames[$key];
|
||||
|
||||
$out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]);
|
||||
if (!$this->withfilereadonly) {
|
||||
$out .= ' <input type="image" style="border: 0px;" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/delete.png" value="'.($key + 1).'" class="removedfile" id="removedfile_'.$key.'" name="removedfile_'.$key.'" />';
|
||||
|
||||
@ -755,7 +755,23 @@ class FormTicket
|
||||
} elseif ($htmlname!='') {
|
||||
$groupticket=GETPOST($htmlname, 'aZ09');
|
||||
$child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0;
|
||||
|
||||
if (!empty($groupticket)) {
|
||||
$tmpgroupticket = $groupticket;
|
||||
$sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc WHERE ctc.code = '".$this->db->escape($tmpgroupticket)."'";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$selectedgroups[] = $obj->code;
|
||||
while ($obj->fk_parent > 0) {
|
||||
$sql = "SELECT ctc.rowid, ctc.fk_parent, ctc.code FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc WHERE ctc.rowid ='".$this->db->escape($obj->fk_parent)."'";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$selectedgroups[] = $obj->code;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$arrayidused = array();
|
||||
$arrayidusedconcat = array();
|
||||
$arraycodenotparent = array();
|
||||
@ -794,7 +810,11 @@ class FormTicket
|
||||
$grouplabel = $label;
|
||||
|
||||
$isparent = $obj->isparent;
|
||||
$iselected = $groupticket == $obj->code ?'selected':'';
|
||||
if (is_array($selectedgroups)) {
|
||||
$iselected = in_array($obj->code, $selectedgroups) ?'selected':'';
|
||||
} else {
|
||||
$iselected = $groupticket == $obj->code ?'selected':'';
|
||||
}
|
||||
$stringtoprint .= '<option '.$iselected.' class="'.$htmlname.dol_escape_htmltag($grouprowid).'" value="'.dol_escape_htmltag($groupvalue).'" data-html="'.dol_escape_htmltag($grouplabel).'">'.dol_escape_htmltag($grouplabel).'</option>';
|
||||
if ($isparent == 'NOTPARENT') {
|
||||
$arraycodenotparent[] = $groupvalue;
|
||||
@ -868,10 +888,14 @@ class FormTicket
|
||||
if ($isparent == 'NOTPARENT') {
|
||||
$arraycodenotparent[] = $groupvalue;
|
||||
}
|
||||
$iselected = $groupticket == $obj->code ?'selected':'';
|
||||
if (is_array($selectedgroups)) {
|
||||
$iselected = in_array($obj->code, $selectedgroups) ?'selected':'';
|
||||
} else {
|
||||
$iselected = $groupticket == $obj->code ?'selected':'';
|
||||
}
|
||||
$stringtoprint .= '<option '.$iselected.' class="'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'" value="'.dol_escape_htmltag($groupvalue).'" data-html="'.dol_escape_htmltag($grouplabel).'">'.dol_escape_htmltag($grouplabel).'</option>';
|
||||
if (empty($tabscript[$groupcodefather])) {
|
||||
$tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'")[0].value == "'.dol_escape_js($groupcodefather).'"){
|
||||
$tabscript[$groupcodefather] = 'if ($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'").val() == "'.dol_escape_js($groupcodefather).'"){
|
||||
$(".'.$htmlname.'_'.dol_escape_htmltag($fatherid).'_child_'.$levelid.'").show()
|
||||
console.log("We show childs tickets of '.$groupcodefather.' group ticket")
|
||||
}else{
|
||||
@ -889,23 +913,15 @@ class FormTicket
|
||||
|
||||
$stringtoprint .='<script>';
|
||||
$stringtoprint .='arraynotparents = '.json_encode($arraycodenotparent).';'; // when the last visible combo list is number x, this is the array of group
|
||||
$stringtoprint .='if (arraynotparents.includes($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'")[0].value)){
|
||||
$stringtoprint .='if (arraynotparents.includes($("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid-1:'').'").val())){
|
||||
console.log("'.$htmlname.'_child_'.$levelid.'")
|
||||
if($("#'.$htmlname.'_child_'.$levelid.'")[0].value == "" && ($("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")>'.$child_id.')){
|
||||
if($("#'.$htmlname.'_child_'.$levelid.'").val() == "" && ($("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")>'.$child_id.')){
|
||||
$("#'.$htmlname.'_child_'.$levelid.'").hide();
|
||||
console.log("We hide '.$htmlname.'_child_'.$levelid.' input")
|
||||
}else if(($("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")!=0) && ($("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")<'.$child_id.')){
|
||||
$("#'.$htmlname.'_child_'.$levelid.'").attr("disabled",true);
|
||||
console.log("We disable '.$htmlname.'_child_'.$levelid.' input");
|
||||
}else{
|
||||
$("#'.$htmlname.'_child_'.$levelid.'").attr("disabled",true);
|
||||
$("#ticketcategory_select_child_id")[0].value = $("#'.$htmlname.'_child_'.$levelid.'").attr("child_id")
|
||||
$("#ticketcategory_select")[0].value = $("#'.$htmlname.'_child_'.$levelid.'")[0].value;
|
||||
console.log("We disable '.$htmlname.'_child_'.$levelid.' input and reload hidden input");
|
||||
}
|
||||
if(arraynotparents.includes("'.$groupticket.'") && '.$child_id.' == 0){
|
||||
$("#ticketcategory_select_child_id")[0].value = $("#'.$htmlname.'").attr("child_id")
|
||||
$("#ticketcategory_select")[0].value = $("#'.$htmlname.'")[0].value;
|
||||
$("#ticketcategory_select_child_id").val($("#'.$htmlname.'").attr("child_id"))
|
||||
$("#ticketcategory_select").val($("#'.$htmlname.'").val()) ;
|
||||
console.log("We choose '.$htmlname.' input and reload hidden input");
|
||||
}
|
||||
}
|
||||
@ -913,19 +929,19 @@ class FormTicket
|
||||
child_id = $("#'.$htmlname.($levelid > 1 ?'_child_'.$levelid:'').'").attr("child_id");
|
||||
|
||||
/* Change of value to select this value*/
|
||||
if (arraynotparents.includes(this.value) || $(this).attr("child_id") == '.$use_multilevel.') {
|
||||
$("#ticketcategory_select")[0].value = this.value;
|
||||
$("#ticketcategory_select_child_id")[0].value = $(this).attr("child_id");
|
||||
console.log("We choose to select "+ this.value);
|
||||
if (arraynotparents.includes($(this).val()) || $(this).attr("child_id") == '.$use_multilevel.') {
|
||||
$("#ticketcategory_select").val($(this).val());
|
||||
$("#ticketcategory_select_child_id").val($(this).attr("child_id")) ;
|
||||
console.log("We choose to select "+ $(this).val());
|
||||
}else{
|
||||
if ($("#'.$htmlname.'_child_'.$levelid.' option").length <= 1) {
|
||||
$("#ticketcategory_select")[0].value = this.value;
|
||||
$("#ticketcategory_select_child_id")[0].value = $(this).attr("child_id");
|
||||
console.log("We choose to select "+ this.value + " and next combo has no item, so we keep this selection");
|
||||
$("#ticketcategory_select").val($(this).val());
|
||||
$("#ticketcategory_select_child_id").val($(this).attr("child_id"));
|
||||
console.log("We choose to select "+ $(this).val() + " and next combo has no item, so we keep this selection");
|
||||
} else {
|
||||
console.log("We choose to select "+ this.value + " but next combo has some item, so we clean selected item");
|
||||
$("#ticketcategory_select")[0].value = "";
|
||||
$("#ticketcategory_select_child_id")[0].value = "";
|
||||
console.log("We choose to select "+ $(this).val() + " but next combo has some item, so we clean selected item");
|
||||
$("#ticketcategory_select").val("");
|
||||
$("#ticketcategory_select_child_id").val("");
|
||||
}
|
||||
}
|
||||
|
||||
@ -942,7 +958,7 @@ class FormTicket
|
||||
|
||||
/* Now we enable the next combo */
|
||||
$("#'.$htmlname.'_child_'.$levelid.'").val("");
|
||||
if (!arraynotparents.includes(this.value) && $("#'.$htmlname.'_child_'.$levelid.' option").length > 1) {
|
||||
if (!arraynotparents.includes($(this).val()) && $("#'.$htmlname.'_child_'.$levelid.' option").length > 1) {
|
||||
console.log($("#'.$htmlname.'_child_'.$levelid.' option").length);
|
||||
$("#'.$htmlname.'_child_'.$levelid.'").show()
|
||||
} else {
|
||||
@ -958,9 +974,9 @@ class FormTicket
|
||||
}
|
||||
$stringtoprint .='<script>';
|
||||
$stringtoprint .='$("#'.$htmlname.'_child_'.$use_multilevel.'").change(function() {
|
||||
$("#ticketcategory_select")[0].value = this.value;
|
||||
$("#ticketcategory_select_child_id")[0].value = $(this).attr("child_id");
|
||||
console.log($("#ticketcategory_select")[0].value);
|
||||
$("#ticketcategory_select").val($(this).val());
|
||||
$("#ticketcategory_select_child_id").val($(this).attr("child_id"));
|
||||
console.log($("#ticketcategory_select").val());
|
||||
})';
|
||||
$stringtoprint .='</script>';
|
||||
$stringtoprint .= ajax_combobox($htmlname);
|
||||
@ -1232,7 +1248,7 @@ class FormTicket
|
||||
// External users can't send message email
|
||||
if ($user->rights->ticket->write && !$user->socid) {
|
||||
print '<tr><td></td><td>';
|
||||
$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : '');
|
||||
$checkbox_selected = (GETPOST('send_email') == "1" ? ' checked' : ($conf->global->TICKETS_MESSAGE_FORCE_MAIL?'checked':''));
|
||||
print '<input type="checkbox" name="send_email" value="1" id="send_msg_email" '.$checkbox_selected.'/> ';
|
||||
print '<label for="send_msg_email">'.$langs->trans('SendMessageByEmail').'</label>';
|
||||
print '</td></tr>';
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2016 Destailleur Laurent <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
*
|
||||
* 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
|
||||
@ -202,7 +203,7 @@ class Utils
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
// Check compression parameter
|
||||
if (!in_array($compression, array('none', 'gz', 'bz', 'zip'))) {
|
||||
if (!in_array($compression, array('none', 'gz', 'bz', 'zip', 'zstd'))) {
|
||||
$langs->load("errors");
|
||||
$this->error = $langs->transnoentitiesnoconv("ErrorBadValueForParameter", $compression, "Compression");
|
||||
return -1;
|
||||
@ -248,9 +249,10 @@ class Utils
|
||||
$compression = $compression ? $compression : 'none';
|
||||
if ($compression == 'gz') {
|
||||
$outputfile .= '.gz';
|
||||
}
|
||||
if ($compression == 'bz') {
|
||||
} elseif ($compression == 'bz') {
|
||||
$outputfile .= '.bz2';
|
||||
} elseif ($compression == 'zstd') {
|
||||
$outputfile .= '.zst';
|
||||
}
|
||||
$outputerror = $outputfile.'.err';
|
||||
dol_mkdir($conf->admin->dir_output.'/backup');
|
||||
@ -337,12 +339,12 @@ class Utils
|
||||
$fullcommandclear = $command." ".$paramclear." 2>&1";
|
||||
if ($compression == 'none') {
|
||||
$handle = fopen($outputfile, 'w');
|
||||
}
|
||||
if ($compression == 'gz') {
|
||||
} elseif ($compression == 'gz') {
|
||||
$handle = gzopen($outputfile, 'w');
|
||||
}
|
||||
if ($compression == 'bz') {
|
||||
} elseif ($compression == 'bz') {
|
||||
$handle = bzopen($outputfile, 'w');
|
||||
} elseif ($compression == 'zstd') {
|
||||
$handle = fopen($outputfile, 'w');
|
||||
}
|
||||
|
||||
$ok = 0;
|
||||
@ -408,12 +410,12 @@ class Utils
|
||||
|
||||
if ($compression == 'none') {
|
||||
fclose($handle);
|
||||
}
|
||||
if ($compression == 'gz') {
|
||||
} elseif ($compression == 'gz') {
|
||||
gzclose($handle);
|
||||
}
|
||||
if ($compression == 'bz') {
|
||||
} elseif ($compression == 'bz') {
|
||||
bzclose($handle);
|
||||
} elseif ($compression == 'zstd') {
|
||||
fclose($handle);
|
||||
}
|
||||
|
||||
if (!empty($conf->global->MAIN_UMASK)) {
|
||||
@ -428,12 +430,12 @@ class Utils
|
||||
// Get errorstring
|
||||
if ($compression == 'none') {
|
||||
$handle = fopen($outputfile, 'r');
|
||||
}
|
||||
if ($compression == 'gz') {
|
||||
} elseif ($compression == 'gz') {
|
||||
$handle = gzopen($outputfile, 'r');
|
||||
}
|
||||
if ($compression == 'bz') {
|
||||
} elseif ($compression == 'bz') {
|
||||
$handle = bzopen($outputfile, 'r');
|
||||
} elseif ($compression == 'zstd') {
|
||||
$handle = fopen($outputfile, 'r');
|
||||
}
|
||||
if ($handle) {
|
||||
// Get 2048 first chars of error message.
|
||||
@ -443,12 +445,12 @@ class Utils
|
||||
// Close file
|
||||
if ($compression == 'none') {
|
||||
fclose($handle);
|
||||
}
|
||||
if ($compression == 'gz') {
|
||||
} elseif ($compression == 'gz') {
|
||||
gzclose($handle);
|
||||
}
|
||||
if ($compression == 'bz') {
|
||||
} elseif ($compression == 'bz') {
|
||||
bzclose($handle);
|
||||
} elseif ($compression == 'zstd') {
|
||||
fclose($handle);
|
||||
}
|
||||
if ($ok && preg_match('/^-- (MySql|MariaDB)/i', $errormsg)) { // No error
|
||||
$errormsg = '';
|
||||
|
||||
@ -834,7 +834,7 @@ function translation_prepare_head()
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/admin/translation.php?mode=overwrite";
|
||||
$head[$h][1] = $langs->trans("TranslationOverwriteKey").'<span class="fa fa-plus-circle valignmiddle paddingleft"></span>';
|
||||
$head[$h][1] = '<span class="valignmiddle">'.$langs->trans("TranslationOverwriteKey").'</span><span class="fa fa-plus-circle valignmiddle paddingleft"></span>';
|
||||
$head[$h][2] = 'overwrite';
|
||||
$h++;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2012-2015 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012-2021 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2012-2016 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
@ -1971,6 +1971,9 @@ function dol_compress_file($inputfile, $outputfile, $mode = "gz", &$errorstring
|
||||
} elseif ($mode == 'bz') {
|
||||
$foundhandler = 1;
|
||||
$compressdata = bzcompress($data, 9);
|
||||
} elseif ($mode == 'zstd') {
|
||||
$foundhandler = 1;
|
||||
$compressdata = zstd_compress($data, 9);
|
||||
} elseif ($mode == 'zip') {
|
||||
if (class_exists('ZipArchive') && !empty($conf->global->MAIN_USE_ZIPARCHIVE_FOR_ZIP_COMPRESS)) {
|
||||
$foundhandler = 1;
|
||||
@ -2719,13 +2722,14 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
||||
if ($fuser->rights->expedition->{$lire} || preg_match('/^specimen/i', $original_file)) {
|
||||
$accessallowed = 1;
|
||||
}
|
||||
$original_file = $conf->expedition->dir_output."/sending/".$original_file;
|
||||
$original_file = $conf->expedition->dir_output."/".(strpos('sending/', $original_file) === 0 ? '' : 'sending/').$original_file;
|
||||
//$original_file = $conf->expedition->dir_output."/".$original_file;
|
||||
} elseif (($modulepart == 'livraison' || $modulepart == 'delivery') && !empty($conf->expedition->dir_output)) {
|
||||
// Delivery Note Wrapping
|
||||
if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file)) {
|
||||
$accessallowed = 1;
|
||||
}
|
||||
$original_file = $conf->expedition->dir_output."/receipt/".$original_file;
|
||||
$original_file = $conf->expedition->dir_output."/".(strpos('receipt/', $original_file) === 0 ? '' : 'receipt/').$original_file;
|
||||
} elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) {
|
||||
// Wrapping pour les actions
|
||||
if ($fuser->rights->agenda->myactions->{$read} || preg_match('/^specimen/i', $original_file)) {
|
||||
|
||||
@ -1071,7 +1071,7 @@ function dol_size($size, $type = '')
|
||||
|
||||
/**
|
||||
* Clean a string to use it as a file name.
|
||||
* Replace also '--' and ' -' strings, they are used for parameters separation.
|
||||
* Replace also '--' and ' -' strings, they are used for parameters separation (Note: ' - ' is allowed).
|
||||
*
|
||||
* @param string $str String to clean
|
||||
* @param string $newstr String to replace bad chars with.
|
||||
@ -1089,13 +1089,13 @@ function dol_sanitizeFileName($str, $newstr = '_', $unaccent = 1)
|
||||
$filesystem_forbidden_chars = array('<', '>', '/', '\\', '?', '*', '|', '"', ':', '°', '$', ';');
|
||||
$tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars);
|
||||
$tmp = preg_replace('/\-\-+/', '_', $tmp);
|
||||
$tmp = preg_replace('/\s+\-/', ' _', $tmp);
|
||||
$tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp);
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clean a string to use it as a path name.
|
||||
* Replace also '--' and ' -' strings, they are used for parameters separation.
|
||||
* Replace also '--' and ' -' strings, they are used for parameters separation (Note: ' - ' is allowed).
|
||||
*
|
||||
* @param string $str String to clean
|
||||
* @param string $newstr String to replace bad chars with
|
||||
@ -1112,7 +1112,7 @@ function dol_sanitizePathName($str, $newstr = '_', $unaccent = 1)
|
||||
$filesystem_forbidden_chars = array('<', '>', '?', '*', '|', '"', '°', '$', ';');
|
||||
$tmp = dol_string_nospecial($unaccent ? dol_string_unaccent($str) : $str, $newstr, $filesystem_forbidden_chars);
|
||||
$tmp = preg_replace('/\-\-+/', '_', $tmp);
|
||||
$tmp = preg_replace('/\s+\-/', ' _', $tmp);
|
||||
$tmp = preg_replace('/\s+\-([^\s])/', ' _$1', $tmp);
|
||||
return $tmp;
|
||||
}
|
||||
|
||||
@ -1613,7 +1613,7 @@ function dol_fiche_head($links = array(), $active = '0', $title = '', $notab = 0
|
||||
* @param string $picto Add a picto on tab title
|
||||
* @param int $pictoisfullpath If 1, image path is a full path. If you set this to 1, you can use url returned by dol_buildpath('/mymodyle/img/myimg.png',1) for $picto.
|
||||
* @param string $morehtmlright Add more html content on right of tabs title
|
||||
* @param string $morecss More Css
|
||||
* @param string $morecss More CSS on the link <a>
|
||||
* @param int $limittoshow Limit number of tabs to show. Use 0 to use automatic default value.
|
||||
* @param string $moretabssuffix A suffix to use when you have several dol_get_fiche_head() in same page
|
||||
* @return string
|
||||
@ -2305,8 +2305,17 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
} elseif ($tzoutput == 'tzuser' || $tzoutput == 'tzuserrel') {
|
||||
$to_gmt = true;
|
||||
$offsettzstring = (empty($_SESSION['dol_tz_string']) ? 'UTC' : $_SESSION['dol_tz_string']); // Example 'Europe/Berlin' or 'Indian/Reunion'
|
||||
$offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore
|
||||
$offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore
|
||||
|
||||
if (class_exists('DateTimeZone')) {
|
||||
$user_date_tz = new DateTimeZone($offsettzstring);
|
||||
$user_dt = new DateTime();
|
||||
$user_dt->setTimezone($user_date_tz);
|
||||
$user_dt->setTimestamp($tzoutput == 'tzuser' ? dol_now() : $time);
|
||||
$offsettz = $user_dt->getOffset();
|
||||
} else { // old method (The 'tzuser' was processed like the 'tzuserrel')
|
||||
$offsettz = (empty($_SESSION['dol_tz']) ? 0 : $_SESSION['dol_tz']) * 60 * 60; // Will not be used anymore
|
||||
$offsetdst = (empty($_SESSION['dol_dst']) ? 0 : $_SESSION['dol_dst']) * 60 * 60; // Will not be used anymore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5409,15 +5418,16 @@ function price2num($amount, $rounding = '', $option = 0)
|
||||
/**
|
||||
* Output a dimension with best unit
|
||||
*
|
||||
* @param float $dimension Dimension
|
||||
* @param int $unit Unit scale of dimension (Example: 0=kg, -3=g, -6=mg, 98=ounce, 99=pound, ...)
|
||||
* @param string $type 'weight', 'volume', ...
|
||||
* @param Translate $outputlangs Translate language object
|
||||
* @param int $round -1 = non rounding, x = number of decimal
|
||||
* @param float $dimension Dimension
|
||||
* @param int $unit Unit scale of dimension (Example: 0=kg, -3=g, -6=mg, 98=ounce, 99=pound, ...)
|
||||
* @param string $type 'weight', 'volume', ...
|
||||
* @param Translate $outputlangs Translate language object
|
||||
* @param int $round -1 = non rounding, x = number of decimal
|
||||
* @param string $forceunitoutput 'no' or numeric (-3, -6, ...) compared to $unit (In most case, this value is value defined into $conf->global->MAIN_WEIGHT_DEFAULT_UNIT)
|
||||
* @return string String to show dimensions
|
||||
* @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated.
|
||||
* @return string String to show dimensions
|
||||
*/
|
||||
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round = -1, $forceunitoutput = 'no')
|
||||
function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round = -1, $forceunitoutput = 'no', $use_short_label = 0)
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
||||
|
||||
@ -5447,7 +5457,8 @@ function showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round
|
||||
$unit = $forceunitoutput;
|
||||
}*/
|
||||
|
||||
$ret = price($dimension, 0, $outputlangs, 0, 0, $round).' '.measuringUnitString(0, $type, $unit);
|
||||
$ret = price($dimension, 0, $outputlangs, 0, 0, $round);
|
||||
$ret .= ' '.measuringUnitString(0, $type, $unit, $use_short_label, $outputlangs);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
@ -6627,7 +6638,8 @@ function dol_htmlentitiesbr_decode($stringtodecode, $pagecodeto = 'UTF-8')
|
||||
*/
|
||||
function dol_htmlcleanlastbr($stringtodecode)
|
||||
{
|
||||
$ret = preg_replace('/(<br>|<br(\s[\sa-zA-Z_="]*)?\/?>|'."\n".'|'."\r".')+$/i', "", $stringtodecode);
|
||||
$ret = preg_replace('/ $/i', "", $stringtodecode); // Because wysiwyg editor may add a at end of last line
|
||||
$ret = preg_replace('/(<br>|<br(\s[\sa-zA-Z_="]*)?\/?>|'."\n".'|'."\r".')+$/i', "", $ret);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@ -9099,11 +9111,12 @@ function getAdvancedPreviewUrl($modulepart, $relativepath, $alldata = 0, $param
|
||||
/**
|
||||
* Make content of an input box selected when we click into input field.
|
||||
*
|
||||
* @param string $htmlname Id of html object ('#idvalue' or '.classvalue')
|
||||
* @param string $addlink Add a 'link to' after
|
||||
* @param string $htmlname Id of html object ('#idvalue' or '.classvalue')
|
||||
* @param string $addlink Add a 'link to' after
|
||||
* @param string $textonlink Text to show on link or 'image'
|
||||
* @return string
|
||||
*/
|
||||
function ajax_autoselect($htmlname, $addlink = '')
|
||||
function ajax_autoselect($htmlname, $addlink = '', $textonlink = 'Link')
|
||||
{
|
||||
global $langs;
|
||||
$out = '<script>
|
||||
@ -9112,7 +9125,11 @@ function ajax_autoselect($htmlname, $addlink = '')
|
||||
});
|
||||
</script>';
|
||||
if ($addlink) {
|
||||
$out .= ' <a href="'.$addlink.'" target="_blank">'.$langs->trans("Link").'</a>';
|
||||
if ($textonlink === 'image') {
|
||||
$out .= ' <a href="'.$addlink.'" target="_blank">'.img_picto('', 'globe').'</a>';
|
||||
} else {
|
||||
$out .= ' <a href="'.$addlink.'" target="_blank">'.$langs->trans("Link").'</a>';
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -518,8 +518,12 @@ function getNumberInvoicesPieChart($mode)
|
||||
$dataseries[$i]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30);
|
||||
$i++;
|
||||
}
|
||||
foreach ($dataseries[0] as $key=>$value) {
|
||||
$total += $value;
|
||||
if (!empty($dataseries[0])) {
|
||||
foreach ($dataseries[0] as $key => $value) {
|
||||
if (is_numeric($value)) {
|
||||
$total += $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
$legend = array(
|
||||
$langs->trans('InvoiceLate30Days'),
|
||||
|
||||
@ -99,7 +99,7 @@ function bankline_prepare_head($id)
|
||||
*/
|
||||
function payment_supplier_prepare_head(Paiement $object)
|
||||
{
|
||||
global $langs, $conf;
|
||||
global $db, $langs, $conf;
|
||||
|
||||
$h = 0;
|
||||
$head = array();
|
||||
@ -120,6 +120,19 @@ function payment_supplier_prepare_head(Paiement $object)
|
||||
$head[$h][2] = 'info';
|
||||
$h++;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->fournisseur->payment->dir_output.'/'.$object->ref;
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/document.php?id='.$object->id;
|
||||
$head[$h][1] = $langs->trans('Documents');
|
||||
if (($nbFiles + $nbLinks) > 0) {
|
||||
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.($nbFiles + $nbLinks).'</span>';
|
||||
}
|
||||
$head[$h][2] = 'documents';
|
||||
$h++;
|
||||
|
||||
complete_head_from_modules($conf, $langs, $object, $head, $h, 'payment_supplier', 'remove');
|
||||
|
||||
return $head;
|
||||
@ -173,8 +186,9 @@ function showOnlinePaymentUrl($type, $ref)
|
||||
|
||||
$out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'</span><br>';
|
||||
$url = getOnlinePaymentUrl(0, $type, $ref);
|
||||
$out .= '<div class="urllink"><input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$url.'">';
|
||||
$out .= '<a href="'.$url.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a></div>';
|
||||
$out .= '<div class="urllink"><input type="text" id="onlinepaymenturl" class="quatrevingtpercentminusx" value="'.$url.'">';
|
||||
$out .= '<a class="" href="'.$url.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
|
||||
$out .= '</div>';
|
||||
$out .= ajax_autoselect("onlinepaymenturl", 0);
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -177,8 +177,8 @@ function pdf_getInstance($format = '', $metric = 'mm', $pagetype = 'P')
|
||||
//$metric=$arrayformat['unit'];
|
||||
|
||||
$pdfa = false; // PDF-1.3
|
||||
if (!empty($conf->global->PDF_USE_1A)) {
|
||||
$pdfa = true; // PDF1/A
|
||||
if (!empty($conf->global->PDF_USE_A)) {
|
||||
$pdfa = $conf->global->PDF_USE_A; // PDF/A-1 ou PDF/A-3
|
||||
}
|
||||
|
||||
if (class_exists('TCPDI')) {
|
||||
@ -2264,7 +2264,7 @@ function pdf_getTotalQty($object, $type, $outputlangs)
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
* @return array Linked objects
|
||||
*/
|
||||
function pdf_getLinkedObjects($object, $outputlangs)
|
||||
function pdf_getLinkedObjects(&$object, $outputlangs)
|
||||
{
|
||||
global $db, $hookmanager;
|
||||
|
||||
@ -2286,7 +2286,17 @@ function pdf_getLinkedObjects($object, $outputlangs)
|
||||
}
|
||||
} elseif ($objecttype == 'commande' || $objecttype == 'supplier_order') {
|
||||
$outputlangs->load('orders');
|
||||
foreach ($objects as $elementobject) {
|
||||
|
||||
if (count($objects) > 1) {
|
||||
$object->note_public .= dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefOrder").' : <br>');
|
||||
foreach ($objects as $elementobject) {
|
||||
$object->note_public .= dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '').' ');
|
||||
$object->note_public .= dol_concatdesc($object->note_public, $outputlangs->transnoentities("OrderDate").' : ');
|
||||
$object->note_public .= dol_concatdesc($object->note_public, dol_print_date($elementobject->date, 'day', '', $outputlangs));
|
||||
$object->note_public .= dol_concatdesc($object->note_public, '<br>');
|
||||
}
|
||||
} elseif (count($objects) == 1) {
|
||||
$elementobject = array_shift($objects);
|
||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder");
|
||||
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->transnoentities($elementobject->ref).($elementobject->ref_client ? ' ('.$elementobject->ref_client.')' : '').($elementobject->ref_supplier ? ' ('.$elementobject->ref_supplier.')' : '');
|
||||
$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate");
|
||||
@ -2311,12 +2321,40 @@ function pdf_getLinkedObjects($object, $outputlangs)
|
||||
} elseif ($objecttype == 'shipping') {
|
||||
$outputlangs->loadLangs(array("orders", "sendings"));
|
||||
|
||||
foreach ($objects as $x => $elementobject) {
|
||||
if (count($objects) > 1) {
|
||||
$order = null;
|
||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') $object->note_public .= dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending").' : <br>');
|
||||
else $object->note_public .= dol_concatdesc($object->note_public, '<br>'.$outputlangs->transnoentities("RefSending").' : <br>');
|
||||
// We concat this record info into fields xxx_value. title is overwrote.
|
||||
foreach ($objects as $elementobject) {
|
||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { // There is not already a link to order and object is not the order, so we show also info with order
|
||||
$elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0);
|
||||
if (! empty($elementobject->linkedObjectsIds['commande'])) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
$order = new Commande($db);
|
||||
$ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande']));
|
||||
if ($ret < 1) {
|
||||
$order = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! is_object($order)) {
|
||||
$object->note_public .= dol_concatdesc($object->note_public, $outputlangs->transnoentities($elementobject->ref));
|
||||
$object->note_public .= dol_concatdesc($object->note_public, '<br>');
|
||||
} else {
|
||||
$object->note_public .= dol_concatdesc($object->note_public, $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : ''));
|
||||
$object->note_public .= dol_concatdesc($object->note_public, ' / '.$outputlangs->transnoentities($elementobject->ref));
|
||||
$object->note_public .= dol_concatdesc($object->note_public, '<br>');
|
||||
}
|
||||
}
|
||||
} elseif (count($objects) == 1) {
|
||||
$elementobject = array_shift($objects);
|
||||
$order = null;
|
||||
// We concat this record info into fields xxx_value. title is overwrote.
|
||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { // There is not already a link to order and object is not the order, so we show also info with order
|
||||
if (empty($object->linkedObjects['commande']) && $object->element != 'commande') { // There is not already a link to order and object is not the order, so we show also info with order
|
||||
$elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0);
|
||||
if (!empty($elementobject->linkedObjectsIds['commande'])) {
|
||||
if (! empty($elementobject->linkedObjectsIds['commande'])) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
||||
$order = new Commande($db);
|
||||
$ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande']));
|
||||
@ -2325,24 +2363,15 @@ function pdf_getLinkedObjects($object, $outputlangs)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!is_object($order)) {
|
||||
|
||||
if (! is_object($order)) {
|
||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefSending");
|
||||
if (!empty($linkedobjects[$objecttype]['ref_value'])) {
|
||||
$linkedobjects[$objecttype]['ref_value'] .= ' / ';
|
||||
}
|
||||
if (! empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] .= ' / ';
|
||||
$linkedobjects[$objecttype]['ref_value'] .= $outputlangs->transnoentities($elementobject->ref);
|
||||
//$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("DateShipment");
|
||||
//if (! empty($linkedobjects[$objecttype]['date_value'])) $linkedobjects[$objecttype]['date_value'].=' / ';
|
||||
//$linkedobjects[$objecttype]['date_value'].= dol_print_date($elementobject->date_delivery,'day','',$outputlangs);
|
||||
} else {
|
||||
$linkedobjects[$objecttype]['ref_title'] = $outputlangs->transnoentities("RefOrder").' / '.$outputlangs->transnoentities("RefSending");
|
||||
if (empty($linkedobjects[$objecttype]['ref_value'])) {
|
||||
$linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : '');
|
||||
}
|
||||
if (empty($linkedobjects[$objecttype]['ref_value'])) $linkedobjects[$objecttype]['ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ? ' ('.$order->ref_client.')' : '');
|
||||
$linkedobjects[$objecttype]['ref_value'] .= ' / '.$outputlangs->transnoentities($elementobject->ref);
|
||||
//$linkedobjects[$objecttype]['date_title'] = $outputlangs->transnoentities("OrderDate") . ($elementobject->date_delivery ? ' / ' . $outputlangs->transnoentities("DateShipment") : '');
|
||||
//if (empty($linkedobjects[$objecttype]['date_value'])) $linkedobjects[$objecttype]['date_value'] = dol_print_date($order->date,'day','',$outputlangs);
|
||||
//$linkedobjects[$objecttype]['date_value'].= ($elementobject->date_delivery ? ' / ' . dol_print_date($elementobject->date_delivery,'day','',$outputlangs) : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -589,12 +589,12 @@ function measuring_units_string($scale = '', $measuring_style = '', $unit = 0, $
|
||||
/**
|
||||
* Return translation label of a unit key
|
||||
*
|
||||
* @param int $unit ID of unit (rowid in llx_c_units table)
|
||||
* @param string $measuring_style Style of unit: 'weight', 'volume', ..., '' = 'net_measure' for option PRODUCT_ADD_NET_MEASURE
|
||||
* @param string $scale Scale of unit: '0', '-3', '6', ...
|
||||
* @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated.
|
||||
* @param int $unit ID of unit (rowid in llx_c_units table)
|
||||
* @param string $measuring_style Style of unit: 'weight', 'volume', ..., '' = 'net_measure' for option PRODUCT_ADD_NET_MEASURE
|
||||
* @param string $scale Scale of unit: '0', '-3', '6', ...
|
||||
* @param int $use_short_label 1=Use short label ('g' instead of 'gram'). Short labels are not translated.
|
||||
* @param Translate $outputlangs Language object
|
||||
* @return string Unit string
|
||||
* @return string Unit string
|
||||
* @see formproduct->selectMeasuringUnits()
|
||||
*/
|
||||
function measuringUnitString($unit, $measuring_style = '', $scale = '', $use_short_label = 0, $outputlangs = null)
|
||||
|
||||
@ -572,7 +572,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
$numlines = count($lines);
|
||||
|
||||
// We declare counter as global because we want to edit them into recursive call
|
||||
global $total_projectlinesa_spent, $total_projectlinesa_planned, $total_projectlinesa_spent_if_planned, $total_projectlinesa_declared_if_planned, $total_projectlinesa_tobill, $total_projectlinesa_billed;
|
||||
global $total_projectlinesa_spent, $total_projectlinesa_planned, $total_projectlinesa_spent_if_planned, $total_projectlinesa_declared_if_planned, $total_projectlinesa_tobill, $total_projectlinesa_billed, $total_budget_amount;
|
||||
|
||||
if ($level == 0) {
|
||||
$total_projectlinesa_spent = 0;
|
||||
@ -581,6 +581,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
$total_projectlinesa_declared_if_planned = 0;
|
||||
$total_projectlinesa_tobill = 0;
|
||||
$total_projectlinesa_billed = 0;
|
||||
$total_budget_amount = 0;
|
||||
}
|
||||
|
||||
for ($i = 0; $i < $numlines; $i++) {
|
||||
@ -651,6 +652,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
$taskstatic->datee = $lines[$i]->date_end; // deprecated
|
||||
$taskstatic->planned_workload = $lines[$i]->planned_workload;
|
||||
$taskstatic->duration_effective = $lines[$i]->duration;
|
||||
$taskstatic->budget_amount = $lines[$i]->budget_amount;
|
||||
|
||||
|
||||
if ($showproject) {
|
||||
@ -850,6 +852,12 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
print '</td>';
|
||||
}*/
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) {
|
||||
print '<td class="center">';
|
||||
print price($lines[$i]->budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
|
||||
$total_budget_amount += $lines[$i]->budget_amount;
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Contacts of task
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) {
|
||||
@ -921,7 +929,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
}
|
||||
|
||||
if (($total_projectlinesa_planned > 0 || $total_projectlinesa_spent > 0 || $total_projectlinesa_tobill > 0 || $total_projectlinesa_billed > 0)
|
||||
if (($total_projectlinesa_planned > 0 || $total_projectlinesa_spent > 0 || $total_projectlinesa_tobill > 0 || $total_projectlinesa_billed > 0 || $total_budget_amount > 0)
|
||||
&& $level <= 0) {
|
||||
print '<tr class="liste_total nodrag nodrop">';
|
||||
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
@ -1021,6 +1029,13 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['t.budget_amount']['checked'])) {
|
||||
print '<td class="nowrap liste_total center">';
|
||||
print price($total_budget_amount, 0, $langs, 1, 0, 0, $conf->currency);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Contacts of task for backward compatibility,
|
||||
if (!empty($conf->global->PROJECT_SHOW_CONTACTS_IN_LIST)) {
|
||||
print '<td></td>';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user