Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2022-09-20 10:17:53 +02:00
commit eab8af760d
85 changed files with 622 additions and 431 deletions

View File

@ -291,16 +291,16 @@ print $formadmin->select_paper_format($selected, 'MAIN_PDF_FORMAT');
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_LEFT").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_LEFT").'</td><td>';
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_LEFT" value="'.(empty($conf->global->MAIN_PDF_MARGIN_LEFT) ? 10 : $conf->global->MAIN_PDF_MARGIN_LEFT).'">'; print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_LEFT" value="'.getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10).'">';
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_RIGHT").'</td><td>';
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_RIGHT" value="'.(empty($conf->global->MAIN_PDF_MARGIN_RIGHT) ? 10 : $conf->global->MAIN_PDF_MARGIN_RIGHT).'">'; print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_RIGHT" value="'.getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10).'">';
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_TOP").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_TOP").'</td><td>';
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_TOP" value="'.(empty($conf->global->MAIN_PDF_MARGIN_TOP) ? 10 : $conf->global->MAIN_PDF_MARGIN_TOP).'">'; print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_TOP" value="'.getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10).'">';
print '</td></tr>'; print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>'; print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_MARGIN_BOTTOM").'</td><td>';
print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_BOTTOM" value="'.(empty($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? 10 : $conf->global->MAIN_PDF_MARGIN_BOTTOM).'">'; print '<input type="text" class="maxwidth50" name="MAIN_PDF_MARGIN_BOTTOM" value="'.getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10).'">';
print '</td></tr>'; print '</td></tr>';
print '</table>'; print '</table>';

View File

@ -1369,8 +1369,7 @@ class BOM extends CommonObject
$unit = measuringUnitString($line->fk_unit, '', '', 1); $unit = measuringUnitString($line->fk_unit, '', '', 1);
$qty = convertDurationtoHour($line->qty, $unit); $qty = convertDurationtoHour($line->qty, $unit);
if ($conf->workstation->enabled) { if ($conf->workstation->enabled && !empty($tmpproduct->fk_default_workstation)) {
if ($tmpproduct->fk_default_workstation) {
$workstation = new Workstation($this->db); $workstation = new Workstation($this->db);
$res = $workstation->fetch($tmpproduct->fk_default_workstation); $res = $workstation->fetch($tmpproduct->fk_default_workstation);
@ -1379,7 +1378,6 @@ class BOM extends CommonObject
$this->error = $workstation->error; $this->error = $workstation->error;
return -3; return -3;
} }
}
} else { } else {
$line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT'); $line->total_cost = price2num($qty * $tmpproduct->cost_price, 'MT');
} }

View File

@ -286,8 +286,8 @@ if ($nb) {
if ($type != 'bank-transfer') { if ($type != 'bank-transfer') {
print '<select name="format">'; print '<select name="format">';
print '<option value="FRST"'.(GETPOST('format', 'aZ09') == 'FRST' ? ' selected="selected"' : '').'>'.$langs->trans('SEPAFRST').'</option>'; print '<option value="FRST"'.($format == 'FRST' ? ' selected="selected"' : '').'>'.$langs->trans('SEPAFRST').'</option>';
print '<option value="RCUR"'.(GETPOST('format', 'aZ09') == 'RCUR' ? ' selected="selected"' : '').'>'.$langs->trans('SEPARCUR').'</option>'; print '<option value="RCUR"'.($format == 'RCUR' ? ' selected="selected"' : '').'>'.$langs->trans('SEPARCUR').'</option>';
print '</select>'; print '</select>';
} }
print '<input type="submit" class="butAction" value="'.$title.'"/>'; print '<input type="submit" class="butAction" value="'.$title.'"/>';

View File

@ -851,6 +851,7 @@ class ExtraFields
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$count = 0;
if ($this->db->num_rows($resql)) { if ($this->db->num_rows($resql)) {
while ($tab = $this->db->fetch_object($resql)) { while ($tab = $this->db->fetch_object($resql)) {
if ($tab->entity != 0 && $tab->entity != $conf->entity) { if ($tab->entity != 0 && $tab->entity != $conf->entity) {
@ -890,10 +891,12 @@ class ExtraFields
$this->attributes[$tab->elementtype]['csslist'][$tab->name] = $tab->csslist; $this->attributes[$tab->elementtype]['csslist'][$tab->name] = $tab->csslist;
$this->attributes[$tab->elementtype]['loaded'] = 1; $this->attributes[$tab->elementtype]['loaded'] = 1;
$count++;
} }
} }
if ($elementtype) { if ($elementtype) {
$this->attributes[$elementtype]['loaded'] = 1; // If nothing found, we also save tag 'loaded' $this->attributes[$elementtype]['loaded'] = 1; // If nothing found, we also save tag 'loaded'
$this->attributes[$elementtype]['count'] = $count;
} }
} else { } else {
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
@ -1688,8 +1691,8 @@ class ExtraFields
if (!empty($obj->$field_toshow)) { if (!empty($obj->$field_toshow)) {
$translabel = $langs->trans($obj->$field_toshow); $translabel = $langs->trans($obj->$field_toshow);
} }
if ($translabel != $field_toshow) { if ($translabel != $obj->$field_toshow) {
$value .= dol_trunc($translabel, 18).' '; $value .= dol_trunc($translabel, 24).' ';
} else { } else {
$value .= $obj->$field_toshow.' '; $value .= $obj->$field_toshow.' ';
} }

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -313,7 +314,7 @@ function show_array_last_actions_done($max = 5)
print '<tr class="oddeven">'; print '<tr class="oddeven">';
$staticaction->type_code = $obj->code; $staticaction->type_code = $obj->code;
$staticaction->libelle = $obj->label; $staticaction->label = $obj->label;
$staticaction->id = $obj->id; $staticaction->id = $obj->id;
print '<td>'.$staticaction->getNomUrl(1, 34).'</td>'; print '<td>'.$staticaction->getNomUrl(1, 34).'</td>';
@ -362,7 +363,11 @@ function show_array_last_actions_done($max = 5)
*/ */
function agenda_prepare_head() function agenda_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('actioncomm');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -395,6 +400,10 @@ function agenda_prepare_head()
$head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php";
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['actioncomm']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2018-2022 OpenDSI <support@open-dsi.fr> /* Copyright (C) 2018-2022 OpenDSI <support@open-dsi.fr>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -28,7 +29,11 @@
*/ */
function assetAdminPrepareHead() function assetAdminPrepareHead()
{ {
global $langs, $conf; global $langs, $conf, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('asset');
$extrafields->fetch_name_optionals_label('asset_model');
$langs->load("assets"); $langs->load("assets");
@ -52,11 +57,19 @@ function assetAdminPrepareHead()
$head[$h][0] = DOL_URL_ROOT.'/asset/admin/asset_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/asset/admin/asset_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['asset']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'asset_extrafields'; $head[$h][2] = 'asset_extrafields';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/asset/admin/assetmodel_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/asset/admin/assetmodel_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsAssetModel"); $head[$h][1] = $langs->trans("ExtraFieldsAssetModel");
$nbExtrafields = $extrafields->attributes['asset_model']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'assetmodel_extrafields'; $head[$h][2] = 'assetmodel_extrafields';
$h++; $h++;

View File

@ -108,7 +108,11 @@ function contract_prepare_head(Contrat $object)
*/ */
function contract_admin_prepare_head() function contract_admin_prepare_head()
{ {
global $langs, $conf; global $langs, $conf, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('contrat');
$extrafields->fetch_name_optionals_label('contratdet');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -126,11 +130,19 @@ function contract_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contract_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['contrat']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/contrat/admin/contractdet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][1] = $langs->trans("ExtraFieldsLines");
$nbExtrafields = $extrafields->attributes['contratdet']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributeslines'; $head[$h][2] = 'attributeslines';
$h++; $h++;

View File

@ -121,7 +121,9 @@ function getServerTimeZoneInt($refgmtdate = 'now')
function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0) function dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth = 0)
{ {
global $conf; global $conf;
if ($duration_unit == 's') {
return $time + ($duration_value);
}
if ($duration_value == 0) { if ($duration_value == 0) {
return $time; return $time;
} }

View File

@ -28,7 +28,10 @@
*/ */
function donation_admin_prepare_head() function donation_admin_prepare_head()
{ {
global $langs, $conf; global $langs, $conf, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('don');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -46,6 +49,10 @@ function donation_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/don/admin/donation_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/don/admin/donation_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['don']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -160,7 +161,12 @@ function ecm_prepare_head_fm($object)
*/ */
function ecm_admin_prepare_head() function ecm_admin_prepare_head()
{ {
global $langs, $conf; global $langs, $conf, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('ecm_files');
$extrafields->fetch_name_optionals_label('ecm_directories');
$langs->load("ecm"); $langs->load("ecm");
$h = 0; $h = 0;
@ -173,11 +179,19 @@ function ecm_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/admin/ecm_files_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_files_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsEcmFiles"); $head[$h][1] = $langs->trans("ExtraFieldsEcmFiles");
$nbExtrafields = $extrafields->attributes['ecm_files']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes_ecm_files'; $head[$h][2] = 'attributes_ecm_files';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/admin/ecm_directories_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/ecm_directories_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsEcmDirectories"); $head[$h][1] = $langs->trans("ExtraFieldsEcmDirectories");
$nbExtrafields = $extrafields->attributes['ecm_directories']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes_ecm_directories'; $head[$h][2] = 'attributes_ecm_directories';
$h++; $h++;

View File

@ -279,7 +279,11 @@ function productlot_prepare_head($object)
*/ */
function product_admin_prepare_head() function product_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('product');
$extrafields->fetch_name_optionals_label('product_fournisseur_price');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -306,11 +310,19 @@ function product_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['product']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/product/admin/product_supplier_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_supplier_extrafields.php';
$head[$h][1] = $langs->trans("ProductSupplierExtraFields"); $head[$h][1] = $langs->trans("ProductSupplierExtraFields");
$nbExtrafields = $extrafields->attributes['product_fournisseur_price']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'supplierAttributes'; $head[$h][2] = 'supplierAttributes';
$h++; $h++;
@ -556,11 +568,11 @@ function show_stats_for_company($product, $socid)
} }
// MO // MO
if (!empty($conf->mrp->enabled) && $user->rights->mrp->read) { if (!empty($conf->mrp->enabled) && !empty($user->rights->mrp->read)) {
$nblines++; $nblines++;
$ret = $product->load_stats_mo($socid); $ret = $product->load_stats_mo($socid);
if ($ret < 0) { if ($ret < 0) {
setEventMessage($product->error, 'errors'); setEventMessages($product->error, $product->errors, 'errors');
} }
$langs->load("mrp"); $langs->load("mrp");
print '<tr><td>'; print '<tr><td>';
@ -585,7 +597,9 @@ function show_stats_for_company($product, $socid)
} }
$parameters = array('socid'=>$socid); $parameters = array('socid'=>$socid);
$reshook = $hookmanager->executeHooks('addMoreProductStat', $parameters, $product, $nblines); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('addMoreProductStat', $parameters, $product, $nblines); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
print $hookmanager->resPrint; print $hookmanager->resPrint;

View File

@ -487,11 +487,14 @@ function project_timesheet_prepare_head($mode, $fuser = null)
*/ */
function project_admin_prepare_head() function project_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$h = 0;
$head = array(); $extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('projet');
$extrafields->fetch_name_optionals_label('projet_task');
$h = 0; $h = 0;
$head = array();
$head[$h][0] = DOL_URL_ROOT."/projet/admin/project.php"; $head[$h][0] = DOL_URL_ROOT."/projet/admin/project.php";
$head[$h][1] = $langs->trans("Projects"); $head[$h][1] = $langs->trans("Projects");
@ -502,11 +505,19 @@ function project_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT."/projet/admin/project_extrafields.php"; $head[$h][0] = DOL_URL_ROOT."/projet/admin/project_extrafields.php";
$head[$h][1] = $langs->trans("ExtraFieldsProject"); $head[$h][1] = $langs->trans("ExtraFieldsProject");
$nbExtrafields = $extrafields->attributes['projet']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/projet/admin/project_task_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/projet/admin/project_task_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsProjectTask"); $head[$h][1] = $langs->trans("ExtraFieldsProjectTask");
$nbExtrafields = $extrafields->attributes['projet_task']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes_task'; $head[$h][2] = 'attributes_task';
$h++; $h++;

View File

@ -122,7 +122,11 @@ function propal_prepare_head($object)
*/ */
function propal_admin_prepare_head() function propal_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('propal');
$extrafields->fetch_name_optionals_label('propaldet');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -140,11 +144,19 @@ function propal_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/comm/admin/propal_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propal_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['propal']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/comm/admin/propaldet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][1] = $langs->trans("ExtraFieldsLines");
$nbExtrafields = $extrafields->attributes['propaldet']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributeslines'; $head[$h][2] = 'attributeslines';
$h++; $h++;

View File

@ -88,7 +88,12 @@ function stock_prepare_head($object)
*/ */
function stock_admin_prepare_head() function stock_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('entrepot');
$extrafields->fetch_name_optionals_label('stock_mouvement');
$extrafields->fetch_name_optionals_label('inventory');
$h = 0; $h = 0;
$head = array(); $head = array();
@ -106,16 +111,28 @@ function stock_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['entrepot']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_mouvement_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/product/admin/stock_mouvement_extrafields.php';
$head[$h][1] = $langs->trans("StockMouvementExtraFields"); $head[$h][1] = $langs->trans("StockMouvementExtraFields");
$nbExtrafields = $extrafields->attributes['stock_mouvement']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'stockMouvementAttributes'; $head[$h][2] = 'stockMouvementAttributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/product/admin/inventory_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/product/admin/inventory_extrafields.php';
$head[$h][1] = $langs->trans("InventoryExtraFields"); $head[$h][1] = $langs->trans("InventoryExtraFields");
$nbExtrafields = $extrafields->attributes['inventory']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'inventoryAttributes'; $head[$h][2] = 'inventoryAttributes';
$h++; $h++;

View File

@ -30,7 +30,10 @@
*/ */
function ticketAdminPrepareHead() function ticketAdminPrepareHead()
{ {
global $langs, $conf; global $langs, $conf, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('ticket');
$langs->load("ticket"); $langs->load("ticket");
@ -44,6 +47,10 @@ function ticketAdminPrepareHead()
$head[$h][0] = DOL_URL_ROOT.'/admin/ticket_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/ticket_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsTicket"); $head[$h][1] = $langs->trans("ExtraFieldsTicket");
$nbExtrafields = $extrafields->attributes['ticket']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;

View File

@ -250,7 +250,11 @@ function group_prepare_head($object)
*/ */
function user_admin_prepare_head() function user_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('user');
$extrafields->fetch_name_optionals_label('usergroup');
$langs->load("users"); $langs->load("users");
$h = 0; $h = 0;
@ -268,11 +272,19 @@ function user_admin_prepare_head()
$head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/user/admin/user_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Users").")"; $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Users").")";
$nbExtrafields = $extrafields->attributes['user']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes'; $head[$h][2] = 'attributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT.'/user/admin/group_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/user/admin/group_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Groups").")"; $head[$h][1] = $langs->trans("ExtraFields")." (".$langs->trans("Groups").")";
$nbExtrafields = $extrafields->attributes['usergroup']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes_group'; $head[$h][2] = 'attributes_group';
$h++; $h++;

View File

@ -114,7 +114,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'member', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "members") ? 0 : 1),
'loadLangs' => array(), 'loadLangs' => array("members"),
'submenus' => array(), 'submenus' => array(),
); );
@ -170,7 +170,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'product', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "products") ? 0 : 1),
'loadLangs' => array("products"), 'loadLangs' => array("products", "stocks"),
'submenus' => array(), 'submenus' => array(),
); );
@ -379,7 +379,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'hrm', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "hrm") ? 0 : 1),
'loadLangs' => array("holiday"), 'loadLangs' => array("hrm", "holiday"),
'submenus' => array(), 'submenus' => array(),
); );
@ -410,7 +410,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"', 'classname' => $classname = (!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 'class="tmenusel"' : 'class="tmenu"',
'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'), 'prefix' => img_picto('', 'ticket', 'class="fa-fw paddingright pictofixedwidth"'),
'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1), 'session' => ((!empty($_SESSION["mainmenu"]) && $_SESSION["mainmenu"] == "ticket") ? 0 : 1),
'loadLangs' => array("other"), 'loadLangs' => array("ticket", "knowledgemanagement"),
'submenus' => array(), 'submenus' => array(),
); );

