Merge remote-tracking branch 'Dolibarr/14.0' into 14
This commit is contained in:
commit
58380acc31
@ -228,8 +228,9 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
|
||||
* If your database is MySQL or MariaDB, you need at least version 5.1
|
||||
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
|
||||
* removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__)
|
||||
* 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.
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.4 compared to 13.0.3 *****
|
||||
|
||||
@ -91,7 +91,6 @@ if ($action == 'update') {
|
||||
if (!$error) {
|
||||
foreach ($list as $constname) {
|
||||
$constvalue = GETPOST($constname, 'alpha');
|
||||
var_dump($constname);
|
||||
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -576,7 +576,7 @@ if (!empty($sortfield)) {
|
||||
// Export into a file with format defined into setup (FEC, CSV, ...)
|
||||
// Must be after definition of $sql
|
||||
if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->export) {
|
||||
// TODO Replace the fetchAll + ->export later that consume too much memory on large export with the query($sql) and loop on each line to export them.
|
||||
// TODO Replace the fetchAll to get all ->line followed by call to ->export(). It consumew too much memory on large export. Replace this with the query($sql) and loop on each line to export them.
|
||||
$result = $object->fetchAll($sortorder, $sortfield, 0, 0, $filter, 'AND', (empty($conf->global->ACCOUNTING_REEXPORT) ? 0 : 1));
|
||||
|
||||
if ($result < 0) {
|
||||
@ -822,7 +822,7 @@ if (!empty($arrayfields['t.piece_num']['checked'])) {
|
||||
// Code journal
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1);
|
||||
print $formaccounting->multi_select_journal($search_ledger_code, 'search_ledger_code', 0, 1, 1, 1, 'maxwidth150');
|
||||
print '</td>';
|
||||
}
|
||||
// Date document
|
||||
@ -865,7 +865,7 @@ if (!empty($arrayfields['t.subledger_account']['checked'])) {
|
||||
print $formaccounting->select_auxaccount($search_accountancy_aux_code_end, 'search_accountancy_aux_code_end', $langs->trans('to'), 'maxwidth250', 'subledgeraccount');
|
||||
print '</div>';
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth100" name="search_accountancy_aux_code" value="'.$search_accountancy_aux_code.'">';
|
||||
print '<input type="text" class="maxwidth75" name="search_accountancy_aux_code" value="'.$search_accountancy_aux_code.'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -56,6 +56,14 @@ $search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
|
||||
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
|
||||
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
|
||||
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
|
||||
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
|
||||
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
|
||||
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
|
||||
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
|
||||
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
|
||||
|
||||
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||
@ -81,7 +89,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_
|
||||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (empty($conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION) ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
@ -144,6 +152,7 @@ $arrayfields = array(
|
||||
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
|
||||
);
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
@ -221,6 +230,14 @@ if (empty($reshook)) {
|
||||
$search_date_export_endyear = '';
|
||||
$search_date_export_endmonth = '';
|
||||
$search_date_export_endday = '';
|
||||
$search_date_validation_start = '';
|
||||
$search_date_validation_end = '';
|
||||
$search_date_validation_startyear = '';
|
||||
$search_date_validation_startmonth = '';
|
||||
$search_date_validation_startday = '';
|
||||
$search_date_validation_endyear = '';
|
||||
$search_date_validation_endmonth = '';
|
||||
$search_date_validation_endday = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
@ -301,6 +318,14 @@ if (empty($reshook)) {
|
||||
$filter['t.date_export<='] = $search_date_export_end;
|
||||
$param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear;
|
||||
}
|
||||
if (!empty($search_date_validation_start)) {
|
||||
$filter['t.date_validated>='] = $search_date_validation_start;
|
||||
$param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear;
|
||||
}
|
||||
if (!empty($search_date_validation_end)) {
|
||||
$filter['t.date_validated<='] = $search_date_validation_end;
|
||||
$param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
|
||||
@ -484,10 +509,9 @@ $moreforfilter = '';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= $langs->trans('AccountAccounting').': ';
|
||||
$moreforfilter .= '<div class="nowrap inline-block">';
|
||||
$moreforfilter .= $langs->trans('From').' ';
|
||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', 1, array(), 1, 1, 'maxwidth200');
|
||||
$moreforfilter .= ' '.$langs->trans('to').' ';
|
||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', 1, array(), 1, 1, 'maxwidth200');
|
||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), array(), 1, 1, 'maxwidth200');
|
||||
$moreforfilter .= ' ';
|
||||
$moreforfilter .= $formaccounting->select_account($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), array(), 1, 1, 'maxwidth200');
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
@ -564,6 +588,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date validation
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
@ -605,6 +640,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -632,20 +670,19 @@ while ($i < min($num, $limit)) {
|
||||
$accountg = length_accountg($line->numero_compte);
|
||||
//if (empty($accountg)) $accountg = '-';
|
||||
|
||||
$colspan = 0; // colspan before field 'label of operation'
|
||||
$colspanend = 3; // colspan after debit/credit
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.date_validating']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
|
||||
|
||||
// Is it a break ?
|
||||
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
|
||||
$colnumber = 5;
|
||||
$colnumberend = 7;
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
$colnumber--;
|
||||
}
|
||||
if (empty($arrayfields['t.date_export']['checked'])) {
|
||||
$colnumber--;
|
||||
}
|
||||
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
// Show a subtotal by accounting account
|
||||
if (isset($displayed_account_number)) {
|
||||
print '<tr class="liste_total">';
|
||||
@ -845,6 +882,14 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Validated operation date
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -876,9 +921,7 @@ while ($i < min($num, $limit)) {
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($num > 0) {
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
if ($num > 0 && $colspan > 0) {
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
|
||||
@ -2,8 +2,8 @@
|
||||
/* Copyright (C) 2016 Neil Orley <neil.orley@oeris.fr>
|
||||
* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2020 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -46,7 +46,7 @@ $search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
|
||||
$search_date_end = dol_mktime(0, 0, 0, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int');
|
||||
$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int');
|
||||
@ -55,7 +55,15 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
|
||||
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
|
||||
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
|
||||
$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
|
||||
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
|
||||
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
|
||||
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
|
||||
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
|
||||
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
|
||||
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
|
||||
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
|
||||
|
||||
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||
@ -144,6 +152,7 @@ $arrayfields = array(
|
||||
't.credit'=>array('label'=>$langs->trans("Credit"), 'checked'=>1),
|
||||
't.lettering_code'=>array('label'=>$langs->trans("LetteringCode"), 'checked'=>1),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
|
||||
);
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
@ -221,6 +230,14 @@ if (empty($reshook)) {
|
||||
$search_date_export_endyear = '';
|
||||
$search_date_export_endmonth = '';
|
||||
$search_date_export_endday = '';
|
||||
$search_date_validation_start = '';
|
||||
$search_date_validation_end = '';
|
||||
$search_date_validation_startyear = '';
|
||||
$search_date_validation_startmonth = '';
|
||||
$search_date_validation_startday = '';
|
||||
$search_date_validation_endyear = '';
|
||||
$search_date_validation_endmonth = '';
|
||||
$search_date_validation_endday = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
@ -301,6 +318,14 @@ if (empty($reshook)) {
|
||||
$filter['t.date_export<='] = $search_date_export_end;
|
||||
$param .= '&search_date_export_endmonth='.$search_date_export_endmonth.'&search_date_export_endday='.$search_date_export_endday.'&search_date_export_endyear='.$search_date_export_endyear;
|
||||
}
|
||||
if (!empty($search_date_validation_start)) {
|
||||
$filter['t.date_validated>='] = $search_date_validation_start;
|
||||
$param .= '&search_date_validation_startmonth='.$search_date_validation_startmonth.'&search_date_validation_startday='.$search_date_validation_startday.'&search_date_validation_startyear='.$search_date_validation_startyear;
|
||||
}
|
||||
if (!empty($search_date_validation_end)) {
|
||||
$filter['t.date_validated<='] = $search_date_validation_end;
|
||||
$param .= '&search_date_validation_endmonth='.$search_date_validation_endmonth.'&search_date_validation_endday='.$search_date_validation_endday.'&search_date_validation_endyear='.$search_date_validation_endyear;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delbookkeeping' && $user->rights->accounting->mouvements->supprimer) {
|
||||
@ -373,7 +398,6 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("VueByAccountAccou
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
|
||||
// List
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
@ -448,7 +472,6 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
@ -488,10 +511,9 @@ $moreforfilter = '';
|
||||
$moreforfilter .= '<div class="divsearchfield">';
|
||||
$moreforfilter .= $langs->trans('AccountAccounting').': ';
|
||||
$moreforfilter .= '<div class="nowrap inline-block">';
|
||||
$moreforfilter .= $langs->trans('From').' ';
|
||||
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', 1, 'maxwidth200');
|
||||
$moreforfilter .= ' '.$langs->trans('to').' ';
|
||||
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', 1, 'maxwidth200');
|
||||
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_start, 'search_accountancy_code_start', $langs->trans('From'), 'maxwidth200');
|
||||
$moreforfilter .= ' ';
|
||||
$moreforfilter .= $formaccounting->select_auxaccount($search_accountancy_code_end, 'search_accountancy_code_end', $langs->trans('to'), 'maxwidth200');
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= '</div>';
|
||||
|
||||
@ -568,6 +590,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date validation
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
@ -609,6 +642,9 @@ if (!empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -636,21 +672,19 @@ while ($i < min($num, $limit)) {
|
||||
$accountg = length_accounta($line->subledger_account);
|
||||
//if (empty($accountg)) $accountg = '-';
|
||||
|
||||
$colspan = 0; // colspan before field 'label of operation'
|
||||
$colspanend = 3; // colspan after debit/credit
|
||||
if (!empty($arrayfields['t.piece_num']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.code_journal']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_date']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.doc_ref']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.label_operation']['checked'])) { $colspan++; }
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.date_validating']['checked'])) { $colspanend++; }
|
||||
if (!empty($arrayfields['t.lettering_code']['checked'])) { $colspanend++; }
|
||||
|
||||
// Is it a break ?
|
||||
if ($accountg != $displayed_account_number || !isset($displayed_account_number)) {
|
||||
$colnumber = 5;
|
||||
$colnumberend = 7;
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING) || empty($arrayfields['t.lettering_code']['checked'])) {
|
||||
$colnumber--;
|
||||
}
|
||||
if (empty($arrayfields['t.date_export']['checked'])) {
|
||||
$colnumber--;
|
||||
}
|
||||
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
|
||||
// Show a subtotal by accounting account
|
||||
if (isset($displayed_account_number)) {
|
||||
print '<tr class="liste_total">';
|
||||
@ -859,6 +893,14 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Validated operation date
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
|
||||
@ -890,9 +932,7 @@ while ($i < min($num, $limit)) {
|
||||
$i++;
|
||||
}
|
||||
|
||||
if ($num > 0) {
|
||||
$colspan = $totalarray['nbfield'] - $colnumber;
|
||||
$colspanend = $totalarray['nbfield'] - $colnumberend;
|
||||
if ($num > 0 && $colspan > 0) {
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="right" colspan="'.$colspan.'">'.$langs->trans("TotalForAccount").' '.$accountg.':</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2015 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2016 Pierre-Henry Favre <phf@atm-consulting.fr>
|
||||
* Copyright (C) 2016-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2017 Elarifr. Ari Elbaz <github@accedinfo.com>
|
||||
* Copyright (C) 2017-2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -466,34 +466,43 @@ class AccountancyExport
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : CIEL
|
||||
* Export format : CIEL (Format XIMPORT)
|
||||
* Format since 2003 compatible CIEL version > 2002 / Sage50
|
||||
* Last review for this format : 2021/07/28 Alexandre Spangaro (aspangaro@open-dsi.fr)
|
||||
*
|
||||
* Help : https://sage50c.online-help.sage.fr/aide-technique/
|
||||
* In sage software | Use menu : "Exchange" > "Importing entries..."
|
||||
*
|
||||
* If you want to force filename to "XIMPORT.TXT" for automatically import file present in a directory :
|
||||
* use constant ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME
|
||||
*
|
||||
* @param array $TData data
|
||||
* @return void
|
||||
*/
|
||||
public function exportCiel(&$TData)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$end_line = "\r\n";
|
||||
|
||||
$i = 1;
|
||||
$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be yyyymmdd
|
||||
|
||||
foreach ($TData as $data) {
|
||||
$code_compta = $data->numero_compte;
|
||||
$code_compta = length_accountg($data->numero_compte);
|
||||
if (!empty($data->subledger_account)) {
|
||||
$code_compta = $data->subledger_account;
|
||||
$code_compta = length_accounta($data->subledger_account);
|
||||
}
|
||||
|
||||
$date_document = dol_print_date($data->doc_date, '%Y%m%d');
|
||||
$date_echeance = dol_print_date($data->date_lim_reglement, '%Y%m%d');
|
||||
|
||||
$Tab = array();
|
||||
$Tab['num_ecriture'] = str_pad($i, 5);
|
||||
$Tab['num_ecriture'] = str_pad($data->piece_num, 5);
|
||||
$Tab['code_journal'] = str_pad($data->code_journal, 2);
|
||||
$Tab['date_ecriture'] = $date_ecriture;
|
||||
$Tab['date_ope'] = dol_print_date($data->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->piece_num, 12), 12);
|
||||
$Tab['date_ecriture'] = str_pad($date_document, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['date_echeance'] = str_pad($date_echeance, 8, ' ', STR_PAD_LEFT);
|
||||
$Tab['num_piece'] = str_pad(self::trunc($data->doc_ref, 12), 12);
|
||||
$Tab['num_compte'] = str_pad(self::trunc($code_compta, 11), 11);
|
||||
$Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).dol_string_unaccent($data->label_operation), 25), 25);
|
||||
$Tab['montant'] = str_pad(abs($data->debit - $data->credit), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['montant'] = str_pad(price2fec(abs($data->debit - $data->credit)), 13, ' ', STR_PAD_LEFT);
|
||||
$Tab['type_montant'] = str_pad($data->sens, 1);
|
||||
$Tab['vide'] = str_repeat(' ', 18);
|
||||
$Tab['intitule_compte'] = str_pad(self::trunc(dol_string_unaccent($data->label_operation), 34), 34);
|
||||
|
||||
@ -177,7 +177,7 @@ $accountingjournalstatic->fetch($id_journal);
|
||||
$journal = $accountingjournalstatic->code;
|
||||
$journal_label = $accountingjournalstatic->label;
|
||||
|
||||
|
||||
//print $sql;
|
||||
dol_syslog("accountancy/journal/bankjournal.php", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
@ -252,6 +252,7 @@ if ($result) {
|
||||
);
|
||||
|
||||
// Set accountancy code for user
|
||||
// $obj->accountancy_code is the accountancy_code of table u=user but it is defined only if a link with type 'user' exists)
|
||||
$compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : '');
|
||||
|
||||
$tabuser[$obj->rowid] = array(
|
||||
@ -277,7 +278,7 @@ if ($result) {
|
||||
$tabpay[$obj->rowid]["lib"] = dol_trunc($obj->label, 60);
|
||||
}
|
||||
|
||||
// Load of url links to the line into llx_bank
|
||||
// Load of url links to the line into llx_bank (so load llx_bank_url)
|
||||
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
|
||||
|
||||
// By default
|
||||
@ -287,7 +288,7 @@ if ($result) {
|
||||
|
||||
// get_url may return -1 which is not traversable
|
||||
if (is_array($links) && count($links) > 0) {
|
||||
// Now loop on each link of record in bank.
|
||||
// Now loop on each link of record in bank (code similar to bankentries_list.php)
|
||||
foreach ($links as $key => $val) {
|
||||
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
|
||||
// So we excluded 'company' and 'user' here. We want only payment lines
|
||||
@ -302,6 +303,7 @@ if ($result) {
|
||||
}
|
||||
}
|
||||
|
||||
// Special case to ask later to add more request to get information for old links without company link.
|
||||
if ($links[$key]['type'] == 'withdraw') {
|
||||
$tabmoreinfo[$obj->rowid]['withdraw'] = 1;
|
||||
}
|
||||
@ -401,6 +403,44 @@ if ($result) {
|
||||
$paymentsalstatic->label = $links[$key]['label'];
|
||||
$tabpay[$obj->rowid]["lib"] .= ' '.$paymentsalstatic->getNomUrl(2);
|
||||
$tabpay[$obj->rowid]["paymentsalid"] = $paymentsalstatic->id;
|
||||
|
||||
// This part of code is no more required. it is here to solve case where a link were missing (ith v14.0.0) and keep writing in accountancy complete.
|
||||
// Note: A better way to fix this is to delete payement of salary and recreate it, or to fix the bookkeeping table manually after.
|
||||
if (!empty($conf->global->ACCOUNTANCY_AUTOFIX_MISSING_LINK_TO_USEr_ON_SALARY_BANK_PAYMENT)) {
|
||||
$tmpsalary = new Salary($db);
|
||||
$tmpsalary->fetch($paymentsalstatic->id);
|
||||
$tmpsalary->fetch_user($tmpsalary->fk_user);
|
||||
|
||||
$userstatic->id = $tmpsalary->user->id;
|
||||
$userstatic->name = $tmpsalary->user->name;
|
||||
$userstatic->email = $tmpsalary->user->email;
|
||||
$userstatic->firstname = $tmpsalary->user->firstname;
|
||||
$userstatic->lastname = $tmpsalary->user->lastname;
|
||||
$userstatic->statut = $tmpsalary->user->statut;
|
||||
$userstatic->accountancy_code = $tmpsalary->user->accountancy_code;
|
||||
|
||||
if ($userstatic->id > 0) {
|
||||
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0);
|
||||
} else {
|
||||
$tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen
|
||||
}
|
||||
|
||||
if (empty($obj->typeop_user)) { // Add test to avoid to add amount twice if a link already exists also on user.
|
||||
$compta_user = $userstatic->accountancy_code;
|
||||
if ($compta_user) {
|
||||
$tabtp[$obj->rowid][$compta_user] += $obj->amount;
|
||||
$tabuser[$obj->rowid] = array(
|
||||
'id' => $userstatic->id,
|
||||
'name' => dolGetFirstLastname($userstatic->firstname, $userstatic->lastname),
|
||||
'lastname' => $userstatic->lastname,
|
||||
'firstname' => $userstatic->firstname,
|
||||
'email' => $userstatic->email,
|
||||
'accountancy_code' => $compta_user,
|
||||
'status' => $userstatic->statut
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ($links[$key]['type'] == 'payment_expensereport') {
|
||||
$paymentexpensereportstatic->id = $links[$key]['url_id'];
|
||||
$tabpay[$obj->rowid]["lib"] .= $paymentexpensereportstatic->getNomUrl(2);
|
||||
@ -468,7 +508,7 @@ if ($result) {
|
||||
}
|
||||
}
|
||||
|
||||
// If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
|
||||
// If no links were found to know the amount on thirdparty/user, we init it to account 'NotDefined'.
|
||||
if (empty($tabtp[$obj->rowid])) {
|
||||
$tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
|
||||
}
|
||||
@ -1162,9 +1202,9 @@ if (empty($action) || $action == 'view') {
|
||||
if ($tabtype[$key] == 'unknown') {
|
||||
// We will accept writing, but into a waiting account
|
||||
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') {
|
||||
print '<span class="error">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
||||
print '<span class="error small">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
||||
} else {
|
||||
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||
print '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||
}
|
||||
} else {
|
||||
// We will refuse writing
|
||||
@ -1187,7 +1227,7 @@ if (empty($action) || $action == 'view') {
|
||||
if ($tabtype[$key] == 'member') {
|
||||
$errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
|
||||
}
|
||||
print '<span class="error">'.$langs->trans($errorstring).'</span>';
|
||||
print '<span class="error small">'.$langs->trans($errorstring).'</span>';
|
||||
}
|
||||
} else {
|
||||
print $accounttoshow;
|
||||
@ -1196,7 +1236,7 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payment with subledger
|
||||
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payments that uses a subledger
|
||||
$accounttoshowsubledger = length_accounta($k);
|
||||
if ($accounttoshow != $accounttoshowsubledger) {
|
||||
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') {
|
||||
@ -1205,14 +1245,14 @@ if (empty($action) || $action == 'view') {
|
||||
var_dump($tabbq[$key]);*/
|
||||
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
if (!empty($tabcompany[$key]['code_compta'])) {
|
||||
if (in_array($tabtype[$key], array('payment_various'))) {
|
||||
if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) {
|
||||
// For such case, if subledger is not defined, we won't use subledger accounts.
|
||||
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
||||
print '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
||||
} else {
|
||||
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
|
||||
print '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
|
||||
}
|
||||
} else {
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
||||
print '<span class="error small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
||||
}
|
||||
} else {
|
||||
print $accounttoshowsubledger;
|
||||
@ -1220,10 +1260,15 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
print "<td>".$reflabel."</td>";
|
||||
|
||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// $formatexportset ùust be defined
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || !is_object($conf)) {
|
||||
print "Error, template page can't be called as URL";
|
||||
@ -56,6 +58,8 @@ if ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$
|
||||
$endaccountingperiod = dol_print_date(dol_get_last_day($tmparray['year'], $tmparray['mon']), 'dayxcard');
|
||||
|
||||
$completefilename = $siren."FEC".$endaccountingperiod.".txt";
|
||||
} elseif ($accountancyexport->getFormatCode($formatexportset) == $accountancyexport::$EXPORT_TYPE_CIEL && $type_export == "general_ledger" && !empty($conf->global->ACCOUNTING_EXPORT_XIMPORT_FORCE_FILENAME)) {
|
||||
$completefilename = "XIMPORT.TXT";
|
||||
} else {
|
||||
$completefilename = ($code ? $code."_" : "").($prefix ? $prefix."_" : "").$filename.($nodateexport ? "" : $date_export).".".$format;
|
||||
}
|
||||
|
||||
@ -134,7 +134,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) {
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print $langs->trans("LinkToTestClickToDial", $user->login).' : ';
|
||||
print '<input class="flat" type="text" name="phonefortest" value="'.dol_escape_htmltag($phonefortest).'">';
|
||||
print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';
|
||||
print '<input type="submit" class="button small" value="'.dol_escape_htmltag($langs->trans("RefreshPhoneLink")).'">';
|
||||
print '</form>';
|
||||
|
||||
$setupcomplete = 1;
|
||||
@ -149,7 +149,7 @@ if (!empty($conf->global->CLICKTODIAL_URL)) {
|
||||
}
|
||||
|
||||
if ($setupcomplete) {
|
||||
print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL');
|
||||
print $langs->trans("LinkToTest", $user->login).': '.dol_print_phone($phonefortest, '', 0, 0, 'AC_TEL', '', 1);
|
||||
} else {
|
||||
$langs->load("errors");
|
||||
print '<div class="warning">'.$langs->trans("WarningClickToDialUserSetupNotComplete").'</div>';
|
||||
|
||||
@ -150,42 +150,44 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("Parameter").'</td>';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>";
|
||||
|
||||
// Bank account (from Banks module)
|
||||
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("BankToPayCreditTransfer").'</td>';
|
||||
print '<td class="left">';
|
||||
$form->select_comptes($conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT, 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 0, "courant=1", 1);
|
||||
print '<td>';
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
print $form->select_comptes($conf->global->PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT, 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT', 0, "courant=1", 1, '', 0, 'minwidth200', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
/* Moved to bank account data
|
||||
// ICS
|
||||
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("ICS").'</td>';
|
||||
print '<td class="left">';
|
||||
print '<td>';
|
||||
print '<input type="text" name="PAYMENTBYBANKTRANSFER_ICS" value="'.$conf->global->PAYMENTBYBANKTRANSFER_ICS.'" size="15" ></td>';
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
//User
|
||||
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("ResponsibleUser").'</td>';
|
||||
print '<td class="left">';
|
||||
print $form->select_dolusers($conf->global->PAYMENTBYBANKTRANSFER_USER, 'PAYMENTBYBANKTRANSFER_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '<td>';
|
||||
print img_picto('', 'user', 'class="pictofixedwidth"');
|
||||
print $form->select_dolusers($conf->global->PAYMENTBYBANKTRANSFER_USER, 'PAYMENTBYBANKTRANSFER_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth200 maxwidth500');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
/*
|
||||
//EntToEnd
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("END_TO_END").'</td>';
|
||||
print '<td class="left">';
|
||||
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.'" size="15" ></td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.'" class="width100"></td>';
|
||||
print '</td></tr>';
|
||||
|
||||
//USTRD
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("USTRD").'</td>';
|
||||
print '<td class="left">';
|
||||
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.'" size="15" ></td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.'" class="width100"></td>';
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
@ -195,7 +197,7 @@ print '<td class="left">';
|
||||
if (!$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS) {
|
||||
$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS = 0;
|
||||
}
|
||||
print '<input type="text" name="PAYMENTBYBANKTRANSFER_ADDDAYS" value="'.$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS.'" size="15" ></td>';
|
||||
print '<input type="text" name="PAYMENTBYBANKTRANSFER_ADDDAYS" value="'.$conf->global->PAYMENTBYBANKTRANSFER_ADDDAYS.'" class="width50"></td>';
|
||||
print '</td></tr>';
|
||||
print '</table>';
|
||||
print '<br>';
|
||||
|
||||
@ -52,22 +52,22 @@ if ($cancel) {
|
||||
}
|
||||
|
||||
if ($action == 'update') {
|
||||
dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_FORMAT')) dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_MARGIN_LEFT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_MARGIN_RIGHT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_MARGIN_BOTTOM')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PROFID1_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PROFID2_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PROFID3_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PROFID4_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_TVAINTRA_NOT_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
if (GETPOST('PDF_SHOW_PROJECT_REF_OR_LABEL') == 'no') {
|
||||
@ -82,20 +82,20 @@ if ($action == 'update') {
|
||||
}
|
||||
}
|
||||
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DESC')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_REF')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_USE_ISO_LOCATION')) dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_THIRD_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE')) dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
if (GETPOSTISSET('SHOW_SUBPRODUCT_REF_IN_PDF')) dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
|
||||
@ -160,8 +160,9 @@ print "</tr>";
|
||||
|
||||
// Bank account (from Banks module)
|
||||
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("BankToReceiveWithdraw").'</td>';
|
||||
print '<td class="left">';
|
||||
$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'PRELEVEMENT_ID_BANKACCOUNT', 0, "courant=1", 1);
|
||||
print '<td>';
|
||||
print img_picto('', 'bank_account', 'class="pictofixedwidth"');
|
||||
print $form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'PRELEVEMENT_ID_BANKACCOUNT', 0, "courant=1", 1, '', 0, 'minwidth200', 1);
|
||||
print '</td></tr>';
|
||||
|
||||
/* Moved to bank account data
|
||||
@ -179,8 +180,9 @@ print '</td></tr>';
|
||||
|
||||
//User
|
||||
print '<tr class="oddeven"><td class="fieldrequired">'.$langs->trans("ResponsibleUser").'</td>';
|
||||
print '<td class="left">';
|
||||
print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'PRELEVEMENT_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print '<td>';
|
||||
print img_picto('', 'user', 'class="pictofixedwidth"');
|
||||
print $form->select_dolusers($conf->global->PRELEVEMENT_USER, 'PRELEVEMENT_USER', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'minwidth200 maxwidth500');
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -189,8 +191,8 @@ print '<tr class="oddeven"><td>';
|
||||
$htmltext = $langs->trans("KeepThisEmptyInMostCases");
|
||||
print $form->textwithpicto($langs->trans("END_TO_END"), $htmltext);
|
||||
print '</td>';
|
||||
print '<td class="left">';
|
||||
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.'" size="15" ></td>';
|
||||
print '<td>';
|
||||
print '<input type="text" name="PRELEVEMENT_END_TO_END" value="'.$conf->global->PRELEVEMENT_END_TO_END.'" class="width100"></td>';
|
||||
print '</td></tr>';
|
||||
|
||||
//USTRD
|
||||
@ -199,16 +201,16 @@ $htmltext = $langs->trans("KeepThisEmptyInMostCases");
|
||||
print $form->textwithpicto($langs->trans("USTRD"), $htmltext);
|
||||
print '</td>';
|
||||
print '<td class="left">';
|
||||
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.'" size="15" ></td>';
|
||||
print '<input type="text" name="PRELEVEMENT_USTRD" value="'.$conf->global->PRELEVEMENT_USTRD.'" class="width100"></td>';
|
||||
print '</td></tr>';
|
||||
|
||||
//ADDDAYS
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ADDDAYS").'</td>';
|
||||
print '<td class="left">';
|
||||
print '<td>';
|
||||
if (empty($conf->global->PRELEVEMENT_ADDDAYS)) {
|
||||
$conf->global->PRELEVEMENT_ADDDAYS = 0;
|
||||
}
|
||||
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" size="5" ></td>';
|
||||
print '<input type="text" name="PRELEVEMENT_ADDDAYS" value="'.$conf->global->PRELEVEMENT_ADDDAYS.'" class="width50"></td>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -59,8 +59,10 @@ $specimenthirdparty->initAsSpecimen();
|
||||
if ($action == 'updateMask') {
|
||||
$maskconstinvoice = GETPOST('maskconstinvoice', 'alpha');
|
||||
$maskconstcredit = GETPOST('maskconstcredit', 'alpha');
|
||||
$maskconstdeposit = GETPOST('maskconstdeposit', 'alpha');
|
||||
$maskinvoice = GETPOST('maskinvoice', 'alpha');
|
||||
$maskcredit = GETPOST('maskcredit', 'alpha');
|
||||
$maskdeposit = GETPOST('maskdeposit', 'alpha');
|
||||
|
||||
if ($maskconstinvoice) {
|
||||
$res = dolibarr_set_const($db, $maskconstinvoice, $maskinvoice, 'chaine', 0, '', $conf->entity);
|
||||
@ -68,6 +70,9 @@ if ($action == 'updateMask') {
|
||||
if ($maskconstcredit) {
|
||||
$res = dolibarr_set_const($db, $maskconstcredit, $maskcredit, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if ($maskconstdeposit) {
|
||||
$res = dolibarr_set_const($db, $maskconstdeposit, $maskdeposit, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if (!($res > 0)) {
|
||||
$error++;
|
||||
|
||||
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("install", "other", "admin"));
|
||||
$langs->loadLangs(array("install", "other", "admin", "errors"));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
@ -198,6 +198,7 @@ if (empty($fileswithwritepermission)) {
|
||||
}
|
||||
}
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: '; // $conffile is defined into filefunc.inc.php
|
||||
$perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
|
||||
@ -219,6 +220,16 @@ if ($perms) {
|
||||
print img_warning().' '.$langs->trans("FailedToReadFile", $conffile);
|
||||
}
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
$installlock = DOL_DATA_ROOT.'/install.lock';
|
||||
print '<strong>'.$langs->trans("DolibarrSetup").'</strong>: ';
|
||||
if (file_exists($installlock)) {
|
||||
print img_picto('', 'tick').' '.$langs->trans("InstallAndUpgradeLockedBy", $installlock);
|
||||
} else {
|
||||
print img_warning().' '.$langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT);
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
|
||||
// File conf.php
|
||||
|
||||
@ -182,7 +182,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$propalstatic->getNomUrl(1).'</td>';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||
print '<td class="nowrap right tdamount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
|
||||
print '<td class="nowrap right tdamount amount">'.price((!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc)).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
@ -278,7 +278,7 @@ if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposa
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$supplierproposalstatic->getNomUrl(1).'</td>';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
|
||||
print '<td class="nowrap right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
@ -375,7 +375,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$orderstatic->getNomUrl(1).'</td>';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'customer').'</td>';
|
||||
print '<td class="nowrap right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
@ -472,7 +472,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$supplierorderstatic->getNomUrl(1).'</td>';
|
||||
print '<td class="nowrap tdoverflowmax100">'.$companystatic->getNomUrl(1, 'supplier').'</td>';
|
||||
print '<td class="nowrap right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '<td class="nowrap right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
$i++;
|
||||
@ -862,7 +862,7 @@ if (!empty($conf->propal->enabled) && $user->rights->propal->lire) {
|
||||
|
||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||
print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dp), 'day').'</td>';
|
||||
print '<td class="right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '<td class="right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '<td align="center" width="14">'.$propalstatic->LibStatut($obj->fk_statut, 3).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
@ -979,7 +979,7 @@ if (!empty($conf->commande->enabled) && $user->rights->commande->lire) {
|
||||
|
||||
print '<td class="nowrap">'.$companystatic->getNomUrl(1, 'customer', 44).'</td>';
|
||||
print '<td class="right tddate">'.dol_print_date($db->jdate($obj->dv), 'day').'</td>';
|
||||
print '<td class="right tdamount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '<td class="right tdamount amount">'.price(!empty($conf->global->MAIN_DASHBOARD_USE_TOTAL_HT) ? $obj->total_ht : $obj->total_ttc).'</td>';
|
||||
print '<td align="center" width="14">'.$orderstatic->LibStatut($obj->fk_statut, $obj->billed, 3).'</td>';
|
||||
|
||||
print '</tr>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2016 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2005-2021 Laurent Destailleur <eldy@uers.sourceforge.net>
|
||||
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
*
|
||||
@ -337,6 +337,7 @@ if ($object->fetch($id) >= 0) {
|
||||
if (is_resource($handle)) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (substr($file, 0, 1) <> '.' && substr($file, 0, 3) <> 'CVS') {
|
||||
$reg = array();
|
||||
if (preg_match("/(.*)\.modules\.php$/i", $file, $reg)) {
|
||||
if ($reg[1] == 'example') {
|
||||
continue;
|
||||
@ -534,9 +535,9 @@ if ($object->fetch($id) >= 0) {
|
||||
|
||||
$morehtmlcenter = '';
|
||||
if ($allowaddtarget) {
|
||||
$morehtmlcenter = '<span class="opacitymedium">'.$langs->trans("ToClearAllRecipientsClickHere").'</span> <a href="'.$_SERVER["PHP_SELF"].'?clearlist=1&id='.$object->id.'" class="button reposition">'.$langs->trans("TargetsReset").'</a>';
|
||||
$morehtmlcenter = '<span class="opacitymedium">'.$langs->trans("ToClearAllRecipientsClickHere").'</span> <a href="'.$_SERVER["PHP_SELF"].'?clearlist=1&id='.$object->id.'" class="button reposition smallpaddingimp">'.$langs->trans("TargetsReset").'</a>';
|
||||
}
|
||||
$morehtmlcenter .= ' <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?exportcsv=1&id='.$object->id.'">'.$langs->trans("Download").'</a>';
|
||||
$morehtmlcenter .= ' <a class="reposition" href="'.$_SERVER["PHP_SELF"].'?exportcsv=1&id='.$object->id.'">'.$langs->trans("Download").'</a>';
|
||||
|
||||
print_barre_liste($langs->trans("MailSelectedRecipients"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $morehtmlcenter, $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
|
||||
|
||||
|
||||
@ -1346,7 +1346,7 @@ if ($resql) {
|
||||
print '<td class="tdoverflowmax300"'.($titletoshow ? ' title="'.dol_escape_htmltag($titletoshow).'"' : '').'>';
|
||||
print $labeltoshow; // Already escaped
|
||||
|
||||
// Add links after description
|
||||
// Add info about links after description
|
||||
$cachebankaccount = array();
|
||||
foreach ($links as $key => $val) {
|
||||
print '<!-- '.$links[$key]['type'].' -->';
|
||||
@ -1424,6 +1424,7 @@ if ($resql) {
|
||||
} elseif ($links[$key]['type'] == 'sc') {
|
||||
} elseif ($links[$key]['type'] == 'vat') {
|
||||
} elseif ($links[$key]['type'] == 'salary') {
|
||||
// Information is already shown using the payment_salary link. No need of this link.
|
||||
} else {
|
||||
// Show link with label $links[$key]['label']
|
||||
if (!empty($objp->label) && !empty($links[$key]['label'])) {
|
||||
@ -1530,15 +1531,21 @@ if ($resql) {
|
||||
}
|
||||
|
||||
if ($companylinked_id) {
|
||||
// TODO Add a cache of loaded companies here
|
||||
// TODO Add a cache of loaded companies here ?
|
||||
$companystatic->fetch($companylinked_id);
|
||||
print $companystatic->getNomUrl(1);
|
||||
} elseif ($userlinked_id &&
|
||||
(($type_link == 'payment_salary' && !empty($user->rights->salaries->read))
|
||||
|| ($type_link == 'payment_sc' && !empty($user->rights->tax->charges->lire)))) {
|
||||
// TODO Add a cache of loaded users here
|
||||
$userstatic->fetch($userlinked_id);
|
||||
print $userstatic->getNomUrl(1);
|
||||
// Get object user from cache or load it
|
||||
if (!empty($conf->cache['user'][$userlinked_id])) {
|
||||
$tmpuser = $conf->cache['user'][$userlinked_id];
|
||||
} else {
|
||||
$tmpuser = new User($db);
|
||||
$tmpuser->fetch($userlinked_id);
|
||||
$conf->cache['user'][$userlinked_id] = $tmpuser;
|
||||
}
|
||||
print $tmpuser->getNomUrl(1);
|
||||
} else {
|
||||
print ' ';
|
||||
}
|
||||
|
||||
@ -399,9 +399,9 @@ class Account extends CommonObject
|
||||
/**
|
||||
* Add a link between bank line record and its source
|
||||
*
|
||||
* @param int $line_id Id ecriture bancaire
|
||||
* @param int $url_id Id parametre url
|
||||
* @param string $url Url
|
||||
* @param int $line_id Id of bank entry
|
||||
* @param int $url_id Id of object related to link
|
||||
* @param string $url Url (deprecated, we use now 'url_id' and 'type' instead)
|
||||
* @param string $label Link label
|
||||
* @param string $type Type of link ('payment', 'company', 'member', ...)
|
||||
* @return int <0 if KO, id line if OK
|
||||
@ -412,13 +412,13 @@ class Account extends CommonObject
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."bank_url (";
|
||||
$sql .= "fk_bank";
|
||||
$sql .= ", url_id";
|
||||
$sql .= ", url";
|
||||
$sql .= ", url"; // deprecated
|
||||
$sql .= ", label";
|
||||
$sql .= ", type";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= " ".((int) $line_id);
|
||||
$sql .= ", '".$this->db->escape($url_id)."'";
|
||||
$sql .= ", '".$this->db->escape($url)."'";
|
||||
$sql .= ", ".((int) $url_id);
|
||||
$sql .= ", '".$this->db->escape($url)."'"; // dperecated
|
||||
$sql .= ", '".$this->db->escape($label)."'";
|
||||
$sql .= ", '".$this->db->escape($type)."'";
|
||||
$sql .= ")";
|
||||
|
||||
@ -624,21 +624,21 @@ if ($result) {
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Conciliation")."</td>";
|
||||
print '<tr><td class="titlefieldcreate">'.$form->textwithpicto($langs->trans("AccountStatement"), $langs->trans("InputReceiptNumber"))."</td>";
|
||||
if ($user->rights->banque->consolidate) {
|
||||
print '<td>';
|
||||
if ($objp->rappro) {
|
||||
print $langs->trans("AccountStatement").' <input name="num_rel_bis" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro ? ' disabled' : '').'>';
|
||||
print '<input name="num_rel_bis" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro ? ' disabled' : '').'>';
|
||||
print '<input name="num_rel" type="hidden" value="'.$objp->num_releve.'">';
|
||||
} else {
|
||||
print $langs->trans("AccountStatement").' <input name="num_rel" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro ? ' disabled' : '').'>';
|
||||
print '<input name="num_rel" class="flat" value="'.$objp->num_releve.'"'.($objp->rappro ? ' disabled' : '').'>';
|
||||
}
|
||||
if ($objp->num_releve) {
|
||||
print ' (<a href="'.DOL_URL_ROOT.'/compta/bank/releve.php?num='.$objp->num_releve.'&account='.$acct->id.'">'.$langs->trans("AccountStatement").' '.$objp->num_releve.')</a>';
|
||||
}
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td>'.$objp->num_releve.' </td>';
|
||||
print '<td>'.$objp->num_releve.'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -5274,7 +5274,8 @@ if ($action == 'create') {
|
||||
// Reopen a standard paid invoice
|
||||
if ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT)
|
||||
|| ($object->type == Facture::TYPE_CREDIT_NOTE && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id)))
|
||||
|| ($object->type == Facture::TYPE_DEPOSIT && empty($discount->id))
|
||||
|| ($object->type == Facture::TYPE_SITUATION && empty($discount->id)))
|
||||
&& ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
|
||||
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) { // A paid invoice (partially or completely)
|
||||
if ($object->close_code != 'replaced' || (!$objectidnext)) { // Not replaced by another invoice or replaced but the replacement invoice has been deleted
|
||||
|
||||
@ -148,12 +148,6 @@ if ($type == 'bank-transfer') {
|
||||
llxHeader('', $title, $helpurl);
|
||||
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* Mode fiche */
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
|
||||
if ($object->id > 0) {
|
||||
$selleruserevenustamp = $mysoc->useRevenueStamp();
|
||||
|
||||
@ -471,6 +465,7 @@ if ($object->id > 0) {
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
||||
// IBAN of seller or supplier
|
||||
$title = 'CustomerIBAN';
|
||||
if ($type == 'bank-transfer') {
|
||||
$title = 'SupplierIBAN';
|
||||
|
||||
@ -67,6 +67,7 @@ $hookmanager->initHooks(array('directdebitcreatecard', 'globalcard'));
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$massaction = '';
|
||||
}
|
||||
@ -165,7 +166,11 @@ llxHeader('', $langs->trans("NewStandingOrder"));
|
||||
|
||||
if (prelevement_check_config($type) < 0) {
|
||||
$langs->load("errors");
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Withdraw")), null, 'errors');
|
||||
$modulenametoshow = "Withdraw";
|
||||
if ($type == 'bank-transfer') {
|
||||
$modulenametoshow = "PaymentByBankTransfer";
|
||||
}
|
||||
setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv($modulenametoshow)), null, 'errors');
|
||||
}
|
||||
|
||||
|
||||
@ -206,7 +211,7 @@ print $nb;
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("AmountTotal").'</td>';
|
||||
print '<td>';
|
||||
print '<td class="amount">';
|
||||
print price($pricetowithdraw);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
@ -225,7 +230,11 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
if ($nb) {
|
||||
if ($pricetowithdraw) {
|
||||
print $langs->trans('BankToReceiveWithdraw').': ';
|
||||
$title = print $langs->trans('BankToReceiveWithdraw').': ';
|
||||
if ($type == 'bank-transfer') {
|
||||
$title .= $langs->trans('BankToPayCreditTransfer').': ';
|
||||
}
|
||||
print $title;
|
||||
$form->select_comptes($conf->global->PRELEVEMENT_ID_BANKACCOUNT, 'id_bankaccount', 0, "courant=1");
|
||||
print ' - ';
|
||||
|
||||
|
||||
@ -182,10 +182,15 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
|
||||
|
||||
$tmparray = array();
|
||||
if (trim($_POST['sendto'])) {
|
||||
// Recipients are provided into free text
|
||||
// Recipients are provided into free text field
|
||||
$tmparray[] = trim($_POST['sendto']);
|
||||
}
|
||||
|
||||
if (trim($_POST['tomail'])) {
|
||||
// Recipients are provided into free hidden text field
|
||||
$tmparray[] = trim($_POST['tomail']);
|
||||
}
|
||||
|
||||
if (count($receiver) > 0) {
|
||||
// Recipient was provided from combo list
|
||||
foreach ($receiver as $key => $val) {
|
||||
|
||||
@ -1628,7 +1628,7 @@ class CMailFile
|
||||
* @return array array of email => name
|
||||
* @see getValidAddress()
|
||||
*/
|
||||
public function getArrayAddress($address)
|
||||
public static function getArrayAddress($address)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
|
||||
@ -3791,7 +3791,6 @@ abstract class CommonObject
|
||||
} elseif ($objecttype == 'contact') {
|
||||
$module = 'societe';
|
||||
}
|
||||
|
||||
// Set classfile
|
||||
$classfile = strtolower($subelement);
|
||||
$classname = ucfirst($subelement);
|
||||
@ -3823,6 +3822,11 @@ abstract class CommonObject
|
||||
$classfile = 'conferenceorboothattendee';
|
||||
$classname = 'ConferenceOrBoothAttendee';
|
||||
$module = 'eventorganization';
|
||||
} elseif ($objecttype == 'conferenceorbooth') {
|
||||
$classpath = 'eventorganization/class';
|
||||
$classfile = 'conferenceorbooth';
|
||||
$classname = 'ConferenceOrBooth';
|
||||
$module = 'eventorganization';
|
||||
}
|
||||
|
||||
// Here $module, $classfile and $classname are set
|
||||
|
||||
@ -680,9 +680,7 @@ class dolReceiptPrinter extends Printer
|
||||
foreach ($object->lines as $line) {
|
||||
$total_localtax1 += $line->total_localtax1;
|
||||
}
|
||||
foreach ($vatarray as $vatkey => $vatvalue) {
|
||||
$this->printer->text(str_pad(price($total_localtax1), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
}
|
||||
$this->printer->text(str_pad(price($total_localtax1), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
break;
|
||||
case 'DOL_PRINT_OBJECT_TAX2':
|
||||
//var_dump($object);
|
||||
@ -690,9 +688,7 @@ class dolReceiptPrinter extends Printer
|
||||
foreach ($object->lines as $line) {
|
||||
$total_localtax2 += $line->total_localtax2;
|
||||
}
|
||||
foreach ($vatarray as $vatkey => $vatvalue) {
|
||||
$this->printer->text(str_pad(price($total_localtax2), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
}
|
||||
$this->printer->text(str_pad(price($total_localtax2), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
break;
|
||||
case 'DOL_PRINT_OBJECT_TOTAL':
|
||||
$title = $langs->trans('TotalHT');
|
||||
|
||||
@ -1267,16 +1267,17 @@ class Form
|
||||
// mode 1
|
||||
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '');
|
||||
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
if (empty($hidelabel)) {
|
||||
print $langs->trans("RefOrLabel").' : ';
|
||||
} elseif ($hidelabel > 1) {
|
||||
$placeholder = ' placeholder="'.$langs->trans("RefOrLabel").'"';
|
||||
$placeholder = $langs->trans("RefOrLabel");
|
||||
if ($hidelabel == 2) {
|
||||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
}
|
||||
$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
|
||||
$out .= '<input type="text" class="'.$morecss.'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '').' '.(!empty($conf->global->THIRDPARTY_SEARCH_AUTOFOCUS) ? 'autofocus' : '').' />';
|
||||
if ($hidelabel == 3) {
|
||||
$out .= img_picto($langs->trans("Search"), 'search');
|
||||
}
|
||||
@ -1951,15 +1952,12 @@ class Form
|
||||
}
|
||||
|
||||
dol_syslog(get_class($this)."::select_dolusers", LOG_DEBUG);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
if ($num) {
|
||||
// Enhance with select2
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox($htmlname);
|
||||
|
||||
// do not use maxwidthonsmartphone by default. Set it by caller so auto size to 100% will work when not defined
|
||||
$out .= '<select class="flat'.($morecss ? ' '.$morecss : ' minwidth200').'" id="'.$htmlname.'" name="'.$htmlname.($multiple ? '[]' : '').'" '.($multiple ? 'multiple' : '').' '.($disabled ? ' disabled' : '').'>';
|
||||
if ($show_empty && !$multiple) {
|
||||
@ -2067,6 +2065,12 @@ class Form
|
||||
$out .= '<option value="">'.$langs->trans("None").'</option>';
|
||||
}
|
||||
$out .= '</select>';
|
||||
|
||||
if ($num) {
|
||||
// Enhance with select2
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox($htmlname);
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
@ -6661,11 +6665,8 @@ class Form
|
||||
$urloption = 'htmlname='.$htmlname.'&outjson=1&objectdesc='.$objectdesc.'&filter='.urlencode($objecttmp->filter);
|
||||
// Activate the auto complete using ajax call.
|
||||
$out .= ajax_autocompleter($preselectedvalue, $htmlname, $urlforajaxcall, $urloption, $conf->global->$confkeyforautocompletemode, 0, array());
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 250; }</style>';
|
||||
if ($placeholder) {
|
||||
$placeholder = ' placeholder="'.$placeholder.'"';
|
||||
}
|
||||
$out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
|
||||
$out .= '<style type="text/css">.ui-autocomplete { z-index: 1003; }</style>';
|
||||
$out .= '<input type="text" class="'.$morecss.'"'.($disabled ? ' disabled="disabled"' : '').' name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.($placeholder ? ' placeholder="'.dol_escape_htmltag($placeholder).'"' : '') .' />';
|
||||
} else {
|
||||
// Immediate load of table record. Note: filter is inside $objecttmp->filter
|
||||
$out .= $this->selectForFormsList($objecttmp, $htmlname, $preselectedvalue, $showempty, $searchkey, $placeholder, $morecss, $moreparams, $forcecombo, 0, $disabled);
|
||||
@ -7642,6 +7643,10 @@ class Form
|
||||
$tplpath = 'expensereport';
|
||||
} elseif ($objecttype == 'subscription') {
|
||||
$tplpath = 'adherents';
|
||||
} elseif ($objecttype == 'conferenceorbooth') {
|
||||
$tplpath = 'eventorganization';
|
||||
} elseif ($objecttype == 'conferenceorboothattendee') {
|
||||
$tplpath = 'eventorganization';
|
||||
}
|
||||
|
||||
global $linkedObjectBlock;
|
||||
|
||||
@ -1255,7 +1255,7 @@ class FormMail extends Form
|
||||
*/
|
||||
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
|
||||
{
|
||||
global $conf;
|
||||
global $conf, $langs;
|
||||
|
||||
$ret = new ModelMail();
|
||||
|
||||
|
||||
@ -687,7 +687,7 @@ class Notify
|
||||
break;
|
||||
case 'BILL_PAYED':
|
||||
$link = '<a href="'.$urlwithroot.'/compta/facture/card.php?facid='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
|
||||
$dir_output = $$conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||
$dir_output = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
|
||||
$object_type = 'facture';
|
||||
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoicePayed", $link);
|
||||
break;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
/* Copyright (C) 2014 delcroip <delcroip@gmail.com>
|
||||
* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Josep Lluís Amador <joseplluis@lliuretic.cat>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -257,7 +258,7 @@ function updateTotal(days,mode)
|
||||
result=parseTime(jQuery('.totalDay'+stringdays).text(),taskTime);
|
||||
if (result >= 0)
|
||||
{
|
||||
totalhour = totalhour + taskTime.getHours();
|
||||
totalhour = totalhour + taskTime.getHours() + result*24;
|
||||
totalmin = totalmin + taskTime.getMinutes();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2700,7 +2700,7 @@ function convertBackOfficeMediasLinksToPublicLinks($notetoshow)
|
||||
* Function to format a value into a defined format for French administration (no thousand separator & decimal separator force to ',' with two decimals)
|
||||
* Function used into accountancy FEC export
|
||||
*
|
||||
* @param float $amount Amount to format
|
||||
* @param float $amount Amount to format
|
||||
* @return string Chain with formatted upright
|
||||
* @see price2num() Format a numeric into a price for FEC files
|
||||
*/
|
||||
|
||||
@ -98,7 +98,7 @@ function dol_decode($chain, $key = '1')
|
||||
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorightm is something else than 'password_hash').
|
||||
*
|
||||
* @param string $chain String to hash
|
||||
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
|
||||
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256, '6':password_hash). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
|
||||
* @return string Hash of string
|
||||
* @see getRandomPassword()
|
||||
*/
|
||||
@ -124,8 +124,10 @@ function dol_hash($chain, $type = '0')
|
||||
return md5($chain);
|
||||
} elseif ($type == '4' || $type == 'md5openldap') {
|
||||
return '{md5}'.base64_encode(mhash(MHASH_MD5, $chain)); // For OpenLdap with md5 (based on an unencrypted password in base)
|
||||
} elseif ($type == '5') {
|
||||
} elseif ($type == '5' || $type == 'sha256') {
|
||||
return hash('sha256', $chain);
|
||||
} elseif ($type == '6' || $type == 'password_hash') {
|
||||
return password_hash($chain, PASSWORD_DEFAULT);
|
||||
} elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') {
|
||||
return sha1($chain);
|
||||
} elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') {
|
||||
|
||||
@ -1344,15 +1344,15 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
// Accounting
|
||||
$newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->rights->accounting->mouvements->lire, '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"'));
|
||||
|
||||
// Balance
|
||||
$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire);
|
||||
|
||||
// General Ledger
|
||||
$newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->rights->accounting->mouvements->lire);
|
||||
|
||||
// Journals
|
||||
$newmenu->add("/accountancy/bookkeeping/list.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Journals"), 1, $user->rights->accounting->mouvements->lire);
|
||||
|
||||
// Account Balance
|
||||
$newmenu->add("/accountancy/bookkeeping/balance.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("AccountBalance"), 1, $user->rights->accounting->mouvements->lire);
|
||||
|
||||
// Files
|
||||
if (empty($conf->global->ACCOUNTANCY_HIDE_EXPORT_FILES_MENU)) {
|
||||
$newmenu->add("/compta/accounting-files.php?mainmenu=accountancy&leftmenu=accountancy_files", $langs->trans("AccountantFiles"), 1, $user->rights->accounting->mouvements->lire);
|
||||
|
||||
@ -140,16 +140,20 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ORDER BY sp.poste";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$s .= $langs->trans("PostOrFunction").': ';
|
||||
$s .= '<select name="filter_jobposition" class="flat">';
|
||||
$s .= $langs->trans("PostOrFunction").' ';
|
||||
$s .= '<select name="filter_jobposition" class="flat marginrightonly" placeholder="'.dol_escape_htmltag($langs->trans("PostOrFunction")).'">';
|
||||
$s .= '<option value="all"> </option>';
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$s .= '<option value="'.dol_escape_htmltag($obj->poste).'">'.dol_escape_htmltag($obj->poste).' ('.$obj->nb.')</option>';
|
||||
$i++;
|
||||
if ($num > 0) {
|
||||
while ($i < $num) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$s .= '<option value="'.dol_escape_htmltag($obj->poste).'">'.dol_escape_htmltag($obj->poste).' ('.$obj->nb.')</option>';
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
$s .= '<option disabled="disabled" value="">'.$langs->trans("None").'</option>';
|
||||
}
|
||||
} else {
|
||||
dol_print_error($this->db);
|
||||
@ -159,7 +163,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$s .= ' ';
|
||||
|
||||
// Filter on contact category
|
||||
$s .= $langs->trans("ContactCategoriesShort").': ';
|
||||
$s .= $langs->trans("ContactCategoriesShort").' ';
|
||||
$sql = "SELECT c.label, count(distinct(sp.email)) AS nb";
|
||||
$sql .= " FROM ";
|
||||
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
@ -175,7 +179,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ORDER BY c.label";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$s .= '<select name="filter_category" class="flat">';
|
||||
$s .= '<select name="filter_category" class="flat marginrightonly">';
|
||||
$s .= '<option value="all"> </option>';
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
@ -197,8 +201,8 @@ class mailing_contacts1 extends MailingTargets
|
||||
$s .= '<br>';
|
||||
|
||||
// Add prospect of a particular level
|
||||
$s .= $langs->trans("NatureOfThirdParty").': ';
|
||||
$s .= '<select name="filter" class="flat">';
|
||||
$s .= $langs->trans("NatureOfThirdParty").' ';
|
||||
$s .= '<select name="filter" class="flat marginrightonly">';
|
||||
$sql = "SELECT code, label";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_prospectlevel";
|
||||
$sql .= " WHERE active > 0";
|
||||
@ -234,7 +238,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$s .= ' ';
|
||||
|
||||
// Filter on thirdparty category
|
||||
$s .= $langs->trans("CustomersProspectsCategoriesShort").': ';
|
||||
$s .= $langs->trans("CustomersProspectsCategoriesShort").' ';
|
||||
$sql = "SELECT c.label, count(distinct(sp.email)) AS nb";
|
||||
$sql .= " FROM ";
|
||||
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
@ -250,7 +254,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ORDER BY c.label";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$s .= '<select name="filter_category_customer" class="flat">';
|
||||
$s .= '<select name="filter_category_customer" class="flat marginrightonly maxwidth200">';
|
||||
$s .= '<option value="all"> </option>';
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
@ -272,7 +276,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$s .= ' ';
|
||||
|
||||
// Filter on thirdparty category
|
||||
$s .= $langs->trans("SuppliersCategoriesShort").': ';
|
||||
$s .= $langs->trans("SuppliersCategoriesShort").' ';
|
||||
$sql = "SELECT c.label, count(distinct(sp.email)) AS nb";
|
||||
$sql .= " FROM ";
|
||||
$sql .= " ".MAIN_DB_PREFIX."socpeople as sp,";
|
||||
@ -288,7 +292,7 @@ class mailing_contacts1 extends MailingTargets
|
||||
$sql .= " ORDER BY c.label";
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$s .= '<select name="filter_category_supplier" class="flat">';
|
||||
$s .= '<select name="filter_category_supplier" class="flat marginrightonly maxwidth200">';
|
||||
$s .= '<option value="all"> </option>';
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
|
||||
@ -20,13 +20,13 @@
|
||||
/**
|
||||
* \file htdocs/core/modules/mailings/pomme.modules.php
|
||||
* \ingroup mailing
|
||||
* \brief File of class to offer a selector of emailing targets with Rule 'Pomme'.
|
||||
* \brief File of class to offer a selector of emailing targets of users.
|
||||
*/
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/modules/mailings/modules_mailings.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class to offer a selector of emailing targets with Rule 'Peche'.
|
||||
* Class to offer a selector of emailing targets with Rule 'Pomme'.
|
||||
*/
|
||||
class mailing_pomme extends MailingTargets
|
||||
{
|
||||
@ -119,16 +119,16 @@ class mailing_pomme extends MailingTargets
|
||||
$langs->load("users");
|
||||
|
||||
$s = '';
|
||||
$s .= $langs->trans("Status").': ';
|
||||
$s .= '<select name="filter" class="flat">';
|
||||
$s .= $langs->trans("Status").' ';
|
||||
$s .= '<select name="filter" class="flat marginrightonly">';
|
||||
$s .= '<option value="-1"> </option>';
|
||||
$s .= '<option value="1">'.$langs->trans("Enabled").'</option>';
|
||||
$s .= '<option value="0">'.$langs->trans("Disabled").'</option>';
|
||||
$s .= '</select>';
|
||||
|
||||
$s .= ' ';
|
||||
$s .= $langs->trans("Employee").': ';
|
||||
$s .= '<select name="filteremployee" class="flat">';
|
||||
$s .= $langs->trans("Employee").' ';
|
||||
$s .= '<select name="filteremployee" class="flat marginrightonly">';
|
||||
$s .= '<option value="-1"> </option>';
|
||||
$s .= '<option value="1">'.$langs->trans("Yes").'</option>';
|
||||
$s .= '<option value="0">'.$langs->trans("No").'</option>';
|
||||
|
||||
@ -226,8 +226,8 @@ class mailing_thirdparties extends MailingTargets
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
$s = $langs->trans("Categories").': ';
|
||||
$s .= '<select name="filter" class="flat">';
|
||||
$s = $langs->trans("Categories").' ';
|
||||
$s .= '<select name="filter" class="flat marginrightonly">';
|
||||
|
||||
// Show categories
|
||||
$sql = "SELECT rowid, label, type, visible";
|
||||
@ -276,7 +276,7 @@ class mailing_thirdparties extends MailingTargets
|
||||
|
||||
$s .= '</select> ';
|
||||
$s .= $langs->trans('ProspectCustomer');
|
||||
$s .= ': <select name="filter_client" class="flat">';
|
||||
$s .= ' <select name="filter_client" class="flat marginrightonly">';
|
||||
$s .= '<option value="-1"> </option>';
|
||||
if (empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) {
|
||||
$s .= '<option value="2">'.$langs->trans('Prospect').'</option>';
|
||||
@ -292,7 +292,7 @@ class mailing_thirdparties extends MailingTargets
|
||||
$s .= '</select> ';
|
||||
|
||||
$s .= $langs->trans("Status");
|
||||
$s .= ': <select name="filter_status" class="flat">';
|
||||
$s .= ' <select name="filter_status" class="flat marginrightonly">';
|
||||
$s .= '<option value="-1"> </option>';
|
||||
$s .= '<option value="1" selected>'.$langs->trans("Enabled").'</option>';
|
||||
$s .= '<option value="0">'.$langs->trans("Disabled").'</option>';
|
||||
|
||||
@ -122,8 +122,18 @@ class modTicket extends DolibarrModules
|
||||
}
|
||||
$this->dictionaries = array(
|
||||
'langs' => 'ticket',
|
||||
'tabname' => array(MAIN_DB_PREFIX."c_ticket_type", MAIN_DB_PREFIX."c_ticket_severity", MAIN_DB_PREFIX."c_ticket_category", MAIN_DB_PREFIX."c_ticket_resolution"),
|
||||
'tablib' => array("TicketDictType", "TicketDictSeverity", "TicketDictCategory", "TicketDictResolution"),
|
||||
'tabname' => array(
|
||||
MAIN_DB_PREFIX."c_ticket_type",
|
||||
MAIN_DB_PREFIX."c_ticket_severity",
|
||||
MAIN_DB_PREFIX."c_ticket_category",
|
||||
MAIN_DB_PREFIX."c_ticket_resolution"
|
||||
),
|
||||
'tablib' => array(
|
||||
"TicketDictType",
|
||||
"TicketDictSeverity",
|
||||
"TicketDictCategory",
|
||||
"TicketDictResolution"
|
||||
),
|
||||
'tabsql' => array(
|
||||
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f',
|
||||
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f',
|
||||
@ -135,7 +145,7 @@ class modTicket extends DolibarrModules
|
||||
'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public", "code,label,pos,use_default"),
|
||||
'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public", "code,label,pos,use_default"),
|
||||
'tabrowid' => array("rowid", "rowid", "rowid", "rowid"),
|
||||
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled),
|
||||
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && !empty($conf->global->TICKET_ENABLE_RESOLUTION)),
|
||||
'tabhelp' => array(
|
||||
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
|
||||
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
|
||||
|
||||
@ -524,8 +524,8 @@ class doc_generic_task_odt extends ModelePDFTask
|
||||
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
|
||||
|
||||
dol_mkdir($conf->projet->dir_temp);
|
||||
if (!is_writable($conf->task->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->task->dir_temp;
|
||||
if (!is_writable($conf->projet->dir_temp)) {
|
||||
$this->error = "Failed to write in temp directory ".$conf->projet->dir_temp;
|
||||
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -936,7 +936,11 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
}
|
||||
}
|
||||
|
||||
$object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$user->login, $object->actionmsg);
|
||||
if (!empty($user->login)) {
|
||||
$object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$user->login, $object->actionmsg);
|
||||
} elseif (isset($object->origin_email)) {
|
||||
$object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$object->origin_email, $object->actionmsg);
|
||||
}
|
||||
|
||||
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
|
||||
|
||||
|
||||
@ -330,7 +330,15 @@ if (!empty($withproject)) {
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
print '';
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
|
||||
|
||||
// Show message
|
||||
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
||||
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
|
||||
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
|
||||
print $message;
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
@ -496,6 +504,41 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$keyforbreak='pubregister';
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
$object->fetchObjectLinked();
|
||||
|
||||
|
||||
if (is_array($object->linkedObjects) && count($object->linkedObjects)>0 && array_key_exists("facture", $object->linkedObjects)) {
|
||||
foreach ($object->linkedObjects["facture"] as $fac) {
|
||||
/**
|
||||
* @var $fac Facture
|
||||
*/
|
||||
if (empty($fac->paye)) {
|
||||
$key = 'paymentlink_'.$fac->id;
|
||||
print '<tr class="field_'.$key.'"><td';
|
||||
print ' class="titlefield fieldname_'.$key;
|
||||
print '">';
|
||||
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePayment", $langs->transnoentitiesnoconv('Online')) . ' '. $fac->ref.'</span><br>';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="valuefield fieldname_'.$key;
|
||||
print '">';
|
||||
$sourcetouse = 'boothlocation';
|
||||
$reftouse = $fac->id;
|
||||
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$object->id;
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
|
||||
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
|
||||
$redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical
|
||||
} else {
|
||||
$redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
|
||||
}
|
||||
}
|
||||
print '<div class="urllink"><input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$redirection.'">';
|
||||
print '<a href="'.$redirection.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a></div>';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
//var_dump($object);
|
||||
// Other attributes. Fields from hook formObjectOptions and Extrafields.
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
@ -309,7 +309,15 @@ if (!empty($withproject)) {
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
print '';
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
|
||||
|
||||
// Show message
|
||||
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
||||
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
|
||||
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
|
||||
print $message;
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -266,8 +266,15 @@ if (!empty($withproject)) {
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
print '';
|
||||
//TODO fill with ics
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
|
||||
|
||||
// Show message
|
||||
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
||||
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
|
||||
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
|
||||
print $message;
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -173,7 +173,10 @@ if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend'
|
||||
&& $massaction != 'presend_attendees'
|
||||
&& $massaction != 'confirm_presend'
|
||||
&& $massaction != 'confirm_presend_attendees') {
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
@ -211,6 +214,7 @@ if (empty($reshook)) {
|
||||
$objectclass = 'ConferenceOrBooth';
|
||||
$objectlabel = 'ConferenceOrBooth';
|
||||
$uploaddir = $conf->eventorganization->dir_output;
|
||||
include DOL_DOCUMENT_ROOT.'/eventorganization/core/actions_massactions_mail.inc.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
@ -421,8 +425,6 @@ if ($projectid > 0) {
|
||||
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
||||
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
|
||||
$message .= "&project=".$projectid.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
|
||||
$message .= '</div>';
|
||||
$message .= '<br>';
|
||||
print $message;
|
||||
print "</td></tr>";
|
||||
|
||||
@ -583,12 +585,13 @@ $arrayofmassactions = array(
|
||||
//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
|
||||
//'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
|
||||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("ConferenceOrBooth"),
|
||||
'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"),
|
||||
);
|
||||
if ($permissiontodelete) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'presend_attendees', 'predelete'))) {
|
||||
$arrayofmassactions = array();
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
@ -612,9 +615,11 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort
|
||||
$topicmail = "SendConferenceOrBoothRef";
|
||||
$modelmail = "conferenceorbooth";
|
||||
$objecttmp = new ConferenceOrBooth($db);
|
||||
$trackid = 'xxxx'.$object->id;
|
||||
$trackid = 'conferenceorbooth_'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/eventorganization/tpl/massactions_mail_pre.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
|
||||
if ($search_all) {
|
||||
foreach ($fieldstosearchall as $key => $val) {
|
||||
$fieldstosearchall[$key] = $langs->trans($val);
|
||||
|
||||
@ -336,7 +336,15 @@ if (!empty($withproject)) {
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
print '';
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
|
||||
|
||||
// Show message
|
||||
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
||||
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
|
||||
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
|
||||
print $message;
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -499,7 +499,15 @@ if ($confOrBooth->id > 0) {
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
print '';
|
||||
// Define $urlwithroot
|
||||
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
|
||||
|
||||
// Show message
|
||||
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
|
||||
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
|
||||
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
|
||||
print $message;
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
315
htdocs/eventorganization/core/actions_massactions_mail.inc.php
Normal file
315
htdocs/eventorganization/core/actions_massactions_mail.inc.php
Normal file
@ -0,0 +1,315 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2021 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* or see https://www.gnu.org/
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/core/actions_massactions.inc.php
|
||||
* \brief Code for actions done with massaction button (send by email, merge pdf, delete, ...)
|
||||
*/
|
||||
|
||||
|
||||
// $massaction must be defined
|
||||
// $objectclass and $objectlabel must be defined
|
||||
// $parameters, $object, $action must be defined for the hook.
|
||||
|
||||
// $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined
|
||||
// $uploaddir may be defined (example to $conf->projet->dir_output."/";)
|
||||
// $toselect may be defined
|
||||
// $diroutputmassaction may be defined
|
||||
|
||||
|
||||
// Protection
|
||||
if (empty($objectclass) || empty($uploaddir)) {
|
||||
dol_print_error(null, 'include of actions_massactions.inc.php is done but var $objectclass or $uploaddir was not defined');
|
||||
exit;
|
||||
}
|
||||
|
||||
// For backward compatibility
|
||||
if (!empty($permtoread) && empty($permissiontoread)) {
|
||||
$permissiontoread = $permtoread;
|
||||
}
|
||||
if (!empty($permtocreate) && empty($permissiontoadd)) {
|
||||
$permissiontoadd = $permtocreate;
|
||||
}
|
||||
if (!empty($permtodelete) && empty($permissiontodelete)) {
|
||||
$permissiontodelete = $permtodelete;
|
||||
}
|
||||
|
||||
|
||||
// Mass actions. Controls on number of lines checked.
|
||||
$maxformassaction = (empty($conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS) ? 1000 : $conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS);
|
||||
if (!empty($massaction) && is_array($toselect) && count($toselect) < 1) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("NoRecordSelected"), null, "warnings");
|
||||
}
|
||||
if (!$error && is_array($toselect) && count($toselect) > $maxformassaction) {
|
||||
setEventMessages($langs->trans('TooManyRecordForMassAction', $maxformassaction), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if (!$error && $massaction == 'confirm_presend_attendees' && !GETPOST('sendmail')) { // If we do not choose button send (for example when we change template or limit), we must not send email, but keep on send email form
|
||||
$massaction = 'presend_attendees';
|
||||
}
|
||||
if (!$error && $massaction == 'confirm_presend_attendees') {
|
||||
$resaction = '';
|
||||
$nbsent = 0;
|
||||
$nbignored = 0;
|
||||
$langs->load("mails");
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
|
||||
$listofobjectid = array();
|
||||
|
||||
$listofobjectref = array();
|
||||
$oneemailperrecipient = (GETPOST('oneemailperrecipient') == 'on' ? 1 : 0);
|
||||
|
||||
if (!$error) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
$attendee = new ConferenceOrBoothAttendee($db);
|
||||
$listofselectedid = array();
|
||||
$listofselectedref = array();
|
||||
$objecttmp = new $objectclass($db);
|
||||
|
||||
foreach ($toselect as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
$attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm' => $objecttmp->id));
|
||||
if (is_array($attendees) && count($attendees) > 0) {
|
||||
foreach ($attendees as $attmail) {
|
||||
if (!empty($attmail->email)) {
|
||||
$attmail->fetch_thirdparty();
|
||||
$listofselectedid[$attmail->email] = $attmail;
|
||||
$listofselectedref[$attmail->email] = $objecttmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check mandatory parameters
|
||||
if (GETPOST('fromtype', 'alpha') === 'user' && empty($user->email)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
|
||||
$massaction = 'presend_attendees';
|
||||
}
|
||||
|
||||
$receiver = $_POST['receiver'];
|
||||
if (!is_array($receiver)) {
|
||||
if (empty($receiver) || $receiver == '-1') {
|
||||
$receiver = array();
|
||||
} else {
|
||||
$receiver = array($receiver);
|
||||
}
|
||||
}
|
||||
if (!trim($_POST['sendto']) && count($receiver) == 0 && count($listofselectedid) == 1) { // if only one recipient, receiver is mandatory
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Recipient")), null, 'warnings');
|
||||
$massaction = 'presend_attendees';
|
||||
}
|
||||
|
||||
if (!GETPOST('subject', 'restricthtml')) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MailTopic")), null, 'warnings');
|
||||
$massaction = 'presend_attendees';
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$objecttmp->fetch_thirdparty();
|
||||
foreach ($listofselectedid as $email => $attendees) {
|
||||
$sendto = '';
|
||||
$sendtocc = '';
|
||||
$sendtobcc = '';
|
||||
$sendtoid = array();
|
||||
|
||||
// Define $sendto
|
||||
$sendto = $attendees->thirdparty->name . '<' . trim($attendees->email) . '>';
|
||||
|
||||
// Define $sendtocc
|
||||
$receivercc = $_POST['receivercc'];
|
||||
if (!is_array($receivercc)) {
|
||||
if ($receivercc == '-1') {
|
||||
$receivercc = array();
|
||||
} else {
|
||||
$receivercc = array($receivercc);
|
||||
}
|
||||
}
|
||||
$tmparray = array();
|
||||
if (trim($_POST['sendtocc'])) {
|
||||
$tmparray[] = trim($_POST['sendtocc']);
|
||||
}
|
||||
$sendtocc = implode(',', $tmparray);
|
||||
|
||||
|
||||
$langs->load("commercial");
|
||||
|
||||
$reg = array();
|
||||
$fromtype = GETPOST('fromtype');
|
||||
if ($fromtype === 'user') {
|
||||
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
|
||||
} elseif ($fromtype === 'company') {
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM . ' <' . $conf->global->MAIN_INFO_SOCIETE_MAIL . '>';
|
||||
} elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {
|
||||
$tmp = explode(',', $user->email_aliases);
|
||||
$from = trim($tmp[($reg[1] - 1)]);
|
||||
} elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) {
|
||||
$tmp = explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES);
|
||||
$from = trim($tmp[($reg[1] - 1)]);
|
||||
} elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) {
|
||||
$sql = 'SELECT rowid, label, email FROM ' . MAIN_DB_PREFIX . 'c_email_senderprofile WHERE rowid = ' . (int) $reg[1];
|
||||
$resql = $db->query($sql);
|
||||
$obj = $db->fetch_object($resql);
|
||||
if ($obj) {
|
||||
$from = $obj->label . ' <' . $obj->email . '>';
|
||||
}
|
||||
} else {
|
||||
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>';
|
||||
}
|
||||
|
||||
$replyto = $from;
|
||||
$subject = GETPOST('subject', 'restricthtml');
|
||||
$message = GETPOST('message', 'restricthtml');
|
||||
|
||||
$sendtobcc = GETPOST('sendtoccc');
|
||||
|
||||
// $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $attendees);
|
||||
|
||||
if (!empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) {
|
||||
$urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
|
||||
$urlwithroot = $urlwithouturlroot . DOL_URL_ROOT;
|
||||
$url_link = $urlwithroot . '/public/agenda/agendaexport.php?format=ical' . ($conf->entity > 1 ? "&entity=" . $conf->entity : "");
|
||||
$url_link .= '&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
|
||||
$url_link .= "&project=" . $listofselectedref[$email]->fk_project . '&module=' . urlencode('@eventorganization') . '&status=' . ConferenceOrBooth::STATUS_CONFIRMED;
|
||||
$html_link = '<a href="' . $url_link . '">' . $langs->trans('DownloadICSLink') . '</a>';
|
||||
}
|
||||
$substitutionarray['__EVENTORGANIZATION_ICS_LINK__'] = $html_link;
|
||||
$substitutionarray['__EVENTORGANIZATION_URL_LINK__'] = $url_link;
|
||||
$substitutionarray['__CHECK_READ__'] = '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . urlencode($attendees->thirdparty->tag) . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>';
|
||||
|
||||
$parameters = array('mode' => 'formemail');
|
||||
|
||||
if (!empty($listofobjectref)) {
|
||||
$parameters['listofobjectref'] = $listofobjectref;
|
||||
}
|
||||
|
||||
complete_substitutions_array($substitutionarray, $langs, $attendees, $parameters);
|
||||
|
||||
$subjectreplaced = make_substitutions($subject, $substitutionarray);
|
||||
$messagereplaced = make_substitutions($message, $substitutionarray);
|
||||
|
||||
|
||||
if (empty($sendcontext)) {
|
||||
$sendcontext = 'standard';
|
||||
}
|
||||
|
||||
// Send mail (substitutionarray must be done just before this)
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
|
||||
$mailfile = new CMailFile($subjectreplaced, $sendto, $from, $messagereplaced, array(), array(), array(), $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', "attendees_".$attendees->id, '', $sendcontext);
|
||||
if ($mailfile->error) {
|
||||
$resaction .= '<div class="error">' . $mailfile->error . '</div>';
|
||||
} else {
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result) {
|
||||
$resaction .= $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)) . '<br>'; // Must not contain "
|
||||
$error = 0;
|
||||
|
||||
dol_syslog("Try to insert email event into agenda for objid=" . $attendees->id . " => objectobj=" . get_class($attendees));
|
||||
|
||||
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
|
||||
if ($message) {
|
||||
if ($sendtocc) {
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
|
||||
}
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subjectreplaced);
|
||||
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
|
||||
$actionmsg = dol_concatdesc($actionmsg, $messagereplaced);
|
||||
}
|
||||
$actionmsg2 = '';
|
||||
|
||||
$objectobj2 = $listofselectedref[$email];
|
||||
// Initialisation donnees
|
||||
$objectobj2->actionmsg = $actionmsg; // Long text
|
||||
$objectobj2->actionmsg2 = $actionmsg2; // Short text
|
||||
$objectobj2->fk_element = $objectobj2->id;
|
||||
$objectobj2->elementtype = $objectobj2->element;
|
||||
|
||||
$triggername = 'CONFERENCEORBOOTHATTENDEE_SENTBYMAIL';
|
||||
if (!empty($triggername)) {
|
||||
// Call trigger
|
||||
$result = $objectobj2->call_trigger($triggername, $user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
|
||||
if ($error) {
|
||||
setEventMessages($db->lasterror(), $objectobj2->errors, 'errors');
|
||||
dol_syslog("Error in trigger " . $triggername . ' ' . $db->lasterror(), LOG_ERR);
|
||||
}
|
||||
}
|
||||
|
||||
$nbsent++; // Nb of object sent
|
||||
} else {
|
||||
$langs->load("other");
|
||||
if ($mailfile->error) {
|
||||
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
|
||||
$resaction .= '<br><div class="error">' . $mailfile->error . '</div>';
|
||||
} elseif (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
|
||||
$resaction .= '<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
|
||||
} else {
|
||||
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '<br><div class="error">(unhandled error)</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$resaction .= ($resaction ? '<br>' : $resaction);
|
||||
$resaction .= '<strong>' . $langs->trans("ResultOfMailSending") . ':</strong><br>' . "\n";
|
||||
$resaction .= $langs->trans("NbSelected") . ': ' . count($toselect) . "\n<br>";
|
||||
$resaction .= $langs->trans("NbIgnored") . ': ' . ($nbignored ? $nbignored : 0) . "\n<br>";
|
||||
$resaction .= $langs->trans("NbSent") . ': ' . ($nbsent ? $nbsent : 0) . "\n<br>";
|
||||
|
||||
if ($nbsent) {
|
||||
$action = ''; // Do not show form post if there was at least one successfull sent
|
||||
//setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs');
|
||||
setEventMessages($langs->trans("EMailSentForNElements", $nbsent . '/' . count($toselect)), null, 'mesgs');
|
||||
setEventMessages($resaction, null, 'mesgs');
|
||||
} else {
|
||||
//setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings'); // May be object has no generated PDF file
|
||||
setEventMessages($resaction, null, 'warnings');
|
||||
}
|
||||
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
$parameters['toselect'] = $toselect;
|
||||
$parameters['uploaddir'] = $uploaddir;
|
||||
$parameters['massaction'] = $massaction;
|
||||
$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null;
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
61
htdocs/eventorganization/tpl/linkedobjectblock.tpl.php
Normal file
61
htdocs/eventorganization/tpl/linkedobjectblock.tpl.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Protection to avoid direct call of template
|
||||
if (empty($conf) || !is_object($conf)) {
|
||||
print "Error, template page can't be called as URL";
|
||||
exit;
|
||||
}
|
||||
|
||||
echo "<!-- BEGIN PHP TEMPLATE -->\n";
|
||||
|
||||
global $user;
|
||||
|
||||
$langs = $GLOBALS['langs'];
|
||||
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
$langs->load("eventorganization");
|
||||
|
||||
$total = 0;
|
||||
foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
echo '<tr class="oddeven">';
|
||||
echo '<td>' . $langs->trans(get_class($objectlink)) . '</td>';
|
||||
echo '<td>'.$objectlink->getNomUrl(1).'</td>';
|
||||
echo '<td class="center">';
|
||||
if (get_class($objectlink)=='ConferenceOrBooth') {
|
||||
print dol_trunc($objectlink->label, 20);
|
||||
}
|
||||
print '</td>';
|
||||
echo '<td class="center">';
|
||||
if (get_class($objectlink)=='ConferenceOrBoothAttendee') {
|
||||
print dol_print_date($objectlink->date_subscription);
|
||||
} else {
|
||||
print dol_print_date($objectlink->datep);
|
||||
}
|
||||
print '</td>';
|
||||
echo '<td class="right">';
|
||||
if (get_class($objectlink)=='ConferenceOrBoothAttendee') {
|
||||
print price($objectlink->amount);
|
||||
}
|
||||
print '</td>';
|
||||
echo '<td class="right">'.$objectlink->getLibStatut(3).'</td>';
|
||||
echo '<td class="right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
|
||||
echo "<!-- END PHP TEMPLATE -->\n";
|
||||
130
htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php
Normal file
130
htdocs/eventorganization/tpl/massactions_mail_pre.tpl.php
Normal file
@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
|
||||
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
* or see https://www.gnu.org/
|
||||
*/
|
||||
|
||||
// Following var must be set:
|
||||
// $arrayofselected = array of id selected
|
||||
// $object
|
||||
// $objecttmp=new Propal($db);
|
||||
// $topicmail="SendSupplierProposalRef";
|
||||
// $modelmail="supplier_proposal_send";
|
||||
// $trackid='ord'.$object->id;
|
||||
|
||||
if ($massaction == 'presend_attendees') {
|
||||
$langs->load("mails");
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
$attendee = new ConferenceOrBoothAttendee($db);
|
||||
$listofselectedid = array();
|
||||
$listofselectedref = array();
|
||||
|
||||
if (!GETPOST('cancel', 'alpha')) {
|
||||
foreach ($arrayofselected as $toselectid) {
|
||||
$result = $objecttmp->fetch($toselectid);
|
||||
if ($result > 0) {
|
||||
$attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$objecttmp->id));
|
||||
if (is_array($attendees) && count($attendees)>0) {
|
||||
foreach ($attendees as $attmail) {
|
||||
if (!empty($attmail->email)) {
|
||||
$listofselectedid[$attmail->email] = $attmail->id;
|
||||
$listofselectedref[$attmail->id][$toselectid] = $objecttmp->ref;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '<input type="hidden" name="massaction" value="confirm_presend_attendees">';
|
||||
print '<input type="hidden" name="projectid" value="'.GETPOST('projectid', 'int').'">';
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
|
||||
print dol_get_fiche_head(null, '', '');
|
||||
|
||||
// Cree l'objet formulaire mail
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
$formmail->withform = -1;
|
||||
$formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user'));
|
||||
|
||||
if ($formmail->fromtype === 'user') {
|
||||
$formmail->fromid = $user->id;
|
||||
}
|
||||
$formmail->trackid = $trackid;
|
||||
if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set
|
||||
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
$formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid);
|
||||
}
|
||||
$formmail->withfrom = 1;
|
||||
$liste = $langs->trans("AllRecipientSelected", count($listofselectedid));
|
||||
$formmail->withtoreadonly = 1;
|
||||
|
||||
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : ((GETPOST('oneemailperrecipient') == 'on') ? 1 : -1);
|
||||
|
||||
$formmail->withto = empty($liste) ? (GETPOST('sendto', 'alpha') ?GETPOST('sendto', 'alpha') : array()) : $liste;
|
||||
$formmail->withtofree = empty($liste) ? 1 : 0;
|
||||
$formmail->withtocc = 1;
|
||||
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
|
||||
$formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__');
|
||||
$formmail->withfile = 0;
|
||||
// $formmail->withfile = 2; Not yet supported in mass action
|
||||
$formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document"
|
||||
$formmail->withbody = 1;
|
||||
$formmail->withdeliveryreceipt = 1;
|
||||
$formmail->withcancel = 1;
|
||||
|
||||
// Make substitution in email content
|
||||
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object);
|
||||
|
||||
$substitutionarray['__EMAIL__'] = $sendto;
|
||||
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($object->thirdparty->tag).'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
|
||||
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
|
||||
$substitutionarray['__CONTACTCIVNAME__'] = '';
|
||||
|
||||
$parameters = array(
|
||||
'mode' => 'formemail'
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
|
||||
|
||||
// Tableau des substitutions
|
||||
$formmail->substit = $substitutionarray;
|
||||
|
||||
// Tableau des parametres complementaires du post
|
||||
$formmail->param['action'] = $action;
|
||||
$formmail->param['models'] = $modelmail;
|
||||
$formmail->param['models_id'] = empty(GETPOST('modelmailselected', 'int'))?$conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES:GETPOST('modelmailselected', 'int');
|
||||
$formmail->param['id'] = join(',', $arrayofselected);
|
||||
// $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
|
||||
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedid) > $conf->global->MAILING_LIMIT_SENDBYWEB) {
|
||||
$langs->load("errors");
|
||||
print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||
print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>';
|
||||
$arrayofmassactions = array();
|
||||
} else {
|
||||
print $formmail->get_form();
|
||||
}
|
||||
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
|
||||
$parameters = array(
|
||||
'toselect' => $toselect,
|
||||
'uploaddir' => isset($uploaddir) ? $uploaddir : null
|
||||
);
|
||||
@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) {
|
||||
define('DOL_APPLICATION_TITLE', 'Dolibarr');
|
||||
}
|
||||
if (!defined('DOL_VERSION')) {
|
||||
define('DOL_VERSION', '14.0.0'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
define('DOL_VERSION', '14.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
|
||||
}
|
||||
|
||||
if (!defined('EURO')) {
|
||||
|
||||
@ -102,13 +102,13 @@ if ($attachment) {
|
||||
|
||||
|
||||
// List of targets fields
|
||||
$headerlinefields = array();
|
||||
$contentlinevalues = array();
|
||||
$headerlinefields = array(); // Array of fields (label to show)
|
||||
$contentlinevalues = array(); // Array of example values
|
||||
$i = 0;
|
||||
foreach ($fieldstarget as $code => $label) {
|
||||
$withoutstar = preg_replace('/\*/', '', $fieldstarget[$code]);
|
||||
$headerlinefields[] = $langs->transnoentities($withoutstar).($withoutstar != $fieldstarget[$code] ? '*' : '').' ('.$code.')';
|
||||
$contentlinevalues[] = $valuestarget[$code];
|
||||
$contentlinevalues[] = (isset($valuestarget[$code]) ? $valuestarget[$code] : '');
|
||||
}
|
||||
//var_dump($headerlinefields);
|
||||
//var_dump($contentlinevalues);
|
||||
|
||||
@ -35,9 +35,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private,
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,<br><br>\n\n__(YourCandidatureAnswerMessage)__<br>__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 0);
|
||||
|
||||
-- Event organization
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__(Sincerely)__<br /><br />__MYCOMPANY_NAME__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__(Sincerely)__<br /><br />__MYCOMPANY_NAME__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
|
||||
|
||||
@ -246,9 +246,9 @@ DescThirdPartyReport=Consult here the list of third-party customers and vendors
|
||||
ListAccounts=List of the accounting accounts
|
||||
UnknownAccountForThirdparty=Unknown third-party account. We will use %s
|
||||
UnknownAccountForThirdpartyBlocking=Unknown third-party account. Blocking error
|
||||
ThirdpartyAccountNotDefinedOrThirdPartyUnknown=Third-party account not defined or third party unknown. We will use %s
|
||||
ThirdpartyAccountNotDefinedOrThirdPartyUnknown=Subledger account not defined or third party or user unknown. We will use %s
|
||||
ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored=Third-party unknown and subledger not defined on the payment. We will keep the subledger account value empty.
|
||||
ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Third-party account not defined or third party unknown. Blocking error.
|
||||
ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Subledger account not defined or third party or user unknown. Blocking error.
|
||||
UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-party account and waiting account not defined. Blocking error
|
||||
PaymentsNotLinkedToProduct=Payment not linked to any product / service
|
||||
OpeningBalance=Opening balance
|
||||
@ -339,7 +339,7 @@ Modelcsv_normal=Classic export
|
||||
Modelcsv_CEGID=Export for CEGID Expert Comptabilité
|
||||
Modelcsv_COALA=Export for Sage Coala
|
||||
Modelcsv_bob50=Export for Sage BOB 50
|
||||
Modelcsv_ciel=Export for Sage Ciel Compta or Compta Evolution
|
||||
Modelcsv_ciel=Export for Sage50, Ciel Compta or Compta Evo. (Format XIMPORT)
|
||||
Modelcsv_quadratus=Export for Quadratus QuadraCompta
|
||||
Modelcsv_ebp=Export for EBP
|
||||
Modelcsv_cogilog=Export for Cogilog
|
||||
|
||||
@ -2148,4 +2148,5 @@ RandomlySelectedIfSeveral=Randomly selected if several pictures are available
|
||||
DatabasePasswordObfuscated=Database password is obfuscated in conf file
|
||||
DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file
|
||||
APIsAreNotEnabled=APIs modules are not enabled
|
||||
YouShouldSetThisToOff=You should set this to 0 or off
|
||||
YouShouldSetThisToOff=You should set this to 0 or off
|
||||
InstallAndUpgradeLockedBy=Install and upgrades are locked by the file <b>%s</b>
|
||||
@ -119,6 +119,8 @@ EventType = Event type
|
||||
LabelOfBooth=Booth label
|
||||
LabelOfconference=Conference label
|
||||
ConferenceIsNotConfirmed=Subcription not available, conference is not confirmed yet
|
||||
DateMustBeBeforeThan=%s must be before %s
|
||||
DateMustBeAfterThan=%s must be after %s
|
||||
|
||||
#
|
||||
# Vote page
|
||||
|
||||
@ -162,8 +162,8 @@ AdvTgtDeleteFilter=Delete filter
|
||||
AdvTgtSaveFilter=Save filter
|
||||
AdvTgtCreateFilter=Create filter
|
||||
AdvTgtOrCreateNewFilter=Name of new filter
|
||||
NoContactWithCategoryFound=No contact/address with a category found
|
||||
NoContactLinkedToThirdpartieWithCategoryFound=No contact/address with a category found
|
||||
NoContactWithCategoryFound=No category found linked to some contacts/addresses
|
||||
NoContactLinkedToThirdpartieWithCategoryFound=No category found linked to some thirdparties
|
||||
OutGoingEmailSetup=Outgoing emails
|
||||
InGoingEmailSetup=Incoming emails
|
||||
OutGoingEmailSetupForEmailing=Outgoing emails (for module %s)
|
||||
|
||||
@ -66,7 +66,7 @@ NeedMoreInformation=Waiting for reporter feedback
|
||||
NeedMoreInformationShort=Waiting for feedback
|
||||
Answered=Answered
|
||||
Waiting=Waiting
|
||||
Closed=Closed
|
||||
SolvedClosed=Solved
|
||||
Deleted=Deleted
|
||||
|
||||
# Dict
|
||||
@ -186,9 +186,11 @@ TicketSeverity=Severity
|
||||
ShowTicket=See ticket
|
||||
RelatedTickets=Related tickets
|
||||
TicketAddIntervention=Create intervention
|
||||
CloseTicket=Close ticket
|
||||
CloseATicket=Close a ticket
|
||||
CloseTicket=Close|Solve ticket
|
||||
AbandonTicket=Abandon ticket
|
||||
CloseATicket=Close|Solve a ticket
|
||||
ConfirmCloseAticket=Confirm ticket closing
|
||||
ConfirmAbandonTicket=Do you confirm the closing of the ticket to status 'Abandonned'
|
||||
ConfirmDeleteTicket=Please confirm ticket deleting
|
||||
TicketDeletedSuccess=Ticket deleted with success
|
||||
TicketMarkedAsClosed=Ticket marked as closed
|
||||
|
||||
@ -40,8 +40,8 @@ EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = Modèle de courriel à envoyer aprè
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = Modèle de courriel à envoyer après avoir reçu une suggestion d'un stand.
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Modèle de courriel à envoyer après paiement d'une inscription à un stand.
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Modèle de courriel à envoyer après paiement d'une inscription à un événement.
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Modèle de courriel pour action de masse aux participants
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Modèle de courriel pour action de masse aux intervenants
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Modèle de courriel pour action de masse aux intervenants
|
||||
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Modèle de courriel pour action de masse aux participants
|
||||
EVENTORGANIZATION_FILTERATTENDEES_CAT = Filtrer la liste de sélection des tiers dans la fiche/le formulaire de création des participants avec/selon la catégorie
|
||||
EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filtrer la liste de sélection des tiers dans la fiche/le formulaire de création des participants avec le type de client
|
||||
|
||||
|
||||
@ -1,61 +1,61 @@
|
||||
# Dolibarr language file - Source file is en_US - opensurvey
|
||||
Survey=Poll
|
||||
Surveys=Polls
|
||||
OrganizeYourMeetingEasily=Organize your meetings and polls easily. First select the type of poll...
|
||||
NewSurvey=New poll
|
||||
OpenSurveyArea=Polls area
|
||||
AddACommentForPoll=You can add a comment into poll...
|
||||
AddComment=Add comment
|
||||
CreatePoll=Create poll
|
||||
PollTitle=Poll title
|
||||
ToReceiveEMailForEachVote=Receive an email for each vote
|
||||
TypeDate=Type date
|
||||
TypeClassic=Type standard
|
||||
OpenSurveyStep2=Select your dates among the free days (grey). The selected days are green. You can unselect a day previously selected by clicking again on it
|
||||
RemoveAllDays=Remove all days
|
||||
CopyHoursOfFirstDay=Copy hours of first day
|
||||
RemoveAllHours=Remove all hours
|
||||
SelectedDays=Selected days
|
||||
TheBestChoice=The best choice currently is
|
||||
TheBestChoices=The best choices currently are
|
||||
with=with
|
||||
OpenSurveyHowTo=If you agree to vote in this poll, you have to give your name, choose the values that fit best for you and validate with the plus button at the end of the line.
|
||||
CommentsOfVoters=Comments of voters
|
||||
ConfirmRemovalOfPoll=Are you sure you want to remove this poll (and all votes)
|
||||
RemovePoll=Remove poll
|
||||
UrlForSurvey=URL to communicate to get a direct access to poll
|
||||
PollOnChoice=You are creating a poll to make a multi-choice for a poll. First enter all possible choices for your poll:
|
||||
CreateSurveyDate=Create a date poll
|
||||
CreateSurveyStandard=Create a standard poll
|
||||
CheckBox=Simple checkbox
|
||||
YesNoList=List (empty/yes/no)
|
||||
PourContreList=List (empty/for/against)
|
||||
AddNewColumn=Add new column
|
||||
TitleChoice=Choice label
|
||||
ExportSpreadsheet=Export result spreadsheet
|
||||
ExpireDate=極限日期
|
||||
NbOfSurveys=Number of polls
|
||||
NbOfVoters=No. of voters
|
||||
SurveyResults=Results
|
||||
PollAdminDesc=You are allowed to change all vote lines of this poll with button "Edit". You can, as well, remove a column or a line with %s. You can also add a new column with %s.
|
||||
5MoreChoices=5 more choices
|
||||
Against=Against
|
||||
YouAreInivitedToVote=You are invited to vote for this poll
|
||||
VoteNameAlreadyExists=This name was already used for this poll
|
||||
AddADate=Add a date
|
||||
AddStartHour=Add start hour
|
||||
AddEndHour=Add end hour
|
||||
votes=vote(s)
|
||||
NoCommentYet=No comments have been posted for this poll yet
|
||||
CanComment=Voters can comment in the poll
|
||||
CanSeeOthersVote=Voters can see other people's vote
|
||||
SelectDayDesc=For each selected day, you can choose, or not, meeting hours in the following format:<br>- empty,<br>- "8h", "8H" or "8:00" to give a meeting's start hour,<br>- "8-11", "8h-11h", "8H-11H" or "8:00-11:00" to give a meeting's start and end hour,<br>- "8h15-11h15", "8H15-11H15" or "8:15-11:15" for the same thing but with minutes.
|
||||
BackToCurrentMonth=Back to current month
|
||||
ErrorOpenSurveyFillFirstSection=You haven't filled the first section of the poll creation
|
||||
ErrorOpenSurveyOneChoice=Enter at least one choice
|
||||
ErrorInsertingComment=There was an error while inserting your comment
|
||||
MoreChoices=Enter more choices for the voters
|
||||
SurveyExpiredInfo=The poll has been closed or voting delay has expired.
|
||||
EmailSomeoneVoted=%s has filled a line.\nYou can find your poll at the link: \n%s
|
||||
ShowSurvey=Show survey
|
||||
UserMustBeSameThanUserUsedToVote=You must have voted and use the same user name that the one used to vote, to post a comment
|
||||
Survey=調查
|
||||
Surveys=調查
|
||||
OrganizeYourMeetingEasily=輕鬆組織會議和調查。首先選擇調查的類型...
|
||||
NewSurvey=新調查
|
||||
OpenSurveyArea=調查區
|
||||
AddACommentForPoll=您可以在調查中加入評論...
|
||||
AddComment=增加評論
|
||||
CreatePoll=建立調查
|
||||
PollTitle=調查標題
|
||||
ToReceiveEMailForEachVote=每次投票都會收到一封電子郵件
|
||||
TypeDate=日期類型
|
||||
TypeClassic=標準類型
|
||||
OpenSurveyStep2=在空閒日中選擇日期(灰色)。所選的日期為綠色。您可以通過再次點擊來取消先前選擇的日期
|
||||
RemoveAllDays=全部刪除
|
||||
CopyHoursOfFirstDay=複制第一天的時間
|
||||
RemoveAllHours=刪除所有時間
|
||||
SelectedDays=已選擇的日子
|
||||
TheBestChoice=目前最好的選擇是
|
||||
TheBestChoices=目前最好的選擇是
|
||||
with=與
|
||||
OpenSurveyHowTo=如果您同意在此次調查中投票,則必須給出自己的名字,選擇最適合您的值,並使用該行末尾的加號按鈕進行驗證。
|
||||
CommentsOfVoters=投票人的評論
|
||||
ConfirmRemovalOfPoll=您確定要刪除此調查(以及所有投票)嗎?
|
||||
RemovePoll=刪除調查
|
||||
UrlForSurvey=調查的直接網址
|
||||
PollOnChoice=您正在建立多項選擇的調查。首先為您的調查輸入所有可能的選擇:
|
||||
CreateSurveyDate=建立日期調查
|
||||
CreateSurveyStandard=建立標準調查
|
||||
CheckBox=簡易勾選框
|
||||
YesNoList=清單(空/是/否)
|
||||
PourContreList=清單(空/支持/反對)
|
||||
AddNewColumn=增加新欄位
|
||||
TitleChoice=選擇標籤
|
||||
ExportSpreadsheet=匯出結果表格
|
||||
ExpireDate=調查截止日
|
||||
NbOfSurveys=投票次數
|
||||
NbOfVoters=投票人數
|
||||
SurveyResults=結果
|
||||
PollAdminDesc=您可以使用“編輯”按鈕更改此民意調查的所有投票行。您也可以使用%s刪除列或行。您也可以使用%s增加新列。
|
||||
5MoreChoices=再多5個選項
|
||||
Against=反對
|
||||
YouAreInivitedToVote=您被邀請參加此項調查
|
||||
VoteNameAlreadyExists=此名稱已用於此調查
|
||||
AddADate=增加日期
|
||||
AddStartHour=增加開始時間
|
||||
AddEndHour=增加結束時間
|
||||
votes=投票
|
||||
NoCommentYet=尚未有此調查的評論
|
||||
CanComment=投票者可以在調查中發表評論
|
||||
CanSeeOthersVote=投票者可以看到其他人的投票
|
||||
SelectDayDesc=對於每個選定的日期,您可以依照以下格式選擇是否選擇開會時間: <br> -空的<br> -“ 8h”,“ 8H”或“ 8:00”指定會議的開始時間, <br> -“ 8-11”,“ 8h-11h”,“ 8H-11H”或“ 8:00-11:00”給出會議的開始和結束時間, <br> -同樣的用“ 8h15-11h15”,“ 8H15-11H15”或“ 8:15-11:15”表示,但要加上分鐘。
|
||||
BackToCurrentMonth=回到目前月份
|
||||
ErrorOpenSurveyFillFirstSection=您尚未填寫建立調查的第一部分
|
||||
ErrorOpenSurveyOneChoice=輸入至少一個選項
|
||||
ErrorInsertingComment=插入您的評論時出錯
|
||||
MoreChoices=為投票者輸入更多選項
|
||||
SurveyExpiredInfo=投票已關閉或投票已到期。
|
||||
EmailSomeoneVoted=%s已填滿一行。\n您可以在以下連結找到您的調查:\n%s
|
||||
ShowSurvey=顯示調查
|
||||
UserMustBeSameThanUserUsedToVote=您必須已投票並使用與投票時相同的用戶名來發表評論
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2007-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
/* Copyright (C) 2007-2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2013-2014 Cedric GROSS <c.gross@kreiz-it.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -44,8 +44,8 @@ class Productbatch extends CommonObject
|
||||
|
||||
public $tms = '';
|
||||
public $fk_product_stock;
|
||||
public $sellby = '';
|
||||
public $eatby = '';
|
||||
public $sellby = ''; // dlc
|
||||
public $eatby = ''; // dmd/dluo
|
||||
public $batch = '';
|
||||
public $qty;
|
||||
public $warehouseid;
|
||||
|
||||
@ -209,7 +209,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree
|
||||
);
|
||||
if ($result1 < 0) {
|
||||
$error++;
|
||||
setEventMessages($product->errors, $product->errorss, 'errors');
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
}
|
||||
|
||||
// Add stock
|
||||
@ -224,7 +224,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree
|
||||
);
|
||||
if ($result2 < 0) {
|
||||
$error++;
|
||||
setEventMessages($product->errors, $product->errorss, 'errors');
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
$arraybatchinfo = $product->loadBatchInfo($batch);
|
||||
@ -253,7 +253,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree
|
||||
);
|
||||
if ($result1 < 0) {
|
||||
$error++;
|
||||
setEventMessages($product->errors, $product->errorss, 'errors');
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
}
|
||||
|
||||
// Add stock
|
||||
@ -271,7 +271,7 @@ if ($action == 'createmovements' && !empty($user->rights->stock->mouvement->cree
|
||||
);
|
||||
if ($result2 < 0) {
|
||||
$error++;
|
||||
setEventMessages($product->errors, $product->errorss, 'errors');
|
||||
setEventMessages($product->error, $product->errors, 'errors');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -62,98 +62,108 @@ if ($object->id > 0) {
|
||||
restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('producttranslationcard', 'globalcard'));
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
// retour a l'affichage des traduction si annulation
|
||||
if ($cancel == $langs->trans("Cancel")) {
|
||||
$action = '';
|
||||
$parameters = array('id'=>$id, 'ref'=>$ref);
|
||||
$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 ($action == 'delete' && GETPOST('langtodelete', 'alpha')) {
|
||||
$object = new Product($db);
|
||||
$object->fetch($id);
|
||||
$object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
$action = '';
|
||||
}
|
||||
|
||||
// Add translation
|
||||
if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
|
||||
$object = new Product($db);
|
||||
$object->fetch($id);
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
// update de l'objet
|
||||
if (GETPOST("forcelangprod") == $current_lang) {
|
||||
$object->label = GETPOST("libelle");
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
|
||||
$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
|
||||
|
||||
$object->update($object->id, $user);
|
||||
} else {
|
||||
$object->multilangs[GETPOST("forcelangprod")]["label"] = GETPOST("libelle");
|
||||
$object->multilangs[GETPOST("forcelangprod")]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
|
||||
$object->multilangs[GETPOST("forcelangprod")]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
|
||||
}
|
||||
|
||||
// save in database
|
||||
if (GETPOST("forcelangprod")) {
|
||||
$result = $object->setMultiLangs($user);
|
||||
} else {
|
||||
$object->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Language"));
|
||||
$result = -1;
|
||||
}
|
||||
|
||||
if ($result > 0) {
|
||||
if (empty($reshook)) {
|
||||
// retour a l'affichage des traduction si annulation
|
||||
if ($cancel == $langs->trans("Cancel")) {
|
||||
$action = '';
|
||||
} else {
|
||||
$action = 'add';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
// Edit translation
|
||||
if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
|
||||
$object = new Product($db);
|
||||
$object->fetch($id);
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
if ($action == 'delete' && GETPOST('langtodelete', 'alpha')) {
|
||||
$object = new Product($db);
|
||||
$object->fetch($id);
|
||||
$object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
|
||||
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
|
||||
$action = '';
|
||||
}
|
||||
|
||||
foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet
|
||||
if ($key == $current_lang) {
|
||||
$object->label = GETPOST("libelle-".$key);
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
|
||||
$object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
|
||||
// Add translation
|
||||
if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
|
||||
$object = new Product($db);
|
||||
$object->fetch($id);
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
// update de l'objet
|
||||
if (GETPOST("forcelangprod") == $current_lang) {
|
||||
$object->label = GETPOST("libelle");
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
|
||||
$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
|
||||
|
||||
$object->update($object->id, $user);
|
||||
} else {
|
||||
$object->multilangs[$key]["label"] = GETPOST("libelle-".$key);
|
||||
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
|
||||
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
|
||||
$object->multilangs[GETPOST("forcelangprod")]["label"] = GETPOST("libelle");
|
||||
$object->multilangs[GETPOST("forcelangprod")]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
|
||||
$object->multilangs[GETPOST("forcelangprod")]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
|
||||
}
|
||||
|
||||
// save in database
|
||||
if (GETPOST("forcelangprod")) {
|
||||
$result = $object->setMultiLangs($user);
|
||||
} else {
|
||||
$object->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Language"));
|
||||
$result = -1;
|
||||
}
|
||||
|
||||
if ($result > 0) {
|
||||
$action = '';
|
||||
} else {
|
||||
$action = 'add';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
$result = $object->setMultiLangs($user);
|
||||
if ($result > 0) {
|
||||
$action = '';
|
||||
} else {
|
||||
$action = 'edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
// Edit translation
|
||||
if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
|
||||
$object = new Product($db);
|
||||
$object->fetch($id);
|
||||
$current_lang = $langs->getDefaultLang();
|
||||
|
||||
foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet
|
||||
if ($key == $current_lang) {
|
||||
$object->label = GETPOST("libelle-" . $key);
|
||||
$object->description = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml'));
|
||||
$object->other = dol_htmlcleanlastbr(GETPOST("other-" . $key, 'restricthtml'));
|
||||
} else {
|
||||
$object->multilangs[$key]["label"] = GETPOST("libelle-" . $key);
|
||||
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml'));
|
||||
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-" . $key, 'restricthtml'));
|
||||
}
|
||||
}
|
||||
|
||||
$result = $object->setMultiLangs($user);
|
||||
if ($result > 0) {
|
||||
$action = '';
|
||||
} else {
|
||||
$action = 'edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete translation
|
||||
if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
|
||||
$object = new Product($db);
|
||||
$object->fetch($id);
|
||||
$langtodelete = GETPOST('langdel', 'alpha');
|
||||
// Delete translation
|
||||
if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
|
||||
$object = new Product($db);
|
||||
$object->fetch($id);
|
||||
$langtodelete = GETPOST('langdel', 'alpha');
|
||||
|
||||
$result = $object->delMultiLangs($langtodelete, $user);
|
||||
if ($result > 0) {
|
||||
$action = '';
|
||||
} else {
|
||||
$action = 'edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
$result = $object->delMultiLangs($langtodelete, $user);
|
||||
if ($result > 0) {
|
||||
$action = '';
|
||||
} else {
|
||||
$action = 'edit';
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,11 +226,15 @@ print dol_get_fiche_end();
|
||||
*/
|
||||
print "\n".'<div class="tabsAction">'."\n";
|
||||
|
||||
if ($action == '') {
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/traduction.php?action=add&id='.$object->id.'">'.$langs->trans("Add").'</a>';
|
||||
if ($cnt_trans > 0) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/traduction.php?action=edit&id='.$object->id.'">'.$langs->trans("Update").'</a>';
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
|
||||
if (empty($reshook)) {
|
||||
if ($action == '') {
|
||||
if ($user->rights->produit->creer || $user->rights->service->creer) {
|
||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=add&id=' . $object->id . '">' . $langs->trans("Add") . '</a>';
|
||||
if ($cnt_trans > 0) {
|
||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=edit&id=' . $object->id . '">' . $langs->trans("Update") . '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -263,6 +277,9 @@ if ($action == 'edit') {
|
||||
}
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center">';
|
||||
@ -334,6 +351,9 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
|
||||
@ -82,7 +82,7 @@ if (empty($mode) || $mode != 'gettasks') {
|
||||
// Mode to get list of tasks
|
||||
if ($mode == 'gettasks') {
|
||||
$formproject = new FormProjets($db);
|
||||
$formproject->selectTasks((!empty($$socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), '');
|
||||
$formproject->selectTasks((!empty($socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOST('projectid', 'int'), '');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -1423,7 +1423,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} elseif ($action !== 'createtime') {
|
||||
print '<input type="hidden" name="taskid" value="'.$id.'">';
|
||||
}
|
||||
|
||||
|
||||
@ -1031,6 +1031,8 @@ if ($ispaymentok) {
|
||||
if ($resultattendee < 0) {
|
||||
setEventMessages(null, $attendeetovalidate->errors, "errors");
|
||||
} else {
|
||||
$attendeetovalidate->amount=$FinalPaymentAmt;
|
||||
$attendeetovalidate->update($user);
|
||||
$attendeetovalidate->validate($user);
|
||||
|
||||
// Sending mail
|
||||
@ -1051,8 +1053,9 @@ if ($ispaymentok) {
|
||||
$arraydefaultmessage = null;
|
||||
|
||||
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT;
|
||||
|
||||
if (!empty($labeltouse)) {
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, '');
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
|
||||
}
|
||||
|
||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||
@ -1066,7 +1069,7 @@ if ($ispaymentok) {
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
|
||||
|
||||
$sendto = $thirdparty->email;
|
||||
$sendto = $attendeetovalidate->email;
|
||||
$from = $conf->global->MAILING_EMAIL_FROM;
|
||||
$urlback = $_SERVER["REQUEST_URI"];
|
||||
|
||||
@ -1233,7 +1236,7 @@ if ($ispaymentok) {
|
||||
|
||||
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT;
|
||||
if (!empty($labeltouse)) {
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, '');
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
|
||||
}
|
||||
|
||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||
|
||||
@ -81,9 +81,8 @@ $email = GETPOST("email");
|
||||
$societe = GETPOST("societe");
|
||||
$label = GETPOST("label");
|
||||
$note = GETPOST("note");
|
||||
$datestart = GETPOST("datestart");
|
||||
$dateend = GETPOST("dateend");
|
||||
|
||||
$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int'));
|
||||
$dateend = dol_mktime(23, 59, 59, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int'));
|
||||
$id = GETPOST('id');
|
||||
|
||||
$project = new Project($db);
|
||||
@ -225,13 +224,19 @@ if (empty($reshook) && $action == 'add') {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."<br>\n";
|
||||
}
|
||||
if (!GETPOST("datestart")) {
|
||||
if (empty($datestart)) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."<br>\n";
|
||||
} elseif ($datestart < $project->date_start) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("DateMustBeAfterThan", $langs->transnoentitiesnoconv("DateStart"), dol_print_date($project->date_start))."<br>\n";
|
||||
}
|
||||
if (!GETPOST("dateend")) {
|
||||
if (empty($dateend)) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."<br>\n";
|
||||
} elseif ($dateend > dol_mktime(23, 59, 59, dol_print_date($project->date_end, '%m'), dol_print_date($project->date_end, '%d'), dol_print_date($project->date_end, '%Y'))) {
|
||||
$error++;
|
||||
$errmsg .= $langs->trans("DateMustBeBeforeThan", $langs->transnoentitiesnoconv("DateEnd"), dol_print_date($project->date_end))."<br>\n";
|
||||
}
|
||||
if (!GETPOST("email")) {
|
||||
$error++;
|
||||
@ -376,7 +381,7 @@ if (empty($reshook) && $action == 'add') {
|
||||
$conforbooth->fk_project = $project->id;
|
||||
$conforbooth->note = $note;
|
||||
$conforbooth->fk_action = $eventtype;
|
||||
$conforbooth->datep =$datestart;
|
||||
$conforbooth->datep = $datestart;
|
||||
$conforbooth->datep2 = $dateend;
|
||||
$conforbooth->datec = dol_now();
|
||||
$conforbooth->tms = dol_now();
|
||||
@ -423,7 +428,7 @@ if (empty($reshook) && $action == 'add') {
|
||||
$error++;
|
||||
} else {
|
||||
$db->commit();
|
||||
$facture->add_object_linked($contact->element, $contact->id);
|
||||
$facture->add_object_linked($conforbooth->element, $conforbooth->id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -436,7 +441,7 @@ if (empty($reshook) && $action == 'add') {
|
||||
$contact->errors = $facture->errors;
|
||||
$error++;
|
||||
}
|
||||
if (!$error) {
|
||||
/*if (!$error) {
|
||||
$valid = true;
|
||||
$sourcetouse = 'boothlocation';
|
||||
$reftouse = $facture->id;
|
||||
@ -450,54 +455,12 @@ if (empty($reshook) && $action == 'add') {
|
||||
}
|
||||
Header("Location: ".$redirection);
|
||||
exit;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
} else {
|
||||
// If no price has been set for the booth, we confirm it as suggested and we update
|
||||
$conforbooth->status = ConferenceOrBooth::STATUS_SUGGESTED;
|
||||
$conforbooth->update($user);
|
||||
// Sending mail
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
|
||||
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH;
|
||||
if (!empty($labeltouse)) {
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
|
||||
}
|
||||
|
||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||
$subject = $arraydefaultmessage->topic;
|
||||
$msg = $arraydefaultmessage->content;
|
||||
}
|
||||
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
|
||||
|
||||
$sendto = $thirdparty->email;
|
||||
$from = $conf->global->MAILING_EMAIL_FROM;
|
||||
$urlback = $_SERVER["REQUEST_URI"];
|
||||
|
||||
$ishtml = dol_textishtml($texttosend); // May contain urls
|
||||
|
||||
$mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml);
|
||||
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result) {
|
||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
|
||||
} else {
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -505,6 +468,50 @@ if (empty($reshook) && $action == 'add') {
|
||||
}
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
|
||||
// Sending mail
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||
$formmail = new FormMail($db);
|
||||
// Set output language
|
||||
$outputlangs = new Translate('', $conf);
|
||||
$outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
|
||||
// Load traductions files required by page
|
||||
$outputlangs->loadLangs(array("main", "members"));
|
||||
// Get email content from template
|
||||
$arraydefaultmessage = null;
|
||||
|
||||
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH;
|
||||
if (!empty($labeltouse)) {
|
||||
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
|
||||
}
|
||||
|
||||
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
|
||||
$subject = $arraydefaultmessage->topic;
|
||||
$msg = $arraydefaultmessage->content;
|
||||
}
|
||||
|
||||
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object);
|
||||
|
||||
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
|
||||
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
|
||||
|
||||
$sendto = $thirdparty->email;
|
||||
$from = $conf->global->MAILING_EMAIL_FROM;
|
||||
$urlback = $_SERVER["REQUEST_URI"];
|
||||
|
||||
$ishtml = dol_textishtml($texttosend); // May contain urls
|
||||
|
||||
$mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml);
|
||||
|
||||
$result = $mailfile->sendfile();
|
||||
if ($result) {
|
||||
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
|
||||
} else {
|
||||
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
|
||||
}
|
||||
|
||||
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
|
||||
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl;
|
||||
Header("Location: ".$redirection);
|
||||
@ -630,12 +637,23 @@ print '</td><td><input type="text" name="label" class="minwidth150" value="'.dol
|
||||
print '<tr><td>'.$langs->trans("Description").'<FONT COLOR="red">*</FONT></td>'."\n";
|
||||
print '<td><textarea name="note" id="note" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
|
||||
// Start Date
|
||||
print '<tr><td>'.$langs->trans("DateStart").'<FONT COLOR="red">*</FONT></td>'."\n";
|
||||
print '<td><input type="date" name="datestart" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('datestart')).'"></td></tr>'."\n";
|
||||
print '<tr><td>'.$langs->trans("DateStart").'<FONT COLOR="red">*</FONT>';
|
||||
if (!empty($project->date_start)) {
|
||||
print '('.$langs->trans('Min'). ' '.dol_print_date($project->date_start).')';
|
||||
}
|
||||
print '</td>'."\n";
|
||||
print '<td>';
|
||||
print $form->selectDate((empty($datestart)?$project->date_start:$datestart), 'datestart');
|
||||
print '</td></tr>'."\n";
|
||||
// End Date
|
||||
print '<tr><td>'.$langs->trans("DateEnd").'<FONT COLOR="red">*</FONT></td>'."\n";
|
||||
print '<td><input type="date" name="dateend" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('dateend')).'"></td></tr>'."\n";
|
||||
|
||||
print '<tr><td>'.$langs->trans("DateEnd").'<FONT COLOR="red">*</FONT>';
|
||||
if (!empty($project->date_end)) {
|
||||
print '('.$langs->trans('Max'). ' '.dol_print_date($project->date_end).')';
|
||||
}
|
||||
print '</td>'."\n";
|
||||
print '<td>';
|
||||
print $form->selectDate(empty($dateend)?$project->date_end:$dateend, 'dateend');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
@ -258,7 +258,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('add', 'alpha')) {
|
||||
|
||||
$sendto = GETPOST('email', 'alpha');
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$replyto = $from;
|
||||
$sendtocc = '';
|
||||
$deliveryreceipt = 0;
|
||||
@ -298,7 +298,6 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('add', 'alpha')) {
|
||||
}
|
||||
$message_admin .= '</ul>';
|
||||
|
||||
$message_admin .= '</ul>';
|
||||
$message_admin .= '<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
|
||||
$message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'" rel="nofollow noopener">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
|
||||
|
||||
@ -390,7 +389,7 @@ if ($action != "infos_success") {
|
||||
print '<div class="error">';
|
||||
print $langs->trans("ErrorFieldRequired", $langs->transnoentities("TicketEmailNotificationFrom")).'<br>';
|
||||
print $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentities("Ticket"));
|
||||
print '<div>';
|
||||
print '</div>';
|
||||
} else {
|
||||
print '<div class="info marginleftonly marginrightonly">'.$langs->trans('TicketPublicInfoCreateTicket').'</div>';
|
||||
$formticket->showForm(0, 'edit', 1);
|
||||
|
||||
@ -262,8 +262,10 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
|
||||
|
||||
// Category
|
||||
print '<tr><td>'.$langs->trans("Category").'</td><td>';
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"');
|
||||
print dol_escape_htmltag($object->dao->category_label);
|
||||
if ($object->dao->category_label) {
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"');
|
||||
print dol_escape_htmltag($object->dao->category_label);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Severity
|
||||
|
||||
@ -477,7 +477,7 @@ class PaymentSalary extends CommonObject
|
||||
* All payment properties must have been set first like after a call to create().
|
||||
*
|
||||
* @param User $user Object of user making payment
|
||||
* @param string $mode 'payment_sc'
|
||||
* @param string $mode 'payment_salary'
|
||||
* @param string $label Label to use in bank record
|
||||
* @param int $accountid Id of bank account to do link with
|
||||
* @param string $emetteur_nom Name of transmitter
|
||||
@ -516,8 +516,8 @@ class PaymentSalary extends CommonObject
|
||||
$this->datev
|
||||
);
|
||||
|
||||
// Mise a jour fk_bank dans llx_paiement.
|
||||
// On connait ainsi le paiement qui a genere l'ecriture bancaire
|
||||
// Update fk_bank into llx_paiement_salary.
|
||||
// so we know the payment that was used to generated the bank entry.
|
||||
if ($bank_line_id > 0) {
|
||||
$result = $this->update_fk_bank($bank_line_id);
|
||||
if ($result <= 0) {
|
||||
@ -525,9 +525,12 @@ class PaymentSalary extends CommonObject
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
|
||||
// Add link 'payment', 'payment_supplier', 'payment_sc' in bank_url between payment and bank transaction
|
||||
// Add link 'payment_salary' in bank_url between payment and bank transaction
|
||||
$url = '';
|
||||
if ($mode == 'payment_salary') $url = DOL_URL_ROOT.'/salaries/payment_salary/card.php?id=';
|
||||
if ($mode == 'payment_salary') {
|
||||
$url = DOL_URL_ROOT.'/salaries/payment_salary/card.php?id=';
|
||||
}
|
||||
|
||||
if ($url) {
|
||||
$result = $acc->add_url_line($bank_line_id, $this->id, $url, '(paiement)', $mode);
|
||||
if ($result <= 0) {
|
||||
@ -536,14 +539,31 @@ class PaymentSalary extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
// Add link 'company' in bank_url between invoice and bank transaction (for each invoice concerned by payment)
|
||||
$linkaddedforthirdparty = array();
|
||||
// Add link 'user' in bank_url between user and bank transaction
|
||||
foreach ($this->amounts as $key => $value) {
|
||||
if ($mode == 'payment_salary') {
|
||||
$salary = new Salary($this->db);
|
||||
$salary->fetch($key);
|
||||
$result = $acc->add_url_line($bank_line_id, $salary->id, DOL_URL_ROOT.'/salaries/card.php?id=', '('.$salary->label.')', 'salary');
|
||||
if ($result <= 0) dol_print_error($this->db);
|
||||
if (!$error) {
|
||||
if ($mode == 'payment_salary') {
|
||||
$salary = new Salary($this->db);
|
||||
$salary->fetch($key);
|
||||
$salary->fetch_user($salary->fk_user);
|
||||
|
||||
$fuser = $salary->user;
|
||||
|
||||
if ($fuser->id > 0) {
|
||||
$result = $acc->add_url_line(
|
||||
$bank_line_id,
|
||||
$fuser->id,
|
||||
DOL_URL_ROOT.'/user/card.php?id=',
|
||||
$fuser->getFullName($langs),
|
||||
'user'
|
||||
);
|
||||
}
|
||||
if ($result <= 0) {
|
||||
$this->error = $this->db->lasterror();
|
||||
dol_syslog(get_class($this) . '::addPaymentToBank ' . $this->error);
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -88,6 +88,12 @@ class Salary extends CommonObject
|
||||
*/
|
||||
public $fk_user_modif;
|
||||
|
||||
/**
|
||||
* @var user User
|
||||
*/
|
||||
public $user;
|
||||
|
||||
|
||||
const STATUS_UNPAID = 0;
|
||||
const STATUS_PAID = 1;
|
||||
|
||||
|
||||
@ -83,7 +83,7 @@ class CompanyBankAccount extends Account
|
||||
$now = dol_now();
|
||||
$error = 0;
|
||||
// Correct default_rib to be sure to have always one default
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".$this->socid." AND default_rib = 1 AND type = 'ban'";
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."societe_rib where fk_soc = ".((int) $this->socid)." AND default_rib = 1 AND type = 'ban'";
|
||||
$result = $this->db->query($sql);
|
||||
if ($result) {
|
||||
$numrows = $this->db->num_rows($result);
|
||||
@ -96,7 +96,7 @@ class CompanyBankAccount extends Account
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe_rib (fk_soc, type, datec)";
|
||||
$sql .= " VALUES (".$this->socid.", 'ban', '".$this->db->idate($now)."')";
|
||||
$sql .= " VALUES (".((int) $this->socid).", 'ban', '".$this->db->idate($now)."')";
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
if ($this->db->affected_rows($resql)) {
|
||||
@ -135,6 +135,7 @@ class CompanyBankAccount extends Account
|
||||
public function update(User $user = null, $notrigger = 0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$error = 0;
|
||||
|
||||
if (!$this->id) {
|
||||
@ -160,7 +161,7 @@ class CompanyBankAccount extends Account
|
||||
$sql .= ",proprio = '".$this->db->escape($this->proprio)."'";
|
||||
$sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'";
|
||||
$sql .= ",default_rib = ".((int) $this->default_rib);
|
||||
if ($conf->prelevement->enabled) {
|
||||
if (!empty($conf->prelevement->enabled)) {
|
||||
$sql .= ",frstrecur = '".$this->db->escape($this->frstrecur)."'";
|
||||
$sql .= ",rum = '".$this->db->escape($this->rum)."'";
|
||||
$sql .= ",date_rum = ".($this->date_rum ? "'".$this->db->idate($this->date_rum)."'" : "null");
|
||||
|
||||
@ -654,8 +654,8 @@ if ($search_level) {
|
||||
if ($search_parent_name) {
|
||||
$sql .= natural_search("s2.nom", $search_parent_name);
|
||||
}
|
||||
if ($search_stcomm != '' && $search_stcomm != -2) {
|
||||
$sql .= natural_search("s.fk_stcomm", $search_stcomm, 2);
|
||||
if ($search_stcomm != '' && $search_stcomm != '-2') { // -2 is not filter
|
||||
$sql .= natural_search("s.fk_stcomm", $search_stcomm, 1);
|
||||
}
|
||||
if ($search_import_key) {
|
||||
$sql .= natural_search("s.import_key", $search_import_key);
|
||||
@ -830,7 +830,7 @@ if (is_array($search_level) && count($search_level)) {
|
||||
if ($search_status != '') {
|
||||
$param .= '&search_status='.urlencode($search_status);
|
||||
}
|
||||
if ($search_stcomm != '') {
|
||||
if ($search_stcomm != '' && $search_stcomm != '-2') { // -2 is no filter
|
||||
$param .= '&search_stcomm='.urlencode($search_stcomm);
|
||||
}
|
||||
if ($search_parent_name != '') {
|
||||
|
||||
@ -161,9 +161,6 @@ if (empty($reshook)) {
|
||||
if (empty($companybankaccount->rum)) {
|
||||
$companybankaccount->rum = $prelevement->buildRumNumber($object->code_client, $companybankaccount->datec, $companybankaccount->id);
|
||||
}
|
||||
if (empty($companybankaccount->date_rum)) {
|
||||
$companybankaccount->date_rum = dol_now();
|
||||
}
|
||||
|
||||
$result = $companybankaccount->update($user);
|
||||
if (!$result) {
|
||||
@ -268,9 +265,9 @@ if (empty($reshook)) {
|
||||
$companybankaccount->domiciliation = GETPOST('domiciliation', 'alpha');
|
||||
$companybankaccount->proprio = GETPOST('proprio', 'alpha');
|
||||
$companybankaccount->owner_address = GETPOST('owner_address', 'alpha');
|
||||
$companybankaccount->frstrecur = GETPOST('frstrecur');
|
||||
$companybankaccount->frstrecur = GETPOST('frstrecur', 'alpha');
|
||||
$companybankaccount->rum = GETPOST('rum', 'alpha');
|
||||
$companybankaccount->date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth'), GETPOST('date_rumday'), GETPOST('date_rumyear'));
|
||||
$companybankaccount->date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth', 'int'), GETPOST('date_rumday', 'int'), GETPOST('date_rumyear', 'int'));
|
||||
$companybankaccount->datec = dol_now();
|
||||
$companybankaccount->status = 1;
|
||||
|
||||
@ -300,7 +297,6 @@ if (empty($reshook)) {
|
||||
|
||||
if (empty($companybankaccount->rum)) {
|
||||
$companybankaccount->rum = $prelevement->buildRumNumber($object->code_client, $companybankaccount->datec, $companybankaccount->id);
|
||||
$companybankaccount->date_rum = dol_now();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1638,8 +1634,10 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("RUM").'</td>';
|
||||
print '<td><input class="minwidth300" type="text" name="rum" value="'.dol_escape_htmltag($companybankaccount->rum).'"></td></tr>';
|
||||
|
||||
$date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth'), GETPOST('date_rumday'), GETPOST('date_rumyear'));
|
||||
|
||||
print '<tr><td class="titlefield">'.$langs->trans("DateRUM").'</td>';
|
||||
print '<td>'.$form->selectDate(GETPOST('date_rum') ?GETPOST('date_rum') : $companybankaccount->date_rum, 'date_rum', 0, 0, 1, 'date_rum').'</td></tr>';
|
||||
print '<td>'.$form->selectDate($date_rum ? $date_rum : $companybankaccount->date_rum, 'date_rum', 0, 0, 1, 'date_rum', 1, 1).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("WithdrawMode").'</td><td>';
|
||||
$tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR"));
|
||||
@ -1800,8 +1798,10 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) {
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("RUM").'</td>';
|
||||
print '<td colspan="4"><input type="text" class="minwidth300" name="rum" value="'.GETPOST('rum', 'alpha').'"> <div class="opacitymedium">'.$langs->trans("RUMWillBeGenerated").'</div></td></tr>';
|
||||
|
||||
$date_rum = dol_mktime(0, 0, 0, GETPOST('date_rummonth'), GETPOST('date_rumday'), GETPOST('date_rumyear'));
|
||||
|
||||
print '<tr><td class="titlefieldcreate">'.$langs->trans("DateRUM").'</td>';
|
||||
print '<td colspan="4">'.$form->selectDate(GETPOST('date_rum'), 'date_rum', 0, 0, 1, 'date_rum').'</td></tr>';
|
||||
print '<td colspan="4">'.$form->selectDate($date_rum, 'date_rum', 0, 0, 1, 'date_rum', 1, 1).'</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("WithdrawMode").'</td><td>';
|
||||
$tblArraychoice = array("FRST" => $langs->trans("FRST"), "RECUR" => $langs->trans("RECUR"));
|
||||
|
||||
@ -426,10 +426,10 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) {
|
||||
if (($action == "confirm_close" || $action == "confirm_abandon") && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) {
|
||||
$object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha'));
|
||||
|
||||
if ($object->close($user)) {
|
||||
if ($object->close($user, ($action == "confirm_abandon" ? 1 : 0))) {
|
||||
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
|
||||
|
||||
$url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha');
|
||||
@ -473,7 +473,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Set parent company
|
||||
if ($action == 'set_thirdparty' && $user->rights->societe->creer) {
|
||||
if ($action == 'set_thirdparty' && $user->rights->ticket->write) {
|
||||
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
|
||||
$result = $object->setCustomer(GETPOST('editcustomer', 'int'));
|
||||
$url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha');
|
||||
@ -749,7 +749,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '</div>';
|
||||
|
||||
print '</form>'; */
|
||||
} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|
||||
} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'abandon' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|
||||
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') {
|
||||
if ($res > 0) {
|
||||
// or for unauthorized internals users
|
||||
@ -764,6 +764,13 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
// Confirmation abandon
|
||||
if ($action == 'abandon') {
|
||||
print $form->formconfirm($url_page_current."?track_id=".$object->track_id, $langs->trans("AbandonTicket"), $langs->trans("ConfirmAbandonTicket"), "confirm_abandon", '', '', 1);
|
||||
if ($ret == 'html') {
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
// Confirmation delete
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($url_page_current."?track_id=".$object->track_id, $langs->trans("Delete"), $langs->trans("ConfirmDeleteTicket"), "confirm_delete_ticket", '', '', 1);
|
||||
@ -1119,15 +1126,21 @@ if ($action == 'create' || $action == 'presend') {
|
||||
} else {
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>';
|
||||
print $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);
|
||||
if (!empty($object->type_code)) {
|
||||
print $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);
|
||||
}
|
||||
print '</td></tr>';
|
||||
// Group
|
||||
print '<tr><td>'.$langs->trans("TicketCategory").'</td><td>';
|
||||
print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
|
||||
if (!empty($object->category_code)) {
|
||||
print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
|
||||
}
|
||||
print '</td></tr>';
|
||||
// Severity
|
||||
print '<tr><td>'.$langs->trans("TicketSeverity").'</td><td>';
|
||||
print $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code);
|
||||
if (!empty($object->severity_code)) {
|
||||
print $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</table>'; // End table actions
|
||||
@ -1296,8 +1309,13 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id='.$object->track_id.'&action=close">'.$langs->trans('CloseTicket').'</a></div>';
|
||||
}
|
||||
|
||||
// Abadon ticket if statut is read
|
||||
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id='.$object->track_id.'&action=abandon">'.$langs->trans('AbandonTicket').'</a></div>';
|
||||
}
|
||||
|
||||
// Re-open ticket
|
||||
if (!$user->socid && $object->fk_statut == Ticket::STATUS_CLOSED && !$user->socid) {
|
||||
if (!$user->socid && ($object->fk_statut == Ticket::STATUS_CLOSED || $object->fk_statut == Ticket::STATUS_CANCELED) && !$user->socid) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id='.$object->track_id.'&action=reopen">'.$langs->trans('ReOpen').'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
@ -408,7 +408,7 @@ class ActionsTicket
|
||||
if ($status == 1) {
|
||||
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=mark_ticket_read'; // To set as read, we use a dedicated action
|
||||
} else {
|
||||
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&token='.newToken().'&new_status='.$status;
|
||||
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=confirm_set_status&token='.newToken().'&new_status='.$status;
|
||||
}
|
||||
|
||||
print '<a class="butAction butStatus marginbottomonly" href="'.$urlforbutton.'">';
|
||||
|
||||
@ -218,8 +218,8 @@ class Ticket extends CommonObject
|
||||
const STATUS_IN_PROGRESS = 3;
|
||||
const STATUS_NEED_MORE_INFO = 5;
|
||||
const STATUS_WAITING = 7; // on hold
|
||||
const STATUS_CLOSED = 8;
|
||||
const STATUS_CANCELED = 9;
|
||||
const STATUS_CLOSED = 8; // Closed - Solved
|
||||
const STATUS_CANCELED = 9; // Closed - Not solved
|
||||
|
||||
|
||||
/**
|
||||
@ -272,8 +272,8 @@ class Ticket extends CommonObject
|
||||
'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1,),
|
||||
'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'),
|
||||
'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>1),
|
||||
'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>1, 'position'=>550, 'notnull'=>1),
|
||||
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted')),
|
||||
'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'$conf->global->TICKET_ENABLE_RESOLUTION', 'position'=>550, 'notnull'=>1),
|
||||
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'SolvedClosed', 9 => 'Deleted')),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
@ -286,6 +286,8 @@ class Ticket extends CommonObject
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
$this->statuts_short = array(
|
||||
@ -295,7 +297,7 @@ class Ticket extends CommonObject
|
||||
self::STATUS_IN_PROGRESS => 'InProgress',
|
||||
self::STATUS_WAITING => 'OnHold',
|
||||
self::STATUS_NEED_MORE_INFO => 'NeedMoreInformationShort',
|
||||
self::STATUS_CLOSED => 'Closed',
|
||||
self::STATUS_CLOSED => 'SolvedClosed',
|
||||
self::STATUS_CANCELED => 'Canceled'
|
||||
);
|
||||
$this->statuts = array(
|
||||
@ -305,7 +307,7 @@ class Ticket extends CommonObject
|
||||
self::STATUS_IN_PROGRESS => 'InProgress',
|
||||
self::STATUS_WAITING => 'OnHold',
|
||||
self::STATUS_NEED_MORE_INFO => 'NeedMoreInformation',
|
||||
self::STATUS_CLOSED => 'Closed',
|
||||
self::STATUS_CLOSED => 'SolvedClosed',
|
||||
self::STATUS_CANCELED => 'Canceled'
|
||||
);
|
||||
}
|
||||
@ -459,7 +461,7 @@ class Ticket extends CommonObject
|
||||
$sql .= " ".(!isset($this->progress) ? '0' : "'".$this->db->escape($this->progress)."'").",";
|
||||
$sql .= " ".(!isset($this->timing) ? 'NULL' : "'".$this->db->escape($this->timing)."'").",";
|
||||
$sql .= " ".(!isset($this->type_code) ? 'NULL' : "'".$this->db->escape($this->type_code)."'").",";
|
||||
$sql .= " ".(!isset($this->category_code) ? 'NULL' : "'".$this->db->escape($this->category_code)."'").",";
|
||||
$sql .= " ".(empty($this->category_code) || $this->category_code == '-1' ? 'NULL' : "'".$this->db->escape($this->category_code)."'").",";
|
||||
$sql .= " ".(!isset($this->severity_code) ? 'NULL' : "'".$this->db->escape($this->severity_code)."'").",";
|
||||
$sql .= " ".(!isset($this->datec) || dol_strlen($this->datec) == 0 ? 'NULL' : "'".$this->db->idate($this->datec)."'").",";
|
||||
$sql .= " ".(!isset($this->date_read) || dol_strlen($this->date_read) == 0 ? 'NULL' : "'".$this->db->idate($this->date_read)."'").",";
|
||||
@ -1747,21 +1749,22 @@ class Ticket extends CommonObject
|
||||
/**
|
||||
* Close a ticket
|
||||
*
|
||||
* @param User $user User that close
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User that close
|
||||
* @param int $mode 0=Close solved, 1=Close abandonned
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function close(User $user)
|
||||
public function close(User $user, $mode = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($this->fk_statut != Ticket::STATUS_CLOSED) { // not closed
|
||||
if ($this->fk_statut != Ticket::STATUS_CLOSED && $this->fk_statut != Ticket::STATUS_CANCELED) { // not closed
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."ticket";
|
||||
$sql .= " SET fk_statut=".Ticket::STATUS_CLOSED.", progress=100, date_close='".$this->db->idate(dol_now())."'";
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " SET fk_statut=".($mode ? Ticket::STATUS_CANCELED : Ticket::STATUS_CLOSED).", progress=100, date_close='".$this->db->idate(dol_now())."'";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::close sql=".$sql);
|
||||
dol_syslog(get_class($this)."::close mode=".$mode);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$error = 0;
|
||||
|
||||
@ -45,9 +45,9 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'tickep#selectedfieldstlist'; // To manage different context of search
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'tickep#selectedfieldstlist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$msg_id = GETPOST('msg_id', 'int');
|
||||
@ -73,8 +73,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@ -107,12 +108,16 @@ if (GETPOST('search_fk_status', 'alpha') == 'non_closed') {
|
||||
}
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = trim(GETPOSTISSET("search_all") ?GETPOSTISSET("search_all", 'alpha') : GETPOST('sall'));
|
||||
$search_all = (GETPOSTISSET("search_all") ? GETPOST("search_all", 'alpha') : GETPOST('sall'));
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha')) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
|
||||
$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
|
||||
}
|
||||
}
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
@ -126,12 +131,19 @@ $fieldstosearchall['s.name_alias'] = "AliasNameShort";
|
||||
$fieldstosearchall['s.zip'] = "Zip";
|
||||
$fieldstosearchall['s.town'] = "Town";
|
||||
|
||||
// Definition of fields for list
|
||||
// Definition of array of fields for columns
|
||||
$arrayfields = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) {
|
||||
$arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
|
||||
$visible = (int) dol_eval($val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
'label'=>$val['label'],
|
||||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
|
||||
'position'=>$val['position'],
|
||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
@ -139,8 +151,6 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
//if ($socid > 0) $arrayfields['t.fk_soc']['enabled']=0;
|
||||
//if ($projectid > 0) $arrayfields['t.fk_project']['enabled']=0;
|
||||
|
||||
|
||||
// Security check
|
||||
|
||||
@ -30,10 +30,13 @@ $langs->loadLangs(array("products", "other"));
|
||||
$id = GETPOST('id', 'int');
|
||||
$valueid = GETPOST('valueid', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$weight_impact = GETPOST('weight_impact', 'alpha');
|
||||
$price_impact = GETPOST('price_impact', 'alpha');
|
||||
$weight_impact = price2num(GETPOST('weight_impact', 'alpha'), 2);
|
||||
$price_impact_percent = (bool) GETPOST('price_impact_percent');
|
||||
|
||||
if ($price_impact_percent) {
|
||||
$price_impact = price2num(GETPOST('price_impact', 'alpha'), 2);
|
||||
} else {
|
||||
$price_impact = price2num(GETPOST('price_impact', 'alpha'), 'MU');
|
||||
}
|
||||
$level_price_impact = GETPOST('level_price_impact', 'array');
|
||||
$level_price_impact_percent = GETPOST('level_price_impact_percent', 'array');
|
||||
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
require DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/variants/class/ProductAttribute.class.php';
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$object = new ProductAttribute($db);
|
||||
|
||||
@ -2326,7 +2326,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
$domainname = $objp->virtualhost;
|
||||
}
|
||||
if (! preg_match('/^http/i', $domainname)) {
|
||||
$domainname .= 'https://'.$domainname;
|
||||
$domainname = 'https://'.$domainname;
|
||||
}
|
||||
//$pathofpage = $dolibarr_main_url_root.'/'.$pageurl.'.php';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user