Merge branch 'develop' of github.com:Dolibarr/dolibarr into develop
This commit is contained in:
commit
571110f60a
60
ChangeLog
60
ChangeLog
@ -12,6 +12,7 @@ For users:
|
||||
NEW: PHP 8.1 compatibility
|
||||
NEW: Support for recurring purchase invoices.
|
||||
NEW: #20292 Include German public holidays
|
||||
NEW: Can show ZATCA QRCode on PDFs
|
||||
NEW: #17123 added ExtraFields for Stock Mouvement
|
||||
NEW: #20609 : new massaction to assign a sale representatives on a selection of thirdparties
|
||||
NEW: #20653 edit discount pourcentage for all lines in one shot
|
||||
@ -405,8 +406,9 @@ NEW: Increase size of params of actions for emailcollector
|
||||
NEW: Invoice list - Use complete country select field with EEC or not
|
||||
NEW: mass action delete, no more break if at least one object has child
|
||||
NEW: mass action paid on customer invoice list
|
||||
NEW: massaction validate on supplier orders list
|
||||
NEW: Mass action send email to all attendees of an event.
|
||||
NEW: mass action validate on supplier orders list
|
||||
NEW: mass action send email to all attendees of an event
|
||||
NEW: mass action to switch status on sale / on purchase of a product
|
||||
NEW: expense reports: conf to pre-fill start/end dates with bounds of current month
|
||||
NEW: Option "Add a link on the PDF to make the online payment"
|
||||
NEW: More options to generate PDF (show Frame option, width of picture option)
|
||||
@ -427,7 +429,7 @@ NEW: when multiple order linked to facture, show list into note.
|
||||
NEW: when we delete several objects with massaction, if somes object has child we must see which objects are concerned and nevertheless delete objects which can be deleted
|
||||
NEW: Editing a page in website module keep old page with name .back
|
||||
NEW: External backups can be downloaded from the "About info page".
|
||||
NEW: Add massaction to switch status on sale / on purchase of a product.
|
||||
|
||||
|
||||
|
||||
Modules
|
||||
@ -435,36 +437,49 @@ NEW: Stable module Knowledge Management
|
||||
NEW: Experimental module Event Organization Management
|
||||
NEW: Experimental module Workstations Management
|
||||
NEW: Development of module Partnership Management
|
||||
OLD: module SimplePOS has been completely removed -> use TakePOS
|
||||
|
||||
|
||||
For developers:
|
||||
---------------
|
||||
|
||||
API:
|
||||
NEW: #18319 REST API - Shipment: Add 'close' action / endpoint / POST method.
|
||||
NEW: add API /approve and /makeOrder for purchase orders
|
||||
NEW: API for knowledgemanagement
|
||||
NEW: API get list of legal form of business
|
||||
NEW: API list of staff units
|
||||
NEW: Hidden option API_DISABLE_COMPRESSION is now visible in API setup page.
|
||||
|
||||
Hook:
|
||||
NEW: add hook 'beforeBodyClose'
|
||||
NEW: add hook 'hookGetEntity'
|
||||
NEW: add hook 'menuLeftMenuItems' to filter the leftmenu items
|
||||
NEW: add hook 'printUnderHeaderPDFline' on invoice PDF templates (can be used for example to add a barcode or more information on header of invoices).
|
||||
NEW: add hookmanager on note pages
|
||||
NEW: hook after rank update
|
||||
NEW: 'printFieldListFrom' hook call on several lists
|
||||
|
||||
ModuleBuilder:
|
||||
NEW: add the property "copytoclipboard" in modulebuilder
|
||||
NEW: Use lang selector when using a field key 'lang' in modulebuilder
|
||||
|
||||
Options:
|
||||
NEW: add options MAIN_IBAN_IS_NEVER_MANDATORY, MAIN_IBAN_NOT_MANDATORY, PROPAL_NOT_BILLABLE, PROPAL_REOPEN_UNSIGNED_ONLY, PROPOSAL_ARE_NOT_BILLABLE, TICKETS_MESSAGE_FORCE_MAIL
|
||||
|
||||
Trigger:
|
||||
NEW: add action trigger for member excluded
|
||||
|
||||
|
||||
NEW: Introduce method hasRight
|
||||
NEW: Can use textarea field into a confirm popup.
|
||||
NEW: Can use the result_mode of mysqli driver. Save memory for list count
|
||||
NEW: #18319 REST API - Shipment: Add 'close' action / endpoint / POST method.
|
||||
NEW: Add API /approve and /makeOrder for purchase orders.
|
||||
NEW: add action trigger for member excluded
|
||||
NEW: add option MAIN_IBAN_IS_NEVER_MANDATORY, MAIN_IBAN_NOT_MANDATORY, PROPAL_NOT_BILLABLE, PROPAL_REOPEN_UNSIGNED_ONLY, PROPOSAL_ARE_NOT_BILLABLE, TICKETS_MESSAGE_FORCE_MAIL
|
||||
NEW: Add code codebar column on serial/lot structure
|
||||
NEW: Add date_valid and date_approve columns in the list of supplier orders
|
||||
NEW: add hook `beforeBodyClose`
|
||||
NEW: Add hook hookGetEntity.
|
||||
NEW: add hookmanager on note pages
|
||||
NEW: add hook 'menuLeftMenuItems' to filter the leftmenu items
|
||||
NEW: Add the property "copytoclipboard" in modulebuilder
|
||||
NEW: api for knowledgemanagement
|
||||
NEW: API get list of legal form of business
|
||||
NEW: API list of staff units
|
||||
NEW: hook after rank update
|
||||
NEW: printFieldListFrom hook call on several lists
|
||||
NEW: Use lang selector when using a field key 'lang' in modulebuilder
|
||||
NEW: add code codebar column on serial/lot structure
|
||||
NEW: add date_valid and date_approve columns in the list of supplier orders
|
||||
NEW: we need to be able to put more filters on deleteByParentField() function
|
||||
NEW: make it easier to set the `keyword`, `keywords` and `description` attributes of an ecm file object
|
||||
NEW: Experimental feature to manage user sessions in database
|
||||
NEW: Hidden option API_DISABLE_COMPRESSION is now visible in API setup page.
|
||||
NEW: Add hook printUnderHeaderPDFline on invoice PDF templates (can be used for example to add a barcode or more information on header of invoices).
|
||||
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* ALL EXTERNAL MODULES THAT WERE NOT CORRECTLY DEVELOPPED WILL NOT WORK ON V15 (All modules that forgot to manage the security token field
|
||||
@ -1321,7 +1336,6 @@ NEW: introduce constant FACTUREFOURN_REUSE_NOTES_ON_CREATE_FROM
|
||||
NEW: introducing new modal boxes in TakePOS
|
||||
NEW: keep TakePOS terminal when login/logout
|
||||
NEW: link on balance to the ledger
|
||||
NEW: MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER const in email collector
|
||||
NEW: manage errors on update extra fields in ticket card
|
||||
NEW: mass-actions for the event list view
|
||||
NEW: more filter for "View change logs"
|
||||
|
||||
@ -111,7 +111,7 @@ class AccountancyExport
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
global $langs;
|
||||
global $langs, $hookmanager;
|
||||
|
||||
$listofexporttypes = array(
|
||||
self::$EXPORT_TYPE_CONFIGURABLE => $langs->trans('Modelcsv_configurable'),
|
||||
@ -137,7 +137,7 @@ class AccountancyExport
|
||||
);
|
||||
|
||||
// allow modules to define export formats
|
||||
global $hookmanager;
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('getType', $parameters, $listofexporttypes);
|
||||
|
||||
ksort($listofexporttypes, SORT_NUMERIC);
|
||||
|
||||
@ -1067,12 +1067,12 @@ if ($rowid > 0) {
|
||||
// Bank account
|
||||
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("FinancialAccount").'</td><td>';
|
||||
print img_picto('', 'bank_account');
|
||||
$form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 2);
|
||||
$form->select_comptes(GETPOST('accountid'), 'accountid', 0, '', 2, '', 0, 'minwidth200');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Payment mode
|
||||
print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
|
||||
$form->select_types_paiements(GETPOST('operation'), 'operation', '', 2);
|
||||
$form->select_types_paiements(GETPOST('operation'), 'operation', '', 2, 1, 0, 0, 1, 'minwidth200');
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Date of payment
|
||||
|
||||
@ -101,9 +101,14 @@ if ($action == 'update') {
|
||||
if ($mode == 'template') {
|
||||
dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
/*$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
|
||||
if (! $val) dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
|
||||
else dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);*/
|
||||
if (GETPOSTISSET('THEME_TOPMENU_DISABLE_IMAGE')) {
|
||||
$val=GETPOST('THEME_TOPMENU_DISABLE_IMAGE');
|
||||
if (!$val) {
|
||||
dolibarr_del_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', $conf->entity);
|
||||
} else {
|
||||
dolibarr_set_const($db, 'THEME_TOPMENU_DISABLE_IMAGE', GETPOST('THEME_TOPMENU_DISABLE_IMAGE'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
}
|
||||
|
||||
$val = (implode(',', (colorStringToArray(GETPOST('THEME_ELDY_BACKBODY'), array()))));
|
||||
if ($val == '') {
|
||||
|
||||
@ -57,6 +57,7 @@ $langs->loadLangs($langsArray);
|
||||
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
$mode = GETPOST('mode', 'aZ09');
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$rowid = GETPOST('rowid', 'alpha');
|
||||
@ -619,19 +620,19 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
$param .= '&limit='.urlencode($limit);
|
||||
}
|
||||
if (!empty($search)) {
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
if ($skey != '') {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
if (!empty($search) && is_array($search)) {
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
if ($skey != '') {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
}
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($optioncss != '') {
|
||||
$param .= '&optioncss='.urlencode($optioncss);
|
||||
}
|
||||
|
||||
@ -60,6 +60,9 @@ if ($action == 'update') {
|
||||
if (GETPOSTISSET('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) {
|
||||
dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOST("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
if (GETPOSTISSET('INVOICE_ADD_ZATCA_QR_CODE')) {
|
||||
dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOST("INVOICE_ADD_ZATCA_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
|
||||
@ -90,19 +93,19 @@ $tooltiptext = '';
|
||||
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
if (!empty($conf->propal->enabled)) {
|
||||
print load_fiche_titre($langs->trans("Proposal"), '', '');
|
||||
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE");
|
||||
print ' <span class="opacitymedium">('.$langs->trans("RandomlySelectedIfSeveral").')</span>';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
|
||||
@ -112,6 +115,29 @@ if (!empty($conf->propal->enabled)) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
|
||||
if (!empty($conf->facture->enabled)) {
|
||||
print load_fiche_titre($langs->trans("Invoices"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore"));
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('INVOICE_ADD_ZATCA_QR_CODE');
|
||||
} else {
|
||||
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
|
||||
print $form->selectarray("INVOICE_ADD_ZATCA_QR_CODE", $arrval, $conf->global->INVOICE_ADD_ZATCA_QR_CODE);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
/*
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
|
||||
@ -439,7 +439,7 @@ if (in_array($type, array('pgsql'))) {
|
||||
$prefix = 'pg_dump';
|
||||
$ext = 'sql';
|
||||
}
|
||||
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext;
|
||||
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.dol_print_date(dol_now('gmt'), "dayhourlogsmall", 'tzuser').'.'.$ext;
|
||||
print '<input type="text" name="filename_template" style="width: 90%" id="filename_template" value="'.$file.'" />';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
@ -559,10 +559,10 @@ print '</table>';
|
||||
print "</div> <!-- end div fichehalfleft -->\n";
|
||||
|
||||
|
||||
print '<div id="backupdatabaseright" class="fichehalfright" style="height:480px; overflow: auto;">';
|
||||
print '<div id="backupdatabaseright" class="fichehalfright">';
|
||||
|
||||
$filearray = dol_dir_list($conf->admin->dir_output.'/backup', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1);
|
||||
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"));
|
||||
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'backup/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousDumpFiles"), '', 0, -1, '', '', 'ASC', 1, 0, -1, 'style="height:480px; overflow: auto;"');
|
||||
print '<br>';
|
||||
|
||||
print '</div>';
|
||||
@ -594,7 +594,7 @@ print load_fiche_titre($title);
|
||||
print '<label for="zipfilename_template" class="line-height-large paddingbottom">'.$langs->trans("FileNameToGenerate").'</label><br>';
|
||||
$prefix = 'documents';
|
||||
$ext = 'zip';
|
||||
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M");
|
||||
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.dol_print_date(dol_now('gmt'), "dayhourlogsmall", 'tzuser');
|
||||
print '<input type="text" name="zipfilename_template" style="width: 90%" id="zipfilename_template" value="'.$file.'" /> <br>';
|
||||
print '<br>';
|
||||
|
||||
@ -639,10 +639,10 @@ print '</div>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<div id="backupfileright" class="fichehalfright" style="height:250px; overflow: auto;">';
|
||||
print '<div id="backupfileright" class="fichehalfright">';
|
||||
|
||||
$filearray = dol_dir_list($conf->admin->dir_output.'/documents', 'files', 0, '', '', $sortfield, (strtolower($sortorder) == 'asc' ?SORT_ASC:SORT_DESC), 1);
|
||||
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousArchiveFiles"));
|
||||
$result = $formfile->list_of_documents($filearray, null, 'systemtools', '', 1, 'documents/', 1, 0, $langs->trans("NoBackupFileAvailable"), 0, $langs->trans("PreviousArchiveFiles"), '', 0, -1, '', '', 'ASC', 1, 0, -1, 'style="height:250px; overflow: auto;"');
|
||||
print '<br>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
@ -88,9 +88,9 @@ class DolibarrApi
|
||||
// phpcs:enable
|
||||
// TODO Use type detected in $object->fields
|
||||
if (in_array($field, array('note', 'note_private', 'note_public', 'desc', 'description'))) {
|
||||
return checkVal($value, 'restricthtml');
|
||||
return sanitizeVal($value, 'restricthtml');
|
||||
} else {
|
||||
return checkVal($value, 'alphanohtml');
|
||||
return sanitizeVal($value, 'alphanohtml');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp.lib.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp", "other"));
|
||||
@ -581,47 +583,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</div>';
|
||||
|
||||
print "</form>\n";
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
$(document).ready(function() {
|
||||
// When clicking on collapse
|
||||
$(".collapse_bom").click(function() {
|
||||
console.log("We click on collapse");
|
||||
var id_bom_line = $(this).attr('id').replace('collapse-', '');
|
||||
console.log($(this).html().indexOf('folder-open'));
|
||||
if($(this).html().indexOf('folder-open') <= 0) {
|
||||
$('[parentid="'+ id_bom_line +'"]').show();
|
||||
$(this).html('<?php echo dol_escape_js(img_picto('', 'folder-open')); ?>');
|
||||
}
|
||||
else {
|
||||
$('[parentid="'+ id_bom_line +'"]').hide();
|
||||
$(this).html('<?php echo dol_escape_js(img_picto('', 'folder')); ?>');
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// To Show all the sub bom lines
|
||||
$("#show_all").click(function() {
|
||||
console.log("We click on show all");
|
||||
$("[class^=sub_bom_lines]").show();
|
||||
$("[class^=collapse_bom]").html('<?php echo dol_escape_js(img_picto('', 'folder-open')); ?>');
|
||||
return false;
|
||||
});
|
||||
|
||||
// To Hide all the sub bom lines
|
||||
$("#hide_all").click(function() {
|
||||
console.log("We click on hide all");
|
||||
$("[class^=sub_bom_lines]").hide();
|
||||
$("[class^=collapse_bom]").html('<?php echo dol_escape_js(img_picto('', 'folder')); ?>');
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
print mrpCollapseBomManagement();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -136,3 +136,55 @@ function bomPrepareHead($object)
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage collapse bom display
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function mrpCollapseBomManagement()
|
||||
{
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
// When clicking on collapse
|
||||
$(".collapse_bom").click(function() {
|
||||
console.log("We click on collapse");
|
||||
var id_bom_line = $(this).attr('id').replace('collapse-', '');
|
||||
console.log($(this).html().indexOf('folder-open'));
|
||||
if($(this).html().indexOf('folder-open') <= 0) {
|
||||
$('[parentid="'+ id_bom_line +'"]').show();
|
||||
$(this).html('<?php echo dol_escape_js(img_picto('', 'folder-open')); ?>');
|
||||
}
|
||||
else {
|
||||
$('[parentid="'+ id_bom_line +'"]').hide();
|
||||
$(this).html('<?php echo dol_escape_js(img_picto('', 'folder')); ?>');
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// To Show all the sub bom lines
|
||||
$("#show_all").click(function() {
|
||||
console.log("We click on show all");
|
||||
$("[class^=sub_bom_lines]").show();
|
||||
$("[class^=collapse_bom]").html('<?php echo dol_escape_js(img_picto('', 'folder-open')); ?>');
|
||||
return false;
|
||||
});
|
||||
|
||||
// To Hide all the sub bom lines
|
||||
$("#hide_all").click(function() {
|
||||
console.log("We click on hide all");
|
||||
$("[class^=sub_bom_lines]").hide();
|
||||
$("[class^=collapse_bom]").html('<?php echo dol_escape_js(img_picto('', 'folder')); ?>');
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
@ -919,7 +919,7 @@ class Categorie extends CommonObject
|
||||
|
||||
$categories = array();
|
||||
|
||||
$type = checkVal($type, 'aZ09');
|
||||
$type = sanitizeVal($type, 'aZ09');
|
||||
|
||||
$sub_type = $type;
|
||||
$subcol_name = "fk_".$type;
|
||||
|
||||
@ -1220,11 +1220,14 @@ class ActionComm extends CommonObject
|
||||
|
||||
if (!empty($this->socpeopleassigned)) {
|
||||
$already_inserted = array();
|
||||
foreach (array_keys($this->socpeopleassigned) as $id) {
|
||||
foreach (array_keys($this->socpeopleassigned) as $key => $val) {
|
||||
if (!is_array($val)) { // For backward compatibility when val=id
|
||||
$val = array('id'=>$val);
|
||||
}
|
||||
if (!empty($already_inserted[$val['id']])) continue;
|
||||
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."actioncomm_resources(fk_actioncomm, element_type, fk_element, mandatory, transparency, answer_status)";
|
||||
$sql .= " VALUES(".((int) $this->id).", 'socpeople', ".((int) $id).", 0, 0, 0)";
|
||||
$sql .= " VALUES(".((int) $this->id).", 'socpeople', ".((int) $val['id']).", 0, 0, 0)";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
|
||||
@ -827,7 +827,7 @@ if ($object->id > 0) {
|
||||
$sql .= ", p.total_tva";
|
||||
$sql .= ", p.total_ttc";
|
||||
$sql .= ", p.ref, p.ref_client, p.remise";
|
||||
$sql .= ", p.datep as dp, p.fin_validite as date_limit";
|
||||
$sql .= ", p.datep as dp, p.fin_validite as date_limit, p.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c";
|
||||
$sql .= " WHERE p.fk_soc = s.rowid AND p.fk_statut = c.id";
|
||||
$sql .= " AND s.rowid = ".((int) $object->id);
|
||||
@ -887,7 +887,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
|
||||
print $formfile->showPreview($file_list, $propal_static->element, $relativepath, 0, $param);
|
||||
print $formfile->showPreview($file_list, $propal_static->element, $relativepath, 0);
|
||||
}
|
||||
// $filename = dol_sanitizeFileName($objp->ref);
|
||||
// $filedir = $conf->propal->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
@ -1226,7 +1226,7 @@ if ($object->id > 0) {
|
||||
* Latest interventions
|
||||
*/
|
||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->lire) {
|
||||
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate";
|
||||
$sql = "SELECT s.nom, s.rowid, f.rowid as id, f.ref, f.fk_statut, f.duree as duration, f.datei as startdate, f.entity";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as f";
|
||||
$sql .= " WHERE f.fk_soc = s.rowid";
|
||||
$sql .= " AND s.rowid = ".((int) $object->id);
|
||||
@ -1261,7 +1261,7 @@ if ($object->id > 0) {
|
||||
print '<td class="nowraponall">';
|
||||
print $fichinter_static->getNomUrl(1);
|
||||
// Preview
|
||||
$filedir = $conf->fichinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
$filedir = $conf->ficheinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
$file_list = null;
|
||||
if (!empty($filedir)) {
|
||||
$file_list = dol_dir_list($filedir, 'files', 0, '', '(\.meta|_preview.*.*\.png)$', 'date', SORT_DESC);
|
||||
@ -1283,7 +1283,7 @@ if ($object->id > 0) {
|
||||
}
|
||||
}
|
||||
$relativepath = dol_sanitizeFileName($objp->ref).'/'.dol_sanitizeFileName($objp->ref).'.pdf';
|
||||
print $formfile->showPreview($file_list, $fichinter_static->element, $relativepath, 0, $param);
|
||||
print $formfile->showPreview($file_list, $fichinter_static->element, $relativepath, 0);
|
||||
}
|
||||
// $filename = dol_sanitizeFileName($objp->ref);
|
||||
// $filedir = $conf->fichinter->multidir_output[$objp->entity].'/'.dol_sanitizeFileName($objp->ref);
|
||||
|
||||
@ -185,6 +185,11 @@ class Mailing extends CommonObject
|
||||
*/
|
||||
public $substitutionarray;
|
||||
|
||||
/**
|
||||
* @var array substitutionarrayfortest
|
||||
*/
|
||||
public $substitutionarrayfortest;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
||||
@ -351,8 +351,8 @@ class Proposals extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
$updateRes = $this->propal->addline(
|
||||
$request_data->desc,
|
||||
@ -496,8 +496,8 @@ class Proposals extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
$propalline = new PropaleLigne($this->db);
|
||||
$result = $propalline->fetch($lineid);
|
||||
|
||||
@ -2735,7 +2735,7 @@ if ($action == 'create' && $usercancreate) {
|
||||
}
|
||||
|
||||
// Create intervention
|
||||
if ($conf->ficheinter->enabled) {
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
$langs->load("interventions");
|
||||
|
||||
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0) {
|
||||
|
||||
@ -350,8 +350,8 @@ class Orders extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
$updateRes = $this->commande->addline(
|
||||
$request_data->desc,
|
||||
@ -418,8 +418,8 @@ class Orders extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
$updateRes = $this->commande->updateline(
|
||||
$lineid,
|
||||
|
||||
@ -250,7 +250,7 @@ class BankAccounts extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
$description = checkVal($description, 'alphanohtml');
|
||||
$description = sanitizeVal($description, 'alphanohtml');
|
||||
|
||||
|
||||
/**
|
||||
@ -498,13 +498,13 @@ class BankAccounts extends DolibarrApi
|
||||
throw new RestException(404, 'account not found');
|
||||
}
|
||||
|
||||
$type = checkVal($type);
|
||||
$label = checkVal($label);
|
||||
$cheque_number = checkVal($cheque_number);
|
||||
$cheque_writer = checkVal($cheque_writer);
|
||||
$cheque_bank = checkVal($cheque_bank);
|
||||
$accountancycode = checkVal($accountancycode);
|
||||
$num_releve = checkVal($num_releve);
|
||||
$type = sanitizeVal($type);
|
||||
$label = sanitizeVal($label);
|
||||
$cheque_number = sanitizeVal($cheque_number);
|
||||
$cheque_writer = sanitizeVal($cheque_writer);
|
||||
$cheque_bank = sanitizeVal($cheque_bank);
|
||||
$accountancycode = sanitizeVal($accountancycode);
|
||||
$num_releve = sanitizeVal($num_releve);
|
||||
|
||||
$result = $account->addline(
|
||||
$date,
|
||||
@ -557,9 +557,9 @@ class BankAccounts extends DolibarrApi
|
||||
throw new RestException(404, 'account line not found');
|
||||
}
|
||||
|
||||
$url = checkVal($url);
|
||||
$label = checkVal($label);
|
||||
$type = checkVal($type);
|
||||
$url = sanitizeVal($url);
|
||||
$label = sanitizeVal($label);
|
||||
$type = sanitizeVal($type);
|
||||
|
||||
$result = $account->add_url_line($line_id, $url_id, $url, $label, $type);
|
||||
if ($result < 0) {
|
||||
|
||||
@ -647,7 +647,7 @@ if (empty($action) || $action == "view" || $action == "close") {
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="fichehalfright">>';
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
@ -659,11 +659,11 @@ if (empty($action) || $action == "view" || $action == "close") {
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("InitialBankBalance").' - '.$langs->trans("Cash").'</td><td>';
|
||||
print price($object->opening, 0, $langs, 1, -1, -1, $conf->currency);
|
||||
print '<span class="amount">'.price($object->opening, 0, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
print "</td></tr>";
|
||||
foreach ($arrayofpaymentmode as $key => $val) {
|
||||
print '<tr><td valign="middle">'.$langs->trans($val).'</td><td>';
|
||||
print price($object->$key, 0, $langs, 1, -1, -1, $conf->currency);
|
||||
print '<span class="amount">'.price($object->$key, 0, $langs, 1, -1, -1, $conf->currency).'</span>';
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
@ -428,8 +428,8 @@ class Invoices extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
$updateRes = $this->invoice->updateline(
|
||||
$lineid,
|
||||
@ -718,8 +718,8 @@ class Invoices extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
// Reset fk_parent_line for no child products and special product
|
||||
if (($request_data->product_type != 9 && empty($request_data->fk_parent_line)) || $request_data->product_type == 9) {
|
||||
|
||||
@ -141,7 +141,6 @@ $search_btn = GETPOST('button_search', 'alpha');
|
||||
$search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
|
||||
|
||||
$option = GETPOST('search_option');
|
||||
if ($option == 'late') {
|
||||
$search_status = '1';
|
||||
|
||||
@ -52,7 +52,7 @@ $hookmanager->initHooks(array('paymentcard', 'globalcard'));
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
|
||||
|
||||
$result = restrictedArea($user, $object->element, $object->id, 'paiement', '');
|
||||
$result = restrictedArea($user, $object->element, $object->id, 'paiement');
|
||||
|
||||
// Security check
|
||||
if ($user->socid) {
|
||||
|
||||
@ -200,8 +200,9 @@ class RemiseCheque extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
$lines = array();
|
||||
|
||||
if ($this->id > 0 && $this->errno == 0) {
|
||||
$lines = array();
|
||||
$sql = "SELECT b.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
$sql .= " WHERE b.fk_type = 'CHQ'";
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -180,6 +180,10 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
$tva->id = $obj->rowid;
|
||||
$tva->ref = $obj->rowid;
|
||||
$tva->label = $obj->label;
|
||||
|
||||
$payment_vat_static->id = $obj->pid;
|
||||
$payment_vat_static->ref = $obj->pid;
|
||||
|
||||
@ -190,31 +194,32 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
|
||||
// VAT
|
||||
print '<td>';
|
||||
$tva->id = $obj->rowid;
|
||||
$tva->ref = $obj->rowid;
|
||||
$tva->label = $obj->label;
|
||||
print $tva->getNomUrl(1, '20');
|
||||
print '</td>';
|
||||
|
||||
// Label
|
||||
print '<td>'.$obj->label.'</td>';
|
||||
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($obj->label).'">'.dol_escape_htmltag($obj->label).'</td>';
|
||||
|
||||
// Date
|
||||
$date = $obj->datev;
|
||||
print '<td>'.dol_print_date($date, 'day').'</td>';
|
||||
$date = $db->jdate($obj->datev);
|
||||
print '<td class="center nowraponall">'.dol_print_date($date, 'day').'</td>';
|
||||
|
||||
// Date payment
|
||||
print '<td class="center">'.dol_print_date($db->jdate($obj->datep), 'day').'</td>';
|
||||
$datep = $db->jdate($obj->datep);
|
||||
print '<td class="center nowraponalls">'.dol_print_date($datep, 'day').'</td>';
|
||||
|
||||
// Type payment
|
||||
print '<td>';
|
||||
$labelpaymenttype = '';
|
||||
if ($obj->payment_code) {
|
||||
print $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||
$labelpaymenttype = $langs->trans("PaymentTypeShort".$obj->payment_code).' ';
|
||||
}
|
||||
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labelpaymenttype).'">';
|
||||
print dol_escape_htmltag($labelpaymenttype);
|
||||
print '</td>';
|
||||
|
||||
// Chq number
|
||||
print '<td>'.$obj->num_payment.'</td>';
|
||||
print '<td>'.dol_escape_htmltag($obj->num_payment).'</td>';
|
||||
|
||||
if (!empty($conf->banque->enabled)) {
|
||||
// Bank transaction
|
||||
@ -231,10 +236,9 @@ if (!empty($conf->tax->enabled) && $user->rights->tax->charges->lire) {
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Type
|
||||
//print '<td><a href="../tva/list.php?filtre=tva.fk_type:'.$obj->type.'">'.$obj->type_label.'</a></td>';
|
||||
// Expected to pay
|
||||
print '<td class="right"><span class="amount">'.price($obj->total).'</span></td>';
|
||||
|
||||
// Paid
|
||||
print '<td class="right"><span class="amount">';
|
||||
if ($obj->totalpaid) {
|
||||
|
||||
@ -251,17 +251,17 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$objthirdparty = $object->thirdparty;
|
||||
|
||||
$out = '';
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||
if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') {
|
||||
$out .= '&originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&socid='.$objthirdparty->id : '');
|
||||
}
|
||||
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&origin=contact&originid='.$object->id.'&percentage=-1&backtopage='.urlencode($_SERVER['PHP_SELF'].($objcon->id > 0 ? '?id='.$objcon->id : ''));
|
||||
$out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog'));
|
||||
}
|
||||
|
||||
$newcardbutton = '';
|
||||
if (!empty($conf->agenda->enabled)) {
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||
if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') {
|
||||
$out .= '&originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&socid='.$objthirdparty->id : '');
|
||||
}
|
||||
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&origin=contact&originid='.$object->id.'&percentage=-1&backtopage='.urlencode($_SERVER['PHP_SELF'].($objcon->id > 0 ? '?id='.$objcon->id : ''));
|
||||
$out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog'));
|
||||
}
|
||||
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||
}
|
||||
|
||||
@ -40,6 +40,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
|
||||
@ -235,6 +236,9 @@ if (empty($reshook)) {
|
||||
$object->birthday = dol_mktime(0, 0, 0, GETPOST("birthdaymonth", 'int'), GETPOST("birthdayday", 'int'), GETPOST("birthdayyear", 'int'));
|
||||
$object->birthday_alert = GETPOST("birthday_alert", 'alpha');
|
||||
|
||||
//Default language
|
||||
$object->default_lang = GETPOST('default_lang');
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) {
|
||||
@ -437,6 +441,9 @@ if (empty($reshook)) {
|
||||
|
||||
$object->roles = GETPOST("roles", 'array'); // Note GETPOSTISSET("role") is null when combo is empty
|
||||
|
||||
//Default language
|
||||
$object->default_lang = GETPOST('default_lang');
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
|
||||
if ($ret < 0) {
|
||||
@ -557,6 +564,7 @@ if (empty($reshook)) {
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$formadmin = new FormAdmin($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
|
||||
$title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
@ -635,7 +643,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$object->country = $tmparray['label'];
|
||||
}
|
||||
|
||||
$title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("AddContact") : $langs->trans("AddContactAddress"));
|
||||
$title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("NewContact") : $langs->trans("NewContactAddress"));
|
||||
$linkback = '';
|
||||
print load_fiche_titre($title, $linkback, 'address');
|
||||
|
||||
@ -872,6 +880,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print $form->selectarray('priv', $selectarray, (GETPOST("priv", 'alpha') ?GETPOST("priv", 'alpha') : $object->priv), 0);
|
||||
print '</td></tr>';
|
||||
|
||||
//Default language
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
|
||||
print $formadmin->select_language(GETPOST('default_lang', 'alpha') ?GETPOST('default_lang', 'alpha') : ($object->default_lang ? $object->default_lang : ''), 'default_lang', 0, 0, 1, 0, 0, 'maxwidth200onsmartphone', 0, 0, 0, null, 1);
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Categories
|
||||
if (!empty($conf->categorie->enabled) && !empty($user->rights->categorie->lire)) {
|
||||
print '<tr><td>'.$form->editfieldkey('Categories', 'contcats', '', $object, 0).'</td><td colspan="3">';
|
||||
@ -1151,6 +1168,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print $form->selectarray('priv', $selectarray, $object->priv, 0);
|
||||
print '</td></tr>';
|
||||
|
||||
//Default language
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
print '<tr><td>'.$form->editfieldkey('DefaultLang', 'default_lang', '', $object, 0).'</td><td colspan="3" class="maxwidthonsmartphone">'."\n";
|
||||
print $formadmin->select_language($object->default_lang, 'default_lang', 0, 0, 1, 0, 0, '', 0, 0, 0, null, 1);
|
||||
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Note Public
|
||||
print '<tr><td class="tdtop"><label for="note_public">'.$langs->trans("NotePublic").'</label></td><td colspan="3">';
|
||||
$doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, empty($conf->global->FCKEDITOR_ENABLE_NOTE_PUBLIC) ? 0 : 1, ROWS_3, '90%');
|
||||
@ -1363,6 +1389,18 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Default language
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
print '<tr><td>'.$langs->trans("DefaultLang").'</td><td>';
|
||||
//$s=picto_from_langcode($object->default_lang);
|
||||
//print ($s?$s.' ':'');
|
||||
$langs->load("languages");
|
||||
$labellang = ($object->default_lang ? $langs->trans('Language_'.$object->default_lang.'_'.strtoupper($object->default_lang)) : '');
|
||||
print $labellang;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr><td>'.$langs->trans("ContactVisibility").'</td><td>';
|
||||
print $object->LibPubPriv($object->priv);
|
||||
print '</td></tr>';
|
||||
|
||||
@ -366,7 +366,7 @@ $param .= "&socid=".urlencode($socid);
|
||||
$param .= "&type_element=".urlencode($type_element);
|
||||
|
||||
$total_qty = 0;
|
||||
|
||||
$num=0;
|
||||
if ($sql_select) {
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
|
||||
@ -132,31 +132,31 @@ if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('b
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
|
||||
$titre = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
|
||||
$title = (!empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("Contacts") : $langs->trans("ContactsAddresses"));
|
||||
if ($type == "p") {
|
||||
if (empty($contextpage) || $contextpage == 'contactlist') {
|
||||
$contextpage = 'contactprospectlist';
|
||||
}
|
||||
$titre .= ' ('.$langs->trans("ThirdPartyProspects").')';
|
||||
$title .= ' ('.$langs->trans("ThirdPartyProspects").')';
|
||||
$urlfiche = "card.php";
|
||||
}
|
||||
if ($type == "c") {
|
||||
if (empty($contextpage) || $contextpage == 'contactlist') {
|
||||
$contextpage = 'contactcustomerlist';
|
||||
}
|
||||
$titre .= ' ('.$langs->trans("ThirdPartyCustomers").')';
|
||||
$title .= ' ('.$langs->trans("ThirdPartyCustomers").')';
|
||||
$urlfiche = "card.php";
|
||||
} elseif ($type == "f") {
|
||||
if (empty($contextpage) || $contextpage == 'contactlist') {
|
||||
$contextpage = 'contactsupplierlist';
|
||||
}
|
||||
$titre .= ' ('.$langs->trans("ThirdPartySuppliers").')';
|
||||
$title .= ' ('.$langs->trans("ThirdPartySuppliers").')';
|
||||
$urlfiche = "card.php";
|
||||
} elseif ($type == "o") {
|
||||
if (empty($contextpage) || $contextpage == 'contactlist') {
|
||||
$contextpage = 'contactotherlist';
|
||||
}
|
||||
$titre .= ' ('.$langs->trans("OthersNotLinkedToThirdParty").')';
|
||||
$title .= ' ('.$langs->trans("OthersNotLinkedToThirdParty").')';
|
||||
$urlfiche = "";
|
||||
}
|
||||
|
||||
@ -709,7 +709,7 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="type" value="'.$type.'">';
|
||||
print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
|
||||
|
||||
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'address', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$topicmail = "Information";
|
||||
$modelmail = "contact";
|
||||
|
||||
@ -278,8 +278,8 @@ class Contracts extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->price_base_type = checkVal($request_data->price_base_type);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->price_base_type = sanitizeVal($request_data->price_base_type);
|
||||
|
||||
$updateRes = $this->contract->addline(
|
||||
$request_data->desc,
|
||||
@ -336,8 +336,8 @@ class Contracts extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->price_base_type = checkVal($request_data->price_base_type);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->price_base_type = sanitizeVal($request_data->price_base_type);
|
||||
|
||||
$updateRes = $this->contract->updateline(
|
||||
$lineid,
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
// $permissiontodelete must be defined
|
||||
// $backurlforlist must be defined
|
||||
// $backtopage may be defined
|
||||
// $noback may be defined
|
||||
// $triggermodname may be defined
|
||||
|
||||
if (!empty($permissionedit) && empty($permissiontoadd)) {
|
||||
@ -137,8 +138,11 @@ if ($action == 'add' && !empty($permissiontoadd)) {
|
||||
}
|
||||
$urltogo = $backtopage ? str_replace('__ID__', $result, $backtopage) : $backurlforlist;
|
||||
$urltogo = preg_replace('/--IDFORBACKTOPAGE--/', $object->id, $urltogo); // New method to autoselect project after a New on another form object creation
|
||||
header("Location: ".$urltogo);
|
||||
exit;
|
||||
|
||||
if (!empty($noback)) {
|
||||
header("Location: " . $urltogo);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
// Creation KO
|
||||
@ -311,8 +315,10 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
|
||||
// Delete OK
|
||||
setEventMessages("RecordDeleted", null, 'mesgs');
|
||||
|
||||
header("Location: ".$backurlforlist);
|
||||
exit;
|
||||
if (!empty($noback)) {
|
||||
header("Location: " . $backurlforlist);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
if (!empty($object->errors)) {
|
||||
@ -355,8 +361,10 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && !empty($permissionto
|
||||
|
||||
setEventMessages($langs->trans('RecordDeleted'), null, 'mesgs');
|
||||
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit;
|
||||
if (!empty($noback)) {
|
||||
header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
@ -494,8 +502,10 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && !empty($permissiontoadd))
|
||||
$newid = $result;
|
||||
}
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF'].'?id='.$newid); // Open record of new object
|
||||
exit;
|
||||
if (!empty($noback)) {
|
||||
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $newid); // Open record of new object
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
setEventMessages($objectutil->error, $objectutil->errors, 'errors');
|
||||
|
||||
@ -131,7 +131,7 @@ class box_graph_nb_tickets_type extends ModeleBoxes
|
||||
}
|
||||
foreach ($listofoppcode as $rowid => $code) {
|
||||
$dataseries[] = array(
|
||||
'label' => $langs->getLabelFromKey($this->db, 'TicketTypeShort' . $code, 'c_ticket_category', 'code', 'label', $code),
|
||||
'label' => $langs->getLabelFromKey($this->db, 'TicketTypeShort' . $code, 'c_ticket_type', 'code', 'label', $code),
|
||||
'data' => (empty($data[$code]) ? 0 : $data[$code])
|
||||
);
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ class box_graph_ticket_by_severity extends ModeleBoxes
|
||||
}
|
||||
foreach ($listofoppcode as $rowid => $code) {
|
||||
$dataseries[] = array(
|
||||
'label' => $langs->getLabelFromKey($this->db, 'TicketSeverityShort' . $code, 'c_ticket_category', 'code', 'label', $code),
|
||||
'label' => $langs->getLabelFromKey($this->db, 'TicketSeverityShort' . $code, 'c_ticket_severity', 'code', 'label', $code),
|
||||
'data' => (empty($data[$code]) ? 0 : $data[$code])
|
||||
);
|
||||
}
|
||||
|
||||
@ -6997,7 +6997,7 @@ abstract class CommonObject
|
||||
$out .= '</select>';
|
||||
} elseif ($type == 'checkbox') {
|
||||
$value_arr = explode(',', $value);
|
||||
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, '', 0, '100%');
|
||||
$out = $form->multiselectarray($keyprefix.$key.$keysuffix, (empty($param['options']) ?null:$param['options']), $value_arr, '', 0, $morecss, 0, '100%');
|
||||
} elseif ($type == 'radio') {
|
||||
$out = '';
|
||||
foreach ($param['options'] as $keyopt => $val) {
|
||||
@ -7982,7 +7982,8 @@ abstract class CommonObject
|
||||
$datenotinstring = $this->db->jdate($datenotinstring);
|
||||
}
|
||||
}
|
||||
$value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)) ? dol_mktime(12, 0, 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year", 'int', 3)) : $datenotinstring;
|
||||
$datekey = $keyprefix.'options_'.$key.$keysuffix;
|
||||
$value = (GETPOSTISSET($datekey)) ? dol_mktime(12, 0, 0, GETPOST($datekey.'month', 'int', 3), GETPOST($datekey.'day', 'int', 3), GETPOST($datekey.'year', 'int', 3)) : $datenotinstring;
|
||||
}
|
||||
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('datetime'))) {
|
||||
$datenotinstring = null;
|
||||
@ -7992,7 +7993,8 @@ abstract class CommonObject
|
||||
$datenotinstring = $this->db->jdate($datenotinstring);
|
||||
}
|
||||
}
|
||||
$value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)) ? dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."sec", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."month", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year", 'int', 3), 'tzuserrel') : $datenotinstring;
|
||||
$timekey = $keyprefix.'options_'.$key.$keysuffix;
|
||||
$value = (GETPOSTISSET($timekey)) ? dol_mktime(GETPOST($timekey.'hour', 'int', 3), GETPOST($timekey.'min', 'int', 3), GETPOST($timekey.'sec', 'int', 3), GETPOST($timekey.'month', 'int', 3), GETPOST($timekey.'day', 'int', 3), GETPOST($timekey.'year', 'int', 3), 'tzuserrel') : $datenotinstring;
|
||||
}
|
||||
// Convert float submited string into real php numeric (value in memory must be a php numeric)
|
||||
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('price', 'double'))) {
|
||||
@ -8000,7 +8002,7 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
// HTML, text, select, integer and varchar: take into account default value in database if in create mode
|
||||
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'varchar', 'select', 'int'))) {
|
||||
if (in_array($extrafields->attributes[$this->table_element]['type'][$key], array('html', 'text', 'varchar', 'select', 'int', 'boolean'))) {
|
||||
if ($action == 'create') {
|
||||
$value = (GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix) || $value) ? $value : $extrafields->attributes[$this->table_element]['default'][$key];
|
||||
}
|
||||
|
||||
@ -42,6 +42,7 @@
|
||||
* {dol_cut_paper_partial} Cut ticket partially
|
||||
* {dol_open_drawer} Open cash drawer
|
||||
* {dol_beep} Activate buzzer
|
||||
* {dol_beep_alternative} Activate buzzer (alternative mode)
|
||||
* {dol_print_barcode} Print barcode
|
||||
* {dol_print_logo} Print logo stored on printer. Example : <print_logo>32|32
|
||||
* {dol_print_logo_old} Print logo stored on printer. Must be followed by logo code. For old printers.
|
||||
@ -52,6 +53,7 @@
|
||||
* {dol_print_order_lines} Print order lines for Printer
|
||||
* {dol_print_object_lines_with_notes} Print object lines with notes
|
||||
* {dol_print_payment} Print payment method
|
||||
* {dol_print_curr_date} Print the current date/time. Must be followed by format string.
|
||||
*
|
||||
* Code which can be placed everywhere
|
||||
* <dol_value_date> Replaced by date AAAA-MM-DD
|
||||
@ -178,6 +180,7 @@ class dolReceiptPrinter extends Printer
|
||||
'dol_cut_paper_partial' => 'DOL_CUT_PAPER_PARTIAL',
|
||||
'dol_open_drawer' => 'DOL_OPEN_DRAWER',
|
||||
'dol_beep' => 'DOL_BEEP',
|
||||
'dol_beep_alternative' => 'DOL_BEEP_ALTERNATIVE',
|
||||
'dol_print_text' => 'DOL_PRINT_TEXT',
|
||||
'dol_print_barcode' => 'DOL_PRINT_BARCODE',
|
||||
'dol_value_date' => 'DateInvoice',
|
||||
@ -189,6 +192,7 @@ class dolReceiptPrinter extends Printer
|
||||
'dol_value_day_letters' => 'DOL_VALUE_DAY',
|
||||
'dol_value_currentdate' => 'DOL_VALUE_CURRENTDATE',
|
||||
'dol_print_payment' => 'DOL_PRINT_PAYMENT',
|
||||
'dol_print_curr_date' => 'DOL_PRINT_CURR_DATE',
|
||||
'dol_print_logo' => 'DOL_PRINT_LOGO',
|
||||
'dol_print_logo_old' => 'DOL_PRINT_LOGO_OLD',
|
||||
'dol_value_object_id' => 'InvoiceID',
|
||||
@ -712,6 +716,10 @@ class dolReceiptPrinter extends Printer
|
||||
$spaces = str_repeat(' ', $spacestoadd > 0 ? $spacestoadd : 0);
|
||||
$this->printer->text($title.$spaces.str_pad(price($object->total_ttc), 10, ' ', STR_PAD_LEFT)."\n");
|
||||
break;
|
||||
case 'DOL_PRINT_CURR_DATE':
|
||||
if (strlen($vals[$tplline]['value'])<2) $this->printer->text(date('d/m/Y H:i:s')."\n");
|
||||
else $this->printer->text(date($vals[$tplline]['value'])."\n");
|
||||
break;
|
||||
case 'DOL_LINE_FEED':
|
||||
$this->printer->feed();
|
||||
break;
|
||||
@ -794,6 +802,9 @@ class dolReceiptPrinter extends Printer
|
||||
case 'DOL_BEEP':
|
||||
$this->printer->getPrintConnector() -> write("\x1e");
|
||||
break;
|
||||
case 'DOL_BEEP_ALTERNATIVE': //if DOL_BEEP not works
|
||||
$this->printer->getPrintConnector() -> write(Printer::ESC . "B" . chr(4) . chr(1));
|
||||
break;
|
||||
case 'DOL_PRINT_ORDER_LINES':
|
||||
foreach ($object->lines as $line) {
|
||||
if ($line->special_code == $this->orderprinter) {
|
||||
|
||||
@ -1067,35 +1067,56 @@ class ExtraFields
|
||||
$out = '<input type="text" class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" value="'.$value.'" '.($moreparam ? $moreparam : '').'> ';
|
||||
} elseif ($type == 'select') {
|
||||
$out = '';
|
||||
if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_EXTRAFIELDS_DISABLE_SELECT2)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
|
||||
}
|
||||
if ($mode) {
|
||||
$options = array();
|
||||
foreach ($param['options'] as $okey => $val) {
|
||||
if ((string) $okey == '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
$out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
|
||||
$out .= '<option value="0"> </option>';
|
||||
foreach ($param['options'] as $key => $val) {
|
||||
if ((string) $key == '') {
|
||||
continue;
|
||||
if ($langfile && $val) {
|
||||
$options[$okey] = $langs->trans($val);
|
||||
} else {
|
||||
$options[$okey] = $val;
|
||||
}
|
||||
}
|
||||
$valarray = explode('|', $val);
|
||||
$val = $valarray[0];
|
||||
$parent = '';
|
||||
if (!empty($valarray[1])) {
|
||||
$parent = $valarray[1];
|
||||
$selected = array();
|
||||
if (!is_array($value)) {
|
||||
$selected = explode(',', $value);
|
||||
}
|
||||
$out .= '<option value="'.$key.'"';
|
||||
$out .= (((string) $value == (string) $key) ? ' selected' : '');
|
||||
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
|
||||
$out .= '>';
|
||||
if ($langfile && $val) {
|
||||
$out .= $langs->trans($val);
|
||||
} else {
|
||||
$out .= $val;
|
||||
|
||||
$out .= $form->multiselectarray($keyprefix.$key.$keysuffix, $options, $selected, 0, 0, $morecss, 0, 0, '', '', '', !empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_EXTRAFIELDS_DISABLE_SELECT2));
|
||||
} else {
|
||||
if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_EXTRAFIELDS_DISABLE_SELECT2)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
|
||||
$out .= ajax_combobox($keyprefix.$key.$keysuffix, array(), 0);
|
||||
}
|
||||
$out .= '</option>';
|
||||
|
||||
$out .= '<select class="flat '.$morecss.' maxwidthonsmartphone" name="'.$keyprefix.$key.$keysuffix.'" id="'.$keyprefix.$key.$keysuffix.'" '.($moreparam ? $moreparam : '').'>';
|
||||
$out .= '<option value="0"> </option>';
|
||||
foreach ($param['options'] as $key => $val) {
|
||||
if ((string) $key == '') {
|
||||
continue;
|
||||
}
|
||||
$valarray = explode('|', $val);
|
||||
$val = $valarray[0];
|
||||
$parent = '';
|
||||
if (!empty($valarray[1])) {
|
||||
$parent = $valarray[1];
|
||||
}
|
||||
$out .= '<option value="'.$key.'"';
|
||||
$out .= (((string) $value == (string) $key) ? ' selected' : '');
|
||||
$out .= (!empty($parent) ? ' parent="'.$parent.'"' : '');
|
||||
$out .= '>';
|
||||
if ($langfile && $val) {
|
||||
$out .= $langs->trans($val);
|
||||
} else {
|
||||
$out .= $val;
|
||||
}
|
||||
$out .= '</option>';
|
||||
}
|
||||
$out .= '</select>';
|
||||
}
|
||||
$out .= '</select>';
|
||||
} elseif ($type == 'sellist') {
|
||||
$out = '';
|
||||
if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_EXTRAFIELDS_DISABLE_SELECT2)) {
|
||||
@ -2133,6 +2154,16 @@ class ExtraFields
|
||||
} else {
|
||||
continue; // Value was not provided, we should not set it.
|
||||
}
|
||||
} elseif ($key_type == 'select') {
|
||||
// to detect if we are in search context
|
||||
if (GETPOSTISARRAY($keysuffix."options_".$key.$keyprefix)) {
|
||||
$value_arr = GETPOST($keysuffix."options_".$key.$keyprefix, 'array:aZ09');
|
||||
// Make sure we get an array even if there's only one selected
|
||||
$value_arr = (array) $value_arr;
|
||||
$value_key = implode(',', $value_arr);
|
||||
} else {
|
||||
$value_key = GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||
}
|
||||
} elseif (in_array($key_type, array('checkbox', 'chkbxlst'))) {
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) {
|
||||
continue; // Value was not provided, we should not set it.
|
||||
|
||||
@ -8432,12 +8432,13 @@ class Form
|
||||
/**
|
||||
* Show linked object block.
|
||||
*
|
||||
* @param CommonObject $object Object we want to show links to
|
||||
* @param string $morehtmlright More html to show on right of title
|
||||
* @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
* @param CommonObject $object Object we want to show links to
|
||||
* @param string $morehtmlright More html to show on right of title
|
||||
* @param array $compatibleImportElementsList Array of compatibles elements object for "import from" action
|
||||
* @param string $title Title
|
||||
* @return int <0 if KO, >=0 if OK
|
||||
*/
|
||||
public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false)
|
||||
public function showLinkedObjectBlock($object, $morehtmlright = '', $compatibleImportElementsList = false, $title = 'RelatedObjects')
|
||||
{
|
||||
global $conf, $langs, $hookmanager;
|
||||
global $bc, $action;
|
||||
@ -8456,7 +8457,7 @@ class Form
|
||||
$nbofdifferenttypes = count($object->linkedObjects);
|
||||
|
||||
print '<!-- showLinkedObjectBlock -->';
|
||||
print load_fiche_titre($langs->trans('RelatedObjects'), $morehtmlright, '', 0, 0, 'showlinkedobjectblock');
|
||||
print load_fiche_titre($langs->trans($title), $morehtmlright, '', 0, 0, 'showlinkedobjectblock');
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -8527,11 +8528,6 @@ class Form
|
||||
if (empty($conf->expedition->enabled)) {
|
||||
continue; // Do not show if module disabled
|
||||
}
|
||||
} elseif ($objecttype == 'mo') {
|
||||
$tplpath = 'mrp/mo';
|
||||
if (empty($conf->mrp->enabled)) {
|
||||
continue; // Do not show if module disabled
|
||||
}
|
||||
} elseif ($objecttype == 'ficheinter') {
|
||||
$tplpath = 'fichinter';
|
||||
if (empty($conf->ficheinter->enabled)) {
|
||||
|
||||
@ -1162,12 +1162,13 @@ class FormFile
|
||||
* @param string $sortfield Sort field ('name', 'size', 'position', ...)
|
||||
* @param string $sortorder Sort order ('ASC' or 'DESC')
|
||||
* @param int $disablemove 1=Disable move button, 0=Position move is possible.
|
||||
* @param int $addfilterfields Add line with filters
|
||||
* @param int $addfilterfields Add the line with filters
|
||||
* @param int $disablecrop Disable crop feature on images (-1 = auto, prefer to set it explicitely to 0 or 1)
|
||||
* @param string $moreattrondiv More attributes on the div for responsive. Example 'style="height:280px; overflow: auto;"'
|
||||
* @return int <0 if KO, nb of files shown if OK
|
||||
* @see list_of_autoecmfiles()
|
||||
*/
|
||||
public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0, $disablecrop = -1)
|
||||
public function list_of_documents($filearray, $object, $modulepart, $param = '', $forcedownload = 0, $relativepath = '', $permonobject = 1, $useinecm = 0, $textifempty = '', $maxlength = 0, $title = '', $url = '', $showrelpart = 0, $permtoeditline = -1, $upload_dir = '', $sortfield = '', $sortorder = 'ASC', $disablemove = 1, $addfilterfields = 0, $disablecrop = -1, $moreattrondiv = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $user, $conf, $langs, $hookmanager, $form;
|
||||
@ -1272,7 +1273,7 @@ class FormFile
|
||||
print '<input type="hidden" name="modulepart" value="'.$modulepart.'">';
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<div class="div-table-responsive-no-min"'.($moreattrondiv ? ' '.$moreattrondiv : '').'>';
|
||||
print '<table id="tablelines" class="centpercent liste noborder nobottom">'."\n";
|
||||
|
||||
if (!empty($addfilterfields)) {
|
||||
@ -1340,7 +1341,8 @@ class FormFile
|
||||
print '<!-- Line list_of_documents '.$key.' relativepath = '.$relativepath.' -->'."\n";
|
||||
// Do we have entry into database ?
|
||||
print '<!-- In database: position='.(array_key_exists('position', $filearray[$key]) ? $filearray[$key]['position'] : 0).' -->'."\n";
|
||||
print '<tr class="oddeven" id="row-'.(array_key_exists('rowid', $filearray[$key]) ? ($filearray[$key]['rowid'] > 0) : 0) ? $filearray[$key]['rowid'] : 'AFTER'.$lastrowid.'POS'.($i + 1).'">';
|
||||
print '<tr class="oddeven" id="row-'.((array_key_exists('rowid', $filearray[$key]) && $filearray[$key]['rowid'] > 0) ? $filearray[$key]['rowid'] : 'AFTER'.$lastrowid.'POS'.($i + 1)).'">';
|
||||
|
||||
|
||||
// File name
|
||||
print '<td class="minwith200 tdoverflowmax500">';
|
||||
|
||||
@ -233,7 +233,7 @@ class Utils
|
||||
$prefix = 'pg_dump';
|
||||
$ext = 'sql';
|
||||
}
|
||||
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.strftime("%Y%m%d%H%M").'.'.$ext;
|
||||
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.dol_print_date(dol_now('gmt'), "dayhourlogsmall", 'tzuser').'.'.$ext;
|
||||
}
|
||||
|
||||
$outputdir = $conf->admin->dir_output.'/backup';
|
||||
@ -276,7 +276,7 @@ class Utils
|
||||
$param = $dolibarr_main_db_name." -h ".$dolibarr_main_db_host;
|
||||
$param .= " -u ".$dolibarr_main_db_user;
|
||||
if (!empty($dolibarr_main_db_port)) {
|
||||
$param .= " -P ".$dolibarr_main_db_port;
|
||||
$param .= " -P ".$dolibarr_main_db_port." --protocol=tcp";
|
||||
}
|
||||
if (GETPOST("use_transaction", "alpha")) {
|
||||
$param .= " --single-transaction";
|
||||
|
||||
@ -964,6 +964,69 @@ function dol_move($srcfile, $destfile, $newmask = 0, $overwriteifexists = 1, $te
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move a directory into another name.
|
||||
*
|
||||
* @param string $srcdir Source directory
|
||||
* @param string $destdir Destination directory
|
||||
* @param int $overwriteifexists Overwrite directory if exists (1 by default)
|
||||
* @param int $indexdatabase Index new file into database.
|
||||
* @param int $renamedircontent Rename contents inside srcdir.
|
||||
*
|
||||
* @return boolean True if OK, false if KO
|
||||
*/
|
||||
function dol_move_dir($srcdir, $destdir, $overwriteifexists = 1, $indexdatabase = 1, $renamedircontent = 1)
|
||||
{
|
||||
|
||||
global $user, $db, $conf;
|
||||
$result = false;
|
||||
|
||||
dol_syslog("files.lib.php::dol_move_dir srcdir=".$srcdir." destdir=".$destdir." overwritifexists=".$overwriteifexists." indexdatabase=".$indexdatabase." renamedircontent=".$renamedircontent);
|
||||
$srcexists = dol_is_dir($srcdir);
|
||||
$srcbasename = basename($srcdir);
|
||||
$destexists = dol_is_dir($destdir);
|
||||
|
||||
if (!$srcexists) {
|
||||
dol_syslog("files.lib.php::dol_move_dir srcdir does not exists. we ignore the move request.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($overwriteifexists || !$destexists) {
|
||||
$newpathofsrcdir = dol_osencode($srcdir);
|
||||
$newpathofdestdir = dol_osencode($destdir);
|
||||
|
||||
$result = @rename($newpathofsrcdir, $newpathofdestdir);
|
||||
|
||||
if ($result && $renamedircontent) {
|
||||
if (file_exists($newpathofdestdir)) {
|
||||
$destbasename = basename($newpathofdestdir);
|
||||
$files = dol_dir_list($newpathofdestdir);
|
||||
if (!empty($files) && is_array($files)) {
|
||||
foreach ($files as $key => $file) {
|
||||
if (!file_exists($file["fullname"])) continue;
|
||||
$filepath = $file["path"];
|
||||
$oldname = $file["name"];
|
||||
|
||||
$newname = str_replace($srcbasename, $destbasename, $oldname);
|
||||
if (!empty($newname) && $newname !== $oldname) {
|
||||
if ($file["type"] == "dir") {
|
||||
$res = dol_move_dir($filepath.'/'.$oldname, $filepath.'/'.$newname, $overwriteifexists, $indexdatabase, $renamedircontent);
|
||||
} else {
|
||||
$res = dol_move($filepath.'/'.$oldname, $filepath.'/'.$newname);
|
||||
}
|
||||
if (!$res) {
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
$result = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unescape a file submitted by upload.
|
||||
* PHP escape char " (%22) or char ' (%27) into $FILES.
|
||||
|
||||
@ -370,6 +370,32 @@ function GETPOSTISSET($paramname)
|
||||
return $isset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the parameter $paramname is submit from a POST OR GET as an array.
|
||||
* Can be used before GETPOST to know if the $check param of GETPOST need to check an array or a string
|
||||
*
|
||||
* @param string $paramname Name or parameter to test
|
||||
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get)
|
||||
* @return bool True if we have just submit a POST or GET request with the parameter provided (even if param is empty)
|
||||
*/
|
||||
function GETPOSTISARRAY($paramname, $method = 0)
|
||||
{
|
||||
// for $method test need return the same $val as GETPOST
|
||||
if (empty($method)) {
|
||||
$val = isset($_GET[$paramname]) ? $_GET[$paramname] : (isset($_POST[$paramname]) ? $_POST[$paramname] : '');
|
||||
} elseif ($method == 1) {
|
||||
$val = isset($_GET[$paramname]) ? $_GET[$paramname] : '';
|
||||
} elseif ($method == 2) {
|
||||
$val = isset($_POST[$paramname]) ? $_POST[$paramname] : '';
|
||||
} elseif ($method == 3) {
|
||||
$val = isset($_POST[$paramname]) ? $_POST[$paramname] : (isset($_GET[$paramname]) ? $_GET[$paramname] : '');
|
||||
} else {
|
||||
$val = 'BadFirstParameterForGETPOST';
|
||||
}
|
||||
|
||||
return is_array($val);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return value of a param into GET or POST supervariable.
|
||||
* Use the property $user->default_values[path]['createform'] and/or $user->default_values[path]['filters'] and/or $user->default_values[path]['sortorder']
|
||||
@ -660,11 +686,11 @@ function GETPOST($paramname, $check = 'alphanohtml', $method = 0, $filter = null
|
||||
$tmpcheck = 'alphanohtml';
|
||||
}
|
||||
foreach ($out as $outkey => $outval) {
|
||||
$out[$outkey] = checkVal($outval, $tmpcheck, $filter, $options);
|
||||
$out[$outkey] = sanitizeVal($outval, $tmpcheck, $filter, $options);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$out = checkVal($out, $check, $filter, $options);
|
||||
$out = sanitizeVal($out, $check, $filter, $options);
|
||||
}
|
||||
|
||||
// Sanitizing for special parameters.
|
||||
@ -713,9 +739,11 @@ function GETPOSTINT($paramname, $method = 0)
|
||||
return (int) GETPOST($paramname, 'int', $method, null, null, 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a value after checking on a rule. A sanitization may also have been done.
|
||||
* Return a sanitized or empty value after checking value against a rule.
|
||||
*
|
||||
* @deprecated
|
||||
* @param string|array $out Value to check/clear.
|
||||
* @param string $check Type of check/sanitizing
|
||||
* @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
|
||||
@ -723,9 +751,24 @@ function GETPOSTINT($paramname, $method = 0)
|
||||
* @return string|array Value sanitized (string or array). It may be '' if format check fails.
|
||||
*/
|
||||
function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = null)
|
||||
{
|
||||
return sanitizeVal($out, $check, $filter, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a sanitized or empty value after checking value against a rule.
|
||||
*
|
||||
* @param string|array $out Value to check/clear.
|
||||
* @param string $check Type of check/sanitizing
|
||||
* @param int $filter Filter to apply when $check is set to 'custom'. (See http://php.net/manual/en/filter.filters.php for détails)
|
||||
* @param mixed $options Options to pass to filter_var when $check is set to 'custom'
|
||||
* @return string|array Value sanitized (string or array). It may be '' if format check fails.
|
||||
*/
|
||||
function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options = null)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
// TODO : use class "Validate" to perform tests (and add missing tests) if needed for factorize
|
||||
// Check is done after replacement
|
||||
switch ($check) {
|
||||
case 'none':
|
||||
@ -2261,7 +2304,7 @@ function dol_bc($var, $moreclass = '')
|
||||
*/
|
||||
function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs = '', $mode = 0, $extralangcode = '')
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf, $langs, $hookmanager;
|
||||
|
||||
$ret = '';
|
||||
$countriesusingstate = array('AU', 'CA', 'US', 'IN', 'GB', 'ES', 'UK', 'TR', 'CN'); // See also MAIN_FORCE_STATE_INTO_ADDRESS
|
||||
@ -2328,6 +2371,14 @@ function dol_format_address($object, $withcountry = 0, $sep = "\n", $outputlangs
|
||||
$langs->load("dict");
|
||||
$ret .= (empty($object->country_code) ? '' : ($ret ? $sep : '').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$object->country_code)));
|
||||
}
|
||||
if ($hookmanager) {
|
||||
$parameters = array('withcountry' => $withcountry, 'sep' => $sep, 'outputlangs' => $outputlangs,'mode' => $mode, 'extralangcode' => $extralangcode);
|
||||
$reshook = $hookmanager->executeHooks('formatAddress', $parameters, $object);
|
||||
if ($reshook > 0) {
|
||||
$ret = '';
|
||||
}
|
||||
$ret .= $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
@ -2453,6 +2504,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
|
||||
} elseif ($format == 'dayhourlog') {
|
||||
// Format not sensitive to language
|
||||
$format = '%Y%m%d%H%M%S';
|
||||
} elseif ($format == 'dayhourlogsmall') {
|
||||
// Format not sensitive to language
|
||||
$format = '%Y%m%d%H%M';
|
||||
} elseif ($format == 'dayhourldap') {
|
||||
$format = '%Y%m%d%H%M%SZ';
|
||||
} elseif ($format == 'dayhourxcard') {
|
||||
|
||||
@ -240,7 +240,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
||||
|
||||
//dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
|
||||
//print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid;
|
||||
//print ", dbtablename=".$dbtablename.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
|
||||
//print ", dbtablename=".$tableandshare.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
|
||||
//print ", perm: ".$features."->".$feature2."=".($user->rights->$features->$feature2->lire)."<br>";
|
||||
|
||||
$parentfortableentity = '';
|
||||
@ -536,8 +536,8 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
|
||||
if (!$user->rights->fournisseur->facture->creer) {
|
||||
$deleteok = 0;
|
||||
}
|
||||
} elseif ($feature == 'payment') { // Permission to delete a payment of an invoice is permission to edit an invoice.
|
||||
if (!$user->rights->facture->creer) {
|
||||
} elseif ($feature == 'payment') {
|
||||
if (!$user->rights->facture->paiement) {
|
||||
$deleteok = 0;
|
||||
}
|
||||
} elseif ($feature == 'banque') {
|
||||
|
||||
@ -450,26 +450,6 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
||||
include DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||
}
|
||||
|
||||
// Show logo
|
||||
if ($foruserprofile) {
|
||||
// Nothing
|
||||
} else {
|
||||
// Show logo
|
||||
print '<tr class="oddeven"><td class="titlefieldmiddle">'.$langs->trans("EnableShowLogo").'</td><td>';
|
||||
if ($edit) {
|
||||
print ajax_constantonoff('MAIN_SHOW_LOGO', array(), null, 0, 0, 1);
|
||||
//print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1);
|
||||
} else {
|
||||
print yn($conf->global->MAIN_SHOW_LOGO);
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
/*
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>';
|
||||
print "</tr>";*/
|
||||
}
|
||||
|
||||
|
||||
// TopMenuDisableImages
|
||||
if ($foruserprofile) {
|
||||
/*
|
||||
@ -493,26 +473,51 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
||||
if ($edit) print '<br>('.$langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis").')';
|
||||
print '</td>';*/
|
||||
} else {
|
||||
$default = $langs->trans('No');
|
||||
$listoftopmenumodes = array(
|
||||
'0' => $langs->transnoentitiesnoconv("IconAndText"),
|
||||
'1' => $langs->transnoentitiesnoconv("TextOnly"),
|
||||
'2' => $langs->transnoentitiesnoconv("IconOnlyAllTextsOnHover"),
|
||||
'3' => $langs->transnoentitiesnoconv("IconOnlyTextOnHover"),
|
||||
'4' => $langs->transnoentitiesnoconv("IconOnly"),
|
||||
);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("TopMenuDisableImages").'</td>';
|
||||
print '<td colspan="'.($colspan - 1).'">';
|
||||
if ($edit) {
|
||||
print ajax_constantonoff('THEME_TOPMENU_DISABLE_IMAGE', array(), null, 0, 0, 1);
|
||||
//print $form->selectyesno('THEME_TOPMENU_DISABLE_IMAGE', $conf->global->THEME_TOPMENU_DISABLE_IMAGE, 1);
|
||||
//print ajax_constantonoff('THEME_TOPMENU_DISABLE_IMAGE', array(), null, 0, 0, 1);
|
||||
print $form->selectarray('THEME_TOPMENU_DISABLE_IMAGE', $listoftopmenumodes, $conf->global->THEME_TOPMENU_DISABLE_IMAGE);
|
||||
} else {
|
||||
print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE);
|
||||
$listoftopmenumodes[$conf->global->THEME_TOPMENU_DISABLE_IMAGE];
|
||||
//print yn($conf->global->THEME_TOPMENU_DISABLE_IMAGE);
|
||||
}
|
||||
print ' <span class="nowraponall opacitymedium">'.$langs->trans("Default").'</span>: <strong>'.$default.'</strong> ';
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Show logo
|
||||
if ($foruserprofile) {
|
||||
// Nothing
|
||||
} else {
|
||||
// Show logo
|
||||
print '<tr class="oddeven"><td class="titlefieldmiddle">'.$langs->trans("EnableShowLogo").'</td><td>';
|
||||
if ($edit) {
|
||||
print ajax_constantonoff('MAIN_SHOW_LOGO', array(), null, 0, 0, 1);
|
||||
//print $form->selectyesno('MAIN_SHOW_LOGO', $conf->global->MAIN_SHOW_LOGO, 1);
|
||||
} else {
|
||||
print yn($conf->global->MAIN_SHOW_LOGO);
|
||||
}
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
/*
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("EnableShowLogo").'</td><td>' . yn($conf->global->MAIN_SHOW_LOGO) . '</td>';
|
||||
print "</tr>";*/
|
||||
}
|
||||
|
||||
// BorderTableActive
|
||||
if ($foruserprofile) {
|
||||
} else {
|
||||
$default = $langs->trans('No');
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("UseBorderOnTable").'</td>';
|
||||
print '<td colspan="'.($colspan - 1).'">';
|
||||
@ -522,8 +527,7 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false)
|
||||
} else {
|
||||
print yn($conf->global->THEME_ELDY_USEBORDERONTABLE);
|
||||
}
|
||||
print ' <span class="nowraponall opacitymedium">'.$langs->trans("Default").'</span>: <strong>'.$default.'</strong> ';
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes").', '.$langs->trans("PressF5AfterChangingThis"));
|
||||
print $form->textwithpicto('', $langs->trans("NotSupportedByAllThemes"));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -807,7 +807,6 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
if ($mainmenu == 'hrm') {
|
||||
get_left_menu_hrm($mainmenu, $newmenu, $usemenuhider, $leftmenu, $type_user);
|
||||
}
|
||||
|
||||
/*
|
||||
* Menu TOOLS
|
||||
*/
|
||||
@ -2262,19 +2261,19 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("holiday", "trips"));
|
||||
|
||||
$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'hrm', 0, '', '', '', img_picto('', 'holiday', 'class="pictofixedwidth"'));
|
||||
$newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->rights->holiday->write);
|
||||
$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=hrm", $langs->trans("List"), 1, $user->rights->holiday->read);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu == "hrm") {
|
||||
$newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=hrm", $langs->trans("DraftCP"), 2, $user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=hrm", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=hrm", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=hrm", $langs->trans("CancelCP"), 2, $user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=hrm", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->rights->holiday->read, '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="pictofixedwidth"'));
|
||||
$newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->rights->holiday->write, '', $mainmenu);
|
||||
$newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->rights->holiday->read, '', $mainmenu);
|
||||
if ($usemenuhider || empty($leftmenu) || $leftmenu == "holiday") {
|
||||
$newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm');
|
||||
$newmenu->add("/holiday/list.php?search_status=2&mainmenu=hrm&leftmenu=holiday", $langs->trans("ToReviewCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm');
|
||||
$newmenu->add("/holiday/list.php?search_status=3&mainmenu=hrm&leftmenu=holiday", $langs->trans("ApprovedCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm');
|
||||
$newmenu->add("/holiday/list.php?search_status=4&mainmenu=hrm&leftmenu=holiday", $langs->trans("CancelCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm');
|
||||
$newmenu->add("/holiday/list.php?search_status=5&mainmenu=hrm&leftmenu=holiday", $langs->trans("RefuseCP"), 2, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm');
|
||||
}
|
||||
$newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read);
|
||||
$newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->readall);
|
||||
$newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday);
|
||||
$newmenu->add("/holiday/define_holiday.php?mainmenu=hrm&action=request", $langs->trans("MenuConfCP"), 1, $user->rights->holiday->read, '', $mainmenu, 'holiday_sm');
|
||||
$newmenu->add("/holiday/month_report.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("MenuReportMonth"), 1, $user->rights->holiday->readall, '', $mainmenu, 'holiday_sm');
|
||||
$newmenu->add("/holiday/view_log.php?mainmenu=hrm&leftmenu=holiday&action=request", $langs->trans("MenuLogCP"), 1, $user->rights->holiday->define_holiday, '', $mainmenu, 'holiday_sm');
|
||||
}
|
||||
|
||||
// Trips and expenses (old module)
|
||||
@ -2316,6 +2315,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get left Menu TOOLS
|
||||
*
|
||||
|
||||
@ -715,19 +715,16 @@ class ImportCsv extends ModeleImports
|
||||
}
|
||||
if (!empty($newval) && $arrayrecord[($key - 1)]['type'] > 0) {
|
||||
$socialkey = array_search("socialnetworks", $listfields);
|
||||
$socialnetwork = explode("_", $fieldname)[1];
|
||||
if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") {
|
||||
$socialnetwork = explode("_", $fieldname)[1];
|
||||
$json = new stdClass();
|
||||
$json->$socialnetwork = $newval;
|
||||
$newvalue = json_encode($json);
|
||||
$listvalues[$socialkey] = "'".$this->db->escape($newvalue)."'";
|
||||
$listvalues[$socialkey] = json_encode($json);
|
||||
} else {
|
||||
$socialnetwork = explode("_", $fieldname)[1];
|
||||
$jsondata = $listvalues[$socialkey];
|
||||
$jsondata = str_replace("'", "", $jsondata);
|
||||
$json = json_decode($jsondata);
|
||||
$json->$socialnetwork = $newval;
|
||||
$listvalues[$socialkey] = "'".$this->db->escape(json_encode($json))."'";
|
||||
$listvalues[$socialkey] = json_encode($json);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -745,6 +742,12 @@ class ImportCsv extends ModeleImports
|
||||
$i++;
|
||||
}
|
||||
|
||||
// We db escape social network field because he isn't in field creation
|
||||
if (in_array("socialnetworks", $listfields)) {
|
||||
$socialkey = array_search("socialnetworks", $listfields);
|
||||
$tmpsql = $listvalues[$socialkey];
|
||||
$listvalues[$socialkey] = "'".$this->db->escape($tmpsql)."'";
|
||||
}
|
||||
// We add hidden fields (but only if there is at least one field to add into table)
|
||||
// We process here all the fields that were declared into the array ->import_fieldshidden_array of the descriptor file.
|
||||
// Previously we processed the ->import_fields_array.
|
||||
|
||||
@ -411,7 +411,7 @@ class modRecruitment extends DolibarrModules
|
||||
$sql = array();
|
||||
|
||||
// Document template
|
||||
$moduledir = 'mymodule';
|
||||
$moduledir = 'recruitment';
|
||||
$myTmpObjects = array();
|
||||
$myTmpObjects['RecruitmentJobPosition'] = array('includerefgeneration'=>1, 'includedocgeneration'=>1);
|
||||
|
||||
@ -419,10 +419,10 @@ class modRecruitment extends DolibarrModules
|
||||
if ($myTmpObjectKey == 'MyObject') {
|
||||
continue;
|
||||
}
|
||||
if ($myTmpObjectArray['includerefgeneration']) {
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/mymodule/template_myobjects.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/mymodule';
|
||||
$dest = $dirodt.'/template_myobjects.odt';
|
||||
if ($myTmpObjectArray['includedocgeneration']) {
|
||||
$src = DOL_DOCUMENT_ROOT.'/install/doctemplates/'.$moduledir.'/template_recruitmentjobposition.odt';
|
||||
$dirodt = DOL_DATA_ROOT.'/doctemplates/'.$moduledir;
|
||||
$dest = $dirodt.'/template_recruitmentjobposition.odt';
|
||||
|
||||
if (file_exists($src) && !file_exists($dest)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
@ -438,6 +438,7 @@ class modRecruitment extends DolibarrModules
|
||||
$sql = array_merge($sql, array(
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey)."' AND type = '".$this->db->escape(strtolower($myTmpObjectKey))."' AND entity = ".((int) $conf->entity),
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey)."','".$this->db->escape(strtolower($myTmpObjectKey))."',".((int) $conf->entity).")",
|
||||
|
||||
"DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = 'generic_".strtolower($myTmpObjectKey)."_odt' AND type = '".$this->db->escape(strtolower($myTmpObjectKey))."' AND entity = ".((int) $conf->entity),
|
||||
"INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey)."_odt', '".$this->db->escape(strtolower($myTmpObjectKey))."', ".((int) $conf->entity).")"
|
||||
));
|
||||
|
||||
@ -91,7 +91,7 @@ class modResource extends DolibarrModules
|
||||
|
||||
// Dependencies
|
||||
// List of modules id that must be enabled if this module is enabled
|
||||
$this->depends = array('modResource');
|
||||
$this->depends = array();
|
||||
// List of modules id to disable if this one is disabled
|
||||
$this->requiredby = array('modPlace');
|
||||
// Minimum version of PHP required by module
|
||||
|
||||
@ -48,7 +48,7 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
|
||||
}
|
||||
$sql .= ")";
|
||||
}
|
||||
} elseif ($crit != '' && (!in_array($typ, array('select', 'sellist')) || $crit != '0') && (!in_array($typ, array('link')) || $crit != '-1')) {
|
||||
} elseif ($crit != '' && (!in_array($typ, array('select', 'sellist', 'select')) || $crit != '0') && (!in_array($typ, array('link')) || $crit != '-1')) {
|
||||
$mode_search = 0;
|
||||
if (in_array($typ, array('int', 'double', 'real', 'price'))) {
|
||||
$mode_search = 1; // Search on a numeric
|
||||
@ -59,13 +59,14 @@ if (!empty($extrafieldsobjectkey) && !empty($search_array_options) && is_array($
|
||||
if (in_array($typ, array('sellist')) && !is_numeric($crit)) {
|
||||
$mode_search = 0;// Search on a foreign key string
|
||||
}
|
||||
if (in_array($typ, array('chkbxlst', 'checkbox'))) {
|
||||
if (in_array($typ, array('chkbxlst', 'checkbox', 'select'))) {
|
||||
$mode_search = 4; // Search on a multiselect field with sql type = text
|
||||
}
|
||||
if (is_array($crit)) {
|
||||
$crit = implode(' ', $crit); // natural_search() expects a string
|
||||
} elseif ($typ === 'select' and is_string($crit) and strpos($crit, ' ') === false) {
|
||||
$sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." = '".$db->escape($crit)."')";
|
||||
} elseif ($typ === 'select' and is_string($crit) and strpos($crit, ',') === false) {
|
||||
$critSelect = "'".implode("','", array_map(array($db, 'escape'), explode(',', $crit)))."'";
|
||||
$sql .= " AND (".$extrafieldsobjectprefix.$tmpkey." IN (".$db->sanitize($critSelect, 1).") )";
|
||||
continue;
|
||||
}
|
||||
$sql .= natural_search($extrafieldsobjectprefix.$tmpkey, $crit, $mode_search);
|
||||
|
||||
@ -202,8 +202,8 @@ class InterfaceStripe extends DolibarrTriggers
|
||||
$this->db->query($sql);
|
||||
}
|
||||
|
||||
// If payment mode is linked to Stripee, we update/delete Stripe too
|
||||
if ($action == 'COMPANYPAYMENTMODE_MODIFY' && $object->type == 'card') {
|
||||
// If payment mode is linked to Stripe, we update/delete Stripe too
|
||||
if ($action == 'COMPANYPAYMENTMODE_CREATE' && $object->type == 'card') {
|
||||
// For creation of credit card, we do not create in Stripe automatically
|
||||
}
|
||||
if ($action == 'COMPANYPAYMENTMODE_MODIFY' && $object->type == 'card') {
|
||||
@ -222,6 +222,7 @@ class InterfaceStripe extends DolibarrTriggers
|
||||
}
|
||||
|
||||
if ($customer) {
|
||||
dol_syslog("We got the customer, so now we update the credit card", LOG_DEBUG);
|
||||
$card = $stripe->cardStripe($customer, $object, $stripeacc, $servicestatus);
|
||||
if ($card) {
|
||||
$card->metadata = array('dol_id'=>$object->id, 'dol_version'=>DOL_VERSION, 'dol_entity'=>$conf->entity, 'ipaddress'=>(empty($_SERVER['REMOTE_ADDR']) ? '' : $_SERVER['REMOTE_ADDR']));
|
||||
|
||||
@ -901,9 +901,17 @@ class EmailCollector extends CommonObject
|
||||
// Overwrite param $tmpproperty
|
||||
$valueextracted = isset($regforval[count($regforval) - 1]) ?trim($regforval[count($regforval) - 1]) : null;
|
||||
if (strtolower($sourcefield) == 'header') {
|
||||
$object->$tmpproperty = $this->decodeSMTPSubject($valueextracted);
|
||||
if (preg_match('/^options_/', $tmpproperty)) {
|
||||
$object->array_options[preg_replace('/^options_/', '', $tmpproperty)] = $this->decodeSMTPSubject($valueextracted);
|
||||
} else {
|
||||
$object->$tmpproperty = $this->decodeSMTPSubject($valueextracted);
|
||||
}
|
||||
} else {
|
||||
$object->$tmpproperty = $valueextracted;
|
||||
if (preg_match('/^options_/', $tmpproperty)) {
|
||||
$object->array_options[preg_replace('/^options_/', '', $tmpproperty)] = $this->decodeSMTPSubject($valueextracted);
|
||||
} else {
|
||||
$object->$tmpproperty = $this->decodeSMTPSubject($valueextracted);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Regex not found
|
||||
|
||||
@ -279,8 +279,8 @@ class Shipments extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
$updateRes = $this->shipment->addline(
|
||||
$request_data->desc,
|
||||
@ -347,8 +347,8 @@ class Shipments extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
$updateRes = $this->shipment->updateline(
|
||||
$lineid,
|
||||
|
||||
@ -251,8 +251,8 @@ class ExpenseReports extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
$updateRes = $this->expensereport->addline(
|
||||
$request_data->desc,
|
||||
@ -319,8 +319,8 @@ class ExpenseReports extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = checkVal($request_data->label);
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
$request_data->label = sanitizeVal($request_data->label);
|
||||
|
||||
$updateRes = $this->expensereport->updateline(
|
||||
$lineid,
|
||||
|
||||
@ -302,7 +302,7 @@ class Export
|
||||
public function build_filterQuery($TypeField, $NameField, $ValueField)
|
||||
{
|
||||
// phpcs:enable
|
||||
$NameField = checkVal($NameField, 'aZ09');
|
||||
$NameField = sanitizeVal($NameField, 'aZ09');
|
||||
$szFilterQuery = '';
|
||||
|
||||
//print $TypeField." ".$NameField." ".$ValueField;
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2011-2020 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2014-2018 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2014-2018 Charlene Benke <charlies@patas-monkey.com>
|
||||
* Copyright (C) 2014-2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
* Copyright (C) 2015-2016 Abbes Bahfir <bafbes@gmail.com>
|
||||
* Copyright (C) 2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
@ -65,6 +65,7 @@ $mesg = GETPOST('msg', 'alpha');
|
||||
$origin = GETPOST('origin', 'alpha');
|
||||
$originid = (GETPOST('originid', 'int') ?GETPOST('originid', 'int') : GETPOST('origin_id', 'int')); // For backward compatibility
|
||||
$note_public = GETPOST('note_public', 'restricthtml');
|
||||
$note_private = GETPOST('note_private', 'restricthtml');
|
||||
$lineid = GETPOST('line_id', 'int');
|
||||
|
||||
$error = 0;
|
||||
@ -79,6 +80,7 @@ $hookmanager->initHooks(array('interventioncard', 'globalcard'));
|
||||
|
||||
$object = new Fichinter($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$objectsrc = null;
|
||||
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
||||
@ -776,7 +778,7 @@ if (empty($reshook)) {
|
||||
|
||||
$form = new Form($db);
|
||||
$formfile = new FormFile($db);
|
||||
if ($conf->contrat->enabled) {
|
||||
if (!empty($conf->contrat->enabled)) {
|
||||
$formcontract = new FormContract($db);
|
||||
}
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
@ -1227,7 +1229,7 @@ if ($action == 'create') {
|
||||
print '</tr>';
|
||||
|
||||
// Contract
|
||||
if ($conf->contrat->enabled) {
|
||||
if (!empty($conf->contrat->enabled)) {
|
||||
$langs->load('contracts');
|
||||
print '<tr>';
|
||||
print '<td>';
|
||||
@ -1510,7 +1512,7 @@ if ($action == 'create') {
|
||||
// editeur wysiwyg
|
||||
if (empty($conf->global->FICHINTER_EMPTY_LINE_DESC)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('np_desc', GETPOST('np_desc', 'restricthtml'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, ROWS_2, '90%');
|
||||
$doleditor = new DolEditor('np_desc', GETPOST('np_desc', 'restricthtml'), '', 100, 'dolibarr_details', '', false, true, !empty($conf->global->FCKEDITOR_ENABLE_DETAILS), ROWS_2, '90%');
|
||||
$doleditor->Create();
|
||||
}
|
||||
|
||||
|
||||
@ -558,8 +558,8 @@ class SupplierInvoices extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->description = checkVal($request_data->description, 'restricthtml');
|
||||
$request_data->ref_supplier = checkVal($request_data->ref_supplier);
|
||||
$request_data->description = sanitizeVal($request_data->description, 'restricthtml');
|
||||
$request_data->ref_supplier = sanitizeVal($request_data->ref_supplier);
|
||||
|
||||
$updateRes = $this->invoice->addline(
|
||||
$request_data->description,
|
||||
@ -625,8 +625,8 @@ class SupplierInvoices extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->description = checkVal($request_data->description, 'restricthtml');
|
||||
$request_data->ref_supplier = checkVal($request_data->ref_supplier);
|
||||
$request_data->description = sanitizeVal($request_data->description, 'restricthtml');
|
||||
$request_data->ref_supplier = sanitizeVal($request_data->ref_supplier);
|
||||
|
||||
$updateRes = $this->invoice->updateline(
|
||||
$lineid,
|
||||
|
||||
@ -153,18 +153,6 @@ $htmlother = new FormOther($db);
|
||||
$formfile = new FormFile($db);
|
||||
|
||||
// Init $array_match_file_to_database from _SESSION
|
||||
$serialized_array_match_file_to_database = isset($_SESSION["dol_array_match_file_to_database"]) ? $_SESSION["dol_array_match_file_to_database"] : '';
|
||||
$array_match_file_to_database = array();
|
||||
$fieldsarray = explode(',', $serialized_array_match_file_to_database);
|
||||
foreach ($fieldsarray as $elem) {
|
||||
$tabelem = explode('=', $elem, 2);
|
||||
$key = $tabelem[0];
|
||||
$val = (isset($tabelem[1]) ? $tabelem[1] : '');
|
||||
if ($key && $val) {
|
||||
$array_match_file_to_database[$key] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($array_match_file_to_database)) {
|
||||
$serialized_array_match_file_to_database = isset($_SESSION["dol_array_match_file_to_database_select"]) ? $_SESSION["dol_array_match_file_to_database_select"] : '';
|
||||
$array_match_file_to_database = array();
|
||||
@ -492,7 +480,7 @@ if ($step == 2 && $datatoimport) {
|
||||
$filetoimport = '';
|
||||
|
||||
// Add format informations and link to download example
|
||||
print '<tr class="liste_titre"><td colspan="6">';
|
||||
print '<tr class="liste_titre"><td colspan="5">';
|
||||
print $langs->trans("FileMustHaveOneOfFollowingFormat");
|
||||
print '</td></tr>';
|
||||
$list = $objmodelimport->liste_modeles($db);
|
||||
@ -502,9 +490,11 @@ if ($step == 2 && $datatoimport) {
|
||||
$text = $objmodelimport->getDriverDescForKey($key);
|
||||
print '<td>'.$form->textwithpicto($objmodelimport->getDriverLabelForKey($key), $text).'</td>';
|
||||
print '<td style="text-align:center">';
|
||||
print img_picto('', 'download', 'class="paddingright opacitymedium"').'<a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$key.$param.'" target="_blank" rel="noopener noreferrer">'.$langs->trans("DownloadEmptyExample");
|
||||
print '<a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$key.$param.'" target="_blank" rel="noopener noreferrer">';
|
||||
print img_picto('', 'download', 'class="paddingright opacitymedium"');
|
||||
print $langs->trans("DownloadEmptyExample");
|
||||
print '</a>';
|
||||
print ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("StarAreMandatory").')</span>';
|
||||
print $form->textwithpicto('', $langs->trans("StarAreMandatory"));
|
||||
print '</td>';
|
||||
// Action button
|
||||
print '<td style="text-align:right">';
|
||||
@ -591,9 +581,11 @@ if ($step == 3 && $datatoimport) {
|
||||
$text = $objmodelimport->getDriverDescForKey($format);
|
||||
print $form->textwithpicto($objmodelimport->getDriverLabelForKey($format), $text);
|
||||
print '</td><td style="text-align:right" class="nowrap">';
|
||||
print img_picto('', 'download', 'class="paddingright opacitymedium"').'<a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$format.$param.'" target="_blank" rel="noopener noreferrer">'.$langs->trans("DownloadEmptyExample");
|
||||
print '<a href="'.DOL_URL_ROOT.'/imports/emptyexample.php?format='.$format.$param.'" target="_blank" rel="noopener noreferrer">';
|
||||
print img_picto('', 'download', 'class="paddingright opacitymedium"');
|
||||
print $langs->trans("DownloadEmptyExample");
|
||||
print '</a>';
|
||||
print ' <span class="opacitymedium hideonsmartphone">('.$langs->trans("StarAreMandatory").')</span>';
|
||||
print $form->textwithpicto('', $langs->trans("StarAreMandatory"));
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -1072,14 +1064,14 @@ if ($step == 4 && $datatoimport) {
|
||||
if (!$line["imported"]) {
|
||||
$optionsnotused .= $text;
|
||||
}
|
||||
$optionsall[$code] = array('label'=>$langs->trans($line["label"]), 'required'=>(empty($line["required"]) ? 0 : 1), 'position'=>$line['position']);
|
||||
$optionsall[$code] = array('label'=>$langs->trans($line["label"]), 'required'=>(empty($line["required"]) ? 0 : 1), 'position'=>!empty($line['position']) ? $line['position'] : 0);
|
||||
}
|
||||
// $optionsall is an array of all possible fields. key=>array('label'=>..., 'xxx')
|
||||
|
||||
$height = '32px'; //needs px for css height attribute below
|
||||
$i = 0;
|
||||
$mandatoryfieldshavesource = true;
|
||||
|
||||
$more = "";
|
||||
//var_dump($fieldstarget);
|
||||
//var_dump($optionsall);
|
||||
//exit;
|
||||
@ -1100,7 +1092,7 @@ if ($step == 4 && $datatoimport) {
|
||||
$entity = (!empty($objimport->array_import_entities[0][$code]) ? $objimport->array_import_entities[0][$code] : $objimport->array_import_icon[0]);
|
||||
|
||||
$tablealias = preg_replace('/(\..*)$/i', '', $code);
|
||||
$tablename = $objimport->array_import_tables[0][$tablealias];
|
||||
$tablename = !empty($objimport->array_import_tables[0][$tablealias]) ? $objimport->array_import_tables[0][$tablealias] : "";
|
||||
|
||||
$entityicon = !empty($entitytoicon[$entity]) ? $entitytoicon[$entity] : $entity; // $entityicon must string name of picto of the field like 'project', 'company', 'contact', 'modulename', ...
|
||||
$entitylang = $entitytolang[$entity] ? $entitytolang[$entity] : $objimport->array_import_label[0]; // $entitylang must be a translation key to describe object the field is related to, like 'Company', 'Contact', 'MyModyle', ...
|
||||
@ -1118,8 +1110,8 @@ if ($step == 4 && $datatoimport) {
|
||||
//var_dump($_SESSION['dol_array_match_file_to_database']);
|
||||
//var_dump($modetoautofillmapping);
|
||||
|
||||
print '<select id="selectorderimport_'.($i+1).'" class="targetselectchange minwidth300" name="select_'.$line["label"].'">';
|
||||
if ($line["imported"]) {
|
||||
print '<select id="selectorderimport_'.($i+1).'" class="targetselectchange minwidth300" name="select_'.($i+1).'">';
|
||||
if (!empty($line["imported"])) {
|
||||
print '<option value="-1"> </option>';
|
||||
} else {
|
||||
print '<option selected="" value="-1"> </option>';
|
||||
@ -1166,10 +1158,10 @@ if ($step == 4 && $datatoimport) {
|
||||
//var_dump($code);
|
||||
//var_dump($tmpselectioninsession);
|
||||
//if ($tmpselectioninsession[$j] == $code) {
|
||||
if ($tmpselectioninsession[($i+1)] == $tmpcode) {
|
||||
if (!empty($tmpselectioninsession[($i+1)]) && $tmpselectioninsession[($i+1)] == $tmpcode) {
|
||||
print ' selected';
|
||||
}
|
||||
print ' data-debug="'.$tmpcode.'-'.$code.'-'.$j.'-'.$tmpselectioninsession[($i+1)].'"';
|
||||
print ' data-debug="'.$tmpcode.'-'.$code.'-'.$j.'-'.(!empty($tmpselectioninsession[($i+1)]) ? $tmpselectioninsession[($i+1)] : "").'"';
|
||||
}
|
||||
print ' data-html="'.dol_escape_htmltag($label).'"';
|
||||
print '>';
|
||||
@ -1234,7 +1226,7 @@ if ($step == 4 && $datatoimport) {
|
||||
$htmltext .= $langs->trans("DataCodeIDSourceIsInsertedInto").'<br>';
|
||||
}
|
||||
}
|
||||
$htmltext .= $langs->trans("FieldTitle").": <b>".$langs->trans($line["label"])."</b><br>";
|
||||
$htmltext .= $langs->trans("FieldTitle").": <b>".$langs->trans($fieldstarget[$arraykeysfieldtarget[$code-1]]["label"])."</b><br>";
|
||||
$htmltext .= $langs->trans("Table")." -> ".$langs->trans("Field").': <b>'.$tablename." -> ".preg_replace('/^.*\./', '', $code)."</b><br>";
|
||||
print $form->textwithpicto($more, $htmltext);
|
||||
print '</tr>';
|
||||
@ -1657,7 +1649,7 @@ if ($step == 5 && $datatoimport) {
|
||||
|
||||
// Keys for data UPDATE (not INSERT of new data)
|
||||
print '<tr><td>';
|
||||
print $langs->trans("KeysToUseForUpdates");
|
||||
print $form->textwithpicto($langs->trans("KeysToUseForUpdates"), $langs->trans("SelectPrimaryColumnsForUpdateAttempt"));
|
||||
print '</td><td>';
|
||||
if ($action == 'launchsimu') {
|
||||
if (count($updatekeys)) {
|
||||
@ -1672,7 +1664,7 @@ if ($step == 5 && $datatoimport) {
|
||||
} else {
|
||||
if (is_array($objimport->array_import_updatekeys[0]) && count($objimport->array_import_updatekeys[0])) { //TODO dropdown UL is created inside nested SPANS
|
||||
print $form->multiselectarray('updatekeys', $objimport->array_import_updatekeys[0], $updatekeys, 0, 0, '', 1, '80%');
|
||||
print $form->textwithpicto("", $langs->trans("SelectPrimaryColumnsForUpdateAttempt"));
|
||||
//print $form->textwithpicto("", $langs->trans("SelectPrimaryColumnsForUpdateAttempt"));
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("UpdateNotYetSupportedForThisImport").'</span>';
|
||||
}
|
||||
|
||||
@ -400,5 +400,7 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (23
|
||||
--delete from llx_c_tva where rowid = 1181; -- to delete a record that does not follow rules for rowid (fk_pays+'1')
|
||||
--insert into llx_c_tva(rowid, fk_pays, taux, recuperableonly, note, active) SELECT CONCAT(c.rowid, '1'), c.rowid, 0, 0, 'No VAT', 1 from llx_c_country as c where c.rowid not in (select fk_pays from llx_c_tva);
|
||||
|
||||
|
||||
|
||||
-- BURUNDI (id country=61) -- https://www.objectif-import-export.fr/fr/marches-internationaux/fiche-pays/burundi/presentation-fiscalite
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2335,61, '0','0','No VAT',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2336,61, '10','0','VAT 10%',1);
|
||||
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2337,61, '18','0','VAT 18%',1);
|
||||
|
||||
@ -14,7 +14,9 @@
|
||||
-- To create a unique index ALTER TABLE llx_table ADD UNIQUE INDEX uk_table_field (field);
|
||||
-- To drop an index: -- VMYSQL4.1 DROP INDEX nomindex on llx_table;
|
||||
-- To drop an index: -- VPGSQL8.2 DROP INDEX nomindex;
|
||||
-- To make pk to be auto increment (mysql): -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
||||
-- To make pk to be auto increment (mysql):
|
||||
-- -- VMYSQL4.3 ALTER TABLE llx_table ADD PRIMARY KEY(rowid);
|
||||
-- -- VMYSQL4.3 ALTER TABLE llx_table CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
||||
-- To make pk to be auto increment (postgres):
|
||||
-- -- VPGSQL8.2 CREATE SEQUENCE llx_table_rowid_seq OWNED BY llx_table.rowid;
|
||||
-- -- VPGSQL8.2 ALTER TABLE llx_table ADD PRIMARY KEY (rowid);
|
||||
@ -33,8 +35,24 @@
|
||||
|
||||
-- Missing in v15 or lower
|
||||
|
||||
-- VMYSQL4.3 ALTER TABLE llx_c_civility ADD PRIMARY KEY(rowid);
|
||||
-- VMYSQL4.3 ALTER TABLE llx_c_civility CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
||||
|
||||
-- VMYSQL4.3 ALTER TABLE llx_c_payment_term ADD PRIMARY KEY(rowid);
|
||||
-- VMYSQL4.3 ALTER TABLE llx_c_payment_term CHANGE COLUMN rowid rowid INTEGER NOT NULL AUTO_INCREMENT;
|
||||
|
||||
-- VPGSQL8.2 CREATE SEQUENCE llx_c_civility_rowid_seq OWNED BY llx_c_civility.rowid;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_c_civility ADD PRIMARY KEY (rowid);
|
||||
-- VPGSQL8.2 ALTER TABLE llx_c_civility ALTER COLUMN rowid SET DEFAULT nextval('llx_c_civility_rowid_seq');
|
||||
-- VPGSQL8.2 SELECT setval('llx_c_civility_rowid_seq', MAX(rowid)) FROM llx_c_civility;
|
||||
|
||||
-- VPGSQL8.2 CREATE SEQUENCE llx_c_payment_term_rowid_seq OWNED BY llx_c_payment_term.rowid;
|
||||
-- VPGSQL8.2 ALTER TABLE llx_c_payment_term ADD PRIMARY KEY (rowid);
|
||||
-- VPGSQL8.2 ALTER TABLE llx_c_payment_term ALTER COLUMN rowid SET DEFAULT nextval('llx_c_payment_term_rowid_seq');
|
||||
-- VPGSQL8.2 SELECT setval('llx_c_payment_term_rowid_seq', MAX(rowid)) FROM llx_c_payment_term;
|
||||
|
||||
|
||||
|
||||
ALTER TABLE llx_c_transport_mode ADD UNIQUE INDEX uk_c_transport_mode (code, entity);
|
||||
|
||||
ALTER TABLE llx_c_shipment_mode MODIFY COLUMN tracking varchar(255) NULL;
|
||||
@ -380,3 +398,8 @@ ALTER TABLE llx_fichinter ADD COLUMN ref_client varchar(255) after ref_ext;
|
||||
ALTER TABLE llx_c_holiday_types ADD COLUMN sortorder smallint;
|
||||
|
||||
ALTER TABLE llx_expedition MODIFY COLUMN ref_customer varchar(255);
|
||||
|
||||
ALTER TABLE llx_extrafields ADD COLUMN css varchar(128);
|
||||
ALTER TABLE llx_extrafields ADD COLUMN cssview varchar(128);
|
||||
ALTER TABLE llx_extrafields ADD COLUMN csslist varchar(128);
|
||||
|
||||
|
||||
@ -40,6 +40,9 @@ create table llx_extrafields
|
||||
totalizable boolean DEFAULT FALSE, -- is extrafield totalizable on list
|
||||
langs varchar(64), -- example: fileofmymodule@mymodule
|
||||
help text, -- to store help tooltip
|
||||
css varchar(128), -- to store css on create/update forms
|
||||
cssview varchar(128), -- to store css on view form
|
||||
csslist varchar(128), -- to store css on list
|
||||
fk_user_author integer, -- user making creation
|
||||
fk_user_modif integer, -- user making last change
|
||||
datec datetime, -- date de creation
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
use Luracast\Restler\RestException;
|
||||
|
||||
dol_include_once('/knowledgemanagement/class/knowledgerecord.class.php');
|
||||
dol_include_once('/categories/class/categorie.class.php');
|
||||
|
||||
|
||||
|
||||
@ -85,6 +86,39 @@ class KnowledgeManagement extends DolibarrApi
|
||||
return $this->_cleanObjectDatas($this->knowledgerecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get categories for a knowledgerecord object
|
||||
*
|
||||
* @param int $id ID of knowledgerecord object
|
||||
* @param string $sortfield Sort field
|
||||
* @param string $sortorder Sort order
|
||||
* @param int $limit Limit for list
|
||||
* @param int $page Page number
|
||||
*
|
||||
* @return mixed
|
||||
*
|
||||
* @url GET /knowledgerecords/{id}/categories
|
||||
*/
|
||||
public function getCategories($id, $sortfield = "s.rowid", $sortorder = 'ASC', $limit = 0, $page = 0)
|
||||
{
|
||||
if (!DolibarrApiAccess::$user->rights->categorie->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
$categories = new Categorie($this->db);
|
||||
|
||||
$result = $categories->getListForItem($id, 'knowledgemanagement', $sortfield, $sortorder, $limit, $page);
|
||||
|
||||
if (empty($result)) {
|
||||
throw new RestException(404, 'No category found');
|
||||
}
|
||||
|
||||
if ($result < 0) {
|
||||
throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* List knowledgerecords
|
||||
@ -218,7 +252,7 @@ class KnowledgeManagement extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
// $this->knowledgerecord->abc = checkVal($this->knowledgerecord->abc, 'alphanohtml');
|
||||
// $this->knowledgerecord->abc = sanitizeVal($this->knowledgerecord->abc, 'alphanohtml');
|
||||
|
||||
if ($this->knowledgerecord->create(DolibarrApiAccess::$user)<0) {
|
||||
throw new RestException(500, "Error creating KnowledgeRecord", array_merge(array($this->knowledgerecord->error), $this->knowledgerecord->errors));
|
||||
@ -260,7 +294,7 @@ class KnowledgeManagement extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
// $this->knowledgerecord->abc = checkVal($this->knowledgerecord->abc, 'alphanohtml');
|
||||
// $this->knowledgerecord->abc = sanitizeVal($this->knowledgerecord->abc, 'alphanohtml');
|
||||
|
||||
if ($this->knowledgerecord->update(DolibarrApiAccess::$user, false) > 0) {
|
||||
return $this->get($id);
|
||||
|
||||
@ -95,7 +95,7 @@ if (!$sortorder) {
|
||||
}
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
|
||||
$search_all = GETPOST('search_all', 'alphanohtml');
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
@ -124,11 +124,11 @@ $arrayfields = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) {
|
||||
$visible = (int) dol_eval($val['visible'], 1, 1, '1');
|
||||
$visible = (int) dol_eval($val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
'label'=>$val['label'],
|
||||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
|
||||
'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)),
|
||||
'position'=>$val['position'],
|
||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
@ -234,13 +234,13 @@ $sql .= $object->getFieldList('t');
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ",ef.".$key." as options_".$key.', ' : '');
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= preg_replace('/^,/', ',', $hookmanager->resPrint);
|
||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
@ -278,10 +278,10 @@ foreach ($search as $key => $val) {
|
||||
$columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
|
||||
if (preg_match('/_dtstart$/', $key)) {
|
||||
$sql .= " AND t.".$columnName." >= '".$db->idate($search[$key])."'";
|
||||
$sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
|
||||
}
|
||||
if (preg_match('/_dtend$/', $key)) {
|
||||
$sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'";
|
||||
$sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'";
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -340,35 +340,34 @@ $sql.=$hookmanager->resPrint;
|
||||
$sql=preg_replace('/,\s*$/','', $sql);
|
||||
*/
|
||||
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
|
||||
// Count total nb of records
|
||||
$nbtotalofrecords = '';
|
||||
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
|
||||
$resql = $db->query($sql);
|
||||
$nbtotalofrecords = $db->num_rows($resql);
|
||||
|
||||
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
|
||||
$page = 0;
|
||||
$offset = 0;
|
||||
}
|
||||
$db->free($resql);
|
||||
}
|
||||
// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
|
||||
if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit))) {
|
||||
$num = $nbtotalofrecords;
|
||||
} else {
|
||||
if ($limit) {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
// Complete request and execute it with limit
|
||||
$sql .= $db->order($sortfield, $sortorder);
|
||||
if ($limit) {
|
||||
$sql .= $db->plimit($limit + 1, $offset);
|
||||
}
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql) {
|
||||
dol_print_error($db);
|
||||
exit;
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
|
||||
// Direct jump if only one record found
|
||||
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
@ -381,12 +380,15 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
||||
// Output page
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
|
||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
|
||||
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
if (!empty($mode)) {
|
||||
$param .= '&mode='.urlencode($mode);
|
||||
}
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
}
|
||||
@ -396,9 +398,11 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
||||
foreach ($search as $key => $val) {
|
||||
if (is_array($search[$key]) && count($search[$key])) {
|
||||
foreach ($search[$key] as $skey) {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
if ($skey != '') {
|
||||
$param .= '&search_'.$key.'[]='.urlencode($skey);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} elseif ($search[$key] != '') {
|
||||
$param .= '&search_'.$key.'='.urlencode($search[$key]);
|
||||
}
|
||||
}
|
||||
@ -455,10 +459,13 @@ $trackid = 'xxxx'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
if ($search_all) {
|
||||
$setupstring = '';
|
||||
foreach ($fieldstosearchall as $key => $val) {
|
||||
$fieldstosearchall[$key] = $langs->trans($val);
|
||||
$setupstring .= $key."=".$val.";";
|
||||
}
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>';
|
||||
print '<!-- Search done like if PRODUCT_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
|
||||
print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>'."\n";
|
||||
}
|
||||
|
||||
$moreforfilter = '';
|
||||
@ -503,6 +510,13 @@ print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwit
|
||||
// Fields title search
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
// Action column
|
||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons('left');
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$searchkey = empty($search[$key]) ? '' : $search[$key];
|
||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
||||
@ -512,16 +526,16 @@ foreach ($object->fields as $key => $val) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $searchkey, $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) {
|
||||
print $object->showInputField($val, $key, $searchkey, '', '', 'search_', 'maxwidth125', 1);
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
|
||||
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
@ -530,9 +544,11 @@ foreach ($object->fields as $key => $val) {
|
||||
print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
} elseif ($key == 'lang') {
|
||||
print $formadmin->select_language($searchkey, 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2);
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
|
||||
$formadmin = new FormAdmin($db);
|
||||
print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2);
|
||||
} else {
|
||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($searchkey).'">';
|
||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
@ -545,16 +561,23 @@ $parameters = array('arrayfields'=>$arrayfields);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print '<td class="liste_titre maxwidthsearch">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
|
||||
// Fields title label
|
||||
// --------------------------------------------------------------------
|
||||
print '<tr class="liste_titre">';
|
||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
@ -563,11 +586,13 @@ foreach ($object->fields as $key => $val) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID') {
|
||||
} elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
$cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
@ -577,7 +602,10 @@ $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$
|
||||
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||
}
|
||||
$totalarray['nbfield']++;
|
||||
print '</tr>'."\n";
|
||||
|
||||
|
||||
@ -595,8 +623,10 @@ if (!empty($extrafields->attributes[$object->table_element]['computed']) && is_a
|
||||
// Loop on record
|
||||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$savnbfield = $totalarray['nbfield'];
|
||||
$totalarray['nbfield'] = 0;
|
||||
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||
while ($i < $imaxinloop) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) {
|
||||
break; // Should not happen
|
||||
@ -606,8 +636,20 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$object->setVarsFromFetchObj($obj);
|
||||
|
||||
// Show here line of result
|
||||
print '<tr class="oddeven">';
|
||||
$totalarray['nbfield'] = 0;
|
||||
$j = 0;
|
||||
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||
// Action column
|
||||
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
@ -622,14 +664,20 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status'))) {
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
//if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '');
|
||||
if (preg_match('/tdoverflow/', $cssforfield)) {
|
||||
print ' title="'.dol_escape_htmltag($object->$key).'"';
|
||||
}
|
||||
print '>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
} elseif ($key == 'fk_user_creat') {
|
||||
if ($object->fk_user_creat > 0) {
|
||||
if (isset($conf->cache['user'][$object->fk_user_creat])) {
|
||||
@ -695,15 +743,17 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
// Action column
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print '<td class="nowrap center">';
|
||||
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||
$selected = 0;
|
||||
if (in_array($object->id, $arrayofselected)) {
|
||||
$selected = 1;
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
}
|
||||
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||
print '</td>';
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -724,14 +774,14 @@ if ($num == 0) {
|
||||
$colspan++;
|
||||
}
|
||||
}
|
||||
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
|
||||
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||
}
|
||||
|
||||
|
||||
$db->free($resql);
|
||||
|
||||
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
@ -2048,7 +2048,7 @@ COMPANY_AQUARIUM_CLEAN_REGEX=Regex filter to clean value (COMPANY_AQUARIUM_CLEAN
|
||||
COMPANY_DIGITARIA_CLEAN_REGEX=Regex filter to clean value (COMPANY_DIGITARIA_CLEAN_REGEX)
|
||||
COMPANY_DIGITARIA_UNIQUE_CODE=Duplicate not allowed
|
||||
GDPRContact=Data Protection Officer (DPO, Data Privacy or GDPR contact)
|
||||
GDPRContactDesc=If you store data about European companies/citizens, you can name the contact who is responsible for the General Data Protection Regulation here
|
||||
GDPRContactDesc=If you store personal data in your Information System, you can name the contact who is responsible for the General Data Protection Regulation here
|
||||
HelpOnTooltip=Help text to show on tooltip
|
||||
HelpOnTooltipDesc=Put text or a translation key here for the text to show in a tooltip when this field appears in a form
|
||||
YouCanDeleteFileOnServerWith=You can delete this file on the server with Command Line:<br>%s
|
||||
@ -2254,4 +2254,11 @@ ReadOnlyMode=Is instance in "Read Only" mode
|
||||
DEBUGBAR_USE_LOG_FILE=Use the <b>dolibarr.log</b> file to trap Logs
|
||||
UsingLogFileShowAllRecordOfSubrequestButIsSlower=Use the dolibarr.log file to trap Logs instead of live memory catching. It allows to catch all logs instead of only log of current process (so including the one of ajax subrequests pages) but will make your instance very very slow. Not recommended.
|
||||
FixedOrPercent=Fixed (use keyword 'fixed') or percent (use keyword 'percent')
|
||||
DefaultOpportunityStatus=Default opportunity status (first status when lead is created)
|
||||
DefaultOpportunityStatus=Default opportunity status (first status when lead is created)
|
||||
IconAndText=Icon and text
|
||||
TextOnly=Text only
|
||||
IconOnlyAllTextsOnHover=Icon only - All texts appears under icon on mouse hover menu bar
|
||||
IconOnlyTextOnHover=Icon only - Text of icon appears under icon on mouse hover the icon
|
||||
IconOnly=Icon only - Text on tooltip only
|
||||
INVOICE_ADD_ZATCA_QR_CODE=Show the ZATCA QR code on invoices
|
||||
INVOICE_ADD_ZATCA_QR_CODEMore=Some Arabic countries need this QR Code on their invoices
|
||||
|
||||
@ -172,8 +172,8 @@ SEPAMandate=SEPA mandate
|
||||
YourSEPAMandate=Your SEPA mandate
|
||||
FindYourSEPAMandate=This is your SEPA mandate to authorize our company to make direct debit order to your bank. Return it signed (scan of the signed document) or send it by mail to
|
||||
AutoReportLastAccountStatement=Automatically fill the field 'number of bank statement' with last statement number when making reconciliation
|
||||
CashControl=POS cash desk control
|
||||
NewCashFence=New cash desk opening or closing
|
||||
CashControl=POS cash control
|
||||
NewCashFence=New cash control (opening or closing)
|
||||
BankColorizeMovement=Colorize movements
|
||||
BankColorizeMovementDesc=If this function is enable, you can choose specific background color for debit or credit movements
|
||||
BankColorizeMovementName1=Background color for debit movement
|
||||
|
||||
@ -50,8 +50,8 @@ Footer=Footer
|
||||
AmountAtEndOfPeriod=Amount at end of period (day, month or year)
|
||||
TheoricalAmount=Theorical amount
|
||||
RealAmount=Real amount
|
||||
CashFence=Cash desk closing
|
||||
CashFenceDone=Cash desk closing done for the period
|
||||
CashFence=Cash box closing
|
||||
CashFenceDone=Cash box closing done for the period
|
||||
NbOfInvoices=Nb of invoices
|
||||
Paymentnumpad=Type of Pad to enter payment
|
||||
Numberspad=Numbers Pad
|
||||
@ -102,8 +102,8 @@ CashDeskGenericMaskCodes6 = <br><b>{TN}</b> tag is used to add the terminal numb
|
||||
TakeposGroupSameProduct=Group same products lines
|
||||
StartAParallelSale=Start a new parallel sale
|
||||
SaleStartedAt=Sale started at %s
|
||||
ControlCashOpening=Open the "Control cash" popup when opening the POS
|
||||
CloseCashFence=Close cash desk control
|
||||
ControlCashOpening=Open the "Control cash box" popup when opening the POS
|
||||
CloseCashFence=Close cash box control
|
||||
CashReport=Cash report
|
||||
MainPrinterToUse=Main printer to use
|
||||
OrderPrinterToUse=Order printer to use
|
||||
|
||||
@ -53,8 +53,8 @@ TypeOfLineServiceOrProduct=Type of line (0=product, 1=service)
|
||||
FileWithDataToImport=File with data to import
|
||||
FileToImport=Source file to import
|
||||
FileMustHaveOneOfFollowingFormat=File to import must have one of following formats
|
||||
DownloadEmptyExample=Download template file with field content information
|
||||
StarAreMandatory=* are mandatory fields
|
||||
DownloadEmptyExample=Download a template file with examples and information on fields you can import
|
||||
StarAreMandatory=Into the template file, all fields with a * are mandatory fields
|
||||
ChooseFormatOfFileToImport=Choose the file format to use as import file format by clicking on the %s icon to select it...
|
||||
ChooseFileToImport=Upload file then click on the %s icon to select file as source import file...
|
||||
SourceFileFormat=Source file format
|
||||
|
||||
@ -1175,4 +1175,5 @@ ConfirmAllocateCommercialQuestion=Are you sure you want to assign the %s selecte
|
||||
CommercialsAffected=Sales representatives affected
|
||||
CommercialAffected=Sales representative affected
|
||||
YourMessage=Votre message
|
||||
YourMessageHasBeenReceived=Your message has been received. We will answer or contact you as soon as possible.
|
||||
YourMessageHasBeenReceived=Your message has been received. We will answer or contact you as soon as possible.
|
||||
UrlToCheck=Url to check
|
||||
@ -109,6 +109,6 @@ THMEstimatedHelp=This rate makes it possible to define a forecast cost of the it
|
||||
BOM=Bill Of Materials
|
||||
CollapseBOMHelp=You can define the default display of the details of the nomenclature in the configuration of the BOM module
|
||||
MOAndLines=Manufacturing Orders and lines
|
||||
BOMNetNeeds=Net Needs
|
||||
TreeStructure=Tree structure
|
||||
GroupByProduct=Group by product
|
||||
MoChildGenerate=Generate Child Mo
|
||||
ParentMo=MO Parent
|
||||
MOChild=MO Child
|
||||
|
||||
@ -110,7 +110,7 @@ ChooseYourDemoProfilMore=...or build your own profile<br>(manual module selectio
|
||||
DemoFundation=Manage members of a foundation
|
||||
DemoFundation2=Manage members and bank account of a foundation
|
||||
DemoCompanyServiceOnly=Company or freelance selling service only
|
||||
DemoCompanyShopWithCashDesk=Manage a shop with a cash desk
|
||||
DemoCompanyShopWithCashDesk=Manage a shop with a cash box
|
||||
DemoCompanyProductAndStocks=Shop selling products with Point Of Sales
|
||||
DemoCompanyManufacturing=Company manufacturing products
|
||||
DemoCompanyAll=Company with multiple activities (all main modules)
|
||||
|
||||
@ -55,6 +55,8 @@ DOL_DEFAULT_HEIGHT_WIDTH=Default height and width size
|
||||
DOL_UNDERLINE=Enable underline
|
||||
DOL_UNDERLINE_DISABLED=Disable underline
|
||||
DOL_BEEP=Beep sound
|
||||
DOL_BEEP_ALTERNATIVE=Beep sound (alternative mode)
|
||||
DOL_PRINT_CURR_DATE=Print current date/time
|
||||
DOL_PRINT_TEXT=Print text
|
||||
DateInvoiceWithTime=Invoice date and time
|
||||
YearInvoice=Invoice year
|
||||
|
||||
@ -55,6 +55,8 @@ DOL_DEFAULT_HEIGHT_WIDTH=Altezza e larghezza predefinite
|
||||
DOL_UNDERLINE=Abilita sottolineatura
|
||||
DOL_UNDERLINE_DISABLED=Disabilita la sottolineatura
|
||||
DOL_BEEP=Suono di Beep
|
||||
DOL_BEEP_ALTERNATIVE=Suono di Beep (modalità alternativa)
|
||||
DOL_PRINT_CURR_DATE=Stampa la data/ora corrente
|
||||
DOL_PRINT_TEXT=Stampa il testo
|
||||
DateInvoiceWithTime=Data e ora della fattura
|
||||
YearInvoice=Anno della fattura
|
||||
|
||||
@ -2399,6 +2399,14 @@ function printDropdownQuickadd()
|
||||
|
||||
$items = array(
|
||||
'items' => array(
|
||||
array(
|
||||
"url" => "/adherents/card.php?action=create&mainmenu=members",
|
||||
"title" => "MenuNewMember@members",
|
||||
"name" => "Adherent@members",
|
||||
"picto" => "object_member",
|
||||
"activation" => !empty($conf->adherent->enabled) && $user->rights->adherent->creer, // vs hooking
|
||||
"position" => 5,
|
||||
),
|
||||
array(
|
||||
"url" => "/societe/card.php?action=create&mainmenu=companies",
|
||||
"title" => "MenuNewThirdParty@companies",
|
||||
@ -2452,7 +2460,7 @@ function printDropdownQuickadd()
|
||||
"url" => "/supplier_proposal/card.php?action=create&mainmenu=commercial",
|
||||
"title" => "SupplierProposalNew@supplier_proposal",
|
||||
"name" => "SupplierProposal@supplier_proposal",
|
||||
"picto" => "object_propal",
|
||||
"picto" => "supplier_proposal",
|
||||
"activation" => !empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer, // vs hooking
|
||||
"position" => 70,
|
||||
),
|
||||
@ -2460,7 +2468,7 @@ function printDropdownQuickadd()
|
||||
"url" => "/fourn/commande/card.php?action=create&mainmenu=commercial",
|
||||
"title" => "NewSupplierOrderShort@orders",
|
||||
"name" => "SupplierOrder@orders",
|
||||
"picto" => "object_order",
|
||||
"picto" => "supplier_order",
|
||||
"activation" => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->creer) || (!empty($conf->supplier_order->enabled) && $user->rights->supplier_order->creer), // vs hooking
|
||||
"position" => 80,
|
||||
),
|
||||
@ -2468,7 +2476,7 @@ function printDropdownQuickadd()
|
||||
"url" => "/fourn/facture/card.php?action=create&mainmenu=billing",
|
||||
"title" => "NewBill@bills",
|
||||
"name" => "SupplierBill@bills",
|
||||
"picto" => "object_bill",
|
||||
"picto" => "supplier_invoice",
|
||||
"activation" => (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->creer) || (!empty($conf->supplier_invoice->enabled) && $user->rights->supplier_invoice->creer), // vs hooking
|
||||
"position" => 90,
|
||||
),
|
||||
@ -2488,6 +2496,14 @@ function printDropdownQuickadd()
|
||||
"activation" => !empty($conf->service->enabled) && $user->rights->service->creer, // vs hooking
|
||||
"position" => 110,
|
||||
),
|
||||
array(
|
||||
"url" => "/user/card.php?action=create&type=1&mainmenu=home",
|
||||
"title" => "AddUser@users",
|
||||
"name" => "User@users",
|
||||
"picto" => "user",
|
||||
"activation" => $user->rights->user->user->creer, // vs hooking
|
||||
"position" => 500,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
@ -218,7 +218,7 @@ class MyModuleApi extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
// $this->myobject->abc = checkVal($this->myobject->abc, 'alphanohtml');
|
||||
// $this->myobject->abc = sanitizeVal($this->myobject->abc, 'alphanohtml');
|
||||
|
||||
if ($this->myobject->create(DolibarrApiAccess::$user)<0) {
|
||||
throw new RestException(500, "Error creating MyObject", array_merge(array($this->myobject->error), $this->myobject->errors));
|
||||
@ -260,7 +260,7 @@ class MyModuleApi extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
// $this->myobject->abc = checkVal($this->myobject->abc, 'alphanohtml');
|
||||
// $this->myobject->abc = sanitizeVal($this->myobject->abc, 'alphanohtml');
|
||||
|
||||
if ($this->myobject->update(DolibarrApiAccess::$user, false) > 0) {
|
||||
return $this->get($id);
|
||||
|
||||
@ -562,7 +562,8 @@ if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
|
||||
print '</td>';
|
||||
}
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
$searchkey = empty($search[$key]) ? '' : $search[$key];
|
||||
$cssforfield = (empty($val['css']) ? '' : $val['css']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
|
||||
@ -120,6 +120,7 @@ class Mo extends CommonObject
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'default'=>0, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '2'=>'InProgress', '3'=>'StatusMOProduced', '9'=>'Canceled')),
|
||||
'fk_parent_line' => array('type'=>'integer:MoLine:mrp/class/mo.class.php', 'label'=>'ParentMo', 'enabled'=>1, 'visible'=>0, 'position'=>1020, 'default'=>0, 'notnull'=>0, 'index'=>1,'showoncombobox'=>0),
|
||||
);
|
||||
public $rowid;
|
||||
public $entity;
|
||||
@ -201,6 +202,11 @@ class Mo extends CommonObject
|
||||
*/
|
||||
public $lines = array();
|
||||
|
||||
/**
|
||||
* @var integer Mo parent line
|
||||
* */
|
||||
|
||||
public $fk_parent_line;
|
||||
|
||||
|
||||
/**
|
||||
@ -1267,15 +1273,18 @@ class Mo extends CommonObject
|
||||
|
||||
/**
|
||||
* Create an array of lines
|
||||
*
|
||||
* @param string $rolefilter string lines role filter
|
||||
* @return array|int array of lines if OK, <0 if KO
|
||||
*/
|
||||
public function getLinesArray()
|
||||
public function getLinesArray($rolefilter = '')
|
||||
{
|
||||
$this->lines = array();
|
||||
|
||||
$objectline = new MoLine($this->db);
|
||||
$result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_mo = '.((int) $this->id)));
|
||||
|
||||
$TFilters = array('customsql'=>'fk_mo = '.((int) $this->id));
|
||||
if (!empty($rolefilter)) $TFilters['role'] = $rolefilter;
|
||||
$result = $objectline->fetchAll('ASC', 'position', 0, 0, $TFilters);
|
||||
|
||||
if (is_numeric($result)) {
|
||||
$this->error = $this->error;
|
||||
@ -1380,6 +1389,13 @@ class Mo extends CommonObject
|
||||
$text_stock_options .= (!empty($conf->global->STOCK_CALCULATE_ON_RECEPTION) || !empty($conf->global->STOCK_CALCULATE_ON_RECEPTION_CLOSE) ? '- '.$langs->trans("StockOnReception").'<br>' : '');
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
// Product or sub-bom
|
||||
print '<td class="linecoldescription">'.$langs->trans('Description');
|
||||
if (!empty($conf->global->BOM_SUB_BOM)) {
|
||||
print ' <a id="show_all" href="#">'.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").'</a> ';
|
||||
print '<a id="hide_all" href="#">'.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").'</a> ';
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans('Ref').'</td>';
|
||||
print '<td class="right">'.$langs->trans('Qty');
|
||||
if ($this->bom->bomtype == 0) {
|
||||
@ -1392,9 +1408,9 @@ class Mo extends CommonObject
|
||||
print '<td class="center">'.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).'</td>';
|
||||
print '<td class="center">'.$langs->trans('QtyFrozen').'</td>';
|
||||
print '<td class="center">'.$langs->trans('DisableStockChange').'</td>';
|
||||
//print '<td class="right">'.$langs->trans('Efficiency').'</td>';
|
||||
print '<td class="center">'.$langs->trans('MoChildGenerate').'</td>';
|
||||
//print '<td class="center">'.$form->showCheckAddButtons('checkforselect', 1).'</td>';
|
||||
print '<td class="center"></td>';
|
||||
// print '<td class="center"></td>';
|
||||
print '</tr>';
|
||||
$i = 0;
|
||||
|
||||
@ -1478,6 +1494,81 @@ class Mo extends CommonObject
|
||||
|
||||
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function used to return childs of Mo
|
||||
*
|
||||
* @return array if OK, -1 if KO
|
||||
*/
|
||||
public function getMoChilds()
|
||||
{
|
||||
|
||||
$TMoChilds = array();
|
||||
$error = 0;
|
||||
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."mrp_mo as mo_child";
|
||||
$sql.= " WHERE fk_parent_line IN ";
|
||||
$sql.= " (SELECT rowid FROM ".MAIN_DB_PREFIX."mrp_production as line_parent";
|
||||
$sql.= " WHERE fk_mo=".((int) $this->id).")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ($resql) {
|
||||
if ($this->db->num_rows($resql) > 0) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$MoChild = new Mo($this->db);
|
||||
$res = $MoChild->fetch($obj->rowid);
|
||||
if ($res > 0) $TMoChilds[$MoChild->id] = $MoChild;
|
||||
else $error++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
return -1;
|
||||
} else {
|
||||
return $TMoChilds;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function used to return childs of Mo
|
||||
*
|
||||
* @return object Mo if OK, -1 if KO, 0 if not exist
|
||||
*/
|
||||
public function getMoParent()
|
||||
{
|
||||
|
||||
$MoParent = new Mo($this->db);
|
||||
$error = 0;
|
||||
|
||||
$sql = "SELECT lineparent.fk_mo as id_moparent FROM ".MAIN_DB_PREFIX."mrp_mo as mo";
|
||||
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production lineparent ON mo.fk_parent_line = lineparent.rowid";
|
||||
$sql.= " WHERE mo.rowid = ".((int) $this->id);
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
if ($resql) {
|
||||
if ($this->db->num_rows($resql) > 0) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$res = $MoParent->fetch($obj->id_moparent);
|
||||
if ($res < 0) $error++;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
return -1;
|
||||
} else {
|
||||
return $MoParent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1671,7 +1762,7 @@ class MoLine extends CommonObjectLine
|
||||
if ($resql) {
|
||||
$num = $this->db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < min($limit, $num)) {
|
||||
while ($i < ($limit ? min($limit, $num) : $num)) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$record = new self($this->db);
|
||||
|
||||
@ -31,6 +31,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/mrp/lib/mrp_mo.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
|
||||
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("mrp", "other"));
|
||||
@ -44,6 +46,7 @@ $cancel = GETPOST('cancel', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'mocard'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
$TBomLineId = GETPOST('bomlineid', 'array');
|
||||
//$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
// Initialize technical objects
|
||||
@ -128,9 +131,41 @@ if (empty($reshook)) {
|
||||
if ($cancel && !empty($backtopageforcancel)) {
|
||||
$backtopage = $backtopageforcancel;
|
||||
}
|
||||
|
||||
$triggermodname = 'MRP_MO_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
//Create MO with Childs
|
||||
if ($action == 'add' && empty($id) && !empty($TBomLineId)) {
|
||||
$noback = 0;
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
$mo_parent = $object;
|
||||
|
||||
$moline = new MoLine($db);
|
||||
$objectbomchildline = new BOMLine($db);
|
||||
|
||||
foreach ($TBomLineId as $id_bom_line) {
|
||||
$object = new Mo($db);
|
||||
|
||||
$objectbomchildline->fetch($id_bom_line);
|
||||
|
||||
$TMoLines = $moline->fetchAll('DESC', 'rowid', '1', '', array('origin_id' => $id_bom_line));
|
||||
|
||||
foreach ($TMoLines as $moline) {
|
||||
$_POST['fk_bom'] = $objectbomchildline->fk_bom_child;
|
||||
$_POST['fk_parent_line'] = $moline->id;
|
||||
$_POST['qty'] = $moline->qty;
|
||||
$_POST['fk_product'] = $moline->fk_product;
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
$res = $object->add_object_linked('mo', $mo_parent->id);
|
||||
}
|
||||
|
||||
header("Location: ".dol_buildpath('/mrp/mo_card.php?id='.$moline->fk_mo, 1));
|
||||
exit;
|
||||
}
|
||||
|
||||
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
@ -240,10 +275,12 @@ if ($action == 'create') {
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print mrpCollapseBomManagement();
|
||||
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
jQuery('#fk_bom').change(function() {
|
||||
jQuery('#fk_bom').change(function() {
|
||||
console.log('We change value of BOM with BOM of id '+jQuery('#fk_bom').val());
|
||||
if (jQuery('#fk_bom').val() > 0)
|
||||
{
|
||||
@ -486,6 +523,15 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
//Mo Parent
|
||||
$mo_parent = $object->getMoParent();
|
||||
if (is_object($mo_parent)) {
|
||||
print '<tr class="field_fk_mo_parent">';
|
||||
print '<td class="titlefield fieldname_fk_mo_parent">' . $langs->trans('ParentMo') . '</td>';
|
||||
print '<td class="valuefield fieldname_fk_mo_parent">' .$mo_parent->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Common attributes
|
||||
$keyforbreak = 'fk_warehouse';
|
||||
unset($object->fields['fk_project']);
|
||||
@ -602,7 +648,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
if ($object->status == $object::STATUS_VALIDATED) {
|
||||
if ($permissiontoadd) {
|
||||
// TODO Add test that production has not started
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes">'.$langs->trans("SetToDraft").'</a>';
|
||||
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&confirm=yes&token='.newToken().'">'.$langs->trans("SetToDraft").'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -641,16 +687,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$nbProduced += $lineproduced['qty'];
|
||||
}
|
||||
if ($nbProduced > 0) { // If production has started, we can close it
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_produced&confirm=yes">'.$langs->trans("Close").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_produced&confirm=yes&token='.newToken().'">'.$langs->trans("Close").'</a>'."\n";
|
||||
} else {
|
||||
print '<a class="butActionRefused" href="#" title="'.$langs->trans("GoOnTabProductionToProduceFirst", $langs->transnoentitiesnoconv("Production")).'">'.$langs->trans("Close").'</a>'."\n";
|
||||
}
|
||||
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_close&confirm=yes">'.$langs->trans("Cancel").'</a>'."\n";
|
||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_close&confirm=yes&token='.newToken().'">'.$langs->trans("Cancel").'</a>'."\n";
|
||||
}
|
||||
|
||||
if ($object->status == $object::STATUS_PRODUCED || $object->status == $object::STATUS_CANCELED) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_reopen&confirm=yes">'.$langs->trans("ReOpen").'</a>'."\n";
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_reopen&confirm=yes&token='.newToken().'">'.$langs->trans("ReOpen").'</a>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -685,7 +731,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
// Show links to link elements
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('mo'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, false, 'MOChild');
|
||||
|
||||
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
@ -118,6 +118,17 @@ foreach ($object->fields as $key => $val) {
|
||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
}
|
||||
|
||||
if ($key == 'fk_parent_line') {
|
||||
$visible = (int) dol_eval($val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
'label'=>$val['label'],
|
||||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
|
||||
'position'=>$val['position'],
|
||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
@ -219,6 +230,8 @@ $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_production lineparent ON t.fk_parent_line = lineparent.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."mrp_mo moparent ON lineparent.fk_mo = moparent.rowid";
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
@ -228,11 +241,16 @@ if ($object->ismultientitymanaged == 1) {
|
||||
} else {
|
||||
$sql .= " WHERE 1 = 1";
|
||||
}
|
||||
|
||||
foreach ($search as $key => $val) {
|
||||
if (array_key_exists($key, $object->fields)) {
|
||||
if ($key == 'status' && $search[$key] == -1) {
|
||||
continue;
|
||||
}
|
||||
if ($key == 'fk_parent_line') {
|
||||
$sql .= natural_search('moparent.ref', $search[$key], 0);
|
||||
continue;
|
||||
}
|
||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
|
||||
if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
|
||||
@ -439,6 +457,8 @@ foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif ($key == 'fk_parent_line') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
@ -448,6 +468,11 @@ foreach ($object->fields as $key => $val) {
|
||||
}
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
if ($key == 'fk_parent_line') {
|
||||
print '<input type="text" class="flat maxwidth75" name="search_fk_parent_line">';
|
||||
print '</td>';
|
||||
continue;
|
||||
}
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
|
||||
@ -487,6 +512,8 @@ foreach ($object->fields as $key => $val) {
|
||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||
if ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif ($key == 'fk_parent_line') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif (in_array($val['type'], array('timestamp'))) {
|
||||
@ -542,6 +569,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif ($key == 'status') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
} elseif ($key == 'fk_parent_line') {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'center';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('timestamp'))) {
|
||||
@ -558,6 +587,9 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'fk_parent_line') {
|
||||
$moparent = $object->getMoParent();
|
||||
if (is_object($moparent)) print $moparent->getNomUrl(1);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
} else {
|
||||
|
||||
@ -934,7 +934,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
if (!empty($arrayfields['origin']['checked'])) {
|
||||
// Origin of movement
|
||||
print '<td class="nowraponall">'.dol_escape_htmltag($origin).'</td>';
|
||||
print '<td class="nowraponall">'.$origin.'</td>';
|
||||
}
|
||||
if (!empty($arrayfields['m.fk_projet']['checked'])) {
|
||||
// fk_project
|
||||
|
||||
@ -31,21 +31,23 @@ global $noMoreLinkedObjectBlockAfter;
|
||||
|
||||
$langs = $GLOBALS['langs'];
|
||||
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
|
||||
$object = $GLOBALS['object'];
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->load("bom");
|
||||
|
||||
$linkedObjectBlock = dol_sort_array($linkedObjectBlock, 'date', 'desc', 0, 0, 1);
|
||||
|
||||
$total = 0;
|
||||
$ilink = 0;
|
||||
foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
|
||||
$mo_static = new Mo($db);
|
||||
$res = $mo_static->fetch($object->id);
|
||||
$TMoChilds = $mo_static->getMoChilds();
|
||||
|
||||
foreach ($TMoChilds as $key => $objectlink) {
|
||||
$ilink++;
|
||||
$product_static = new Product($db);
|
||||
|
||||
$trclass = 'oddeven';
|
||||
if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
|
||||
$trclass .= ' liste_sub_total';
|
||||
}
|
||||
|
||||
echo '<tr class="'.$trclass.'" >';
|
||||
echo '<td class="linkedcol-element" >'.$langs->trans("ManufacturingOrder");
|
||||
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
|
||||
@ -55,26 +57,14 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
echo '<td class="linkedcol-name nowraponall" >'.$objectlink->getNomUrl(1).'</td>';
|
||||
|
||||
echo '<td class="linkedcol-ref" align="center">';
|
||||
$result = $product_static->fetch($objectlink->fk_product);
|
||||
if ($result < 0) {
|
||||
setEventMessage($product_static->error, 'errors');
|
||||
} elseif ($result > 0) {
|
||||
$product_static->getNomUrl(1);
|
||||
}
|
||||
// $result = $product_static->fetch($objectlink->fk_product);
|
||||
print '</td>';
|
||||
echo '<td class="linkedcol-date" align="center">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
|
||||
echo '<td class="linkedcol-amount right">';
|
||||
if ($user->rights->commande->lire) {
|
||||
$total = $total + $objectlink->total_ht;
|
||||
echo price($objectlink->total_ht);
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<td class="linkedcol-amount right">-</td>';
|
||||
echo '<td class="linkedcol-statut right">'.$objectlink->getLibStatut(3).'</td>';
|
||||
echo '<td class="linkedcol-action right">';
|
||||
// For now, shipments must stay linked to order, so link is not deletable
|
||||
if ($object->element != 'shipping') {
|
||||
echo '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a>';
|
||||
}
|
||||
echo '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a>';
|
||||
echo '</td>';
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
@ -22,6 +22,8 @@ if (empty($conf) || !is_object($conf)) {
|
||||
exit;
|
||||
}
|
||||
|
||||
global $db;
|
||||
|
||||
if (!is_object($form)) {
|
||||
$form = new Form($db);
|
||||
}
|
||||
@ -32,12 +34,31 @@ $qtytoconsumeforline = $this->tpl['qty'] / ( ! empty($this->tpl['efficiency']) ?
|
||||
}*/
|
||||
$qtytoconsumeforline = price2num($qtytoconsumeforline, 'MS');
|
||||
|
||||
$tmpproduct = new Product($db);
|
||||
$tmpproduct->fetch($line->fk_product);
|
||||
$tmpbom = new BOM($db);
|
||||
$res = $tmpbom->fetch($line->fk_bom_child);
|
||||
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE originproductline.tpl.php -->
|
||||
<?php
|
||||
print '<tr class="oddeven'.(empty($this->tpl['strike']) ? '' : ' strikefordisabled').'">';
|
||||
print '<td>'.$this->tpl['label'].'</td>';
|
||||
print '<td>';
|
||||
if ($res) {
|
||||
print $tmpproduct->getNomUrl(1);
|
||||
if ($tmpbom->id) {
|
||||
print ' ' . $langs->trans("or") . ' ';
|
||||
print $tmpbom->getNomUrl(1);
|
||||
print ' <a class="collapse_bom" id="collapse-' . $line->id . '" href="#">';
|
||||
print (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT) ? img_picto('', 'folder') : img_picto('', 'folder-open'));
|
||||
}
|
||||
print '</a>';
|
||||
} else {
|
||||
print $this->tpl['label'];
|
||||
}
|
||||
print '</td>';
|
||||
//print '<td>'.$this->tpl['label'].'</td>';
|
||||
print '<td class="right">'.$this->tpl['qty'].(($this->tpl['efficiency'] > 0 && $this->tpl['efficiency'] < 1) ? ' / '.$form->textwithpicto($this->tpl['efficiency'], $langs->trans("ValueOfMeansLoss")).' = '.$qtytoconsumeforline : '').'</td>';
|
||||
print '<td class="center">'.(empty($this->tpl['stock']) ? 0 : price2num($this->tpl['stock'], 'MS'));
|
||||
if ($this->tpl['seuil_stock_alerte'] != '' && ($this->tpl['stock'] < $this->tpl['seuil_stock_alerte'])) {
|
||||
@ -60,6 +81,92 @@ if (!empty($selectedLines) && !in_array($this->tpl['id'], $selectedLines)) {
|
||||
print '<td class="center">';
|
||||
//print '<input id="cb'.$this->tpl['id'].'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$this->tpl['id'].'"'.($selected?' checked="checked"':'').'>';
|
||||
print '</td>';
|
||||
|
||||
if ($tmpbom->id) {
|
||||
print '<td class="center">';
|
||||
print '<input type="checkbox" name="bomlineid[]" value="' . $line->id . '">';
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center"> </td>';
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
|
||||
// Select of all the sub-BOM lines
|
||||
$sql = 'SELECT rowid, fk_bom_child, fk_product, qty FROM '.MAIN_DB_PREFIX.'bom_bomline AS bl';
|
||||
$sql.= ' WHERE fk_bom ='. (int) $tmpbom->id;
|
||||
$resql = $db->query($sql);
|
||||
|
||||
if ($resql) {
|
||||
// Loop on all the sub-BOM lines if they exist
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$sub_bom_product = new Product($db);
|
||||
$sub_bom_product->fetch($obj->fk_product);
|
||||
$sub_bom_product->load_stock();
|
||||
|
||||
$sub_bom = new BOM($db);
|
||||
$sub_bom->fetch($obj->fk_bom_child);
|
||||
|
||||
$sub_bom_line = new BOMLine($db);
|
||||
$sub_bom_line->fetch($obj->rowid);
|
||||
|
||||
//If hidden conf is set, we show directly all the sub-BOM lines
|
||||
if (empty($conf->global->BOM_SHOW_ALL_BOM_BY_DEFAULT)) {
|
||||
print '<tr style="display:none" class="sub_bom_lines" parentid="'.$line->id.'">';
|
||||
} else {
|
||||
print '<tr class="sub_bom_lines" parentid="'.$line->id.'">';
|
||||
}
|
||||
|
||||
// Product OR BOM
|
||||
print '<td style="padding-left: 5%" id="sub_bom_product_'.$sub_bom_line->id.'">';
|
||||
if (!empty($obj->fk_bom_child)) {
|
||||
print $sub_bom_product->getNomUrl(1);
|
||||
print ' '.$langs->trans('or').' ';
|
||||
print $sub_bom->getNomUrl(1);
|
||||
} else {
|
||||
print $sub_bom_product->getNomUrl(1);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
// Qty
|
||||
if ($sub_bom_line->qty_frozen > 0) {
|
||||
print '<td class="linecolqty nowrap right" id="sub_bom_qty_'.$sub_bom_line->id.'">'.price($sub_bom_line->qty, 0, '', 0, 0).'</td>';
|
||||
} else {
|
||||
print '<td class="linecolqty nowrap right" id="sub_bom_qty_'.$sub_bom_line->id.'">'.price($sub_bom_line->qty * $line->qty, 0, '', 0, 0).'</td>';
|
||||
}
|
||||
|
||||
// Stock réel
|
||||
if ($sub_bom_product->stock_reel > 0) {
|
||||
print '<td class="linecolstockreel nowrap center" id="sub_bom_stock_reel_'.$sub_bom_product->stock_reel.'">'.$sub_bom_product->stock_reel.'</td>';
|
||||
} else {
|
||||
print '<td class="linecolstockreel nowrap center" id="sub_bom_stock_reel_'.$sub_bom_product->stock_reel.'"> </td>';
|
||||
}
|
||||
|
||||
// Stock virtuel
|
||||
if ($sub_bom_product->stock_theorique > 0) {
|
||||
print '<td class="linecolstocktheorique nowrap center" id="sub_bom_stock_theorique_'.$sub_bom_product->stock_theorique.'">'.$sub_bom_product->stock_theorique.'</td>';
|
||||
} else {
|
||||
print '<td class="linecolstocktheorique nowrap center" id="sub_bom_stock_theorique_'.$sub_bom_product->stock_theorique.'"> </td>';
|
||||
}
|
||||
|
||||
// Frozen qty
|
||||
if ($sub_bom_line->qty_frozen > 0) {
|
||||
print '<td class="linecolqtyfrozen nowrap right" id="sub_bom_qty_frozen_'.$sub_bom_line->qty_frozen.'">'.$langs->trans('Yes').'</td>';
|
||||
} else {
|
||||
print '<td class="linecolqtyfrozen nowrap right" id="sub_bom_qty_frozen_'.$sub_bom_line->qty_frozen.'"> </td>';
|
||||
}
|
||||
|
||||
// Disable stock change
|
||||
if ($sub_bom_line->disable_stock_change > 0) {
|
||||
print '<td class="linecoldisablestockchange nowrap right" id="sub_bom_stock_change_'.$sub_bom_line->id.'">'.yn($sub_bom_line->disable_stock_change).'</td>';
|
||||
} else {
|
||||
print '<td class="linecoldisablestockchange nowrap right" id="sub_bom_stock_change_'.$sub_bom_line->id.'"> </td>';
|
||||
}
|
||||
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!-- END PHP TEMPLATE originproductline.tpl.php -->
|
||||
|
||||
@ -260,7 +260,7 @@ llxHeader('', $title, $help_url);
|
||||
|
||||
// Part to create
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Partnership")), '', 'object_'.$object->picto);
|
||||
print load_fiche_titre($langs->trans("NewPartnership"), '', 'object_'.$object->picto);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
@ -186,25 +186,16 @@ if ($id > 0 || $ref) {
|
||||
$objcon = new stdClass();
|
||||
|
||||
$out = '';
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
if ((!empty($objproduct->id) || !empty($objcon->id)) && $permok) {
|
||||
//$out.='<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
if (get_class($objproduct) == 'Product') {
|
||||
$out .= '&prodid='.$objproduct->id.'&origin=product&originid='.$id;
|
||||
}
|
||||
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id.'&percentage=-1';
|
||||
//$out.=$langs->trans("AddAnAction").' ';
|
||||
//$out.=img_picto($langs->trans("AddAnAction"),'filenew');
|
||||
//$out.="</a>";
|
||||
}
|
||||
|
||||
|
||||
//print '<div class="tabsAction">';
|
||||
//print '</div>';
|
||||
|
||||
|
||||
$morehtmlcenter = '';
|
||||
if (!empty($conf->agenda->enabled)) {
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
if ((!empty($objproduct->id) || !empty($objcon->id)) && $permok) {
|
||||
if (get_class($objproduct) == 'Product') {
|
||||
$out .= '&prodid='.$objproduct->id.'&origin=product&originid='.$id;
|
||||
}
|
||||
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id.'&percentage=-1';
|
||||
}
|
||||
|
||||
$linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus);
|
||||
}
|
||||
|
||||
@ -781,9 +781,9 @@ class Products extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
$ref_fourn = checkVal($ref_fourn, 'alphanohtml');
|
||||
$desc_fourn = checkVal($desc_fourn, 'restricthtml');
|
||||
$barcode = checkVal($barcode, 'alphanohtml');
|
||||
$ref_fourn = sanitizeVal($ref_fourn, 'alphanohtml');
|
||||
$desc_fourn = sanitizeVal($desc_fourn, 'restricthtml');
|
||||
$barcode = sanitizeVal($barcode, 'alphanohtml');
|
||||
|
||||
$result = $this->productsupplier->update_buyprice($qty, $buyprice, DolibarrApiAccess::$user, $price_base_type, $fourn, $availability, $ref_fourn, $tva_tx, $charges, $remise_percent, $remise, $newnpr, $delivery_time_days, $supplier_reputation, $localtaxes_array, $newdefaultvatcode, $multicurrency_buyprice, $multicurrency_price_base_type, $multicurrency_tx, $multicurrency_code, $desc_fourn, $barcode, $fk_barcode_type);
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
* Copyright (C) 2016 Francis Appels <francis.appels@yahoo.com>
|
||||
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -679,6 +680,8 @@ if ($action == 'create') {
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
$sameunits = true;
|
||||
|
||||
while ($i < $num) {
|
||||
$objp = $db->fetch_object($resql);
|
||||
|
||||
@ -960,7 +963,7 @@ if ($action != 'create' && $action != 'edit' && $action != 'delete') {
|
||||
$delallowed = $usercancreate;
|
||||
$modulepart = 'stock';
|
||||
|
||||
print $formfile->showdocuments($modulepart, $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', $object->default_lang, '', $object);
|
||||
print $formfile->showdocuments($modulepart, $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 0, 0, 0, 28, 0, '', 0, '', '', '', $object);
|
||||
$somethingshown = $formfile->numoffiles;
|
||||
|
||||
print '</div><div class="fichehalfright">';
|
||||
|
||||
@ -28,6 +28,7 @@ require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/productlot.class.php';
|
||||
@ -90,7 +91,13 @@ if ($id || $ref) {
|
||||
$batch = $tmp[1];
|
||||
}
|
||||
$object->fetch($id, $productid, $batch);
|
||||
$object->ref = $object->batch; // For document management ( it use $object->ref)
|
||||
$object->ref = $object->batch; // Old system for document management ( it uses $object->ref)
|
||||
$upload_dir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart);
|
||||
$filearray = dol_dir_list($upload_dir, "files");
|
||||
if (empty($filearray)) {
|
||||
// If no files linked yet, use new system on lot id. (Batch is not unique and can be same on different product)
|
||||
$object->fetch($id, $productid, $batch);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
|
||||
|
||||
@ -83,10 +83,16 @@ if ($id || $ref) {
|
||||
$batch = $tmp[1];
|
||||
}
|
||||
$object->fetch($id, $productid, $batch);
|
||||
$object->ref = $object->batch; // For document management ( it use $object->ref)
|
||||
$object->ref = $object->batch; // Old system for document management ( it uses $object->ref)
|
||||
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
$upload_dir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart);
|
||||
$filearray = dol_dir_list($upload_dir, "files");
|
||||
if (empty($filearray)) {
|
||||
// If no files linked yet, use new system on lot id. (Batch is not unique and can be same on different product)
|
||||
$object->fetch($id, $productid, $batch);
|
||||
$upload_dir = $conf->productbatch->multidir_output[$object->entity].'/'.get_exdir(0, 0, 0, 1, $object, $modulepart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1092,7 +1092,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
print img_picto($langs->trans('SharedProject'), 'world', 'class="paddingrightonly"');
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print img_picto($langs->trans('SharedProject'), 'private', 'class="paddingrightonly"');
|
||||
print img_picto($langs->trans('PrivateProject'), 'private', 'class="paddingrightonly"');
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -1207,7 +1207,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
||||
{
|
||||
var element = jQuery("#opp_status option:selected");
|
||||
var defaultpercent = element.attr("defaultpercent");
|
||||
var defaultcloseproject = '.$defaultcheckedwhenoppclose.';
|
||||
var defaultcloseproject = '.((int) $defaultcheckedwhenoppclose).';
|
||||
var elemcode = element.attr("elemcode");
|
||||
var oldpercent = \''.dol_escape_js($object->opp_percent).'\';
|
||||
|
||||
|
||||
@ -333,7 +333,7 @@ class Projects extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
|
||||
$updateRes = $this->project->addline(
|
||||
$request_data->desc,
|
||||
@ -400,7 +400,7 @@ class Projects extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
|
||||
$updateRes = $this->project->updateline(
|
||||
$lineid,
|
||||
|
||||
@ -333,7 +333,7 @@ class Tasks extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
|
||||
$updateRes = $this->project->addline(
|
||||
$request_data->desc,
|
||||
@ -400,7 +400,7 @@ class Tasks extends DolibarrApi
|
||||
|
||||
$request_data = (object) $request_data;
|
||||
|
||||
$request_data->desc = checkVal($request_data->desc, 'restricthtml');
|
||||
$request_data->desc = sanitizeVal($request_data->desc, 'restricthtml');
|
||||
|
||||
$updateRes = $this->project->updateline(
|
||||
$lineid,
|
||||
|
||||
@ -1669,7 +1669,8 @@ if ($action == 'create') {
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<table id="tablelines" class="noborder centpercent">';
|
||||
print '<thead>';
|
||||
print '<tr class="liste_titre">';
|
||||
// #
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
@ -1734,6 +1735,7 @@ if ($action == 'create') {
|
||||
print '<td class="linecoldelete" width="10"></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
print '</thead>';
|
||||
|
||||
$var = false;
|
||||
|
||||
@ -1799,9 +1801,10 @@ if ($action == 'create') {
|
||||
$arrayofpurchaselinealreadyoutput = array();
|
||||
|
||||
// Loop on each product to send/sent. Warning: $lines must be sorted by ->fk_commandefourndet (it is a regroupment key on output)
|
||||
print '<tbody>';
|
||||
for ($i = 0; $i < $num_prod; $i++) {
|
||||
print '<!-- origin line id = '.(!empty($lines[$i]->origin_line_id) ? $lines[$i]->origin_line_id : 0).' -->'; // id of order line
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven" id="row-'.$lines[$i]->id.'" data-id="'.$lines[$i]->id.'" data-element="'.$lines[$i]->element.'">';
|
||||
|
||||
// #
|
||||
if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) {
|
||||
@ -1819,7 +1822,7 @@ if ($action == 'create') {
|
||||
$label = (!empty($lines[$i]->product->label) ? $lines[$i]->product->label : $lines[$i]->product->product_label);
|
||||
}
|
||||
|
||||
print '<td>';
|
||||
print '<td class="linecoldescription">';
|
||||
if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) {
|
||||
$text = $lines[$i]->product->getNomUrl(1);
|
||||
$text .= ' - '.$label;
|
||||
@ -1832,7 +1835,7 @@ if ($action == 'create') {
|
||||
}
|
||||
print "</td>\n";
|
||||
} else {
|
||||
print "<td>";
|
||||
print '<td class="linecoldescription">';
|
||||
if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) {
|
||||
if ($lines[$i]->product_type == Product::TYPE_SERVICE) {
|
||||
$text = img_object($langs->trans('Service'), 'service');
|
||||
@ -1860,7 +1863,7 @@ if ($action == 'create') {
|
||||
|
||||
|
||||
// Qty ordered
|
||||
print '<td class="center">';
|
||||
print '<td class="center linecolqty">';
|
||||
if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) {
|
||||
print $lines[$i]->qty_asked;
|
||||
}
|
||||
@ -1868,7 +1871,7 @@ if ($action == 'create') {
|
||||
|
||||
// Qty in other receptions (with reception and warehouse used)
|
||||
if ($origin && $origin_id > 0) {
|
||||
print '<td class="center nowrap">';
|
||||
print '<td class="center nowrap linecolqtyinotherreceptions">';
|
||||
if (!array_key_exists($lines[$i]->fk_commandefourndet, $arrayofpurchaselinealreadyoutput)) {
|
||||
foreach ($alreadysent as $key => $val) {
|
||||
if ($lines[$i]->fk_commandefourndet == $key) {
|
||||
@ -1939,7 +1942,7 @@ if ($action == 'create') {
|
||||
print '</table></td>';
|
||||
} else {
|
||||
// Qty to receive or received
|
||||
print '<td class="center">'.$lines[$i]->qty.'</td>';
|
||||
print '<td class="center linecolqtytoreceive">'.$lines[$i]->qty.'</td>';
|
||||
|
||||
// Warehouse source
|
||||
if (!empty($conf->stock->enabled)) {
|
||||
@ -1959,7 +1962,7 @@ if ($action == 'create') {
|
||||
if (!empty($conf->productbatch->enabled)) {
|
||||
if (isset($lines[$i]->batch)) {
|
||||
print '<!-- Detail of lot -->';
|
||||
print '<td>';
|
||||
print '<td class="linecolbatch">';
|
||||
$detail = '';
|
||||
if ($lines[$i]->product->status_batch) {
|
||||
$detail .= $langs->trans("Batch").': '.$lines[$i]->batch;
|
||||
@ -1983,7 +1986,7 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Weight
|
||||
print '<td class="center">';
|
||||
print '<td class="center linecolweight">';
|
||||
if (!empty($lines[$i]->fk_product_type) && $lines[$i]->fk_product_type == Product::TYPE_PRODUCT) {
|
||||
print $lines[$i]->product->weight * $lines[$i]->qty.' '.measuringUnitString(0, "weight", $lines[$i]->product->weight_units);
|
||||
} else {
|
||||
@ -1992,7 +1995,7 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
|
||||
// Volume
|
||||
print '<td class="center">';
|
||||
print '<td class="center linecolvolume">';
|
||||
if (!empty($lines[$i]->fk_product_type) && $lines[$i]->fk_product_type == Product::TYPE_PRODUCT) {
|
||||
print $lines[$i]->product->volume * $lines[$i]->qty.' '.measuringUnitString(0, "volume", $lines[$i]->product->volume_units);
|
||||
} else {
|
||||
@ -2040,6 +2043,7 @@ if ($action == 'create') {
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</tbody>';
|
||||
|
||||
// TODO Show also lines ordered but not delivered
|
||||
|
||||
|
||||
@ -364,7 +364,7 @@ class Recruitment extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
// $this->jobposition->abc = checkVal($this->jobposition->abc, 'alphanohtml');
|
||||
// $this->jobposition->abc = sanitizeVal($this->jobposition->abc, 'alphanohtml');
|
||||
|
||||
if ($this->jobposition->create(DolibarrApiAccess::$user)<0) {
|
||||
throw new RestException(500, "Error creating jobposition", array_merge(array($this->jobposition->error), $this->jobposition->errors));
|
||||
@ -396,7 +396,7 @@ class Recruitment extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
// $this->jobposition->abc = checkVal($this->jobposition->abc, 'alphanohtml');
|
||||
// $this->jobposition->abc = sanitizeVal($this->jobposition->abc, 'alphanohtml');
|
||||
|
||||
if ($this->candidature->create(DolibarrApiAccess::$user)<0) {
|
||||
throw new RestException(500, "Error creating candidature", array_merge(array($this->candidature->error), $this->candidature->errors));
|
||||
@ -438,7 +438,7 @@ class Recruitment extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
// $this->jobposition->abc = checkVal($this->jobposition->abc, 'alphanohtml');
|
||||
// $this->jobposition->abc = sanitizeVal($this->jobposition->abc, 'alphanohtml');
|
||||
|
||||
if ($this->jobposition->update(DolibarrApiAccess::$user, false) > 0) {
|
||||
return $this->get($id);
|
||||
@ -481,7 +481,7 @@ class Recruitment extends DolibarrApi
|
||||
}
|
||||
|
||||
// Clean data
|
||||
// $this->jobposition->abc = checkVal($this->jobposition->abc, 'alphanohtml');
|
||||
// $this->jobposition->abc = sanitizeVal($this->jobposition->abc, 'alphanohtml');
|
||||
|
||||
if ($this->candidature->update(DolibarrApiAccess::$user, false) > 0) {
|
||||
return $this->get($id);
|
||||
|
||||
@ -51,7 +51,7 @@ abstract class ModelePDFRecruitmentCandidature extends CommonDocGenerator
|
||||
// phpcs:enable
|
||||
global $conf;
|
||||
|
||||
$type = 'recruitmentjobposition';
|
||||
$type = 'recruitmentjobcandidature';
|
||||
$list = array();
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||
|
||||
@ -147,7 +147,7 @@ if ($socid > 0) {
|
||||
$objcon = new stdClass();
|
||||
|
||||
$out = '';
|
||||
$permok = $user->rights->agenda->myactions->create;
|
||||
$permok = $user->hasRight('agenda', 'myactions', 'create');
|
||||
if ((!empty($objthirdparty->id) || !empty($objcon->id)) && $permok) {
|
||||
if (is_object($objthirdparty) && get_class($objthirdparty) == 'Societe') {
|
||||
$out .= '&originid='.$objthirdparty->id.($objthirdparty->id > 0 ? '&socid='.$objthirdparty->id : '').'&backtopage='.urlencode($_SERVER['PHP_SELF'].($objthirdparty->id > 0 ? '?socid='.$objthirdparty->id : ''));
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 NextGestion <contact@nextgestion.com>
|
||||
* Copyright (C) 2022 Charlene Benke <charlent@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -180,25 +181,25 @@ if ($id > 0) {
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
if (!empty($conf->global->SOCIETE_USEPREFIX)) { // Old not used prefix field
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$societe->prefix_comm.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
|
||||
}
|
||||
|
||||
if ($societe->client) {
|
||||
if ($object->client) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('CustomerCode').'</td><td colspan="3">';
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($societe->code_client));
|
||||
$tmpcheck = $societe->check_codeclient();
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
|
||||
$tmpcheck = $object->check_codeclient();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <span class="error">('.$langs->trans("WrongCustomerCode").')</span>';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
if ($societe->fournisseur) {
|
||||
if ($object->fournisseur) {
|
||||
print '<tr><td class="titlefield">';
|
||||
print $langs->trans('SupplierCode').'</td><td colspan="3">';
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($societe->code_fournisseur));
|
||||
$tmpcheck = $societe->check_codefournisseur();
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
|
||||
$tmpcheck = $object->check_codefournisseur();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <span class="error">('.$langs->trans("WrongSupplierCode").')</span>';
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ if ($action == 'getProducts') {
|
||||
'rowid' => $thirdparty->id,
|
||||
'name' => $thirdparty->name,
|
||||
'barcode' => $thirdparty->barcode,
|
||||
'object' => 'thirdparty'
|
||||
'object' => 'thirdparty'
|
||||
);
|
||||
echo json_encode($rows);
|
||||
exit;
|
||||
@ -267,6 +267,7 @@ if ($action == 'getProducts') {
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
$rows = array();
|
||||
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$objProd = new Product($db);
|
||||
$objProd->fetch($obj->rowid);
|
||||
@ -303,17 +304,23 @@ if ($action == 'getProducts') {
|
||||
$parameters=array();
|
||||
$parameters['row'] = $row;
|
||||
$parameters['obj'] = $obj;
|
||||
|
||||
$reshook = $hookmanager->executeHooks('completeAjaxReturnArray', $parameters);
|
||||
if ($reshook > 0) {
|
||||
// replace
|
||||
$row = $hookmanager->resArray;
|
||||
if (count($hookmanager->resArray)) {
|
||||
$row = $hookmanager->resArray;
|
||||
} else {
|
||||
$row = array();
|
||||
}
|
||||
} else {
|
||||
// add
|
||||
$rows[] = $hookmanager->resArray;
|
||||
if (count($hookmanager->resArray)) {
|
||||
$rows[] = $hookmanager->resArray;
|
||||
}
|
||||
$rows[] = $row;
|
||||
}
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
echo json_encode($rows);
|
||||
} else {
|
||||
echo 'Failed to search product : '.$db->lasterror();
|
||||
|
||||
@ -436,8 +436,9 @@ tr.selected, tr.selected td {
|
||||
/* font-weight: bold; */
|
||||
background-color: rgb(240,230,210) !important;
|
||||
}
|
||||
.order {
|
||||
color: limegreen;
|
||||
.order td {
|
||||
color: green;
|
||||
/* background-color: #f5f5f5; */
|
||||
}
|
||||
|
||||
.colorwhite {
|
||||
|
||||
@ -128,22 +128,20 @@ top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
|
||||
<link rel="stylesheet" href="css/pos.css.php?a=xxx">
|
||||
<style type="text/css">
|
||||
div.tablediv{
|
||||
background-image:url(img/table.gif);
|
||||
-moz-background-size:100% 100%;
|
||||
-webkit-background-size:100% 100%;
|
||||
background-size:100% 100%;
|
||||
height:10%;
|
||||
width:10%;
|
||||
text-align: center;
|
||||
font-size:300%;
|
||||
color:white;
|
||||
background-image:url(img/table.gif);
|
||||
-moz-background-size:100% 100%;
|
||||
-webkit-background-size:100% 100%;
|
||||
background-size:100% 100%;
|
||||
height:10%;
|
||||
width:10%;
|
||||
text-align: center;
|
||||
font-size:300%;
|
||||
color:white;
|
||||
}
|
||||
|
||||
/* Color when a table has a pending order/invoice */
|
||||
div.red{
|
||||
color:red;
|
||||
}
|
||||
html, body
|
||||
{
|
||||
height: 100%;
|
||||
color:red;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@ -804,7 +804,7 @@ if (empty($reshook)) {
|
||||
$printer->orderprinter = 1;
|
||||
echo "<script>";
|
||||
echo "var orderprinter1esc='";
|
||||
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_ORDER_PRINTER1_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 1
|
||||
$ret = $printer->sendToPrinter($invoice, getDolGlobalInt('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]), getDolGlobalInt('TAKEPOS_ORDER_PRINTER1_TO_USE'.$_SESSION["takeposterminal"])); // PRINT TO PRINTER 1
|
||||
echo "';</script>";
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='1' and fk_facture=".$invoice->id; // Set as printed
|
||||
@ -836,7 +836,7 @@ if (empty($reshook)) {
|
||||
$printer->orderprinter = 2;
|
||||
echo "<script>";
|
||||
echo "var orderprinter2esc='";
|
||||
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_ORDER_PRINTER2_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 2
|
||||
$ret = $printer->sendToPrinter($invoice, getDolGlobalInt('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]), getDolGlobalInt('TAKEPOS_ORDER_PRINTER2_TO_USE'.$_SESSION["takeposterminal"])); // PRINT TO PRINTER 2
|
||||
echo "';</script>";
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='2' and fk_facture=".$invoice->id; // Set as printed
|
||||
@ -868,7 +868,7 @@ if (empty($reshook)) {
|
||||
$printer->orderprinter = 3;
|
||||
echo "<script>";
|
||||
echo "var orderprinter3esc='";
|
||||
$ret = $printer->sendToPrinter($invoice, $conf->global->{'TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]}, $conf->global->{'TAKEPOS_ORDER_PRINTER3_TO_USE'.$_SESSION["takeposterminal"]}); // PRINT TO PRINTER 3
|
||||
$ret = $printer->sendToPrinter($invoice, getDolGlobalInt('TAKEPOS_TEMPLATE_TO_USE_FOR_ORDERS'.$_SESSION["takeposterminal"]), getDolGlobalInt('TAKEPOS_ORDER_PRINTER3_TO_USE'.$_SESSION["takeposterminal"])); // PRINT TO PRINTER 3
|
||||
echo "';</script>";
|
||||
}
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet set special_code='4' where special_code='3' and fk_facture=".$invoice->id; // Set as printed
|
||||
@ -1444,7 +1444,11 @@ if ($placeid > 0) {
|
||||
if ($line->special_code == "4") {
|
||||
$htmlsupplements[$line->fk_parent_line] .= ' order';
|
||||
}
|
||||
$htmlsupplements[$line->fk_parent_line] .= '" id="'.$line->id.'">';
|
||||
$htmlsupplements[$line->fk_parent_line] .= '" id="'.$line->id.'"';
|
||||
if ($line->special_code == "4") {
|
||||
$htmlsupplements[$line->fk_parent_line] .= ' title="'.dol_escape_htmltag("AlreadyPrinted").'"';
|
||||
}
|
||||
$htmlsupplements[$line->fk_parent_line] .= '>';
|
||||
$htmlsupplements[$line->fk_parent_line] .= '<td class="left">';
|
||||
$htmlsupplements[$line->fk_parent_line] .= img_picto('', 'rightarrow');
|
||||
if ($line->product_label) {
|
||||
@ -1483,7 +1487,11 @@ if ($placeid > 0) {
|
||||
if ($line->special_code == "4") {
|
||||
$htmlforlines .= ' order';
|
||||
}
|
||||
$htmlforlines .= '" id="'.$line->id.'">';
|
||||
$htmlforlines .= '" id="'.$line->id.'"';
|
||||
if ($line->special_code == "4") {
|
||||
$htmlforlines .= ' title="'.dol_escape_htmltag("AlreadyPrinted").'"';
|
||||
}
|
||||
$htmlforlines .= '>';
|
||||
$htmlforlines .= '<td class="left">';
|
||||
if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) {
|
||||
$htmlforlines .= '<span class="phoneqty">'.$line->qty."</span> x ";
|
||||
|
||||
@ -396,7 +396,7 @@ a.dropdown-item {
|
||||
content: "\f35d";
|
||||
}
|
||||
|
||||
.dropdown-item.active, .dropdown-item:hover, .dropdown-item:focus {
|
||||
.dropdown-item.active, .dropdown-item:hover, .dropdown-item:hover span::before, .dropdown-item:focus {
|
||||
color: #<?php echo $colortextbackhmenu; ?> !important;
|
||||
text-decoration: none;
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
|
||||
@ -10,7 +10,7 @@ if (!defined('ISLOADEDBYSTEELSHEET')) {
|
||||
*/
|
||||
|
||||
.info-box-module.--external span.info-box-icon-version {
|
||||
background: #bbb;
|
||||
background: rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.info-box-module.--external.--need-update span.info-box-icon-version{
|
||||
|
||||
@ -400,7 +400,7 @@ a.dropdown-item {
|
||||
content: "\f35d";
|
||||
}
|
||||
|
||||
.dropdown-item.active, .dropdown-item:hover, .dropdown-item:focus {
|
||||
.dropdown-item.active, .dropdown-item:hover, .dropdown-item:hover::before, .dropdown-item:hover span::before, .dropdown-item:focus {
|
||||
color: #<?php echo $colortextbackhmenu; ?> !important;
|
||||
text-decoration: none;
|
||||
background: rgb(<?php echo $colorbackhmenu1 ?>);
|
||||
|
||||
@ -559,4 +559,72 @@ class FilesLibTest extends PHPUnit\Framework\TestCase
|
||||
$user->rights->facture->lire = $savpermlire;
|
||||
$user->rights->facture->creer = $savpermcreer;
|
||||
}
|
||||
|
||||
/**
|
||||
* testDolDirMove
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testDolDirMove()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
$conf=$this->savconf;
|
||||
$user=$this->savuser;
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
// To test a move of empty directory that should work
|
||||
$dirsrcpath = $conf->admin->dir_temp.'/directory';
|
||||
$dirdestpath = $conf->admin->dir_temp.'/directory2';
|
||||
$file=dirname(__FILE__).'/Example_import_company_1.csv';
|
||||
dol_mkdir($dirsrcpath);
|
||||
dol_delete_dir_recursive($dirdestpath, 0, 1);
|
||||
$result=dol_move_dir($dirsrcpath, $dirdestpath, 1, 1, 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result, 'move of directory with empty directory');
|
||||
|
||||
// To test a move on existing directory with overwrite
|
||||
dol_mkdir($dirsrcpath);
|
||||
$result=dol_move_dir($dirsrcpath, $dirdestpath, 1, 1, 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result, 'move of directory on existing directory with empty directory');
|
||||
|
||||
// To test a move on existing directory without overwrite
|
||||
dol_mkdir($dirsrcpath);
|
||||
$result=dol_move_dir($dirsrcpath, $dirdestpath, 0, 1, 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertFalse($result, 'move of directory on existing directory without overwrite');
|
||||
|
||||
// To test a move with a file to rename in src directory
|
||||
dol_mkdir($dirsrcpath);
|
||||
dol_delete_dir_recursive($dirdestpath, 0, 1);
|
||||
dol_copy($file, $dirsrcpath.'/directory_file.csv');
|
||||
$result=dol_move_dir($dirsrcpath, $dirdestpath, 1, 1, 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result, 'move of directory with file in directory');
|
||||
|
||||
// To test a move without a file to rename in src directory
|
||||
dol_mkdir($dirsrcpath);
|
||||
dol_delete_dir_recursive($dirdestpath, 0, 1);
|
||||
dol_copy($file, $dirsrcpath.'/file.csv');
|
||||
$result=dol_move_dir($dirsrcpath, $dirdestpath, 1, 1, 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result, 'move of directory with file whitout rename needed in directory');
|
||||
|
||||
// To test a move with a directory to rename in src directory
|
||||
dol_mkdir($dirsrcpath);
|
||||
dol_delete_dir_recursive($dirdestpath, 0, 1);
|
||||
dol_mkdir($dirsrcpath.'/directory');
|
||||
$result=dol_move_dir($dirsrcpath, $dirdestpath, 1, 1, 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result, 'move of directory with file with rename needed in directory');
|
||||
|
||||
// To test a move without a directory to rename in src directory
|
||||
dol_mkdir($dirsrcpath);
|
||||
dol_delete_dir_recursive($dirdestpath, 0, 1);
|
||||
dol_mkdir($dirsrcpath.'/notorename');
|
||||
$result=dol_move_dir($dirsrcpath, $dirdestpath, 1, 1, 1);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertTrue($result, 'move of directory with directory whitout rename needed in directory');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user