View File

@ -98,10 +98,10 @@ class CommActionRapport
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; $this->title = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;
$this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month; $this->subject = $langs->transnoentitiesnoconv("ActionsReport").' '.$this->year."-".$this->month;

View File

@ -156,10 +156,10 @@ class pdf_standard_asset extends ModelePDFAsset
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
// Get source company // Get source company
$this->emetteur = $mysoc; $this->emetteur = $mysoc;

View File

@ -67,10 +67,10 @@ class pdf_ban extends ModeleBankAccountDoc
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -70,10 +70,10 @@ class pdf_sepamandate extends ModeleBankAccountDoc
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -63,10 +63,10 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
// Retrieves transmitter // Retrieves transmitter
$this->emetteur = $mysoc; $this->emetteur = $mysoc;

View File

@ -149,10 +149,10 @@ class pdf_einstein extends ModelePDFCommandes
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -154,10 +154,10 @@ class pdf_eratosthene extends ModelePDFCommandes
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -145,10 +145,10 @@ class pdf_strato extends ModelePDFContract
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION

View File

@ -140,10 +140,10 @@ class pdf_storm extends ModelePDFDeliveryOrder
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -139,10 +139,10 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -134,10 +134,10 @@ class pdf_espadon extends ModelePdfExpedition
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -135,10 +135,10 @@ class pdf_merou extends ModelePdfExpedition
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = round($formatarray['height'] / 2); $this->page_hauteur = round($formatarray['height'] / 2);
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo

View File

@ -135,10 +135,10 @@ class pdf_rouget extends ModelePdfExpedition
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -119,10 +119,10 @@ class pdf_standard extends ModeleExpenseReport
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -155,10 +155,10 @@ class pdf_crabe extends ModelePDFFactures
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -182,10 +182,10 @@ class pdf_sponge extends ModelePDFFactures
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -137,10 +137,10 @@ class pdf_soleil extends ModelePDFFicheinter
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 0; // Manage the vat option FACTURE_TVAOPTION

View File

@ -1,8 +1,7 @@
<?php <?php
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2021 SuperAdmin
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr> * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -63,8 +62,6 @@ class modStockTransfer extends DolibarrModules
$this->description = $langs->trans("ModuleStockTransferDesc"); $this->description = $langs->trans("ModuleStockTransferDesc");
// Used only if file README.md and README-LL.md not found. // Used only if file README.md and README-LL.md not found.
$this->descriptionlong = "StockTransfer description (Long)"; $this->descriptionlong = "StockTransfer description (Long)";
$this->editor_name = 'Editor name';
$this->editor_url = 'https://www.example.com';
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = 'development'; $this->version = 'development';
// Url to the file with your last numberversion of this module // Url to the file with your last numberversion of this module
@ -127,7 +124,7 @@ class modStockTransfer extends DolibarrModules
$this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...) $this->requiredby = array(); // List of module class names as string to disable if this one is disabled. Example: array('modModuleToDisable1', ...)
$this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...) $this->conflictwith = array(); // List of module class names as string this module is in conflict with. Example: array('modModuleToDisable1', ...)
$this->langfiles = array("stocktransfer@stocktransfer"); $this->langfiles = array("stocktransfer@stocktransfer");
$this->phpmin = array(5, 5); // Minimum version of PHP required by module $this->phpmin = array(5, 6); // Minimum version of PHP required by module
$this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module $this->need_dolibarr_version = array(11, -3); // Minimum version of Dolibarr required by module
$this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','ES'='textes'...)
$this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...) $this->warnings_activation_ext = array(); // Warning to show when we activate an external module. array('always'='text') or array('FR'='textfr','ES'='textes'...)

View File

