Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into addButtonForOveritedocTemplate
This commit is contained in:
commit
57ba5fc7f5
103 changed files with 638 additions and 484 deletions
|
|
@ -103,7 +103,7 @@ class GlobalToFunction extends AbstractRector
|
|||
|
||||
if ($node instanceof FuncCall) {
|
||||
$tmpfunctionname = $this->getName($node);
|
||||
// If function is ok(we must avoid a lot of cases like isset, empty)
|
||||
// If function is ok. We must avoid a lot of cases like isset(), empty()
|
||||
if (in_array($tmpfunctionname, array('dol_escape_htmltag', 'make_substitutions', 'min', 'max', 'explode'))) {
|
||||
$args = $node->getArgs();
|
||||
$nbofparam = count($args);
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha');
|
|||
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ $search_lettering_code = GETPOST('search_lettering_code', 'alpha');
|
|||
$search_not_reconciled = GETPOST('search_not_reconciled', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_
|
|||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class AccountancyExport
|
|||
|
||||
$this->db = $db;
|
||||
$this->separator = $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV;
|
||||
$this->end_line = !getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE') ? "\n" : (getDolGlobalInt('ACCOUNTING_EXPORT_ENDLINE') == 1 ? "\n" : "\r\n");
|
||||
$this->end_line = getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE') ? (getDolGlobalInt('ACCOUNTING_EXPORT_ENDLINE') == 1 ? "\n" : "\r\n") : "\n";
|
||||
|
||||
$hookmanager->initHooks(array('accountancyexport'));
|
||||
}
|
||||
|
|
@ -201,9 +201,9 @@ class AccountancyExport
|
|||
'param' => array(
|
||||
self::$EXPORT_TYPE_CONFIGURABLE => array(
|
||||
'label' => $langs->trans('Modelcsv_configurable'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => !getDolGlobalString('ACCOUNTING_EXPORT_FORMAT') ? 'txt' : $conf->global->ACCOUNTING_EXPORT_FORMAT,
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV' => !getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV') ? ',' : $conf->global->ACCOUNTING_EXPORT_SEPARATORCSV,
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => !getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE') ? 1 : $conf->global->ACCOUNTING_EXPORT_ENDLINE,
|
||||
'ACCOUNTING_EXPORT_FORMAT' => getDolGlobalString('ACCOUNTING_EXPORT_FORMAT', 'txt'),
|
||||
'ACCOUNTING_EXPORT_SEPARATORCSV' => getDolGlobalString('ACCOUNTING_EXPORT_SEPARATORCSV', ','),
|
||||
'ACCOUNTING_EXPORT_ENDLINE' => getDolGlobalString('ACCOUNTING_EXPORT_ENDLINE', 1),
|
||||
'ACCOUNTING_EXPORT_DATE' => getDolGlobalString('ACCOUNTING_EXPORT_DATE', '%Y-%m-%d'),
|
||||
),
|
||||
self::$EXPORT_TYPE_CEGID => array(
|
||||
|
|
@ -839,8 +839,6 @@ class AccountancyExport
|
|||
$end_line = "\r\n";
|
||||
|
||||
// We should use dol_now function not time however this is wrong date to transfert in accounting
|
||||
// $date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
// $date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
foreach ($objectLines as $line) {
|
||||
// Clean some data
|
||||
$line->doc_ref = dol_string_unaccent($line->doc_ref);
|
||||
|
|
@ -938,7 +936,6 @@ class AccountancyExport
|
|||
|
||||
// Force date format : %d%m%y
|
||||
if (!empty($line->date_lim_reglement)) {
|
||||
//$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, '%d%m%y'); // Format must be ddmmyy
|
||||
} else {
|
||||
$tab['date_echeance'] = '000000';
|
||||
|
|
@ -1061,10 +1058,6 @@ class AccountancyExport
|
|||
$end_line = "\r\n";
|
||||
$index = 1;
|
||||
|
||||
//We should use dol_now function not time however this is wrong date to transfert in accounting
|
||||
//$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
//$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy
|
||||
|
||||
// Warning ! When truncation is necessary, no dot because 3 dots = three characters. The columns are shifted
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
|
|
@ -1109,7 +1102,6 @@ class AccountancyExport
|
|||
$tab['code_stat'] = str_repeat(' ', 4);
|
||||
|
||||
if (!empty($line->date_lim_reglement)) {
|
||||
//$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$tab['date_echeance'] = dol_print_date($line->date_lim_reglement, '%d%m%Y');
|
||||
} else {
|
||||
$tab['date_echeance'] = dol_print_date($line->doc_date, '%d%m%Y');
|
||||
|
|
@ -1276,7 +1268,7 @@ class AccountancyExport
|
|||
$separator = $this->separator;
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$date_document = dol_print_date($line->doc_date, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$date_document = dol_print_date($line->doc_date, getDolGlobalString('ACCOUNTING_EXPORT_DATE'));
|
||||
|
||||
$tab = array();
|
||||
// export configurable
|
||||
|
|
|
|||
|
|
@ -470,7 +470,7 @@ class AccountingJournal extends CommonObject
|
|||
}
|
||||
// Define begin binding date
|
||||
if (getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate($conf->global->ACCOUNTING_DATE_START_BINDING) . "'";
|
||||
$sql .= " AND ad.depreciation_date >= '" . $this->db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) . "'";
|
||||
}
|
||||
$sql .= " ORDER BY ad.depreciation_date";
|
||||
|
||||
|
|
@ -616,12 +616,12 @@ class AccountingJournal extends CommonObject
|
|||
$disposal_date = $pre_data_info['disposal']['date'];
|
||||
|
||||
if ((!($date_start && $date_end) || ($date_start <= $disposal_date && $disposal_date <= $date_end)) &&
|
||||
(!getDolGlobalString('ACCOUNTING_DATE_START_BINDING') || $conf->global->ACCOUNTING_DATE_START_BINDING <= $disposal_date)
|
||||
(!getDolGlobalString('ACCOUNTING_DATE_START_BINDING') || getDolGlobalInt('ACCOUNTING_DATE_START_BINDING') <= $disposal_date)
|
||||
) {
|
||||
$disposal_amount = $pre_data_info['disposal']['amount'];
|
||||
$disposal_subject_to_vat = $pre_data_info['disposal']['subject_to_vat'];
|
||||
$disposal_date_formatted = dol_print_date($disposal_date, 'day');
|
||||
$disposal_vat = getDolGlobalInt('ASSET_DISPOSAL_VAT') > 0 ? $conf->global->ASSET_DISPOSAL_VAT : 20;
|
||||
$disposal_vat = getDolGlobalInt('ASSET_DISPOSAL_VAT') > 0 ? getDolGlobalInt('ASSET_DISPOSAL_VAT') : 20;
|
||||
|
||||
// Get accountancy codes
|
||||
//---------------------------
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -337,7 +337,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -357,7 +357,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -405,27 +405,27 @@ if ($resql) {
|
|||
print '</td>';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
$startmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||
$startmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||
if ($startmonth > 12) {
|
||||
$startmonth -= 12;
|
||||
}
|
||||
$startyear = ($startmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + 11;
|
||||
$startyear = ($startmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$endmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + 11;
|
||||
if ($endmonth > 12) {
|
||||
$endmonth -= 12;
|
||||
}
|
||||
$endyear = ($endmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endyear = ($endmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_date_startday=1&search_date_startmonth='.((int) $startmonth).'&search_date_startyear='.((int) $startyear).'&search_date_endday=&search_date_endmonth='.((int) $endmonth).'&search_date_endyear='.((int) $endyear), $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
print $row[1];
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 13; $i++) {
|
||||
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
|
||||
$cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2);
|
||||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td class="right nowraponall amount">';
|
||||
|
|
@ -466,7 +466,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -474,7 +474,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -494,7 +494,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -551,11 +551,11 @@ if ($resql) {
|
|||
print '</td>';
|
||||
|
||||
for ($i = 2; $i <= 13; $i++) {
|
||||
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
|
||||
$cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2);
|
||||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td class="right nowraponall amount">';
|
||||
|
|
@ -590,7 +590,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td lass="left">'.$langs->trans("TotalVente").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -600,7 +600,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
|
||||
$sql = "SELECT '".$db->escape($langs->trans("TotalVente"))."' AS total,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -650,7 +650,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("TotalMarge").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -662,7 +662,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
// With old situation invoice setup
|
||||
$sql = "SELECT '".$db->escape($langs->trans("Vide"))."' AS marge,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -684,7 +684,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
} else {
|
||||
$sql = "SELECT '".$db->escape($langs->trans("Vide"))."' AS marge,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ $search_country = GETPOST('search_country', 'alpha');
|
|||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -506,7 +506,7 @@ if ($result) {
|
|||
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI
|
|||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -660,7 +660,7 @@ if ($result) {
|
|||
// Description of line
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facture_static_det->desc, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $facture_static_det->desc);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -212,7 +212,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -233,7 +233,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -271,27 +271,27 @@ if ($resql) {
|
|||
print '</td>';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
$startmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||
$startmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||
if ($startmonth > 12) {
|
||||
$startmonth -= 12;
|
||||
}
|
||||
$startyear = ($startmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + 11;
|
||||
$startyear = ($startmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$endmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + 11;
|
||||
if ($endmonth > 12) {
|
||||
$endmonth -= 12;
|
||||
}
|
||||
$endyear = ($endmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endyear = ($endmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_date_startday=1&search_date_startmonth='.((int) $startmonth).'&search_date_startyear='.((int) $startyear).'&search_date_endday=&search_date_endmonth='.((int) $endmonth).'&search_date_endyear='.((int) $endyear), $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
print $row[1];
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 13; $i++) {
|
||||
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
|
||||
$cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2);
|
||||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td class="right nowraponall amount">';
|
||||
|
|
@ -333,7 +333,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -344,7 +344,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -421,7 +421,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="left">'.$langs->trans("Total").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -431,7 +431,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
|
||||
$sql = "SELECT '".$db->escape($langs->trans("TotalExpenseReport"))."' AS label,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ $search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_s
|
|||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -414,7 +414,7 @@ if ($result) {
|
|||
// Fees description -- Can be null
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDI
|
|||
}
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -489,7 +489,7 @@ if ($result) {
|
|||
// Fees description -- Can be null
|
||||
print '<td>';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->comments, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->comments);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -1305,7 +1305,7 @@ if (empty($action) || $action == 'view') {
|
|||
if (!getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE') || getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE') == '-1') {
|
||||
$accounttoshow = '<span class="error small">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
||||
} else {
|
||||
$accounttoshow = '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||
$accounttoshow = '<span class="warning small">'.$langs->trans('UnknownAccountForThirdparty', length_accountg(getDolGlobalString('ACCOUNTING_ACCOUNT_SUSPENSE'))).'</span>'; // We will use a waiting account
|
||||
}
|
||||
} else {
|
||||
// We will refuse writing
|
||||
|
|
@ -1396,7 +1396,8 @@ if (empty($action) || $action == 'view') {
|
|||
{
|
||||
print '<span class="error">'.$langs->trans("WaitAccountNotDefined").'</span>';
|
||||
}
|
||||
else */ print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
||||
else */
|
||||
print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
||||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
|
|
@ -1407,7 +1408,7 @@ if (empty($action) || $action == 'view') {
|
|||
else print length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE);
|
||||
*/
|
||||
print "</td>";
|
||||
print "<td>".$reflabel."</td>";
|
||||
print "<td>".dol_escape_htmltag($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>";
|
||||
|
|
|
|||
|
|
@ -162,8 +162,8 @@ if ($result) {
|
|||
$num = $db->num_rows($result);
|
||||
|
||||
// Variables
|
||||
$account_salary = (getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT')) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined';
|
||||
$account_vat = (getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT')) ? $conf->global->ACCOUNTING_VAT_BUY_ACCOUNT : 'NotDefined';
|
||||
$account_salary = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT', 'NotDefined');
|
||||
$account_vat = getDolGlobalString('ACCOUNTING_VAT_BUY_ACCOUNT', 'NotDefined');
|
||||
|
||||
$i = 0;
|
||||
while ($i < $num) {
|
||||
|
|
@ -247,7 +247,7 @@ if ($action == 'writebookkeeping' && !$error) {
|
|||
$error = 0;
|
||||
|
||||
$accountingaccountexpense = new AccountingAccount($db);
|
||||
$accountingaccountexpense->fetch(null, $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT, true);
|
||||
$accountingaccountexpense->fetch(null, getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'), true);
|
||||
|
||||
foreach ($taber as $key => $val) { // Loop on each expense report
|
||||
$errorforline = 0;
|
||||
|
|
@ -279,7 +279,7 @@ if ($action == 'writebookkeeping' && !$error) {
|
|||
$bookkeeping->subledger_account = $tabuser[$key]['user_accountancy_code'];
|
||||
$bookkeeping->subledger_label = $tabuser[$key]['name'];
|
||||
|
||||
$bookkeeping->numero_compte = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||
$bookkeeping->numero_compte = getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT');
|
||||
$bookkeeping->label_compte = $accountingaccountexpense->label;
|
||||
|
||||
$bookkeeping->label_operation = $tabuser[$key]['name'];
|
||||
|
|
@ -726,7 +726,7 @@ if (empty($action) || $action == 'view') {
|
|||
print "<td>".$expensereportstatic->getNomUrl(1)."</td>";
|
||||
// Account
|
||||
print "<td>";
|
||||
$accountoshow = length_accountg($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT);
|
||||
$accountoshow = length_accountg(getDolGlobalString('SALARIES_ACCOUNTING_ACCOUNT_PAYMENT'));
|
||||
if (($accountoshow == "") || $accountoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("MainAccountForUsersNotDefined").'</span>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -322,7 +322,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -330,7 +330,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -350,7 +350,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -393,27 +393,27 @@ if ($resql) {
|
|||
print '</td>';
|
||||
print '<td>';
|
||||
if ($row[0] == 'tobind') {
|
||||
$startmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1);
|
||||
$startmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1);
|
||||
if ($startmonth > 12) {
|
||||
$startmonth -= 12;
|
||||
}
|
||||
$startyear = ($startmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endmonth = ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + 11;
|
||||
$startyear = ($startmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$endmonth = getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + 11;
|
||||
if ($endmonth > 12) {
|
||||
$endmonth -= 12;
|
||||
}
|
||||
$endyear = ($endmonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$endyear = ($endmonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_date_startday=1&search_date_startmonth='.((int) $startmonth).'&search_date_startyear='.((int) $startyear).'&search_date_endday=&search_date_endmonth='.((int) $endmonth).'&search_date_endyear='.((int) $endyear), $langs->transnoentitiesnoconv("ToBind"));
|
||||
} else {
|
||||
print $row[1];
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 13; $i++) {
|
||||
$cursormonth = (($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) + $i - 2);
|
||||
$cursormonth = (getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) + $i - 2);
|
||||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td class="right nowraponall amount">';
|
||||
|
|
@ -454,7 +454,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><td class="minwidth100">'.$langs->trans("Account").'</td>';
|
||||
print '<td>'.$langs->trans("Label").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -462,7 +462,7 @@ for ($i = 1; $i <= 12; $i++) {
|
|||
if ($cursormonth > 12) {
|
||||
$cursormonth -= 12;
|
||||
}
|
||||
$cursoryear = ($cursormonth < ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1)) ? $y + 1 : $y;
|
||||
$cursoryear = ($cursormonth < getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1)) ? $y + 1 : $y;
|
||||
$tmp = dol_getdate(dol_get_last_day($cursoryear, $cursormonth, 'gmt'), false, 'gmt');
|
||||
|
||||
print '<td width="60" class="right">';
|
||||
|
|
@ -482,7 +482,7 @@ print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>'
|
|||
$sql = "SELECT ".$db->ifsql('aa.account_number IS NULL', "'tobind'", 'aa.account_number')." AS codecomptable,";
|
||||
$sql .= " ".$db->ifsql('aa.label IS NULL', "'tobind'", 'aa.label')." AS intitule,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -566,7 +566,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td>'.$langs->trans("Total").'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
@ -576,7 +576,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
|
|||
|
||||
$sql = "SELECT '".$db->escape($langs->trans("CAHTF"))."' AS label,";
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
|
||||
$j = $i + getDolGlobalInt('SOCIETE_FISCAL_MONTH_START', 1) - 1;
|
||||
if ($j > 12) {
|
||||
$j -= 12;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ $search_country = GETPOST('search_country', 'alpha');
|
|||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -536,7 +536,7 @@ if ($result) {
|
|||
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($objp->description, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ $search_country = GETPOST('search_country', 'alpha');
|
|||
$search_tvaintra = GETPOST('search_tvaintra', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : (!getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION') ? $conf->liste_limit : $conf->global->ACCOUNTING_LIMIT_LIST_VENTILATION);
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : getDolGlobalString('ACCOUNTING_LIMIT_LIST_VENTILATION', $conf->liste_limit);
|
||||
$sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
|
|
@ -119,7 +119,7 @@ if (!$user->hasRight('accounting', 'mouvements', 'lire')) {
|
|||
|
||||
// Define begin binding date
|
||||
if (empty($search_date_start) && getDolGlobalString('ACCOUNTING_DATE_START_BINDING')) {
|
||||
$search_date_start = $db->idate($conf->global->ACCOUNTING_DATE_START_BINDING);
|
||||
$search_date_start = $db->idate(getDolGlobalString('ACCOUNTING_DATE_START_BINDING'));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -687,7 +687,7 @@ if ($result) {
|
|||
// Description of line
|
||||
print '<td class="tdoverflowonsmartphone small">';
|
||||
$text = dolGetFirstLineOfText(dol_string_nohtmltag($facturefourn_static_det->desc, 1));
|
||||
$trunclength = !getDolGlobalString('ACCOUNTING_LENGTH_DESCRIPTION') ? 32 : $conf->global->ACCOUNTING_LENGTH_DESCRIPTION;
|
||||
$trunclength = getDolGlobalInt('ACCOUNTING_LENGTH_DESCRIPTION', 32);
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $facturefourn_static_det->desc);
|
||||
print '</td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ if ($action == 'updateMask') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
@ -279,7 +279,7 @@ if ($action == 'edit') {
|
|||
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (isModEnabled("product") || isModEnabled("service")) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$selected = getDolGlobalString($constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ foreach ($eventstolog as $key => $arr) {
|
|||
print '<td>'.$arr['id'].'</td>';
|
||||
print '<td class="center">';
|
||||
$key = 'MAIN_LOGEVENTS_'.$arr['id'];
|
||||
$value = empty($conf->global->$key) ? '' : $conf->global->$key;
|
||||
$value = getDolGlobalString($key);
|
||||
print '<input class="oddeven checkforselect" type="checkbox" name="'.$key.'" value="1"'.($value ? ' checked' : '').'>';
|
||||
print '</td></tr>'."\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ if ($resql) {
|
|||
//print "x".$idrss;
|
||||
|
||||
$rssparser = new RssParser($db);
|
||||
$result = $rssparser->parser($conf->global->$keyrssurl, 5, 300, $conf->externalrss->dir_temp);
|
||||
$result = $rssparser->parser(getDolGlobalString($keyrssurl), 5, 300, $conf->externalrss->dir_temp);
|
||||
|
||||
print "<br>";
|
||||
print '<form name="externalrssconfig" action="'.$_SERVER["PHP_SELF"].'" method="post">'."\n";
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ if (empty($conf->use_javascript_ajax)) {
|
|||
}
|
||||
print '</td>';
|
||||
print '<td class="center centpercent width100">';
|
||||
$value = (isset($conf->global->$constante) ? $conf->global->$constante : 0);
|
||||
$value = getDolGlobalInt($constante, 0);
|
||||
if ($value == 0) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=enable_'.strtolower($const).'&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
|
||||
} elseif ($value == 1) {
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ if ($action == 'update') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'HRMTEST_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
@ -549,7 +549,7 @@ if ($action == 'edit') {
|
|||
print dolJSToSetRandomPassword($constname, 'generate_token' . $constname);
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (isModEnabled('product') || isModEnabled('service')) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$selected = getDolGlobalString($constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ if ($action == 'updateMask') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'KNOWLEDGEMANAGEMENT_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_CONTACTS', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_GROUPS', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_MEMBERS', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_MEMBERS_TYPES', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ if ($action == 'setvalue' && $user->admin) {
|
|||
$valkey = '';
|
||||
$key = GETPOST("key");
|
||||
if ($key) {
|
||||
$valkey = $conf->global->$key;
|
||||
$valkey = getDolGlobalString($key);
|
||||
}
|
||||
if (!dolibarr_set_const($db, 'LDAP_KEY_USERS', $valkey, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
|
|
|||
|
|
@ -851,7 +851,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
|||
}
|
||||
|
||||
// Activate/Disable and Setup (2 columns)
|
||||
if (!empty($conf->global->$const_name)) { // If module is already activated
|
||||
if (getDolGlobalString($const_name)) { // If module is already activated
|
||||
// Set $codeenabledisable
|
||||
$disableSetup = 0;
|
||||
if (!empty($arrayofwarnings[$modName])) {
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
|||
}
|
||||
|
||||
$param = 'NOTIFICATION_FIXEDEMAIL_'.$notifiedevent['code'].'_THRESHOLD_HIGHER_'.$reg[1];
|
||||
$value = GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key') ? GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key', 'alpha') : $conf->global->$param;
|
||||
$value = GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key') ? GETPOST('NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key', 'alpha') : getDolGlobalString($param);
|
||||
|
||||
$s = '<input type="text" class="minwidth200" name="NOTIF_'.$notifiedevent['code'].'_old_'.$reg[1].'_key" value="'.dol_escape_htmltag($value).'">'; // Do not use type="email" here, we must be able to enter a list of email with , separator.
|
||||
$arrayemail = explode(',', $value);
|
||||
|
|
@ -464,7 +464,7 @@ foreach ($listofnotifiedevents as $notifiedevent) {
|
|||
$showwarning++;
|
||||
}
|
||||
}
|
||||
if ((!empty($conf->global->$param)) && $showwarning) {
|
||||
if (getDolGlobalString($param) && $showwarning) {
|
||||
$s .= ' '.img_warning($langs->trans("ErrorBadEMail"));
|
||||
}
|
||||
print $form->textwithpicto($s, $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients").'<br>'.$langs->trans("YouCanAlsoUseSupervisorKeyword"), 1, 'help', '', 0, 2);
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ for ($i = 1; $i <= 6; $i++) {
|
|||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff($keyforconstant);
|
||||
} else {
|
||||
print $form->selectyesno($keyforconstant, isset($conf->global->$keyforconstant) ? $conf->global->$keyforconstant : 0, 1, $noCountryCode);
|
||||
print $form->selectyesno($keyforconstant, getDolGlobalString($keyforconstant, 0), 1, $noCountryCode);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,8 +232,8 @@ foreach ($syslogModules as $moduleName) {
|
|||
if (!empty($tmpoption)) {
|
||||
if (GETPOSTISSET($tmpoption)) {
|
||||
$value = GETPOST($tmpoption);
|
||||
} elseif (!empty($conf->global->$tmpoption)) {
|
||||
$value = $conf->global->$tmpoption;
|
||||
} elseif (getDolGlobalString($tmpoption)) {
|
||||
$value = getDolGlobalString($tmpoption);
|
||||
}
|
||||
} else {
|
||||
$value = (isset($option['default']) ? $option['default'] : '');
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ if ($action == 'updateMask') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'WEBHOOK_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
@ -270,7 +270,7 @@ if ($action == 'edit') {
|
|||
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (isModEnabled("product") || isModEnabled("service")) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$selected = getDolGlobalString($constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -447,7 +447,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if ($conf->global->$constforvar == $file) {
|
||||
if (getDolGlobalString($constforvar) == $file) {
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
|
||||
|
|
@ -589,7 +589,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
|
|||
// Default
|
||||
print '<td class="center">';
|
||||
$constforvar = 'WEBHOOK_'.strtoupper($myTmpObjectKey).'_ADDON';
|
||||
if ($conf->global->$constforvar == $name) {
|
||||
if (getDolGlobalString($constforvar) == $name) {
|
||||
//print img_picto($langs->trans("Default"), 'on');
|
||||
// Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
|
||||
|
|
|
|||
|
|
@ -315,7 +315,7 @@ foreach ($workflowcodes as $key => $params) {
|
|||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ajax_constantonoff($key);
|
||||
} else {
|
||||
if (!empty($conf->global->$key)) {
|
||||
if (getDolGlobalString($key)) {
|
||||
print '<a class="reposition" href="'.$_SERVER['PHP_SELF'].'?action=del'.$key.'&token='.newToken().'">';
|
||||
print img_picto($langs->trans("Activated"), 'switch_on');
|
||||
print '</a>';
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ if ($action == 'updateMask') {
|
|||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
$constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2037,8 +2037,8 @@ class Setup extends DolibarrApi
|
|||
$xmlremote = $conf->global->MAIN_FILECHECK_URL;
|
||||
}
|
||||
$param = 'MAIN_FILECHECK_URL_'.DOL_VERSION;
|
||||
if (empty($xmlremote) && !empty($conf->global->$param)) {
|
||||
$xmlremote = $conf->global->$param;
|
||||
if (empty($xmlremote) && getDolGlobalString($param)) {
|
||||
$xmlremote = getDolGlobalString($param);
|
||||
}
|
||||
if (empty($xmlremote)) {
|
||||
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
||||
|
|
@ -2098,7 +2098,7 @@ class Setup extends DolibarrApi
|
|||
// Value found
|
||||
$value = '';
|
||||
if ($constname && getDolGlobalString($constname) != '') {
|
||||
$value = $conf->global->$constname;
|
||||
$value = getDolGlobalString($constname);
|
||||
}
|
||||
$valueforchecksum = (empty($value) ? '0' : $value);
|
||||
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ if ($action == 'updateMask') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'ASSET_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -590,7 +590,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMProductsList'), '', 'product');
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '') . '" method="POST">
|
||||
print ' <form name="addproduct" id="listbomproducts" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '') . '" method="POST">
|
||||
<input type="hidden" name="token" value="' . newToken() . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
|
||||
<input type="hidden" name="mode" value="">
|
||||
|
|
@ -642,7 +642,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
print ($res == 0 && $object->status >= $object::STATUS_VALIDATED) ? '' : load_fiche_titre($langs->trans('BOMServicesList'), '', 'service');
|
||||
|
||||
print ' <form name="addservice" id="addservice" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '') . '" method="POST">
|
||||
print ' <form name="addservice" id="listbomservices" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . (($action != 'editline') ? '' : '') . '" method="POST">
|
||||
<input type="hidden" name="token" value="' . newToken() . '">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline') . '">
|
||||
<input type="hidden" name="mode" value="">
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ if ($filtertype != 1) {
|
|||
print '<td class="linecolworkstation nowrap right">';
|
||||
$coldisplay++;
|
||||
if ($res > 0) {
|
||||
echo $workstation->getNomUrl();
|
||||
echo $workstation->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ if ($action == 'updateMask') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'BOOKCAL_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,31 +148,45 @@ if ($object->id > 0) {
|
|||
|
||||
print dol_get_fiche_head($head, 'documents', $langs->trans("Action"), -1, 'action');
|
||||
|
||||
$linkback = img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Link to other agenda views
|
||||
$out = '';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
$linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("BackToList").'</span>';
|
||||
$linkback .= '</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
|
||||
$linkback .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewCal").'</span>';
|
||||
$linkback .= '</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
|
||||
$linkback .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewWeek").'</span>';
|
||||
$linkback .= '</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
|
||||
$linkback .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewDay").'</span>';
|
||||
$linkback .= '</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
|
||||
$linkback .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewPerUser").'</span>';
|
||||
$linkback .= '</a>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$out .= $hookmanager->resPrint;
|
||||
$linkback .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 1) {
|
||||
$out = $hookmanager->resPrint;
|
||||
$linkback = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
$linkback .= $out;
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
// Thirdparty
|
||||
//$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||
|
|
|
|||
|
|
@ -72,31 +72,45 @@ $object->info($object->id);
|
|||
$head = actions_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'info', $langs->trans("Action"), -1, 'action');
|
||||
|
||||
$linkback = img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
// Link to other agenda views
|
||||
$out = '';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
$linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("BackToList").'</span>';
|
||||
$linkback .= '</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
|
||||
$linkback .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewCal").'</span>';
|
||||
$linkback .= '</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
|
||||
$linkback .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewWeek").'</span>';
|
||||
$linkback .= '</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
|
||||
$linkback .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewDay").'</span>';
|
||||
$linkback .= '</a>';
|
||||
$linkback .= '</li>';
|
||||
$linkback .= '<li class="noborder litext">';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
|
||||
$linkback .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("ViewPerUser").'</span>';
|
||||
$linkback .= '</a>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
if (empty($reshook)) {
|
||||
$out .= $hookmanager->resPrint;
|
||||
$linkback .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 1) {
|
||||
$out = $hookmanager->resPrint;
|
||||
$linkback = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
$linkback .= $out;
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
|
|
|
|||
|
|
@ -538,8 +538,8 @@ if ($object->id > 0) {
|
|||
print '</td><td>';
|
||||
print $object->price_level;
|
||||
$keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$object->price_level;
|
||||
if (!empty($conf->global->$keyforlabel)) {
|
||||
print ' - '.$langs->trans($conf->global->$keyforlabel);
|
||||
if (getDolGlobalString($keyforlabel)) {
|
||||
print ' - '.$langs->trans(getDolGlobalString($keyforlabel));
|
||||
}
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ if ($_socid > 0) {
|
|||
}
|
||||
print '>'.$i;
|
||||
$keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$i;
|
||||
if (!empty($conf->global->$keyforlabel)) {
|
||||
print ' - '.$langs->trans($conf->global->$keyforlabel);
|
||||
if (getDolGlobalString($keyforlabel)) {
|
||||
print ' - '.$langs->trans(getDolGlobalString($keyforlabel));
|
||||
}
|
||||
print '</option>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -281,10 +281,10 @@ if ($resql) {
|
|||
}
|
||||
$transactionspertype[$objp->code] += 1;
|
||||
} else {
|
||||
if ($conf->global->$var1 == $bankaccount->id) {
|
||||
if (getDolGlobalString($var1) == $bankaccount->id) {
|
||||
$cash += $objp->amount;
|
||||
// } elseif ($conf->global->$var2 == $bankaccount->id) $bank+=$objp->amount;
|
||||
//elseif ($conf->global->$var3 == $bankaccount->id) $cheque+=$objp->amount;
|
||||
// } elseif (getDolGlobalString($var2) == $bankaccount->id) $bank+=$objp->amount;
|
||||
//elseif (getDolGlobalString($var3) == $bankaccount->id) $cheque+=$objp->amount;
|
||||
if (empty($transactionspertype['CASH'])) {
|
||||
$transactionspertype['CASH'] = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3925,9 +3925,9 @@ if ($action == 'create') {
|
|||
if (getDolGlobalString('INVOICE_USE_DEFAULT_DOCUMENT')) {
|
||||
// Hidden conf
|
||||
$paramkey = 'FACTURE_ADDON_PDF_'.$object->type;
|
||||
$preselected = !empty($conf->global->$paramkey) ? $conf->global->$paramkey : $conf->global->FACTURE_ADDON_PDF;
|
||||
$preselected = getDolGlobalString($paramkey, getDolGlobalString('FACTURE_ADDON_PDF'));
|
||||
} else {
|
||||
$preselected = $conf->global->FACTURE_ADDON_PDF;
|
||||
$preselected = getDolGlobalString('FACTURE_ADDON_PDF');
|
||||
}
|
||||
print $form->selectarray('model', $liste, $preselected, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth200 widthcentpercentminusx', 1);
|
||||
print "</td></tr>";
|
||||
|
|
|
|||
|
|
@ -1689,10 +1689,10 @@ class Facture extends CommonInvoice
|
|||
|
||||
$modelByTypeConfName = 'FACTURE_ADDON_PDF_' . $deposit->type;
|
||||
|
||||
if (!empty($conf->global->$modelByTypeConfName)) {
|
||||
$deposit->model_pdf = $conf->global->$modelByTypeConfName;
|
||||
if (getDolGlobalString($modelByTypeConfName)) {
|
||||
$deposit->model_pdf = getDolGlobalString($modelByTypeConfName);
|
||||
} elseif (getDolGlobalString('FACTURE_ADDON_PDF')) {
|
||||
$deposit->model_pdf = $conf->global->FACTURE_ADDON_PDF;
|
||||
$deposit->model_pdf = getDolGlobalString('FACTURE_ADDON_PDF');
|
||||
}
|
||||
|
||||
if (!getDolGlobalString('MAIN_DISABLE_PROPAGATE_NOTES_FROM_ORIGIN')) {
|
||||
|
|
@ -3270,7 +3270,7 @@ class Facture extends CommonInvoice
|
|||
|
||||
// Check for mandatory
|
||||
$keymandatory = 'INVOICE_'.$key.'_MANDATORY_FOR_VALIDATION';
|
||||
if (!$vallabel && !empty($conf->global->$keymandatory)) {
|
||||
if (!$vallabel && getDolGlobalString($keymandatory)) {
|
||||
$langs->load("errors");
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv($val)), null, 'errors');
|
||||
|
|
@ -5219,8 +5219,8 @@ class Facture extends CommonInvoice
|
|||
|
||||
if (!empty($this->model_pdf)) {
|
||||
$modele = $this->model_pdf;
|
||||
} elseif (!empty($conf->global->$thisTypeConfName)) {
|
||||
$modele = $conf->global->$thisTypeConfName;
|
||||
} elseif (getDolGlobalString($thisTypeConfName)) {
|
||||
$modele = getDolGlobalString($thisTypeConfName);
|
||||
} elseif (getDolGlobalString('FACTURE_ADDON_PDF')) {
|
||||
$modele = $conf->global->FACTURE_ADDON_PDF;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ if (empty($reshook)) {
|
|||
*/
|
||||
if ($action == 'create' && $permissiontocreate) {
|
||||
$default_account = ($type == 'bank-transfer' ? 'PAYMENTBYBANKTRANSFER_ID_BANKACCOUNT' : 'PRELEVEMENT_ID_BANKACCOUNT');
|
||||
//var_dump($default_account);var_dump($conf->global->$default_account);var_dump($id_bankaccount);exit;
|
||||
//var_dump($default_account);var_dump(getDolGlobalString($default_account));var_dump($id_bankaccount);exit;
|
||||
|
||||
if ($id_bankaccount != getDolGlobalInt($default_account)) {
|
||||
$res = dolibarr_set_const($db, $default_account, $id_bankaccount, 'chaine', 0, '', $conf->entity); // Set as default
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
|||
} elseif ($object->fields[$key]['type'] == 'datetime') {
|
||||
$value = dol_mktime(GETPOST($key.'hour', 'int'), GETPOST($key.'min', 'int'), GETPOST($key.'sec', 'int'), GETPOST($key.'month', 'int'), GETPOST($key.'day', 'int'), GETPOST($key.'year', 'int'), 'tzuserrel');
|
||||
} elseif ($object->fields[$key]['type'] == 'duration') {
|
||||
$value = 60 * 60 * GETPOST($key.'hour', 'int') + 60 * GETPOST($key.'min', 'int');
|
||||
$value = 60 * 60 * GETPOSTINT($key.'hour') + 60 * GETPOSTINT($key.'min');
|
||||
} elseif (preg_match('/^(integer|price|real|double)/', $object->fields[$key]['type'])) {
|
||||
$value = price2num(GETPOST($key, 'alphanohtml')); // To fix decimal separator according to lang setup
|
||||
} elseif ($object->fields[$key]['type'] == 'boolean') {
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ class box_external_rss extends ModeleBoxes
|
|||
$keyforparamtitle = "EXTERNAL_RSS_TITLE_".$site;
|
||||
|
||||
// Get RSS feed
|
||||
$url = $conf->global->$keyforparamurl;
|
||||
$url = getDolGlobalString($keyforparamurl);
|
||||
|
||||
$rssparser = new RssParser($this->db);
|
||||
$result = $rssparser->parser($url, $this->max, $cachedelay, $conf->externalrss->dir_temp);
|
||||
|
|
@ -98,7 +98,7 @@ class box_external_rss extends ModeleBoxes
|
|||
$description = $rssparser->getDescription();
|
||||
$link = $rssparser->getLink();
|
||||
|
||||
$title = $langs->trans("BoxTitleLastRssInfos", $max, $conf->global->$keyforparamtitle);
|
||||
$title = $langs->trans("BoxTitleLastRssInfos", $max, getDolGlobalString($keyforparamtitle));
|
||||
if ($result < 0 || !empty($rssparser->error)) {
|
||||
// Show warning
|
||||
$errormessage = $langs->trans("FailedToRefreshDataInfoNotUpToDate", ($rssparser->getLastFetchDate() ? dol_print_date($rssparser->getLastFetchDate(), "dayhourtext") : $langs->trans("Unknown")));
|
||||
|
|
|
|||
|
|
@ -780,12 +780,12 @@ class CMailFile
|
|||
}
|
||||
|
||||
// Force parameters
|
||||
//dol_syslog("CMailFile::sendfile conf->global->".$keyforsmtpserver."=".$conf->global->$keyforsmtpserver." cpnf->global->".$keyforsmtpport."=".$conf->global->$keyforsmtpport, LOG_DEBUG);
|
||||
if (!empty($conf->global->$keyforsmtpserver)) {
|
||||
ini_set('SMTP', $conf->global->$keyforsmtpserver);
|
||||
//dol_syslog("CMailFile::sendfile conf->global->".$keyforsmtpserver."=".getDolGlobalString($keyforsmtpserver)." cpnf->global->".$keyforsmtpport."=".$conf->global->$keyforsmtpport, LOG_DEBUG);
|
||||
if (getDolGlobalString($keyforsmtpserver)) {
|
||||
ini_set('SMTP', getDolGlobalString($keyforsmtpserver));
|
||||
}
|
||||
if (!empty($conf->global->$keyforsmtpport)) {
|
||||
ini_set('smtp_port', $conf->global->$keyforsmtpport);
|
||||
if (getDolGlobalString($keyforsmtpport)) {
|
||||
ini_set('smtp_port', getDolGlobalString($keyforsmtpport));
|
||||
}
|
||||
|
||||
$res = true;
|
||||
|
|
@ -869,10 +869,10 @@ class CMailFile
|
|||
}
|
||||
|
||||
// Restore parameters
|
||||
if (!empty($conf->global->$keyforsmtpserver)) {
|
||||
if (getDolGlobalString($keyforsmtpserver)) {
|
||||
ini_restore('SMTP');
|
||||
}
|
||||
if (!empty($conf->global->$keyforsmtpport)) {
|
||||
if (getDolGlobalString($keyforsmtpport)) {
|
||||
ini_restore('smtp_port');
|
||||
}
|
||||
} elseif ($this->sendmode == 'smtps') {
|
||||
|
|
@ -1059,7 +1059,7 @@ class CMailFile
|
|||
}
|
||||
|
||||
// If we use SSL/TLS
|
||||
$server = $conf->global->$keyforsmtpserver;
|
||||
$server = getDolGlobalString($keyforsmtpserver);
|
||||
$secure = '';
|
||||
if (!empty($conf->global->$keyfortls) && function_exists('openssl_open')) {
|
||||
$secure = 'ssl';
|
||||
|
|
@ -1068,7 +1068,7 @@ class CMailFile
|
|||
$secure = 'tls';
|
||||
}
|
||||
|
||||
$this->transport = new Swift_SmtpTransport($server, $conf->global->$keyforsmtpport, $secure);
|
||||
$this->transport = new Swift_SmtpTransport($server, getDolGlobalString($keyforsmtpport), $secure);
|
||||
|
||||
if (!empty($conf->global->$keyforsmtpid)) {
|
||||
$this->transport->setUsername($conf->global->$keyforsmtpid);
|
||||
|
|
|
|||
|
|
@ -3659,7 +3659,7 @@ abstract class CommonObject
|
|||
}
|
||||
|
||||
if (!empty($MODULE)) {
|
||||
if (!empty($conf->global->$MODULE)) {
|
||||
if (getDolGlobalString($MODULE)) {
|
||||
$modsactivated = explode(',', getDolGlobalString($MODULE));
|
||||
foreach ($modsactivated as $mod) {
|
||||
if (isModEnabled($mod)) {
|
||||
|
|
@ -5661,8 +5661,8 @@ abstract class CommonObject
|
|||
// If generator is ODT, we must have srctemplatepath defined, if not we set it.
|
||||
if ($obj->type == 'odt' && empty($srctemplatepath)) {
|
||||
$varfortemplatedir = $obj->scandir;
|
||||
if ($varfortemplatedir && !empty($conf->global->$varfortemplatedir)) {
|
||||
$dirtoscan = $conf->global->$varfortemplatedir;
|
||||
if ($varfortemplatedir && getDolGlobalString($varfortemplatedir)) {
|
||||
$dirtoscan = getDolGlobalString($varfortemplatedir);
|
||||
|
||||
$listoffiles = array();
|
||||
|
||||
|
|
@ -5970,8 +5970,8 @@ abstract class CommonObject
|
|||
|
||||
$keyforfieldname = strtoupper($newelement.'_DEFAULT_'.$fieldname);
|
||||
//var_dump($keyforfieldname);
|
||||
if (isset($conf->global->$keyforfieldname)) {
|
||||
return $conf->global->$keyforfieldname;
|
||||
if (getDolGlobalString($keyforfieldname)) {
|
||||
return getDolGlobalString($keyforfieldname);
|
||||
}
|
||||
|
||||
// TODO Ad here a scan into table llx_overwrite_default with a filter on $this->element and $fieldname
|
||||
|
|
|
|||
|
|
@ -195,6 +195,7 @@ class DolEditor
|
|||
/* property:xxx is same than CKEDITOR.config.property = xxx */
|
||||
customConfig: ckeditorConfig,
|
||||
removePlugins: \''.dol_escape_js($pluginstodisable).'\',
|
||||
versionCheck: false,
|
||||
readOnly: '.($this->readonly ? 'true' : 'false').',
|
||||
htmlEncodeOutput: '.dol_escape_js($htmlencode_force).',
|
||||
allowedContent: '.($disallowAnyContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is own when allowedContent is false */
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ class ExtraFields
|
|||
* This is a private method. For public method, use addExtraField.
|
||||
*
|
||||
* @param string $attrname code of attribute
|
||||
* @param int $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datehour','price','pricecy','phone','mail','password','url','select','checkbox', ...)
|
||||
* @param string $type Type of attribute ('boolean', 'int', 'varchar', 'text', 'html', 'date', 'datehour','price','pricecy','phone','mail','password','url','select','checkbox', ...)
|
||||
* @param string $length Size/length of attribute ('5', '24,8', ...)
|
||||
* @param string $elementtype Element type ('member', 'product', 'thirdparty', 'contact', ...)
|
||||
* @param int $unique Is field unique or not
|
||||
|
|
@ -199,7 +199,7 @@ class ExtraFields
|
|||
* @param array $moreparams More parameters. Example: array('css'=>, 'csslist'=>, 'cssview'=>...)
|
||||
* @return int Return integer <=0 if KO, >0 if OK
|
||||
*/
|
||||
private function create($attrname, $type = 'varchar', $length = 255, $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = '', $perms = '', $list = '0', $computed = '', $help = '', $moreparams = array())
|
||||
private function create($attrname, $type = 'varchar', $length = '255', $elementtype = 'member', $unique = 0, $required = 0, $default_value = '', $param = array(), $perms = '', $list = '0', $computed = '', $help = '', $moreparams = array())
|
||||
{
|
||||
if ($elementtype == 'thirdparty') {
|
||||
$elementtype = 'societe';
|
||||
|
|
@ -281,7 +281,7 @@ class ExtraFields
|
|||
*
|
||||
* @param string $attrname code of attribute
|
||||
* @param string $label label of attribute
|
||||
* @param int $type Type of attribute ('int', 'varchar', 'text', 'html', 'date', 'datehour', 'float')
|
||||
* @param string $type Type of attribute ('int', 'varchar', 'text', 'html', 'date', 'datehour', 'float')
|
||||
* @param int $pos Position of attribute
|
||||
* @param string $size Size/length of attribute ('5', '24,8', ...)
|
||||
* @param string $elementtype Element type ('member', 'product', 'thirdparty', ...)
|
||||
|
|
@ -303,7 +303,7 @@ class ExtraFields
|
|||
* @return int Return integer <=0 if KO, >0 if OK
|
||||
* @throws Exception
|
||||
*/
|
||||
private function create_label($attrname, $label = '', $type = '', $pos = 0, $size = 0, $elementtype = 'member', $unique = 0, $required = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
|
||||
private function create_label($attrname, $label = '', $type = '', $pos = 0, $size = '', $elementtype = 'member', $unique = 0, $required = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '-1', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
|
@ -551,7 +551,7 @@ class ExtraFields
|
|||
* @return int >0 if OK, <=0 if KO
|
||||
* @throws Exception
|
||||
*/
|
||||
public function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
|
||||
public function update($attrname, $label, $type, $length, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = array(), $alwayseditable = 0, $perms = '', $list = '', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
|
||||
{
|
||||
global $action, $hookmanager;
|
||||
|
||||
|
|
@ -676,7 +676,7 @@ class ExtraFields
|
|||
* @return int Return integer <=0 if KO, >0 if OK
|
||||
* @throws Exception
|
||||
*/
|
||||
private function update_label($attrname, $label, $type, $size, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = '', $alwayseditable = 0, $perms = '', $list = '0', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
|
||||
private function update_label($attrname, $label, $type, $size, $elementtype, $unique = 0, $required = 0, $pos = 0, $param = array(), $alwayseditable = 0, $perms = '', $list = '0', $help = '', $default = '', $computed = '', $entity = '', $langfile = '', $enabled = '1', $totalizable = 0, $printable = 0, $moreparams = array())
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $user;
|
||||
|
|
@ -934,7 +934,7 @@ class ExtraFields
|
|||
* @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric)
|
||||
* @param int $objectid Current object id
|
||||
* @param string $extrafieldsobjectkey The key to use to store retreived data (commonly $object->table_element)
|
||||
* @param string $mode 1=Used for search filters
|
||||
* @param int $mode 1=Used for search filters
|
||||
* @return string
|
||||
*/
|
||||
public function showInputField($key, $value, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $extrafieldsobjectkey = '', $mode = 0)
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class ExtraLanguages
|
|||
* @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names)
|
||||
* @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric)
|
||||
* @param int $objectid Current object id
|
||||
* @param string $mode 1=Used for search filters
|
||||
* @param int $mode 1=Used for search filters
|
||||
* @return string
|
||||
*/
|
||||
public function showInputField($key, $value, $extrafieldsobjectkey, $moreparam = '', $keysuffix = '', $keyprefix = '', $morecss = '', $objectid = 0, $mode = 0)
|
||||
|
|
|
|||
|
|
@ -463,9 +463,9 @@ class Fiscalyear extends CommonObject
|
|||
/**
|
||||
* Return the number of entries by fiscal year
|
||||
*
|
||||
* @param int $datestart Date start to scan
|
||||
* @param int $dateend Date end to scan
|
||||
* @return string Number of entries
|
||||
* @param int|string $datestart Date start to scan
|
||||
* @param int|string $dateend Date end to scan
|
||||
* @return string Number of entries
|
||||
*/
|
||||
public function getAccountancyEntriesByFiscalYear($datestart = '', $dateend = '')
|
||||
{
|
||||
|
|
@ -497,8 +497,8 @@ class Fiscalyear extends CommonObject
|
|||
/**
|
||||
* Return the number of movements by fiscal year
|
||||
*
|
||||
* @param int $datestart Date start to scan
|
||||
* @param int $dateend Date end to scan
|
||||
* @param int|string $datestart Date start to scan
|
||||
* @param int|string $dateend Date end to scan
|
||||
* @return string Number of movements
|
||||
*/
|
||||
public function getAccountancyMovementsByFiscalYear($datestart = '', $dateend = '')
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ class HookManager
|
|||
* All types can also return some values into an array ->results that will be finaly merged into this->resArray for caller.
|
||||
* $this->error or this->errors are also defined by class called by this function if error.
|
||||
*/
|
||||
public function executeHooks($method, $parameters = array(), &$object = '', &$action = '')
|
||||
public function executeHooks($method, $parameters = array(), &$object = null, &$action = '')
|
||||
{
|
||||
if (!is_array($this->hooks) || empty($this->hooks)) {
|
||||
return 0; // No hook available, do nothing.
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class DoliDBMysqli extends DoliDB
|
|||
* Constructor.
|
||||
* This create an opened connexion to a database server and eventually to a database
|
||||
*
|
||||
* @param string $type Type of database (mysql, pgsql...)
|
||||
* @param string $type Type of database (mysql, pgsql...). Not used.
|
||||
* @param string $host Address of database server
|
||||
* @param string $user Name of database user
|
||||
* @param string $pass Password of database user
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class DoliDBPgsql extends DoliDB
|
|||
* Constructor.
|
||||
* This create an opened connexion to a database server and eventually to a database
|
||||
*
|
||||
* @param string $type Type of database (mysql, pgsql...)
|
||||
* @param string $type Type of database (mysql, pgsql...). Not used.
|
||||
* @param string $host Address of database server
|
||||
* @param string $user Nom de l'utilisateur autorise
|
||||
* @param string $pass Mot de passe
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class DoliDBSqlite3 extends DoliDB
|
|||
* Constructor.
|
||||
* This create an opened connexion to a database server and eventually to a database
|
||||
*
|
||||
* @param string $type Type of database (mysql, pgsql...)
|
||||
* @param string $type Type of database (mysql, pgsql...). Not used.
|
||||
* @param string $host Address of database server
|
||||
* @param string $user Nom de l'utilisateur autorise
|
||||
* @param string $pass Mot de passe
|
||||
|
|
|
|||
|
|
@ -151,7 +151,6 @@ function getMultidirOutput($object, $module = '')
|
|||
function getDolGlobalString($key, $default = '')
|
||||
{
|
||||
global $conf;
|
||||
// return $conf->global->$key ?? $default;
|
||||
return (string) (isset($conf->global->$key) ? $conf->global->$key : $default);
|
||||
}
|
||||
|
||||
|
|
@ -166,7 +165,6 @@ function getDolGlobalString($key, $default = '')
|
|||
function getDolGlobalInt($key, $default = 0)
|
||||
{
|
||||
global $conf;
|
||||
// return $conf->global->$key ?? $default;
|
||||
return (int) (isset($conf->global->$key) ? $conf->global->$key : $default);
|
||||
}
|
||||
|
||||
|
|
@ -185,7 +183,6 @@ function getDolUserString($key, $default = '', $tmpuser = null)
|
|||
$tmpuser = $user;
|
||||
}
|
||||
|
||||
// return $conf->global->$key ?? $default;
|
||||
return (string) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key);
|
||||
}
|
||||
|
||||
|
|
@ -204,7 +201,6 @@ function getDolUserInt($key, $default = 0, $tmpuser = null)
|
|||
$tmpuser = $user;
|
||||
}
|
||||
|
||||
// return $conf->global->$key ?? $default;
|
||||
return (int) (empty($tmpuser->conf->$key) ? $default : $tmpuser->conf->$key);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1893,8 +1893,7 @@ function getListOfModels($db, $type, $maxfilenamelength = 0)
|
|||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$const = $obj->description;
|
||||
//irtoscan.=($dirtoscan?',':'').preg_replace('/[\r\n]+/',',',trim($conf->global->$const));
|
||||
$dirtoscan = preg_replace('/[\r\n]+/', ',', trim($conf->global->$const));
|
||||
$dirtoscan = preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString($const)));
|
||||
|
||||
$listoffiles = array();
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,8 @@ ToProduce=To produce
|
|||
ToObtain=To obtain
|
||||
QtyAlreadyConsumed=Qty already consumed
|
||||
QtyAlreadyProduced=Qty already produced
|
||||
QtyAlreadyConsumedShort=Qty consumed
|
||||
QtyAlreadyProducedShort=Qty produced
|
||||
QtyRequiredIfNoLoss=Qty required to produce the quantity defined into the BOM if there is no loss (if the manufacturing efficiency is 100%%)
|
||||
ConsumeOrProduce=Consume or Produce
|
||||
ConsumeAndProduceAll=Consume and Produce All
|
||||
|
|
|
|||
|
|
@ -560,6 +560,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
}
|
||||
|
||||
/*
|
||||
// Disable / Enable
|
||||
if ($permissiontoadd) {
|
||||
if ($object->status == $object::STATUS_ENABLED) {
|
||||
print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd);
|
||||
|
|
|
|||
|
|
@ -1757,19 +1757,18 @@ class Mo extends CommonObject
|
|||
*/
|
||||
public function printOriginLine($line, $var, $restrictlist = '', $defaulttpldir = '/core/tpl', $selectedLines = array())
|
||||
{
|
||||
global $langs, $conf;
|
||||
$productstatic = new Product($this->db);
|
||||
|
||||
$this->tpl['id'] = $line->id;
|
||||
|
||||
$this->tpl['label'] = '';
|
||||
if (!empty($line->fk_product)) {
|
||||
$productstatic = new Product($this->db);
|
||||
if (!empty($line->fk_product) && $line->fk_product > 0) {
|
||||
$productstatic->fetch($line->fk_product);
|
||||
$productstatic->load_virtual_stock();
|
||||
$this->tpl['label'] .= $productstatic->getNomUrl(1);
|
||||
//$this->tpl['label'].= ' - '.$productstatic->label;
|
||||
} else {
|
||||
// If origin MRP line is not a product, but another MRP
|
||||
// If origin MO line is not a product, but another MO
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
|
@ -1787,8 +1786,8 @@ class Mo extends CommonObject
|
|||
$this->tpl['disable_stock_change'] = $line->disable_stock_change;
|
||||
$this->tpl['efficiency'] = $line->efficiency;
|
||||
|
||||
$tpl = DOL_DOCUMENT_ROOT.'/mrp/tpl/originproductline.tpl.php';
|
||||
$res = include $tpl;
|
||||
global $conf; // used into template
|
||||
$res = include DOL_DOCUMENT_ROOT.'/mrp/tpl/originproductline.tpl.php';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -428,6 +428,7 @@ if ($action == 'create') {
|
|||
if ($objectbom->id > 0) {
|
||||
print load_fiche_titre($titlelist);
|
||||
|
||||
print '<!-- list of product/services to consume -->'."\n";
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
|
|
|
|||
|
|
@ -25,20 +25,20 @@
|
|||
|
||||
// Load Dolibarr environment
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/workstation/class/workstation.class.php';
|
||||
|
||||
dol_include_once('/bom/class/bom.class.php');
|
||||
dol_include_once('/mrp/class/mo.class.php');
|
||||
dol_include_once('/mrp/lib/mrp_mo.lib.php');
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp", "stocks", "other", "product", "productbatch"));
|
||||
|
|
@ -848,12 +848,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '<td class="right">'.$langs->trans("UnitCost").'</td>';
|
||||
}
|
||||
// Qty already consumed
|
||||
print '<td class="right">'.$langs->trans("QtyAlreadyConsumed").'</td>';
|
||||
print '<td class="right">'.$form->textwithpicto($langs->trans("QtyAlreadyConsumedShort"), $langs->trans("QtyAlreadyConsumed")).'</td>';
|
||||
// Warehouse
|
||||
print '<td>';
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
print $langs->trans("Warehouse");
|
||||
|
||||
if (isModEnabled('workstation')) {
|
||||
print ' '.$langs->trans("or").' '.$langs->trans("Workstation");
|
||||
}
|
||||
// Select warehouse to force it everywhere
|
||||
if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
$listwarehouses = $tmpwarehouse->list_array(1);
|
||||
|
|
@ -1024,7 +1026,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
// Qty
|
||||
print '<td class="right nowraponall">';
|
||||
print '<input name="qty_lineProduce" type="number" value="'. $line->qty.'" width="25px">';
|
||||
print '<input class="width40" name="qty_lineProduce" value="'. $line->qty.'">';
|
||||
print '</td>';
|
||||
// Unit
|
||||
if ($conf->global->PRODUCT_USE_UNITS) {
|
||||
|
|
@ -1041,24 +1043,29 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
print '</td>';
|
||||
// Stock
|
||||
print '<td class="nowraponall right">';
|
||||
if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) {
|
||||
print img_warning($langs->trans('StockTooLow')).' ';
|
||||
if ($tmpproduct->isStockManaged()) {
|
||||
if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) {
|
||||
print img_warning($langs->trans('StockTooLow')).' ';
|
||||
}
|
||||
print '<span class="left">'. $tmpproduct->stock_reel .' </span>';
|
||||
}
|
||||
print '<span class="left">'. $tmpproduct->stock_reel .' </span>';
|
||||
print '</td>';
|
||||
// Batch
|
||||
print '<td class="right">';
|
||||
print '</td>';
|
||||
|
||||
// Batch
|
||||
/*
|
||||
print '<td class="right">';
|
||||
print '</td>';
|
||||
*/
|
||||
|
||||
// Action delete line
|
||||
print '<td>';
|
||||
print '<input type="submit" class="button buttongen button-add" name="save" value="' . $langs->trans("Edit") . '">';
|
||||
print '<input type="submit" class="button buttongen button-cancel" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '<td colspan="2">';
|
||||
print '<input type="submit" class="button buttongen button-add small nominwidth" name="save" value="' . $langs->trans("Save") . '">';
|
||||
print '<input type="submit" class="button buttongen button-cancel small nominwidth" name="cancel" value="' . $langs->trans("Cancel") . '">';
|
||||
print '</td>';
|
||||
|
||||
// Action delete line
|
||||
if ($permissiontodelete) {
|
||||
print '<td class="center"></td>';
|
||||
print '<td></td>';
|
||||
}
|
||||
print '<td></td>';
|
||||
print '</tr>';
|
||||
|
|
@ -1140,11 +1147,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
}
|
||||
print ' ' . price2num($alreadyconsumed, 'MS');
|
||||
print '</td>';
|
||||
// Warehouse
|
||||
// Warehouse and/or workstation
|
||||
print '<td>';
|
||||
if (getDolGlobalString('STOCK_CONSUMPTION_FROM_MANUFACTURING_WAREHOUSE') && $tmpwarehouse->id > 0) {
|
||||
print img_picto('', $tmpwarehouse->picto) . " " . $tmpwarehouse->label;
|
||||
}
|
||||
if (isModEnabled('workstation') && $line->fk_default_workstation > 0) {
|
||||
$tmpworkstation = new Workstation($db);
|
||||
$tmpworkstation->fetch($line->fk_default_workstation);
|
||||
print $tmpworkstation->getNomUrl(1);
|
||||
}
|
||||
print '</td>';
|
||||
// Stock
|
||||
if (isModEnabled('stock')) {
|
||||
|
|
@ -1402,6 +1414,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
});</script>';
|
||||
}
|
||||
|
||||
|
||||
// Lines to produce
|
||||
|
||||
print '</div>';
|
||||
|
|
@ -1448,7 +1461,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
}
|
||||
}
|
||||
// Already produced
|
||||
print '<td class="right">'.$langs->trans("QtyAlreadyProduced").'</td>';
|
||||
print '<td class="right">'.$form->textwithpicto($langs->trans("QtyAlreadyProducedShort"), $langs->trans("QtyAlreadyProduced")).'</td>';
|
||||
// Warehouse
|
||||
print '<td>';
|
||||
if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ if (empty($conf) || !is_object($conf)) {
|
|||
exit;
|
||||
}
|
||||
|
||||
global $db;
|
||||
global $db, $langs;
|
||||
|
||||
if (!empty($form) && !is_object($form)) {
|
||||
$form = new Form($db);
|
||||
|
|
@ -35,9 +35,13 @@ $qtytoconsumeforline = $this->tpl['qty'] / (!empty($this->tpl['efficiency']) ? $
|
|||
$qtytoconsumeforline = price2num($qtytoconsumeforline, 'MS');
|
||||
|
||||
$tmpproduct = new Product($db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
if ($line->fk_product > 0) {
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
}
|
||||
$tmpbom = new BOM($db);
|
||||
$res = $tmpbom->fetch($line->fk_bom_child);
|
||||
if ($line->fk_bom_child > 0) {
|
||||
$res = $tmpbom->fetch($line->fk_bom_child);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
|
@ -63,14 +67,20 @@ print '</td>';
|
|||
print '<td class="right">'.$this->tpl['qty'].(($this->tpl['efficiency'] > 0 && $this->tpl['efficiency'] < 1) ? ' / '.$form->textwithpicto($this->tpl['efficiency'], $langs->trans("ValueOfMeansLoss")).' = '.$qtytoconsumeforline : '').'</td>';
|
||||
// Unit
|
||||
print '<td class="right">'.measuringUnitString($this->tpl['fk_unit'], '', '', 1).'</td>';
|
||||
print '<td class="center">'.(empty($this->tpl['stock']) ? 0 : price2num($this->tpl['stock'], 'MS'));
|
||||
if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['stock'] < $this->tpl['seuil_stock_alerte'])) {
|
||||
print ' '.img_warning($langs->trans("StockLowerThanLimit", $this->tpl['seuil_stock_alerte']));
|
||||
print '<td class="center">';
|
||||
if ($tmpproduct->isStockManaged()) {
|
||||
print (empty($this->tpl['stock']) ? 0 : price2num($this->tpl['stock'], 'MS'));
|
||||
if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['stock'] < $this->tpl['seuil_stock_alerte'])) {
|
||||
print ' '.img_warning($langs->trans("StockLowerThanLimit", $this->tpl['seuil_stock_alerte']));
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.((empty($this->tpl['virtual_stock']) ? 0 : price2num($this->tpl['virtual_stock'], 'MS')));
|
||||
if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['virtual_stock'] < $this->tpl['seuil_stock_alerte'])) {
|
||||
print ' '.img_warning($langs->trans("StockLowerThanLimit", $this->tpl['seuil_stock_alerte']));
|
||||
print '<td class="center">';
|
||||
if ($tmpproduct->isStockManaged()) {
|
||||
print ((empty($this->tpl['virtual_stock']) ? 0 : price2num($this->tpl['virtual_stock'], 'MS')));
|
||||
if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['virtual_stock'] < $this->tpl['seuil_stock_alerte'])) {
|
||||
print ' '.img_warning($langs->trans("StockLowerThanLimit", $this->tpl['seuil_stock_alerte']));
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.($this->tpl['qty_frozen'] ? yn($this->tpl['qty_frozen']) : '').'</td>';
|
||||
|
|
|
|||
|
|
@ -765,7 +765,7 @@ if (getDolGlobalString('PRODUCT_CANVAS_ABILITY')) {
|
|||
|
||||
$const = "PRODUCT_SPECIAL_".strtoupper($file);
|
||||
|
||||
if ($conf->global->$const) {
|
||||
if (getDolGlobalString($const)) {
|
||||
print img_picto($langs->trans("Active"), 'tick');
|
||||
print '</td><td class="right">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&token='.newToken().'&spe='.urlencode($file).'&value=0">'.$langs->trans("Disable").'</a>';
|
||||
|
|
|
|||
|
|
@ -2106,7 +2106,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($canvasdisplayactio
|
|||
if (!getDolGlobalString('PRODUCT_DISABLE_PUBLIC_URL')) {
|
||||
print '<tr><td>'.$langs->trans("PublicUrl").'</td><td>';
|
||||
print img_picto('', 'globe', 'class="pictofixedwidth"');
|
||||
print '<input type="text" name="url" class="quatrevingtpercent" value="'.(GETPOSTISSET('url') ? GETPOST('url') : $object->url).'">';
|
||||
print '<input type="text" name="url" class="maxwidth500 widthcentpercentminusx" value="'.(GETPOSTISSET('url') ? GETPOST('url') : $object->url).'">';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6140,7 +6140,7 @@ class Product extends CommonObject
|
|||
}
|
||||
|
||||
/**
|
||||
* Return if object is a product
|
||||
* Return if object is a product.
|
||||
*
|
||||
* @return boolean True if it's a product
|
||||
*/
|
||||
|
|
@ -6159,6 +6159,15 @@ class Product extends CommonObject
|
|||
return ($this->type == Product::TYPE_SERVICE ? true : false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if object need to have its stock managed
|
||||
*
|
||||
* @return boolean True if it's a service
|
||||
*/
|
||||
public function isStockManaged()
|
||||
{
|
||||
return ($this->isProduct() || getDolGlobalString('STOCK_SUPPORTS_SERVICES'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if object have a constraint on mandatory_period
|
||||
|
|
@ -6169,6 +6178,18 @@ class Product extends CommonObject
|
|||
{
|
||||
return ($this->mandatory_period == 1 ? true : false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if object has a sell-by date or eat-by date
|
||||
*
|
||||
* @return boolean True if it's has
|
||||
*/
|
||||
public function hasbatch()
|
||||
{
|
||||
return ($this->status_batch > 0 ? true : false);
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Get a barcode from the module to generate barcode values.
|
||||
|
|
@ -6211,8 +6232,6 @@ class Product extends CommonObject
|
|||
*/
|
||||
public function initAsSpecimen()
|
||||
{
|
||||
global $user, $langs, $conf, $mysoc;
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
// Initialize parameters
|
||||
|
|
@ -6285,17 +6304,6 @@ class Product extends CommonObject
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return if object has a sell-by date or eat-by date
|
||||
*
|
||||
* @return boolean True if it's has
|
||||
*/
|
||||
public function hasbatch()
|
||||
{
|
||||
return ($this->status_batch > 0 ? true : false);
|
||||
}
|
||||
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Return minimum product recommended price
|
||||
|
|
|
|||
|
|
@ -402,10 +402,10 @@ if (!getDolUserInt('USER_PUBLIC_HIDE_COMPANY', 0, $object)) {
|
|||
$logosmall = $mysoc->logo_squarred_small ? $mysoc->logo_squarred_small : $mysoc->logo_small;
|
||||
$logo = $mysoc->logo_squarred ? $mysoc->logo_squarred : $mysoc->logo;
|
||||
$paramlogo = 'ONLINE_USER_LOGO_'.$suffix;
|
||||
if (!empty($conf->global->$paramlogo)) {
|
||||
$logosmall = $conf->global->$paramlogo;
|
||||
if (getDolGlobalString($paramlogo)) {
|
||||
$logosmall = getDolGlobalString($paramlogo);
|
||||
} elseif (getDolGlobalString('ONLINE_USER_LOGO')) {
|
||||
$logosmall = $conf->global->ONLINE_USER_LOGO;
|
||||
$logosmall = getDolGlobalString('ONLINE_USER_LOGO');
|
||||
}
|
||||
//print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
|
||||
// Define urllogo
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ if ($action == 'updateMask') {
|
|||
$tmpobjectkey = GETPOST('object');
|
||||
if (!empty($tmpobjectkey)) {
|
||||
$constforval = 'RECRUITMENT_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ if ($action == 'updateMask') {
|
|||
$ret = delDocumentModel($value, $type);
|
||||
if ($ret > 0) {
|
||||
$constforval = 'RECRUITMENT_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
|
||||
if ($conf->global->$constforval == "$value") {
|
||||
if (getDolGlobalString($constforval) == "$value") {
|
||||
dolibarr_del_const($db, $constforval, $conf->entity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
|
|||
// Line of free text
|
||||
$newfreetext = '';
|
||||
$paramfreetext = 'ORDER_FREE_TEXT';
|
||||
if (!empty($conf->global->$paramfreetext)) {
|
||||
if (getDolGlobalString($paramfreetext)) {
|
||||
$newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -333,19 +333,33 @@ if (!$ret) {
|
|||
|
||||
print dol_get_fiche_head($head, 'resources', $langs->trans("Action"), -1, 'action');
|
||||
|
||||
$linkback = img_picto($langs->trans("BackToList"), 'object_list', 'class="hideonsmartphone pictoactionview"');
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list">'.$langs->trans("BackToList").'</a>';
|
||||
$linkback .= '<a href="'.DOL_URL_ROOT.'/comm/action/list.php?mode=show_list&restore_lastsearch_values=1">';
|
||||
$linkback .= img_picto($langs->trans("BackToList"), 'object_calendarlist', 'class="pictoactionview pictofixedwidth"');
|
||||
$linkback .= '<span class="hideonsmartphone">'.$langs->trans("BackToList").'</span>';
|
||||
$linkback .= '</a>';
|
||||
|
||||
// Link to other agenda views
|
||||
$out = '';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewPerUser").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewCal").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewWeek").'</a>';
|
||||
$out .= '</li><li class="noborder litext">'.img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone pictoactionview"');
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">'.$langs->trans("ViewDay").'</a>';
|
||||
$out .= '</li><li class="noborder litext">';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_month&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">';
|
||||
$out .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictofixedwidth pictoactionview"');
|
||||
$out .= '<span class="hideonsmartphone">'.$langs->trans("ViewCal").'</span>';
|
||||
$out .= '</a>';
|
||||
$out .= '</li><li class="noborder litext">';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">';
|
||||
$out .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictofixedwidth pictoactionview"');
|
||||
$out .= '<span class="hideonsmartphone">'.$langs->trans("ViewWeek").'</span>';
|
||||
$out .= '</a>';
|
||||
$out .= '</li><li class="noborder litext">';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">';
|
||||
$out .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictofixedwidth pictoactionview"');
|
||||
$out .= '<span class="hideonsmartphone">'.$langs->trans("ViewDay").'</span>';
|
||||
$out .= '</a>';
|
||||
$out .= '</li><li class="noborder litext">';
|
||||
$out .= '<a href="'.DOL_URL_ROOT.'/comm/action/peruser.php?mode=show_peruser&year='.dol_print_date($act->datep, '%Y').'&month='.dol_print_date($act->datep, '%m').'&day='.dol_print_date($act->datep, '%d').'">';
|
||||
$out .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictofixedwidth pictoactionview"');
|
||||
$out .= '<span class="hideonsmartphone">'.$langs->trans("ViewPerUser").'</span>';
|
||||
$out .= '</a>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array();
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ if (isModEnabled("banque")) {
|
|||
$name = "CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->label).'</td>';
|
||||
print '<td>';
|
||||
if (!empty($conf->global->$name)) {
|
||||
if (getDolGlobalString($name)) {
|
||||
$atleastonefound++;
|
||||
}
|
||||
$cour = preg_match('/^LIQ.*/', $modep->code) ? 2 : 1;
|
||||
|
|
|
|||
|
|
@ -1223,7 +1223,7 @@ if (isset($_SESSION["takeposterminal"]) && $_SESSION["takeposterminal"]) {
|
|||
|
||||
$constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"];
|
||||
//var_dump($constantforkey.' '.getDolGlobalInt($constantforkey));
|
||||
if (!empty($conf->global->$constantforkey) && getDolGlobalInt($constantforkey) > 0) {
|
||||
if (getDolGlobalInt($constantforkey) > 0) {
|
||||
array_push($paiementsModes, $obj);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -323,11 +323,11 @@ if (empty($reshook)) {
|
|||
$prod_batch->find(0, '', '', $line->batch, $line->fk_warehouse);
|
||||
$mouvP = new MouvementStock($db);
|
||||
$mouvP->origin = $invoice;
|
||||
$mouvP->livraison($user, $line->fk_product, $conf->global->$constantforkey, $line->qty, $line->price, 'TakePOS', '', '', '', $prod_batch->batch, $line->batch);
|
||||
$mouvP->livraison($user, $line->fk_product, getDolGlobalString($constantforkey), $line->qty, $line->price, 'TakePOS', '', '', '', $prod_batch->batch, $line->batch);
|
||||
} else {
|
||||
$mouvP = new MouvementStock($db);
|
||||
$mouvP->origin = $invoice;
|
||||
$mouvP->livraison($user, $line->fk_product, $conf->global->$constantforkey, $line->qty, $line->price, 'TakePOS', '', '', '');
|
||||
$mouvP->livraison($user, $line->fk_product, getDolGlobalString($constantforkey), $line->qty, $line->price, 'TakePOS', '', '', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -534,6 +534,7 @@ if (empty($reshook)) {
|
|||
if (!empty($batch)) {
|
||||
$action="setbatch";
|
||||
} else {
|
||||
$nbofsuggested = 0;
|
||||
$prod->load_stock('warehouseopen');
|
||||
$constantforkey = 'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"];
|
||||
if ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch!="") {
|
||||
|
|
@ -561,7 +562,7 @@ if (empty($reshook)) {
|
|||
print '<td class="left">';
|
||||
$staticwarehouse = new Entrepot($db);
|
||||
if ($warehouse_id > 0) {
|
||||
$staticwarehouse->fetch($conf->global->$constantforkey);
|
||||
$staticwarehouse->fetch(getDolGlobalString($constantforkey));
|
||||
}
|
||||
$detail = '';
|
||||
$detail .= $langs->trans("LotSerial").': '.$dbatch->batch;
|
||||
|
|
|
|||
|
|
@ -1638,9 +1638,10 @@ maxscreenheightless200 {
|
|||
.clearboth { clear:both; }
|
||||
|
||||
.hideobject { display: none; }
|
||||
.minwidth25 { min-width: 25px; }
|
||||
.minwidth50 { min-width: 50px; }
|
||||
.minwidth75 { min-width: 75px; }
|
||||
.minwidth25 { min-width: 25px; }
|
||||
.minwidth50 { min-width: 50px; }
|
||||
.minwidth75 { min-width: 75px; }
|
||||
.nominwidth { min-width: fit-content !important; }
|
||||
/* rule for not too small screen only */
|
||||
@media only screen and (min-width: <?php echo !getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC3') ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px) /* reduction 3 */
|
||||
{
|
||||
|
|
@ -3619,7 +3620,7 @@ a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
|
|||
|
||||
.tabactive, a.tab#active {
|
||||
color: var(--colortextbacktab) !important;
|
||||
background: var(--colorbacktabcard1) !important;
|
||||
/* background: var(--colorbacktabcard1) !important; */
|
||||
margin: 0 0.2em 0 0.2em !important;
|
||||
|
||||
border-right: 1px solid transparent;
|
||||
|
|
|
|||
|
|
@ -73,14 +73,14 @@ $manifest->manifest_version = 3;
|
|||
|
||||
$manifest->name = constant('DOL_APPLICATION_TITLE');
|
||||
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
|
||||
$manifest->name = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
$manifest->name = getDolGlobalString('MAIN_APPLICATION_TITLE');
|
||||
}
|
||||
$manifest->short_name = $manifest->name;
|
||||
|
||||
|
||||
$manifest->theme_color = !getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR') ? getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40') : $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR;
|
||||
$manifest->background_color = !getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR') ? "#ffffff" : $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR;
|
||||
$manifest->display = "standalone";
|
||||
$manifest->theme_color = getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR', getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40'));
|
||||
$manifest->background_color = getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR', "#ffffff");
|
||||
$manifest->display = getDolGlobalString('MAIN_MANIFEST_DISPLAY', "minimal-ui");
|
||||
$manifest->splash_pages = null;
|
||||
$manifest->icons = array();
|
||||
$manifest->start_url = constant('DOL_MAIN_URL_ROOT');
|
||||
|
|
|
|||
|
|
@ -72,13 +72,13 @@ $manifest->manifest_version = 3;
|
|||
|
||||
$manifest->name = constant('DOL_APPLICATION_TITLE');
|
||||
if (getDolGlobalString('MAIN_APPLICATION_TITLE')) {
|
||||
$manifest->name = $conf->global->MAIN_APPLICATION_TITLE;
|
||||
$manifest->name = getDolGlobalString('MAIN_APPLICATION_TITLE');
|
||||
}
|
||||
$manifest->short_name = $manifest->name;
|
||||
|
||||
$manifest->theme_color = !getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR') ? getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40') : $conf->global->MAIN_MANIFEST_APPLI_THEME_COLOR;
|
||||
$manifest->background_color = !getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR') ? "#ffffff" : $conf->global->MAIN_MANIFEST_APPLI_BG_COLOR;
|
||||
$manifest->display = "standalone";
|
||||
$manifest->theme_color = getDolGlobalString('MAIN_MANIFEST_APPLI_THEME_COLOR', getDolGlobalString('THEME_ELDY_TOPMENU_BACK1', '#F05F40'));
|
||||
$manifest->background_color = getDolGlobalString('MAIN_MANIFEST_APPLI_BG_COLOR', "#ffffff");
|
||||
$manifest->display = getDolGlobalString('MAIN_MANIFEST_DISPLAY', "minimal-ui");
|
||||
$manifest->splash_pages = null;
|
||||
$manifest->icons = array();
|
||||
$manifest->start_url = constant('DOL_MAIN_URL_ROOT');
|
||||
|
|
@ -86,8 +86,8 @@ $manifest->id = constant('DOL_MAIN_URL_ROOT');
|
|||
|
||||
if (getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL')) {
|
||||
$icon = new stdClass();
|
||||
$icon->src = $conf->global->MAIN_MANIFEST_APPLI_LOGO_URL;
|
||||
if ($conf->global->MAIN_MANIFEST_APPLI_LOGO_URL_SIZE) {
|
||||
$icon->src = getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL');
|
||||
if (getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL_SIZE')) {
|
||||
$icon->sizes = getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL_SIZE') . "x" . getDolGlobalString('MAIN_MANIFEST_APPLI_LOGO_URL_SIZE');
|
||||
} else {
|
||||
$icon->sizes = "512x512";
|
||||
|
|
|
|||
|
|
@ -1875,6 +1875,7 @@ tr.nobottom td {
|
|||
.minwidth25 { min-width: 25px; }
|
||||
.minwidth50 { min-width: 50px; }
|
||||
.minwidth75 { min-width: 75px; }
|
||||
.nominwidth { min-width: fit-content !important; }
|
||||
/* rule for not too small screen only */
|
||||
@media only screen and (min-width: <?php echo !getDolGlobalString('THEME_ELDY_WITDHOFFSET_FOR_REDUC3') ? round($nbtopmenuentries * 47, 0) + 130 : $conf->global->THEME_ELDY_WITDHOFFSET_FOR_REDUC3; ?>px)
|
||||
{
|
||||
|
|
@ -4053,7 +4054,7 @@ table.liste, table.noborder, table.formdoc, div.noborder {
|
|||
border-bottom-color: #BBB;
|
||||
border-bottom-style: solid;
|
||||
|
||||
margin: 0px 0px 15px 0px;
|
||||
margin: 0px 0px 20px 0px;
|
||||
|
||||
-webkit-border-radius: 0.1em;
|
||||
border-radius: 0.1em;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class Workstation extends CommonObject
|
|||
public $fields=array(
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'noteditable'=>'0', 'default'=>'', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>1, 'noteditable'=>'0', 'default'=>'', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object", 'csslist'=>'nowraponall'),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth300', 'csslist'=>'tdoverflowmax125', 'showoncombobox'=>'2',),
|
||||
'type' => array('type'=>'varchar(8)', 'label'=>'Type', 'enabled'=>'1', 'position'=>32, 'default'=>1, 'notnull'=>1, 'visible'=>1, 'arrayofkeyval'=>array('HUMAN'=>'Human', 'MACHINE'=>'Machine', 'BOTH'=>'HumanMachine'),),
|
||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>0,),
|
||||
|
|
@ -110,9 +110,9 @@ class Workstation extends CommonObject
|
|||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>'1', 'position'=>510, 'notnull'=>1, 'visible'=>-2, 'foreignkey'=>'user.rowid',),
|
||||
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>'1', 'position'=>511, 'notnull'=>-1, 'visible'=>-2,),
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>'1', 'position'=>512, 'notnull'=>-1, 'visible'=>-2,),
|
||||
'nb_operators_required' => array('type'=>'integer', 'label'=>'NbOperatorsRequired', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1,),
|
||||
'thm_operator_estimated' => array('type'=>'double', 'help'=>'THMOperatorEstimatedHelp','label'=>'THMOperatorEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1, 'css'=>'right'),
|
||||
'thm_machine_estimated' => array('type'=>'double', 'help'=>'THMMachineEstimatedHelp', 'label'=>'THMMachineEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1, 'css'=>'right'),
|
||||
'nb_operators_required' => array('type'=>'integer', 'label'=>'NbOperatorsRequired', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1, 'css'=>'right', 'csslist'=>'maxwidth75imp'),
|
||||
'thm_operator_estimated' => array('type'=>'double', 'help'=>'THMOperatorEstimatedHelp','label'=>'THMOperatorEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1, 'css'=>'right', 'csslist'=>'maxwidth75imp'),
|
||||
'thm_machine_estimated' => array('type'=>'double', 'help'=>'THMMachineEstimatedHelp', 'label'=>'THMMachineEstimated', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>1, 'css'=>'right', 'csslist'=>'maxwidth75imp'),
|
||||
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'default'=>1, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Disabled', '1'=>'Enabled'),),
|
||||
);
|
||||
public $rowid;
|
||||
|
|
@ -698,6 +698,49 @@ class Workstation extends CommonObject
|
|||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a thumb for kanban views
|
||||
*
|
||||
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
|
||||
* @param array $arraydata Array of data
|
||||
* @return string HTML Code for Kanban thumb.
|
||||
*/
|
||||
public function getKanbanView($option = '', $arraydata = null)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
|
||||
|
||||
$return = '<div class="box-flex-item box-flex-grow-zero">';
|
||||
$return .= '<div class="info-box info-box-sm">';
|
||||
$return .= '<span class="info-box-icon bg-infobox-action">';
|
||||
$return .= img_picto('', $this->picto);
|
||||
$return .= '</span>';
|
||||
$return .= '<div class="info-box-content">';
|
||||
$return .= '<span class="info-box-ref inline-block tdoverflowmax150 valignmiddle">'.(method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref).'</span>';
|
||||
if ($selected >= 0) {
|
||||
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
if (property_exists($this, 'label')) {
|
||||
$return .= ' <div class="inline-block opacitymedium valignmiddle tdoverflowmax100">'.$this->label.'</div>';
|
||||
}
|
||||
if (property_exists($this, 'thirdparty') && is_object($this->thirdparty)) {
|
||||
$return .= '<br><div class="info-box-ref tdoverflowmax150">'.$this->thirdparty->getNomUrl(1).'</div>';
|
||||
}
|
||||
if (property_exists($this, 'amount')) {
|
||||
$return .= '<br>';
|
||||
$return .= '<span class="info-box-label amount">'.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
}
|
||||
if (method_exists($this, 'getLibStatut')) {
|
||||
$return .= '<br><div class="info-box-status">'.$this->getLibStatut(3).'</div>';
|
||||
}
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
$return .= '</div>';
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the label of the status
|
||||
*
|
||||
|
|
|
|||
|
|
@ -43,9 +43,16 @@ $ref = GETPOST('ref', 'alpha');
|
|||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'workstationcard'; // To manage different context of search
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
$backtopagejsfields = GETPOST('backtopagejsfields', 'alpha');
|
||||
$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ09');
|
||||
|
||||
if (!empty($backtopagejsfields)) {
|
||||
$tmpbacktopagejsfields = explode(':', $backtopagejsfields);
|
||||
$dol_openinpopup = $tmpbacktopagejsfields[0];
|
||||
}
|
||||
|
||||
$groups = GETPOST('groups', 'array:int');
|
||||
$resources = GETPOST('resources', 'array:int');
|
||||
|
|
@ -56,7 +63,7 @@ $object = new Workstation($db);
|
|||
|
||||
//$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->workstation->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('workstationcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
$hookmanager->initHooks(array($object->element.'card', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
|
@ -64,7 +71,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = GETPOST("search_all", 'alpha');
|
||||
$search_all = trim(GETPOST("search_all", 'alpha'));
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha')) {
|
||||
|
|
@ -156,7 +163,10 @@ $form = new Form($db);
|
|||
$formfile = new FormFile($db);
|
||||
$formresource = new FormResource($db);
|
||||
|
||||
$title = $langs->trans("Workstation");
|
||||
$title = $langs->trans("Workstation")." - ".$langs->trans('Card');
|
||||
if ($action == 'create') {
|
||||
$title = $langs->trans("NewObject", $langs->transnoentitiesnoconv("Workstation"));
|
||||
}
|
||||
$help_url = 'EN:Module_Workstation';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
|
@ -190,10 +200,14 @@ llxHeader('', $title, $help_url);
|
|||
|
||||
// Part to create
|
||||
if ($action == 'create') {
|
||||
if (empty($permissiontoadd)) {
|
||||
accessforbidden('NotEnoughPermissions', 0, 1);
|
||||
}
|
||||
|
||||
// Set default value of the property ref
|
||||
$object->fields['ref']['default'] = $object->getNextNumRef();
|
||||
|
||||
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Workstation")), '', 'object_'.$object->picto);
|
||||
print load_fiche_titre($title, '', 'object_'.$object->picto);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
|
@ -230,7 +244,7 @@ if ($action == 'create') {
|
|||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
//include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
|
|
@ -283,7 +297,7 @@ if (($id || $ref) && $action == 'edit') {
|
|||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
//include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
|
@ -296,16 +310,15 @@ if (($id || $ref) && $action == 'edit') {
|
|||
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = workstationPrepareHead($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'card', $langs->trans("Workstation"), -1, $object->picto);
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
// Confirmation to delete
|
||||
if ($action == 'delete') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteWorkstation'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
|
||||
// Confirmation to delete (using preloaded confirm popup)
|
||||
if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteWorkstation'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 'action-delete');
|
||||
}
|
||||
// Clone confirmation
|
||||
if ($action == 'clone') {
|
||||
|
|
@ -341,38 +354,33 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$morehtmlref = '<div class="refidno">';
|
||||
/*
|
||||
// Ref customer
|
||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
|
||||
$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
|
||||
// Thirdparty
|
||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>'.$langs->trans('Project') . ' ';
|
||||
if ($permissiontoadd) {
|
||||
//if ($action != 'classify') $morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> ';
|
||||
$morehtmlref .= ' : ';
|
||||
if ($action == 'classify') {
|
||||
//$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 0, 1, '', 'maxwidth300');
|
||||
$morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
|
||||
$morehtmlref .= '<input type="hidden" name="action" value="classin">';
|
||||
$morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
$morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
|
||||
$morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
|
||||
$morehtmlref .= '</form>';
|
||||
} else {
|
||||
$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
|
||||
// Project
|
||||
if (isModEnabled('project')) {
|
||||
$langs->load("projects");
|
||||
$morehtmlref .= '<br>';
|
||||
if ($permissiontoadd) {
|
||||
$morehtmlref .= img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth"');
|
||||
if ($action != 'classify') {
|
||||
$morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> ';
|
||||
}
|
||||
$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, ($action == 'classify' ? 'projectid' : 'none'), 0, 0, 0, 1, '', 'maxwidth300');
|
||||
} else {
|
||||
if (!empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= $proj->getNomUrl(1);
|
||||
if ($proj->title) {
|
||||
$morehtmlref .= '<span class="opacitymedium"> - '.dol_escape_htmltag($proj->title).'</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (! empty($object->fk_project)) {
|
||||
$proj = new Project($db);
|
||||
$proj->fetch($object->fk_project);
|
||||
$morehtmlref .= ': '.$proj->getNomUrl();
|
||||
} else {
|
||||
$morehtmlref .= '';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
*/
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
|
||||
|
|
@ -392,6 +400,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
$object->fields['nb_operators_required']['visible'] = 0;
|
||||
}
|
||||
|
||||
// Common attributes
|
||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_soc']); // Hide field already shown in banner
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
// Groups
|
||||
|
|
@ -446,28 +458,31 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
|
||||
if (empty($reshook)) {
|
||||
// Modify
|
||||
if ($permissiontoadd) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
|
||||
}
|
||||
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken(), '', $permissiontoadd);
|
||||
|
||||
// Clone
|
||||
if ($permissiontoadd) {
|
||||
print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=workstation', 'clone', $permissiontoadd);
|
||||
print dolGetButtonAction('', $langs->trans('ToClone'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : '').'&action=clone&token='.newToken(), '', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Disable / Enable
|
||||
if ($permissiontoadd) {
|
||||
if ($object->status == $object::STATUS_ENABLED) {
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable&token='.newToken().'">'.$langs->trans("Disable").'</a>'."\n";
|
||||
print dolGetButtonAction('', $langs->trans('Disable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=disable&token='.newToken(), '', $permissiontoadd);
|
||||
} else {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable&token='.newToken().'">'.$langs->trans("Enable").'</a>'."\n";
|
||||
print dolGetButtonAction('', $langs->trans('Enable'), 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=enable&token='.newToken(), '', $permissiontoadd);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete
|
||||
print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
|
||||
// Delete (with preloaded confirm popup)
|
||||
$deleteUrl = $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken();
|
||||
$buttonId = 'action-delete-no-ajax';
|
||||
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can use preloaded confirm if not jmobile
|
||||
$deleteUrl = '';
|
||||
$buttonId = 'action-delete';
|
||||
}
|
||||
$params = array();
|
||||
print dolGetButtonAction('', $langs->trans("Delete"), 'delete', $deleteUrl, $buttonId, $permissiontodelete, $params);
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,18 +36,19 @@ global $conf, $db, $hookmanager, $langs, $user;
|
|||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('mrp', 'other'));
|
||||
|
||||
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
|
||||
$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
|
||||
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
|
||||
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
|
||||
$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') : 'workstationlist'; // To manage different context of search
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // 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')
|
||||
$mode = GETPOST('mode', 'aZ');
|
||||
$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
// Load variable for pagination
|
||||
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
|
||||
|
|
@ -84,7 +85,7 @@ if (!$sortorder) {
|
|||
}
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
|
||||
$search_all = trim(GETPOST('search_all', 'alphanohtml'));
|
||||
$search = array();
|
||||
|
||||
foreach ($object->fields as $key => $val) {
|
||||
|
|
@ -129,7 +130,8 @@ $arrayfields['wug.fk_usergroup'] = array(
|
|||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
|
||||
'position'=>1000,
|
||||
'help' => empty($val['help']) ? '' : $val['help']
|
||||
'help' => empty($val['help']) ? '' : $val['help'],
|
||||
'csslist' => 'minwidth100'
|
||||
);
|
||||
|
||||
/* disabled because adding resources to workstation seems not yet available in GUI
|
||||
|
|
@ -214,8 +216,8 @@ $formresource = new FormResource($db);
|
|||
|
||||
$now = dol_now();
|
||||
|
||||
$help_url = 'EN:Module_Workstation';
|
||||
$title = $langs->trans("Workstations");
|
||||
$help_url = 'EN:Module_Workstation';
|
||||
$morejs = array();
|
||||
$morecss = array();
|
||||
|
||||
|
|
@ -232,9 +234,12 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||
}
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
|
||||
$sqlfields = $sql; // $sql fields to remove for count total
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
|
|
@ -247,10 +252,10 @@ if (!empty($resources)) {
|
|||
}
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
if ($object->ismultientitymanaged == 1) {
|
||||
$sql .= " WHERE t.entity IN (".getEntity($object->element).")";
|
||||
$sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOST('search_current_entity', 'int') ? 0 : 1)).")";
|
||||
} else {
|
||||
$sql .= " WHERE 1 = 1";
|
||||
}
|
||||
|
|
@ -302,7 +307,7 @@ if (!empty($resources)) {
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql.= " GROUP BY ";
|
||||
|
|
@ -315,7 +320,7 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
|||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||
}
|
||||
}
|
||||
// Add where from hooks
|
||||
// Add groupby from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
|
@ -324,11 +329,19 @@ $sql = preg_replace('/,\s*$/', '', $sql);
|
|||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
|
||||
/* This old and fast method to get and count full list returns all record so use a high amount of memory. */
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
/* The fast and low memory method to get and count full list converts the sql into a sql count */
|
||||
$sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
|
||||
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
$resql = $db->query($sqlforcount);
|
||||
if ($resql) {
|
||||
$objforcount = $db->fetch_object($resql);
|
||||
$nbtotalofrecords = $objforcount->nbtotalofrecords;
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
|
|
@ -351,10 +364,10 @@ $num = $db->num_rows($resql);
|
|||
|
||||
|
||||
// Direct jump if only one record found
|
||||
if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
|
||||
if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$id = $obj->rowid;
|
||||
header("Location: ".DOL_URL_ROOT.'/workstation/workstation_card.php?id='.$id);
|
||||
header("Location: ".DOL_URL_ROOT.'/workstation/workstation_card.php?id='.((int) $id));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
@ -376,25 +389,29 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
|||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.((int) $limit);
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
if (is_array($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
if ($skey != '') {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
}
|
||||
} elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
|
||||
$param .= '&search_'.$key.'month='.((int) GETPOST('search_'.$key.'month', 'int'));
|
||||
$param .= '&search_'.$key.'day='.((int) GETPOST('search_'.$key.'day', 'int'));
|
||||
$param .= '&search_'.$key.'year='.((int) GETPOST('search_'.$key.'year', 'int'));
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
// List of mass actions available
|
||||
|
|
@ -404,7 +421,7 @@ $arrayofmassactions = array(
|
|||
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
|
||||
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
|
||||
);
|
||||
if ($permissiontodelete) {
|
||||
if (!empty($permissiontodelete)) {
|
||||
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
|
||||
}
|
||||
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
|
||||
|
|
@ -423,9 +440,13 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
|||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitleSeparator();
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/workstation/workstation_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
|
@ -438,9 +459,12 @@ $trackid = 'xxxx'.$object->id;
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
if ($search_all) {
|
||||
$setupstring = '';
|
||||
foreach ($fieldstosearchall as $key => $val) {
|
||||
$fieldstosearchall[$key] = $langs->trans($val);
|
||||
$setupstring .= $key."=".$val.";";
|
||||
}
|
||||
print '<!-- Search done like if WORKSTATION_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
|
||||
}
|
||||
|
||||
|
|
@ -450,7 +474,7 @@ $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_
|
|||
$moreforfilter.= '</div>';*/
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$moreforfilter .= $hookmanager->resPrint;
|
||||
} else {
|
||||
|
|
@ -460,11 +484,14 @@ if (empty($reshook)) {
|
|||
if (!empty($moreforfilter)) {
|
||||
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||
print $moreforfilter;
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
|
||||
$selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
|
||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||
|
||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||
|
|
@ -474,15 +501,16 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
|||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<tr class="liste_titre_filter">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
print '<td class="liste_titre center maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$searchkey = empty($search[$key]) ? '' : $search[$key];
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
|
|
@ -490,15 +518,15 @@ foreach ($object->fields as $key => $val) {
|
|||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), 1, 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
|
||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
|
||||
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
|
|
@ -519,7 +547,7 @@ foreach ($object->fields as $key => $val) {
|
|||
|
||||
// usergroups
|
||||
if (!empty($arrayfields['wug.fk_usergroup']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<td class="liste_titre minwidth100">';
|
||||
print $form->select_dolgroups($groups, 'groups', 1, '', 0, '', '', $conf->entity, true);
|
||||
print '</td>';
|
||||
}
|
||||
|
|
@ -536,11 +564,11 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
|
|||
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
print '<td class="liste_titre center maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
|
|
@ -555,7 +583,7 @@ $totalarray['nbfield'] = 0;
|
|||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
|
|
@ -566,11 +594,12 @@ foreach ($object->fields as $key => $val) {
|
|||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
|
@ -589,11 +618,11 @@ if (!empty($arrayfields['wr.fk_resource']['checked'])) {
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
|
||||
// Hook fields
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
|
@ -614,6 +643,7 @@ if (isset($extrafields->attributes[$object->table_element]['computed']) && is_ar
|
|||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
$savnbfield = $totalarray['nbfield'];
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||
while ($i < $imaxinloop) {
|
||||
|
|
@ -630,7 +660,7 @@ while ($i < $imaxinloop) {
|
|||
|
||||
if ($mode == 'kanban') {
|
||||
if ($i == 0) {
|
||||
print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
|
||||
print '<tr class="trkanban"><td colspan="'.($savnbfield+1).'">';
|
||||
print '<div class="box-flex-container kanban">';
|
||||
}
|
||||
// Output Kanban
|
||||
|
|
@ -647,7 +677,7 @@ while ($i < $imaxinloop) {
|
|||
print '</td></tr>';
|
||||
}
|
||||
} else {
|
||||
// Show here line of result
|
||||
// Show line of result
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
// Action column
|
||||
|
|
@ -674,18 +704,22 @@ while ($i < $imaxinloop) {
|
|||
}
|
||||
|
||||
if (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
|
||||
} elseif ($key == 'ref') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowraponall';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
||||
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield) && !in_array($val['type'], array('ip', 'url')) && !is_numeric($object->$key)) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
|
|
@ -726,7 +760,7 @@ while ($i < $imaxinloop) {
|
|||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories'.($cssforli ? ' '.$cssforli : '').'" style="background: #bbb">' . $g->getNomUrl(1, '', 0, 'categtextwhite') . '</li>';
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
print '<td class="minwidth300imp nowraponall">';
|
||||
print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
|
@ -745,7 +779,7 @@ while ($i < $imaxinloop) {
|
|||
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories'.($cssforli ? ' '.$cssforli : '').'" style="background: #bbb">' . $r->getNomUrl(1, '', '', 0, 'categtextwhite') . '</li>';
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
print '<td class="minwidth300imp">';
|
||||
print '<div class="select2-container-multi-dolibarr"><ul class="select2-choices-dolibarr">' . implode(' ', $toprint) . '</ul></div>';
|
||||
print '</td>';
|
||||
}
|
||||
|
|
@ -754,7 +788,7 @@ while ($i < $imaxinloop) {
|
|||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
// Fields from hook
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||
|
|
@ -796,7 +830,7 @@ if ($num == 0) {
|
|||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</table>'."\n";
|
||||
|
|
@ -821,7 +855,7 @@ if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords
|
|||
$genallowed = $permissiontoread;
|
||||
$delallowed = $permissiontoadd;
|
||||
|
||||
print $formfile->showdocuments('massfilesarea_workstation', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||
print $formfile->showdocuments('massfilesarea_'.$object->module, '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
|
|
|||
|
|
@ -50,27 +50,28 @@ parameters:
|
|||
- '#Undefined variable: \$errors#'
|
||||
- '#Undefined variable: \$form#'
|
||||
- '#has an unused parameter \$param#'
|
||||
- '#Result of function fieldList#'
|
||||
- '#Caught class Stripe#'
|
||||
- '#Function llxHeader invoked with#'
|
||||
- '#Function llxHeaderVierge invoked with#'
|
||||
- '#Function llxFooter invoked with#'
|
||||
- '#Function llxFooterVierge invoked with#'
|
||||
- '#If condition is always true#'
|
||||
- '#always exists and is not falsy#'
|
||||
- '#has no return type specified#'
|
||||
- '#is always true#'
|
||||
- '#is always fal#'
|
||||
- '#has no return type specified#'
|
||||
- '#always exists and is not nullable#'
|
||||
- '#PHPDoc tag @return has invalid value#'
|
||||
- '#type has no value type specified in iterable type array#'
|
||||
- '#with no value type specified in iterable type array#'
|
||||
- '#Empty array passed to foreach#'
|
||||
- '#Result of function fieldList#'
|
||||
- '#in isset\(\) is not nullable#'
|
||||
- '#in isset\(\) is never defined#'
|
||||
- '#(\$force_dolibarr_lib|\$dolibarr_main_db).*in empty\(\) is never defined.#'
|
||||
- '#Caught class Stripe#'
|
||||
- '#Sprain\\SwissQrBill\\#'
|
||||
- '#Constructor of class DolEditor has an unused parameter \$toolbarlocation#'
|
||||
- '#Constructor of class DoliDB\w+ has an unused parameter $type#'
|
||||
internalErrorsCountLimit: 50
|
||||
cache:
|
||||
nodesByFileCountMax: 512
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ print "----- To LDAP database:\n";
|
|||
print "host=" . getDolGlobalString('LDAP_SERVER_HOST')."\n";
|
||||
print "port=" . getDolGlobalString('LDAP_SERVER_PORT')."\n";
|
||||
print "login=" . getDolGlobalString('LDAP_ADMIN_DN')."\n";
|
||||
print "pass=".preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)."\n";
|
||||
print "pass=".preg_replace('/./i', '*', getDolGlobalString('LDAP_ADMIN_PASS'))."\n";
|
||||
print "DN target=" . getDolGlobalString('LDAP_CONTACT_DN')."\n";
|
||||
print "\n";
|
||||
|
||||
|
|
@ -103,8 +103,7 @@ if (!$confirmed) {
|
|||
}
|
||||
|
||||
/*
|
||||
* if (! $conf->global->LDAP_CONTACT_ACTIVE)
|
||||
* {
|
||||
* if (!getDolGlobalSring('LDAP_CONTACT_ACTIVE')) {
|
||||
* print $langs->trans("LDAPSynchronizationNotSetupInDolibarr");
|
||||
* exit(-1);
|
||||
* }
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ function sendEmailTo($mode, $oldemail, $message, $total, $userlang, $oldtarget,
|
|||
}
|
||||
|
||||
$newlangs = new Translate('', $conf);
|
||||
$newlangs->setDefaultLang(empty($userlang) ? (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT) : $userlang);
|
||||
$newlangs->setDefaultLang(empty($userlang) ? getDolGlobalString('MAIN_LANG_DEFAULT', 'auto') : $userlang);
|
||||
$newlangs->load("main");
|
||||
$newlangs->load("contracts");
|
||||
|
||||
|
|
@ -262,26 +262,26 @@ function sendEmailTo($mode, $oldemail, $message, $total, $userlang, $oldtarget,
|
|||
$title = $newlangs->transnoentities("ListOfServicesToExpire");
|
||||
}
|
||||
|
||||
$subject = (!getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_SUBJECT') ? $title : $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_SUBJECT);
|
||||
$subject = getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_SUBJECT', $title);
|
||||
$sendto = $oldemail;
|
||||
$from = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
$errorsto = $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
|
||||
$errorsto = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
|
||||
$msgishtml = -1;
|
||||
|
||||
print "- Send email to '".$oldtarget."' (".$oldemail."), total: ".$total."\n";
|
||||
dol_syslog("email_expire_services_to_customers.php: send mail to ".$oldemail);
|
||||
|
||||
$usehtml = 0;
|
||||
if (dol_textishtml($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER)) {
|
||||
if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
if (dol_textishtml($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_HEADER)) {
|
||||
if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_HEADER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
|
||||
$allmessage = '';
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_HEADER')) {
|
||||
$allmessage .= $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_HEADER;
|
||||
$allmessage .= getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_HEADER');
|
||||
} else {
|
||||
$allmessage .= "Dear customer".($usehtml ? "<br>\n" : "\n").($usehtml ? "<br>\n" : "\n");
|
||||
$allmessage .= "Please, find a summary of the services contracted by you that are about to expire.".($usehtml ? "<br>\n" : "\n").($usehtml ? "<br>\n" : "\n");
|
||||
|
|
@ -289,8 +289,8 @@ function sendEmailTo($mode, $oldemail, $message, $total, $userlang, $oldtarget,
|
|||
$allmessage .= $message.($usehtml ? "<br>\n" : "\n");
|
||||
// $allmessage.= $langs->trans("Total")." = ".price($total,0,$userlang,0,0,-1,$conf->currency).($usehtml?"<br>\n":"\n");
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER')) {
|
||||
$allmessage .= $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER;
|
||||
if (dol_textishtml($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER)) {
|
||||
$allmessage .= getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER');
|
||||
if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ function sendEmailTo($mode, $oldemail, $message, $total, $userlang, $oldtarget,
|
|||
}
|
||||
|
||||
$newlangs = new Translate('', $conf);
|
||||
$newlangs->setDefaultLang(empty($userlang) ? (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT) : $userlang);
|
||||
$newlangs->setDefaultLang(empty($userlang) ? getDolGlobalString('MAIN_LANG_DEFAULT', 'auto') : $userlang);
|
||||
$newlangs->load("main");
|
||||
$newlangs->load("contracts");
|
||||
|
||||
|
|
@ -211,26 +211,26 @@ function sendEmailTo($mode, $oldemail, $message, $total, $userlang, $oldtarget,
|
|||
$title = $newlangs->transnoentities("ListOfServicesToExpire");
|
||||
}
|
||||
|
||||
$subject = (!getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_SUBJECT') ? $title : $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_SUBJECT);
|
||||
$subject = getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_SUBJECT', $title);
|
||||
$sendto = $oldemail;
|
||||
$from = !getDolGlobalString('MAIN_MAIL_EMAIL_FROM') ? '' : $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
$errorsto = !getDolGlobalString('MAIN_MAIL_ERRORS_TO') ? '' : $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
|
||||
$errorsto = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
|
||||
$msgishtml = -1;
|
||||
|
||||
print "- Send email for ".$oldtarget." (".$oldemail."), total: ".$total."\n";
|
||||
dol_syslog("email_expire_services_to_representatives.php: send mail to ".$oldemail);
|
||||
|
||||
$usehtml = 0;
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER') && dol_textishtml($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER)) {
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER') && dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_HEADER') && dol_textishtml($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_HEADER)) {
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_HEADER') && dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_HEADER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
|
||||
$allmessage = '';
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_HEADER')) {
|
||||
$allmessage .= $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_HEADER;
|
||||
$allmessage .= getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_HEADER');
|
||||
} else {
|
||||
$allmessage .= $title.($usehtml ? "<br>\n" : "\n").($usehtml ? "<br>\n" : "\n");
|
||||
$allmessage .= $newlangs->transnoentities("NoteListOfYourExpiredServices").($usehtml ? "<br>\n" : "\n").($usehtml ? "<br>\n" : "\n");
|
||||
|
|
@ -238,8 +238,8 @@ function sendEmailTo($mode, $oldemail, $message, $total, $userlang, $oldtarget,
|
|||
$allmessage .= $message.($usehtml ? "<br>\n" : "\n");
|
||||
$allmessage .= $langs->trans("Total")." = ".price($total, 0, $userlang, 0, 0, -1, $conf->currency).($usehtml ? "<br>\n" : "\n");
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER')) {
|
||||
$allmessage .= $conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER;
|
||||
if (dol_textishtml($conf->global->SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER)) {
|
||||
$allmessage .= getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER');
|
||||
if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ if (!isModEnabled('cron')) {
|
|||
}
|
||||
|
||||
// Check security key
|
||||
if ($key != $conf->global->CRON_KEY) {
|
||||
if ($key != getDolGlobalString('CRON_KEY')) {
|
||||
print "Error: securitykey is wrong\n";
|
||||
exit(-1);
|
||||
}
|
||||
|
|
@ -142,7 +142,7 @@ if ($result < 0) {
|
|||
}
|
||||
|
||||
// Reload langs
|
||||
$langcode = (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT);
|
||||
$langcode = getDolGlobalString('MAIN_LANG_DEFAULT', 'auto');
|
||||
if (!empty($user->conf->MAIN_LANG_DEFAULT)) {
|
||||
$langcode = $user->conf->MAIN_LANG_DEFAULT;
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ if (is_array($object->lines) && (count($object->lines) > 0)) {
|
|||
}
|
||||
|
||||
// Reload langs
|
||||
$langcode = (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT);
|
||||
$langcode = getDolGlobalString('MAIN_LANG_DEFAULT', 'auto');
|
||||
if (!empty($user->conf->MAIN_LANG_DEFAULT)) {
|
||||
$langcode = $user->conf->MAIN_LANG_DEFAULT;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,8 +86,8 @@ if (!isModEnabled('mailing')) {
|
|||
@set_time_limit(0);
|
||||
print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
||||
|
||||
if (getDolGlobalString('MAILING_DELAY')) {
|
||||
print 'A delay of '.((float) $conf->global->MAILING_DELAY).' seconds has been set between each email'."\n";
|
||||
if (getDolGlobalInt('MAILING_DELAY')) {
|
||||
print 'A delay of '.((float) getDolGlobalInt('MAILING_DELAY')).' seconds has been set between each email'."\n";
|
||||
}
|
||||
|
||||
if (getDolGlobalString('MAILING_LIMIT_SENDBYCLI') == '-1') {
|
||||
|
|
@ -153,7 +153,7 @@ if ($resql) {
|
|||
if (getDolGlobalInt('MAILING_LIMIT_SENDBYCLI') > 0 && empty($max)) {
|
||||
$sql2 .= " LIMIT " . getDolGlobalString('MAILING_LIMIT_SENDBYCLI');
|
||||
} elseif (getDolGlobalInt('MAILING_LIMIT_SENDBYCLI') > 0 && $max > 0) {
|
||||
$sql2 .= " LIMIT ".min($conf->global->MAILING_LIMIT_SENDBYCLI, $max);
|
||||
$sql2 .= " LIMIT ".min(getDolGlobalInt('MAILING_LIMIT_SENDBYCLI'), $max);
|
||||
} elseif ($max > 0) {
|
||||
$sql2 .= " LIMIT ".((int) $max);
|
||||
}
|
||||
|
|
@ -383,8 +383,8 @@ if ($resql) {
|
|||
}
|
||||
}
|
||||
|
||||
if (getDolGlobalString('MAILING_DELAY')) {
|
||||
usleep((float) $conf->global->MAILING_DELAY * 1000000);
|
||||
if (getDolGlobalInt('MAILING_DELAY')) {
|
||||
usleep((float) getDolGlobalInt('MAILING_DELAY') * 1000000);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -250,24 +250,24 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget)
|
|||
}
|
||||
|
||||
$newlangs = new Translate('', $conf);
|
||||
$newlangs->setDefaultLang(empty($userlang) ? (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT) : $userlang);
|
||||
$newlangs->setDefaultLang(empty($userlang) ? getDolGlobalString('MAIN_LANG_DEFAULT', 'auto') : $userlang);
|
||||
$newlangs->load("main");
|
||||
$newlangs->load("bills");
|
||||
|
||||
$subject = (!getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_SUBJECT') ? $newlangs->trans("ListOfYourUnpaidInvoices") : $conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_SUBJECT);
|
||||
$subject = getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_SUBJECT', $newlangs->trans("ListOfYourUnpaidInvoices"));
|
||||
$sendto = $oldemail;
|
||||
$from = !getDolGlobalString('MAIN_MAIL_EMAIL_FROM') ? '' : $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
$errorsto = !getDolGlobalString('MAIN_MAIL_ERRORS_TO') ? '' : $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
|
||||
$errorsto = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
|
||||
$msgishtml = -1;
|
||||
|
||||
print "- Send email to '".$oldtarget."' (".$oldemail."), total: ".$total."\n";
|
||||
dol_syslog("email_unpaid_invoices_to_customers.php: send mail to ".$oldemail);
|
||||
|
||||
$usehtml = 0;
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER') && dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER)) {
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER') && dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER') && dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER)) {
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER') && dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
|
||||
|
|
@ -282,8 +282,8 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget)
|
|||
$allmessage .= $message.($usehtml ? "<br>\n" : "\n");
|
||||
$allmessage .= $langs->trans("Total")." = ".price($total, 0, $userlang, 0, 0, -1, $conf->currency).($usehtml ? "<br>\n" : "\n");
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER')) {
|
||||
$allmessage .= $conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER;
|
||||
if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER)) {
|
||||
$allmessage .= getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER');
|
||||
if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,30 +206,30 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget)
|
|||
}
|
||||
|
||||
$newlangs = new Translate('', $conf);
|
||||
$newlangs->setDefaultLang(empty($userlang) ? (!getDolGlobalString('MAIN_LANG_DEFAULT') ? 'auto' : $conf->global->MAIN_LANG_DEFAULT) : $userlang);
|
||||
$newlangs->setDefaultLang(empty($userlang) ? getDolGlobalString('MAIN_LANG_DEFAULT', 'auto') : $userlang);
|
||||
$newlangs->load("main");
|
||||
$newlangs->load("bills");
|
||||
|
||||
$subject = (!getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_SUBJECT') ? $newlangs->trans("ListOfYourUnpaidInvoices") : $conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_SUBJECT);
|
||||
$subject = getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_SUBJECT', $newlangs->trans("ListOfYourUnpaidInvoices"));
|
||||
$sendto = $oldemail;
|
||||
$from = !getDolGlobalString('MAIN_MAIL_EMAIL_FROM') ? '' : $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
$errorsto = !getDolGlobalString('MAIN_MAIL_ERRORS_TO') ? '' : $conf->global->MAIN_MAIL_ERRORS_TO;
|
||||
$from = getDolGlobalString('MAIN_MAIL_EMAIL_FROM');
|
||||
$errorsto = getDolGlobalString('MAIN_MAIL_ERRORS_TO');
|
||||
$msgishtml = -1;
|
||||
|
||||
print "- Send email for ".$oldtarget." (".$oldemail."), total: ".$total."\n";
|
||||
dol_syslog("email_unpaid_invoices_to_representatives.php: send mail to ".$oldemail);
|
||||
|
||||
$usehtml = 0;
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER') && dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER)) {
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER') && dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER') && dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER)) {
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER') && dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
|
||||
$allmessage = '';
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER')) {
|
||||
$allmessage .= $conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER;
|
||||
$allmessage .= getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_HEADER');
|
||||
} else {
|
||||
$allmessage .= $newlangs->transnoentities("ListOfYourUnpaidInvoices").($usehtml ? "<br>\n" : "\n").($usehtml ? "<br>\n" : "\n");
|
||||
$allmessage .= $newlangs->transnoentities("NoteListOfYourUnpaidInvoices").($usehtml ? "<br>\n" : "\n");
|
||||
|
|
@ -237,8 +237,8 @@ function envoi_mail($mode, $oldemail, $message, $total, $userlang, $oldtarget)
|
|||
$allmessage .= $message.($usehtml ? "<br>\n" : "\n");
|
||||
$allmessage .= $langs->trans("Total")." = ".price($total, 0, $newlangs, 0, 0, -1, $conf->currency).($usehtml ? "<br>\n" : "\n");
|
||||
if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER')) {
|
||||
$allmessage .= $conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER;
|
||||
if (dol_textishtml($conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER)) {
|
||||
$allmessage .= getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER');
|
||||
if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER'))) {
|
||||
$usehtml += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ print "----- To LDAP database:\n";
|
|||
print "host=" . getDolGlobalString('LDAP_SERVER_HOST')."\n";
|
||||
print "port=" . getDolGlobalString('LDAP_SERVER_PORT')."\n";
|
||||
print "login=" . getDolGlobalString('LDAP_ADMIN_DN')."\n";
|
||||
print "pass=".preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)."\n";
|
||||
print "pass=".preg_replace('/./i', '*', getDolGlobalString('LDAP_ADMIN_PASS'))."\n";
|
||||
print "DN target=" . getDolGlobalString('LDAP_MEMBER_DN')."\n";
|
||||
print "\n";
|
||||
|
||||
|
|
@ -104,8 +104,7 @@ if (!$confirmed) {
|
|||
}
|
||||
|
||||
/*
|
||||
* if (! $conf->global->LDAP_MEMBER_ACTIVE)
|
||||
* {
|
||||
* if (getDolGlobalString('LDAP_MEMBER_ACTIVE') {
|
||||
* print $langs->trans("LDAPSynchronizationNotSetupInDolibarr");
|
||||
* exit(-1);
|
||||
* }
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ print "----- Synchronize all records from LDAP database:\n";
|
|||
print "host=" . getDolGlobalString('LDAP_SERVER_HOST')."\n";
|
||||
print "port=" . getDolGlobalString('LDAP_SERVER_PORT')."\n";
|
||||
print "login=" . getDolGlobalString('LDAP_ADMIN_DN')."\n";
|
||||
print "pass=".preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)."\n";
|
||||
print "pass=".preg_replace('/./i', '*', getDolGlobalString('LDAP_ADMIN_PASS'))."\n";
|
||||
print "DN to extract=" . getDolGlobalString('LDAP_MEMBER_DN')."\n";
|
||||
if (getDolGlobalString('LDAP_MEMBER_FILTER')) {
|
||||
print 'Filter=(' . getDolGlobalString('LDAP_MEMBER_FILTER').')'."\n"; // Note: filter is defined into function getRecords
|
||||
|
|
@ -192,7 +192,7 @@ if ($result >= 0) {
|
|||
// We disable synchro Dolibarr-LDAP
|
||||
$conf->global->LDAP_MEMBER_ACTIVE = 0;
|
||||
|
||||
$ldaprecords = $ldap->getRecords('*', $conf->global->LDAP_MEMBER_DN, $conf->global->LDAP_KEY_MEMBERS, $required_fields, 'member'); // Fiter on 'member' filter param
|
||||
$ldaprecords = $ldap->getRecords('*', getDolGlobalString('LDAP_MEMBER_DN'), getDolGlobalString('LDAP_KEY_MEMBERS'), $required_fields, 'member'); // Fiter on 'member' filter param
|
||||
if (is_array($ldaprecords)) {
|
||||
$db->begin();
|
||||
|
||||
|
|
@ -253,16 +253,16 @@ if ($result >= 0) {
|
|||
// print_r($member);
|
||||
|
||||
$datefirst = '';
|
||||
if ($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE) {
|
||||
if (getDolGlobalString('LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE')) {
|
||||
$datefirst = dol_stringtotime($ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE')]);
|
||||
$pricefirst = price2num($ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT')]);
|
||||
}
|
||||
|
||||
$datelast = '';
|
||||
if ($conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE) {
|
||||
if (getDolGlobalString('LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE')) {
|
||||
$datelast = dol_stringtotime($ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE')]);
|
||||
$pricelast = price2num($ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT')]);
|
||||
} elseif ($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION) {
|
||||
} elseif (getDolGlobalString('LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION')) {
|
||||
$datelast = dol_time_plus_duree(dol_stringtotime($ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION')]), -1, 'y') + 60 * 60 * 24;
|
||||
$pricelast = price2num($ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT')]);
|
||||
|
||||
|
|
|
|||
|
|
@ -63,8 +63,7 @@ print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
|||
dol_syslog($script_file." launched with arg ".join(',', $argv));
|
||||
|
||||
/*
|
||||
* if (! $conf->global->LDAP_SYNCHRO_ACTIVE)
|
||||
* {
|
||||
* if (getDolGlobalString('LDAP_SYNCHRO_ACTIVE')) {
|
||||
* print $langs->trans("LDAPSynchronizationNotSetupInDolibarr");
|
||||
* exit(-1);
|
||||
* }
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
|||
dol_syslog($script_file." launched with arg ".join(',', $argv));
|
||||
|
||||
// List of fields to get from LDAP
|
||||
$required_fields = array($conf->global->LDAP_KEY_MEMBERS_TYPES, $conf->global->LDAP_MEMBER_TYPE_FIELD_FULLNAME, $conf->global->LDAP_MEMBER_TYPE_FIELD_DESCRIPTION, $conf->global->LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS);
|
||||
$required_fields = array(getDolGlobalString('LDAP_KEY_MEMBERS_TYPES'), getDolGlobalString('LDAP_MEMBER_TYPE_FIELD_FULLNAME'), getDolGlobalString('LDAP_MEMBER_TYPE_FIELD_DESCRIPTION'), getDolGlobalString('LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS'));
|
||||
|
||||
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
|
||||
$required_fields = array_unique(array_values(array_filter($required_fields, "dolValidElementType")));
|
||||
|
|
@ -100,7 +100,7 @@ print "----- Synchronize all records from LDAP database:\n";
|
|||
print "host=" . getDolGlobalString('LDAP_SERVER_HOST')."\n";
|
||||
print "port=" . getDolGlobalString('LDAP_SERVER_PORT')."\n";
|
||||
print "login=" . getDolGlobalString('LDAP_ADMIN_DN')."\n";
|
||||
print "pass=".preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)."\n";
|
||||
print "pass=".preg_replace('/./i', '*', getDolGlobalString('LDAP_ADMIN_PASS'))."\n";
|
||||
print "DN to extract=" . getDolGlobalString('LDAP_MEMBER_TYPE_DN')."\n";
|
||||
print 'Filter=(' . getDolGlobalString('LDAP_KEY_MEMBERS_TYPES').'=*)'."\n";
|
||||
print "----- To Dolibarr database:\n";
|
||||
|
|
@ -132,7 +132,7 @@ if ($result >= 0) {
|
|||
// We disable synchro Dolibarr-LDAP
|
||||
$conf->global->LDAP_MEMBER_TYPE_ACTIVE = 0;
|
||||
|
||||
$ldaprecords = $ldap->getRecords('*', $conf->global->LDAP_MEMBER_TYPE_DN, $conf->global->LDAP_KEY_MEMBERS_TYPES, $required_fields, 0, array($conf->global->LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS));
|
||||
$ldaprecords = $ldap->getRecords('*', getDolGlobalString('LDAP_MEMBER_TYPE_DN'), getDolGlobalString('LDAP_KEY_MEMBERS_TYPES'), $required_fields, 0, array(getDolGlobalString('LDAP_MEMBER_TYPE_FIELD_GROUPMEMBERS')));
|
||||
if (is_array($ldaprecords)) {
|
||||
$db->begin();
|
||||
|
||||
|
|
|
|||
|
|
@ -61,8 +61,7 @@ print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
|||
dol_syslog($script_file." launched with arg ".join(',', $argv));
|
||||
|
||||
/*
|
||||
* if (! $conf->global->LDAP_SYNCHRO_ACTIVE)
|
||||
* {
|
||||
* if (getDolGlobalString('LDAP_SYNCHRO_ACTIVE')) {
|
||||
* print $langs->trans("LDAPSynchronizationNotSetupInDolibarr");
|
||||
* exit(-1);
|
||||
* }
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ print "***** ".$script_file." (".$version.") pid=".dol_getmypid()." *****\n";
|
|||
dol_syslog($script_file." launched with arg ".join(',', $argv));
|
||||
|
||||
// List of fields to get from LDAP
|
||||
$required_fields = array($conf->global->LDAP_KEY_GROUPS, $conf->global->LDAP_GROUP_FIELD_FULLNAME, $conf->global->LDAP_GROUP_FIELD_DESCRIPTION, $conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS);
|
||||
$required_fields = array(getDolGlobalString('LDAP_KEY_GROUPS'), getDolGlobalString('LDAP_GROUP_FIELD_FULLNAME'), getDolGlobalString('LDAP_GROUP_FIELD_DESCRIPTION'), getDolGlobalString('LDAP_GROUP_FIELD_GROUPMEMBERS'));
|
||||
|
||||
// Remove from required_fields all entries not configured in LDAP (empty) and duplicated
|
||||
$required_fields = array_unique(array_values(array_filter($required_fields, "dolValidElement")));
|
||||
|
|
@ -95,7 +95,7 @@ print "----- Synchronize all records from LDAP database:\n";
|
|||
print "host=" . getDolGlobalString('LDAP_SERVER_HOST')."\n";
|
||||
print "port=" . getDolGlobalString('LDAP_SERVER_PORT')."\n";
|
||||
print "login=" . getDolGlobalString('LDAP_ADMIN_DN')."\n";
|
||||
print "pass=".preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)."\n";
|
||||
print "pass=".preg_replace('/./i', '*', getDolGlobalString('LDAP_ADMIN_PASS'))."\n";
|
||||
print "DN to extract=" . getDolGlobalString('LDAP_GROUP_DN')."\n";
|
||||
if (getDolGlobalString('LDAP_GROUP_FILTER')) {
|
||||
print 'Filter=(' . getDolGlobalString('LDAP_GROUP_FILTER').')'."\n"; // Note: filter is defined into function getRecords
|
||||
|
|
@ -131,7 +131,7 @@ if ($result >= 0) {
|
|||
// We disable synchro Dolibarr-LDAP
|
||||
$conf->global->LDAP_SYNCHRO_ACTIVE = 0;
|
||||
|
||||
$ldaprecords = $ldap->getRecords('*', $conf->global->LDAP_GROUP_DN, $conf->global->LDAP_KEY_GROUPS, $required_fields, 'group', array($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS));
|
||||
$ldaprecords = $ldap->getRecords('*', getDolGlobalString('LDAP_GROUP_DN'), getDolGlobalString('LDAP_KEY_GROUPS'), $required_fields, 'group', array(getDolGlobalString('LDAP_GROUP_FIELD_GROUPMEMBERS')));
|
||||
if (is_array($ldaprecords)) {
|
||||
$db->begin();
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue