Merge branch 'develop' into dev_fix_ticket_user_assign

This commit is contained in:
HENRY Florian 2021-11-30 21:32:02 +01:00 committed by GitHub
commit 4af45a1719
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
445 changed files with 2531 additions and 1444 deletions

1
.gitignore vendored
View File

@ -55,3 +55,4 @@ yarn.lock
package-lock.json
doc/install.lock
/factory/

123
ChangeLog
View File

@ -105,6 +105,7 @@ NEW: Use an ajax call for the clicktodial feature instead of href link.
NEW: when multiple order linked to facture, show list into note.
NEW: when we delete several objects with massaction, if somes object has child we must see which objects are concerned and nevertheless delete objects which can be deleted
NEW: Editing a page in website module keep old page with name .back
NEW: External backups can be downloaded from the "About info page".
For developers:
@ -140,9 +141,128 @@ Following changes may create regressions for some external modules, but were nec
* The method static ActionComm::getActions($db, ...) is no more static. Use $actioncomm->getActions(...) instead (without $db param).
* The 'action=delete&file=...' has been replaced with 'action=deletefile&file=...' to avoid confusion with deletion of object lines.
* Method getDictvalue has been renamed into getDictionaryValue to match camel case rule.
* To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in
method executeCLI() available into core/class/utils.class.php
***** 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
@ -497,7 +617,8 @@ Following changes may create regressions for some external modules, but were nec
* Removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__)
* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries.
* v14 seems to work correctly on PHP v8 but it generates a lot of verbose warnings. Currently, v14 i snot yet officialy supported with PHP 8.
* To execute shell or command line command, your code must never use method like exec, shell_exec, popen, .. but must use the built-in
method executeCLI() available into core/class/utils.class.php
***** ChangeLog for 13.0.5 compared to 13.0.4 *****

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

@ -142,7 +142,7 @@ $linkback = '';
print load_fiche_titre($langs->trans('ExportOptions'), $linkback, 'accountancy');
print "\n".'<script type="text/javascript" language="javascript">'."\n";
print "\n".'<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print ' function initfields()'."\n";
print ' {'."\n";

View File

@ -127,7 +127,6 @@ if ($result) {
$title = $langs->trans('AccountingPeriods');
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $params, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $addbutton, '', $limit, 1);
// Load attribute_label
print '<div class="div-table-responsive">';
print '<table class="tagtable liste centpercent">';
print '<tr class="liste_titre">';

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