@ -2,7 +2,6 @@
/* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018-2019 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2019-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2022 SuperAdmin <test@dolibarr.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -67,10 +66,6 @@ class modWebhook extends DolibarrModules
// Used only if file README.md and README-LL.md not found. // Used only if file README.md and README-LL.md not found.
$this->descriptionlong = "WebhookDescription"; $this->descriptionlong = "WebhookDescription";
// Author
$this->editor_name = 'Editor name';
$this->editor_url = 'https://www.example.com';
// Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z'
$this->version = 'development'; $this->version = 'development';
// Url to the file with your last numberversion of this module // Url to the file with your last numberversion of this module

View File

@ -116,10 +116,10 @@ class pdf_standard extends ModelePDFMovement
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_codestockservice = 0; // Display stock-service code $this->option_codestockservice = 0; // Display stock-service code

View File

@ -144,10 +144,10 @@ class pdf_vinci extends ModelePDFMo
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_multilang = 1; //Available in several languages $this->option_multilang = 1; //Available in several languages

View File

@ -97,10 +97,10 @@ class pdf_standard extends ModelePDFProduct
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_multilang = 1; // Available in several languages $this->option_multilang = 1; // Available in several languages

View File

@ -139,10 +139,10 @@ class pdf_baleine extends ModelePDFProjects
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -175,10 +175,10 @@ class pdf_beluga extends ModelePDFProjects
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
} }
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -138,10 +138,10 @@ class pdf_timespent extends ModelePDFProjects
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo FAC_PDF_LOGO $this->option_logo = 1; // Display logo FAC_PDF_LOGO
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -145,10 +145,10 @@ class pdf_azur extends ModelePDFPropales
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -148,10 +148,10 @@ class pdf_cyan extends ModelePDFPropales
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -54,10 +54,10 @@ class pdf_paiement
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->tab_top = 30; $this->tab_top = 30;

View File

@ -57,10 +57,10 @@ class pdf_squille extends ModelePdfReception
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_draft_watermark = 1; // Support add of a watermark on drafts $this->option_draft_watermark = 1; // Support add of a watermark on drafts

View File

@ -111,10 +111,10 @@ class pdf_standard extends ModelePDFStock
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_codestockservice = 0; // Display product-service code $this->option_codestockservice = 0; // Display product-service code

View File

@ -131,10 +131,10 @@ class pdf_eagle extends ModelePdfStockTransfer
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo

View File

@ -145,10 +145,10 @@ class pdf_eagle_proforma extends ModelePDFCommandes
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -141,10 +141,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -143,10 +143,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -143,10 +143,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -114,10 +114,10 @@ class pdf_standard extends ModelePDFSuppliersPayments
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_multilang = 1; // Available in several languages $this->option_multilang = 1; // Available in several languages

View File

@ -973,7 +973,7 @@ class Delivery extends CommonObject
$sqlSourceLine .= ", p.ref, p.label"; $sqlSourceLine .= ", p.ref, p.label";
$sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st"; $sqlSourceLine .= " FROM ".MAIN_DB_PREFIX.$this->linkedObjectsIds[0]['type']."det as st";
$sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid"; $sqlSourceLine .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON st.fk_product = p.rowid";
$sqlSourceLine .= " WHERE fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']); $sqlSourceLine .= " WHERE fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']);
$resultSourceLine = $this->db->query($sqlSourceLine); $resultSourceLine = $this->db->query($sqlSourceLine);
if ($resultSourceLine) { if ($resultSourceLine) {
@ -986,12 +986,12 @@ class Delivery extends CommonObject
// Get lines of sources alread delivered // Get lines of sources alread delivered
$sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty"; $sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty";
$sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,"; $sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,";
$sql .= " ".MAIN_DB_PREFIX.$this->linked_object[0]['type']." as c"; $sql .= " ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']." as c";
$sql .= ", ".MAIN_DB_PREFIX.$this->linked_object[0]['type']."det as cd"; $sql .= ", ".MAIN_DB_PREFIX.$this->linked_objects[0]['type']."det as cd";
$sql .= " WHERE ld.fk_delivery = l.rowid"; $sql .= " WHERE ld.fk_delivery = l.rowid";
$sql .= " AND ld.fk_origin_line = cd.rowid"; $sql .= " AND ld.fk_origin_line = cd.rowid";
$sql .= " AND cd.fk_".$this->linked_object[0]['type']." = c.rowid"; $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = c.rowid";
$sql .= " AND cd.fk_".$this->linked_object[0]['type']." = ".((int) $this->linked_object[0]['linkid']); $sql .= " AND cd.fk_".$this->linked_objects[0]['type']." = ".((int) $this->linked_objects[0]['linkid']);
$sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid); $sql .= " AND ld.fk_origin_line = ".((int) $objSourceLine->rowid);
$sql .= " GROUP BY ld.fk_origin_line"; $sql .= " GROUP BY ld.fk_origin_line";

View File

@ -16,37 +16,38 @@
*/ */
/** /**
* \file emailcollector/class/emailcollector.class.php * \file htdocs/emailcollector/class/emailcollector.class.php
* \ingroup emailcollector * \ingroup emailcollector
* \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete) * \brief This file is a CRUD class file for EmailCollector (Create/Read/Update/Delete)
*/ */
// Put here all includes required by your class file // Put here all includes required by your class file
require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; include_once DOL_DOCUMENT_ROOT .'/emailcollector/lib/emailcollector.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; // customer proposal require_once DOL_DOCUMENT_ROOT .'/core/class/commonobject.class.php';
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; // customer order require_once DOL_DOCUMENT_ROOT .'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; // Shipment
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; // supplier invoice require_once DOL_DOCUMENT_ROOT .'/comm/propal/class/propal.class.php'; // Customer Proposal
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php'; // supplier order require_once DOL_DOCUMENT_ROOT .'/commande/class/commande.class.php'; // Customer Order
require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php'; // supplier proposal require_once DOL_DOCUMENT_ROOT .'/compta/facture/class/facture.class.php'; // Customer Invoice
require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php'; // reception require_once DOL_DOCUMENT_ROOT .'/contact/class/contact.class.php'; // Contact / Address
include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php'; require_once DOL_DOCUMENT_ROOT .'/expedition/class/expedition.class.php'; // Shipping / Delivery
//require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php'; // Holidays (leave request) require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.commande.class.php'; // Supplier Order
//require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; // expernse repor require_once DOL_DOCUMENT_ROOT .'/fourn/class/fournisseur.facture.class.php'; // Supplier Invoice
require_once DOL_DOCUMENT_ROOT .'/projet/class/project.class.php'; // Project
require_once DOL_DOCUMENT_ROOT .'/reception/class/reception.class.php'; // Reception
require_once DOL_DOCUMENT_ROOT .'/recruitment/class/recruitmentcandidature.class.php'; // Recruiting
require_once DOL_DOCUMENT_ROOT .'/societe/class/societe.class.php'; // Third-Party
require_once DOL_DOCUMENT_ROOT .'/supplier_proposal/class/supplier_proposal.class.php'; // Supplier Proposal
require_once DOL_DOCUMENT_ROOT .'/ticket/class/ticket.class.php'; // Ticket
//require_once DOL_DOCUMENT_ROOT .'/expensereport/class/expensereport.class.php'; // Expense Report
//require_once DOL_DOCUMENT_ROOT .'/holiday/class/holiday.class.php'; // Holidays (leave request)
// use Webklex\PHPIMAP; // use Webklex\PHPIMAP;
require DOL_DOCUMENT_ROOT.'/includes/webklex/php-imap/vendor/autoload.php'; require DOL_DOCUMENT_ROOT .'/includes/webklex/php-imap/vendor/autoload.php';
use Webklex\PHPIMAP\ClientManager;
use Webklex\PHPIMAP\ClientManager;
use Webklex\PHPIMAP\Exceptions\ConnectionFailedException; use Webklex\PHPIMAP\Exceptions\ConnectionFailedException;
use Webklex\PHPIMAP\Exceptions\InvalidWhereQueryCriteriaException; use Webklex\PHPIMAP\Exceptions\InvalidWhereQueryCriteriaException;
use Webklex\PHPIMAP\Exceptions\GetMessagesFailedException; use Webklex\PHPIMAP\Exceptions\GetMessagesFailedException;
@ -64,14 +65,17 @@ class EmailCollector extends CommonObject
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element = 'emailcollector'; public $element = 'emailcollector';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'emailcollector_emailcollector'; public $table_element = 'emailcollector_emailcollector';
/** /**
* @var int Does emailcollector support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe * @var int Does emailcollector support multicompany module ? 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
*/ */
public $ismultientitymanaged = 1; public $ismultientitymanaged = 1;
/** /**
* @var int Does emailcollector support extrafields ? 0=No, 1=Yes * @var int Does emailcollector support extrafields ? 0=No, 1=Yes
*/ */
@ -91,6 +95,7 @@ class EmailCollector extends CommonObject
* @var array List of child tables. To test if we can delete object. * @var array List of child tables. To test if we can delete object.
*/ */
protected $childtables = array(); protected $childtables = array();
/** /**
* @var array List of child tables. To know object to delete on cascade. * @var array List of child tables. To know object to delete on cascade.
*/ */
@ -206,7 +211,6 @@ class EmailCollector extends CommonObject
*/ */
public $import_key; public $import_key;
public $host; public $host;
public $port; public $port;
public $hostcharset; public $hostcharset;
@ -1747,61 +1751,61 @@ class EmailCollector extends CommonObject
$objectid = $reg[2]; $objectid = $reg[2];
// See also list into interface_50_modAgenda_ActionsAuto // See also list into interface_50_modAgenda_ActionsAuto
if ($reg[1] == 'thi') { if ($reg[1] == 'thi') { // Third-party
$objectemail = new Societe($this->db); $objectemail = new Societe($this->db);
} }
if ($reg[1] == 'ctc') { if ($reg[1] == 'ctc') { // Contact
$objectemail = new Contact($this->db); $objectemail = new Contact($this->db);
} }
if ($reg[1] == 'inv') { // customer invoices if ($reg[1] == 'inv') { // Customer Invoice
$objectemail = new Facture($this->db); $objectemail = new Facture($this->db);
} }
if ($reg[1] == 'sinv') { // supplier invoices if ($reg[1] == 'sinv') { // Supplier Invoice
$objectemail = new FactureFournisseur($this->db); $objectemail = new FactureFournisseur($this->db);
} }
if ($reg[1] == 'pro') { // customer proposals if ($reg[1] == 'pro') { // Customer Proposal
$objectemail = new Propal($this->db); $objectemail = new Propal($this->db);
} }
if ($reg[1] == 'ord') { // customer orders if ($reg[1] == 'ord') { // Customer Order
$objectemail = new Commande($this->db); $objectemail = new Commande($this->db);
} }
if ($reg[1] == 'shi') { // shipments if ($reg[1] == 'shi') { // Shipment
$objectemail = new Expedition($this->db); $objectemail = new Expedition($this->db);
} }
if ($reg[1] == 'spro') { // supplier proposal if ($reg[1] == 'spro') { // Supplier Proposal
$objectemail = new SupplierProposal($this->db); $objectemail = new SupplierProposal($this->db);
} }
if ($reg[1] == 'sord') { // supplier order if ($reg[1] == 'sord') { // Supplier Order
$objectemail = new CommandeFournisseur($this->db); $objectemail = new CommandeFournisseur($this->db);
} }
if ($reg[1] == 'rec') { // Reception if ($reg[1] == 'rec') { // Reception
$objectemail = new Reception($this->db); $objectemail = new Reception($this->db);
} }
if ($reg[1] == 'proj') { if ($reg[1] == 'proj') { // Project
$objectemail = new Project($this->db); $objectemail = new Project($this->db);
} }
if ($reg[1] == 'tas') { if ($reg[1] == 'tas') { // Task
$objectemail = new Task($this->db); $objectemail = new Task($this->db);
} }
if ($reg[1] == 'con') { if ($reg[1] == 'con') { // Contact
$objectemail = new Contact($this->db); $objectemail = new Contact($this->db);
} }
if ($reg[1] == 'use') { if ($reg[1] == 'use') { // User
$objectemail = new User($this->db); $objectemail = new User($this->db);
} }
if ($reg[1] == 'tic') { if ($reg[1] == 'tic') { // Ticket
$objectemail = new Ticket($this->db); $objectemail = new Ticket($this->db);
} }
if ($reg[1] == 'recruitmentcandidature') { if ($reg[1] == 'recruitmentcandidature') { // Recruiting Candidate
$objectemail = new RecruitmentCandidature($this->db); $objectemail = new RecruitmentCandidature($this->db);
} }
if ($reg[1] == 'mem') { if ($reg[1] == 'mem') { // Member
$objectemail = new Adherent($this->db); $objectemail = new Adherent($this->db);
} }
/*if ($reg[1] == 'leav') { /*if ($reg[1] == 'leav') { // Leave / Holiday
$objectemail = new Holiday($db); $objectemail = new Holiday($db);
} }
if ($reg[1] == 'exp') { if ($reg[1] == 'exp') { // ExpenseReport
$objectemail = new ExpenseReport($db); $objectemail = new ExpenseReport($db);
}*/ }*/
} elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) { } elseif (preg_match('/<(.*@.*)>/', $reference, $reg)) {
@ -2932,6 +2936,7 @@ class EmailCollector extends CommonObject
2.2.1 text/plain 2.2.1 text/plain
2.2.2 text/html 2.2.2 text/html
*/ */
/** /**
* Sub function for getpart(). Only called by createPartArray() and itself. * Sub function for getpart(). Only called by createPartArray() and itself.
* *

View File

@ -11,7 +11,7 @@
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop> * Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Yasser Carreón <yacasia@gmail.com> * Copyright (C) 2016 Yasser Carreón <yacasia@gmail.com>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com> * Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com>
* Copyright (C) 2022 Josep Lluís Amador <joseplluis@lliuretic.cat> * Copyright (C) 2022 Josep Lluís Amador <joseplluis@lliuretic.cat>
* *
@ -265,7 +265,7 @@ if (empty($reshook)) {
$qty .= '_'.$j; $qty .= '_'.$j;
while (GETPOSTISSET($batch)) { while (GETPOSTISSET($batch)) {
// save line of detail into sub_qty // save line of detail into sub_qty
$sub_qty[$j]['q'] = GETPOST($qty, 'int'); // the qty we want to move for this stock record $sub_qty[$j]['q'] = price2num(GETPOST($qty, 'alpha'), 'MS'); // the qty we want to move for this stock record
$sub_qty[$j]['id_batch'] = GETPOST($batch, 'int'); // the id into llx_product_batch of stock record to move $sub_qty[$j]['id_batch'] = GETPOST($batch, 'int'); // the id into llx_product_batch of stock record to move
$subtotalqty += $sub_qty[$j]['q']; $subtotalqty += $sub_qty[$j]['q'];
@ -481,7 +481,7 @@ if (empty($reshook)) {
// setEventMessages($object->error, $object->errors, 'errors'); // setEventMessages($object->error, $object->errors, 'errors');
// } // }
//} //}
} elseif ($action == 'setdate_livraison' && $user->rights->expedition->creer) { } elseif ($action == 'setdate_livraison' && !empty($user->rights->expedition->creer)) {
$datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$object->fetch($id); $object->fetch($id);

View File

@ -120,13 +120,12 @@ class ExpenseReportIk extends CommonObject
public function fetch($id, $ref = null) public function fetch($id, $ref = null)
{ {
$result = $this->fetchCommon($id, $ref); $result = $this->fetchCommon($id, $ref);
if ($result > 0 && !empty($this->table_element_line)) {
$this->fetchLines();
}
return $result; return $result;
} }
/** /**
* Update object into database * Update object into database
* *

View File

@ -171,6 +171,19 @@ class ExpenseReportRule extends CommonObject
} }
/**
* Load object lines in memory from the database
*
* @return int <0 if KO, 0 if not found, >0 if OK
*/
public function fetchLines()
{
$this->lines = array();
$result = $this->fetchLinesCommon();
return $result;
}
/** /**
* Update object into database * Update object into database
* *

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file evaluation_note.php * \file htdocs/hrm/evaluation_note.php
* \ingroup hrm * \ingroup hrm
* \brief Tab for notes on Evaluation * \brief Tab for notes on Evaluation
*/ */
@ -29,15 +29,17 @@
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/evaluation.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_evaluation.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "companies")); $langs->loadLangs(array('hrm', 'companies'));
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
@ -47,6 +49,7 @@ $object = new Evaluation($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('evaluationnote', 'globalcard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('evaluationnote', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
@ -56,6 +59,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
} }
// Permissions
$permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php $permissionnote = $user->rights->hrm->evaluation->write; // Used by the include of actions_setnotes.inc.php
$permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php $permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include of actions_addupdatedelete.inc.php

