Merge branch 'develop' of github.com:Dolibarr/dolibarr into NEW/addline_with_position_choice_develop

This commit is contained in:
Gauthier PC portable 024 2021-11-22 16:23:26 +01:00
commit e02405edc9
243 changed files with 1947 additions and 693 deletions

117
ChangeLog
View File

@ -143,6 +143,123 @@ Following changes may create regressions for some external modules, but were nec
***** ChangeLog for 14.0.4 compared to 14.0.3 *****
FIX: $totalarray is overwritten, totals were lost
FIX: 13.0 - due to a typo in the 'mode' parameter, the "first name" column of the list of members displays the full name
FIX: 13.0: end date required to edit a ticket message
FIX: 13.0 feedback of PR #18993: make ticket messages punctual events with attr percentage = -1
FIX: 13.0 PR #18993: add comment on modified part
FIX: 13.0: sometimes firstname was mistyped as fistname
FIX: 14.0 - civility field of private third party creation form has inadequate width
FIX: 14.0 - civility field width inadequate due to select2 calculating the width while the field has no width (display: none)
FIX: 14.0 - due to a typo in the 'mode' parameter, the "first name" co…
FIX: #18634 : Problem of virtual stock with reception module enabled
FIX: #18695 Added ref_ext to supplier invoice
FIX: #18698 Supplier invoice list - "alert" checkbox not working
FIX: #18735
FIX: #18767 : Adherent delete
FIX: #18797
FIX: #18854
FIX: #18875 in v14
FIX: #18910
FIX: #18910 : MRP List SQL query syntax error with more than one extrafileds.
FIX: #18912 Accountancy - SQL error when custom group is added without country defined
FIX: #18934 on-registration in the extrafieldsline database for deliveries
FIX: #18968
FIX: #19008
FIX: #19014 - the properties of some fields are not updated when you submit the form
FIX: #19210
FIX: #19214 : PostgreSQL error on admin/limits.php
FIX: #19241 Project - Fix display salary in overview
FIX: #19305
FIX: 2 columns for total labels
FIX: Accountancy - Format Quadra export - Missing line type C to create automaticly a subledger account with label
FIX: Accountancy - If deposit invoice is used, force binding in deposit accounting account to solve transaction
FIX: Accountancy - Missing specific filename for export on format FEC2, Ciel & repare it
FIX: Accountancy - Option of export popup are inverted
FIX: Accountancy - PHP8
FIX: Accountancy - Product admin - SQL error when we affect accounting account with product_perentity activated
FIX: Accountancy simplified - Salaries are not present in report
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: also on customer index for automatic binding
FIX: Attachment of pdf into shipment when sending email
FIX: autocalculation of the supplier price in main currency.
FIX: avoid warning if $categories is an id
FIX: bad sign of amount stored for multicurrency columns on credit notes
FIX: Bad use of a forced contact of another company on PDF/ODT documents
FIX: Bad use of dol_concatdesc()
FIX: Button text on proposal card for create a invoice
FIX: calculateCosts of BOM must not be included into fetch
FIX: calculation of balance in conciliation page on desc sorting.
FIX: card.php
FIX: Change date format of the inventorycode to be equal as mass stock transfert
FIX: check if greater 0
FIX: close cash with some terminals in TakePOS
FIX: compatibility with Multicompany
FIX: consistent UX when calling a tab from the invoice card with empty ref/id
FIX: default language defined for IN country
FIX: Expense report - In edit mode, field qty doesn't accept decimal unlike the create mode
FIX: fetch of product with modulebuilder load too much data
FIX: filter for export of accounting documents
FIX: Filter on categories
FIX: generate documents with PDF options
FIX: indentation
FIX: init hookmanager after loading $conf values
FIX: invoice: inpossible to create an invoice because of very bad check + warnings when trying to print tabs for invoice with no ID
FIX: legal issue on expense report pdf (must also show price without tax)
FIX: list of categories in stats of supplier invoices
FIX: load tranlate array after setting lang
FIX: lost superadmin grade after edit user card
FIX: missing filter status=1 on rss feeds
FIX: missing permission check reported by me@lainwir3d.net on product api
FIX: missing return status
FIX: missing sql filter by entity
FIX: move fetch_optionnal into $ac_static->fetch()
FIX: only a superadmin can modify entity
FIX: only ones value is return for dictionaries
FIX: optional visibility on create card
FIX: payment style and html5 tags
FIX: payment using wrong type in takepos when too many payment mode
FIX: PR#18931 Remove useless explicit call to dol_shutdown
FIX: Product accountancy affectation with product_perentity activated (PR #18620)
FIX: products/services card: hidden extrafields were overridden
FIX: project task list: extrafields could not be displayed
FIX: Propal list - Problem of pagination on date
FIX: reload user lang
FIX: Remove not complete order from the virtual stock
FIX: Replenish: SQL error when no warehouse has been created + Warning when there are no warehouses
FIX: resource list : Use standard code to handle list filters
FIX: restrictedArea for payment delete
FIX: Ret PR
FIX: second approval back in stable feature as is the setting for minimum amount (last part from PR#14286)
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: show end hours in events linked to objects
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: tcpdf vulnerability to roman numeral bomb, cf. tecnickom/TCPDF issue #315
FIX: Test when date of invoie is in future (pb with TZ and offset)
FIX: Ticket - Card - Wrong font awesome library
FIX: Ticket - Duplicate field project when we create ticket from project
FIX: translation into email for member at membership validation.
FIX: Travis Sanitize SQL
FIX: unprivileged user can see task associated with a not allowed project
FIX: URGENT: impossible to create an invoice
FIX: Use of accent into filename of GED
FIX: user date timezone offset
FIX: User salary card - translation problem
FIX: user without permission can set ticket subject
FIX: We need a default price base type in variant creation case with multiprices when parent has been created with only one level price
FIX: wrong array key value
FIX: wrong check
FIX: wrong position of error message
Sync transifex.
***** ChangeLog for 14.0.3 compared to 14.0.2 *****
FIX: #18698 Supplier invoice list - "alert" checkbox not working

View File

@ -495,7 +495,7 @@ if ($id) {
if ($valuetoshow != '') {
print '<td class="'.$class.'">';
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
print '<a href="'.$tabhelp[$id][$value].'">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
} elseif (!empty($tabhelp[$id][$value])) {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
} else {

View File

@ -520,7 +520,7 @@ if ($tabname[$id]) {
if ($valuetoshow != '') {
print '<td class="'.$class.'">';
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
print '<a href="'.$tabhelp[$id][$value].'">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
} elseif (!empty($tabhelp[$id][$value])) {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
} else {

View File

@ -453,7 +453,7 @@ if ($id) {
if ($valuetoshow != '') {
print '<td class="'.$class.'">';
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
print '<a href="'.$tabhelp[$id][$value].'">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
} elseif (!empty($tabhelp[$id][$value])) {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value]);
} else {

View File

@ -4,6 +4,7 @@
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -47,9 +48,12 @@ if (empty($user->rights->accounting->bind->write)) {
// search & action GETPOST
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$codeventil_buy = GETPOST('codeventil_buy', 'array');
$codeventil_sell = GETPOST('codeventil_sell', 'array');
$chk_prod = GETPOST('chk_prod', 'array');
$default_account = GETPOST('default_account', 'int');
$confirm = GETPOST('confirm', 'alpha');
$account_number_buy = GETPOST('account_number_buy');
$account_number_sell = GETPOST('account_number_sell');
$changeaccount = GETPOST('changeaccount', 'array');
@ -68,7 +72,6 @@ $search_onsell = GETPOST('search_onsell', 'alpha');
$search_onpurchase = GETPOST('search_onpurchase', 'alpha');
$accounting_product_mode = GETPOST('accounting_product_mode', 'alpha');
$btn_changeaccount = GETPOST('changeaccount', 'alpha');
$btn_changetype = GETPOST('changetype', 'alpha');
$optioncss = GETPOST('optioncss', 'alpha');
@ -165,7 +168,7 @@ if ($action == 'update') {
}
}
if (!empty($btn_changeaccount)) {
if (!empty($chk_prod) && $massaction === 'changeaccount') {
//$msg = '<div><span class="accountingprocessing">' . $langs->trans("Processing") . '...</span></div>';
if (!empty($chk_prod) && in_array($accounting_product_mode, $accounting_product_modes)) {
$accounting = new AccountingAccount($db);
@ -436,11 +439,27 @@ if ($result) {
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
if ($massaction !== 'set_default_account') {
$arrayofmassactions = array(
'changeaccount'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Save")
,'set_default_account'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("ConfirmPreselectAccount")
);
$massactionbutton = $form->selectMassAction('', $arrayofmassactions, 1);
}
$buttonsave = '<input type="submit" class="button button-save" id="changeaccount" name="changeaccount" value="'.$langs->trans("Save").'">';
//print '<br><div class="center">'.$buttonsave.'</div>';
$texte = $langs->trans("ListOfProductsServices");
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $buttonsave, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
if ($massaction == 'set_default_account') {
$formquestion[]=array('type' => 'other',
'name' => 'set_default_account',
'label' => $langs->trans("AccountancyCode"),
'value' => $form->select_account('', 'default_account', 1, array(), 0, 0, 'maxwidth200 maxwidthonsmartphone', 'cachewithshowemptyone'));
print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmPreselectAccount"), $langs->trans("ConfirmPreselectAccountQuestion", count($chk_prod)), "confirm_set_default_account", $formquestion, 1, 0, 200, 500, 1);
}
print '<div class="div-table-responsive">';
print '<table class="liste '.($moreforfilter ? "listwithfilterbefore" : "").'">';
@ -645,7 +664,7 @@ if ($result) {
if (!empty($obj->aaid)) {
$defaultvalue = ''; // Do not suggest default new value is code is already valid
}
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print $form->select_account(($default_account > 0 && $confirm === 'yes' && in_array($product_static->id, $chk_prod)) ? $default_account : $defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print '</td>';
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_INTRA') {
// Accounting account buy intra (In EEC)
@ -659,7 +678,7 @@ if ($result) {
if (!empty($obj->aaid)) {
$defaultvalue = ''; // Do not suggest default new value is code is already valid
}
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print $form->select_account(($default_account > 0 && $confirm === 'yes' && in_array($product_static->id, $chk_prod)) ? $default_account : $defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print '</td>';
} elseif ($accounting_product_mode == 'ACCOUNTANCY_BUY_EXPORT') {
// Accounting account buy export (Out of EEC)
@ -673,7 +692,7 @@ if ($result) {
if (!empty($obj->aaid)) {
$defaultvalue = ''; // Do not suggest default new value is code is already valid
}
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print $form->select_account(($default_account > 0 && $confirm === 'yes' && in_array($product_static->id, $chk_prod)) ? $default_account : $defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print '</td>';
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL') {
// Accounting account sell
@ -687,7 +706,7 @@ if ($result) {
if (!empty($obj->aaid)) {
$defaultvalue = ''; // Do not suggest default new value is code is already valid
}
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print $form->select_account(($default_account > 0 && $confirm === 'yes' && in_array($product_static->id, $chk_prod)) ? $default_account : $defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print '</td>';
} elseif ($accounting_product_mode == 'ACCOUNTANCY_SELL_INTRA') {
// Accounting account sell intra (In EEC)
@ -701,7 +720,7 @@ if ($result) {
if (!empty($obj->aaid)) {
$defaultvalue = ''; // Do not suggest default new value is code is already valid
}
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print $form->select_account(($default_account > 0 && $confirm === 'yes' && in_array($product_static->id, $chk_prod)) ? $default_account : $defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print '</td>';
} else {
// Accounting account sell export (Out of EEC)
@ -714,13 +733,20 @@ if ($result) {
if (!empty($obj->aaid)) {
$defaultvalue = ''; // Do not suggest default new value is code is already valid
}
print $form->select_account($defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print $form->select_account(($default_account > 0 && $confirm === 'yes' && in_array($product_static->id, $chk_prod)) ? $default_account : $defaultvalue, 'codeventil_'.$product_static->id, 1, array(), 1, 0, 'maxwidth300 maxwidthonsmartphone productforselect');
print '</td>';
}
if (!empty($chk_prod)) {
$ischecked = 0;
if (in_array($product_static->id, $chk_prod)) {
$ischecked=true;
}
}
// Checkbox select
print '<td class="center">';
print '<input type="checkbox" class="checkforselect productforselectcodeventil_'.$product_static->id.'" name="chk_prod[]" value="'.$obj->rowid.'"/></td>';
print '<input type="checkbox" class="checkforselect productforselectcodeventil_'.$product_static->id.'" name="chk_prod[]" '.($ischecked ? "checked" : "").' value="'.$obj->rowid.'"/></td>';
print "</tr>";
$i++;
}

View File

@ -874,7 +874,7 @@ class AccountingAccount extends CommonObject
}
// Manage Deposit
if ($factureDet->desc == "(DEPOSIT)") {
if ($factureDet->desc == "(DEPOSIT)" || $facture->type == $facture::TYPE_DEPOSIT) {
$accountdeposittoventilated = new self($this->db);
$result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
if ($result < 0) {

View File

@ -36,6 +36,9 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
$validatemonth = GETPOST('validatemonth', 'int');
$validateyear = GETPOST('validateyear', 'int');
// Security check
if (empty($conf->accounting->enabled)) {
accessforbidden();
@ -174,6 +177,9 @@ if ($action == 'validatehistory') {
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
if ($validatemonth && $validateyear) {
$sql .= dolSqlDateFilter('f.datef', 0, $validatemonth, $validateyear);
}
dol_syslog('htdocs/accountancy/customer/index.php');
@ -245,6 +251,8 @@ if ($action == 'validatehistory') {
$code_sell_p_notset = '';
$code_sell_t_notset = '';
$suggestedid = 0;
$return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer');
if (!is_array($return) && $return<0) {
setEventMessage($accountingAccount->error, 'errors');
@ -259,28 +267,7 @@ if ($action == 'validatehistory') {
}
}
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
if (!empty($objp->company_code_sell)) {
$objp->code_sell_t = $objp->company_code_sell;
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
$suggestedaccountingaccountfor = '';
}
}
// Manage Deposit
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) {
if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) {
$accountdeposittoventilated = new AccountingAccount($db);
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
$objp->code_sell_l = $accountdeposittoventilated->ref;
$objp->code_sell_p = '';
$objp->code_sell_t = '';
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
}
}
if ($objp->aarowid_suggest > 0) {
if ($suggestedid > 0) {
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facturedet";
$sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid);
$sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $facture_static_det->id);
@ -325,7 +312,7 @@ print '</span><br>';
$y = $year_current;
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>';
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&token='.newToken().'">'.$langs->trans("ValidateHistory").'</a>';
print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
@ -339,7 +326,24 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
$cursormonth = $j;
if ($cursormonth > 12) {
$cursormonth -= 12;
}
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
print '<td width="60" class="right">';
if (!empty($tmp['mday'])) {
$param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
$param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
print '<a href="'.DOL_URL_ROOT.'/accountancy/customer/list.php?'.$param.'">';
}
print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
if (!empty($tmp['mday'])) {
print '</a>';
}
print '</td>';
}
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
@ -379,7 +383,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
print '<tr class="oddeven">';
print '<td>';
if ($row[0] == 'tobind') {
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
@ -388,19 +393,33 @@ if ($resql) {
print '</td>';
print '<td>';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
} else {
print $row[1];
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
for ($i = 2; $i <= 13; $i++) {
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
if ($cursormonth > 12) {
$cursormonth -= 12;
}
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
print '<td class="right nowraponall amount">';
print price($row[$i]);
print '</td>';
}
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
if ($num == 0) {
print '<tr class="oddeven"><td colspan="16">';
print '<span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span>';
print '</td></tr>';
}
} else {
print $db->lasterror(); // Show last sql error
}
@ -423,7 +442,24 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
$cursormonth = $j;
if ($cursormonth > 12) {
$cursormonth -= 12;
}
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
print '<td width="60" class="right">';
if (!empty($tmp['mday'])) {
$param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
$param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
print '<a href="'.DOL_URL_ROOT.'/accountancy/customer/lines.php?'.$param.'">';
}
print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
if (!empty($tmp['mday'])) {
print '</a>';
}
print '</td>';
}
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
@ -463,7 +499,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
print '<tr class="oddeven">';
print '<td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
} else {
@ -473,20 +510,34 @@ if ($resql) {
print '<td>';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
} else {
print $row[1];
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
for ($i = 2; $i <= 13; $i++) {
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
if ($cursormonth > 12) {
$cursormonth -= 12;
}
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
print '<td class="right nowraponall amount">';
print price($row[$i]);
print '</td>';
}
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
if ($num == 0) {
print '<tr class="oddeven"><td colspan="16">';
print '<span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span>';
print '</td></tr>';
}
} else {
print $db->lasterror(); // Show last sql error
}

View File

@ -532,6 +532,7 @@ if ($result) {
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
$code_sell_l = '';
$code_sell_p = '';
$code_sell_t = '';
$thirdpartystatic->id = $objp->socid;
$thirdpartystatic->name = $objp->name;
@ -581,6 +582,8 @@ if ($result) {
$code_sell_p_notset = '';
$code_sell_t_notset = '';
$suggestedid = 0;
$return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer');
if (!is_array($return) && $return<0) {
setEventMessage($accountingAccount->error, 'errors');
@ -594,28 +597,7 @@ if ($result) {
}
//var_dump($return);
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
if (!empty($objp->company_code_sell)) {
$objp->code_sell_t = $objp->company_code_sell;
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
$suggestedaccountingaccountfor = '';
}
}
// Manage Deposit
if (!empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT)) {
if ($objp->description == "(DEPOSIT)" || $objp->ftype == $facture_static::TYPE_DEPOSIT) {
$accountdeposittoventilated = new AccountingAccount($db);
$accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1);
$objp->code_sell_l = $accountdeposittoventilated->ref;
$objp->code_sell_p = '';
$objp->code_sell_t = '';
$objp->aarowid_suggest = $accountdeposittoventilated->rowid;
}
}
if (!empty($objp->code_sell_p)) {
if (!empty($code_sell_p)) {
// Value was defined previously
} else {
$code_sell_p_notset = 'color:orange';
@ -630,6 +612,7 @@ if ($result) {
// $code_sell_l is now default code of product/service
// $code_sell_p is now code of product/service
// $code_sell_t is now code of thirdparty
//var_dump($code_sell_l.' - '.$code_sell_p.' - '.$code_sell_t.' -> '.$suggestedid.' ('.$suggestedaccountingaccountbydefaultfor.' '.$suggestedaccountingaccountfor.')');
print '<tr class="oddeven">';

View File

@ -32,6 +32,9 @@ require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
$validatemonth = GETPOST('validatemonth', 'int');
$validateyear = GETPOST('validateyear', 'int');
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
if (GETPOST("year", 'int')) {
$year_start = GETPOST("year", 'int');
@ -106,12 +109,18 @@ if ($action == 'validatehistory') {
$sql1 .= " WHERE ".MAIN_DB_PREFIX."expensereport_det.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity);
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code = accnt.account_number";
$sql1 .= " AND ".MAIN_DB_PREFIX."expensereport_det.fk_code_ventilation = 0";
if ($validatemonth && $validateyear) {
$sql1 .= dolSqlDateFilter('date', 0, $validatemonth, $validateyear);
}
} else {
$sql1 = "UPDATE ".MAIN_DB_PREFIX."expensereport_det as erd, ".MAIN_DB_PREFIX."c_type_fees as t, ".MAIN_DB_PREFIX."accounting_account as accnt , ".MAIN_DB_PREFIX."accounting_system as syst";
$sql1 .= " SET erd.fk_code_ventilation = accnt.rowid";
$sql1 .= " WHERE erd.fk_c_type_fees = t.id AND accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity);
$sql1 .= " AND accnt.active = 1 AND t.accountancy_code=accnt.account_number";
$sql1 .= " AND erd.fk_code_ventilation = 0";
if ($validatemonth && $validateyear) {
$sql1 .= dolSqlDateFilter('erd.date', 0, $validatemonth, $validateyear);
}
}
dol_syslog('htdocs/accountancy/expensereport/index.php');
@ -146,7 +155,7 @@ print '</span><br>';
$y = $year_current;
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>';
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&token='.newToken().'">'.$langs->trans("ValidateHistory").'</a>';
print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
@ -195,7 +204,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
print '<tr class="oddeven">';
print '<td>';
if ($row[0] == 'tobind') {
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
@ -204,15 +214,16 @@ if ($resql) {
print '</td>';
print '<td>';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
} else {
print $row[1];
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
for ($i = 2; $i <= 13; $i++) {
print '<td class="right nowraponall amount">';
print price($row[$i]);
print '</td>';
}
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
@ -274,7 +285,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
print '<tr class="oddeven">';
print '<td>';
if ($row[0] == 'tobind') {
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
@ -284,15 +296,16 @@ if ($resql) {
print '<td>';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
} else {
print $row[1];
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
for ($i = 2; $i <= 13; $i++) {
print '<td class="right nowraponall amount">';
print price($row[$i]);
print '</td>';
}
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}

View File

@ -34,6 +34,9 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
// Load translation files required by the page
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
$validatemonth = GETPOST('validatemonth', 'int');
$validateyear = GETPOST('validateyear', 'int');
// Security check
if (empty($conf->accounting->enabled)) {
accessforbidden();
@ -172,6 +175,9 @@ if ($action == 'validatehistory') {
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
}
if ($validatemonth && $validateyear) {
$sql .= dolSqlDateFilter('f.datef', 0, $validatemonth, $validateyear);
}
dol_syslog('htdocs/accountancy/supplier/index.php');
@ -241,6 +247,8 @@ if ($action == 'validatehistory') {
$code_buy_p_notset = '';
$code_buy_t_notset = '';
$suggestedid = 0;
$return = $accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'supplier');
if (!is_array($return) && $return<0) {
setEventMessage($accountingAccount->error, 'errors');
@ -255,16 +263,7 @@ if ($action == 'validatehistory') {
}
}
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
if (!empty($objp->company_code_buy)) {
$objp->code_buy_t = $objp->company_code_buy;
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
$suggestedaccountingaccountfor = '';
}
}
if ($objp->aarowid_suggest > 0) {
if ($suggestedid > 0) {
$sqlupdate = "UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
$sqlupdate .= " SET fk_code_ventilation = ".((int) $suggestedid);
$sqlupdate .= " WHERE fk_code_ventilation <= 0 AND product_type <= 2 AND rowid = ".((int) $facture_static_det->id);
@ -307,7 +306,7 @@ print '</span><br>';
$y = $year_current;
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?year='.$year_current.'&action=validatehistory">'.$langs->trans("ValidateHistory").'</a>';
$buttonbind = '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&token='.newToken().'">'.$langs->trans("ValidateHistory").'</a>';
print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
@ -322,7 +321,24 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
$cursormonth = $j;
if ($cursormonth > 12) {
$cursormonth -= 12;
}
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
print '<td width="60" class="right">';
if (!empty($tmp['mday'])) {
$param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
$param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
print '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/list.php?'.$param.'">';
}
print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
if (!empty($tmp['mday'])) {
print '</a>';
}
print '</td>';
}
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
@ -357,7 +373,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
print '<tr class="oddeven">';
print '<td>';
if ($row[0] == 'tobind') {
print '<span class="opacitymedium">'.$langs->trans("Unknown").'</span>';
} else {
@ -366,19 +383,26 @@ if ($resql) {
print '</td>';
print '<td>';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
} else {
print $row[1];
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
for ($i = 2; $i <= 13; $i++) {
print '<td class="right nowraponall amount">';
print price($row[$i]);
print '</td>';
}
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
if ($num == 0) {
print '<tr class="oddeven"><td colspan="16">';
print '<span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span>';
print '</td></tr>';
}
} else {
print $db->lasterror(); // Show last sql error
}
@ -401,7 +425,24 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
$cursormonth = $j;
if ($cursormonth > 12) {
$cursormonth -= 12;
}
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
print '<td width="60" class="right">';
if (!empty($tmp['mday'])) {
$param = 'search_date_startday=1&search_date_startmonth='.$cursormonth.'&search_date_startyear='.$cursoryear;
$param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
print '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/lines.php?'.$param.'">';
}
print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
if (!empty($tmp['mday'])) {
print '</a>';
}
print '</td>';
}
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
@ -436,7 +477,8 @@ if ($resql) {
$num = $db->num_rows($resql);
while ($row = $db->fetch_row($resql)) {
print '<tr class="oddeven"><td>';
print '<tr class="oddeven">';
print '<td>';
if ($row[0] == 'tobind') {
print $langs->trans("Unknown");
} else {
@ -445,19 +487,26 @@ if ($resql) {
print '</td>';
print '<td>';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.((int) $y), $langs->transnoentitiesnoconv("ToBind"));
} else {
print $row[1];
}
print '</td>';
for ($i = 2; $i <= 12; $i++) {
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
for ($i = 2; $i <= 13; $i++) {
print '<td class="right nowraponall amount">';
print price($row[$i]);
print '</td>';
}
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
print '</tr>';
}
$db->free($resql);
if ($num == 0) {
print '<tr class="oddeven"><td colspan="16">';
print '<span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span>';
print '</td></tr>';
}
} else {
print $db->lasterror(); // Show last sql error
}

View File

@ -532,9 +532,9 @@ if ($result) {
// product_type: 0 = service, 1 = product
// if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
$objp->code_buy_l = '';
$objp->code_buy_p = '';
$objp->aarowid_suggest = ''; // Will be set later
$code_buy_l = '';
$code_buy_p = '';
$code_buy_t = '';
$thirdpartystatic->id = $objp->socid;
$thirdpartystatic->name = $objp->name;
@ -585,6 +585,8 @@ if ($result) {
$code_buy_p_notset = '';
$code_buy_t_notset = '';
$suggestedid = 0;
$return=$accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facturefourn_static, $facturefourn_static_det, $accountingAccountArray, 'supplier');
if (!is_array($return) && $return<0) {
setEventMessage($accountingAccount->error, 'errors');
@ -598,9 +600,6 @@ if ($result) {
}
//var_dump($return);
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
// Not supported for suppliers
if (!empty($code_buy_p)) {
// Value was defined previously
} else {
@ -616,6 +615,7 @@ if ($result) {
// $code_buy_l is now default code of product/service
// $code_buy_p is now code of product/service
// $code_buy_t is now code of thirdparty
//var_dump($code_buy_l.' - '.$code_buy_p.' - '.$code_buy_t.' -> '.$suggestedid.' ('.$suggestedaccountingaccountbydefaultfor.' '.$suggestedaccountingaccountfor.')');
print '<tr class="oddeven">';

View File

@ -265,7 +265,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print '<div class="urllink">';
print '<input type="text" id="publicurlmember" class="quatrevingtpercentminusx" value="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">';
print '<a target="_blank" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
print '</div>';
print ajax_autoselect('publicurlmember');
}

View File

@ -14,6 +14,7 @@
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2021 Waël Almoman <info@almoman.com>
* Copyright (C) 2021 Philippe Grand <philippe.grand@atoo-net.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
@ -1520,7 +1521,7 @@ class Adherent extends CommonObject
{
global $langs;
require_once DOL_DOCUMENT_ROOT.'/parntership/class/partnership.class.php';
require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php';
$this->partnerships[] = array();

View File

@ -159,7 +159,7 @@ $getentity = ($conf->entity > 1 ? "&entity=".$conf->entity : "");
// Show message
$message = '';
$urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlvcal = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank" rel="noopener noreferrer">';
$urlvcal .= $urlwithroot.'/public/agenda/agendaexport.php?format=vcal'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlvcal, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'vcal', '').'</span>');
$message .= '<div class="urllink">';
@ -168,7 +168,7 @@ $message .= '</div>';
$message .= ajax_autoselect('onlinepaymenturl1');
$message .= '<br>';
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlical = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank" rel="noopener noreferrer">';
$urlical .= $urlwithroot.'/public/agenda/agendaexport.php?format=ical&type=event'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlical, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'ical/ics', '').'</span>');
$message .= '<div class="urllink">';
@ -177,7 +177,7 @@ $message .= '</div>';
$message .= ajax_autoselect('onlinepaymenturl2');
$message .= '<br>';
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank">';
$urlrss = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...').'" target="_blank" rel="noopener noreferrer">';
$urlrss .= $urlwithroot.'/public/agenda/agendaexport.php?format=rss'.$getentity.'&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : 'KEYNOTDEFINED').'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $urlrss, '<span class="opacitymedium">'.$langs->trans("WebCalUrlForVCalExport", 'rss', '').'</span>');
$message .= '<div class="urllink">';

View File

@ -108,7 +108,10 @@ print '<input type="hidden" name="action" value="update">';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent editmode">';
print '<tr class="liste_titre">';
print '<td class="titlefieldcreate">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
print '<td class="titlefieldcreate">'.$langs->trans("SocialNetworksInformation").'</td>';
print '<td>'.$langs->trans("SocialNetworkId").'</td>';
print '<td>'.$form->textwithpicto($langs->trans("Url"), $langs->trans("KeepEmptyToUseDefault")).'</td>';
print '<td></td>';
print "</tr>\n";
@ -119,9 +122,9 @@ foreach ($listofnetworks as $key => $value) {
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
print '<td class="nowraponall"><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.(!empty($conf->global->$networkconstname) ? dol_escape_htmltag($conf->global->$networkconstname) : '').'">';
print '</td><td>';
print '<input name="'.$key.'" id="'.$key.'" class="minwidth300" value="'.(!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : '').'">';
print '</td><td>';
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.(!empty($conf->global->$networkconstname) ? dol_escape_htmltag($conf->global->$networkconstname) : '').'">';
print '</td>';
print '<td class="nowraponall">'.dol_print_socialnetworks((!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : ''), 0, 0, $key, $listofnetworks).'</td>';
print '</tr>'."\n";

View File

@ -173,11 +173,11 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai
// Show message
$message = '';
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank">'.$urlwithroot.'/dav/fileserver.php</a>';
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank" rel="noopener noreferrer">'.$urlwithroot.'/dav/fileserver.php</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV', ''));
$message .= '<div class="urllink"><input type="text" id="webdavpublicurl" class="quatrevingtpercent" value="'.$urlwithroot.'/dav/fileserver.php">';
$message .= '<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank">';
$message .= '<a href="'.$urlwithroot.'/dav/fileserver.php" target="_blank" rel="noopener noreferrer">';
$message .= ' '.img_picto('', 'globe');
$message .= '</a>';
$message .= '</div>';
@ -186,11 +186,11 @@ $message .= ajax_autoselect('webdavpublicurl');
$message .= '<br>';
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) {
$urlEntity = (!empty($conf->multicompany->enabled) ? '?entity='.$conf->entity : '');
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>';
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank" rel="noopener noreferrer">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>';
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', ''));
$message .= '<div class="urllink"><input type="text" id="webdavurl" class="quatrevingtpercent" value="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'">';
$message .= '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank">';
$message .= '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank" rel="noopener noreferrer">';
$message .= ' '.img_picto('', 'globe');
$message .= '</a>';
$message .= '</div>';

View File

@ -268,7 +268,7 @@ class Dolistore
// add image or default ?
if ($product->id_default_image != '') {
$image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.((int) $product->id).'&id_image='.((int) $product->id_default_image);
$images = '<a href="'.urlencode($image_url).'" class="documentpreview" target="_blank" mime="image/png" title="'.dol_escape_htmltag($product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version).'">';
$images = '<a href="'.urlencode($image_url).'" class="documentpreview" target="_blank" rel="noopener noreferrer" mime="image/png" title="'.dol_escape_htmltag($product->name->language[$this->lang - 1].', '.$langs->trans('Version').' '.$product->module_version).'">';
$images .= '<img src="'.urlencode($image_url).'&quality=home_default" style="max-height:250px;max-width: 210px;" alt="" /></a>';
} else {
$images = '<img src="'.DOL_URL_ROOT.'/admin/dolistore/img/NoImageAvailable.png" />';
@ -280,8 +280,8 @@ class Dolistore
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
} else {
$price = '<h3>'.$langs->trans('Free').'</h3>';
$download_link = '<a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
$download_link .= '<br><br><a target="_blank" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
$download_link = '<a target="_blank" rel="noopener noreferrer" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/Download-128.png" /></a>';
$download_link .= '<br><br><a target="_blank" rel="noopener noreferrer" href="'.urlencode($this->shop_url.$product->id).'"><img width="32" src="'.DOL_URL_ROOT.'/admin/dolistore/img/follow.png" /></a>';
}
//checking versions
@ -316,8 +316,6 @@ class Dolistore
$compatible = 'NotCompatible';
}
//.'<br><a class="inline-block valignmiddle" target="_blank" href="'.$this->shop_url.$product->id.'"><span class="details button">'.$langs->trans("SeeInMarkerPlace").'</span></a>
//output template
$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">
<td class="center" width="210"><div class="newAppParent">'.dol_escape_htmltag($newapp.$images).'</div></td>

View File

@ -583,6 +583,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$arrayoftypes = array(
'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")),
'loadandcreatethirdparty'=>$langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")),
'recordjoinpiece'=>$langs->trans('recordjoinpieceonobject'),
'recordevent'=>'RecordEvent');
if ($conf->projet->enabled) {
$arrayoftypes['project'] = 'CreateLeadAndThirdParty';

View File

@ -144,12 +144,12 @@ print '<br>';
print $langs->trans("NoteOnPathLocation").'<br>';
$url1 = 'http://www.maxmind.com/en/city?rId=awstats';
print $langs->trans("YouCanDownloadFreeDatFileTo", '<a href="'.$url1.'" target="_blank">'.$url1.'</a>');
print $langs->trans("YouCanDownloadFreeDatFileTo", '<a href="'.$url1.'" target="_blank" rel="noopener noreferrer external">'.$url1.'</a>');
print '<br>';
$url2 = 'http://www.maxmind.com/en/city?rId=awstats';
print $langs->trans("YouCanDownloadAdvancedDatFileTo", '<a href="'.$url2.'" target="_blank">'.$url2.'</a>');
print $langs->trans("YouCanDownloadAdvancedDatFileTo", '<a href="'.$url2.'" target="_blank" rel="noopener noreferrer external">'.$url2.'</a>');
if ($geoip) {
print '<br><br>';

View File

@ -654,7 +654,7 @@ if ($action == 'view') {
if ($valuetoshow != '') {
print '<td class="'.$align.'">';
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
print '<a href="'.$tabhelp[$id][$value].'" target="_blank" rel="noopener noreferrer">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
} elseif (!empty($tabhelp[$id][$value])) {
if (in_array($value, array('topic'))) {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, $value); // Tooltip on click

View File

@ -334,7 +334,7 @@ if ($mode == 'desc') {
$editor_url = 'http://'.$editor_url;
}
if (!empty($objMod->editor_url) && !preg_match('/dolibarr\.org/i', $objMod->editor_url)) {
$textexternal .= ($objMod->editor_name != 'dolibarr' ? ' - ' : '').img_picto('', 'globe').' <a href="'.$editor_url.'" target="_blank">'.$objMod->editor_url.'</a>';
$textexternal .= ($objMod->editor_name != 'dolibarr' ? ' - ' : '').img_picto('', 'globe').' <a href="'.$editor_url.'" target="_blank" rel="noopener noreferrer external">'.$objMod->editor_url.'</a>';
}
$text .= $textexternal;
$text .= '<br>';

View File

@ -1000,9 +1000,9 @@ if ($mode == 'marketplace') {
print '<tr class="oddeven">'."\n";
$url = 'https://www.dolistore.com';
print '<td class="hideonsmartphone"><a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
print '<td class="hideonsmartphone"><a href="'.$url.'" target="_blank" rel="noopener noreferrer external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolistore_logo.png"></a></td>';
print '<td><span class="opacitymedium">'.$langs->trans("DoliStoreDesc").'</span></td>';
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
print '<td><a href="'.$url.'" target="_blank" rel="noopener noreferrer external">'.$url.'</a></td>';
print '</tr>';
print "</table>\n";
@ -1081,7 +1081,7 @@ if ($mode == 'deploy') {
$allowonlineinstall = false;
}
$fullurl = '<a href="'.$urldolibarrmodules.'" target="_blank">'.$urldolibarrmodules.'</a>';
$fullurl = '<a href="'.$urldolibarrmodules.'" target="_blank" rel="noopener noreferrer">'.$urldolibarrmodules.'</a>';
$message = '';
if (!empty($allowonlineinstall)) {
if (!in_array('/custom', explode(',', $dolibarr_main_url_root_alt))) {
@ -1273,10 +1273,10 @@ if ($mode == 'develop') {
print '<tr class="oddeven" height="80">'."\n";
$url = 'https://partners.dolibarr.org';
print '<td class="left">';
print'<a href="'.$url.'" target="_blank" rel="external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolibarr_preferred_partner.png"></a>';
print'<a href="'.$url.'" target="_blank" rel="noopener noreferrer external"><img border="0" class="imgautosize imgmaxwidth180" src="'.DOL_URL_ROOT.'/theme/dolibarr_preferred_partner.png"></a>';
print '</td>';
print '<td>'.$langs->trans("DoliPartnersDesc").'</td>';
print '<td><a href="'.$url.'" target="_blank" rel="external">'.$url.'</a></td>';
print '<td><a href="'.$url.'" target="_blank" rel="noopener noreferrer external">'.$url.'</a></td>';
print '</tr>';
print "</table>\n";

View File

@ -169,6 +169,7 @@ $head = multicurrencyAdminPrepareHead();
print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "multicurrency");
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
@ -191,7 +192,7 @@ print '<tr class="oddeven">';
print '<td>'.$langs->transnoentitiesnoconv("multicurrency_useOriginTx").'</td>';
print '<td class="center">';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('MULTICURRENCY_USE_ORIGIN_TX');
print ajax_constantonoff('MULTICURRENCY_USE_ORIGIN_TX', null, null, 0, 0, 0, 2, 0, 1);
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
print $form->selectarray("MULTICURRENCY_USE_ORIGIN_TX", $arrval, $conf->global->MULTICURRENCY_USE_ORIGIN_TX);
@ -242,6 +243,7 @@ print '</td></tr>';
*/
print '</table>';
print '</div>';
print '<br>';
@ -264,7 +266,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) {
print '</td></tr>';
print '<tr class="oddeven">';
print '<td class="fieldrequired"><a target="_blank" href="'.$urlforapilayer.'">'.$langs->transnoentitiesnoconv("multicurrency_appId").'</a></td>';
print '<td class="fieldrequired"><a target="_blank" rel="noopener noreferrer external" href="'.$urlforapilayer.'">'.$langs->transnoentitiesnoconv("multicurrency_appId").'</a></td>';
print '<td class="right">';
print '<input type="text" name="MULTICURRENCY_APP_ID" value="'.$conf->global->MULTICURRENCY_APP_ID.'" size="28" />&nbsp;';
print '</td></tr>';
@ -290,7 +292,7 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) {
}
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<table class="noborder centpercent nomarginbottom">';
print '<tr class="liste_titre">';
print '<td>'.$form->textwithpicto($langs->trans("CurrenciesUsed"), $langs->transnoentitiesnoconv("CurrenciesUsed_help_to_add")).'</td>'."\n";
@ -305,7 +307,7 @@ print '<tr class="oddeven">';
print '<td>'.$form->selectCurrency('', 'code', 1).'</td>';
print '<td class="right">';
print '<input type="text" name="rate" value="" class="width75 right" placeholder="'.$langs->trans('Rate').'" />&nbsp;';
print '<input type="submit" class="button button-add" value="'.$langs->trans("Add").'">';
print '<input type="submit" class="button button-add small" value="'.$langs->trans("Add").'">';
print '</td>';
print '</tr>';

View File

@ -72,8 +72,8 @@ print '</li></ul>';
print $langs->trans("Developpers").':';
print '<ul>';
print '<li>'.$langs->trans("SourcesRepository").': <a href="https://www.github.com/Dolibarr/dolibarr" target="_blank" rel="external">https://www.github.com/Dolibarr/dolibarr</a></li>';
print '<li>'.$langs->trans("SeeWikiForAllTeam").': <a href="https://wiki.dolibarr.org/index.php/Dolibarr_Project" target="_blank" rel="external">https://wiki.dolibarr.org/index.php/Dolibarr_Project</a></li>';
print '<li>'.$langs->trans("SourcesRepository").': <a href="https://www.github.com/Dolibarr/dolibarr" target="_blank" rel="noopener noreferrer external">https://www.github.com/Dolibarr/dolibarr</a></li>';
print '<li>'.$langs->trans("SeeWikiForAllTeam").': <a href="https://wiki.dolibarr.org/index.php/Dolibarr_Project" target="_blank" rel="noopener noreferrer external">https://wiki.dolibarr.org/index.php/Dolibarr_Project</a></li>';
print '</ul>';
//print "<br>\n";
@ -82,56 +82,56 @@ print $langs->trans("OtherInformations").':';
print '<ul>';
print '<li>';
print '<a target="_blank" href="https://www.dolibarr.org/" rel="external">'.$langs->trans("OfficialWebSite").'</a>';
print '<a target="_blank" href="https://www.dolibarr.org/" rel="noopener noreferrer external">'.$langs->trans("OfficialWebSite").'</a>';
print '</li>';
// Show local site
/*
if (preg_match('/^fr_/i', $langs->getDefaultLang()))
{
print '<li>';
print '<a target="_blank" href="https://www.dolibarr.fr/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("France")).'</a>';
print '<a target="_blank" href="https://www.dolibarr.fr/" rel="noopener noreferrer external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("France")).'</a>';
print '</li>';
}
if (preg_match('/^el_/i', $langs->getDefaultLang()))
{
print '<li>';
print '<a target="_blank" href="https://www.dolibarr.gr/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Greece")).'</a>';
print '<a target="_blank" href="https://www.dolibarr.gr/" rel="noopener noreferrer external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Greece")).'</a>';
print '</li>';
}
if (preg_match('/^es_/i', $langs->getDefaultLang()))
{
print '<li>';
print '<a target="_blank" href="https://www.dolibarr.es/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Spain")).'</a>';
print '<a target="_blank" href="https://www.dolibarr.es/" rel="noopener noreferrer external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Spain")).'</a>';
print '</li>';
}
if (preg_match('/^it_/i', $langs->getDefaultLang()))
{
print '<li>';
print '<a target="_blank" href="https://www.dolibarr.it/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Italy")).'</a>';
print '<a target="_blank" href="https://www.dolibarr.it/" rel="noopener noreferrer external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Italy")).'</a>';
print '</li>';
}
if (preg_match('/^de_/i', $langs->getDefaultLang()))
{
print '<li>';
print '<a target="_blank" href="https://www.dolibarr.de/" rel="external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Germany")).'</a>';
print '<a target="_blank" href="https://www.dolibarr.de/" rel="noopener noreferrer external">'.$langs->trans("OfficialWebSiteLocal", $langs->transnoentitiesnoconv("Germany")).'</a>';
print '</li>';
}*/
print '<li>';
print '<a target="_blank" href="https://wiki.dolibarr.org/" rel="external">'.$langs->trans("OfficialWiki").'</a>';
print '<a target="_blank" href="https://wiki.dolibarr.org/" rel="noopener noreferrer external">'.$langs->trans("OfficialWiki").'</a>';
print '</li>';
print '</ul>';
print $langs->trans("Demo").':';
print '<ul>';
print '<li>';
print '<a target="_blank" href="https://www.dolibarr.org/onlinedemo/" rel="external">'.$langs->trans("OfficialDemo").'</a>';
print '<a target="_blank" href="https://www.dolibarr.org/onlinedemo/" rel="noopener noreferrer external">'.$langs->trans("OfficialDemo").'</a>';
print '</li>';
print '</ul>';
print $langs->trans("ModulesMarketPlaces").':';
print '<ul>';
print '<li>';
print '<a target="_blank" href="https://www.dolistore.com" rel="external">'.$langs->trans("OfficialMarketPlace").'</a>';
print '<a target="_blank" href="https://www.dolistore.com" rel="noopener noreferrer external">'.$langs->trans("OfficialMarketPlace").'</a>';
print '</li>';
print '</ul>';
@ -143,7 +143,7 @@ print $langs->trans("HelpCenter").':';
print '<ul>';
print '<li>';
//print $langs->trans("SeeWikiPage",'http://wiki.dolibarr.org/index.php/List_of_OpenSource_Software_companies_and_freelancers');
print '<a target="_blank" href="'.DOL_URL_ROOT.'/support/index.php" data-ajax="false">'.$langs->trans("HelpCenter").'</a>';
print '<a target="_blank" rel="noopener noreferrer external" href="'.DOL_URL_ROOT.'/support/index.php" data-ajax="false">'.$langs->trans("HelpCenter").'</a>';
print '</li>';
print '</ul>';
@ -158,15 +158,15 @@ if (preg_match('/^fr_/i', $langs->getDefaultLang())) {
if (preg_match('/^es_/i', $langs->getDefaultLang())) {
$url = 'https://wiki.dolibarr.org/index.php/Subscribirse';
}
print '<li><a href="'.$url.'" target="_blank" rel="external">'.$langs->trans("SubscribeToFoundation").'</a></li>';
print '<li><a href="'.$url.'" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SubscribeToFoundation").'</a></li>';
print '</ul>';
print $langs->trans("SocialNetworks").':';
print '<ul>';
print '<li><a href="https://facebook.com/dolibarr" target="_blank" rel="external">FaceBook</a></li>';
print '<li><a href="https://twitter.com/dolibarr" target="_blank" rel="external">Twitter</a></li>';
print '<li><a href="https://facebook.com/dolibarr" target="_blank" rel="noopener noreferrer external">FaceBook</a></li>';
print '<li><a href="https://twitter.com/dolibarr" target="_blank" rel="noopener noreferrer external">Twitter</a></li>';
print '</ul>';
@ -182,11 +182,11 @@ if (preg_match('/^es_/i', $langs->getDefaultLang())) {
$url = 'https://wiki.dolibarr.org/index.php/Soluciones_en_la_Nube';
}
print '<li>';
print '<a target="_blank" href="'.$url.'" rel="external">'.$title.'</a>';
print '<a target="_blank" rel="noopener noreferrer external" href="'.$url.'">'.$title.'</a>';
print '</li>';
$url = 'https://partners.dolibarr.org'; $title = $langs->trans("ReferencedPreferredPartners");
print '<li>';
print '<a target="_blank" href="'.$url.'" rel="external">'.$title.'</a>';
print '<a target="_blank" rel="noopener noreferrer external" href="'.$url.'">'.$title.'</a>';
print '</li>';
print '</ul>';

View File

@ -93,7 +93,7 @@ $version = DOL_VERSION;
if (preg_match('/[a-z]+/i', $version)) {
$version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
}
print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeChangeLog").'</a>';
$newversion = '';
if (function_exists('curl_init')) {
@ -120,7 +120,7 @@ if (function_exists('curl_init')) {
// Show version
print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
if ($version != '0.0') {
print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeChangeLog").'</a>';
}
} else {
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';

View File

@ -180,7 +180,7 @@ $head = ticketAdminPrepareHead();
print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> : <a class="wordbreak" href="'.DOL_URL_ROOT.'/public/ticket/index.php" target="_blank" >'.dol_buildpath('/public/ticket/index.php', 2).'</a>';
print '<span class="opacitymedium">'.$langs->trans("TicketPublicAccess").'</span> : <a class="wordbreak" href="'.DOL_URL_ROOT.'/public/ticket/index.php" target="_blank" rel="noopener noreferrer">'.dol_buildpath('/public/ticket/index.php', 2).'</a>';
print dol_get_fiche_end();

View File

@ -116,14 +116,14 @@ print $langs->trans("Upgrade").'<br>';
print '<hr>';
print $langs->trans("ThisIsProcessToFollow").'<br>';
print '<b>'.$langs->trans("StepNb", 1).'</b>: ';
$fullurl = '<a href="'.$urldolibarr.'" target="_blank">'.$urldolibarr.'</a>';
$fullurl = '<a href="'.$urldolibarr.'" target="_blank" rel="noopener noreferrer">'.$urldolibarr.'</a>';
print str_replace('{s}', $fullurl, $langs->trans("DownloadPackageFromWebSite", '{s}')).'<br>';
print '<b>'.$langs->trans("StepNb", 2).'</b>: ';
print str_replace('{s}', $dolibarrroot, $langs->trans("UnpackPackageInDolibarrRoot", '{s}')).'<br>';
print '<b>'.$langs->trans("StepNb", 3).'</b>: ';
print $langs->trans("RemoveLock", $dolibarrdataroot.'/install.lock').'<br>';
print '<b>'.$langs->trans("StepNb", 4).'</b>: ';
$fullurl = '<a href="'.DOL_URL_ROOT.'/install/" target="_blank">'.DOL_URL_ROOT.'/install/</a>';
$fullurl = '<a href="'.DOL_URL_ROOT.'/install/" target="_blank" rel="noopener noreferrer">'.DOL_URL_ROOT.'/install/</a>';
print str_replace('{s}', $fullurl, $langs->trans("CallUpdatePage", '{s}')).'<br>';
print '<b>'.$langs->trans("StepNb", 5).'</b>: ';
print $langs->trans("RestoreLock", $dolibarrdataroot.'/install.lock').'<br>';

View File

@ -268,7 +268,7 @@ if ($mode == 'overwrite') {
print '<div class="justify"><span class="opacitymedium">';
print img_info().' '.$langs->trans("SomeTranslationAreUncomplete");
$urlwikitranslatordoc = 'https://wiki.dolibarr.org/index.php/Translator_documentation';
print ' ('.str_replace('{s1}', '<a href="'.$urlwikitranslatordoc.'" target="_blank">'.$langs->trans("Here").'</a>', $langs->trans("SeeAlso", '{s1}')).')<br>';
print ' ('.str_replace('{s1}', '<a href="'.$urlwikitranslatordoc.'" target="_blank" rel="noopener noreferrer external">'.$langs->trans("Here").'</a>', $langs->trans("SeeAlso", '{s1}')).')<br>';
print $langs->trans("TranslationOverwriteDesc", $langs->transnoentitiesnoconv("Language"), $langs->transnoentitiesnoconv("Key"), $langs->transnoentitiesnoconv("NewTranslationStringToShow"))."\n";
print ' ('.$langs->trans("TranslationOverwriteDesc2").').'."<br>\n";
print '</span></div>';

View File

@ -460,7 +460,7 @@ if ($id) {
if ($valuetoshow != '') {
print '<td class="'.$align.'">';
if (!empty($tabhelp[$id][$value]) && preg_match('/^http(s*):/i', $tabhelp[$id][$value])) {
print '<a href="'.$tabhelp[$id][$value].'" target="_blank">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
print '<a href="'.$tabhelp[$id][$value].'" target="_blank" rel="noopener noreferrer">'.$valuetoshow.' '.img_help(1, $valuetoshow).'</a>';
} elseif (!empty($tabhelp[$id][$value])) {
if ($value == 'virtualhost') {
print $form->textwithpicto($valuetoshow, $tabhelp[$id][$value], 1, 'help', '', 0, 2, 'tooltipvirtual');

View File

@ -123,9 +123,25 @@ $workflowcodes = array(
),
// Automatic classification supplier order
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION'=>array(
'family'=>'classify_supplier_order',
'position'=>63,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (!empty($conf->reception->enabled)) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'picto'=>'supplier_order',
'warning'=>''
),
'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED'=>array(
'family'=>'classify_supplier_order',
'position'=>64,
'enabled'=>(!empty($conf->global->MAIN_FEATURES_LEVEL) && (!empty($conf->reception->enabled)) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || empty($conf->supplier_order->enabled))),
'picto'=>'supplier_order',
'warning'=>''
),
'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER'=>array(
'family'=>'classify_supplier_order',
'position'=>62,
'position'=>65,
'enabled'=>((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
'picto'=>'supplier_order',
'warning'=>''
@ -134,7 +150,7 @@ $workflowcodes = array(
// Automatic classification reception
'WORKFLOW_BILL_ON_RECEPTION'=>array(
'family'=>'classify_reception',
'position'=>64,
'position'=>80,
'enabled'=>(!empty($conf->reception->enabled) && ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled))),
'picto'=>'reception'
),
@ -142,7 +158,7 @@ $workflowcodes = array(
// Automatic classification shipping
'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
'family' => 'classify_shipping',
'position' => 66,
'position' => 90,
'enabled' => ! empty($conf->expedition->enabled) && ! empty($conf->facture->enabled),
'picto' => 'shipment'
)

View File

@ -152,11 +152,11 @@ print '<br>';
print '<span class="opacitymedium">'.$langs->trans("ApiExporerIs").':</span><br>';
if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/explorer')) {
$url = DOL_MAIN_URL_ROOT.'/api/index.php/explorer';
print '<div class="urllink soixantepercent">'.img_picto('', 'globe').' <a href="'.$url.'" target="_blank">'.$url."</a></div><br>\n";
print '<div class="urllink soixantepercent">'.img_picto('', 'globe').' <a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.$url."</a></div><br>\n";
print '<div class="opacitymediumxxx"><br><span class="opacitymedium">'.$langs->trans("SwaggerDescriptionFile").':</span><br>';
$urlswagger = DOL_MAIN_URL_ROOT.'/api/index.php/explorer/swagger.json?DOLAPIKEY=youruserapikey';
//$urlswaggerreal = DOL_MAIN_URL_ROOT.'/api/index.php/explorer/swagger.json?DOLAPIKEY='.$user->api_key;
print '<div class="urllink soixantepercent">'.img_picto('', 'globe').' <a href="'.$urlswagger.'" target="_blank">'.$urlswagger."</a></div><br>\n";
print '<div class="urllink soixantepercent">'.img_picto('', 'globe').' <a href="'.$urlswagger.'" target="_blank" rel="noopener noreferrer">'.$urlswagger."</a></div><br>\n";
print '</div>';
} else {
$langs->load("errors");

View File

@ -90,7 +90,7 @@ function printDropdownBookmarksList()
$bookmarkList = '<div id="dropdown-bookmarks-list" >';
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
$bookmarkList .= '<a class="dropdown-item bookmark-item'.(strpos($obj->url, 'http') === 0 ? ' bookmark-item-external' : '').'" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= '<a class="dropdown-item bookmark-item'.(strpos($obj->url, 'http') === 0 ? ' bookmark-item-external' : '').'" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank" rel="noopener noreferrer"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= dol_escape_htmltag($obj->title);
$bookmarkList .= '</a>';
$i++;
@ -115,7 +115,7 @@ function printDropdownBookmarksList()
}
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
$searchForm .= '<option name="bookmark'.$obj->rowid.'" value="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' rel="'.dol_escape_htmltag($obj->url).'" >';
$searchForm .= '<option name="bookmark'.$obj->rowid.'" value="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank" rel="noopener noreferrer"' : '').' rel="'.dol_escape_htmltag($obj->url).'" >';
$searchForm .= dol_escape_htmltag($obj->title);
$searchForm .= '</option>';
$i++;

View File

@ -248,7 +248,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
if ($action == 'edit') {
print '<input class="flat minwidth500 quatrevingtpercent" name="url" value="'.(GETPOSTISSET("url") ? GETPOST("url") : $object->url).'">';
} else {
print '<a href="'.(preg_match('/^http/i', $object->url) ? $object->url : DOL_URL_ROOT.$object->url).'"'.($object->target ? ' target="_blank"' : '').'>';
print '<a href="'.(preg_match('/^http/i', $object->url) ? $object->url : DOL_URL_ROOT.$object->url).'"'.($object->target ? ' target="_blank" rel="noopener noreferrer"' : '').'>';
print img_picto('', 'globe', 'class="paddingright"');
print $object->url;
print '</a>';

View File

@ -194,19 +194,19 @@ if ($object->id) {
if (is_array($listofphoto) && count($listofphoto)) {
print '<br>';
print '<table width="100%" valign="top" align="center">';
print '<table width="100%" valign="top" class="center centpercent">';
foreach ($listofphoto as $key => $obj) {
$nbphoto++;
if ($nbbyrow && ($nbphoto % $nbbyrow == 1)) {
print '<tr align=center valign=middle border=1>';
print '<tr class"center valignmiddle" border="1">';
}
if ($nbbyrow) {
print '<td width="'.ceil(100 / $nbbyrow).'%" class="photo">';
}
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$obj['photo']).'" alt="Taille origine" target="_blank">';
print '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart=category&entity='.$object->entity.'&file='.urlencode($pdir.$obj['photo']).'" alt="Original size" target="_blank" rel="noopener noreferrer">';
// Si fichier vignette disponible, on l'utilise, sinon on utilise photo origine
if ($obj['photo_vignette']) {

View File

@ -1247,7 +1247,9 @@ if ($action == 'create') {
if (!empty($projectid)) {
$projectsListId = $projectid;
}
$tid = GETPOSTISSET("projecttaskid") ? GETPOST("projecttaskid", 'int') : (GETPOSTISSET("taskid") ? GETPOST("taskid", 'int') : '');
$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500', $projectsListId);
print '</td></tr>';
}

View File

@ -185,10 +185,7 @@ if ($resql) {
// Show file name with link to download
$out .= '<a href="'.$documenturl.'?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).($param ? '&'.$param : '').'"';
$mime = dol_mimetype($relativepath, '', 0);
if (preg_match('/text/', $mime)) {
$out .= ' target="_blank"';
}
$out .= ' target="_blank">';
$out .= ' target="_blank" rel="noopener noreferrer">';
$out .= img_mime($filearray["name"], $langs->trans("File").': '.$filearray["name"]);
$out .= $filearray["name"];
$out .= '</a>'."\n";

View File

@ -211,7 +211,7 @@ if (empty($reshook)) {
$substitutionarray['__OTHER5__'] = $other5;
$substitutionarray['__USER_SIGNATURE__'] = $signature; // Signature is empty when ran from command line or taken from user in parameter)
$substitutionarray['__CHECK_READ__'] = '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($obj->tag).'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'&email='.urlencode($obj->email).'&mtid='.$obj->rowid.'" width="1" height="1" style="width:1px;height:1px" border="0"/>';
$substitutionarray['__UNSUBSCRIBE__'] = '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.urlencode($obj->tag).'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'&email='.urlencode($obj->email).'&mtid='.$obj->rowid.'" target="_blank">'.$langs->trans("MailUnsubcribe").'</a>';
$substitutionarray['__UNSUBSCRIBE__'] = '<a href="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.urlencode($obj->tag).'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'&email='.urlencode($obj->email).'&mtid='.$obj->rowid.'" target="_blank" rel="noopener noreferrer">'.$langs->trans("MailUnsubcribe").'</a>';
$substitutionarray['__UNSUBSCRIBE_URL__'] = DOL_MAIN_URL_ROOT.'/public/emailing/mailing-unsubscribe.php?tag='.urlencode($obj->tag).'&unsuscrib=1&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'&email='.urlencode($obj->email).'&mtid='.$obj->rowid;
$onlinepaymentenabled = 0;
@ -248,7 +248,7 @@ if (empty($reshook)) {
}
}
if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
$substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = '<a target="_blank" href="'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.((!empty($conf->multicompany->enabled)) ? '?entity='.$conf->entity : '').'">'.$langs->trans('BlankSubscriptionForm'). '</a>';
$substitutionarray['__PUBLICLINK_NEWMEMBERFORM__'] = '<a target="_blank" rel="noopener noreferrer" href="'.DOL_MAIN_URL_ROOT.'/public/members/new.php'.((!empty($conf->multicompany->enabled)) ? '?entity='.$conf->entity : '').'">'.$langs->trans('BlankSubscriptionForm'). '</a>';
}
/* For backward compatibility, deprecated */
if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_SECURITY_TOKEN)) {

View File

@ -736,7 +736,7 @@ if (!empty($date_start) && !empty($date_stop)) {
print '<td>';
if (!empty($data['files'])) {
foreach ($data['files'] as $id => $filecursor) {
print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank">'.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'</a>&nbsp;'.$formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name']).'<br>';
print '<a href='.DOL_URL_ROOT.'/'.$filecursor['link'].' target="_blank" rel="noopener noreferrer">'.($filecursor['name'] ? $filecursor['name'] : $filecursor['ref']).'</a>&nbsp;'.$formfile->showPreview($filecursor, $filecursor['modulepart'], $filecursor['subdir'].'/'.$filecursor['name']).'<br>';
}
}
print "</td>\n";

View File

@ -677,14 +677,14 @@ if (empty($action) || $action == "view" || $action == "close") {
if ($action != 'close') {
print '<div class="tabsAction">';
print '<div class="inline-block divButAction"><a target="_blank" class="butAction" href="report.php?id='.$id.'">'.$langs->trans('PrintTicket').'</a></div>';
print '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" class="butAction" href="report.php?id='.((int) $id).'">'.$langs->trans('PrintTicket').'</a></div>';
if ($object->status == CashControl::STATUS_DRAFT) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=close&token='.newToken().'&contextpage='.$contextpage.'">'.$langs->trans('Close').'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.((int) $id).'&action=close&token='.newToken().'&contextpage='.$contextpage.'">'.$langs->trans('Close').'</a></div>';
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=confirm_delete&token='.newToken().'">'.$langs->trans('Delete').'</a></div>';
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.((int) $id).'&action=confirm_delete&token='.newToken().'">'.$langs->trans('Delete').'</a></div>';
} else {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$id.'&action=reopen&token='.newToken().'">'.$langs->trans('ReOpen').'</a></div>';
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.((int) $id).'&action=reopen&token='.newToken().'">'.$langs->trans('ReOpen').'</a></div>';
}
print '</div>';

View File

@ -5407,7 +5407,7 @@ if ($action == 'create') {
if (!empty($conf->takepos->enabled) && $object->module_source == 'takepos') {
$langs->load("cashdesk");
$receipt_url = DOL_URL_ROOT."/takepos/receipt.php";
print '<a target="_blank" class="butAction" href="'.$receipt_url.'?facid='.$object->id.'">'.$langs->trans('POSTicket').'</a>';
print '<a target="_blank" rel="noopener noreferrer" class="butAction" href="'.$receipt_url.'?facid='.((int) $object->id).'">'.$langs->trans('POSTicket').'</a>';
}
// Create payment

View File

@ -802,6 +802,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
dol_print_error($db);
}
$formconfirm = '';
// Save button
if ($action != 'add_paiement') {
@ -840,9 +841,21 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$text .= '<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
print '<input type="hidden" name="closepaidinvoices" value="'.GETPOST('closepaidinvoices').'">';
}
print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type, $langs->trans('ReceivedCustomersPayments'), $text, 'confirm_paiement', $formquestion, $preselectedchoice);
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type, $langs->trans('ReceivedCustomersPayments'), $text, 'confirm_paiement', $formquestion, $preselectedchoice);
}
// Call Hook formConfirm
$parameters = array('formConfirm' => $formconfirm);
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (empty($reshook)) {
$formconfirm .= $hookmanager->resPrint;
} elseif ($reshook > 0) {
$formconfirm = $hookmanager->resPrint;
}
// Print form confirm
print $formconfirm;
print "</form>\n";
}
}

View File

@ -27,6 +27,9 @@
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/paymentvat.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
@ -40,9 +43,14 @@ if (!empty($conf->accounting->enabled)) {
$langs->loadLangs(array('compta', 'banks', 'bills'));
$id = GETPOST("id", 'int');
$action = GETPOST("action", "alpha");
$cancel = GETPOST('cancel');
$confirm = GETPOST('confirm');
$ref = GETPOST('ref', 'alpha');
$action = GETPOST("action", "aZ09");
$confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'myobjectcard'; // To manage different context of search
$backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
$refund = GETPOST("refund", "int");
if (GETPOSTISSET('auto_create_paiement') || $action === 'add') {
$auto_create_payment = GETPOST("auto_create_paiement", "int");
@ -57,15 +65,42 @@ if (empty($refund)) {
$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth", 'int'), GETPOST("datevday", 'int'), GETPOST("datevyear", 'int'));
$datep = dol_mktime(12, 0, 0, GETPOST("datepmonth", 'int'), GETPOST("datepday", 'int'), GETPOST("datepyear", 'int'));
// Initialize technical objects
$object = new Tva($db);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->tax->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('taxvatcard', 'globalcard'));
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha')) {
$search[$key] = GETPOST('search_'.$key, 'alpha');
}
}
if (empty($action) && empty($id) && empty($ref)) {
$action = 'view';
}
// Load object
if ($id > 0) {
$object->fetch($id);
}
$permissiontoread = $user->rights->tax->charges->lire;
$permissiontoadd = $user->rights->tax->charges->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->tax->charges->supprimer || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
$permissionnote = $user->rights->tax->charges->creer; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->tax->charges->creer; // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->tax->multidir_output[isset($object->entity) ? $object->entity : 1].'/vat';
// Security check
$socid = GETPOST('socid', 'int');
if ($user->socid) {
@ -74,10 +109,16 @@ if ($user->socid) {
$result = restrictedArea($user, 'tax', '', 'tva', 'charges');
/**
/*
* Actions
*/
$parameters = array();
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if ($cancel && !$id) {
header("Location: list.php");
exit;
@ -339,11 +380,12 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->char
*/
$form = new Form($db);
$formfile = new FormFile($db);
$formproject = new FormProjets($db);
$title = $langs->trans("VAT")." - ".$langs->trans("Card");
$help_url = '';
llxHeader("", $title, $help_url);
llxHeader('', $title, $help_url);
if ($id) {
@ -729,10 +771,11 @@ if ($id) {
print "</form>";
}
/*
* Action bar
*/
print "<div class=\"tabsAction\">\n";
// Buttons for actions
print '<div class="tabsAction">'."\n";
if ($action != 'edit') {
// Reopen
if ($object->paye && $user->rights->tax->charges->creer) {
@ -770,7 +813,66 @@ if ($id) {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.(dol_escape_htmltag($langs->trans("DisabledBecausePayments"))).'">'.$langs->trans("Delete").'</a></div>';
}
}
print "</div>";
print '</div>'."\n";
// Select mail models is same action as presend
if (GETPOST('modelselected')) {
$action = 'presend';
}
if ($action != 'presend') {
print '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre
$includedocgeneration = 1;
// Documents
if ($includedocgeneration) {
$objref = dol_sanitizeFileName($object->ref);
$relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->tax->dir_output.'/vat/'.$objref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
//$genallowed = $user->rights->tax->charges->lire; // If you can read, you can build the PDF to read content
$genallowed = 0;
$delallowed = $user->rights->tax->charges->creer; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('tax-vat', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
}
// Show links to link elements
//$linktoelem = $form->showLinkToObjectBlock($object, null, array('myobject'));
//$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
print '</div><div class="fichehalfright">';
/*
$MAXEVENT = 10;
$morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-list-alt imgforviewmode', dol_buildpath('/mymodule/myobject_agenda.php', 1).'?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.'@'.$object->module, (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
*/
print '</div></div>';
}
//Select mail models is same action as presend
if (GETPOST('modelselected')) {
$action = 'presend';
}
// Presend form
$modelmail = 'vat';
$defaulttopic = 'InformationMessage';
$diroutput = $conf->tax->dir_output;
$trackid = 'vat'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
}
llxFooter();

View File

@ -75,7 +75,11 @@ $search_phone_pro = GETPOST("search_phone_pro", 'alpha');
$search_phone_mobile = GETPOST("search_phone_mobile", 'alpha');
$search_fax = GETPOST("search_fax", 'alpha');
$search_email = GETPOST("search_email", 'alpha');
$search_no_email = GETPOST("search_no_email", 'int');
if (!empty($conf->mailing->enabled)) {
$search_no_email = GETPOST("search_no_email", 'int');
} else {
$search_no_email = -1;
}
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {

View File

@ -140,6 +140,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
header("Location: ".$urltogo);
exit;
} else {
$error++;
// Creation KO
if (!empty($object->errors)) {
setEventMessages(null, $object->errors, 'errors');
@ -255,6 +256,7 @@ if ($action == 'update' && !empty($permissiontoadd)) {
if ($result > 0) {
$action = 'view';
} else {
$error++;
// Creation KO
setEventMessages($object->error, $object->errors, 'errors');
$action = 'edit';
@ -284,6 +286,7 @@ if ($action == "update_extras" && !empty($permissiontoadd)) {
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
$action = 'view';
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
$action = 'edit_extras';
}
@ -301,9 +304,11 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
if ($result > 0) {
// Delete OK
setEventMessages("RecordDeleted", null, 'mesgs');
header("Location: ".$backurlforlist);
exit;
} else {
$error++;
if (!empty($object->errors)) {
setEventMessages(null, $object->errors, 'errors');
} else {
@ -347,6 +352,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
$action = '';
@ -383,6 +389,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $permissiontoadd) {
}
}
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
$action = '';
@ -414,6 +421,7 @@ if ($action == 'confirm_close' && $confirm == 'yes' && $permissiontoadd) {
}
}
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
$action = '';
@ -425,6 +433,7 @@ if ($action == 'confirm_setdraft' && $confirm == 'yes' && $permissiontoadd) {
if ($result >= 0) {
// Nothing else done
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
$action = '';
@ -456,6 +465,7 @@ if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) {
}
}
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
$action = '';
@ -481,6 +491,7 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd))
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$newid); // Open record of new object
exit;
} else {
$error++;
setEventMessages($objectutil->error, $objectutil->errors, 'errors');
$action = '';
}

View File

@ -91,7 +91,7 @@ if (empty($conf->bookmarks->enabled)) {
$bookmarkList = '<div id="dropdown-bookmarks-list" class="start">';
$i = 0;
while ((empty($conf->global->BOOKMARKS_SHOW_IN_MENU) || $i < $conf->global->BOOKMARKS_SHOW_IN_MENU) && $obj = $db->fetch_object($resql)) {
$bookmarkList .= '<a class="dropdown-item bookmark-item'.(strpos($obj->url, 'http') === 0 ? ' bookmark-item-external' : '').'" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= '<a class="dropdown-item bookmark-item'.(strpos($obj->url, 'http') === 0 ? ' bookmark-item-external' : '').'" id="bookmark-item-'.$obj->rowid.'" data-id="'.$obj->rowid.'" '.($obj->target == 1 ? ' target="_blank" rel="noopener noreferrer"' : '').' href="'.dol_escape_htmltag($obj->url).'" >';
$bookmarkList .= dol_escape_htmltag($obj->title);
$bookmarkList .= '</a>';
$i++;

View File

@ -127,7 +127,7 @@ class CMailFile
* @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files
* @param array $mimefilename_list List of attached file name in message
* @param string $addr_cc Email cc
* @param string $addr_cc Email cc (Example: 'abc@def.com, ghk@lmn.com')
* @param string $addr_bcc Email bcc (Note: This is autocompleted with MAIN_MAIL_AUTOCOPY_TO if defined)
* @param int $deliveryreceipt Ask a delivery receipt
* @param int $msgishtml 1=String IS already html, 0=String IS NOT html, -1=Unknown make autodetection (with fast mode, not reliable)

View File

@ -7817,7 +7817,7 @@ abstract class CommonObject
if ($display_type == 'card') {
$out .= '<tr '.($html_id ? 'id="'.$html_id.'" ' : '').$csstyle.' class="valuefieldcreate '.$class.$this->element.'_extras_'.$key.' trextrafields_collapse'.$extrafields_collapse_num.(!empty($this->id)?'_'.$this->id:'').'" '.$domData.' >';
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && ($action == 'view' || $action == 'editline')) {
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER) && ($action == 'view' || $action == 'valid' || $action == 'editline')) {
$out .= '<td></td>';
}
$out .= '<td class="wordbreak';
@ -8197,7 +8197,7 @@ abstract class CommonObject
if ($urladvanced) {
$return .= '<a href="'.$urladvanced.'">';
} else {
$return .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" class="aphoto" target="_blank">';
$return .= '<a href="'.DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.$this->entity.'&file='.urlencode($pdir.$photo).'" class="aphoto" target="_blank" rel="noopener noreferrer">';
}
}
@ -8730,7 +8730,11 @@ abstract class CommonObject
$res = $this->db->query($sql);
if ($res === false) {
$error++;
$this->errors[] = $this->db->lasterror();
if ($this->db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$this->errors[] = "ErrorRefAlreadyExists";
} else {
$this->errors[] = $this->db->lasterror();
}
}
}

View File

@ -110,10 +110,13 @@ class Conf
// Common objects that are not modules
$this->mycompany = new stdClass();
$this->admin = new stdClass();
$this->browser = new stdClass();
$this->medias = new stdClass();
$this->global = new stdClass();
// Common objects that are not modules and set by the main and not into the this->setValues()
$this->browser = new stdClass();
// Common arrays
$this->cache = array();
$this->modules = array();
$this->modules_parts = array(
@ -152,7 +155,6 @@ class Conf
$this->facture = new stdClass();
$this->contrat = new stdClass();
$this->user = new stdClass();
$this->usergroup = new stdClass();
$this->adherent = new stdClass();
$this->bank = new stdClass();
$this->notification = new stdClass();
@ -161,6 +163,23 @@ class Conf
$this->productbatch = new stdClass();
}
/**
* Load setup values into conf object (read llx_const) for a specified entity
* Note that this->db->xxx, this->file->xxx and this->multicompany have been already loaded when setValues is called.
*
* @param int $entity Entity to get
* @return int < 0 if KO, >= 0 if OK
*/
public function setEntityValues($entity)
{
if ($this->entity != $entity) {
// If we ask to reload setup for a new entity
$this->entity = $entity;
return $this->setValues($this->db);
}
return 0;
}
/**
* Load setup values into conf object (read llx_const)
@ -173,6 +192,67 @@ class Conf
{
dol_syslog(get_class($this)."::setValues");
// Unset all old modules values
if (!empty($this->modules)) {
foreach ($this->modules as $m) {
if (isset($this->$m)) unset($this->$m);
}
}
// Common objects that are not modules
$this->mycompany = new stdClass();
$this->admin = new stdClass();
$this->medias = new stdClass();
$this->global = new stdClass();
// Common objects that are not modules and set by the main and not into the this->setValues()
//$this->browser = new stdClass(); // This is set by main and not into this setValues(), so we keep it intact.
// First level object
// TODO Remove this part.
$this->syslog = new stdClass();
$this->expedition_bon = new stdClass();
$this->delivery_note = new stdClass();
$this->fournisseur = new stdClass();
$this->product = new stdClass();
$this->service = new stdClass();
$this->contrat = new stdClass();
$this->actions = new stdClass();
$this->agenda = new stdClass();
$this->commande = new stdClass();
$this->propal = new stdClass();
$this->facture = new stdClass();
$this->contrat = new stdClass();
$this->user = new stdClass();
$this->adherent = new stdClass();
$this->bank = new stdClass();
$this->notification = new stdClass();
$this->mailing = new stdClass();
$this->expensereport = new stdClass();
$this->productbatch = new stdClass();
// Common arrays
$this->cache = array();
$this->modules = array();;
$this->modules_parts = array(
'css' => array(),
'js' => array(),
'tabs' => array(),
'triggers' => array(),
'login' => array(),
'substitutions' => array(),
'menus' => array(),
'theme' => array(),
'sms' => array(),
'tpl' => array(),
'barcode' => array(),
'models' => array(),
'societe' => array(),
'hooks' => array(),
'dir' => array(),
'syslog' => array(),
);
if (!is_null($db) && is_object($db)) {
// Define all global constants into $this->global->key=value
$sql = "SELECT ".$db->decrypt('name')." as name,";
@ -401,10 +481,6 @@ class Conf
$this->user->dir_output = $rootforuser."/users";
$this->user->dir_temp = $rootfortemp."/users/temp";
// For usergroup storage
$this->usergroup->dir_output = $rootforuser."/usergroups";
$this->usergroup->dir_temp = $rootfortemp."/usergroups/temp";
// For proposal storage
$this->propal->multidir_output = array($this->entity => $rootfordata."/propale");
$this->propal->multidir_temp = array($this->entity => $rootfortemp."/propale/temp");
@ -692,6 +768,11 @@ class Conf
$this->global->MAIN_SHOW_STATE_CODE = 1;
}
// By default, we show state code in combo list
if (!isset($this->global->MULTICURRENCY_USE_ORIGIN_TX)) {
$this->global->MULTICURRENCY_USE_ORIGIN_TX = 1;
}
// Use a SCA ready workflow with Stripe module (STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION by default if nothing defined)
if (!isset($this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION) && empty($this->global->STRIPE_USE_NEW_CHECKOUT)) {
$this->global->STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION = 1;

View File

@ -230,7 +230,8 @@ class HookManager
'setContentSecurityPolicy',
'setHtmlTitle',
'completeTabsHead',
'formDolBanner'
'formDolBanner',
'displayMarginInfos',
)
)) {
$hooktype = 'addreplace';

View File

@ -887,7 +887,7 @@ class FormFile
$mime = dol_mimetype($relativepath, '', 0);
if (preg_match('/text/', $mime)) {
$out .= ' target="_blank"';
$out .= ' target="_blank" rel="noopener noreferrer"';
}
$out .= '>';
$out .= img_mime($file["name"], $langs->trans("File").': '.$file["name"]);
@ -976,7 +976,7 @@ class FormFile
foreach ($link_list as $file) {
$out .= '<tr class="oddeven">';
$out .= '<td colspan="'.$colspan.'" class="maxwidhtonsmartphone">';
$out .= '<a data-ajax="false" href="'.$file->url.'" target="_blank">';
$out .= '<a data-ajax="false" href="'.$file->url.'" target="_blank" rel="noopener noreferrer">';
$out .= $file->label;
$out .= '</a>';
$out .= '</td>';
@ -1106,7 +1106,7 @@ class FormFile
$tmpout .= '<li class="nowrap"><a class="pictopreview nowrap" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&amp;entity='.$entity.'&amp;file='.urlencode($relativepath).'"';
$mime = dol_mimetype($relativepath, '', 0);
if (preg_match('/text/', $mime)) {
$tmpout .= ' target="_blank"';
$tmpout .= ' target="_blank" rel="noopener noreferrer"';
}
$tmpout .= '>';
$tmpout .= img_mime($relativepath, $file["name"]);
@ -1410,7 +1410,7 @@ class FormFile
$urlforhref = getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity));
if (empty($urlforhref)) {
$urlforhref = DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank">';
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank" rel="noopener noreferrer">';
} else {
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
}
@ -2091,7 +2091,7 @@ class FormFile
} else {
print '<td>';
print img_picto('', 'globe').' ';
print '<a data-ajax="false" href="'.$link->url.'" target="_blank">';
print '<a data-ajax="false" href="'.$link->url.'" target="_blank" rel="noopener noreferrer">';
print dol_escape_htmltag($link->label);
print '</a>';
print '</td>'."\n";

View File

@ -201,7 +201,7 @@ class FormMargin
*/
public function displayMarginInfos($object, $force_price = false)
{
global $langs, $conf, $user;
global $langs, $conf, $user, $hookmanager;
if (!empty($user->socid)) {
return;
@ -213,88 +213,97 @@ class FormMargin
$marginInfo = $this->getMarginInfosArray($object, $force_price);
if (!empty($conf->global->MARGIN_ADD_SHOWHIDE_BUTTON)) { // TODO Warning this feature rely on an external js file that may be removed. Using native js function document.cookie should be better
print $langs->trans('ShowMarginInfos').' : ';
$hidemargininfos = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']); // Clean cookie
print '<span id="showMarginInfos" class="linkobject '.(!empty($hidemargininfos) ? '' : 'hideobject').'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</span>';
print '<span id="hideMarginInfos" class="linkobject '.(!empty($hidemargininfos) ? 'hideobject' : '').'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</span>';
$parameters=array('marginInfo'=>$marginInfo);
$reshook = $hookmanager->executeHooks('displayMarginInfos', $parameters, $object, $action);
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
} elseif (empty($reshook)) {
if (!empty($conf->global->MARGIN_ADD_SHOWHIDE_BUTTON)) { // TODO Warning this feature rely on an external js file that may be removed. Using native js function document.cookie should be better
print $langs->trans('ShowMarginInfos') . ' : ';
$hidemargininfos = preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['DOLUSER_MARGININFO_HIDE_SHOW']); // Clean cookie
print '<span id="showMarginInfos" class="linkobject ' . (!empty($hidemargininfos) ? '' : 'hideobject') . '">' . img_picto($langs->trans("Disabled"), 'switch_off') . '</span>';
print '<span id="hideMarginInfos" class="linkobject ' . (!empty($hidemargininfos) ? 'hideobject' : '') . '">' . img_picto($langs->trans("Enabled"), 'switch_on') . '</span>';
print '<script>$(document).ready(function() {
$("span#showMarginInfos").click(function() { $.getScript( "'.dol_buildpath('/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js', 1).'", function( data, textStatus, jqxhr ) { $.cookie("DOLUSER_MARGININFO_HIDE_SHOW", 0); $(".margininfos").show(); $("span#showMarginInfos").addClass("hideobject"); $("span#hideMarginInfos").removeClass("hideobject");})});
$("span#hideMarginInfos").click(function() { $.getScript( "'.dol_buildpath('/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js', 1).'", function( data, textStatus, jqxhr ) { $.cookie("DOLUSER_MARGININFO_HIDE_SHOW", 1); $(".margininfos").hide(); $("span#hideMarginInfos").addClass("hideobject"); $("span#showMarginInfos").removeClass("hideobject");})});
print '<script>$(document).ready(function() {
$("span#showMarginInfos").click(function() { $.getScript( "' . dol_buildpath('/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js', 1) . '", function( data, textStatus, jqxhr ) { $.cookie("DOLUSER_MARGININFO_HIDE_SHOW", 0); $(".margininfos").show(); $("span#showMarginInfos").addClass("hideobject"); $("span#hideMarginInfos").removeClass("hideobject");})});
$("span#hideMarginInfos").click(function() { $.getScript( "' . dol_buildpath('/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js', 1) . '", function( data, textStatus, jqxhr ) { $.cookie("DOLUSER_MARGININFO_HIDE_SHOW", 1); $(".margininfos").hide(); $("span#hideMarginInfos").addClass("hideobject"); $("span#showMarginInfos").removeClass("hideobject");})});
});</script>';
if (!empty($hidemargininfos)) {
print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>';
if (!empty($hidemargininfos)) {
print '<script>$(document).ready(function() {$(".margininfos").hide();});</script>';
}
}
}
print '<div class="div-table-responsive-no-min">';
print '<!-- Margin table -->'."\n";
print '<div class="div-table-responsive-no-min">';
print '<!-- Margin table -->' . "\n";
print '<table class="noborder margintable centpercent">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">'.$langs->trans('Margins').'</td>';
print '<td class="liste_titre right">'.$langs->trans('SellingPrice').'</td>';
if ($conf->global->MARGIN_TYPE == "1") {
print '<td class="liste_titre right">'.$langs->trans('BuyingPrice').'</td>';
} else {
print '<td class="liste_titre right">'.$langs->trans('CostPrice').'</td>';
}
print '<td class="liste_titre right">'.$langs->trans('Margin').'</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
print '<td class="liste_titre right">'.$langs->trans('MarginRate').'</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
print '<td class="liste_titre right">'.$langs->trans('MarkRate').'</td>';
}
print '</tr>';
if (!empty($conf->product->enabled)) {
//if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans('MarginOnProducts').'</td>';
print '<td class="right">'.price($marginInfo['pv_products']).'</td>';
print '<td class="right">'.price($marginInfo['pa_products']).'</td>';
print '<td class="right">'.price($marginInfo['margin_on_products']).'</td>';
print '<table class="noborder margintable centpercent">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">' . $langs->trans('Margins') . '</td>';
print '<td class="liste_titre right">' . $langs->trans('SellingPrice') . '</td>';
if ($conf->global->MARGIN_TYPE == "1") {
print '<td class="liste_titre right">' . $langs->trans('BuyingPrice') . '</td>';
} else {
print '<td class="liste_titre right">' . $langs->trans('CostPrice') . '</td>';
}
print '<td class="liste_titre right">' . $langs->trans('Margin') . '</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
print '<td class="right">'.(($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], null, null, null, null, 2).'%').'</td>';
print '<td class="liste_titre right">' . $langs->trans('MarginRate') . '</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
print '<td class="right">'.(($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], null, null, null, null, 2).'%').'</td>';
print '<td class="liste_titre right">' . $langs->trans('MarkRate') . '</td>';
}
print '</tr>';
}
if (!empty($conf->service->enabled)) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans('MarginOnServices').'</td>';
print '<td class="right">'.price($marginInfo['pv_services']).'</td>';
print '<td class="right">'.price($marginInfo['pa_services']).'</td>';
print '<td class="right">'.price($marginInfo['margin_on_services']).'</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
print '<td class="right">'.(($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], null, null, null, null, 2).'%').'</td>';
if (!empty($conf->product->enabled)) {
//if ($marginInfo['margin_on_products'] != 0 && $marginInfo['margin_on_services'] != 0) {
print '<tr class="oddeven">';
print '<td>' . $langs->trans('MarginOnProducts') . '</td>';
print '<td class="right">' . price($marginInfo['pv_products']) . '</td>';
print '<td class="right">' . price($marginInfo['pa_products']) . '</td>';
print '<td class="right">' . price($marginInfo['margin_on_products']) . '</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
print '<td class="right">' . (($marginInfo['margin_rate_products'] == '') ? '' : price($marginInfo['margin_rate_products'], null, null, null, null, 2) . '%') . '</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
print '<td class="right">' . (($marginInfo['mark_rate_products'] == '') ? '' : price($marginInfo['mark_rate_products'], null, null, null, null, 2) . '%') . '</td>';
}
print '</tr>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
print '<td class="right">'.(($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], null, null, null, null, 2).'%').'</td>';
}
print '</tr>';
}
if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) {
print '<tr class="liste_total">';
print '<td>'.$langs->trans('TotalMargin').'</td>';
print '<td class="right">'.price($marginInfo['pv_total']).'</td>';
print '<td class="right">'.price($marginInfo['pa_total']).'</td>';
print '<td class="right">'.price($marginInfo['total_margin']).'</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
print '<td class="right">'.(($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2).'%').'</td>';
if (!empty($conf->service->enabled)) {
print '<tr class="oddeven">';
print '<td>' . $langs->trans('MarginOnServices') . '</td>';
print '<td class="right">' . price($marginInfo['pv_services']) . '</td>';
print '<td class="right">' . price($marginInfo['pa_services']) . '</td>';
print '<td class="right">' . price($marginInfo['margin_on_services']) . '</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
print '<td class="right">' . (($marginInfo['margin_rate_services'] == '') ? '' : price($marginInfo['margin_rate_services'], null, null, null, null, 2) . '%') . '</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
print '<td class="right">' . (($marginInfo['mark_rate_services'] == '') ? '' : price($marginInfo['mark_rate_services'], null, null, null, null, 2) . '%') . '</td>';
}
print '</tr>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
print '<td class="right">'.(($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2).'%').'</td>';
if (!empty($conf->product->enabled) && !empty($conf->service->enabled)) {
print '<tr class="liste_total">';
print '<td>' . $langs->trans('TotalMargin') . '</td>';
print '<td class="right">' . price($marginInfo['pv_total']) . '</td>';
print '<td class="right">' . price($marginInfo['pa_total']) . '</td>';
print '<td class="right">' . price($marginInfo['total_margin']) . '</td>';
if (!empty($conf->global->DISPLAY_MARGIN_RATES)) {
print '<td class="right">' . (($marginInfo['total_margin_rate'] == '') ? '' : price($marginInfo['total_margin_rate'], null, null, null, null, 2) . '%') . '</td>';
}
if (!empty($conf->global->DISPLAY_MARK_RATES)) {
print '<td class="right">' . (($marginInfo['total_mark_rate'] == '') ? '' : price($marginInfo['total_mark_rate'], null, null, null, null, 2) . '%') . '</td>';
}
print '</tr>';
}
print '</tr>';
print $hookmanager->resPrint;
print '</table>';
print '</div>';
} elseif ($reshook > 0) {
print $hookmanager->resPrint;
}
print '</table>';
print '</div>';
}
}

View File

@ -77,7 +77,8 @@ abstract class DoliDB implements Database
*/
public function ifsql($test, $resok, $resko)
{
return 'IF('.$test.','.$resok.','.$resko.')';
//return 'IF('.$test.','.$resok.','.$resko.')'; // Not sql standard
return '(CASE WHEN '.$test.' THEN '.$resok.' ELSE '.$resko.' END)';
}
/**

View File

@ -158,7 +158,7 @@ if (empty($conf->global->MAIN_PRINT_DISABLELINK) && empty($conf->global->MAIN_OP
}
}
$qs.=(($qs && $morequerystring)?'&':'').$morequerystring;
$text ='<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank">';
$text ='<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?'.$qs.($qs?'&':'').'optioncss=print" target="_blank" rel="noopener noreferrer">';
//$text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer_top.png', 'class="printer"');
$text.='<span class="fa fa-print atoplogin"></span>';
$text.='</a>';
@ -191,7 +191,7 @@ if (empty($conf->global->MAIN_HELP_DISABLELINK) && empty($conf->global->MAIN_OPT
$title=$appli.'<br>';
$title.=$langs->trans($mode == 'wiki' ? 'GoToWikiHelpPage': 'GoToHelpPage');
if ($mode == 'wiki') $title.=' - '.$langs->trans("PageWiki").' &quot;'.dol_escape_htmltag(strtr($helppage,'_',' ')).'&quot;';
$text.='<a class="help" target="_blank" rel="noopener" href="';
$text.='<a class="help" target="_blank" rel="noopener noreferrer" href="';
if ($mode == 'wiki') $text.=sprintf($helpbaseurl,urlencode(html_entity_decode($helppage)));
else $text.=sprintf($helpbaseurl,$helppage);
$text.='">';

View File

@ -295,7 +295,7 @@ function societe_prepare_head(Societe $object)
// Notifications
if (!empty($conf->notification->enabled)) {
$nbNotif = 0;
// Enable caching of thirdrparty count notifications
// Enable caching of thirdparty count notifications
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
$cachekey = 'count_notifications_thirdparty_'.$object->id;
$dataretrieved = dol_getcache($cachekey);

View File

@ -100,10 +100,10 @@ function dol_print_cron_urls()
print '<div class="div-table-responsive-no-min">';
print $langs->trans("URLToLaunchCronJobs").':<br>';
$url = $urlwithroot.'/public/cron/cron_run_jobs_by_url.php?'.(empty($conf->global->CRON_KEY) ? '' : 'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login;
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.$url."</a><br>\n";
print ' '.$langs->trans("OrToLaunchASpecificJob").'<br>';
$url = $urlwithroot.'/public/cron/cron_run_jobs_by_url.php?'.(empty($conf->global->CRON_KEY) ? '' : 'securitykey='.$conf->global->CRON_KEY.'&').'userlogin='.$user->login.'&id=cronjobid';
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.$url."</a><br>\n";
print '</div>';
print '<br>';

View File

@ -66,10 +66,6 @@ function show_skin($fuser, $edit = 0)
// Title
print '<tr class="liste_titre"><th width="35%">'.$langs->trans("DefaultSkin").'</th>';
print '<th class="right">';
$url = 'http://ckeditor.com/addons/skins/all';
/*print '<a href="'.$url.'" target="_blank">';
print $langs->trans('DownloadMoreSkins');
print '</a>';*/
print '</th></tr>';
print '<tr class="oddeven">';

View File

@ -2887,7 +2887,7 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor
} else {
if (!empty($dictsocialnetworks[$type]['url'])) {
$link = str_replace('{socialid}', $value, $dictsocialnetworks[$type]['url']);
$htmllink .= '&nbsp;<a href="'.$link.'" target="_blank">'.$value.'</a>';
$htmllink .= '&nbsp;<a href="'.$link.'" target="_blank" rel="noopener noreferrer">'.$value.'</a>';
} else {
$htmllink .= $value;
}
@ -3140,7 +3140,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
// Old method
$newphone = '<a href="'.$url.'"';
if (!empty($conf->global->CLICKTODIAL_FORCENEWTARGET)) {
$newphone .= ' target="_blank"';
$newphone .= ' target="_blank" rel="noopener noreferrer"';
}
$newphone .= '>'.$newphonesav.'</a>';
}
@ -8132,10 +8132,10 @@ function dol_getIdFromCode($db, $key, $tablename, $fieldkey = 'code', $fieldid =
/**
* Verify if condition in string is ok or not
*
* @param string $strRights String with condition to check
* @return boolean True or False. Return True if strRights is ''
* @param string $strToEvaluate String with condition to check
* @return boolean True or False. Note: It returns True if $strToEvaluate is ''
*/
function verifCond($strRights)
function verifCond($strToEvaluate)
{
global $user, $conf, $langs;
global $leftmenu;
@ -8143,8 +8143,8 @@ function verifCond($strRights)
//print $strRights."<br>\n";
$rights = true;
if ($strRights != '') {
$str = 'if(!('.$strRights.')) { $rights = false; }';
if ($strToEvaluate !== '') {
$str = 'if(!('.$strToEvaluate.')) { $rights = false; }';
dol_eval($str); // The dol_eval must contains all the global $xxx used into a condition
}
return $rights;
@ -9157,9 +9157,9 @@ function ajax_autoselect($htmlname, $addlink = '', $textonlink = 'Link')
</script>';
if ($addlink) {
if ($textonlink === 'image') {
$out .= ' <a href="'.$addlink.'" target="_blank">'.img_picto('', 'globe').'</a>';
$out .= ' <a href="'.$addlink.'" target="_blank" rel="noopener noreferrer">'.img_picto('', 'globe').'</a>';
} else {
$out .= ' <a href="'.$addlink.'" target="_blank">'.$langs->trans("Link").'</a>';
$out .= ' <a href="'.$addlink.'" target="_blank" rel="noopener noreferrer">'.$langs->trans("Link").'</a>';
}
}
return $out;

View File

@ -187,7 +187,7 @@ 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="quatrevingtpercentminusx" value="'.$url.'">';
$out .= '<a class="" href="'.$url.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
$out .= '<a class="" href="'.$url.'" target="_blank" rel="noopener noreferrer">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
$out .= '</div>';
$out .= ajax_autoselect("onlinepaymenturl", 0);
return $out;
@ -205,7 +205,7 @@ function getHtmlOnlinePaymentLink($type, $ref, $label = '')
{
$url = getOnlinePaymentUrl(0, $type, $ref);
$label = $label ? $label : $url;
return'<a href="'.$url.'" target="_blank">'.$label.'</a>';
return '<a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.$label.'</a>';
}

View File

@ -41,7 +41,7 @@ function showOnlineSignatureUrl($type, $ref)
} else {
$out .= '<input type="text" id="onlinesignatureurl" class="quatrevingtpercentminusx" value="'.$url.'">';
}
$out .= '<a class="" href="'.$url.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
$out .= '<a class="" href="'.$url.'" target="_blank" rel="noopener noreferrer">'.img_picto('', 'globe', 'class="paddingleft"').'</a>';
$out .= '</div>';
$out .= ajax_autoselect("onlinesignatureurl", 0);
return $out;

View File

@ -164,7 +164,7 @@ function showDirectPublicLink($object)
if ($url) {
$out .= '<div class="urllink">';
$out .= '<input type="text" id="directpubliclink" class="quatrevingtpercentminusx" value="'.$url.'">';
$out .= '<a href="'.$url.'" target="_blank" rel="noopener">'.img_picto('', 'object_globe.png', 'class="paddingleft"').'</a>';
$out .= '<a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.img_picto('', 'object_globe.png', 'class="paddingleft"').'</a>';
$out .= '</div>';
$out .= ajax_autoselect("directpubliclink", 0);
} else {
@ -850,7 +850,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
$class .= ' documentpreview';
}
$footer .= '<a href="'.$doclink.'" class="btn-link '.$class.'" target="_blank" '.$mimeAttr.' >';
$footer .= '<a href="'.$doclink.'" class="btn-link '.$class.'" target="_blank" rel="noopener noreferrer" '.$mimeAttr.' >';
$footer .= img_mime($filePath).' '.$doc->filename;
$footer .= '</a>';

View File

@ -364,7 +364,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
print '</th>';
print '<th class="right">';
$url = 'https://www.dolistore.com/9-skins';
print '<a href="'.$url.'" target="_blank">';
print '<a href="'.$url.'" target="_blank" rel="noopener noreferrer external">';
print $langs->trans('DownloadMoreSkins');
print '</a>';
print '</th></tr>';

View File

@ -836,7 +836,7 @@ function getSocialNetworkSharingLinks()
// Reddit
$out .= '<div class="dol-social-share-reddit">'."\n";
$out .= '<a href="https://www.reddit.com/submit" target="_blank" onclick="window.location = \'https://www.reddit.com/submit?url='.$fullurl.'\'; return false">';
$out .= '<a href="https://www.reddit.com/submit" target="_blank" rel="noopener noreferrer external" onclick="window.location = \'https://www.reddit.com/submit?url='.$fullurl.'\'; return false">';
$out .= '<span class="dol-social-share-reddit-span">Reddit</span>';
$out .= '</a>';
$out .= '</div>'."\n";

View File

@ -523,7 +523,7 @@ function showWebsiteTemplates(Website $website)
print '</th>';
print '<th class="right">';
$url = 'https://www.dolistore.com/43-web-site-templates';
print '<a href="'.$url.'" target="_blank">';
print '<a href="'.$url.'" target="_blank" rel="noopener noreferrer external">';
print $langs->trans('DownloadMoreSkins');
print '</a>';
print '</th></tr>';

View File

@ -2104,7 +2104,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
print '</div>'."\n";
$lastlevel0 = 'enabled';
} elseif ($showmenu) { // Not enabled but visible (so greyed)
print '<div class="menu_titre">'.$tabstring.'<span class="vmenudisabled">'.$menu_array[$i]['titre'].'</span></div>'."\n";
print '<div class="menu_titre">'.$tabstring;
print '<span class="vmenudisabled">';
print ($menu_array[$i]['prefix'] ? $menu_array[$i]['prefix'] : '').$menu_array[$i]['titre'];
print '</span>';
print '</div>'."\n";
$lastlevel0 = 'greyed';
} else {
$lastlevel0 = 'hidden';
@ -2145,7 +2149,8 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
// Not enabled but visible (so greyed), except if parent was not enabled.
print '<div class="menu_contenu'.$cssmenu.'">';
print $tabstring;
print '<span class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</span><br></div>'."\n";
print '<span class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</span><br>';
print '</div>'."\n";
}
}

View File

@ -197,6 +197,13 @@ class modSociete extends DolibarrModules
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
$this->rights[$r][4] = 'export';
$r++;
$this->rights[$r][0] = 130;
$this->rights[$r][1] = 'Modify thirdparty information payment';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'thirdparty_paymentinformation_advance'; // Visible if option MAIN_USE_ADVANCED_PERMS is on
$this->rights[$r][5] = 'write';
// 262 : Restrict access to sales representative
$r++;
$this->rights[$r][0] = 262;

View File

@ -90,8 +90,10 @@ class modWorkflow extends DolibarrModules
3=>array('WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_SHIPPED_SHIPPING_CLOSED', 0, 'current', 0),
4=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER', 0, 'current', 0),
5=>array('WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_BILLED_SUPPLIER_PROPOSAL', 0, 'current', 0),
6=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 0, 'current', 0),
7=>array('WORKFLOW_BILL_ON_RECEPTION', 'chaine', '1', 'WORKFLOW_BILL_ON_RECEPTION', 0, 'current', 0)
6=>array('WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION', 0, 'current', 0),
7=>array('WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED', 'chaine', '1', 'WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED', 0, 'current', 0),
8=>array('WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 'chaine', '1', 'WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_SUPPLIER_ORDER', 0, 'current', 0),
9=>array('WORKFLOW_BILL_ON_RECEPTION', 'chaine', '1', 'WORKFLOW_BILL_ON_RECEPTION', 0, 'current', 0)
);
// Boxes

View File

@ -258,7 +258,7 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
}
}
$dir = $conf->usergroup->dir_output;
$dir = $conf->user->dir_output.'/usergroups';
$objectref = dol_sanitizeFileName($object->ref);
if (!preg_match('/specimen/i', $objectref)) {
$dir .= "/".$objectref;

View File

@ -111,17 +111,17 @@ if ($permission) {
<div class="tagtd"><?php echo $conf->global->MAIN_INFO_SOCIETE_NOM; ?></div>
<!-- <div class="nowrap tagtd"><?php echo img_object('', 'user').' '.$langs->trans("Users"); ?></div> -->
<div class="tagtd maxwidthonsmartphone"><?php echo img_object('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, '', 0, '', 'minwidth200imp'); ?></div>
<div class="tagtd maxwidthonsmartphone"><?php echo img_object('', 'user', 'class="pictofixedwidth"').$form->select_dolusers($user->id, 'userid', 0, (!empty($userAlreadySelected) ? $userAlreadySelected : null), 0, null, null, 0, 56, 0, '', 0, '', 'minwidth100imp widthcentpercentminusxx maxwidth400'); ?></div>
<div class="tagtd maxwidthonsmartphone">
<?php
$tmpobject = $object;
if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) {
$tmpobject = $objectsrc;
}
$formcompany->selectTypeContact($tmpobject, '', 'type', 'internal');
$formcompany->selectTypeContact($tmpobject, '', 'type', 'internal', 'position', 0, 'minwidth125imp widthcentpercentminusx maxwidth400');
?></div>
<div class="tagtd">&nbsp;</div>
<div class="tagtd center"><input type="submit" class="button" value="<?php echo $langs->trans("Add"); ?>"></div>
<div class="tagtd center"><input type="submit" class="button small" value="<?php echo $langs->trans("Add"); ?>"></div>
</form>
<?php
@ -163,14 +163,14 @@ if ($permission) {
if (($object->element == 'shipping' || $object->element == 'reception') && is_object($objectsrc)) {
$tmpobject = $objectsrc;
}
$formcompany->selectTypeContact($tmpobject, $preselectedtypeofcontact, 'typecontact', 'external', 'position', 0, 'minwidth100imp');
$formcompany->selectTypeContact($tmpobject, $preselectedtypeofcontact, 'typecontact', 'external', 'position', 0, 'minwidth125imp widthcentpercentminusx maxwidth400');
?>
</div>
<div class="tagtd noborderbottom">&nbsp;</div>
<div class="tagtd center noborderbottom">
<input type="submit" id="add-customer-contact" class="button" value="<?php echo $langs->trans("Add"); ?>"<?php if (!$nbofcontacts) {
<input type="submit" id="add-customer-contact" class="button small" value="<?php echo $langs->trans("Add"); ?>"<?php if (!$nbofcontacts) {
echo ' disabled';
} ?>>
} ?>>
</div>
</form>

View File

@ -147,7 +147,7 @@ $(document).ready(function () {
<div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
<?php
if ($disablenofollow) {
echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank">';
echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank" rel="noopener noreferrer external">';
}
echo dol_escape_htmltag($title);
if ($disablenofollow) {
@ -291,7 +291,7 @@ if ($forgetpasslink || $helpcenterlink) {
if (!empty($conf->global->MAIN_HELPCENTER_LINKTOUSE)) {
$url = $conf->global->MAIN_HELPCENTER_LINKTOUSE;
}
echo '<a class="alogin" href="'.dol_escape_htmltag($url).'" target="_blank">';
echo '<a class="alogin" href="'.dol_escape_htmltag($url).'" target="_blank" rel="noopener noreferrer">';
echo $langs->trans('NeedHelpCenter');
echo '</a>';
}

View File

@ -99,7 +99,7 @@ $(document).ready(function () {
<div class="login_table_title center" title="<?php echo dol_escape_htmltag($title); ?>">
<?php
if (!empty($disablenofollow)) {
echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank">';
echo '<a class="login_table_title" href="https://www.dolibarr.org" target="_blank" rel="noopener noreferrer external">';
}
echo dol_escape_htmltag($title);
if (!empty($disablenofollow)) {

View File

@ -188,7 +188,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
return $ret;
}
// classify billed order & billed propososal
// classify billed order & billed proposal
if ($action == 'BILL_SUPPLIER_VALIDATE') {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
@ -286,6 +286,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
}
// If we validate or close a shipment
if (($action == 'SHIPPING_VALIDATE') || ($action == 'SHIPPING_CLOSED')) {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
@ -354,6 +355,75 @@ class InterfaceWorkflowManager extends DolibarrTriggers
}
}
// If we validate or close a shipment
if (($action == 'RECEPTION_VALIDATE') || ($action == 'RECEPTION_CLOSED')) {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if ((!empty($conf->fournisseur->enabled) || !empty($conf->supplier_order->enabled)) && !empty($conf->reception->enabled) && !empty($conf->workflow->enabled) &&
(
(!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION) && ($action == 'RECEPTION_VALIDATE')) ||
(!empty($conf->global->WORKFLOW_ORDER_CLASSIFY_RECEIVED_RECEPTION_CLOSED) && ($action == 'RECEPTION_CLOSED'))
)
) {
$qtyshipped = array();
$qtyordred = array();
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
// Find all reception on purchase order origin
$order = new CommandeFournisseur($this->db);
$ret = $order->fetch($object->origin_id);
if ($ret < 0) {
$this->error = $order->error;
$this->errors = $order->errors;
return $ret;
}
$ret = $order->fetchObjectLinked($order->id, 'supplier_order', null, 'reception');
if ($ret < 0) {
$this->error = $order->error;
$this->errors = $order->errors;
return $ret;
}
//Build array of quantity received by product for a purchase order
if (is_array($order->linkedObjects) && count($order->linkedObjects) > 0) {
foreach ($order->linkedObjects as $type => $shipping_array) {
if ($type == 'reception' && is_array($shipping_array) && count($shipping_array) > 0) {
foreach ($shipping_array as $shipping) {
if (is_array($shipping->lines) && count($shipping->lines) > 0) {
foreach ($shipping->lines as $shippingline) {
$qtyshipped[$shippingline->fk_product] += $shippingline->qty;
}
}
}
}
}
}
//Build array of quantity ordered to be received
if (is_array($order->lines) && count($order->lines) > 0) {
foreach ($order->lines as $orderline) {
// Exclude lines not qualified for shipment, similar code is found into calcAndSetStatusDispatch() for vendors
if (empty($conf->global->STOCK_SUPPORTS_SERVICES) && $orderline->product_type > 0) {
continue;
}
$qtyordred[$orderline->fk_product] += $orderline->qty;
}
}
//dol_syslog(var_export($qtyordred,true),LOG_DEBUG);
//dol_syslog(var_export($qtyshipped,true),LOG_DEBUG);
//Compare array
$diff_array = array_diff_assoc($qtyordred, $qtyshipped);
if (count($diff_array) == 0) {
//No diff => mean everythings is received
$ret = $order->setStatut(CommandeFournisseur::STATUS_RECEIVED_COMPLETELY, $object->origin_id, $object->origin, 'SUPPLIER_ORDER_CLOSE');
if ($ret < 0) {
$this->error = $order->error;
$this->errors = $order->errors;
return $ret;
}
}
}
}
return 0;
}

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT."/core/class/html.formcron.class.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/cron.lib.php';
// Load translation files required by the page
$langs->loadLangs(array('admin', 'cron', 'members'));
$langs->loadLangs(array('admin', 'cron', 'members', 'bills'));
$id = GETPOST('id', 'int');
$action = GETPOST('action', 'aZ09');

View File

@ -1081,7 +1081,7 @@ class Cronjob extends CommonObject
dol_syslog("We try to run a job in entity ".$this->entity." when we are in entity ".$conf->entity, LOG_WARNING);
}
$savcurrententity = $conf->entity;
$conf->entity = $this->entity;
$conf->setEntityValues($this->entity);
dol_syslog(get_class($this)."::run_jobs entity for running job is ".$conf->entity);
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
@ -1090,13 +1090,13 @@ class Cronjob extends CommonObject
if ($result < 0) {
$this->error = "User Error:".$user->error;
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
$conf->entity = $savcurrententity;
$conf->setEntityValues($savcurrententity);
return -1;
} else {
if (empty($user->id)) {
$this->error = " User user login:".$userlogin." do not exists";
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
$conf->entity = $savcurrententity;
$conf->setEntityValues($savcurrententity);
return -1;
}
}
@ -1126,7 +1126,7 @@ class Cronjob extends CommonObject
$result = $this->update($user); // This include begin/commit
if ($result < 0) {
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
$conf->entity = $savcurrententity;
$conf->setEntityValues($savcurrententity);
return -1;
}
@ -1241,7 +1241,7 @@ class Cronjob extends CommonObject
if ($ret === false) {
$this->error = $langs->trans('CronCannotLoadLib').': '.$libpath;
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
$conf->entity = $savcurrententity;
$conf->setEntityValues($savcurrententity);
return -1;
}
@ -1250,7 +1250,7 @@ class Cronjob extends CommonObject
$result = $langs->load($this->module_name.'@'.$this->module_name); // If this->module_name was an existing language file, this will make nothing
if ($result < 0) { // If technical error
dol_syslog(get_class($this)."::run_jobs Cannot load module langs".$langs->error, LOG_ERR);
$conf->entity = $savcurrententity;
$conf->setEntityValues($savcurrententity);
return -1;
}
@ -1316,11 +1316,11 @@ class Cronjob extends CommonObject
$result = $this->update($user); // This include begin/commit
if ($result < 0) {
dol_syslog(get_class($this)."::run_jobs ".$this->error, LOG_ERR);
$conf->entity = $savcurrententity;
$conf->setEntityValues($savcurrententity);
return -1;
}
$conf->entity = $savcurrententity;
$conf->setEntityValues($savcurrententity);
return $error ?-1 : 1;
}

View File

@ -359,11 +359,11 @@ class ActionsDatapolicy
</script>';
echo $dialog;
if ($parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?socid=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICIES_PORTABILITE").'</a></div>';
echo '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?socid=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICIES_PORTABILITE").'</a></div>';
} elseif ($parameters['currentcontext'] == 'membercard') {
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICIES_PORTABILITE").'</a></div>';
echo '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?rowid=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICIES_PORTABILITE").'</a></div>';
} elseif ($parameters['currentcontext'] == 'contactcard') {
echo '<div class="inline-block divButAction"><a target="_blank" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?id=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICIES_PORTABILITE").'</a></div>';
echo '<div class="inline-block divButAction"><a target="_blank" rel="noopener noreferrer" id="rpgpdbtn" class="butAction" href="'.$_SERVER["PHP_SELF"]."?id=".$object->id.'&action=datapolicy_portabilite" title="'.$langs->trans('DATAPOLICIES_PORTABILITE_TITLE').'">'.$langs->trans("DATAPOLICIES_PORTABILITE").'</a></div>';
}
if (!empty($object->mail) && empty($object->array_options['options_datapolicy_send']) && $parameters['currentcontext'] == 'thirdpartycard' && in_array($object->forme_juridique_code, array(11, 12, 13, 15, 17, 18, 19, 35, 60, 200, 311, 312, 316, 401, 600, 700, 1005)) || $object->typent_id == 8) {
echo '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"]."?socid=".$object->id.'&action=send_datapolicy" title="'.$langs->trans('DATAPOLICIES_SEND').'">'.$langs->trans("DATAPOLICIES_SEND").'</a></div>';

View File

@ -182,8 +182,8 @@ class DataPolicy
$deliveryreceipt = 0;
$substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&c='.$contact->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linkr.'</a>',
'__FIRSTNAME__' => $contact->firstname,
'__NAME__' => $contact->lastname,
'__CIVILITY__' => $contact->civility,
@ -259,8 +259,8 @@ class DataPolicy
$deliveryreceipt = 0;
$substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&s='.$societe->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linkr.'</a>',
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);
@ -332,8 +332,8 @@ class DataPolicy
$deliveryreceipt = 0;
$substitutionarray = array(
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank">'.$linkr.'</a>',
'__LINKACCEPT__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=1&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linka.'</a>',
'__LINKREFUSED__' => '<a href="'.dol_buildpath('/datapolicy/public/index.php?action=2&a='.$adherent->id.'&l='.$l.'&key='.$code, 3).'" target="_blank" rel="noopener noreferrer">'.$linkr.'</a>',
);
$subject = make_substitutions($subject, $substitutionarray);
$message = make_substitutions($message, $substitutionarray);

View File

@ -23,7 +23,7 @@ Module4100Desc = Module to manage Data Privacy (Conformity with the GDPR)
#
datapolicySetup = Module Data Privacy Policy Setup
Deletion = Deletion of data
datapolicySetupPage = Depending of laws of your countries (Example <a href="http://www.privacy-regulation.eu/en/5.htm" target="_blank">Article 5</a> of the GDPR), personal data must be kept for a period not exceeding that necessary for the purposes for which they were collected, except for archival purposes.<br>The deletion will be done automatically after a certain duration without event (the duration which you will have indicated below).
datapolicySetupPage = Depending of laws of your countries (Example <a href="http://www.privacy-regulation.eu/en/5.htm" target="_blank" rel="noopener noreferrer external">Article 5</a> of the GDPR), personal data must be kept for a period not exceeding that necessary for the purposes for which they were collected, except for archival purposes.<br>The deletion will be done automatically after a certain duration without event (the duration which you will have indicated below).
NB_MONTHS = %s months
ONE_YEAR = 1 year
NB_YEARS = %s years

View File

@ -27,7 +27,7 @@ Module4100Desc = Module de gestion de la protection des données (RGPD)
#
datapolicySetup = Configuration du module Protection des données
Settings_DATAPOLICY = Paramétrage du module Protection des données
datapolicySetupPage = Selon la loi de votre pays (Exemple <a href="http://www.privacy-regulation.eu/fr/5.htm" target="_blank">larticle 5</a> du RGPD), les données à caractère personnel doivent être conservées pendant une durée nexcédant pas celle nécessaire au regard des finalités pour lesquelles elles ont été traitées, à lexception de fins archivistiques. La suppression se fera automatiquement après une certaine durée sans évènement (la durée que vous aurez indiquée ci-dessous).
datapolicySetupPage = Selon la loi de votre pays (Exemple <a href="http://www.privacy-regulation.eu/fr/5.htm" target="_blank" rel="noopener noreferrer">larticle 5</a> du RGPD), les données à caractère personnel doivent être conservées pendant une durée nexcédant pas celle nécessaire au regard des finalités pour lesquelles elles ont été traitées, à lexception de fins archivistiques. La suppression se fera automatiquement après une certaine durée sans évènement (la durée que vous aurez indiquée ci-dessous).
NB_MONTHS = %s mois
ONE_YEAR = 1 an
NB_YEARS = %s ans

View File

@ -10,7 +10,7 @@ Module4100Desc = Conformità con GDPR
#
datapolicySetup = Module Setup
Settings_DATAPOLICY = Configurazione modulo GDPR
datapolicySetupPage = In accordo con <a href="http://www.privacy-regulation.eu/it/5.htm" target="_blank">l'art 5 del GDPR </a> i dati personali devono essere conservati per un periodo di tempo che .... ed eliminati se non sono più utili agli scopi per cui sono stati processati.
datapolicySetupPage = In accordo con <a href="http://www.privacy-regulation.eu/it/5.htm" target="_blank" rel="noopener noreferrer">l'art 5 del GDPR </a> i dati personali devono essere conservati per un periodo di tempo che .... ed eliminati se non sono più utili agli scopi per cui sono stati processati.
NB_MONTHS = %s mesi
ONE_YEAR = 1 anno
NB_YEARS = %s anni

View File

@ -1897,6 +1897,164 @@ class EmailCollector extends CommonObject
}
}
}
} elseif ($operation['type'] == 'recordjoinpiece') {
$pj = getAttachments($imapemail, $connection);
foreach ($pj as $key => $val) {
$data[$val['filename']] = getFileData($imapemail, $val['pos'], $val['type'], $connection);
}
if (count($pj) > 0) {
$sql = "SELECT rowid as id FROM " . MAIN_DB_PREFIX . "user WHERE email LIKE '%" . $from . "%'";
$resql = $this->db->query($sql);
if ($resql->num_rows == 0) {
$this->errors = 'User Not allowed to add documents';
}
$arrayobject = array(
'propale' => array('table' => 'propal',
'fields' => array('ref'),
'class' => 'comm/propal/class/propal.class.php',
'object' => 'Propal'),
'holiday' => array('table' => 'holiday',
'fields' => array('ref'),
'class' => 'holiday/class/holiday.class.php',
'object' => 'Holiday'),
'expensereport' => array('table' => 'expensereport',
'fields' => array('ref'),
'class' => 'expensereport/class/expensereport.class.php',
'object' => 'ExpenseReport'),
'recruitment/recruitmentjobposition' => array('table' => 'recruitment_recruitmentjobposition',
'fields' => array('ref'),
'class' => 'recruitment/class/recruitmentjobposition.class.php',
'object' => 'RecruitmentJobPosition'),
'recruitment/recruitmentjobposition' => array('table' => 'recruitment_recruitmentcandidature',
'fields' => array('ref'),
'class' => 'recruitment/class/recruitmentcandidature.class.php',
'object' => ' RecruitmentCandidature'),
'societe' => array('table' => 'societe',
'fields' => array('code_client', 'code_fournisseur'),
'class' => 'societe/class/societe.class.php',
'object' => 'Societe'),
'commande' => array('table' => 'commande',
'fields' => array('ref'),
'class' => 'commande/class/commande.class.php',
'object' => 'Commande'),
'expedition' => array('table' => 'expedition',
'fields' => array('ref'),
'class' => 'expedition/class/expedition.class.php',
'object' => 'Expedition'),
'contract' => array('table' => 'contrat',
'fields' => array('ref'),
'class' => 'contrat/class/contrat.class.php',
'object' => 'Contrat'),
'fichinter' => array('table' => 'fichinter',
'fields' => array('ref'),
'class' => 'fichinter/class/fichinter.class.php',
'object' => 'Fichinter'),
'ticket' => array('table' => 'ticket',
'fields' => array('ref'),
'class' => 'ticket/class/ticket.class.php',
'object' => ' Ticket'),
'knowledgemanagement' => array('table' => 'knowledgemanagement_knowledgerecord',
'fields' => array('ref'),
'class' => 'knowledgemanagement/class/knowledgemanagement.class.php',
'object' => 'KnowledgeRecord'),
'supplier_proposal' => array('table' => 'supplier_proposal',
'fields' => array('ref'),
'class' => 'supplier_proposal/class/supplier_proposal.class.php',
'object' => 'SupplierProposal'),
'fournisseur/commande' => array('table' => 'commande_fournisseur',
'fields' => array('ref', 'ref_supplier'),
'class' => 'fourn/class/fournisseur.commande.class.php',
'object' => 'SupplierProposal'),
'facture' => array('table' => 'facture',
'fields' => array('ref'),
'class' => 'compta/facture/class/facture.class.php',
'object' => 'Facture'),
'fournisseur/facture' => array('table' => 'facture_fourn',
'fields' => array('ref', ref_client),
'class' => 'fourn/class/fournisseur.facture.class.php',
'object' => 'FactureFournisseur'),
'produit' => array('table' => 'product',
'fields' => array('ref'),
'class' => 'product/class/product.class.php',
'object' => 'Product'),
'productlot' => array('table' => 'product_lot',
'fields' => array('batch'),
'class' => 'product/stock/class/productlot.class.php',
'object' => 'Productlot'),
'projet' => array('table' => 'projet',
'fields' => array('ref'),
'class' => 'projet/class/projet.class.php',
'object' => 'Project'),
'projet_task' => array('table' => 'projet_task',
'fields' => array('ref'),
'class' => 'projet/class/task.class.php',
'object' => 'Task'),
'ressource' => array('table' => 'resource',
'fields' => array('ref'),
'class' => 'ressource/class/dolressource.class.php',
'object' => 'Dolresource'),
'bom' => array('table' => 'bom_bom',
'fields' => array('ref'),
'class' => 'bom/class/bom.class.php',
'object' => 'BOM'),
'mrp' => array('table' => 'mrp_mo',
'fields' => array('ref'),
'class' => 'mrp/class/mo.class.php',
'object' => 'Mo'),
);
$hookmanager->initHooks(array('emailcolector'));
$parameters = array('arrayobject' => $arrayobject);
$reshook = $hookmanager->executeHooks('addmoduletoeamailcollectorjoinpiece', $parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $arrayobject = $hookmanager->resArray;
$resultobj = array();
foreach ($arrayobject as $key => $objectdesc) {
$sql = 'SELECT DISTINCT t.rowid ';
$sql .= ' FROM ' . MAIN_DB_PREFIX . $objectdesc['table'] . ' AS t';
$sql .= ' WHERE ';
foreach ($objectdesc['fields'] as $field) {
$sql .= "'" .$this->db->escape($subject) . "' LIKE CONCAT('%', t." . $field . ", '%') OR ";
}
$sql = substr($sql, 0, -4);
$ressqlobj = $this->db->query($sql);
if ($ressqlobj) {
while ($obj = $this->db->fetch_object($ressqlobj)) {
$resultobj[$key][] = $obj->rowid;
}
}
}
$dirs = array();
foreach ($resultobj as $mod => $ids) {
$moddesc = $arrayobject[$mod];
$elementpath = $mod;
dol_include_once($moddesc['class']);
$objectmanaged = new $moddesc['object']($this->db);
foreach ($ids as $val) {
$res = $objectmanaged->fetch($val);
if ($res) {
$path = ($objectmanaged->entity > 1 ? "/" . $objectmanaged->entity : '');
$dirs[] = DOL_DATA_ROOT . $path . "/" . $elementpath . '/' . dol_sanitizeFileName($objectmanaged->ref) . '/';
} else {
$this->errors = 'object not found';
}
}
}
foreach ($dirs as $target) {
foreach ($data as $filename => $content) {
$prefix = $this->actions[$this->id]['actionparam'];
$resr = saveAttachment($target, $prefix . '_' . $filename, $content);
if ($resr == -1) {
$this->errors = 'Doc not saved';
}
}
}
} else {
$this->errors = 'no joined piece';
}
} elseif ($operation['type'] == 'project') {
// Create project / lead
$projecttocreate = new Project($this->db);

View File

@ -85,3 +85,132 @@ function emailcollectorPrepareHead($object)
return $head;
}
/**
* Récupère les parties d'un message
* @param object $structure structure du message
* @return object|boolean parties du message|false en cas d'erreur
*/
function getParts($structure)
{
return isset($structure->parts) ? $structure->parts : false;
}
/**
* Tableau définissant la pièce jointe
* @param object $part partie du message
* @return object|boolean définition du message|false en cas d'erreur
*/
function getDParameters($part)
{
return $part->ifdparameters ? $part->dparameters : false;
}
/**
* Récupère les pièces d'un mail donné
* @param integer $jk numéro du mail
* @param object $mbox object connection imaap
* @return array type, filename, pos
*/
function getAttachments($jk, $mbox)
{
$structure = imap_fetchstructure($mbox, $jk);
$parts = getParts($structure);
$fpos = 2;
$attachments = array();
$nb = count($parts);
if ($parts && $nb) {
for ($i = 1; $i < $nb; $i++) {
$part = $parts[$i];
if ($part->ifdisposition && strtolower($part->disposition) == "attachment") {
$ext = $part->subtype;
$params = getDParameters($part);
if ($params) {
$filename = $part->dparameters[0]->value;
$filename = imap_utf8($filename);
$attachments[] = array('type' => $part->type, 'filename' => $filename, 'pos' => $fpos);
}
}
$fpos++;
}
}
return $attachments;
}
/**
* Récupère la contenu de la pièce jointe par rapport a sa position dans un mail donné
* @param integer $jk numéro du mail
* @param integer $fpos position de la pièce jointe
* @param integer $type type de la pièce jointe
* @param object $mbox object connection imaap
* @return mixed data
*/
function getFileData($jk, $fpos, $type, $mbox)
{
$mege = imap_fetchbody($mbox, $jk, $fpos);
$data = getDecodeValue($mege, $type);
return $data;
}
/**
* Sauvegarde de la pièce jointe dans le dossier défini avec un nom unique
* @param string $path chemin de sauvegarde dui fichier
* @param string $filename nom du fichier
* @param mixed $data contenu à sauvegarder
* @return string emplacement du fichier
**/
function saveAttachment($path, $filename, $data)
{
global $lang;
$tmp = explode('.', $filename);
$ext = array_pop($tmp);
$filename = implode('.', $tmp);
if (!file_exists($path)) {
if (dol_mkdir($path) < 0) {
return -1;
}
}
$i = 1;
$filepath = $path . $filename . '.' . $ext;
while (file_exists($filepath)) {
$filepath = $path . $filename . '(' . $i . ').' . $ext;
$i++;
}
file_put_contents($filepath, $data);
return $filepath;
}
/**
* Décode le contenu du message
* @param string $message message
* @param integer $coding type de contenu
* @return message décodé
**/
function getDecodeValue($message, $coding)
{
switch ($coding) {
case 0: //text
case 1: //multipart
$message = imap_8bit($message);
break;
case 2: //message
$message = imap_binary($message);
break;
case 3: //application
case 5: //image
case 6: //video
case 7: //other
$message = imap_base64($message);
break;
case 4: //audio
$message = imap_qprint($message);
break;
}
return $message;
}

View File

@ -523,7 +523,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
print '<div class="urllink"><input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$redirection.'">';
print '<a href="'.$redirection.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a></div>';
print '<a href="'.$redirection.'" target="_blank" rel="noopener noreferrer">'.img_picto('', 'globe', 'class="paddingleft"').'</a></div>';
print '</td>';
print '</tr>';
}

View File

@ -420,7 +420,7 @@ if ($projectid > 0) {
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
$message = '<a target="_blank" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message = '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.urlencode(getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY', '...'));
$message .= "&project=".$projectid.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
print $message;
@ -438,7 +438,7 @@ if ($projectid > 0) {
//print '<div class="urllink">';
//print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$linksuggest.'" class="quatrevingtpercent">'.$linksuggest.'</a></div>';
print '<a target="_blank" href="'.$linksuggest.'">'.img_picto('', 'globe').'</a>';
print '<a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.'">'.img_picto('', 'globe').'</a>';
//print '</div>';
//print ajax_autoselect("linkregister");
print '</td></tr>';
@ -455,7 +455,7 @@ if ($projectid > 0) {
//print '<div class="urllink">';
//print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$link_subscription.'" class="quatrevingtpercent">'.$link_subscription.'</a></div>';
print '<a target="_blank" href="'.$link_subscription.'">'.img_picto('', 'globe').'</a>';
print '<a target="_blank" rel="noopener noreferrer" rel="noopener noreferrer" href="'.$link_subscription.'">'.img_picto('', 'globe').'</a>';
//print '</div>';
//print ajax_autoselect("linkregister");
print '</td></tr>';

View File

@ -367,7 +367,7 @@ if (!empty($withproject)) {
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
$message = '<a target="_blank" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message = '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
print $message;
@ -385,7 +385,7 @@ if (!empty($withproject)) {
//print '<div class="urllink">';
//print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$linksuggest.'" class="quatrevingtpercent">'.$linksuggest.'</a></div>';
print '<a target="_blank" href="'.$linksuggest.'">'.img_picto('', 'globe').'</a>';
print '<a target="_blank" rel="noopener noreferrer" rel="noopener noreferrer" href="'.$linksuggest.'">'.img_picto('', 'globe').'</a>';
//print '</div>';
//print ajax_autoselect("linkregister");
print '</td></tr>';
@ -402,7 +402,7 @@ if (!empty($withproject)) {
//print '<div class="urllink">';
//print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$link_subscription.'" class="quatrevingtpercent">'.$link_subscription.'</a></div>';
print '<a target="_blank" href="'.$link_subscription.'">'.img_picto('', 'globe').'</a>';
print '<a target="_blank" rel="noopener noreferrer" href="'.$link_subscription.'">'.img_picto('', 'globe').'</a>';
//print '</div>';
//print ajax_autoselect("linkregister");
print '</td></tr>';

View File

@ -547,7 +547,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
$message = '<a target="_blank" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message = '<a target="_blank" rel="noopener noreferrer" href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'</a>';
print $message;
@ -564,8 +564,8 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print '<div class="urllink">';
//print '<input type="text" value="'.$linksuggest.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$linksuggest.'" class="quatrevingtpercent">'.$linksuggest.'</a></div>';
print '<a target="_blank" href="'.$linksuggest.'">'.img_picto('', 'globe').'</a>';
print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.'" class="quatrevingtpercent">'.$linksuggest.'</a></div>';
print '<a target="_blank" rel="noopener noreferrer" href="'.$linksuggest.'">'.img_picto('', 'globe').'</a>';
//print '</div>';
//print ajax_autoselect("linkregister");
print '</td></tr>';
@ -582,7 +582,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
//print '<div class="urllink">';
//print '<input type="text" value="'.$linkregister.'" id="linkregister" class="quatrevingtpercent paddingrightonly">';
print '<div class="tdoverflowmax200 inline-block valignmiddle"><a target="_blank" href="'.$link_subscription.'" class="quatrevingtpercent">'.$link_subscription.'</a></div>';
print '<a target="_blank" href="'.$link_subscription.'">'.img_picto('', 'globe').'</a>';
print '<a target="_blank" rel="noopener noreferrer" href="'.$link_subscription.'">'.img_picto('', 'globe').'</a>';
//print '</div>';
//print ajax_autoselect("linkregister");
print '</td></tr>';

View File

@ -9,7 +9,7 @@
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014-2017 Francis Appels <francis.appels@yahoo.com>
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com>
@ -368,11 +368,11 @@ class Expedition extends CommonObject
$num = count($this->lines);
for ($i = 0; $i < $num; $i++) {
if (!isset($this->lines[$i]->detail_batch)) { // no batch management
if (!$this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) > 0) {
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) <= 0) {
$error++;
}
} else { // with batch management
if (!$this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) > 0) {
if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) <= 0) {
$error++;
}
}
@ -414,7 +414,6 @@ class Expedition extends CommonObject
}
} else {
$error++;
$this->error = $this->db->lasterror()." - sql=$sql";
$this->db->rollback();
return -3;
}
@ -2138,7 +2137,7 @@ class Expedition extends CommonObject
if (!empty($tracking) && !empty($value)) {
$url = str_replace('{TRACKID}', $value, $tracking);
$this->tracking_url = sprintf('<a target="_blank" href="%s">'.($value ? $value : 'url').'</a>', $url, $url);
$this->tracking_url = sprintf('<a target="_blank" rel="noopener noreferrer" href="%s">'.($value ? $value : 'url').'</a>', $url, $url);
} else {
$this->tracking_url = $value;
}
@ -2771,21 +2770,23 @@ class ExpeditionLigne extends CommonObjectLine
// End call triggers
}
if (!$error) {
$this->db->commit();
return $this->id;
if ($error) {
foreach ($this->errors as $errmsg) {
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
}
}
foreach ($this->errors as $errmsg) {
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
}
$this->db->rollback();
return -1 * $error;
} else {
$error++;
}
if ($error) {
$this->db->rollback();
return -1;
} else {
$this->db->commit();
return $this->id;
}
}
/**

View File

@ -2149,7 +2149,7 @@ if ($action == 'create') {
$urlforhref = getAdvancedPreviewUrl($modulepart, $relativepath.'/'.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity));
if (empty($urlforhref)) {
$urlforhref = DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']));
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank">';
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank" rel="noopener noreferrer">';
} else {
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
}

View File

@ -38,7 +38,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) {
$urlforhref = getAdvancedPreviewUrl($modulepart, $relativepath.$fileinfo['filename'].'.'.strtolower($fileinfo['extension']), 1, '&entity='.(!empty($object->entity) ? $object->entity : $conf->entity));
if (empty($urlforhref)) {
$urlforhref = DOL_URL_ROOT.'/viewimage.php?modulepart='.$modulepart.'&entity='.(!empty($object->entity) ? $object->entity : $conf->entity).'&file='.urlencode($fileinfo['relativename'].'.'.strtolower($fileinfo['extension']));
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank">';
print '<a href="'.$urlforhref.'" class="aphoto" target="_blank" rel="noopener noreferrer">';
} else {
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
}
@ -85,7 +85,7 @@ if (empty($conf->global->EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES)) {
}
if (empty($urlforhref) || empty($thumbshown)) {
print '<span href="" class="aphoto" target="_blank">';
print '<span href="" class="aphoto" target="_blank" rel="noopener noreferrer">';
} else {
print '<a href="'.$urlforhref['url'].'" class="'.$urlforhref['css'].'" target="'.$urlforhref['target'].'" mime="'.$urlforhref['mime'].'">';
}

View File

@ -10,7 +10,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
@ -771,6 +771,7 @@ class CommandeFournisseur extends CommonOrder
if ($reshook > 0) {
return $hookmanager->resPrint;
}
return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode);
}
@ -2304,7 +2305,14 @@ class CommandeFournisseur extends CommonOrder
dol_syslog(get_class($this)."::Livraison");
if ($user->rights->fournisseur->commande->receptionner) {
$usercanreceive = 0;
if (empty($conf->reception->enabled)) {
$usercanreceive = $user->rights->fournisseur->commande->receptionner;
} else {
$usercanreceive = $user->rights->reception->creer;
}
if ($usercanreceive) {
// Define the new status
if ($type == 'par') {
$statut = self::STATUS_RECEIVED_PARTIALLY;

View File

@ -2282,6 +2282,7 @@ class FactureFournisseur extends CommonInvoice
if ($result) {
if ($this->db->num_rows($result)) {
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author) {
$cuser = new User($this->db);
@ -2298,8 +2299,8 @@ class FactureFournisseur extends CommonInvoice
$muser->fetch($obj->fk_user_modif);
$this->user_modification = $muser;
}
$this->date_creation = $this->db->idate($obj->datec);
$this->date_modification = $this->db->idate($obj->datem);
$this->date_creation = $this->db->jdate($obj->datec);
$this->date_modification = $this->db->jdate($obj->datem);
//$this->date_validation = $obj->datev; // This field is not available. Should be store into log table and using this function should be replaced with showing content of log (like for supplier orders)
}
$this->db->free($result);

View File

@ -92,7 +92,6 @@ $datelivraison = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('ordersuppliercard', 'globalcard'));
@ -126,6 +125,8 @@ if ($id > 0 || !empty($ref)) {
}
}
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
// Common permissions
$usercanread = ($user->rights->fournisseur->commande->lire || $user->rights->supplier_order->lire);
$usercancreate = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
@ -138,7 +139,11 @@ $usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($us
$usercanapprove = $user->rights->fournisseur->commande->approuver;
$usercanapprovesecond = $user->rights->fournisseur->commande->approve2;
$usercanorder = $user->rights->fournisseur->commande->commander;
$usercanreceived = $user->rights->fournisseur->commande->receptionner;
if (empty($conf->reception->enabled)) {
$usercanreceive = $user->rights->fournisseur->commande->receptionner;
} else {
$usercanreceive = $user->rights->reception->creer;
}
// Permissions for includes
$permissionnote = $usercancreate; // Used by the include of actions_setnotes.inc.php

View File

@ -62,11 +62,6 @@ $confirm = GETPOST('confirm', 'alpha');
if ($user->socid) {
$socid = $user->socid;
}
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
if (empty($conf->stock->enabled)) {
accessforbidden();
}
$hookmanager->initHooks(array('ordersupplierdispatch'));
@ -89,6 +84,21 @@ if ($id > 0 || !empty($ref)) {
}
}
if (empty($conf->reception->enabled)) {
$permissiontoreceive = $user->rights->fournisseur->commande->receptionner;
$permissiontocontrol = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->fournisseur->commande_advance->check)));
} else {
$permissiontoreceive = $user->rights->reception->creer;
$permissiontocontrol = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->reception->reception_advance->validate)));
}
// $id is id of a purchase order.
$result = restrictedArea($user, 'fournisseur', $id, 'commande_fournisseur', 'commande');
if (empty($conf->stock->enabled)) {
accessforbidden();
}
/*
* Actions
@ -100,7 +110,7 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if ($action == 'checkdispatchline' && !((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) {
if ($action == 'checkdispatchline' && $permissiontocontrol) {
$error = 0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
@ -137,7 +147,7 @@ if ($action == 'checkdispatchline' && !((empty($conf->global->MAIN_USE_ADVANCED_
}
}
if ($action == 'uncheckdispatchline' && !((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) {
if ($action == 'uncheckdispatchline' && $permissiontocontrol) {
$error = 0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
@ -173,7 +183,7 @@ if ($action == 'uncheckdispatchline' && !((empty($conf->global->MAIN_USE_ADVANCE
}
}
if ($action == 'denydispatchline' && !((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check)))) {
if ($action == 'denydispatchline' && $permissiontocontrol) {
$error = 0;
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
@ -209,7 +219,7 @@ if ($action == 'denydispatchline' && !((empty($conf->global->MAIN_USE_ADVANCED_P
}
}
if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) {
if ($action == 'dispatch' && $permissiontoreceive) {
$error = 0;
$db->begin();
@ -387,7 +397,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner)
}
// Remove a dispatched line
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fournisseur->commande->receptionner) {
if ($action == 'confirm_deleteline' && $confirm == 'yes' && $permissiontoreceive) {
$db->begin();
$supplierorderdispatch = new CommandeFournisseurDispatch($db);
@ -430,7 +440,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fourn
}
// Update a dispatched line
if ($action == 'updateline' && $user->rights->fournisseur->commande->receptionner) {
if ($action == 'updateline' && $permissiontoreceive) {
$db->begin();
$error = 0;
@ -751,9 +761,9 @@ if ($id > 0 || !empty($ref)) {
// Select warehouse to force it everywhere
if (count($listwarehouses) > 1) {
print '<br>'.$langs->trans("ForceTo").' '.$form->selectarray('fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 1, 0, 0, '', 0, 0, $disabled, '', 'minwidth100 maxwidth300', 1);
print '<br><span class="opacitymedium">'.$langs->trans("ForceTo").'</span> '.$form->selectarray('fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 1, 0, 0, '', 0, 0, $disabled, '', 'minwidth100 maxwidth300', 1);
} elseif (count($listwarehouses) == 1) {
print '<br>'.$langs->trans("ForceTo").' '.$form->selectarray('fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0, '', 0, 0, $disabled, '', 'minwidth100 maxwidth300', 1);
print '<br><span class="opacitymedium">'.$langs->trans("ForceTo").'</span> '.$form->selectarray('fk_default_warehouse', $listwarehouses, $fk_default_warehouse, 0, 0, 0, '', 0, 0, $disabled, '', 'minwidth100 maxwidth300', 1);
}
print '</td>';
@ -1055,10 +1065,19 @@ if ($id > 0 || !empty($ref)) {
$dispatchBt = empty($conf->reception->enabled) ? $langs->trans("Receive") : $langs->trans("CreateReception");
print '<br><input type="submit" class="button" name="dispatch" value="'.dol_escape_htmltag($dispatchBt).'"';
print '<br>';
print '<input type="submit" class="button" name="dispatch" value="'.dol_escape_htmltag($dispatchBt).'"';
$disabled = 0;
if (!$permissiontoreceive) {
$disabled = 1;
}
if (count($listwarehouses) <= 0) {
$disabled = 1;
}
if ($disabled) {
print ' disabled';
}
print '>';
}
print '</div>';
@ -1257,7 +1276,7 @@ if ($id > 0 || !empty($ref)) {
// Add button to check/uncheck disaptching
print '<td class="center">';
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande->receptionner)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->fournisseur->commande_advance->check))) {
if (!$permissiontocontrol) {
if (empty($objp->status)) {
print '<a class="button buttonRefused" href="#">'.$langs->trans("Approve").'</a>';
print '<a class="button buttonRefused" href="#">'.$langs->trans("Deny").'</a>';

View File

@ -519,7 +519,7 @@ if ($step == 2 && $datatoimport) {
$text = $objmodelimport->getDriverDescForKey($key);
print '<td>'.$form->textwithpicto($objmodelimport->getDriverLabelForKey($key), $text).'</td>';
print '<td style="text-align:center">';
print img_picto('', 'download', 'class="paddingright opacitymedium"').'<a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$key.$param.'" target="_blank">'.$langs->trans("DownloadEmptyExample");
print img_picto('', 'download', 'class="paddingright opacitymedium"').'<a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$key.$param.'" target="_blank" rel="noopener noreferrer">'.$langs->trans("DownloadEmptyExample");
print '</a>';
print ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("StarAreMandatory").')</span>';
print '</td>';
@ -608,7 +608,7 @@ if ($step == 3 && $datatoimport) {
$text = $objmodelimport->getDriverDescForKey($format);
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
print '</td><td style="text-align:right" class="nowrap">';
print img_picto('', 'download', 'class="paddingright opacitymedium"').'<a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$format.$param.'" target="_blank">'.$langs->trans("DownloadEmptyExample");
print img_picto('', 'download', 'class="paddingright opacitymedium"').'<a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$format.$param.'" target="_blank" rel="noopener noreferrer">'.$langs->trans("DownloadEmptyExample");
print '</a>';
print ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("StarAreMandatory").')</span>';
print '</td></tr>';
@ -735,7 +735,7 @@ if ($step == 3 && $datatoimport) {
print '<tr class="oddeven">';
print '<td>';
print img_mime($file, '', 'pictofixedwidth');
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=3'.$param.'" target="_blank">';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=3'.$param.'" target="_blank" rel="noopener noreferrer">';
print $file;
print '</a>';
print '</td>';
@ -937,7 +937,7 @@ if ($step == 4 && $datatoimport) {
print '<td>';
$modulepart = 'import';
$relativepath = GETPOST('filetoimport');
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank" rel="noopener noreferrer">';
print img_mime($file, '', 'pictofixedwidth');
print $filetoimport;
print '</a>';
@ -1435,7 +1435,7 @@ if ($step == 5 && $datatoimport) {
print '<td>';
$modulepart = 'import';
$relativepath = GETPOST('filetoimport');
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank" rel="noopener noreferrer">';
print img_mime($file, '', 'pictofixedwidth');
print $filetoimport;
print '</a>';
@ -1881,7 +1881,7 @@ if ($step == 6 && $datatoimport) {
print '<td>';
$modulepart = 'import';
$relativepath = GETPOST('filetoimport');
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank">';
print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?modulepart='.$modulepart.'&file='.urlencode($relativepath).'&step=4'.$param.'" target="_blank" rel="noopener noreferrer">';
print img_mime($file, '', 'pictofixedwidth');
print $filetoimport;
print '</a>';

View File

@ -93,7 +93,7 @@ if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0) { //
print '<img src="../theme/eldy/img/tick.png" alt="Ok" class="valignmiddle"> '.$langs->trans("PHPVersion")." ".versiontostring(versionphparray());
}
if (empty($force_install_nophpinfo)) {
print ' (<a href="phpinfo.php" target="_blank">'.$langs->trans("MoreInformation").'</a>)';
print ' (<a href="phpinfo.php" target="_blank" rel="noopener noreferrer">'.$langs->trans("MoreInformation").'</a>)';
}
print "<br>\n";

View File

@ -30,13 +30,18 @@
-- Types paiement
--
insert into llx_c_paiement (id,code,libelle,type,active) values ( 1, 'TIP', 'TIP', 2,0);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 2, 'VIR', 'Transfer', 2,1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 3, 'PRE', 'Debit order', 2,1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 4, 'LIQ', 'Cash', 2,1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 6, 'CB', 'Credit card', 2,1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 7, 'CHQ', 'Cheque', 2,1);
insert into llx_c_paiement (id,code,libelle,type,active) values (50, 'VAD', 'Online payment', 2,0);
insert into llx_c_paiement (id,code,libelle,type,active) values (51, 'TRA', 'Traite', 2,0);
insert into llx_c_paiement (id,code,libelle,type,active) values (52, 'LCR', 'LCR', 2,0);
insert into llx_c_paiement (id,code,libelle,type,active) values (53, 'FAC', 'Factor', 2,0);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 1, 'TIP', 'TIP', 2, 0);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 2, 'VIR', 'Transfer', 2, 1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 3, 'PRE', 'Debit order', 2, 1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 4, 'LIQ', 'Cash', 2, 1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 6, 'CB', 'Credit card', 2, 1);
insert into llx_c_paiement (id,code,libelle,type,active) values ( 7, 'CHQ', 'Cheque', 2, 1);
insert into llx_c_paiement (id,code,libelle,type,active) values (50, 'VAD', 'Online payment', 2, 0);
insert into llx_c_paiement (id,code,libelle,type,active) values (51, 'TRA', 'Traite', 2, 0);
insert into llx_c_paiement (id,code,libelle,type,active) values (52, 'LCR', 'LCR', 2, 0);
insert into llx_c_paiement (id,code,libelle,type,active) values (53, 'FAC', 'Factor', 2, 0);
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (100, 'KLA', 'Klarna', 1, 0);
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (101, 'SOF', 'Sofort', 1, 0);
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (102, 'BAN', 'Bancontact', 1, 0);
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (103, 'IDE', 'iDeal', 1, 0);
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (104, 'GIR', 'Giropay', 1, 0);

View File

@ -448,3 +448,48 @@ ALTER TABLE llx_socpeople DROP COLUMN googleplus;
ALTER TABLE llx_socpeople DROP COLUMN youtube;
ALTER TABLE llx_socpeople DROP COLUMN whatsapp;
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (100, 'KLA', 'Klarna', 1, 0);
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (101, 'SOF', 'Sofort', 1, 0);
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (102, 'BAN', 'Bancontact', 1, 0);
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (103, 'IDE', 'iDeal', 1, 0);
INSERT INTO llx_c_paiement (id,code,libelle,type,active) values (104, 'GIR', 'Giropay', 1, 0);
ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_tx double(24,8) DEFAULT 1;
ALTER TABLE llx_paiement_facture ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_tx double(24,8) DEFAULT 1;
ALTER TABLE llx_paiementfourn_facturefourn ADD COLUMN multicurrency_amount double(24,8) DEFAULT 0;
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_commande MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_commandedet MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_contratdet MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_expensereport_det MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_expensereport MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_facture_fourn_det MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_facture_fourn MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_facture_rec MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_facture MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_facturedet_rec MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_facturedet MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_paiement_facture MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_paiementfourn_facturefourn MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_product_fournisseur_price_log MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_product_price_by_qty MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_product_price MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_propal MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_propaldet MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_societe MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_supplier_proposal MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_supplier_proposaldet MODIFY COLUMN multicurrency_code varchar(3);
ALTER TABLE llx_propal ADD COLUMN online_sign_ip varchar(48);
ALTER TABLE llx_propal ADD COLUMN online_sign_name varchar(64);
ALTER TABLE llx_entrepot ADD COLUMN warehouse_usage integer DEFAULT 1;

View File

@ -77,7 +77,7 @@ create table llx_commande
extraparams varchar(255), -- for stock other parameters with json format
fk_multicurrency integer,
multicurrency_code varchar(255),
multicurrency_code varchar(3),
multicurrency_tx double(24,8) DEFAULT 1,
multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0,

View File

@ -70,7 +70,7 @@ create table llx_commande_fournisseur
extraparams varchar(255), -- for stock other parameters with json format
fk_multicurrency integer,
multicurrency_code varchar(255),
multicurrency_code varchar(3),
multicurrency_tx double(24,8) DEFAULT 1,
multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0,

View File

@ -53,7 +53,7 @@ create table llx_commande_fournisseurdet
fk_unit integer DEFAULT NULL,
fk_multicurrency integer,
multicurrency_code varchar(255),
multicurrency_code varchar(3),
multicurrency_subprice double(24,8) DEFAULT 0,
multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0,

View File

@ -62,7 +62,7 @@ create table llx_commandedet
fk_commandefourndet integer DEFAULT NULL, -- link to detail line of commande fourn (resplenish)
fk_multicurrency integer,
multicurrency_code varchar(255),
multicurrency_code varchar(3),
multicurrency_subprice double(24,8) DEFAULT 0,
multicurrency_total_ht double(24,8) DEFAULT 0,
multicurrency_total_tva double(24,8) DEFAULT 0,

Some files were not shown because too many files have changed in this diff Show More