@ -753,7 +753,7 @@ if ($result) {
print '</table>';
print '</div>';
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
function init_savebutton()
{

View File

@ -241,7 +241,7 @@ if ($action != 'export_csv') {
if (empty($reshook)) {
$button = '<input type="button" id="exportcsvbutton" name="exportcsvbutton" class="butAction" value="'.$langs->trans("Export").' ('.$conf->global->ACCOUNTING_EXPORT_FORMAT.')" />';
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#exportcsvbutton").click(function() {
event.preventDefault();

View File

@ -24,6 +24,7 @@
* \ingroup Accountancy (Double entries)
* \brief List operation of book keeping
*/
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancyexport.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
@ -333,10 +334,6 @@ if (empty($reshook)) {
$filter['t.numero_compte<='] = $search_accountancy_code_end;
$param .= '&search_accountancy_code_end='.urlencode($search_accountancy_code_end);
}
if (!empty($search_accountancy_aux_code)) {
$filter['t.subledger_account'] = $search_accountancy_aux_code;
$param .= '&search_accountancy_aux_code='.urlencode($search_accountancy_aux_code);
}
if (!empty($search_accountancy_aux_code_start)) {
$filter['t.subledger_account>='] = $search_accountancy_aux_code_start;
$param .= '&search_accountancy_aux_code_start='.urlencode($search_accountancy_aux_code_start);
@ -533,11 +530,11 @@ if (count($filter) > 0) {
$sqlwhere[] = $key."='".$db->idate($value)."'";
} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
$sqlwhere[] = $key."'".$db->idate($value)."'";
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=') {
} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') {
$sqlwhere[] = $key."'".$db->escape($value)."'";
} elseif ($key == 't.fk_doc' || $key == 't.fk_docdet' || $key == 't.piece_num') {
$sqlwhere[] = $key.'='.((int) $value);
} elseif ($key == 't.numero_compte') {
} elseif ($key == 't.subledger_account' || $key == 't.numero_compte') {
$sqlwhere[] = $key." LIKE '".$db->escape($value)."%'";
} elseif ($key == 't.subledger_account') {
$sqlwhere[] = natural_search($key, $value, 0, 1);

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">';
@ -755,7 +738,7 @@ if ($db->type == 'mysqli') {
}
// Add code to auto check the box when we select an account
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".codeventil").change(function() {
var s=$(this).attr("id").replace("codeventil", "")

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

@ -470,7 +470,7 @@ if ($result) {
}
// Add code to auto check the box when we select an account
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".codeventil").change(function() {
var s=$(this).attr("id").replace("codeventil", "")

View File

@ -100,7 +100,7 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S
$showtutorial .= ' '.$langs->trans("ShowTutorial");
$showtutorial .= '</a></div>';
$showtutorial .= '<script type="text/javascript" language="javascript">
$showtutorial .= '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#show_hide").click(function () {
jQuery( "#idfaq" ).toggle({

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">';
@ -747,7 +747,7 @@ if ($db->type == 'mysqli') {
}
// Add code to auto check the box when we select an account
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".codeventil").change(function() {
var s=$(this).attr("id").replace("codeventil", "")

View File

@ -113,7 +113,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
print dol_get_fiche_head($head, 'website', $langs->trans("Members"), -1, 'user');
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () {
function initemail()
{
@ -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

@ -104,7 +104,7 @@ abstract class ActionsAdherentCardCommon
if ($action == 'create' || $action == 'edit') {
if ($conf->use_javascript_ajax) {
$this->tpl['ajax_selectcountry'] = "\n".'<script type="text/javascript" language="javascript">
$this->tpl['ajax_selectcountry'] = "\n".'<script type="text/javascript">
jQuery(document).ready(function () {
jQuery("#selectcountry_id").change(function() {
document.formsoc.action.value="'.$action.'";

View File

@ -953,7 +953,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print load_fiche_titre($langs->trans("NewMember"), '', $object->picto);
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () {
jQuery("#selectcountry_id").change(function() {
document.formsoc.action.value="create";
@ -1183,7 +1183,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () {
jQuery("#selectcountry_id").change(function() {
document.formsoc.action.value="edit";

View File

@ -119,7 +119,7 @@ if ((!empty($foruserid) || !empty($foruserlogin) || !empty($mode)) && !$mesg) {
}
//if (!empty($objp->$key))
// $objp->array_options[$tmpkey] = $objp->$key;
//$objp->array_options[$tmpkey] = $extrafields->showOutputField($key, $objp->$tmpkey, '', 1); //$objp->$tmpkey;
//$objp->array_options[$tmpkey] = $extrafields->showOutputField($key, $objp->$tmpkey, '', $object->table_element); //$objp->$tmpkey;
}
}

View File

@ -1398,6 +1398,7 @@ class Adherent extends CommonObject
$this->photo = $obj->photo;
$this->statut = $obj->statut;
$this->status = $obj->statut;
$this->public = $obj->public;
$this->datec = $this->db->jdate($obj->datec);

View File

@ -543,14 +543,13 @@ class AdherentType extends CommonObject
}
/**
* Return list of amount by type id
* Return the array of all amounts per membership type id
*
* @param int $status Filter on status of type
* @return array List of types of members
* @return array Array of membership type
*/
public function amountByType($status = null)
{
global $conf, $langs;
$amountbytype = array();
@ -578,6 +577,7 @@ class AdherentType extends CommonObject
} else {
print $this->db->error();
}
return $amountbytype;
}

View File

@ -838,7 +838,7 @@ if ($rowid > 0) {
if ($conf->use_javascript_ajax) {
//var_dump($bankdirect.'-'.$bankviainvoice.'-'.$invoiceonly.'-'.empty($conf->global->ADHERENT_BANK_USE));
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$(".bankswitchclass, .bankswitchclass2").'.(($bankdirect || $bankviainvoice) ? 'show()' : 'hide()').';
$("#none, #invoiceonly").click(function() {

View File

@ -100,7 +100,7 @@ print "<br><br>\n";
* Edit parameters
*/
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#selectcountry_id").change(function() {
document.form_index.action.value="updateedit";

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

@ -175,9 +175,9 @@ if ($action == 'switch') {
$newfirst = $objto->box_order;
$newsecond = $objfrom->box_order;
if ($newfirst == $newsecond) {
$newsecondchar = preg_replace('/[0-9]+/', '', $newsecond);
$newsecondnum = preg_replace('/[a-zA-Z]+/', '', $newsecond);
$newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1);
$newsecondchar = preg_replace('/[0-9]+/', '', $newsecond);
$newsecondnum = preg_replace('/[a-zA-Z]+/', '', $newsecond);
$newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1);
}
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newfirst)."' WHERE rowid=".((int) $objfrom->rowid);
@ -300,14 +300,13 @@ $boxtoadd = InfoBox::listBoxes($db, 'available', -1, null, $actives);
// Activated boxes
$boxactivated = InfoBox::listBoxes($db, 'activated', -1, null);
print "<br>\n";
print "\n\n".'<!-- Boxes Available -->'."\n";
print load_fiche_titre($langs->trans("BoxesAvailable"), '', '');
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
print '<input type="hidden" name="action" value="add">'."\n";
print '<br>';
print '<div class="div-table-responsive-no-min">';
print '<table class="tagtable liste centpercent">'."\n";
@ -315,9 +314,12 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
print '<td></td>';
print '<td width="160" class="center">'.$langs->trans("ActivatableOn").'</td>';
print "</tr>\n";
print '<td class="center" width="160">'.$langs->trans("ActivatableOn").'</td>';
print '<td class="center" width="60" colspan="2">'.$langs->trans("PositionByDefault").'</td>';
print '<td class="center" width="80">'.$langs->trans("Disable").'</td>';
print '</tr>'."\n";
print "\n\n".'<!-- Boxes Available -->'."\n";
foreach ($boxtoadd as $box) {
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) {
$logo = $box->boximg;
@ -326,8 +328,8 @@ foreach ($boxtoadd as $box) {
}
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
print '<tr class="oddeven">'."\n";
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
print '<tr class="oddeven" style="height:3em !important;">'."\n";
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($langs->transnoentitiesnoconv($box->boxlabel)).'">'.img_object("", $logo, 'class="pictofixedwidth" height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
if (!empty($box->class) && preg_match('/graph_/', $box->class)) {
print img_picto('', 'graph', 'class="paddingleft"');
}
@ -339,7 +341,7 @@ foreach ($boxtoadd as $box) {
}
}
print '</td>'."\n";
print '<td>';
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($box->note).'">';
if ($box->note == '(WarningUsingThisBoxSlowDown)') {
$langs->load("errors");
print $langs->trans("WarningUsingThisBoxSlowDown");
@ -357,36 +359,21 @@ foreach ($boxtoadd as $box) {
print '<input type="hidden" name="boxid['.$box->box_id.'][value]" value="'.$box->box_id.'">'."\n";
print '</td>';
print '<td>';
print '</td>';
print '<td>';
print '</td>';
print '<td>';
print '<input type="submit" class="button small smallpaddingimp" value="'.$langs->trans("Activate").'">';
print '</td>';
print '</tr>'."\n";
}
if (!count($boxtoadd) && count($boxactivated)) {
print '<tr><td colspan="4"><span class="opacitymedium">'.$langs->trans("AllWidgetsWereEnabled").'</span></td></tr>';
}
print '</table>'."\n";
print '</div>';
print '<div class="right">';
print '<input type="submit" class="button"'.(count($boxtoadd) ? '' : ' disabled').' value="'.$langs->trans("Activate").'">';
print '</div>'."\n";
print '</form>';
print "\n".'<!-- End Boxes Available -->'."\n";
//var_dump($boxactivated);
print "<br>\n\n";
print load_fiche_titre($langs->trans("BoxesActivated"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="tagtable liste">'."\n";
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Box").'</td>';
print '<td>'.$langs->trans("Note").'/'.$langs->trans("Parameters").'</td>';
print '<td class="center" width="160">'.$langs->trans("ActivatableOn").'</td>';
print '<td class="center" width="60" colspan="2">'.$langs->trans("PositionByDefault").'</td>';
print '<td class="center" width="80">'.$langs->trans("Disable").'</td>';
print '</tr>'."\n";
$box_order = 1;
$foundrupture = 1;
foreach ($boxactivated as $key => $box) {
@ -397,8 +384,8 @@ foreach ($boxactivated as $key => $box) {
}
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
print '<tr class="oddeven">';
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
print '<tr class="oddeven" style="height:3em !important;">';
print '<td>'.img_object("", $logo, 'class="pictofixedwidth" height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
if (!empty($box->class) && preg_match('/graph_/', $box->class)) {
print img_picto('', 'graph', 'class="paddingleft"');
}
@ -410,14 +397,17 @@ foreach ($boxactivated as $key => $box) {
}
}
print '</td>';
print '<td>';
$langs->load("errors");
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($box->note == '(WarningUsingThisBoxSlowDown)' ? $langs->trans("WarningUsingThisBoxSlowDown") : $box->note).'">';
if ($box->note == '(WarningUsingThisBoxSlowDown)') {
$langs->load("errors");
print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown");
} else {
print ($box->note ? $box->note : '&nbsp;');
}
print '</td>';
print '<td>';
print $form->textwithpicto('', $langs->trans("SourceFile").' : '.$box->sourcefile);
print '</td>'."\n";
print '<td class="center">'.(empty($arrayofhomepages[$box->position]) ? '' : $langs->trans($arrayofhomepages[$box->position])).'</td>';
$hasnext = ($key < (count($boxactivated) - 1));
$hasprevious = ($key != 0);
@ -437,6 +427,8 @@ print '</table>';
print '</div>';
print '<br>';
print '</form>';
// Other parameters

View File

@ -385,7 +385,7 @@ print "<br><br>\n";
* Edit parameters
*/
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#selectcountry_id").change(function() {
document.form_index.action.value="updateedit";

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,11 +280,12 @@ 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
// Set and check version
$version = '';
if ($this->version_compare($product->dolibarr_min, DOL_VERSION) <= 0) {
if ($this->version_compare($product->dolibarr_max, DOL_VERSION) >= 0) {
//compatible
@ -316,17 +317,22 @@ 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>
<td class="margeCote"><h2 class="appTitle">'.dol_escape_htmltag($product->name->language[$this->lang - 1])
.'<br><small>'.dol_escape_htmltag($version).'</small></h2>
<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>';
$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">';
$html .= '<td class="center" width="210"><div class="newAppParent">';
$html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html
$html .= '</div></td>';
$html .= '<td class="margeCote"><h2 class="appTitle">';
$html .= dol_escape_htmltag($product->name->language[$this->lang - 1]);
$html .= '<br><small>';
$html .= $version; // No dol_escape_htmltag, it is already escape html
$html .= '</small></h2>';
$html .= '<small> '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).'</small><br><br>'.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).'</td>';
// do not load if display none
//$html .= '<td style="display:none;" class="long_description">'.$product->description->language[$this->lang - 1].'</td>';
$html .= '<td class="margeCote center">'.dol_escape_htmltag($price).'</td>';
$html .= '<td class="margeCote center">';
$html .= $price;
$html .= '</td>';
$html .= '<td class="margeCote">'.$download_link.'</td>';
$html .= '</tr>';
}

View File

@ -222,7 +222,7 @@ if (empty($conf->use_javascript_ajax)) {
// Add env of ckeditor
// This is to show how CKEditor detect browser to understand why editor is disabled or not. To help debug.
/*
print '<br><script language="javascript">
print '<br><script type="text/javascript">
function jsdump(obj, id) {
var out = \'\';
for (var i in obj) {

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

@ -469,13 +469,17 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print load_fiche_titre($langs->trans('OtherOptions'), '', '');
if (empty($conf->global->HRM_MAXRANK)) {
$conf->global->HRM_MAXRANK = Skill::DEFAULT_MAX_RANK_PER_SKILL;
}
if ($action == 'edit') {
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="update">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
@ -571,7 +575,7 @@ if ($action == 'edit') {
} else {
if (!empty($arrayofparameters)) {
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {

View File

@ -173,7 +173,7 @@ if (version_compare(phpversion(), '7.0', '>=')) {
if ($action == 'edit') {
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () {
function initfields()
{

View File

@ -143,7 +143,7 @@ if (version_compare(phpversion(), '7.0', '>=')) {
if ($action == 'edit') {
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () {
function initfields()
{

View File

@ -225,6 +225,9 @@ if (!empty($conf->contrat->enabled) && !empty($user->rights->contrat->lire)) {
if (!empty($conf->ticket->enabled) && !empty($user->rights->ticket->read)) {
$elementList['ticket_send'] = img_picto('', 'ticket', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTicket'));
}
if (!empty($conf->expensereport->enabled) && !empty($user->rights->expensereport->lire)) {
$elementList['expensereport_send'] = img_picto('', 'trip', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToTExpenseReport'));
}
if (!empty($conf->agenda->enabled)) {
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
}
@ -654,7 +657,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

@ -142,7 +142,7 @@ if (version_compare(phpversion(), '7.0', '>=')) {
if ($action == 'edit') {
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () {
function initfields()
{

View File

@ -255,7 +255,7 @@ llxHeader('', $langs->trans("Menu"));
if ($action == 'create') {
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
function init_topleft()
{

View File

@ -262,6 +262,11 @@ if ($ip) {
$text .= '<br><span class="opacitymedium">'.$langs->trans("LastActivationIP").':</span> ';
$text .= $ip;
}
$lastactivationversion = $tmp['lastactivationversion'];
if ($lastactivationversion) {
$text .= '<br><span class="opacitymedium">'.$langs->trans("LastActivationVersion").':</span> ';
$text .= $lastactivationversion;
}
$moreinfo = $text;
@ -326,6 +331,13 @@ if ($mode == 'desc') {
$textexternal = '';
if ($objMod->isCoreOrExternalModule() == 'external') {
$textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Origin").':</span> '.$langs->trans("ExternalModule").' - '.$langs->trans("InstalledInto", $dirofmodule);
global $dolibarr_allow_download_external_modules;
if (!empty($dolibarr_allow_download_external_modules) && preg_match('/\/custom\//', $dirofmodule)) {
// Add a link to download a zip of the module
$textexternal .= ' <a href="'.DOL_URL_ROOT.'/admin/tools/export_files.php?export_type=externalmodule&what='.urlencode($moduledir).'&compression=zip&zipfilename_template=module_'.$moduledir.'-'.$version.'.notorig" target="_blank" rel="noopener">'.img_picto('', 'download').'</a>';
}
if ($objMod->editor_name != 'dolibarr') {
$textexternal .= '<br><span class="opacitymedium">'.$langs->trans("Publisher").':</span> '.(empty($objMod->editor_name) ? $langs->trans("Unknown") : $objMod->editor_name);
}
@ -334,7 +346,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

@ -303,7 +303,7 @@ llxHeader('', $langs->trans("Setup"), $help_url, '', '', '', $morejs, $morecss,
// Search modules dirs
$modulesdir = dolGetModulesDirs();
$arrayofnatures = array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']');
$arrayofnatures = array('core'=>$langs->transnoentitiesnoconv("NativeModules"), 'external'=>$langs->transnoentitiesnoconv("External").' - ['.$langs->trans("AllPublishers").']');
$arrayofwarnings = array(); // Array of warning each module want to show when activated
$arrayofwarningsext = array(); // Array of warning each module want to show when we activate an external module
$filename = array();
@ -526,7 +526,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$moreforfilter = '<div class="valignmiddle">';
$moreforfilter .= '<div class="floatright right pagination --module-list"><ul><li>';
$moreforfilter .= '<div class="floatright right pagination paddingtop --module-list"><ul><li>';
$moreforfilter .= dolGetButtonTitle($langs->trans('CheckForModuleUpdate'), $langs->trans('CheckForModuleUpdate').'<br>'.$langs->trans('CheckForModuleUpdateHelp'), 'fa fa-sync', $_SERVER["PHP_SELF"].'?action=checklastversion&token='.newToken().'&mode='.$mode.$param, '', 1, array('morecss'=>'reposition'));
$moreforfilter .= dolGetButtonTitleSeparator();
$moreforfilter .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=commonkanban'.$param, '', ($mode == 'commonkanban' ? 2 : 1), array('morecss'=>'reposition'));
@ -563,8 +563,10 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$moreforfilter .= ' ';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= '<input type="submit" name="buttonsubmit" class="button" value="'.dol_escape_htmltag($langs->trans("Refresh")).'">';
$moreforfilter .= ' ';
$moreforfilter .= '<input type="submit" name="buttonreset" class="butActionDelete noborderbottom" value="'.dol_escape_htmltag($langs->trans("Reset")).'">';
if ($search_keyword || $search_status || $search_nature || $search_version) {
$moreforfilter .= ' ';
$moreforfilter .= '<input type="submit" name="buttonreset" class="buttonreset noborderbottom" value="'.dol_escape_htmltag($langs->trans("Reset")).'">';
}
$moreforfilter .= '</div>';
$moreforfilter .= '</div>';
@ -597,6 +599,9 @@ if ($mode == 'common' || $mode == 'commonkanban') {
$oldfamily = '';
$foundoneexternalmodulewithupdate = 0;
$linenum = 0;
$atleastonequalified = 0;
$atleastoneforfamily = 0;
foreach ($orders as $key => $value) {
$linenum++;
$tab = explode('_', $value);
@ -685,7 +690,9 @@ if ($mode == 'common' || $mode == 'commonkanban') {
}
}
// Load all lang files of module
$atleastonequalified++;
// Load all language files of the qualified module
if (isset($objMod->langfiles) && is_array($objMod->langfiles)) {
foreach ($objMod->langfiles as $domain) {
$langs->load($domain);
@ -972,6 +979,10 @@ if ($mode == 'common' || $mode == 'commonkanban') {
}
}
if (!$atleastonequalified) {
print '<br><span class="opacitymedium">'.$langs->trans("NoDeployedModulesFoundWithThisSearchCriteria").'</span><br><br>';
}
print dol_get_fiche_end();
print '<br>';
@ -1000,9 +1011,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";
@ -1051,7 +1062,9 @@ if ($mode == 'marketplace') {
<div id="category-tree-left">
<ul class="tree">
<?php echo dol_escape_htmltag($dolistore->get_categories()); ?>
<?php
echo $dolistore->get_categories(); // Do not use dol_escape_htmltag here, it is already a structured content
?>
</ul>
</div>
<div id="listing-content">
@ -1081,7 +1094,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 +1286,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

@ -266,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>';

View File

@ -170,6 +170,13 @@ if ($action == 'update') {
dolibarr_set_const($db, "PDF_USE_A", GETPOST('PDF_USE_A', 'alpha'), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('PDF_BOLD_PRODUCT_LABEL')) {
dolibarr_set_const($db, "PDF_BOLD_PRODUCT_LABEL", GETPOST('PDF_BOLD_PRODUCT_LABEL', 'alpha'), 'chaine', 0, '', $conf->entity);
}
if (GETPOSTISSET('PDF_BOLD_PRODUCT_REF_AND_PERIOD')) {
dolibarr_set_const($db, "PDF_BOLD_PRODUCT_REF_AND_PERIOD", GETPOST('PDF_BOLD_PRODUCT_REF_AND_PERIOD', 'alpha'), 'chaine', 0, '', $conf->entity);
}
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
@ -499,6 +506,22 @@ if ($conf->use_javascript_ajax) {
}
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("BoldLabelOnPDF").'</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('PDF_BOLD_PRODUCT_LABEL');
} else {
print $form->selectyesno('PDF_BOLD_PRODUCT_LABEL', (!empty($conf->global->PDF_BOLD_PRODUCT_LABEL)) ? $conf->global->PDF_BOLD_PRODUCT_LABEL : 0, 1);
}
print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("BoldRefAndPeriodOnPDF").'</td><td>';
if ($conf->use_javascript_ajax) {
print ajax_constantonoff('PDF_BOLD_PRODUCT_REF_AND_PERIOD');
} else {
print $form->selectyesno('PDF_BOLD_PRODUCT_REF_AND_PERIOD', (!empty($conf->global->PDF_BOLD_PRODUCT_REF_AND_PERIOD)) ? $conf->global->PDF_BOLD_PRODUCT_REF_AND_PERIOD : 0, 1);
}
print '</td></tr>';
// Desc
print '<tr class="oddeven"><td>'.$langs->trans("HideDescOnPDF").'</td><td>';

View File

@ -98,7 +98,7 @@ print dol_get_fiche_head($head, 'proxy', '', -1);
print '<br>';
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () {
function initfields()
{

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

@ -165,7 +165,7 @@ if (ini_get('opcache.preload')) {
print '<br>';
// HTTPCacheStaticResources
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
var getphpurl;
var cachephpstring;

View File

@ -88,9 +88,9 @@ if (function_exists('exec')) {
}
print '<br>';
print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? '' : img_warning().' ').(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? '' : img_warning().' ').(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? '' : img_warning().' ').(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None');
if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') {
print ' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>";

View File

@ -70,9 +70,14 @@ if ($labeluser && $labelgroup) {
if (function_exists('exec')) {
$arrayout = array(); $varout = 0;
exec('id', $arrayout, $varout);
print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>";
if (empty($varout)) { // Test command is ok. Work only on Linux OS.
print '<tr><td>'.$langs->trans("WebUserGroup")." (real, 'id' command)</td><td>".join(',', $arrayout)."</td></tr>\n";
print join(',', $arrayout);
} else {
$langs->load("errors");
print '<span class="opacitymedium">'.$langs->trans("ErrorExecIdFailed").'</span>';
}
print "</td></tr>\n";
}
print '</table>';
print '</div>';

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

@ -145,6 +145,8 @@ print "<!-- Dump of a server -->\n";
print '<form method="post" action="export.php" name="dump">';
print '<input type="hidden" name="token" value="'.newToken().'" />';
print '<input type="hidden" name="export_type" value="server" />';
print '<input type="hidden" name="page_y" value="" />';
print '<fieldset id="fieldsetexport"><legend class="legendforfieldsetstep" style="font-size: 3em">1</legend>';
print '<span class="opacitymedium">';
@ -160,14 +162,15 @@ $title = $langs->trans("BackupDumpWizard");
print load_fiche_titre($title);
print '<table class="'.(!empty($useinecm) ? 'nobordernopadding' : 'liste noborderbottom').' nohover centpercent">';
print '<table class="liste nohover centpercent noborderbottom">';
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print $langs->trans("DatabaseName").' : <b>'.$dolibarr_main_db_name.'</b><br>';
print '</td>';
print '</tr>';
print '<tr class="oddeven nohover"><td style="padding-left: 8px" class="nohover">';
print '<table class="centpercent">';
print '<table class="centpercent noborderbottom">';
print '<tr>';
print '<td class="tdtop">';
@ -397,11 +400,15 @@ print '</td>';
print '</tr>';
print '</table>';
print '</td></tr>';
print '</table>';
print '<!--<fieldset>';
print '<legend>'.$langs->trans("Destination").'</legend> -->';
print '<br>';
print '<label for="filename_template">'.$langs->trans("FileNameToGenerate").'</label>';
print '<label for="filename_template" class="line-height-large">'.$langs->trans("FileNameToGenerate").'</label>';
print '<br>';
$prefix = 'dump';
$ext = '.sql';
@ -437,9 +444,9 @@ if (in_array($type, array('mysql', 'mysqli'))) {
// 'label' => $langs->trans("FormatZip")
// );
$compression['bz'] = array(
'function' => 'bzopen',
'id' => 'radio_compression_bzip',
'label' => $langs->trans("Bzip2")
'function' => 'bzopen',
'id' => 'radio_compression_bzip',
'label' => $langs->trans("Bzip2")
);
$compression['zstd'] = array(
'function' => 'zstd_compress',
@ -498,7 +505,6 @@ print "<!--</fieldset>--> <!-- End destination -->\n";
print '<br>';
print '<div class="center">';
print '<input type="submit" class="button reposition" value="'.$langs->trans("GenerateBackup").'" id="buttonGo">';
print '<input type="hidden" name="page_y" value="'.GETPOST('page_y', 'int').'">';
print '<br>';
print '<br>';
@ -532,8 +538,6 @@ if (!empty($_SESSION["commandbackuptorun"])) {
print "</div> <!-- end div center button -->\n";
print '</td></tr>';
print '</table>';
print "</div> <!-- end div fichehalfleft -->\n";
@ -569,7 +573,7 @@ print '<div id="backupfilesleft" class="fichehalfleft">';
print load_fiche_titre($title ? $title : $langs->trans("BackupZipWizard"));
print '<label for="zipfilename_template">'.$langs->trans("FileNameToGenerate").'</label><br>';
print '<label for="zipfilename_template" class="line-height-large paddingbottom">'.$langs->trans("FileNameToGenerate").'</label><br>';
$prefix = 'documents';
$ext = 'zip';
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M");
@ -617,7 +621,7 @@ print '</div>';
print '</div>';
print '<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">';
print '<div id="backupfileright" class="fichehalfright" style="height:250px; overflow: auto;">';
$filearray = dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1);
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousArchiveFiles"));

View File

@ -216,8 +216,7 @@ if ($errormsg) {
}*/
}
$db->close();
// Redirect to backup page
header("Location: dolibarr_export.php".(GETPOST('page_y', 'int') ? '?page_y='.GETPOST('page_y', 'int') : ''));
$db->close();

View File

@ -127,10 +127,34 @@ $result = dol_mkdir($outputdir);
$utils = new Utils($db);
if ($export_type == 'externalmodule' && ! empty($what)) {
$fulldirtocompress = DOL_DOCUMENT_ROOT.'/custom/'.dol_sanitizeFileName($what);
} else {
$fulldirtocompress = DOL_DATA_ROOT;
}
$dirtoswitch = dirname($fulldirtocompress);
$dirtocompress = basename($fulldirtocompress);
if ($compression == 'zip') {
$file .= '.zip';
$excludefiles = '/(\.back|\.old|\.log|[\/\\\]temp[\/\\\]|documents[\/\\\]admin[\/\\\]documents[\/\\\])/i';
$ret = dol_compress_dir(DOL_DATA_ROOT, $outputdir."/".$file, $compression, $excludefiles);
//var_dump($fulldirtocompress);
//var_dump($outputdir."/".$file);exit;
$rootdirinzip = '';
if ($export_type == 'externalmodule' && !empty($what)) {
$rootdirinzip = $what;
global $dolibarr_allow_download_external_modules;
if (empty($dolibarr_allow_download_external_modules)) {
print 'Download of external modules is not allowed by $dolibarr_allow_download_external_modules in conf.php file';
$db->close();
exit();
}
}
$ret = dol_compress_dir($fulldirtocompress, $outputdir."/".$file, $compression, $excludefiles, $rootdirinzip);
if ($ret < 0) {
if ($ret == -2) {
$langs->load("errors");
@ -146,10 +170,12 @@ if ($compression == 'zip') {
$outputfile = $conf->admin->dir_temp.'/export_files.'.$userlogin.'.out'; // File used with popen method
$file .= '.tar';
// We also exclude '/temp/' dir and 'documents/admin/documents'
$cmd = "tar -cf ".$outputdir."/".$file." --exclude-vcs --exclude 'temp' --exclude 'dolibarr.log' --exclude 'dolibarr_*.log' --exclude 'documents/admin/documents' -C ".dirname(DOL_DATA_ROOT)." ".basename(DOL_DATA_ROOT);
$result = $utils->executeCLI($cmd, $outputfile);
// We also exclude '/temp/' dir and 'documents/admin/documents'
// We make escapement here and call executeCLI without escapement because we don't want to have the '*.log' escaped.
$cmd = "tar -cf ".escapeshellcmd($outputdir."/".$file)." --exclude-vcs --exclude-caches-all --exclude='temp' --exclude='*.log' --exclude='documents/admin/documents' -C '".escapeshellcmd(dol_sanitizePathName($dirtoswitch))."' '".escapeshellcmd(dol_sanitizeFileName($dirtocompress))."'";
$result = $utils->executeCLI($cmd, $outputfile, 0, null, 1);
$retval = $result['error'];
if ($result['result'] || !empty($retval)) {
@ -173,15 +199,37 @@ if ($compression == 'zip') {
unlink($outputdir."/".$file);
}
}
} else {
$errormsg = 'Bad value for compression method';
print $errormsg;
}
if ($errormsg) {
setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors');
if ($export_type != 'externalmodule' || empty($what)) {
if ($errormsg) {
setEventMessages($langs->trans("Error")." : ".$errormsg, null, 'errors');
} else {
setEventMessages($langs->trans("BackupFileSuccessfullyCreated").'.<br>'.$langs->trans("YouCanDownloadBackupFile"), null, 'mesgs');
}
$db->close();
// Redirect to calling page
$returnto = 'dolibarr_export.php';
header("Location: ".$returnto);
exit();
} else {
$zipname = $outputdir."/".$file;
// Then download the zipped file.
header('Content-Type: application/zip');
header('Content-disposition: attachment; filename='.basename($zipname));
header('Content-Length: '.filesize($zipname));
readfile($zipname);
dol_delete_file($zipname);
$db->close();
exit();
}
// Redirect t backup page
header("Location: dolibarr_export.php");
$time_end = time();
$db->close();

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

@ -224,7 +224,7 @@ if ($conf->societe->enabled) {
// For products
if ($conf->product->enabled || $conf->product->service) {
// Example 1 : Adding jquery code
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
function confirm_erase() {
return confirm("'.dol_escape_js($langs->trans("ConfirmEraseAllCurrentBarCode")).'");
}

View File

@ -315,7 +315,7 @@ print '<br>';
// Add javascript to make choice dynamic
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
function init_selectors()
{

View File

@ -54,7 +54,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo '</td>';
echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
echo '<td class="linkedcol-ref" align="center">';
echo '<td class="linkedcol-ref">';
$result = $product_static->fetch($objectlink->fk_product);
if ($result < 0) {
setEventMessage($product_static->error, 'errors');
@ -62,7 +62,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
$product_static->getNomUrl(1);
}
print '</td>';
echo '<td class="linkedcol-date" align="center">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
echo '<td class="linkedcol-date">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
echo '<td class="linkedcol-amount right">';
if ($user->rights->commande->lire) {
$total = $total + $objectlink->total_ht;

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

@ -186,7 +186,7 @@ foreach ($fulltree as $key => $val) {
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
: $categstatic->getObjectsInCateg($type, 1);
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
$counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
}
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';

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

@ -413,7 +413,7 @@ if ($cats < 0) {
? $categstatic->getObjectsInCateg("account", 1) // Categorie::TYPE_ACCOUNT is "bank_account" instead of "account"
: $categstatic->getObjectsInCateg($type, 1);
$counter = "<td class='left' width='40px;'>".(is_countable($elements) ? count($elements) : '0')."</td>";
$counter = "<td class='left' width='40px;'>".(is_array($elements) ? count($elements) : '0')."</td>";
}
$color = $categstatic->color ? ' style="background: #'.sprintf("%06s", $categstatic->color).';"' : ' style="background: #bbb"';

View File

@ -1075,7 +1075,7 @@ if ($action == 'create') {
print '<div class="hidden marginrightonly inline-block repeateventBYDAY">';
print $langs->trans("DayOfWeek").': <input type="input" size="4" name="BYDAY" value="'.$selectedrecurrulebyday.'">';
print '</div>';
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
function init_repeat()
{
@ -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>';
}
@ -1552,7 +1554,7 @@ if ($id > 0) {
print '<div class="hidden marginrightonly inline-block repeateventBYDAY">';
print $langs->trans("DayOfWeek").': <input type="input" size="4" name="BYDAY" value="'.$selectedrecurrulebyday.'">';
print '</div>';
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
function init_repeat()
{

View File

@ -882,7 +882,7 @@ print "\n".'</form>';
print "\n";
// Add js code to manage click on a box
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".onclickopenref").click(function() {
var ref=$(this).attr(\'ref\');

View File

@ -1050,7 +1050,7 @@ print "\n".'</form>';
print "\n";
// Add js code to manage click on a box
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".onclickopenref").click(function() {
var ref=$(this).attr(\'ref\');

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)) {
@ -1221,7 +1221,7 @@ if ($action == 'create') {
// TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
$out .= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">'."\n";
$out .= '<script type="text/javascript" language="javascript">';
$out .= '<script type="text/javascript">';
$out .= 'jQuery(document).ready(function () {';
$out .= ' jQuery(".removedfile").click(function() {';
$out .= ' jQuery(".removedfilehidden").val(jQuery(this).val());';

View File

@ -1442,7 +1442,7 @@ if (empty($reshook)) {
}
// Actions to build doc
$upload_dir = $conf->propal->multidir_output[$object->entity];
$upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output;
$permissiontoadd = $usercancreate;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
}
@ -1584,6 +1584,7 @@ if ($action == 'create') {
// Third party
print '<tr>';
print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
$shipping_method_id = 0;
if ($socid > 0) {
print '<td>';
print $soc->getNomUrl(1);
@ -1700,7 +1701,7 @@ if ($action == 'create') {
// Delivery date (or manufacturing)
print '<tr><td>'.$langs->trans("DeliveryDate").'</td>';
print '<td>';
if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "") {
if (isset($conf->global->DATE_LIVRAISON_WEEK_DELAY) && is_numeric($conf->global->DATE_LIVRAISON_WEEK_DELAY)) {
$tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
$syear = date("Y", $tmpdte);
$smonth = date("m", $tmpdte);
@ -1737,7 +1738,7 @@ if ($action == 'create') {
print '<td>';
print img_picto('', 'pdf').'&ensp;';
$liste = ModelePDFPropales::liste_modeles($db);
$preselected = ($conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT ? $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT : $conf->global->PROPALE_ADDON_PDF);
$preselected = (!empty($conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT) ? $conf->global->PROPALE_ADDON_PDF_ODT_DEFAULT : getDolGlobalString("PROPALE_ADDON_PDF"));
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200 widthcentpercentminusx', 1);
print "</td></tr>";
@ -1754,7 +1755,7 @@ if ($action == 'create') {
print '<tr>';
print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
print '<td valign="top">';
$note_public = $object->getDefaultCreateValueFor('note_public', (is_object($objectsrc) ? $objectsrc->note_public : null));
$note_public = $object->getDefaultCreateValueFor('note_public', (!empty($objectsrc) ? $objectsrc->note_public : null));
$doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
print $doleditor->Create(1);

View File

@ -100,8 +100,8 @@ if (!empty($conf->propal->enabled)) {
$nbofloop = min($num, (empty($conf->global->MAIN_MAXLIST_OVERLOAD) ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD));
startSimpleTable("DraftPropals", "comm/propal/list.php", "search_status=".Propal::STATUS_DRAFT, 2, $num);
$total = 0;
if ($num) {
$total = 0;
$i = 0;
while ($i < $nbofloop) {

View File

@ -534,7 +534,7 @@ if (!empty($search_categ_cus) && $search_categ_cus != '-1') {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
}
$sql .= ', '.MAIN_DB_PREFIX.'propal as p';
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (p.rowid = ef.fk_object)";
}
if ($sall || $search_product_category > 0) {
@ -903,6 +903,10 @@ if ($resql) {
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// Add $param from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
$param .= $hookmanager->resPrint;
// List of mass actions available
$arrayofmassactions = array(

View File

@ -678,6 +678,10 @@ if (empty($reshook)) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error++;
}
if ($qty < 0) {
setEventMessages($langs->trans('FieldCannotBeNegative', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error++;
}
if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && empty($product_desc)) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
$error++;
@ -1002,9 +1006,11 @@ if (empty($reshook)) {
$date_end = dol_mktime(GETPOST('date_endhour'), GETPOST('date_endmin'), GETPOST('date_endsec'), GETPOST('date_endmonth'), GETPOST('date_endday'), GETPOST('date_endyear'));
$description = dol_htmlcleanlastbr(GETPOST('product_desc', 'restricthtml'));
$pu_ht = price2num(GETPOST('price_ht'), '', 2);
$vat_rate = (GETPOST('tva_tx') ?GETPOST('tva_tx') : 0);
$vat_rate = (GETPOST('tva_tx') ? GETPOST('tva_tx', 'alpha') : 0);
$pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), '', 2);
$qty = price2num(GETPOST('qty'), 'MS');
// Define info_bits
$info_bits = 0;
if (preg_match('/\*/', $vat_rate)) {
@ -1056,6 +1062,7 @@ if (empty($reshook)) {
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && ($price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
$action = 'editline';
}
} else {
$type = GETPOST('type');
@ -1065,9 +1072,16 @@ if (empty($reshook)) {
if (GETPOST('type') < 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
$error++;
$action = 'editline';
}
}
if ($qty < 0) {
setEventMessages($langs->trans('FieldCannotBeNegative', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error++;
$action = 'editline';
}
if (!$error) {
if (empty($user->rights->margins->creer)) {
foreach ($object->lines as &$line) {
@ -1078,7 +1092,7 @@ if (empty($reshook)) {
}
}
}
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, price2num(GETPOST('qty'), 'MS'), $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
$result = $object->updateline(GETPOST('lineid', 'int'), $description, $pu_ht, $qty, $remise_percent, $vat_rate, $localtax1_rate, $localtax2_rate, 'HT', $info_bits, $date_start, $date_end, $type, GETPOST('fk_parent_line'), 0, $fournprice, $buyingprice, $label, $special_code, $array_options, GETPOST('units'), $pu_ht_devise);
if ($result >= 0) {
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
@ -1130,7 +1144,7 @@ if (empty($reshook)) {
setEventMessages($object->error, $object->errors, 'errors');
}
}
} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha') == $langs->trans("Cancel")) {
} elseif ($action == 'updateline' && $usercancreate && GETPOST('cancel', 'alpha')) {
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition
exit();
} elseif ($action == 'confirm_validate' && $confirm == 'yes' && $usercanvalidate) {
@ -1355,7 +1369,7 @@ if (empty($reshook)) {
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to build doc
$upload_dir = $conf->commande->multidir_output[$object->entity];
$upload_dir = !empty($conf->propal->multidir_output[$object->entity])?$conf->propal->multidir_output[$object->entity]:$conf->propal->dir_output;
$permissiontoadd = $usercancreate;
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
@ -1688,7 +1702,7 @@ if ($action == 'create' && $usercancreate) {
print '</td></tr>';
}
// Source / Channle - What trigger creation
// Source / Channel - What trigger creation
print '<tr><td>'.$langs->trans('Channel').'</td><td>';
print img_picto('', 'question', 'class="pictofixedwidth"');
$form->selectInputReason($demand_reason_id, 'demand_reason_id', '', 1, 'maxwidth200 widthcentpercentminusx');

View File

@ -452,7 +452,7 @@ if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
}
$sql .= ', '.MAIN_DB_PREFIX.'commande as c';
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."commande_extrafields as ef on (c.rowid = ef.fk_object)";
}
if ($sall || $search_product_category > 0) {
@ -829,6 +829,11 @@ if ($resql) {
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
// Add $param from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
$param .= $hookmanager->resPrint;
// List of mass actions available
$arrayofmassactions = array(
'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),

View File

@ -52,8 +52,8 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
}
echo '</td>';
echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
echo '<td class="linkedcol-ref" align="center">'.$objectlink->ref_client.'</td>';
echo '<td class="linkedcol-date" align="center">'.dol_print_date($objectlink->date, 'day').'</td>';
echo '<td class="linkedcol-ref">'.$objectlink->ref_client.'</td>';
echo '<td class="linkedcol-date">'.dol_print_date($objectlink->date, 'day').'</td>';
echo '<td class="linkedcol-amount right">';
if ($user->rights->commande->lire) {
$total = $total + $objectlink->total_ht;

View File

@ -499,7 +499,7 @@ if ($result && $action == "dl" && !$error) {
$zip->addFromString('transactions.csv', $log);
$zip->close();
///Then download the zipped file.
// Then download the zipped file.
header('Content-Type: application/zip');
header('Content-disposition: attachment; filename='.basename($zipname));
header('Content-Length: '.filesize($zipname));
@ -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

@ -343,7 +343,7 @@ if ($action == 'create') {
print load_fiche_titre($langs->trans("NewFinancialAccount"), '', 'bank_account');
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () {
jQuery("#selecttype").change(function() {
document.formsoc.action.value="create";
@ -429,7 +429,7 @@ if ($action == 'create') {
print '<tr><td>'.$langs->trans("Web").'</td>';
print '<td>';
print img_picto('', 'globe', 'class="pictofixedwidth"');
print '<input class="minwidth300" type="text" class="flat" name="url" value="'.GETPOST("url").'">';
print '<input class="minwidth300 widthcentpercentminusx maxwidth500" type="text" class="flat" name="url" value="'.GETPOST("url").'">';
print '</td></tr>';
// Tags-Categories
@ -831,7 +831,7 @@ if ($action == 'create') {
print load_fiche_titre($langs->trans("EditFinancialAccount"), '', 'bank_account');
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print 'jQuery(document).ready(function () {
jQuery("#selecttype").change(function() {
document.formsoc.action.value="edit";

View File

@ -342,7 +342,7 @@ foreach ($bankcateg->fetchAll() as $bankcategory) {
if ($action == 'create') {
// Update fields properties in realtime
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
setPaymentType();
$("#selectpaymenttype").change(function() {
@ -415,7 +415,7 @@ if ($action == 'create') {
if (!empty($conf->banque->enabled)) {
print '<tr><td>';
print $form->editfieldkey('BankAccount', 'selectaccountid', '', $object, 0, 'string', '', 1).'</td><td>';
$form->select_comptes($accountid, "accountid", 0, '', 2); // Affiche liste des comptes courant
print img_picto('', 'bank_account', 'class="pictofixedwidth"').$form->select_comptes($accountid, "accountid", 0, '', 2, '', 0, '', 1); // Affiche liste des comptes courant
print '</td></tr>';
}
@ -490,9 +490,8 @@ if ($action == 'create') {
$langs->load("projects");
print '<tr><td>'.$langs->trans("Project").'</td><td>';
$numproject = $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1);
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
print $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1);
print '</td></tr>';
}

View File

@ -160,7 +160,7 @@ $arrayfields = array(
'ref' =>array('label'=>"Ref", 'checked'=>1, 'position'=>100),
'label' =>array('label'=>"Label", 'checked'=>1, 'position'=>110),
'datep' =>array('label'=>"DatePayment", 'checked'=>1, 'position'=>120),
'datev' =>array('label'=>"DateValue", 'checked'=>1, 'position'=>130),
'datev' =>array('label'=>"DateValue", 'checked'=>-1, 'position'=>130),
'type' =>array('label'=>"PaymentMode", 'checked'=>1, 'position'=>140),
'project' =>array('label'=>"Project", 'checked'=>1, 'position'=>200, "enabled"=>!empty($conf->projet->enabled)),
'bank' =>array('label'=>"BankAccount", 'checked'=>1, 'position'=>300, "enabled"=>!empty($conf->banque->enabled)),

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

@ -1066,7 +1066,7 @@ if ($action == 'create') {
// Autogeneration
$title = $langs->trans("Recurrence");
print load_fiche_titre('<span class="fa fa-calendar"></span> '.$title, '', '');
print load_fiche_titre(img_picto('', 'recurring', 'class="pictofixedwidth"').$title, '', '');
print dol_get_fiche_head(null, '', '', 0);
@ -1455,7 +1455,7 @@ if ($action == 'create') {
print '<table class="border centpercent tableforfield">';
print '<tr><td colspan="2"><span class="fa fa-calendar"></span> '.$title.'</td></tr>';
print '<tr><td colspan="2">'.img_picto('', 'recurring', 'class="pictofixedwidth"').$title.'</td></tr>';
// if "frequency" is empty or = 0, the reccurence is disabled
print '<tr><td style="width: 50%">';

View File

@ -1660,6 +1660,11 @@ if (empty($reshook)) {
$discount->tva_tx = $lines[$i]->tva_tx;
$discount->fk_user = $user->id;
$discount->description = $desc;
$discount->multicurrency_subprice = abs($lines[$i]->multicurrency_subprice);
$discount->multicurrency_amount_ht = abs($lines[$i]->multicurrency_total_ht);
$discount->multicurrency_amount_tva = abs($lines[$i]->multicurrency_total_tva);
$discount->multicurrency_amount_ttc = abs($lines[$i]->multicurrency_total_ttc);
$discountid = $discount->create($user);
if ($discountid > 0) {
$result = $object->insert_discount($discountid); // This include link_to_invoice
@ -3215,7 +3220,7 @@ if ($action == 'create') {
if (empty($conf->global->INVOICE_DISABLE_DEPOSIT)) {
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp = '<input type="radio" id="radio_deposit" name="type" value="3"'.(GETPOST('type') == 3 ? ' checked' : '').'> ';
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#typestandardinvoice, #valuestandardinvoice").click(function() {
jQuery("#radio_standard").prop("checked", true);
@ -3329,7 +3334,7 @@ if ($action == 'create') {
$tmp .= ' disabled';
}
$tmp .= '> ';
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#fac_replacement").change(function() {
jQuery("#radio_replacement").prop("checked", true);
@ -3418,7 +3423,7 @@ if ($action == 'create') {
}
$tmp .= '> ';
// Show credit note options only if we checked credit note
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
jQuery(document).ready(function() {
if (! jQuery("#radio_creditnote").is(":checked"))
{
@ -3493,7 +3498,7 @@ if ($action == 'create') {
$jsListType .= (!empty($jsListType) ? ',' : '').'"'.$type.'":"'.$curent.'"';
}
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
$(document).ready(function() {
var listType = {'.$jsListType.'};
$("[name=\'type\'").change(function() {
@ -3581,7 +3586,7 @@ if ($action == 'create') {
$form->select_conditions_paiements($retained_warranty_fk_cond_reglement, 'retained_warranty_fk_cond_reglement', -1, 1);
print '</td></tr>';
print '<script type="text/javascript" language="javascript">
print '<script type="text/javascript">
$(document).ready(function() {
$("[name=\'type\']").change(function() {
if($( this ).prop("checked") && $.inArray($( this ).val(), '.json_encode($retainedWarrantyInvoiceAvailableType).' ) !== -1)
@ -5405,7 +5410,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

@ -100,14 +100,6 @@ if ($action == 'addcontact' && $user->rights->facture->creer) {
* View
*/
if (empty($object->id)) {
llxHeader();
$langs->load('errors');
echo '<div class="error">'.$langs->trans("ErrorRecordNotFound").'</div>';
llxFooter();
exit;
}
$title = $langs->trans('InvoiceCustomer')." - ".$langs->trans('ContactsAddresses');
$helpurl = "EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes";
llxHeader('', $title, $helpurl);

View File

@ -141,7 +141,7 @@ $arrayfields = array(
'f.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>1),
'f.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0),
'f.fk_cond_reglement'=>array('label'=>"PaymentTerm", 'checked'=>0),
'recurring'=>array('label'=>"RecurringInvoiceTemplate", 'checked'=>1),
'recurring'=>array('label'=>"RecurringInvoice", 'checked'=>1),
'f.frequency'=>array('label'=>"Frequency", 'checked'=>1),
'f.unit_frequency'=>array('label'=>"FrequencyUnit", 'checked'=>1),
'f.nb_gen_done'=>array('label'=>"NbOfGenerationDoneShort", 'checked'=>1),
@ -359,7 +359,11 @@ if ($search_date_when_end) {
$sql .= " AND f.date_when <= '".$db->idate($search_date_when_end)."'";
}
$sql .= $db->order($sortfield, $sortorder);
$tmpsortfield = $sortfield;
if ($tmpsortfield == 'recurring') {
$tmpsortfield = 'f.frequency';
}
$sql .= $db->order($tmpsortfield, $sortorder);
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
@ -773,8 +777,9 @@ if ($resql) {
$totalarray['nbfield']++;
}
}
// Is it a recurring invoice
if (!empty($arrayfields['recurring']['checked'])) {
print '<td class="center">'.yn($objp->frequency ? 1 : 0).'</td>';
print '<td class="center">'.($objp->frequency ? img_picto($langs->trans("Frequency").': '.$objp->frequency.' '.$objp->unit_frequency, 'recurring', 'class="opacitymedium"').' ' : '').yn($objp->frequency ? 1 : 0).'</td>';
if (!$i) {
$totalarray['nbfield']++;
}

View File

@ -348,7 +348,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
// Add realtime total information
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
setPaiementCode();

View File

@ -409,7 +409,7 @@ if ($action == 'new') {
foreach ($accounts as $bid => $account_label) {
print '
<script language="javascript" type="text/javascript">
<script type="text/javascript">
jQuery(document).ready(function()
{
jQuery("#checkall_'.$bid.'").click(function()

View File

@ -154,7 +154,7 @@ if ($action == 'create') {
$total = $charge->amount;
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
//Add js for AutoFill
print ' $(document).ready(function () {';

View File

@ -154,7 +154,7 @@ if ($action == 'create') {
$total = $tva->amount;
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
//Add js for AutoFill
print ' $(document).ready(function () {';

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) {
@ -359,7 +401,7 @@ if ($action == 'create') {
print load_fiche_titre($langs->trans("VAT").' - '.$langs->trans("New"));
if (!empty($conf->use_javascript_ajax)) {
print "\n".'<script type="text/javascript" language="javascript">';
print "\n".'<script type="text/javascript">';
print /** @lang JavaScript */'
$(document).ready(function () {
let onAutoCreatePaiementChange = function () {
@ -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

@ -331,6 +331,12 @@ $dolibarr_cron_allow_cli='0';
// Examples:
// $dolibarr_strict_mode=0;
// dolibarr_allow_download_external_modules
// Provide a link to download the zip of an external modules installed into custom directory from the web admin.
// Default value: 0
// Examples:
// $dolibarr_allow_download_external_modules=0;
//#################################

View File

@ -105,7 +105,7 @@ abstract class ActionsContactCardCommon
if ($action == 'create' || $action == 'edit') {
if ($conf->use_javascript_ajax) {
$this->tpl['ajax_selectcountry'] = "\n".'<script type="text/javascript" language="javascript">
$this->tpl['ajax_selectcountry'] = "\n".'<script type="text/javascript">
jQuery(document).ready(function () {
jQuery("#selectcountry_id").change(function() {
document.formsoc.action.value="'.$action.'";

View File

@ -620,7 +620,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
dol_htmloutput_errors(is_numeric($error) ? '' : $error, $errors);
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">'."\n";
print "\n".'<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {
jQuery("#selectcountry_id").change(function() {
document.formsoc.action.value="create";
@ -798,7 +798,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Unsubscribe
if (!empty($conf->mailing->enabled)) {
if ($conf->use_javascript_ajax && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) {
print "\n".'<script type="text/javascript" language="javascript">'."\n";
print "\n".'<script type="text/javascript">'."\n";
print '$(document).ready(function () {
$("#email").keyup(function() {
if ($(this).val()!="") {
@ -924,7 +924,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
dol_htmloutput_errors(is_numeric($error) ? '' : $error, $errors);
if ($conf->use_javascript_ajax) {
print "\n".'<script type="text/javascript" language="javascript">'."\n";
print "\n".'<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {
jQuery("#selectcountry_id").change(function() {
document.formsoc.action.value="edit";
@ -1071,7 +1071,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
// Unsubscribe
if (!empty($conf->mailing->enabled)) {
if ($conf->use_javascript_ajax && isset($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) {
print "\n".'<script type="text/javascript" language="javascript">'."\n";
print "\n".'<script type="text/javascript">'."\n";
print '
jQuery(document).ready(function () {

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 = GETPOSTISSET("search_no_email") ? GETPOST("search_no_email", 'int') : -1;
} else {
$search_no_email = -1;
}
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {

View File

@ -34,18 +34,22 @@ $action = GETPOST('action', 'aZ09');
// Load translation files required by the page
$langs->load("companies");
// Security check
$id = GETPOST('id', 'int');
if ($user->socid) {
$id = $user->socid;
}
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$object = new Contact($db);
if ($id > 0) {
$object->fetch($id);
}
// Security check
if ($user->socid > 0) {
if ($object->fk_soc > 0 && $object->fk_soc != $user->socid) {
accessforbidden();
}
}
$result = restrictedArea($user, 'contact', $id, 'socpeople&societe');
$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context

View File

@ -916,6 +916,8 @@ if (empty($reshook)) {
}
}
// Actions when printing a doc from card
include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
// Actions to build doc
$upload_dir = $conf->contrat->multidir_output[$object->entity];

View File

@ -229,6 +229,7 @@ $formother = new FormOther($db);
$socstatic = new Societe($db);
$formcompany = new FormCompany($db);
$contracttmp = new Contrat($db);
$title = "";
$sql = 'SELECT';
$sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,";
@ -259,7 +260,7 @@ if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
$sql .= ", ".MAIN_DB_PREFIX."contrat as c";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (c.rowid = ef.fk_object)";
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";

View File

@ -37,6 +37,7 @@ $langs->loadLangs(array('products', 'contracts', 'companies'));
$optioncss = GETPOST('optioncss', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
$sortorder = GETPOST("sortorder", 'alpha');
@ -248,7 +249,7 @@ if (empty($user->rights->societe->client->voir) && !$socid) {
$sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
}
$sql .= " ".MAIN_DB_PREFIX."contratdet as cd";
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (cd.rowid = ef.fk_object)";
}
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";

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