View File

@ -32,10 +32,10 @@ require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
if (isModEnabled('deplacement')) { if (isModEnabled('deplacement')) {
require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/deplacement/class/deplacement.class.php';

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file job_card.php * \file htdocs/hrm/job_card.php
* \ingroup hrm * \ingroup hrm
* \brief Page to create/edit/view job * \brief Page to create/edit/view job
*/ */
@ -36,7 +36,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "other", 'products')); $langs->loadLangs(array('hrm', 'other', 'products')); // why products?
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
@ -76,7 +76,7 @@ if (empty($action) && empty($id) && empty($ref)) {
// Load object // Load object
include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once. include DOL_DOCUMENT_ROOT . '/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
// Permissions
$permissiontoread = $user->rights->hrm->all->read; $permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->hrm->all->delete; $permissiontodelete = $user->rights->hrm->all->delete;

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file job_contact.php * \file htdocs/hrm/job_contact.php
* \ingroup hrm * \ingroup hrm
* \brief Tab for contacts linked to Job * \brief Tab for contacts linked to Job
*/ */
@ -28,14 +28,15 @@
// Load Dolibarr environment // Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "companies", "other", "mails")); $langs->loadLangs(array('hrm', 'companies', 'other', 'mails'));
// Get Parameters
$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
$lineid = GETPOST('lineid', 'int'); $lineid = GETPOST('lineid', 'int');
@ -53,6 +54,7 @@ $extrafields->fetch_name_optionals_label($object->table_element);
// Load object // Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
// Permissions
$permission = $user->rights->hrm->job->write; $permission = $user->rights->hrm->job->write;
// Security check (enable the most restrictive one) // Security check (enable the most restrictive one)

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file job_document.php * \file htdocs/hrm/job_document.php
* \ingroup hrm * \ingroup hrm
* \brief Tab for documents linked to Job * \brief Tab for documents linked to Job
*/ */
@ -36,15 +36,15 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "companies", "other", "mails")); $langs->loadLangs(array('hrm', 'companies', 'other', 'mails'));
// Get parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm'); $confirm = GETPOST('confirm');
$id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int')); $id = (GETPOST('socid', 'int') ? GETPOST('socid', 'int') : GETPOST('id', 'int'));
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
// Get parameters
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma');
@ -68,6 +68,7 @@ $object = new Job($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('jobdocument', 'globalcard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('jobdocument', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
@ -78,6 +79,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/job/".get_exdir(0, 0, 0, 1, $object); $upload_dir = $conf->hrm->multidir_output[$object->entity ? $object->entity : $conf->entity]."/job/".get_exdir(0, 0, 0, 1, $object);
} }
// Permissions
$permissiontoread = $user->rights->hrm->all->read; $permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php

