Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
3dc43279f5
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "admin", "accountancy", "salaries"));
|
||||
$langs->loadLangs(array('accountancy', 'admin', 'bills', 'compta', 'salaries'));
|
||||
|
||||
$mesg = '';
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
@ -44,7 +44,7 @@ if (isModEnabled('accounting')) {
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("errors", "admin", "companies", "resource", "holiday", "compta", "accountancy", "hrm"));
|
||||
$langs->loadLangs(array('accountancy', 'admin', 'companies', 'compta', 'errors', 'holiday', 'hrm', 'resource'));
|
||||
|
||||
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view';
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
|
||||
@ -186,12 +186,12 @@ print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print getTitleFieldOfList('Name', 0, $_SERVER['PHP_SELF'], 'name', '', $param, '', $sortfield, $sortorder, '')."\n";
|
||||
print getTitleFieldOfList('Name', 0, $_SERVER['PHP_SELF'], 'name', '', $param, '', $sortfield, $sortorder, '') . "\n";
|
||||
print getTitleFieldOfList("Value", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||
print getTitleFieldOfList("Comment", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||
print getTitleFieldOfList('DateModificationShort', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
|
||||
if (!empty($conf->multicompany->enabled) && !$user->entity) {
|
||||
print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ')."\n";
|
||||
print getTitleFieldOfList('DateModificationShort', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ') . "\n";
|
||||
if (isModEnabled('multicompany') && !$user->entity) {
|
||||
print getTitleFieldOfList('Entity', 0, $_SERVER['PHP_SELF'], 'tms', '', $param, '', $sortfield, $sortorder, 'center ') . "\n";
|
||||
}
|
||||
print getTitleFieldOfList("", 0, $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||
print "</tr>\n";
|
||||
@ -212,14 +212,14 @@ print '</td>';
|
||||
print '<td>';
|
||||
print '</td>';
|
||||
// Limit to superadmin
|
||||
if (!empty($conf->multicompany->enabled) && !$user->entity) {
|
||||
if (isModEnabled('multicompany') && !$user->entity) {
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">';
|
||||
print '<input type="text" class="flat" size="1" name="entity" value="' . $conf->entity . '">';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
} else {
|
||||
print '<td class="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
print '<input type="hidden" name="entity" value="' . $conf->entity . '">';
|
||||
}
|
||||
print '<input type="submit" class="button button-add small" name="add" value="'.$langs->trans("Add").'">';
|
||||
print "</td>\n";
|
||||
@ -281,7 +281,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Entity limit to superadmin
|
||||
if (!empty($conf->multicompany->enabled) && !$user->entity) {
|
||||
if (isModEnabled('multicompany') && !$user->entity) {
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="1" name="const['.$i.'][entity]" value="'.((int) $obj->entity).'">';
|
||||
print '</td>';
|
||||
|
||||
@ -185,13 +185,13 @@ $message .= ajax_autoselect('webdavpublicurl');
|
||||
|
||||
$message .= '<br>';
|
||||
if (!empty($conf->global->DAV_ALLOW_PUBLIC_DIR)) {
|
||||
$urlEntity = (!empty($conf->multicompany->enabled) ? '?entity='.$conf->entity : '');
|
||||
$url = '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank" rel="noopener noreferrer">'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'</a>';
|
||||
$urlEntity = (isModEnabled('multicompany') ? '?entity=' . $conf->entity : '');
|
||||
$url = '<a href="' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '" target="_blank" rel="noopener noreferrer">' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '</a>';
|
||||
|
||||
$message .= img_picto('', 'globe').' '.str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', ''));
|
||||
$message .= '<div class="urllink"><input type="text" id="webdavurl" class="quatrevingtpercent" value="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'">';
|
||||
$message .= '<a href="'.$urlwithroot.'/dav/fileserver.php/public/'.$urlEntity.'" target="_blank" rel="noopener noreferrer">';
|
||||
$message .= ' '.img_picto('', 'globe');
|
||||
$message .= img_picto('', 'globe') . ' ' . str_replace('{url}', $url, $langs->trans("WebDavServer", 'WebDAV public', ''));
|
||||
$message .= '<div class="urllink"><input type="text" id="webdavurl" class="quatrevingtpercent" value="' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '">';
|
||||
$message .= '<a href="' . $urlwithroot . '/dav/fileserver.php/public/' . $urlEntity . '" target="_blank" rel="noopener noreferrer">';
|
||||
$message .= ' ' . img_picto('', 'globe');
|
||||
$message .= '</a>';
|
||||
$message .= '</div>';
|
||||
$message .= ajax_autoselect('webdavurl');
|
||||
|
||||
@ -306,7 +306,7 @@ if ($mode != 'focus' && $mode != 'mandatory') {
|
||||
print_liste_field_titre($textvalue, $_SERVER["PHP_SELF"], 'value', '', $param, '', $sortfield, $sortorder);
|
||||
}
|
||||
// Entity
|
||||
if (!empty($conf->multicompany->enabled) && !$user->entity) {
|
||||
if (isModEnabled('multicompany') && !$user->entity) {
|
||||
print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,page', '', $param, '', $sortfield, $sortorder);
|
||||
} else {
|
||||
print_liste_field_titre("", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
|
||||
@ -335,13 +335,13 @@ if ($mode != 'focus' && $mode != 'mandatory') {
|
||||
print '</td>';
|
||||
}
|
||||
// Limit to superadmin
|
||||
if (!empty($conf->multicompany->enabled) && !$user->entity) {
|
||||
if (isModEnabled('multicompany') && !$user->entity) {
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="1" disabled name="entity" value="'.$conf->entity.'">'; // We see environment, but to change it we must switch on other entity
|
||||
print '<input type="text" class="flat" size="1" disabled name="entity" value="' . $conf->entity . '">'; // We see environment, but to change it we must switch on other entity
|
||||
print '</td>';
|
||||
} else {
|
||||
print '<td class="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
print '<input type="hidden" name="entity" value="' . $conf->entity . '">';
|
||||
print '</td>';
|
||||
}
|
||||
print '<td class="center">';
|
||||
|
||||
@ -172,7 +172,7 @@ if (!isset($conf->global->MAIN_DELAY_ORDERS_TO_PROCESS)) {
|
||||
|
||||
if ($action == 'update') {
|
||||
foreach ($modules as $module => $delays) {
|
||||
if (!empty($conf->$module->enabled)) {
|
||||
if (isModEnabled('module')) {
|
||||
foreach ($delays as $delay) {
|
||||
if (GETPOST($delay['code']) != '') {
|
||||
dolibarr_set_const($db, $delay['code'], GETPOST($delay['code']), 'chaine', 0, '', $conf->entity);
|
||||
@ -226,13 +226,13 @@ if ($action == 'edit') {
|
||||
print '<td class="right">'.$langs->trans("LateWarningAfter").'</td></tr>';
|
||||
|
||||
foreach ($modules as $module => $delays) {
|
||||
if (!empty($conf->$module->enabled)) {
|
||||
if (isModEnabled('module')) {
|
||||
foreach ($delays as $delay) {
|
||||
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0);
|
||||
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']} : 0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('', $delay['img']).'</td>';
|
||||
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td><td class="nowraponall right">';
|
||||
print '<input class="right maxwidth75" type="number" name="'.$delay['code'].'" value="'.$value.'"> '.$langs->trans("days").'</td></tr>';
|
||||
print '<td width="20px">' . img_object('', $delay['img']) . '</td>';
|
||||
print '<td>' . $langs->trans('Delays_' . $delay['code']) . '</td><td class="nowraponall right">';
|
||||
print '<input class="right maxwidth75" type="number" name="' . $delay['code'] . '" value="' . $value . '"> ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -260,13 +260,13 @@ if ($action == 'edit') {
|
||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("DelaysOfToleranceBeforeWarning").'</td><td class="right">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
foreach ($modules as $module => $delays) {
|
||||
if (!empty($conf->$module->enabled)) {
|
||||
if (isModEnabled('module')) {
|
||||
foreach ($delays as $delay) {
|
||||
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']}:0);
|
||||
$value = (!empty($conf->global->{$delay['code']}) ? $conf->global->{$delay['code']} : 0);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20px">'.img_object('', $delay['img']).'</td>';
|
||||
print '<td>'.$langs->trans('Delays_'.$delay['code']).'</td>';
|
||||
print '<td class="right">'.$value.' '.$langs->trans("days").'</td></tr>';
|
||||
print '<td width="20px">' . img_object('', $delay['img']) . '</td>';
|
||||
print '<td>' . $langs->trans('Delays_' . $delay['code']) . '</td>';
|
||||
print '<td class="right">' . $value . ' ' . $langs->trans("days") . '</td></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ include_once DOL_DOCUMENT_ROOT.'/emailcollector/lib/emailcollector.lib.php';
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (empty($conf->emailcollector->enabled)) {
|
||||
if (!isModEnabled('emailcollector')) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -547,20 +547,21 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</tr>';
|
||||
|
||||
$arrayoftypes = array(
|
||||
'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")),
|
||||
'loadandcreatethirdparty'=>$langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")),
|
||||
'recordjoinpiece'=>'AttachJoinedDocumentsToObject',
|
||||
'recordevent'=>'RecordEvent');
|
||||
'loadthirdparty' => $langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")),
|
||||
'loadandcreatethirdparty' => $langs->trans('LoadThirdPartyFromNameOrCreate', $langs->transnoentities("ThirdPartyName")),
|
||||
'recordjoinpiece' => 'AttachJoinedDocumentsToObject',
|
||||
'recordevent' => 'RecordEvent'
|
||||
);
|
||||
$arrayoftypesnocondition = $arrayoftypes;
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
$arrayoftypes['project'] = 'CreateLeadAndThirdParty';
|
||||
}
|
||||
$arrayoftypesnocondition['project'] = 'CreateLeadAndThirdParty';
|
||||
if (!empty($conf->ticket->enabled)) {
|
||||
if (isModEnabled('ticket')) {
|
||||
$arrayoftypes['ticket'] = 'CreateTicketAndThirdParty';
|
||||
}
|
||||
$arrayoftypesnocondition['ticket'] = 'CreateTicketAndThirdParty';
|
||||
if (!empty($conf->recruitment->enabled)) {
|
||||
if (isModEnabled('recruitment')) {
|
||||
$arrayoftypes['candidature'] = 'CreateCandidature';
|
||||
}
|
||||
$arrayoftypesnocondition['candidature'] = 'CreateCandidature';
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2011-2022 Philippe Grand <philippe.grand@atoo-net.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
|
||||
@ -148,7 +148,7 @@ if ($action == 'updateMask') {
|
||||
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
|
||||
|
||||
$res3 = 0;
|
||||
if (!empty($conf->project->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
|
||||
if (isModEnabled('project') && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
|
||||
$res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
@ -471,7 +471,7 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm
|
||||
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('EXPENSEREPORT_DRAFT_WATERMARK')).'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
if (!empty($conf->project->enabled)) {
|
||||
if (isModEnabled('project')) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans('ProjectIsRequiredOnExpenseReports');
|
||||
print '</td><td class="right">';
|
||||
|
||||
@ -492,14 +492,14 @@ if ($action == 'edit') {
|
||||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print $conf->global->{$constname};
|
||||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'integer') {
|
||||
print '<input class="flat" name="'.$constname.'" id="'.$constname.'" value="'.$conf->global->$constname.'" type="number" step="1" min="0" max="50" >' . "\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
} elseif ($val['type'] == 'integer') {
|
||||
print '<input class="flat" name="' . $constname . '" id="' . $constname . '" value="' . $conf->global->$constname . '" type="number" step="1" min="0" max="50" >' . "\n";
|
||||
} elseif ($val['type'] == 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, $conf->global->{$constname}, 1);
|
||||
@ -532,25 +532,25 @@ if ($action == 'edit') {
|
||||
print img_picto('', 'category', 'class="pictofixedwidth"');
|
||||
print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
|
||||
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
|
||||
$formcompany = new FormCompany($db);
|
||||
print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
|
||||
} elseif ($val['type'] == 'securekey') {
|
||||
print '<input required="required" type="text" class="flat" id="'.$constname.'" name="'.$constname.'" value="'.(GETPOST($constname, 'alpha') ?GETPOST($constname, 'alpha') : $conf->global->{$constname}).'" size="40">';
|
||||
print '<input required="required" type="text" class="flat" id="' . $constname . '" name="' . $constname . '" value="' . (GETPOST($constname, 'alpha') ? GETPOST($constname, 'alpha') : $conf->global->{$constname}) . '" size="40">';
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token'.$constname.'" class="linkobject"');
|
||||
print ' ' . img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token' . $constname . '" class="linkobject"');
|
||||
}
|
||||
|
||||
// Add button to autosuggest a key
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
|
||||
print dolJSToSetRandomPassword($constname, 'generate_token'.$constname);
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/security2.lib.php';
|
||||
print dolJSToSetRandomPassword($constname, 'generate_token' . $constname);
|
||||
} elseif ($val['type'] == 'product') {
|
||||
if (isModEnabled("product") || isModEnabled("service")) {
|
||||
if (isModEnabled('product') || isModEnabled('service')) {
|
||||
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||
$form->select_produits($selected, $constname, '', 0);
|
||||
}
|
||||
} else {
|
||||
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
||||
print '<input name="' . $constname . '" class="flat ' . (empty($val['css']) ? 'minwidth200' : $val['css']) . '" value="' . $conf->global->{$constname} . '">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -208,12 +208,12 @@ if ($action == 'edit') {
|
||||
print '</td><td>';
|
||||
|
||||
if ($val['type'] == 'textarea') {
|
||||
print '<textarea class="flat" name="'.$constname.'" id="'.$constname.'" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print '<textarea class="flat" name="' . $constname . '" id="' . $constname . '" cols="50" rows="5" wrap="soft">' . "\n";
|
||||
print $conf->global->{$constname};
|
||||
print "</textarea>\n";
|
||||
} elseif ($val['type']== 'html') {
|
||||
} elseif ($val['type'] == 'html') {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, $conf->fckeditor->enabled, ROWS_5, '90%');
|
||||
$doleditor = new DolEditor($constname, $conf->global->{$constname}, '', 160, 'dolibarr_notes', '', false, false, isModEnabled('fckeditor'), ROWS_5, '90%');
|
||||
$doleditor->Create();
|
||||
} elseif ($val['type'] == 'yesno') {
|
||||
print $form->selectyesno($constname, $conf->global->{$constname}, 1);
|
||||
|
||||
@ -158,24 +158,24 @@ if (!empty($conf->global->LDAP_SYNCHRO_ACTIVE) && empty($conf->global->LDAP_USER
|
||||
print '</td></tr>';
|
||||
|
||||
// Synchro contact active
|
||||
if (isModEnabled("societe")) {
|
||||
if (isModEnabled('societe')) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnContactActive").'</td><td>';
|
||||
print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_CONTACT_ACTIVE'), 'activecontact', array(Ldap::SYNCHRO_LDAP_TO_DOLIBARR));
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnContactActiveExample").'</span></td></tr>';
|
||||
print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnContactActiveExample") . '</span></td></tr>';
|
||||
}
|
||||
|
||||
// Synchro member active
|
||||
if (!empty($conf->adherent->enabled)) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnMemberActive").'</td><td>';
|
||||
if (isModEnabled('adherent')) {
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("LDAPDnMemberActive") . '</td><td>';
|
||||
print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_ACTIVE'), 'activemembers', array(), 2);
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberActiveExample").'</span></td></tr>';
|
||||
print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnMemberActiveExample") . '</span></td></tr>';
|
||||
}
|
||||
|
||||
// Synchro member type active
|
||||
if (!empty($conf->adherent->enabled)) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPDnMemberTypeActive").'</td><td>';
|
||||
if (isModEnabled('adherent')) {
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("LDAPDnMemberTypeActive") . '</td><td>';
|
||||
print $formldap->selectLdapDnSynchroActive(getDolGlobalInt('LDAP_MEMBER_TYPE_ACTIVE'), 'activememberstypes', array(), 2);
|
||||
print '</td><td><span class="opacitymedium">'.$langs->trans("LDAPDnMemberTypeActiveExample").'</span></td></tr>';
|
||||
print '</td><td><span class="opacitymedium">' . $langs->trans("LDAPDnMemberTypeActiveExample") . '</span></td></tr>';
|
||||
}
|
||||
|
||||
// Fields from hook
|
||||
|
||||
@ -36,7 +36,7 @@ if (!$user->admin) {
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$currencycode = GETPOST('currencycode', 'alpha');
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
||||
if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
||||
// When MULTICURRENCY_USE_LIMIT_BY_CURRENCY is on, we use always a defined currency code instead of '' even for default.
|
||||
$currencycode = (!empty($currencycode) ? $currencycode : $conf->currency);
|
||||
}
|
||||
@ -105,12 +105,12 @@ print load_fiche_titre($title, '', 'title_setup');
|
||||
|
||||
$aCurrencies = array($conf->currency); // Default currency always first position
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/multicurrency.lib.php';
|
||||
if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/core/lib/multicurrency.lib.php';
|
||||
|
||||
$sql = "SELECT rowid, code FROM ".MAIN_DB_PREFIX."multicurrency";
|
||||
$sql .= " WHERE entity = ".((int) $conf->entity);
|
||||
$sql .= " AND code <> '".$db->escape($conf->currency)."'"; // Default currency always first position
|
||||
$sql = "SELECT rowid, code FROM " . MAIN_DB_PREFIX . "multicurrency";
|
||||
$sql .= " WHERE entity = " . ((int) $conf->entity);
|
||||
$sql .= " AND code <> '" . $db->escape($conf->currency) . "'"; // Default currency always first position
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) {
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
@ -129,11 +129,11 @@ print '<span class="opacitymedium">'.$langs->trans("LimitsDesc")."</span><br>\n"
|
||||
print "<br>\n";
|
||||
|
||||
if ($action == 'edit') {
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
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->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
||||
print '<input type="hidden" name="currencycode" value="'.$currencycode.'">';
|
||||
if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
||||
print '<input type="hidden" name="currencycode" value="' . $currencycode . '">';
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
@ -194,7 +194,7 @@ if ($action == 'edit') {
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
||||
if (isModEnabled('multicompany') && !empty($conf->global->MULTICURRENCY_USE_LIMIT_BY_CURRENCY)) {
|
||||
if (!empty($aCurrencies) && count($aCurrencies) > 1) {
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ require '../main.inc.php';
|
||||
|
||||
// Class
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ if ($action == 'update') {
|
||||
llxHeader();
|
||||
|
||||
$form = new Form($db);
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
$formaccounting = new FormAccounting($db);
|
||||
}
|
||||
|
||||
@ -100,14 +100,14 @@ foreach ($list as $key) {
|
||||
|
||||
// Param
|
||||
$label = $langs->trans($key);
|
||||
print '<td><label for="'.$key.'">'.$label.'</label></td>';
|
||||
print '<td><label for="' . $key . '">' . $label . '</label></td>';
|
||||
|
||||
// Value
|
||||
print '<td>';
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
if (isModEnabled('accounting')) {
|
||||
print $formaccounting->select_account(getDolGlobalString($key), $key, 1, '', 1, 1);
|
||||
} else {
|
||||
print '<input type="text" size="20" id="'.$key.'" name="'.$key.'" value="'.getDolGlobalString($key).'">';
|
||||
print '<input type="text" size="20" id="' . $key . '" name="' . $key . '" value="' . getDolGlobalString($key) . '">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -294,16 +294,16 @@ if ($action == 'edit') {
|
||||
}
|
||||
print '</td><td>';
|
||||
// SuperAdministrator access only
|
||||
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
||||
print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="'.$mainserver.'">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="'.$mainserver.'">';
|
||||
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||
print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>';
|
||||
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
|
||||
print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" size="18" value="' . $mainserver . '">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" name="MAIN_MAIL_SMTP_SERVER_EMAILING_sav" value="' . $mainserver . '">';
|
||||
print '<span id="smtp_server_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>';
|
||||
print ' <span class="opacitymedium smtp_method">' . $langs->trans("SeeLinkToOnlineDocumentation") . '</span>';
|
||||
} else {
|
||||
$text = !empty($mainserver) ? $mainserver : $smtpserver;
|
||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="'.$mainserver.'">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_EMAILING" name="MAIN_MAIL_SMTP_SERVER_EMAILING" value="' . $mainserver . '">';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
@ -326,15 +326,15 @@ if ($action == 'edit') {
|
||||
}
|
||||
print '</td><td>';
|
||||
// SuperAdministrator access only
|
||||
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
||||
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="'.$mainport.'">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="'.$mainport.'">';
|
||||
print '<span id="smtp_port_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
|
||||
print '<input class="flat" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" size="3" value="' . $mainport . '">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING_sav" name="MAIN_MAIL_SMTP_PORT_EMAILING_sav" value="' . $mainport . '">';
|
||||
print '<span id="smtp_port_mess" class="opacitymedium">' . $langs->trans("SeeLocalSendMailSetup") . '</span>';
|
||||
} else {
|
||||
$text = (!empty($mainport) ? $mainport : $smtpport);
|
||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="'.$mainport.'">';
|
||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_PORT_EMAILING" name="MAIN_MAIL_SMTP_PORT_EMAILING" value="' . $mainport . '">';
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
@ -342,14 +342,14 @@ if ($action == 'edit') {
|
||||
// ID
|
||||
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
||||
$mainstmpid = (!empty($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_ID_EMAILING : '');
|
||||
print '<tr class="drag drop oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_ID").'</td><td>';
|
||||
print '<tr class="drag drop oddeven hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_ID") . '</td><td>';
|
||||
// SuperAdministrator access only
|
||||
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
||||
print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="'.$mainstmpid.'">';
|
||||
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
|
||||
print '<input class="flat" name="MAIN_MAIL_SMTPS_ID_EMAILING" size="32" value="' . $mainstmpid . '">';
|
||||
} else {
|
||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_ID_EMAILING, $htmltext, 1, 'superadmin');
|
||||
print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="'.$mainstmpid.'">';
|
||||
print '<input type="hidden" name="MAIN_MAIL_SMTPS_ID_EMAILING" value="' . $mainstmpid . '">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -357,14 +357,14 @@ if ($action == 'edit') {
|
||||
// PW
|
||||
if (!empty($conf->use_javascript_ajax) || (isset($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && in_array($conf->global->MAIN_MAIL_SENDMODE_EMAILING, array('smtps', 'swiftmailer')))) {
|
||||
$mainsmtppw = (!empty($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING) ? $conf->global->MAIN_MAIL_SMTPS_PW_EMAILING : '');
|
||||
print '<tr class="drag drop oddeven hideifdefault"><td>'.$langs->trans("MAIN_MAIL_SMTPS_PW").'</td><td>';
|
||||
print '<tr class="drag drop oddeven hideifdefault"><td>' . $langs->trans("MAIN_MAIL_SMTPS_PW") . '</td><td>';
|
||||
// SuperAdministrator access only
|
||||
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity)) {
|
||||
print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="'.$mainsmtppw.'">';
|
||||
if (!isModEnabled('multicompany') || ($user->admin && !$user->entity)) {
|
||||
print '<input class="flat" type="password" name="MAIN_MAIL_SMTPS_PW_EMAILING" size="32" value="' . $mainsmtppw . '">';
|
||||
} else {
|
||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||
print $form->textwithpicto($conf->global->MAIN_MAIL_SMTPS_PW_EMAILING, $htmltext, 1, 'superadmin');
|
||||
print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="'.$mainsmtppw.'">';
|
||||
print '<input type="hidden" name="MAIN_MAIL_SMTPS_PW_EMAILING" value="' . $mainsmtppw . '">';
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -533,16 +533,16 @@ if ($action == 'edit') {
|
||||
if (!empty($conf->global->MAIN_MAIL_SENDMODE_EMAILING) && $conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'default') {
|
||||
if ($conf->global->MAIN_MAIL_SENDMODE_EMAILING != 'mail' || !$linuxlike) {
|
||||
if (function_exists('fsockopen') && $port && $server) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testconnect">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testconnect">' . $langs->trans("DoTestServerAvailability") . '</a>';
|
||||
}
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="' . $langs->trans("FeatureNotAvailableOnLinux") . '">' . $langs->trans("DoTestServerAvailability") . '</a>';
|
||||
}
|
||||
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init">'.$langs->trans("DoTestSend").'</a>';
|
||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=test&mode=init">' . $langs->trans("DoTestSend") . '</a>';
|
||||
|
||||
if (!empty($conf->fckeditor->enabled)) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=testhtml&mode=init">'.$langs->trans("DoTestSendHTML").'</a>';
|
||||
if (isModEnabled('fckeditor')) {
|
||||
print '<a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=testhtml&mode=init">' . $langs->trans("DoTestSendHTML") . '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -49,7 +49,7 @@ require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("orders", 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks', 'products'));
|
||||
$langs->loadLangs(array('orders', 'sendings', 'deliveries', 'companies', 'compta', 'bills', 'stocks', 'products'));
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$massaction = GETPOST('massaction', 'alpha');
|
||||
@ -70,6 +70,7 @@ $search_dateorder_start = dol_mktime(0, 0, 0, GETPOST('search_dateorder_start_mo
|
||||
$search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_end_month', 'int'), GETPOST('search_dateorder_end_day', 'int'), GETPOST('search_dateorder_end_year', 'int'));
|
||||
$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_start_month', 'int'), GETPOST('search_datedelivery_start_day', 'int'), GETPOST('search_datedelivery_start_year', 'int'));
|
||||
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_end_month', 'int'), GETPOST('search_datedelivery_end_day', 'int'), GETPOST('search_datedelivery_end_year', 'int'));
|
||||
|
||||
$search_product_category = GETPOST('search_product_category', 'int');
|
||||
$search_ref = GETPOST('search_ref', 'alpha') != '' ?GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha');
|
||||
$search_ref_customer = GETPOST('search_ref_customer', 'alpha');
|
||||
@ -77,22 +78,25 @@ $search_company = GETPOST('search_company', 'alpha');
|
||||
$search_company_alias = GETPOST('search_company_alias', 'alpha');
|
||||
$search_town = GETPOST('search_town', 'alpha');
|
||||
$search_zip = GETPOST('search_zip', 'alpha');
|
||||
$search_state = GETPOST("search_state", 'alpha');
|
||||
$search_country = GETPOST("search_country", 'int');
|
||||
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
||||
$search_state = GETPOST('search_state', 'alpha');
|
||||
$search_country = GETPOST('search_country', 'int');
|
||||
$search_type_thirdparty = GETPOST('search_type_thirdparty', 'int');
|
||||
$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$search_user = GETPOST('search_user', 'int');
|
||||
$search_sale = GETPOST('search_sale', 'int');
|
||||
|
||||
$search_total_ht = GETPOST('search_total_ht', 'alpha');
|
||||
$search_total_vat = GETPOST('search_total_vat', 'alpha');
|
||||
$search_total_ttc = GETPOST('search_total_ttc', 'alpha');
|
||||
$search_warehouse = GETPOST('search_warehouse', 'int');
|
||||
|
||||
$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
|
||||
$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
|
||||
$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
|
||||
$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
|
||||
$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
|
||||
$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
|
||||
|
||||
$search_login = GETPOST('search_login', 'alpha');
|
||||
$search_categ_cus = GETPOST("search_categ_cus", 'int');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
@ -103,10 +107,11 @@ $search_remove_btn = GETPOST('button_removefilter', 'alpha');
|
||||
$search_project_ref = GETPOST('search_project_ref', 'alpha');
|
||||
$search_project = GETPOST('search_project', 'alpha');
|
||||
$search_shippable = GETPOST('search_shippable', 'aZ09');
|
||||
$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int');
|
||||
$search_fk_shipping_method = GETPOST("search_fk_shipping_method", 'int');
|
||||
$search_fk_mode_reglement = GETPOST("search_fk_mode_reglement", 'int');
|
||||
$search_fk_input_reason = GETPOST("search_fk_input_reason", 'int');
|
||||
|
||||
$search_fk_cond_reglement = GETPOST('search_fk_cond_reglement', 'int');
|
||||
$search_fk_shipping_method = GETPOST('search_fk_shipping_method', 'int');
|
||||
$search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'int');
|
||||
$search_fk_input_reason = GETPOST('search_fk_input_reason', 'int');
|
||||
|
||||
// Security check
|
||||
$id = (GETPOST('orderid') ?GETPOST('orderid', 'int') : GETPOST('id', 'int'));
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Copyright (C) 2014-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2018-2022 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -1079,7 +1079,7 @@ if ($action == 'create') {
|
||||
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics" value="'.(GETPOSTISSET('ics') ? GETPOST('ics', 'alphanohtml') : $object->ics).'"></td></tr>';
|
||||
}
|
||||
|
||||
if (!empty(isModEnabled('paymentbybanktransfer'))) {
|
||||
if (isModEnabled('paymentbybanktransfer')) {
|
||||
print '<tr><td>'.$form->textwithpicto($langs->trans("IDS"), $langs->trans("IDS").' ('.$langs->trans("UsedFor", $langs->transnoentitiesnoconv("BankTransfer")).')').'</td>';
|
||||
print '<td><input class="minwidth150 maxwidth200onsmartphone" maxlength="32" type="text" class="flat" name="ics_transfer" value="'.(GETPOSTISSET('ics_transfer') ? GETPOST('ics_transfer', 'alphanohtml') : $object->ics_transfer).'"></td></tr>';
|
||||
|
||||
|
||||
@ -38,8 +38,11 @@ function product_prepare_head($object)
|
||||
$langs->load("products");
|
||||
|
||||
$label = $langs->trans('Product');
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire');
|
||||
|
||||
if ($object->isService()) {
|
||||
$label = $langs->trans('Service');
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire');
|
||||
}
|
||||
|
||||
$h = 0;
|
||||
@ -50,7 +53,7 @@ function product_prepare_head($object)
|
||||
$head[$h][2] = 'card';
|
||||
$h++;
|
||||
|
||||
if (!empty($object->status)) {
|
||||
if (!empty($object->status) && $usercancreadprice) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/price.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("SellingPrices");
|
||||
$head[$h][2] = 'price';
|
||||
@ -61,10 +64,12 @@ function product_prepare_head($object)
|
||||
if ((((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled("supplier_order") || isModEnabled("supplier_invoice")) && $user->rights->fournisseur->lire)
|
||||
|| (!empty($conf->margin->enabled) && $user->rights->margin->liretous)
|
||||
) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("BuyingPrices");
|
||||
$head[$h][2] = 'suppliers';
|
||||
$h++;
|
||||
if ($usercancreadprice) {
|
||||
$head[$h][0] = DOL_URL_ROOT."/product/fournisseurs.php?id=".$object->id;
|
||||
$head[$h][1] = $langs->trans("BuyingPrices");
|
||||
$head[$h][2] = 'suppliers';
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -127,6 +127,14 @@ class modProduct extends DolibarrModules
|
||||
$this->rights[$r][4] = 'creer';
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 33; // id de la permission
|
||||
$this->rights[$r][1] = 'Read prices products'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||
$this->rights[$r][4] = 'product_advance';
|
||||
$this->rights[$r][5] = 'read_prices';
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 34; // id de la permission
|
||||
$this->rights[$r][1] = 'Delete products'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
||||
|
||||
@ -102,6 +102,14 @@ class modService extends DolibarrModules
|
||||
$this->rights[$r][4] = 'creer';
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 533; // id de la permission
|
||||
$this->rights[$r][1] = 'Read prices services'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'w'; // type de la permission (deprecie a ce jour)
|
||||
$this->rights[$r][3] = 0; // La permission est-elle une permission par defaut
|
||||
$this->rights[$r][4] = 'service_advance';
|
||||
$this->rights[$r][5] = 'read_prices';
|
||||
$r++;
|
||||
|
||||
$this->rights[$r][0] = 534; // id de la permission
|
||||
$this->rights[$r][1] = 'Delete les services'; // libelle de la permission
|
||||
$this->rights[$r][2] = 'd'; // type de la permission (deprecie a ce jour)
|
||||
|
||||
@ -44,7 +44,7 @@ if (!empty($conf->project->enabled)) {
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
|
||||
$langs->loadLangs(array("bills", "companies", "donations", "users"));
|
||||
$langs->loadLangs(array('bills', 'companies', 'donations', 'users'));
|
||||
|
||||
$id = GETPOST('rowid') ?GETPOST('rowid', 'int') : GETPOST('id', 'int');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
@ -40,7 +40,7 @@ if (!empty($conf->project->enabled)) {
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "other", "donations"));
|
||||
$langs->loadLangs(array('companies', 'other', 'donations'));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
@ -30,7 +30,7 @@ if (!empty($conf->project->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
}
|
||||
|
||||
$langs->load("donations");
|
||||
$langs->load('donations');
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
@ -45,17 +45,22 @@ $result = restrictedArea($user, 'don', $id, '');
|
||||
|
||||
$object = new Don($db);
|
||||
$object->fetch($id);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'classin' && $user->rights->don->creer) {
|
||||
$object->fetch($id);
|
||||
$object->setProject($projectid);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans('Donation')." - ".$langs->trans('Info');
|
||||
|
||||
$help_url = 'EN:Module_Donations|FR:Module_Dons|ES:Módulo_Donaciones|DE:Modul_Spenden';
|
||||
|
||||
@ -32,7 +32,7 @@ if (!empty($conf->project->enabled)) {
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "donations"));
|
||||
$langs->loadLangs(array('companies', 'donations'));
|
||||
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'sclist';
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ if (!empty($conf->project->enabled)) {
|
||||
}
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies", "bills", "donations"));
|
||||
$langs->loadLangs(array('companies', 'bills', 'donations'));
|
||||
|
||||
$id = (GETPOST('id', 'int') ?GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
@ -60,6 +60,7 @@ $permissionnote = $user->rights->don->creer; // Used by the include of actions_s
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
@ -73,6 +74,7 @@ if ($action == 'classin' && $user->rights->don->creer) {
|
||||
$object->setProject($projectid);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/treeview.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("ecm", "companies", "other", "users", "orders", "propal", "bills", "contracts"));
|
||||
$langs->loadLangs(array('ecm', 'companies', 'other', 'users', 'orders', 'propal', 'bills', 'contracts'));
|
||||
|
||||
// Get parameters
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
@ -714,6 +714,7 @@ Permission27=Delete commercial proposals
|
||||
Permission28=Export commercial proposals
|
||||
Permission31=Read products
|
||||
Permission32=Create/modify products
|
||||
Permission33=Read prices products
|
||||
Permission34=Delete products
|
||||
Permission36=See/manage hidden products
|
||||
Permission38=Export products
|
||||
@ -875,6 +876,7 @@ Permission525=Access loan calculator
|
||||
Permission527=Export loans
|
||||
Permission531=Read services
|
||||
Permission532=Create/modify services
|
||||
Permission533=Read prices services
|
||||
Permission534=Delete services
|
||||
Permission536=See/manage hidden services
|
||||
Permission538=Export services
|
||||
|
||||
@ -291,7 +291,6 @@ if ($search_type == '0') {
|
||||
$result = restrictedArea($user, 'produit|service', '', '', '', '', '', 0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -1360,6 +1359,11 @@ if ($resql) {
|
||||
}
|
||||
}
|
||||
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('product', 'product_advance', 'read_prices'):$user->hasRight('product', 'lire');
|
||||
if ($product_static->isService()) {
|
||||
$usercancreadprice = getDolGlobalString('MAIN_USE_ADVANCED_PERMS')?$user->hasRight('service', 'service_advance', 'read_prices'):$user->hasRight('service', 'lire');
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Action column
|
||||
@ -1622,7 +1626,7 @@ if ($resql) {
|
||||
// Sell price
|
||||
if (!empty($arrayfields['p.sellprice']['checked'])) {
|
||||
print '<td class="right nowraponall">';
|
||||
if ($obj->tosell) {
|
||||
if ($obj->tosell && $usercancreadprice) {
|
||||
if ($obj->price_base_type == 'TTC') {
|
||||
print '<span class="amount">'.price($obj->price_ttc).' '.$langs->trans("TTC").'</span>';
|
||||
} else {
|
||||
@ -1645,7 +1649,7 @@ if ($resql) {
|
||||
$productpricescache[$obj->rowid] = array();
|
||||
}
|
||||
|
||||
if ($obj->tosell) {
|
||||
if ($obj->tosell && $usercancreadprice) {
|
||||
// Make 1 request for all price levels (without filter on price_level) and saved result into an cache array
|
||||
// then reuse the cache array if we need prices for other price levels
|
||||
$sqlp = "SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price, p.price_base_type";
|
||||
@ -1695,7 +1699,7 @@ if ($resql) {
|
||||
// Better buy price
|
||||
if (!empty($arrayfields['p.minbuyprice']['checked'])) {
|
||||
print '<td class="right nowraponall">';
|
||||
if ($obj->tobuy && $obj->minsellprice != '') {
|
||||
if ($obj->tobuy && $obj->minsellprice != '' && $usercancreadprice) {
|
||||
//print price($obj->minsellprice).' '.$langs->trans("HT");
|
||||
if ($product_fourn->find_min_price_product_fournisseur($obj->rowid) > 0) {
|
||||
if ($product_fourn->product_fourn_price_id > 0) {
|
||||
@ -1717,7 +1721,7 @@ if ($resql) {
|
||||
// Number of buy prices
|
||||
if (!empty($arrayfields['p.numbuyprice']['checked'])) {
|
||||
print '<td class="right">';
|
||||
if ($obj->tobuy) {
|
||||
if ($obj->tobuy && $usercancreadprice) {
|
||||
if (count($productFournList = $product_fourn->list_product_fournisseur_price($obj->rowid)) > 0) {
|
||||
$htmltext = $product_fourn->display_price_product_fournisseur(1, 1, 0, 1, $productFournList);
|
||||
print $form->textwithpicto(count($productFournList), $htmltext);
|
||||
@ -1739,14 +1743,18 @@ if ($resql) {
|
||||
// WAP
|
||||
if (!empty($arrayfields['p.pmp']['checked'])) {
|
||||
print '<td class="nowrap right">';
|
||||
print '<span class="amount">'.price($product_static->pmp, 1, $langs)."</span>";
|
||||
if ($usercancreadprice) {
|
||||
print '<span class="amount">'.price($product_static->pmp, 1, $langs)."</span>";
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
// Cost price
|
||||
if (!empty($arrayfields['p.cost_price']['checked'])) {
|
||||
print '<td class="nowrap right">';
|
||||
//print $obj->cost_price;
|
||||
print '<span class="amount">'.price($obj->cost_price).' '.$langs->trans("HT").'</span>';
|
||||
if ($usercancreadprice) {
|
||||
print '<span class="amount">'.price($obj->cost_price).' '.$langs->trans("HT").'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -1779,7 +1787,9 @@ if ($resql) {
|
||||
if ($obj->seuil_stock_alerte != '' && $product_static->stock_reel < (float) $obj->seuil_stock_alerte) {
|
||||
print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' ';
|
||||
}
|
||||
print price(price2num($product_static->stock_reel, 'MS'));
|
||||
if ($usercancreadprice) {
|
||||
print price(price2num($product_static->stock_reel, 'MS'));
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
@ -1793,7 +1803,9 @@ if ($resql) {
|
||||
if ($obj->seuil_stock_alerte != '' && $product_static->stock_theorique < (float) $obj->seuil_stock_alerte) {
|
||||
print img_warning($langs->trans("StockLowerThanLimit", $obj->seuil_stock_alerte)).' ';
|
||||
}
|
||||
print price(price2num($product_static->stock_theorique, 'MS'));
|
||||
if ($usercancreadprice) {
|
||||
print price(price2num($product_static->stock_theorique, 'MS'));
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user