View File

@ -20,9 +20,9 @@
*/ */
/** /**
* \file job_list.php * \file htdocs/hrm/job_list.php
* \ingroup hrm * \ingroup hrm
* \brief List page for job * \brief List page of jobs
*/ */
@ -40,8 +40,9 @@ require_once __DIR__.'/class/job.class.php';
//dol_include_once('/othermodule/class/otherobject.class.php'); //dol_include_once('/othermodule/class/otherobject.class.php');
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "other")); $langs->loadLangs(array('hrm', 'other'));
// Get Parameters
$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 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $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 ? $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
@ -130,6 +131,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');
// Permissions
$permissiontoread = $user->rights->hrm->all->read; $permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; $permissiontoadd = $user->rights->hrm->all->write;
$permissiontodelete = $user->rights->hrm->all->delete; $permissiontodelete = $user->rights->hrm->all->delete;

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file job_note.php * \file htdocs/hrm/job_note.php
* \ingroup hrm * \ingroup hrm
* \brief Tab for notes on Job * \brief Tab for notes on Job
*/ */
@ -33,11 +33,12 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_job.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "companies")); $langs->loadLangs(array('hrm', 'companies'));
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'aZ09'); $cancel = GETPOST('cancel', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
@ -47,6 +48,7 @@ $object = new Job($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('jobnote', 'globalcard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('jobnote', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
@ -56,6 +58,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
} }
// Permissions
$permissiontoread = $user->rights->hrm->all->read; $permissiontoread = $user->rights->hrm->all->read;
$permissionnote = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php $permissionnote = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php

View File

@ -4,6 +4,7 @@
* Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr> * Copyright (C) 2021 Greg Rastklan <greg.rastklan@atm-consulting.fr>
* Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr> * Copyright (C) 2021 Jean-Pascal BOUDET <jean-pascal.boudet@atm-consulting.fr>
* Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr> * Copyright (C) 2021 Grégory BLEMAND <gregory.blemand@atm-consulting.fr>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -21,7 +22,7 @@
/** /**
* \file hrm/lib/hrm.lib.php * \file hrm/lib/hrm.lib.php
* \ingroup hr * \ingroup hrm
* \brief Library files with common functions for Workstation * \brief Library files with common functions for Workstation
*/ */
@ -32,10 +33,15 @@
*/ */
function hrmAdminPrepareHead() function hrmAdminPrepareHead()
{ {
global $langs, $conf; global $langs, $conf, $db;
$langs->load("hrm"); $langs->load("hrm");
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('hrm_evaluation');
$extrafields->fetch_name_optionals_label('hrm_job');
$extrafields->fetch_name_optionals_label('hrm_skill');
$h = 0; $h = 0;
$head = array(); $head = array();
$head[$h][0] = DOL_URL_ROOT . "/admin/hrm.php"; $head[$h][0] = DOL_URL_ROOT . "/admin/hrm.php";
@ -50,31 +56,31 @@ function hrmAdminPrepareHead()
$head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php'; $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/evaluation_extrafields.php';
$head[$h][1] = $langs->trans("EvaluationsExtraFields"); $head[$h][1] = $langs->trans("EvaluationsExtraFields");
$nbExtrafields = $extrafields->attributes['hrm_evaluation']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'evaluationsAttributes'; $head[$h][2] = 'evaluationsAttributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php'; $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/job_extrafields.php';
$head[$h][1] = $langs->trans("JobsExtraFields"); $head[$h][1] = $langs->trans("JobsExtraFields");
$nbExtrafields = $extrafields->attributes['hrm_job']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'jobsAttributes'; $head[$h][2] = 'jobsAttributes';
$h++; $h++;
$head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php'; $head[$h][0] = DOL_URL_ROOT . '/hrm/admin/skill_extrafields.php';
$head[$h][1] = $langs->trans("SkillsExtraFields"); $head[$h][1] = $langs->trans("SkillsExtraFields");
$nbExtrafields = $extrafields->attributes['hrm_skill']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'skillsAttributes'; $head[$h][2] = 'skillsAttributes';
$h++; $h++;
/*
$head[$h][0] = dol_buildpath("/workstation/admin/myobject_extrafields.php", 1);
$head[$h][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'myobject_extrafields';
$h++;
*/
/*$head[$h][0] = require_once "/admin/about.php";
$head[$h][1] = $langs->trans("About");
$head[$h][2] = 'about';
$h++;*/
// Show more tabs from modules // Show more tabs from modules
// Entries must be declared in modules descriptor with line // Entries must be declared in modules descriptor with line
//$this->tabs = array( //$this->tabs = array(

View File

@ -20,7 +20,7 @@
*/ */
/** /**
* \file position_agenda.php * \file htdocs/hrm/position_agenda.php
* \ingroup hrm * \ingroup hrm
* \brief Tab of events on Position * \brief Tab of events on Position
*/ */
@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "other")); $langs->loadLangs(array('hrm', 'other'));
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
@ -79,6 +79,7 @@ $object = new Position($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('positionagenda', 'globalcard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('positionagenda', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
@ -88,6 +89,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
} }
// Permissions
$permissiontoread = $user->rights->hrm->all->read; $permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php

View File

@ -20,9 +20,9 @@
*/ */
/** /**
* \file position_card.php * \file htdocs/hrm/position_card.php
* \ingroup hrm * \ingroup hrm
* \brief Page to create/edit/view position * \brief Page to create/edit/view job position
*/ */
@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php';
//dol_include_once('/hrm/position.php'); //dol_include_once('/hrm/position.php');
// Get Parameters
$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 'add', 'create', 'edit', 'update', 'view', ...
$backtopage = GETPOST('backtopage', 'alpha'); $backtopage = GETPOST('backtopage', 'alpha');
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha'); $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
@ -50,6 +51,7 @@ if ($res < 0) {
dol_print_error($db, $object->error); dol_print_error($db, $object->error);
} }
// Permissions
$permissiontoread = $user->rights->hrm->all->read; $permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $permissiontoadd = $user->rights->hrm->all->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->hrm->all->delete; $permissiontodelete = $user->rights->hrm->all->delete;

View File

@ -20,22 +20,23 @@
*/ */
/** /**
* \file position_contact.php * \file htdocs/hrm/position_contact.php
* \ingroup hrm * \ingroup hrm
* \brief Tab for contacts linked to Position * \brief Tab for contacts linked to Job Position
*/ */
// Load Dolibarr environment // Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "companies", "other", "mails")); $langs->loadLangs(array("hrm", "companies", "other", "mails"));
// Get Parameters
$id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility $id = (GETPOST('id') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha'); $ref = GETPOST('ref', 'alpha');
$lineid = GETPOST('lineid', 'int'); $lineid = GETPOST('lineid', 'int');
@ -47,12 +48,14 @@ $object = new Position($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('positioncontact', 'globalcard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('positioncontact', 'globalcard')); // Note that conf->hooks_modules contains array
// Fetch optionals attributes and labels // Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
// Load object // Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
// Permissions
$permission = $user->rights->hrm->position->write; $permission = $user->rights->hrm->position->write;
// Security check (enable the most restrictive one) // Security check (enable the most restrictive one)

View File

@ -20,9 +20,9 @@
*/ */
/** /**
* \file position_list.php * \file htdocs/hrm/position_list.php
* \ingroup hrm * \ingroup hrm
* \brief List page for position * \brief List page for job positions
*/ */
@ -40,8 +40,9 @@ require_once __DIR__.'/class/position.class.php';
//dol_include_once('/othermodule/class/otherobject.class.php'); //dol_include_once('/othermodule/class/otherobject.class.php');
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "other")); $langs->loadLangs(array('hrm', 'other'));
// Get Parameters
$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 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $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 ? $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
@ -130,6 +131,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position'); $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position');
// Permissions
$permissiontoread = $user->rights->hrm->all->read; $permissiontoread = $user->rights->hrm->all->read;
$permissiontoadd = $user->rights->hrm->all->write; $permissiontoadd = $user->rights->hrm->all->write;
$permissiontodelete = $user->rights->hrm->all->delete; $permissiontodelete = $user->rights->hrm->all->delete;

View File

@ -20,8 +20,7 @@
*/ */
/** /**
* \file position_note.php * \file htdocs/hrm/position_note.php
* \ingroup hrm
* \ingroup hrm * \ingroup hrm
* \brief Tab for notes on Position * \brief Tab for notes on Position
*/ */
@ -30,12 +29,14 @@
// Load Dolibarr environment // Load Dolibarr environment
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';;
require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/class/position.class.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php'; require_once DOL_DOCUMENT_ROOT . '/hrm/lib/hrm_position.lib.php';
require_once DOL_DOCUMENT_ROOT . '/hrm/class/job.class.php';;
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("hrm", "companies")); $langs->loadLangs(array('hrm', 'companies'));
// Get parameters // Get parameters
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
@ -58,6 +59,7 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id; $upload_dir = $conf->hrm->multidir_output[$object->entity]."/".$object->id;
} }
// Permissions
$permissionnote = $user->rights->hrm->all->write; $permissionnote = $user->rights->hrm->all->write;
$permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php $permissiontoread = $user->rights->hrm->all->read; // Used by the include of actions_addupdatedelete.inc.php

View File

@ -198,15 +198,15 @@ if ($action=='downfield' || $action=='upfield')
} }
} }
*/ */
if ($action == 'builddoc') { // if ($action == 'builddoc') {
// Build import file // // Build import file
$result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database); // $result = $objimport->build_file($user, GETPOST('model', 'alpha'), $datatoimport, $array_match_file_to_database);
if ($result < 0) { // if ($result < 0) {
setEventMessages($objimport->error, $objimport->errors, 'errors'); // setEventMessages($objimport->error, $objimport->errors, 'errors');
} else { // } else {
setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs'); // setEventMessages($langs->trans("FileSuccessfullyBuilt"), null, 'mesgs');
} // }
} // }
if ($action == 'deleteprof') { if ($action == 'deleteprof') {
if (GETPOST("id", 'int')) { if (GETPOST("id", 'int')) {

View File

@ -689,3 +689,6 @@ ALTER TABLE llx_cronjob ADD UNIQUE INDEX uk_cronjob (label, entity);
ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0; ALTER TABLE llx_expedition ADD COLUMN billed smallint DEFAULT 0;
ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep); ALTER TABLE llx_loan_schedule ADD UNIQUE INDEX uk_loan_schedule_ref (fk_loan, datep);
-- We need when upgrade 15 to 16 with Dolibarr v17+ for upgrade2 function migrate_user_photospath2()
ALTER TABLE llx_user CHANGE COLUMN note note_private text;

View File

@ -175,5 +175,5 @@ create table llx_element_categorie
ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie); ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie);
ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_fk_categorie(rowid); ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid);

View File

@ -19,4 +19,4 @@
ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie); ALTER TABLE llx_element_categorie ADD UNIQUE INDEX idx_element_categorie_idx (fk_element, fk_categorie);
ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_fk_categorie(rowid); ALTER TABLE llx_element_categorie ADD CONSTRAINT fk_element_categorie_fk_categorie FOREIGN KEY (fk_categorie) REFERENCES llx_categorie(rowid);

View File

@ -82,7 +82,7 @@ ProductsToProduce=Produits à produire
UnitCost=Coût unitaire UnitCost=Coût unitaire
TotalCost=Coût total TotalCost=Coût total
BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat) BOMTotalCost=Le coût de production de cette nomenclature basé sur chaque quantité et produit à consommer (utilise le prix de revient si défini, sinon le PMP si défini, sinon le meilleur prix d'achat)
BOMTotalCostService=Si le module "Poste de travail" est activé, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service" BOMTotalCostService=Si le module "Poste de travail" est activé et qu'un poste de travil est défini par défaut sur la ligne, alors le calcul est "quantité (convertie en heures) x thm du poste de travail", sinon "quantité (convertie en heures) x prix de revient du service"
BOMProductsList=Liste des composants BOMProductsList=Liste des composants
BOMServicesList=Liste des services BOMServicesList=Liste des services
GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler. GoOnTabProductionToProduceFirst=Vous devez avoir la production pour clôturer un Ordre de Fabrication (voir onglet '%s'). Mais vous pouvez l'annuler.

View File

@ -121,10 +121,10 @@ class pdf_standard_myobject extends ModelePDFMyObject
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
// Get source company // Get source company
$this->emetteur = $mysoc; $this->emetteur = $mysoc;

View File

@ -30,6 +30,10 @@ function mymoduleAdminPrepareHead()
{ {
global $langs, $conf; global $langs, $conf;
// global $db;
// $extrafields = new ExtraFields($db);
// $extrafields->fetch_name_optionals_label('myobject');
$langs->load("mymodule@mymodule"); $langs->load("mymodule@mymodule");
$h = 0; $h = 0;
@ -43,6 +47,10 @@ function mymoduleAdminPrepareHead()
/* /*
$head[$h][0] = dol_buildpath("/mymodule/admin/myobject_extrafields.php", 1); $head[$h][0] = dol_buildpath("/mymodule/admin/myobject_extrafields.php", 1);
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = is_countable($extrafields->attributes['myobject']['label']) ? count($extrafields->attributes['myobject']['label']) : 0;
if ($nbExtrafields > 0) {
$head[$h][1] .= ' <span class="badge">' . $nbExtrafields . '</span>';
}
$head[$h][2] = 'myobject_extrafields'; $head[$h][2] = 'myobject_extrafields';
$h++; $h++;
*/ */

View File

@ -1070,7 +1070,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print ' '.img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.((int) $line->id).', \''.dol_escape_js($type).'\', \'qtymissingconsume\')"'); print ' '.img_picto($langs->trans('AddStockLocationLine'), 'split.png', 'class="splitbutton" onClick="addDispatchLine('.((int) $line->id).', \''.dol_escape_js($type).'\', \'qtymissingconsume\')"');
print '</td>'; print '</td>';
print '<td align="right" class="splitall">'; print '<td align="right" class="splitall">';
if (($action == 'consumeorproduce' || $action == 'consumeandproduceall')) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"'); if (($action == 'consumeorproduce' || $action == 'consumeandproduceall') && $tmpproduct->status_batch == 2) print img_picto($langs->trans('SplitAllQuantity'), 'split.png', 'class="splitbutton splitallbutton field-error-icon" data-max-qty="1" onClick="addDispatchLine('.$line->id.', \'batch\', \'allmissingconsume\')"');
print '</td>'; print '</td>';
} }
print '</td>'; print '</td>';

View File

@ -371,7 +371,9 @@ if (empty($reshook)) {
foreach ($toselect as $toselectid) { foreach ($toselect as $toselectid) {
$result = $product->fetch($toselectid); $result = $product->fetch($toselectid);
if ($result > 0 && $product->id > 0) { if ($result > 0 && $product->id > 0) {
$product->setStatut($product->status ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tosell'); if ($product->setStatut($product->status ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tosell') < 0) {
setEventMessages($product->error, $product->errors, 'errors');
}
} }
} }
} }
@ -380,7 +382,9 @@ if (empty($reshook)) {
foreach ($toselect as $toselectid) { foreach ($toselect as $toselectid) {
$result = $product->fetch($toselectid); $result = $product->fetch($toselectid);
if ($result > 0 && $product->id > 0) { if ($result > 0 && $product->id > 0) {
$product->setStatut($product->status_buy ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tobuy'); if ($product->setStatut($product->status_buy ? 0 : 1, null, 'product', 'PRODUCT_MODIFY', 'tobuy') < 0) {
setEventMessages($product->error, $product->errors, 'errors');
}
} }
} }
} }

View File

@ -426,6 +426,7 @@ if ($action == "dosign" && empty($cancel)) {
dataType: "text", dataType: "text",
data: { data: {
"action" : "importSignature", "action" : "importSignature",
"token" : \''.newToken().'\',
"signaturebase64" : signature, "signaturebase64" : signature,
"ref" : \''.dol_escape_js($REF).'\', "ref" : \''.dol_escape_js($REF).'\',
"securekey" : \''.dol_escape_js($SECUREKEY).'\', "securekey" : \''.dol_escape_js($SECUREKEY).'\',

View File

@ -121,10 +121,10 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio
$this->page_largeur = $formatarray['width']; $this->page_largeur = $formatarray['width'];
$this->page_hauteur = $formatarray['height']; $this->page_hauteur = $formatarray['height'];
$this->format = array($this->page_largeur, $this->page_hauteur); $this->format = array($this->page_largeur, $this->page_hauteur);
$this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10; $this->marge_gauche = getDolGlobalInt('MAIN_PDF_MARGIN_LEFT', 10);
$this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10; $this->marge_droite = getDolGlobalInt('MAIN_PDF_MARGIN_RIGHT', 10);
$this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10; $this->marge_haute = getDolGlobalInt('MAIN_PDF_MARGIN_TOP', 10);
$this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10; $this->marge_basse = getDolGlobalInt('MAIN_PDF_MARGIN_BOTTOM', 10);
$this->option_logo = 1; // Display logo $this->option_logo = 1; // Display logo
$this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION $this->option_tva = 1; // Manage the vat option FACTURE_TVAOPTION

View File

@ -12,7 +12,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr> * Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es.com> * Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es.com>
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -342,6 +342,7 @@ if (empty($reshook)) {
if (!$error) { if (!$error) {
//We finally remove the old thirdparty //We finally remove the old thirdparty
if ($soc_origin->delete($soc_origin->id, $user) < 1) { if ($soc_origin->delete($soc_origin->id, $user) < 1) {
setEventMessages($soc_origin->error, $soc_origin->errors, 'errors');
$error++; $error++;
} }
} }

View File

@ -1724,9 +1724,10 @@ class Ticket extends CommonObject
* @param array $filename_list List of files to attach (full path of filename on file system) * @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files * @param array $mimetype_list List of MIME type of attached files
* @param array $mimefilename_list List of attached file name in message * @param array $mimefilename_list List of attached file name in message
* @param boolean $send_email Whether the message is sent by email
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */
public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array()) public function createTicketMessage($user, $notrigger = 0, $filename_list = array(), $mimetype_list = array(), $mimefilename_list = array(), $send_email = false)
{ {
global $conf, $langs; global $conf, $langs;
$error = 0; $error = 0;
@ -1752,6 +1753,9 @@ class Ticket extends CommonObject
if ($this->private) { if ($this->private) {
$actioncomm->code = 'TICKET_MSG_PRIVATE'; $actioncomm->code = 'TICKET_MSG_PRIVATE';
} }
if ($send_email) {
$actioncomm->type_code = 'AC_EMAIL';
}
$actioncomm->socid = $this->socid; $actioncomm->socid = $this->socid;
$actioncomm->label = $this->subject; $actioncomm->label = $this->subject;
$actioncomm->note_private = $this->message; $actioncomm->note_private = $this->message;
@ -2536,7 +2540,7 @@ class Ticket extends CommonObject
$listofnames = $resarray['listofnames']; $listofnames = $resarray['listofnames'];
$listofmimes = $resarray['listofmimes']; $listofmimes = $resarray['listofmimes'];
$id = $object->createTicketMessage($user, 0, $listofpaths, $listofmimes, $listofnames); $id = $object->createTicketMessage($user, 0, $listofpaths, $listofmimes, $listofnames, $send_email);
if ($id <= 0) { if ($id <= 0) {
$error++; $error++;
$this->error = $object->error; $this->error = $object->error;