Merge branch 'Dolibarr:develop' into PROPALE_MODIFY_MARGIN_RATES

This commit is contained in:
marcusdeangabriel 2023-02-16 10:28:44 +01:00 committed by GitHub
commit f39d32255c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
480 changed files with 5729 additions and 2882 deletions

View File

@ -18,7 +18,7 @@ jobs:
fetch-depth: 1
#php-version: '7.1'
- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2022.3.2
uses: JetBrains/qodana-action@v2022.3.3
#with:
# php-version: '7.1'
env:

View File

@ -1,442 +1,442 @@
[main]
host = https://www.transifex.com
host = https://www.transifex.com
lang_map = uz: uz_UZ, sw: sw_SW, sr@latin: sr_RS
[dolibarr.accountancy]
[o:dolibarr-association:p:dolibarr:r:accountancy]
file_filter = htdocs/langs/<lang>/accountancy.lang
source_file = htdocs/langs/en_US/accountancy.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.admin]
[o:dolibarr-association:p:dolibarr:r:admin]
file_filter = htdocs/langs/<lang>/admin.lang
source_file = htdocs/langs/en_US/admin.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.agenda]
[o:dolibarr-association:p:dolibarr:r:agenda]
file_filter = htdocs/langs/<lang>/agenda.lang
source_file = htdocs/langs/en_US/agenda.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.assets]
[o:dolibarr-association:p:dolibarr:r:assets]
file_filter = htdocs/langs/<lang>/assets.lang
source_file = htdocs/langs/en_US/assets.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.banks]
[o:dolibarr-association:p:dolibarr:r:banks]
file_filter = htdocs/langs/<lang>/banks.lang
source_file = htdocs/langs/en_US/banks.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.bills]
[o:dolibarr-association:p:dolibarr:r:bills]
file_filter = htdocs/langs/<lang>/bills.lang
source_file = htdocs/langs/en_US/bills.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.blockedlog]
[o:dolibarr-association:p:dolibarr:r:blockedlog]
file_filter = htdocs/langs/<lang>/blockedlog.lang
source_file = htdocs/langs/en_US/blockedlog.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.bookmarks]
[o:dolibarr-association:p:dolibarr:r:bookmarks]
file_filter = htdocs/langs/<lang>/bookmarks.lang
source_file = htdocs/langs/en_US/bookmarks.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.boxes]
[o:dolibarr-association:p:dolibarr:r:boxes]
file_filter = htdocs/langs/<lang>/boxes.lang
source_file = htdocs/langs/en_US/boxes.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.cashdesk]
[o:dolibarr-association:p:dolibarr:r:cashdesk]
file_filter = htdocs/langs/<lang>/cashdesk.lang
source_file = htdocs/langs/en_US/cashdesk.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.categories]
[o:dolibarr-association:p:dolibarr:r:categories]
file_filter = htdocs/langs/<lang>/categories.lang
source_file = htdocs/langs/en_US/categories.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.commercial]
[o:dolibarr-association:p:dolibarr:r:commercial]
file_filter = htdocs/langs/<lang>/commercial.lang
source_file = htdocs/langs/en_US/commercial.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.companies]
[o:dolibarr-association:p:dolibarr:r:companies]
file_filter = htdocs/langs/<lang>/companies.lang
source_file = htdocs/langs/en_US/companies.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.compta]
[o:dolibarr-association:p:dolibarr:r:compta]
file_filter = htdocs/langs/<lang>/compta.lang
source_file = htdocs/langs/en_US/compta.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.contracts]
[o:dolibarr-association:p:dolibarr:r:contracts]
file_filter = htdocs/langs/<lang>/contracts.lang
source_file = htdocs/langs/en_US/contracts.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.cron]
[o:dolibarr-association:p:dolibarr:r:cron]
file_filter = htdocs/langs/<lang>/cron.lang
source_file = htdocs/langs/en_US/cron.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.datapolicy]
[o:dolibarr-association:p:dolibarr:r:datapolicy]
file_filter = htdocs/langs/<lang>/datapolicy.lang
source_file = htdocs/langs/en_US/datapolicy.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.deliveries]
[o:dolibarr-association:p:dolibarr:r:deliveries]
file_filter = htdocs/langs/<lang>/deliveries.lang
source_file = htdocs/langs/en_US/deliveries.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.dict]
[o:dolibarr-association:p:dolibarr:r:dict]
file_filter = htdocs/langs/<lang>/dict.lang
source_file = htdocs/langs/en_US/dict.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.donations]
[o:dolibarr-association:p:dolibarr:r:donations]
file_filter = htdocs/langs/<lang>/donations.lang
source_file = htdocs/langs/en_US/donations.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.ecm]
[o:dolibarr-association:p:dolibarr:r:ecm]
file_filter = htdocs/langs/<lang>/ecm.lang
source_file = htdocs/langs/en_US/ecm.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.errors]
[o:dolibarr-association:p:dolibarr:r:errors]
file_filter = htdocs/langs/<lang>/errors.lang
source_file = htdocs/langs/en_US/errors.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.eventorganization]
[o:dolibarr-association:p:dolibarr:r:eventorganization]
file_filter = htdocs/langs/<lang>/eventorganization.lang
source_file = htdocs/langs/en_US/eventorganization.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.exports]
[o:dolibarr-association:p:dolibarr:r:exports]
file_filter = htdocs/langs/<lang>/exports.lang
source_file = htdocs/langs/en_US/exports.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.help]
[o:dolibarr-association:p:dolibarr:r:help]
file_filter = htdocs/langs/<lang>/help.lang
source_file = htdocs/langs/en_US/help.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.holiday]
[o:dolibarr-association:p:dolibarr:r:holiday]
file_filter = htdocs/langs/<lang>/holiday.lang
source_file = htdocs/langs/en_US/holiday.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.hrm]
[o:dolibarr-association:p:dolibarr:r:hrm]
file_filter = htdocs/langs/<lang>/hrm.lang
source_file = htdocs/langs/en_US/hrm.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.install]
[o:dolibarr-association:p:dolibarr:r:install]
file_filter = htdocs/langs/<lang>/install.lang
source_file = htdocs/langs/en_US/install.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.interventions]
[o:dolibarr-association:p:dolibarr:r:interventions]
file_filter = htdocs/langs/<lang>/interventions.lang
source_file = htdocs/langs/en_US/interventions.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.intracommreport]
[o:dolibarr-association:p:dolibarr:r:intracommreport]
file_filter = htdocs/langs/<lang>/intracommreport.lang
source_file = htdocs/langs/en_US/intracommreport.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.knowledgemanagement]
[o:dolibarr-association:p:dolibarr:r:knowledgemanagement]
file_filter = htdocs/langs/<lang>/knowledgemanagement.lang
source_file = htdocs/langs/en_US/knowledgemanagement.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.languages-not-res]
[o:dolibarr-association:p:dolibarr:r:languages-not-res]
file_filter = htdocs/langs/<lang>/languages.lang
source_file = htdocs/langs/en_US/languages.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.ldap]
[o:dolibarr-association:p:dolibarr:r:ldap]
file_filter = htdocs/langs/<lang>/ldap.lang
source_file = htdocs/langs/en_US/ldap.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.link]
[o:dolibarr-association:p:dolibarr:r:link]
file_filter = htdocs/langs/<lang>/link.lang
source_file = htdocs/langs/en_US/link.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.loan]
[o:dolibarr-association:p:dolibarr:r:loan]
file_filter = htdocs/langs/<lang>/loan.lang
source_file = htdocs/langs/en_US/loan.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.mailmanspip]
[o:dolibarr-association:p:dolibarr:r:mailmanspip]
file_filter = htdocs/langs/<lang>/mailmanspip.lang
source_file = htdocs/langs/en_US/mailmanspip.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.mails]
[o:dolibarr-association:p:dolibarr:r:mails]
file_filter = htdocs/langs/<lang>/mails.lang
source_file = htdocs/langs/en_US/mails.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.main]
[o:dolibarr-association:p:dolibarr:r:main]
file_filter = htdocs/langs/<lang>/main.lang
source_file = htdocs/langs/en_US/main.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.margins]
[o:dolibarr-association:p:dolibarr:r:margins]
file_filter = htdocs/langs/<lang>/margins.lang
source_file = htdocs/langs/en_US/margins.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.members]
[o:dolibarr-association:p:dolibarr:r:members]
file_filter = htdocs/langs/<lang>/members.lang
source_file = htdocs/langs/en_US/members.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.modulebuilder]
[o:dolibarr-association:p:dolibarr:r:modulebuilder]
file_filter = htdocs/langs/<lang>/modulebuilder.lang
source_file = htdocs/langs/en_US/modulebuilder.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.mrp]
[o:dolibarr-association:p:dolibarr:r:mrp]
file_filter = htdocs/langs/<lang>/mrp.lang
source_file = htdocs/langs/en_US/mrp.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.multicurrency]
[o:dolibarr-association:p:dolibarr:r:multicurrency]
file_filter = htdocs/langs/<lang>/multicurrency.lang
source_file = htdocs/langs/en_US/multicurrency.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.oauth]
[o:dolibarr-association:p:dolibarr:r:oauth]
file_filter = htdocs/langs/<lang>/oauth.lang
source_file = htdocs/langs/en_US/oauth.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.opensurvey]
[o:dolibarr-association:p:dolibarr:r:opensurvey]
file_filter = htdocs/langs/<lang>/opensurvey.lang
source_file = htdocs/langs/en_US/opensurvey.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.orders]
[o:dolibarr-association:p:dolibarr:r:orders]
file_filter = htdocs/langs/<lang>/orders.lang
source_file = htdocs/langs/en_US/orders.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.other]
[o:dolibarr-association:p:dolibarr:r:other]
file_filter = htdocs/langs/<lang>/other.lang
source_file = htdocs/langs/en_US/other.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.partnership]
[o:dolibarr-association:p:dolibarr:r:partnership]
file_filter = htdocs/langs/<lang>/partnership.lang
source_file = htdocs/langs/en_US/partnership.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.paybox]
[o:dolibarr-association:p:dolibarr:r:paybox]
file_filter = htdocs/langs/<lang>/paybox.lang
source_file = htdocs/langs/en_US/paybox.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.paypal]
[o:dolibarr-association:p:dolibarr:r:paypal]
file_filter = htdocs/langs/<lang>/paypal.lang
source_file = htdocs/langs/en_US/paypal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.printing]
[o:dolibarr-association:p:dolibarr:r:printing]
file_filter = htdocs/langs/<lang>/printing.lang
source_file = htdocs/langs/en_US/printing.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.productbatch]
[o:dolibarr-association:p:dolibarr:r:productbatch]
file_filter = htdocs/langs/<lang>/productbatch.lang
source_file = htdocs/langs/en_US/productbatch.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.products]
[o:dolibarr-association:p:dolibarr:r:products]
file_filter = htdocs/langs/<lang>/products.lang
source_file = htdocs/langs/en_US/products.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.projects]
[o:dolibarr-association:p:dolibarr:r:projects]
file_filter = htdocs/langs/<lang>/projects.lang
source_file = htdocs/langs/en_US/projects.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.propal]
[o:dolibarr-association:p:dolibarr:r:propal]
file_filter = htdocs/langs/<lang>/propal.lang
source_file = htdocs/langs/en_US/propal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.receiptprinter]
[o:dolibarr-association:p:dolibarr:r:receiptprinter]
file_filter = htdocs/langs/<lang>/receiptprinter.lang
source_file = htdocs/langs/en_US/receiptprinter.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.receptions]
[o:dolibarr-association:p:dolibarr:r:receptions]
file_filter = htdocs/langs/<lang>/receptions.lang
source_file = htdocs/langs/en_US/receptions.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.recruitment]
[o:dolibarr-association:p:dolibarr:r:recruitment]
file_filter = htdocs/langs/<lang>/recruitment.lang
source_file = htdocs/langs/en_US/recruitment.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.resource]
[o:dolibarr-association:p:dolibarr:r:resource]
file_filter = htdocs/langs/<lang>/resource.lang
source_file = htdocs/langs/en_US/resource.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.salaries]
[o:dolibarr-association:p:dolibarr:r:salaries]
file_filter = htdocs/langs/<lang>/salaries.lang
source_file = htdocs/langs/en_US/salaries.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.sendings]
[o:dolibarr-association:p:dolibarr:r:sendings]
file_filter = htdocs/langs/<lang>/sendings.lang
source_file = htdocs/langs/en_US/sendings.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.sms]
[o:dolibarr-association:p:dolibarr:r:sms]
file_filter = htdocs/langs/<lang>/sms.lang
source_file = htdocs/langs/en_US/sms.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.stocks]
[o:dolibarr-association:p:dolibarr:r:stocks]
file_filter = htdocs/langs/<lang>/stocks.lang
source_file = htdocs/langs/en_US/stocks.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.stripe]
[o:dolibarr-association:p:dolibarr:r:stripe]
file_filter = htdocs/langs/<lang>/stripe.lang
source_file = htdocs/langs/en_US/stripe.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.supplier_proposal]
[o:dolibarr-association:p:dolibarr:r:supplier_proposal]
file_filter = htdocs/langs/<lang>/supplier_proposal.lang
source_file = htdocs/langs/en_US/supplier_proposal.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.suppliers]
[o:dolibarr-association:p:dolibarr:r:suppliers]
file_filter = htdocs/langs/<lang>/suppliers.lang
source_file = htdocs/langs/en_US/suppliers.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.ticket]
[o:dolibarr-association:p:dolibarr:r:ticket]
file_filter = htdocs/langs/<lang>/ticket.lang
source_file = htdocs/langs/en_US/ticket.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.trips]
[o:dolibarr-association:p:dolibarr:r:trips]
file_filter = htdocs/langs/<lang>/trips.lang
source_file = htdocs/langs/en_US/trips.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.users]
[o:dolibarr-association:p:dolibarr:r:users]
file_filter = htdocs/langs/<lang>/users.lang
source_file = htdocs/langs/en_US/users.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.website]
[o:dolibarr-association:p:dolibarr:r:website]
file_filter = htdocs/langs/<lang>/website.lang
source_file = htdocs/langs/en_US/website.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.withdrawals]
[o:dolibarr-association:p:dolibarr:r:withdrawals]
file_filter = htdocs/langs/<lang>/withdrawals.lang
source_file = htdocs/langs/en_US/withdrawals.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.workflow]
[o:dolibarr-association:p:dolibarr:r:workflow]
file_filter = htdocs/langs/<lang>/workflow.lang
source_file = htdocs/langs/en_US/workflow.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES
[dolibarr.zapier]
[o:dolibarr-association:p:dolibarr:r:zapier]
file_filter = htdocs/langs/<lang>/zapier.lang
source_file = htdocs/langs/en_US/zapier.lang
source_lang = en_US
type = MOZILLAPROPERTIES
type = MOZILLAPROPERTIES

View File

@ -36,7 +36,7 @@ then
echo "tx pull -a"
tx pull -a
echo "Remove some language directories (not enough translated)"
echo "Remove some language directories (not enough translated) like ach, br_FR, en, frp, fy_NL, ..."
rm -fr htdocs/langs/ach
rm -fr htdocs/langs/br_FR
rm -fr htdocs/langs/en

View File

@ -42,7 +42,7 @@ $ref = GETPOST('ref', 'alpha');
$rowid = GETPOST('rowid', 'int');
$cancel = GETPOST('cancel', 'alpha');
$account_number = GETPOST('account_number', 'string');
$account_number = GETPOST('account_number', 'alphanohtml');
$label = GETPOST('label', 'alpha');
// Security check

View File

@ -2288,6 +2288,7 @@ class Adherent extends CommonObject
$datas = [];
$nofetch = empty($params['nofetch']) ? false : true;
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$langs->load("users");
return ['optimize' => $langs->trans("ShowUser")];
@ -2318,6 +2319,12 @@ class Adherent extends CommonObject
$datas['email'] = '<br><b>'.$langs->trans("EMail").':</b> '.$this->email;
}
$datas['address'] = '<br><b>'.$langs->trans("Address").':</b> '.dol_format_address($this, 1, ' ', $langs);
// show categories for this record only in ajax to not overload lists
if (isModEnabled('categorie') && !$nofetch) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$form = new Form($this->db);
$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_MEMBER, 1);
}
$datas['divclose'] = '</div>';
return $datas;
@ -2353,6 +2360,7 @@ class Adherent extends CommonObject
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
'nofetch' => 1,
];
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$classfortooltip = 'classforajaxtooltip';

View File

@ -147,12 +147,12 @@ if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('ac
$object->value=$defaultvalue;
$object->entity=$conf->entity;
$result=$object->create($user);
if ($result<0) {
if ($result < 0) {
$action = '';
setEventMessages($object->error, $object->errors, 'errors');
} else {
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
$action = "";
$action = '';
$defaulturl = '';
$defaultkey = '';
$defaultvalue = '';
@ -324,16 +324,16 @@ print "\n";
print '<tr class="oddeven">';
// Page
print '<td>';
print '<input type="text" class="flat minwidth200 maxwidthonsmartphone" name="defaulturl" value="'.dol_escape_htmltag(GETPOST('defaulturl', 'alphanohtml')).'">';
print '<input type="text" class="flat minwidth200 maxwidthonsmartphone" name="defaulturl" value="'.dol_escape_htmltag($defaulturl).'">';
print '</td>'."\n";
// Field
print '<td>';
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultkey" value="'.dol_escape_htmltag(GETPOST('defaultkey', 'alphanohtml')).'">';
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultkey" value="'.dol_escape_htmltag($defaultkey).'">';
print '</td>';
// Value
if ($mode != 'focus' && $mode != 'mandatory') {
print '<td>';
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultvalue" value="">';
print '<input type="text" class="flat maxwidth100onsmartphone" name="defaultvalue" value="'.dol_escape_htmltag($defaultvalue).'">';
print '</td>';
}
// Limit to superadmin

View File

@ -722,7 +722,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Add operation
print '<tr class="oddeven nodrag nodrop">';
print '<td>';
print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300', 1);
print $form->selectarray('operationtype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'minwidth150 maxwidth300', 1);
print '</td><td>';
//print '<input type="text" name="operationparam">';
$htmltext = $langs->transnoentitiesnoconv("OperationParamDesc");

View File

@ -245,6 +245,7 @@ if ($action == 'update') {
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_CHECKBOX_LEFT_COLUMN", GETPOST("MAIN_CHECKBOX_LEFT_COLUMN", 'int'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", GETPOST("MAIN_DISABLE_JAVASCRIPT", 'aZ09'), 'chaine', 0, '', $conf->entity);
//dolibarr_set_const($db, "MAIN_BUTTON_HIDE_UNAUTHORIZED", GETPOST("MAIN_BUTTON_HIDE_UNAUTHORIZED", 'aZ09'), 'chaine', 0, '', $conf->entity);
@ -408,6 +409,12 @@ if ($mode == 'other') {
print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeShortList") . '</td><td><input class="flat" name="main_size_shortliste_limit" size="4" value="' . $conf->global->MAIN_SIZE_SHORTLIST_LIMIT . '"></td>';
print '</tr>';
// Max size of lists
print '<tr class="oddeven"><td>' . $langs->trans("MAIN_CHECKBOX_LEFT_COLUMN") . '</td><td>';
print ajax_constantonoff("MAIN_CHECKBOX_LEFT_COLUMN", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print '</td>';
print '</tr>';
// show input border
/*
print '<tr><td>'.$langs->trans("showInputBorder").'</td><td>';

View File

@ -680,17 +680,27 @@ if (!empty($user->admin) && (empty($_SESSION['leftmenu']) || $_SESSION['leftmenu
}
// Confirmation de la suppression de la ligne
// Confirm deletion of record
if ($action == 'delete') {
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$code.'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.((int) $rowid).'&code='.urlencode($code).'&id='.((int) $id), $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete', '', 0, 1);
}
$fieldlist = explode(',', $tabfield[$id]);
if ($action == 'create') {
// If data was already input, we define them in obj to populate input fields.
$obj = new stdClass();
$obj->label = GETPOST('label');
$obj->lang = GETPOST('lang');
$obj->type_template = GETPOST('type_template');
$obj->fk_user = GETPOST('fk_user', 'int');
$obj->private = GETPOST('private', 'int');
$obj->position = GETPOST('position');
$obj->topic = GETPOST('topic');
$obj->joinfiles = GETPOST('joinfiles');
$obj->content = GETPOST('content', 'restricthtml');
// Form to add a new line
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$id.'" method="POST">';
print '<input type="hidden" name="token" value="'.newToken().'">';
@ -769,16 +779,6 @@ if ($action == 'create') {
print '</th>';
print '</tr>';
$obj = new stdClass();
// If data was already input, we define them in obj to populate input fields.
if (GETPOST('actionadd')) {
foreach ($fieldlist as $key => $val) {
if (GETPOST($val) != '') {
$obj->$val = GETPOST($val);
}
}
}
$tmpaction = 'create';
$parameters = array(
'fieldlist' => $fieldlist,
@ -836,7 +836,6 @@ if ($action == 'create') {
if (empty($conf->global->FCKEDITOR_ENABLE_MAIL)) {
$okforextended = false;
}
$doleditor = new DolEditor($tmpfieldlist, (!empty($obj->$tmpfieldlist) ? $obj->$tmpfieldlist : ''), '', 180, 'dolibarr_mailings', 'In', false, $acceptlocallinktomedia, $okforextended, ROWS_4, '90%');
print $doleditor->Create(1);
}
@ -856,7 +855,7 @@ if ($action == 'create') {
print '</div>';
print '</form>';
print '<br><br>';
} // END IF not edit
}
// List of available record in database
dol_syslog("htdocs/admin/dict", LOG_DEBUG);

View File

@ -577,6 +577,9 @@ print '<br>';
print '<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.getDolGlobalString('MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL', '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>')."<br>";
print '<br>';
print '<strong>MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED</strong> = '.getDolGlobalString('MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED', '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 0)</span>')."<br>";
print '<br>';
print '<strong>MAIN_SECURITY_FORCECSP</strong> = '.getDolGlobalString('MAIN_SECURITY_FORCECSP', '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>').' &nbsp; <span class="opacitymedium">('.$langs->trans("Example").": \"frame-ancestors 'self'; default-src 'self'; img-src *;\")</span><br>";
print '<br>';

View File

@ -202,45 +202,53 @@ print '</tr>';
print '<tr>';
print '<td class="tdtop nopaddingleftimp">';
print '<div class="centpercent center"><a id="lnk" href="javascript:hideoptions()"> '.$langs->trans("ShowAdvancedOptions").'...</a></div>';
print '<div class="centpercent center margintoponly marginbottomonly">';
print img_picto('', 'setup', 'class="pictofixedwidth"').'<a id="lnk">'.$langs->trans("ShowAdvancedOptions").'...</a>';
print '</div>';
print '<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#lnk").click(function() {
console.log("We click on link");
hideoptions(this);
});
});
function hideoptions(){
const lnk = document.getElementById("lnk");
function hideoptions(domelem) {
const div = document.getElementById("div_container_sub_exportoptions");
if (div.style.display === "none") {
div.style.display = "block";
lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("HideAdvancedoptions")).'";
domelem.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("HideAdvancedoptions")).'";
} else {
div.style.display = "none";
lnk.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("ShowAdvancedOptions")).'...";
domelem.innerText="'.dol_escape_js($langs->transnoentitiesnoconv("ShowAdvancedOptions")).'...";
}
}
</script>';
print '<div id="div_container_sub_exportoptions" style="display: none;">';
print '<br>';
if (in_array($type, array('mysql', 'mysqli'))) {
print "<!-- Fieldset mysqldump -->\n";
print '<fieldset id="mysql_options"><legend>'.$langs->trans("MySqlExportParameters").'</legend>';
print '<fieldset id="mysql_options">';
print '<div class="formelementrow">'.$langs->trans("FullPathToMysqldumpCommand");
print '<fieldset class="formelementrow"><legend>'.$langs->trans("FullPathToMysqldumpCommand").'</legend>';
if (empty($conf->global->SYSTEMTOOLS_MYSQLDUMP)) {
$fullpathofmysqldump = $db->getPathOfDump();
} else {
$fullpathofmysqldump = $conf->global->SYSTEMTOOLS_MYSQLDUMP;
}
print '<br>';
print '<input type="text" name="mysqldump" style="width: 80%" value="'.$fullpathofmysqldump.'" /></div>';
print '<input type="text" name="mysqldump" style="width: 80%" value="'.$fullpathofmysqldump.'">';
print '</fieldset>';
print '<br>';
print '<fieldset><legend>'.$langs->trans("ExportOptions").'</legend>';
if (!empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
print '<div class="formelementrow">';
print '<input type="checkbox" name="disable_fk" value="yes" id="checkbox_disable_fk" checked />';
print '<input type="checkbox" name="disable_fk" value="yes" id="checkbox_disable_fk" checked>';
print '<label for="checkbox_disable_fk">'.$langs->trans("CommandsToDisableForeignKeysForImport").' '.img_info($langs->trans('CommandsToDisableForeignKeysForImportWarning')).'</label>';
print '</div>';
}
@ -261,7 +269,7 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '<br><br>';
print '<div class="formelementrow">';
print '<input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" checked="checked" />';
print '<input type="checkbox" name="use_transaction" value="yes" id="checkbox_use_transaction" checked="checked">';
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
print '</div>';
@ -340,16 +348,19 @@ if (in_array($type, array('mysql', 'mysqli'))) {
print '</fieldset>';
print '</fieldset>';
// Export mysql bin
print "<!-- Fieldset mysql_nobin -->\n";
print '<fieldset id="mysql_nobin_options">';
print '<legend>'.$langs->trans("MySqlExportParameters").'</legend>';
print '<fieldset>';
print '<legend>'.$langs->trans("ExportOptions").'</legend>';
print '<div class="formelementrow">';
print '<input type="checkbox" name="nobin_use_transaction" value="yes" id="checkbox_use_transaction" />';
print '<label for="checkbox_use_transaction">'.$langs->trans("UseTransactionnalMode").'</label>';
print '</div>';
if (!empty($conf->global->MYSQL_OLD_OPTION_DISABLE_FK)) {
print '<div class="formelementrow">';
print '<input type="checkbox" name="nobin_disable_fk" value="yes" id="checkbox_disable_fk" checked />';
@ -391,16 +402,18 @@ if (in_array($type, array('mysql', 'mysqli'))) {
if (in_array($type, array('pgsql'))) {
print "<!-- Fieldset pg_dump -->\n";
print '<fieldset id="postgresql_options"><legend>'.$langs->trans("PostgreSqlExportParameters").'</legend>';
print '<fieldset id="postgresql_options">';
print '<div class="formelementrow">'.$langs->trans("FullPathToPostgreSQLdumpCommand");
print '<fieldset class="formelementrow"><legend>'.$langs->trans("FullPathToPostgreSQLdumpCommand").'</legend>';
if (empty($conf->global->SYSTEMTOOLS_POSTGRESQLDUMP)) {
$fullpathofpgdump = $db->getPathOfDump();
} else {
$fullpathofpgdump = $conf->global->SYSTEMTOOLS_POSTGRESQLDUMP;
}
print '<br>';
print '<input type="text" name="postgresqldump" style="width: 80%" value="'.$fullpathofpgdump.'" /></div>';
print '<input type="text" name="postgresqldump" style="width: 80%" value="'.$fullpathofpgdump.'" />';
print '</fieldset>';
print '<br>';
print '<fieldset>';
@ -446,7 +459,7 @@ print '</table>';
print '<!--<fieldset>';
print '<legend>'.$langs->trans("Destination").'</legend> -->';
print '<br>';
print '<label for="filename_template" class="line-height-large">'.$langs->trans("FileNameToGenerate").'</label>';
print '<label for="filename_template" class="line-height-large opacitymedium">'.$langs->trans("FileNameToGenerate").'</label>';
print '<br>';
$prefix = 'dump';
$ext = '.sql';
@ -614,7 +627,7 @@ print '<div id="backupfilesleft" class="fichehalfleft">';
print load_fiche_titre($title);
print '<label for="zipfilename_template" class="line-height-large paddingbottom">'.$langs->trans("FileNameToGenerate").'</label><br>';
print '<label for="zipfilename_template" class="line-height-large paddingbottom opacitymedium">'.$langs->trans("FileNameToGenerate").'</label><br>';
$prefix = 'documents';
$ext = 'zip';
$file = $prefix.'_'.$dolibarr_main_db_name.'_'.dol_sanitizeFileName(DOL_VERSION).'_'.dol_print_date(dol_now('gmt'), "dayhourlogsmall", 'tzuser');

View File

@ -461,7 +461,7 @@ class Documents extends DolibarrApi
} elseif ($modulepart == 'knowledgemanagement') {
require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/class/knowledgerecord.class.php';
if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read && !DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read') && !DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
throw new RestException(401);
}

View File

@ -116,6 +116,11 @@ if ($action == 'builddoc') {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BarcodeValue")), null, 'errors');
$error++;
}
$MAXLENGTH = 51200; // Limit set to 50Ko
if (dol_strlen($forbarcode) > $MAXLENGTH) { // barcode value
setEventMessages($langs->trans("ErrorFieldTooLong", $langs->transnoentitiesnoconv("BarcodeValue")).' ('.$langs->trans("RequireXStringMax", $MAXLENGTH).')', null, 'errors');
$error++;
}
if (empty($fk_barcode_type)) { // barcode type = barcode encoding
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BarcodeType")), null, 'errors');
$error++;

View File

@ -4,7 +4,7 @@ LOG INALTERABLE
## Fonctionnalité
Ce module trace, en temps réel, certains évènements métiers dans une log inaltérable (que vous ne pouvez pas modifier une fois enregistrés) de type blockchain.
Ce module est requis pour la compatibilité avec les exigences légales de certains pays (comme la France avec la loi Fincance 2016 - Norme NF535).
Ce module est requis pour la compatibilité avec les exigences légales de certains pays (comme la France avec la loi Finance 2016 - Norme NF525).
**Les évènements tracés de manière inaltérables sont:**

View File

@ -4,7 +4,7 @@ BLOCKED LOG
## Feature
This module tracks, in real time, some events into a non reversible log (that you can't modify once recorded) into a block chain.
This module provides compatibility with requirements of laws of some countries (like France with the law Fincance 2016 - Norme NF535).
This module provides compatibility with requirements of laws of some countries (like France with the law Finance 2016 - Norme NF525).
**The tracked events are:**

View File

@ -218,6 +218,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
print '<td class="linecolstock right">'.$form->textwithpicto($langs->trans("PhysicalStock"), $text_stock_options, 1).'</td>';
print '<td class="linecoltheoricalstock right">'.$form->textwithpicto($langs->trans("VirtualStock"), $langs->trans("VirtualStockDesc")).'</td>';
print '</tr>';
print '</thead>';
print '<tbody>';
if (!empty($TChildBom)) {
if ($action == 'treeview') {
foreach ($TChildBom as $fk_bom => $TProduct) {
@ -266,7 +269,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
}
}
print '</thead>';
print '</tbody>';
print '</table>';

View File

@ -301,6 +301,16 @@ if ($resql) {
$sub_bom->calculateCosts();
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom->total_cost * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
$total_cost+= $sub_bom->total_cost * $sub_bom_line->qty * $line->qty;
} elseif ($sub_bom_product->type == Product::TYPE_SERVICE && isModEnabled('workstation') && !empty($sub_bom_product->fk_default_workstation)) {
//Convert qty to hour
$unit = measuringUnitString($sub_bom_line->fk_unit, '', '', 1);
$qty = convertDurationtoHour($sub_bom_line->qty, $unit);
$workstation = new Workstation($this->db);
$res = $workstation->fetch($sub_bom_product->fk_default_workstation);
if ($res > 0) $sub_bom_line->total_cost = price2num($qty * ($workstation->thm_operator_estimated + $workstation->thm_machine_estimated), 'MT');
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom_line->total_cost, 'MT')).'</span></td>';
$this->total_cost += $line->total_cost;
} elseif ($sub_bom_product->cost_price > 0) {
print '<td class="linecolcost nowrap right" id="sub_bom_cost_'.$sub_bom_line->id.'"><span class="amount">'.price(price2num($sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty, 'MT')).'</span></td>';
$total_cost+= $sub_bom_product->cost_price * $sub_bom_line->qty * $line->qty;

View File

@ -323,7 +323,7 @@ class Categories extends DolibarrApi
throw new RestException(401);
} elseif ($type == Categorie::TYPE_PROJECT && !DolibarrApiAccess::$user->rights->projet->lire) {
throw new RestException(401);
} elseif ($type == Categorie::TYPE_KNOWLEDGEMANAGEMENT && !DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
} elseif ($type == Categorie::TYPE_KNOWLEDGEMANAGEMENT && !DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
throw new RestException(401);
}

View File

@ -11,6 +11,7 @@
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2023 Benjamin Falière <benjamin.faliere@altairis.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
@ -1443,7 +1444,7 @@ class Categorie extends CommonObject
$ways = array();
$parents = $this->get_meres();
if (!empty($parents)) {
if (is_array($parents)) {
foreach ($parents as $parent) {
$allways = $parent->get_all_ways();
foreach ($allways as $way) {

View File

@ -1005,7 +1005,7 @@ if ($type == Categorie::TYPE_PROJECT) {
print '<input type="hidden" name="action" value="addintocategory">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre"><td>';
print $langs->trans("AddProjectIntoCategory").' &nbsp;';
print $langs->trans("AddObjectIntoCategory").' &nbsp;';
$form->selectProjects('', 'elemid');
print '<input type="submit" class="button buttongen" value="'.$langs->trans("ClassifyInCategory").'"></td>';
print '</tr>';

View File

@ -1580,6 +1580,7 @@ class ActionComm extends CommonObject
$langs->load('agenda');
$datas = [];
$nofetch = empty($params['nofetch']) ? false : true;
// Set label of type
$labeltype = '';
if ($this->type_code) {
@ -1631,6 +1632,12 @@ class ActionComm extends CommonObject
$datas['note'] .= (dol_textishtml($texttoshow) ? str_replace(array("\r", "\n"), "", $texttoshow) : str_replace(array("\r", "\n"), '<br>', $texttoshow));
$datas['note'] .= '</div>';
}
// show categories for this record only in ajax to not overload lists
if (isModEnabled('categorie') && !$nofetch) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$form = new Form($this->db);
$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACTIONCOMM, 1);
}
return $datas;
}
@ -1734,6 +1741,7 @@ class ActionComm extends CommonObject
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
'nofetch' => 1,
];
$classfortooltip = 'classforajaxtooltip';
$dataparams = ' data-params='.json_encode($params);

View File

@ -736,9 +736,9 @@ if ($action == 'create') {
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("MailTitle").'</td><td><input class="flat minwidth300" name="title" value="'.dol_escape_htmltag(GETPOST('title')).'" autofocus="autofocus"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.$conf->global->MAILING_EMAIL_FROM.'"></td></tr>';
print '<tr><td class="fieldrequired">'.$langs->trans("MailFrom").'</td><td><input class="flat minwidth200" name="from" value="'.getDolGlobalString('MAILING_EMAIL_FROM').'"></td></tr>';
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(!empty($conf->global->MAILING_EMAIL_ERRORSTO) ? $conf->global->MAILING_EMAIL_ERRORSTO : $conf->global->MAIN_MAIL_ERRORS_TO).'"></td></tr>';
print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td><input class="flat minwidth200" name="errorsto" value="'.(getDolGlobalString('MAILING_EMAIL_ERRORSTO', getDolGlobalString('MAIN_MAIL_ERRORS_TO'))).'"></td></tr>';
// Other attributes
$parameters = array();

View File

@ -175,7 +175,7 @@ $arrayfields = array(
'balance'=>array('label'=>$langs->trans("Balance"), 'checked'=>1, 'position'=>120),
'b.num_releve'=>array('label'=>$langs->trans("AccountStatement"), 'checked'=>1, 'position'=>130),
'b.conciliated'=>array('label'=>$langs->trans("BankLineReconciled"), 'enabled'=> $object->rappro, 'checked'=>($action == 'reconcile' ? 1 : 0), 'position'=>140),
'b.fk_bordereau'=>array('label'=>$langs->trans("ChequeReceipt"), 'checked'=>0, 'position'=>150),
'b.fk_bordereau'=>array('label'=>$langs->trans("ChequeNumber"), 'checked'=>0, 'position'=>150),
);
// Extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';

View File

@ -1417,6 +1417,7 @@ class Account extends CommonObject
$datas = [];
$nofetch = empty($params['nofetch']) ? false : true;
$pictos = img_picto('', $this->picto).' <u class="paddingrightnow">'.$langs->trans("BankAccount").'</u>';
if (isset($this->status)) {
$pictos .= ' '.$this->getLibStatut(5);
@ -1434,6 +1435,12 @@ class Account extends CommonObject
$datas['accountaccounting'] = '<br><b>'.$langs->trans('AccountAccounting').':</b> '.length_accountg($this->account_number);
$datas['accountancyjournal'] = '<br><b>'.$langs->trans('AccountancyJournal').':</b> '.$this->accountancy_journal;
}
// show categories for this record only in ajax to not overload lists
if (isModEnabled('categorie') && !$nofetch) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$form = new Form($this->db);
$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_ACCOUNT, 1);
}
return $datas;
}
@ -1454,38 +1461,20 @@ class Account extends CommonObject
include_once DOL_DOCUMENT_ROOT.'/core/lib/bank.lib.php';
$result = '';
$label = img_picto('', $this->picto).' <u class="paddingrightnow">'.$langs->trans("BankAccount").'</u>';
if (isset($this->status)) {
$label .= ' '.$this->getLibStatut(5);
}
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
$label .= '<br><b>'.$langs->trans('AccountNumber').':</b> '.$this->number;
$label .= '<br><b>'.$langs->trans('IBAN').':</b> '.getIbanHumanReadable($this);
$label .= '<br><b>'.$langs->trans('BIC').':</b> '.$this->bic;
$label .= '<br><b>'.$langs->trans("AccountCurrency").':</b> '.$this->currency_code;
if (empty($user->rights->banque->lire) || !empty($user->socid)) {
$option = 'nolink';
}
if (isModEnabled('accounting')) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
$langs->load("accountancy");
$label .= '<br><b>'.$langs->trans('AccountAccounting').':</b> '.length_accountg($this->account_number);
$label .= '<br><b>'.$langs->trans('AccountancyJournal').':</b> '.$this->accountancy_journal;
}
$classfortooltip = 'classfortooltip';
$dataparams = '';
$params = [
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
'nofetch' => 1,
];
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$params = [
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
];
$classfortooltip = 'classforajaxtooltip';
$dataparams = ' data-params='.json_encode($params);
$label = $langs->trans('Loading');
}
$label = implode($this->getTooltipContentArray($params));
$linkclose = '"'.$dataparams.' title="'.dol_escape_htmltag($label, 1).'" class="'.$classfortooltip.'">';
$url = DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id;
@ -1871,7 +1860,7 @@ class Account extends CommonObject
/**
* Class to manage bank transaction lines
*/
class AccountLine extends CommonObject
class AccountLine extends CommonObjectLine
{
/**
* @var string Error code (or message)

View File

@ -327,7 +327,7 @@ if ($result) {
print dol_get_fiche_head($head, 'bankline', $langs->trans('LineRecord'), 0, 'accountline', 0);
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$linkback = '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?restore_lastsearch_values=1'.(GETPOST('account', 'int', 1) ? '&id='.GETPOST('account', 'int', 1) : '').'">'.$langs->trans("BackToList").'</a>';
dol_banner_tab($bankline, 'rowid', $linkback);

View File

@ -119,9 +119,9 @@ $usercanreopen = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights
$usercanunvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($usercancreate)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->facture->invoice_advance->unvalidate)));
$usercanproductignorepricemin = ((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS));
$usercancreatemargin = $user->rights->margins->creer;
$usercanreadallmargin = $user->rights->margins->liretous;
$usercancreatewithdrarequest = $user->rights->prelevement->bons->creer;
$usercancreatemargin = $user->hasRight("margins", "creer");
$usercanreadallmargin = $user->hasRight("margins", "liretous");
$usercancreatewithdrarequest = $user->hasRight("prelevement", "bons", "creer");
$now = dol_now();

View File

@ -80,8 +80,6 @@ if (isModEnabled('margin')) {
}
// General $Variables
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
$id = (GETPOST('id', 'int') ? GETPOST('id', 'int') : GETPOST('facid', 'int')); // For backward compatibility
$ref = GETPOST('ref', 'alpha');
$socid = GETPOST('socid', 'int');
@ -100,6 +98,7 @@ $fac_rec = GETPOST('fac_rec', 'int');
$facid = GETPOST('facid', 'int');
$ref_client = GETPOST('ref_client', 'int');
$rank = (GETPOST('rank', 'int') > 0) ? GETPOST('rank', 'int') : -1;
$projectid = (GETPOST('projectid', 'int') ? GETPOST('projectid', 'int') : 0);
// PDF
$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
@ -2153,7 +2152,7 @@ if (empty($reshook)) {
$pu_ht = $datapriceofproduct['pu_ht'];
$pu_ttc = $datapriceofproduct['pu_ttc'];
$price_min = $datapriceofproduct['price_min'];
$price_min_ttc = $datapriceofproduct['price_min_ttc'];
$price_min_ttc = (isset($datapriceofproduct['price_min_ttc'])) ? $datapriceofproduct['price_min_ttc'] : null;
$price_base_type = $datapriceofproduct['price_base_type'];
//$tva_tx = $datapriceofproduct['tva_tx'];
@ -3118,7 +3117,11 @@ if ($action == 'create') {
}
// when bank account is empty (means not override by payment mode form a other object, like third-party), try to use default value
$fk_account = GETPOSTISSET("fk_account") ? GETPOST("fk_account", 'int') : $fk_account;
if ($socid > 0 && $fk_account) { // A company has already been set and it has a default fk_account
$fk_account = GETPOSTISSET('fk_account') ? GETPOST("fk_account", 'int') : $fk_account; // The GETPOST is used only if form was posted to avoid to take default value, because in such case, the default must be the one of the company
} else { // No company forced
$fk_account = GETPOST("fk_account", 'int');
}
if (!empty($soc->id)) {
$absolute_discount = $soc->getAvailableDiscounts();
@ -3145,7 +3148,7 @@ if ($action == 'create') {
print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST" id="formtocreate" name="formtocreate">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="action" id="formtocreateaction" value="add">';
if ($soc->id > 0) {
print '<input type="hidden" name="socid" value="'.$soc->id.'">'."\n";
}
@ -3211,11 +3214,10 @@ if ($action == 'create') {
$(\'input[name="force_fk_account"]\').val(\'1\');
$("#formtocreate").submit(); */
// For company change, we must reuse data of comany, not input already done, so we call a GET with action=create, not a POST submit.
console.log("We have changed the company - Reload page");
var socid = $(this).val();
var fac_rec = $(\'#fac_rec\').val();
window.location.href = "'.$_SERVER["PHP_SELF"].'?action=create&socid="+socid+"&fac_rec="+fac_rec;
// For company change, we must submit page with action=create instead of action=add
console.log("We have changed the company - Resubmit page");
jQuery("#formtocreateaction").val("create");
jQuery("#formtocreate").submit();
});
});
</script>';
@ -4322,7 +4324,7 @@ if ($action == 'create') {
array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company($object->socid, 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', 1)),
array('type' => 'date', 'name' => 'newdate', 'label' => $langs->trans("Date"), 'value' => dol_now())
);
// Ask confirmatio to clone
// Request confirmation to clone
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?facid='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1, 250);
}
@ -5468,6 +5470,7 @@ if ($action == 'create') {
if (!empty($conf->global->INVOICE_CAN_BE_EDITED_EVEN_IF_PAYMENT_DONE) || ($resteapayer == price2num($object->total_ttc, 'MT', 1) && empty($object->paye))) {
if (!$objectidnext && $object->is_last_in_cycle()) {
if ($usercanunvalidate) {
$params['attr']['title'] = '';
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=modif&token='.newToken(), '', true, $params);
} else {
$params['attr']['title'] = $langs->trans('NotEnoughPermissions');
@ -5498,6 +5501,7 @@ if ($action == 'create') {
&& ($object->statut == Facture::STATUS_CLOSED || $object->statut == Facture::STATUS_ABANDONED || ($object->statut == 1 && $object->paye == 1)) // Condition ($object->statut == 1 && $object->paye == 1) should not happened but can be found due to corrupted data
&& ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || $usercanreopen)) { // A paid invoice (partially or completely)
if ($object->close_code != 'replaced' || (!$objectidnext)) { // Not replaced by another invoice or replaced but the replacement invoice has been deleted
$params['attr']['title'] = '';
print dolGetButtonAction($langs->trans('ReOpen'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=reopen&token='.newToken(), '', true, $params);
} else {
$params['attr']['title'] = $langs->trans("DisabledBecauseReplacedInvoice");
@ -5519,6 +5523,7 @@ if ($action == 'create') {
// Validate
if ($object->statut == Facture::STATUS_DRAFT && count($object->lines) > 0 && ((($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA || $object->type == Facture::TYPE_SITUATION) && (!empty($conf->global->FACTURE_ENABLE_NEGATIVE) || $object->total_ttc >= 0)) || ($object->type == Facture::TYPE_CREDIT_NOTE && $object->total_ttc <= 0))) {
if ($usercanvalidate) {
$params['attr']['title'] = '';
print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=valid&token='.newToken(), '', true, $params);
}
}
@ -5530,8 +5535,10 @@ if ($action == 'create') {
print '<span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseReplacedInvoice").'">'.$langs->trans('SendMail').'</span>';
} else {
if ($usercansend) {
$params['attr']['title'] = '';
print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=presend&mode=init#formmailbeforetitle', '', true, $params);
} else {
$params['attr']['title'] = '';
print dolGetButtonAction('', $langs->trans('SendMail'), 'default', '#', '', false, $params);
}
}
@ -5574,6 +5581,7 @@ if ($action == 'create') {
} else {
// Sometimes we can receive more, so we accept to enter more and will offer a button to convert into discount (but it is not a credit note, just a prepayment done)
//print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/paiement.php?facid='.$object->id.'&amp;action=create&amp;accountid='.$object->fk_account.'">'.$langs->trans('DoPayment').'</a>';
$params['attr']['title'] = '';
print dolGetButtonAction($langs->trans('DoPayment'), '', 'default', DOL_URL_ROOT.'/compta/paiement.php?facid='.$object->id.'&amp;action=create&amp;accountid='.$object->fk_account, '', true, $params);
}
}
@ -5626,6 +5634,7 @@ if ($action == 'create') {
$params['attr']['title'] = $langs->trans('AmountPaidMustMatchAmountOfDownPayment');
print dolGetButtonAction($langs->trans('ClassifyPaid'), '', 'default', '#', '', false, $params);
} else {
$params['attr']['title'] = '';
print dolGetButtonAction($langs->trans('ClassifyPaid'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&amp;action=paid', '', true, $params);
}
}
@ -5671,12 +5680,14 @@ if ($action == 'create') {
// Clone
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $usercancreate) {
$params['attr']['title'] = '';
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&amp;action=clone&amp;object=invoice', '', true, $params);
}
// Clone as predefined / Create template
if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->statut == 0 && $usercancreate) {
if (!$objectidnext && count($object->lines) > 0) {
$params['attr']['title'] = '';
print dolGetButtonAction($langs->trans('ChangeIntoRepeatableInvoice'), '', 'default', DOL_URL_ROOT.'/compta/facture/card-rec.php?facid='.$object->id.'&amp;action=create', '', true, $params);
}
}
@ -5710,11 +5721,6 @@ if ($action == 'create') {
// Delete
$isErasable = $object->is_erasable();
$params = array(
'attr' => array(
'class' => 'classfortooltip'
)
);
if ($usercandelete || ($usercancreate && $isErasable == 1)) { // isErasable = 1 means draft with temporary ref (draft can always be deleted with no need of permissions)
$enableDelete = false;
$deleteHref = '#';
@ -5735,8 +5741,10 @@ if ($action == 'create') {
$deleteHref = $_SERVER["PHP_SELF"].'?facid='.$object->id.'&action=delete&token='.newToken();
$enableDelete = true;
}
$params['attr']['title'] = '';
print dolGetButtonAction($htmltooltip, $langs->trans('Delete'), 'delete', $deleteHref, '', $enableDelete, $params);
} else {
$params['attr']['title'] = '';
print dolGetButtonAction($langs->trans('Delete'), $langs->trans('Delete'), 'delete', '#', '', false);
}
}

View File

@ -778,7 +778,7 @@ class Invoices extends DolibarrApi
*
* @url POST {id}/contacts
*
* @return array
* @return object
*
* @throws RestException 304
* @throws RestException 401

View File

@ -1261,7 +1261,7 @@ class Facture extends CommonInvoice
$object->ref_client = '';
$object->close_code = '';
$object->close_note = '';
if ($conf->global->MAIN_DONT_KEEP_NOTE_ON_CLONING == 1) {
if (getDolGlobalInt('MAIN_DONT_KEEP_NOTE_ON_CLONING') == 1) {
$object->note_private = '';
$object->note_public = '';
}

File diff suppressed because it is too large Load Diff

View File

@ -1793,11 +1793,11 @@ if ($resql) {
$with_margin_info = false;
if (isModEnabled('margin') && (
!empty($arrayfields['total_pa']['checked'])
|| !empty($arrayfields['total_margin']['checked'])
|| !empty($arrayfields['total_margin_rate']['checked'])
|| !empty($arrayfields['total_mark_rate']['checked'])
)
!empty($arrayfields['total_pa']['checked'])
|| !empty($arrayfields['total_margin']['checked'])
|| !empty($arrayfields['total_margin_rate']['checked'])
|| !empty($arrayfields['total_mark_rate']['checked'])
)
) {
$with_margin_info = true;
}
@ -1871,11 +1871,14 @@ if ($resql) {
$paiement = $facturestatic->getSommePaiement();
$totalcreditnotes = $facturestatic->getSumCreditNotesUsed();
$totaldeposits = $facturestatic->getSumDepositsUsed();
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = price2num($facturestatic->total_ttc - $totalpay);
$multicurrency_paiement = $facturestatic->getSommePaiement(1);
$multicurrency_totalcreditnotes = $facturestatic->getSumCreditNotesUsed(1);
$multicurrency_totaldeposits = $facturestatic->getSumDepositsUsed(1);
$totalpay = $paiement + $totalcreditnotes + $totaldeposits;
$remaintopay = price2num($facturestatic->total_ttc - $totalpay);
$multicurrency_totalpay = $multicurrency_paiement + $multicurrency_totalcreditnotes + $multicurrency_totaldeposits;
$multicurrency_remaintopay = price2num($facturestatic->multicurrency_total_ttc - $multicurrency_totalpay);
@ -1929,7 +1932,6 @@ if ($resql) {
}
print '>';
// Action column
if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
print '<td class="nowrap" align="center">';
@ -2550,12 +2552,14 @@ if ($resql) {
print '<input id="cb'.$obj->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
print '</td>';
if (!$i) {
$totalarray['nbfield']++;
}
}
if (!$i) {
$totalarray['nbfield']++;
}
print "</tr>\n";
}
$i++;
}

View File

@ -163,6 +163,10 @@ if ($objecttype == 'facture' || $objecttype == 'invoice') {
$classpath = 'opensurvey/class';
$module = 'opensurvey';
$myobject = 'opensurveysondage';
} elseif ($objecttype == 'knowledgerecord') {
$classpath = 'knowledgemanagement/class';
$module = 'knowledgemanagement';
$myobject = 'knowledgerecord';
}
// Generic case for $classfile and $classname

View File

@ -48,7 +48,6 @@ $element = GETPOST('element', 'alpha');
$upload_handler = new FileUpload(null, $fk_element, $element);
/*
* View
*/

View File

@ -58,7 +58,6 @@ if (!isset($usedbyinclude) || empty($usedbyinclude)) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/json.lib.php';
//global $hookmanager;
$hookmanager->initHooks(array('searchform'));
$search_boxvalue = GETPOST('q', 'restricthtml');

View File

@ -0,0 +1,217 @@
<?php
/*
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/boxes/box_last_knowledgerecord.php
* \ingroup knowledgerecord
* \brief This box shows latest created knowledgerecords
*/
require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
/**
* Class to manage the box
*/
class box_last_knowledgerecord extends ModeleBoxes
{
/**
* @var string boxcode
*/
public $boxcode = "box_last_knowledgerecord";
/**
* @var string box img
*/
public $boximg = "knowledgemanagement";
/**
* @var string boc label
*/
public $boxlabel;
/**
* @var array box dependancies
*/
public $depends = array("knowledgemanagement");
/**
* @var DoliDB Database handler.
*/
public $db;
/**
* @var string param
*/
public $param;
/**
* @var array box info heads
*/
public $info_box_head = array();
/**
* @var array box info content
*/
public $info_box_contents = array();
/**
* Constructor
* @param DoliDB $db Database handler
* @param string $param More parameters
*/
public function __construct($db, $param = '')
{
global $langs;
$langs->load("boxes", "languages");
$this->db = $db;
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastKnowledgerecord");
}
/**
* Load data into info_box_contents array to show array later.
*
* @param int $max Maximum number of records to load
* @return void
*/
public function loadBox($max = 5)
{
global $user, $langs;
$this->max = $max;
require_once DOL_DOCUMENT_ROOT."/knowledgemanagement/class/knowledgerecord.class.php";
$text = $langs->trans("BoxLastKnowledgerecordDescription", $max);
$this->info_box_head = array(
'text' => $text,
'limit' => dol_strlen($text),
);
$this->info_box_contents[0][0] = array(
'td' => 'class="left"',
'text' => $langs->trans("BoxLastKnowledgerecordContent"),
);
if ($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
$sql = 'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status';
$sql .= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord as k";
$sql .= " WHERE k.entity IN (".getEntity('knowledgemanagement').")";
if ($user->socid) {
$sql .= " AND k.fk_soc= ".((int) $user->socid);
}
$sql.= " AND k.status > 0";
$sql .= " ORDER BY k.date_creation DESC, k.rowid DESC ";
$sql .= $this->db->plimit($max, 0);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$objp = $this->db->fetch_object($resql);
$datec = $this->db->jdate($objp->date_creation);
$knowledgerecord = new KnowledgeRecord($this->db);
$knowledgerecord->id = $objp->id;
$knowledgerecord->date_creation = $objp->date_creation;
$knowledgerecord->ref = $objp->ref;
$knowledgerecord->status = $objp->status;
$knowledgerecord->question = $objp->question;
$r = 0;
// Ticket
$this->info_box_contents[$i][$r] = array(
'td' => 'class="nowraponall"',
'text' => $knowledgerecord->getNomUrl(1),
'asis' => 1
);
$r++;
// Question
$this->info_box_contents[$i][$r] = array(
'td' => 'class="tdoverflowmax200"',
'text' => '<span title="'.dol_escape_htmltag($objp->question).'">'.dol_escape_htmltag($objp->question).'</span>',
'url' => DOL_URL_ROOT."/knowledgemanagement/knowledgerecord_card.php?id=".urlencode($objp->id),
);
$r++;
// Language
$labellang = ($objp->lang ? $langs->trans('Language_'.$objp->lang) : '');
$this->info_box_contents[$i][$r] = array(
'td' => 'class="tdoverflowmax100"',
'text' => picto_from_langcode($objp->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang,
'asis' => 1,
);
$r++;
// Date creation
$this->info_box_contents[$i][$r] = array(
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateCreation").': '.dol_print_date($datec, 'dayhour', 'tzuserrel')).'"',
'text' => dol_print_date($datec, 'dayhour', 'tzuserrel'),
);
$r++;
// Statut
$this->info_box_contents[$i][$r] = array(
'td' => 'class="right nowraponall"',
'text' => $knowledgerecord->getLibStatut(3),
);
$r++;
$i++;
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array(
'td' => '',
'text' => '<span class="opacitymedium">'.$langs->trans("BoxLastTicketNoRecordedTickets").'</span>',
);
}
} else {
dol_print_error($this->db);
}
} else {
$this->info_box_contents[0][0] = array(
'td' => '',
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>',
);
}
}
/**
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return string
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -0,0 +1,217 @@
<?php
/*
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
* Copyright (C) 2018-2023 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/boxes/box_last_modified_knowledgerecord.php
* \ingroup knowledgerecord
* \brief This box shows latest created knowledgerecords
*/
require_once DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php";
/**
* Class to manage the box
*/
class box_last_modified_knowledgerecord extends ModeleBoxes
{
/**
* @var string boxcode
*/
public $boxcode = "box_last_modified_knowledgerecord";
/**
* @var string box img
*/
public $boximg = "knowledgemanagement";
/**
* @var string boc label
*/
public $boxlabel;
/**
* @var array box dependancies
*/
public $depends = array("knowledgemanagement");
/**
* @var DoliDB Database handler.
*/
public $db;
/**
* @var string param
*/
public $param;
/**
* @var array box info heads
*/
public $info_box_head = array();
/**
* @var array box info content
*/
public $info_box_contents = array();
/**
* Constructor
* @param DoliDB $db Database handler
* @param string $param More parameters
*/
public function __construct($db, $param = '')
{
global $langs;
$langs->load("boxes", "knowledgemanagement", "languages");
$this->db = $db;
$this->boxlabel = $langs->transnoentitiesnoconv("BoxLastModifiedKnowledgerecord");
}
/**
* Load data into info_box_contents array to show array later.
*
* @param int $max Maximum number of records to load
* @return void
*/
public function loadBox($max = 5)
{
global $user, $langs;
$this->max = $max;
require_once DOL_DOCUMENT_ROOT."/knowledgemanagement/class/knowledgerecord.class.php";
$text = $langs->trans("BoxLastModifiedKnowledgerecordDescription", $max);
$this->info_box_head = array(
'text' => $text,
'limit' => dol_strlen($text),
);
$this->info_box_contents[0][0] = array(
'td' => 'class="left"',
'text' => $langs->trans("BoxLastKnowledgerecordContent"),
);
if ($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
$sql = 'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status';
$sql .= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord as k";
$sql .= " WHERE k.entity IN (".getEntity('knowledgemanagement').")";
if ($user->socid) {
$sql .= " AND k.fk_soc= ".((int) $user->socid);
}
$sql.= " AND k.status > 0";
$sql .= " ORDER BY k.tms DESC, k.rowid DESC ";
$sql .= $this->db->plimit($max, 0);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
while ($i < $num) {
$objp = $this->db->fetch_object($resql);
$datec = $this->db->jdate($objp->date_creation);
$knowledgerecord = new KnowledgeRecord($this->db);
$knowledgerecord->id = $objp->id;
$knowledgerecord->date_creation = $objp->date_creation;
$knowledgerecord->ref = $objp->ref;
$knowledgerecord->status = $objp->status;
$knowledgerecord->question = $objp->question;
$r = 0;
// Ticket
$this->info_box_contents[$i][$r] = array(
'td' => 'class="nowraponall"',
'text' => $knowledgerecord->getNomUrl(1),
'asis' => 1
);
$r++;
// Question
$this->info_box_contents[$i][$r] = array(
'td' => 'class="tdoverflowmax200"',
'text' => '<span title="'.dol_escape_htmltag($objp->question).'">'.dol_escape_htmltag($objp->question).'</span>',
'url' => DOL_URL_ROOT."/knowledgemanagement/knowledgerecord_card.php?id=".urlencode($objp->id),
);
$r++;
// Language
$labellang = ($objp->lang ? $langs->trans('Language_'.$objp->lang) : '');
$this->info_box_contents[$i][$r] = array(
'td' => 'class="tdoverflowmax100"',
'text' => picto_from_langcode($objp->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang,
'asis' => 1,
);
$r++;
// Date creation
$this->info_box_contents[$i][$r] = array(
'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateCreation").': '.dol_print_date($datec, 'dayhour', 'tzuserrel')).'"',
'text' => dol_print_date($datec, 'dayhour', 'tzuserrel'),
);
$r++;
// Statut
$this->info_box_contents[$i][$r] = array(
'td' => 'class="right nowraponall"',
'text' => $knowledgerecord->getLibStatut(3),
);
$r++;
$i++;
}
if ($num == 0) {
$this->info_box_contents[$i][0] = array(
'td' => '',
'text' => '<span class="opacitymedium">'.$langs->trans("BoxLastTicketNoRecordedTickets").'</span>',
);
}
} else {
dol_print_error($this->db);
}
} else {
$this->info_box_contents[0][0] = array(
'td' => '',
'text' => '<span class="opacitymedium">'.$langs->trans("ReadPermissionNotAllowed").'</span>',
);
}
}
/**
* Method to show box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
* @param int $nooutput No print, only return string
* @return string
*/
public function showBox($head = null, $contents = null, $nooutput = 0)
{
return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
}
}

View File

@ -191,7 +191,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes
if ($num == 0) {
$this->info_box_contents[$line][0] = array(
'td' => 'class="center"',
'td' => 'class="left" colspan="4"',
'text' => $langs->trans("NoRecordedMembers"),
);
} else {

View File

@ -962,6 +962,8 @@ class CMailFile
}
if ($res) {
dol_syslog("CMailFile::sendfile: sendMsg, HOST=".$server.", PORT=".$conf->global->$keyforsmtpport, LOG_DEBUG);
if (!empty($conf->global->MAIN_MAIL_DEBUG)) {
$this->smtps->setDebug(true);
}
@ -1096,7 +1098,11 @@ class CMailFile
//$this->logger = new Swift_Plugins_Loggers_EchoLogger();
$this->mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($this->logger));
}
dol_syslog("CMailFile::sendfile: mailer->send, HOST=".$server.", PORT=".$conf->global->$keyforsmtpport, LOG_DEBUG);
// send mail
$failedRecipients = array();
try {
$result = $this->mailer->send($this->message, $failedRecipients);
} catch (Exception $e) {

View File

@ -81,63 +81,38 @@ class AntiVir
}
$fullcommand = $this->getCliCommand($file);
//$fullcommand="/usr/bin/clamdscan --fdpass '/tmp/phpuxoAEo'"
//$fullcommand='"c:\Program Files (x86)\ClamWin\bin\clamscan.exe" --database="C:\Program Files (x86)\ClamWin\lib" "c:\temp\aaa.txt"';
$fullcommand .= ' 2>&1'; // This is to get error output
//var_dump($fullcommand);
$output = array();
$return_var = 0;
$safemode = ini_get("safe_mode");
// Create a clean fullcommand
dol_syslog("AntiVir::dol_avscan_file Run command=".$fullcommand." with safe_mode ".($safemode ? "on" : "off"));
// Run CLI command. If run of Windows, you can get return with echo %ERRORLEVEL%
$lastline = exec($fullcommand, $output, $return_var);
// Run CLI command.
include_once DOL_DOCUMENT_ROOT.'/core/class/utils.class.php';
$utils = new Utils($this->db);
$outputfile = $conf->user->dir_temp.'/antivir.tmp';
$result = $utils->executeCLI($fullcommand, $outputfile);
$return_var = $result['result'];
$output = $result['output'];
$errorstring = $result['error'];
if (is_null($output)) {
$output = array();
}
//print "x".$lastline." - ".join(',',$output)." - ".$return_var."y";exit;
/*
$outputfile=$conf->admin->dir_temp.'/dol_avscan_file.out.'.session_id();
$handle = fopen($outputfile, 'w');
if ($handle)
{
$handlein = popen($fullcommand, 'r');
while (!feof($handlein))
{
$read = fgets($handlein);
fwrite($handle,$read);
}
pclose($handlein);
$errormsg = fgets($handle,2048);
$this->output=$errormsg;
fclose($handle);
if (!empty($conf->global->MAIN_UMASK))
@chmod($outputfile, octdec($conf->global->MAIN_UMASK));
}
else
{
$langs->load("errors");
dol_syslog("Failed to open file ".$outputfile,LOG_ERR);
$this->error="ErrorFailedToWriteInDir";
$return=-1;
}
*/
dol_syslog("AntiVir::dol_avscan_file Result return_var=".$return_var." output=".join(',', $output));
dol_syslog("AntiVir::dol_avscan_file Result return_var=".$return_var." output=".$output);
$returncodevirus = 1;
if ($return_var == $returncodevirus) { // Virus found
$this->errors = $output;
$this->errors = array($errorstring, $output);
return -99;
}
if ($return_var > 0) { // If other error
$this->errors = $output;
$this->errors = array($errorstring, $output);
return -98;
}
@ -178,10 +153,12 @@ class AntiVir
}
if (preg_match("/\s/", $command)) {
$command = escapeshellarg($command); // Use quotes on command. Using escapeshellcmd fails.
$command = escapeshellarg($command); // Force use of quotes on command. Using escapeshellcmd fails.
}
$ret = $command.' '.$param;
$forbidden_chars_to_replace = array("*", "?", "\"", "<", ">", "|", "[", "]", ";", '°', '$');
$ret = dol_sanitizePathName($command).' '.dol_string_nospecial($param, '_', $forbidden_chars_to_replace);
//$ret=$command.' '.$param.' 2>&1';
//print "xx".$ret."xx";exit;

View File

@ -131,8 +131,8 @@ abstract class CommonInvoice extends CommonObject
* Return amount of payments already done. This must include ONLY the record into the payment table.
* Payments dones using discounts, credit notes, etc are not included.
*
* @param int $multicurrency Return multicurrency_amount instead of amount
* @return float|int Amount of payment already done, <0 and set ->error if KO
* @param int $multicurrency Return multicurrency_amount instead of amount. -1=Return both.
* @return float|int|array Amount of payment already done, <0 and set ->error if KO
*/
public function getSommePaiement($multicurrency = 0)
{
@ -156,7 +156,11 @@ abstract class CommonInvoice extends CommonObject
$this->db->free($resql);
if ($obj) {
if ($multicurrency) {
if ($multicurrency < 0) {
$this->sumpayed = $obj->amount;
$this->sumpayed_multicurrency = $obj->multicurrency_amount;
return array('alreadypaid'=>(float) $obj->amount, 'alreadypaid_multicurrency'=>(float) $obj->multicurrency_amount);
} elseif ($multicurrency) {
$this->sumpayed_multicurrency = $obj->multicurrency_amount;
return (float) $obj->multicurrency_amount;
} else {

View File

@ -911,8 +911,11 @@ abstract class CommonObject
$out .= img_picto($langs->trans("Address"), 'map-marker-alt');
$out .= '</a> ';
}
$out .= dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', ');
$outdone++;
$address = dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', ');
if ($address) {
$out .= $address;
$outdone++;
}
$outdone++;
// List of extra languages
@ -938,6 +941,7 @@ abstract class CommonObject
// If there is extra languages
foreach ($arrayoflangcode as $extralangcode) {
$s = picto_from_langcode($extralangcode, 'class="pictoforlang paddingright"');
// This also call dol_format_address()
$coords = $this->getFullAddress(1, ', ', $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT, $extralangcode);
$htmltext .= $s.dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', ');
}
@ -946,7 +950,8 @@ abstract class CommonObject
}
}
if (!in_array($this->country_code, $countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS) // If MAIN_FORCE_STATE_INTO_ADDRESS is on, state is already returned previously with getFullAddress
// If MAIN_FORCE_STATE_INTO_ADDRESS is on, state is already returned previously with getFullAddress
if (!in_array($this->country_code, $countriesusingstate) && empty($conf->global->MAIN_FORCE_STATE_INTO_ADDRESS)
&& empty($conf->global->SOCIETE_DISABLE_STATE) && $this->state) {
if (!empty($conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT) && $conf->global->MAIN_SHOW_REGION_IN_STATE_SELECT == 1 && $this->region) {
$out .= ($outdone ? ' - ' : '').$this->region.' - '.$this->state;
@ -956,6 +961,10 @@ abstract class CommonObject
$outdone++;
}
if ($outdone) {
$out = '<div class="address inline-block">'.$out.'</div>';
}
if (!empty($this->phone) || !empty($this->phone_pro) || !empty($this->phone_mobile) || !empty($this->phone_perso) || !empty($this->fax) || !empty($this->office_phone) || !empty($this->user_mobile) || !empty($this->office_fax)) {
$out .= ($outdone ? '<br>' : '');
}
@ -1371,12 +1380,13 @@ abstract class CommonObject
*
* @param int $statusoflink Status of links to get (-1=all). Not used.
* @param string $source Source of contact: 'external' or 'thirdparty' (llx_socpeople) or 'internal' (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @param int $list 0:Returned array contains all properties, 1:Return array contains just id
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
* @param int $status Status of user or company
* @param array $arrayoftcids Array with ID of type of contacts. If we provide this, we can make a ec.fk_c_type_contact in ($arrayoftcids) to avoid link on tc table. TODO Not implemented.
* @return array|int Array of contacts, -1 if error
*/
public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1)
public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1, $arrayoftcids = array())
{
// phpcs:enable
global $langs;
@ -1418,7 +1428,7 @@ abstract class CommonObject
$sql .= " AND t.statut = ".((int) $status); // t is llx_socpeople
}
}
$sql .= " AND tc.active=1";
$sql .= " AND tc.active = 1";
if ($statusoflink >= 0) {
$sql .= " AND ec.statut = ".((int) $statusoflink);
}

View File

@ -836,57 +836,57 @@ class Conf
// Avoid strict errors. TODO: Replace xxx->warning_delay with a property ->warning_delay_xxx
if (isset($this->agenda)) {
$this->adherent->subscription = new stdClass();
$this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
$this->adherent->subscription->warning_delay = (isset($this->global->MAIN_DELAY_MEMBERS) ? (int) $this->global->MAIN_DELAY_MEMBERS : 0) * 86400;
}
if (isset($this->agenda)) {
$this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
$this->agenda->warning_delay = (isset($this->global->MAIN_DELAY_ACTIONS_TODO) ? (int) $this->global->MAIN_DELAY_ACTIONS_TODO : 7) * 86400;
}
if (isset($this->projet)) {
$this->projet->warning_delay = (isset($this->global->MAIN_DELAY_PROJECT_TO_CLOSE) ? $this->global->MAIN_DELAY_PROJECT_TO_CLOSE : 7) * 86400;
$this->projet->warning_delay = (isset($this->global->MAIN_DELAY_PROJECT_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROJECT_TO_CLOSE : 7) * 86400;
$this->projet->task = new StdClass();
$this->projet->task->warning_delay = (isset($this->global->MAIN_DELAY_TASKS_TODO) ? $this->global->MAIN_DELAY_TASKS_TODO : 7) * 86400;
$this->projet->task->warning_delay = (isset($this->global->MAIN_DELAY_TASKS_TODO) ? (int) $this->global->MAIN_DELAY_TASKS_TODO : 7) * 86400;
}
if (isset($this->commande)) {
$this->commande->client = new stdClass();
$this->commande->fournisseur = new stdClass();
$this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
$this->commande->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS) ? $this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS : 7) * 86400;
$this->commande->client->warning_delay = (isset($this->global->MAIN_DELAY_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_ORDERS_TO_PROCESS : 2) * 86400;
$this->commande->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS) ? (int) $this->global->MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS : 7) * 86400;
}
if (isset($this->propal)) {
$this->propal->cloture = new stdClass();
$this->propal->facturation = new stdClass();
$this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
$this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
$this->propal->cloture->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_CLOSE) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_CLOSE : 0) * 86400;
$this->propal->facturation->warning_delay = (isset($this->global->MAIN_DELAY_PROPALS_TO_BILL) ? (int) $this->global->MAIN_DELAY_PROPALS_TO_BILL : 0) * 86400;
}
if (isset($this->facture)) {
$this->facture->client = new stdClass();
$this->facture->fournisseur = new stdClass();
$this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
$this->facture->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY) ? $this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY : 0) * 86400;
$this->facture->client->warning_delay = (isset($this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED) ? (int) $this->global->MAIN_DELAY_CUSTOMER_BILLS_UNPAYED : 0) * 86400;
$this->facture->fournisseur->warning_delay = (isset($this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY) ? (int) $this->global->MAIN_DELAY_SUPPLIER_BILLS_TO_PAY : 0) * 86400;
}
if (isset($this->contrat)) {
$this->contrat->services = new stdClass();
$this->contrat->services->inactifs = new stdClass();
$this->contrat->services->expires = new stdClass();
$this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
$this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
$this->contrat->services->inactifs->warning_delay = (isset($this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES) ? (int) $this->global->MAIN_DELAY_NOT_ACTIVATED_SERVICES : 0) * 86400;
$this->contrat->services->expires->warning_delay = (isset($this->global->MAIN_DELAY_RUNNING_SERVICES) ? (int) $this->global->MAIN_DELAY_RUNNING_SERVICES : 0) * 86400;
}
if (isset($this->commande)) {
$this->bank->rappro = new stdClass();
$this->bank->cheque = new stdClass();
$this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
$this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
$this->bank->rappro->warning_delay = (isset($this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE) ? (int) $this->global->MAIN_DELAY_TRANSACTIONS_TO_CONCILIATE : 0) * 86400;
$this->bank->cheque->warning_delay = (isset($this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT) ? (int) $this->global->MAIN_DELAY_CHEQUES_TO_DEPOSIT : 0) * 86400;
}
if (isset($this->expensereport)) {
$this->expensereport->approve = new stdClass();
$this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
$this->expensereport->approve->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS : 0) * 86400;
$this->expensereport->payment = new stdClass();
$this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
$this->expensereport->payment->warning_delay = (isset($this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY) ? (int) $this->global->MAIN_DELAY_EXPENSEREPORTS_TO_PAY : 0) * 86400;
}
if (isset($this->holiday)) {
$this->holiday->approve = new stdClass();
$this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
$this->holiday->approve->warning_delay = (isset($this->global->MAIN_DELAY_HOLIDAYS) ? (int) $this->global->MAIN_DELAY_HOLIDAYS : 0) * 86400;
}
if (!empty($this->global->PRODUIT_MULTIPRICES) && empty($this->global->PRODUIT_MULTIPRICES_LIMIT)) {

View File

@ -935,7 +935,7 @@ class dolReceiptPrinter extends Printer
* Function Init Printer
*
* @param int $printerid Printer id
* @return int 0 if OK; >0 if KO
* @return void|int 0 if OK; >0 if KO
*/
public function initPrinter($printerid)
{

View File

@ -2114,7 +2114,7 @@ class ExtraFields
) {
continue;
}
if (empty($visibility)) {
if (empty($visibility) || $visibility == 5) {
continue;
}
if (empty($perms)) {

View File

@ -484,7 +484,7 @@ class FileUpload
/**
* Output data
*
* @return void
* @return string|void
*/
public function post()
{

View File

@ -77,7 +77,7 @@ class HookManager
* Then when a hook executeHooks('aMethod'...) is called, the method aMethod found into class will be executed.
*
* @param string[] $arraycontext Array list of searched hooks tab/features. For example: 'thirdpartycard' (for hook methods into page card thirdparty), 'thirdpartydao' (for hook methods into Societe), ...
* @return int Always 1
* @return int|void Always 1
*/
public function initHooks($arraycontext)
{
@ -127,6 +127,7 @@ class HookManager
}
}
}
// Log the init of hook but only for hooks thare are declared to be managed
if (count($arraytolog) > 0) {
dol_syslog(get_class($this)."::initHooks Loading hooks: ".join(', ', $arraytolog), LOG_DEBUG);
}
@ -166,32 +167,31 @@ class HookManager
// TODO Remove hooks with type 'output' (exemple createFrom). All hooks must be converted into 'addreplace' hooks.
if (in_array($method, array(
'createFrom',
'dashboardMembers',
'dashboardEmailings',
'dashboardPropals',
'dashboardPropals',
'dashboardCommercials',
'dashboardOrders',
'dashboardSpecialBills',
'dashboardAccountancy',
'dashboardActivities',
'dashboardCommercials',
'dashboardContracts',
'dashboardDonation',
'dashboardWarehouseSendings',
'dashboardEmailings',
'dashboardExpenseReport',
'dashboardInterventions',
'dashboardOrdersSuppliers',
'dashboardHRM',
'dashboardInterventions',
'dashboardMRP',
'dashboardMembers',
'dashboardOpensurvey',
'dashboardWarehouse',
'dashboardOrders',
'dashboardOrdersSuppliers',
'dashboardProductServices',
'dashboardActivities',
'dashboardProjects',
'dashboardWarehouseReceptions',
'dashboardThirdparties',
'dashboardPropals',
'dashboardSpecialBills',
'dashboardSupplierProposal',
'dashboardThirdparties',
'dashboardTickets',
'dashboardUsersGroups',
'dashboardWarehouse',
'dashboardWarehouseReceptions',
'dashboardWarehouseSendings',
'insertExtraHeader',
'insertExtraFooter',
'printLeftBlock',
@ -237,7 +237,10 @@ class HookManager
$actionclassinstance->error = 0;
$actionclassinstance->errors = array();
dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".get_class($actionclassinstance).'->'.$method.", context=".$context.", module=".$module.", action=".$action.((is_object($object) && property_exists($object, 'id')) ? ', object id='.$object->id : '').((is_object($object) && property_exists($object, 'element')) ? ', object element='.$object->element : ''), LOG_DEBUG);
if (getDolGlobalInt('MAIN_DEBUG_SHOW_EACH_QUALIFIED_HOOK_CALL') >= 2) {
// This his too much verbose, enabled in develop only
dol_syslog(get_class($this)."::executeHooks Qualified hook found (hooktype=".$hooktype."). We call method ".get_class($actionclassinstance).'->'.$method.", context=".$context.", module=".$module.", action=".$action.((is_object($object) && property_exists($object, 'id')) ? ', object id='.$object->id : '').((is_object($object) && property_exists($object, 'element')) ? ', object element='.$object->element : ''), LOG_DEBUG);
}
// Add current context to avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return;
// Note: The hook can use the $currentcontext in its code to avoid to be ran twice or be ran for one given context only

View File

@ -5130,10 +5130,12 @@ class Form
$i = 0;
foreach ($input['values'] as $selkey => $selval) {
$more .= '<div class="tagtr">';
if ($i == 0) {
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
} else {
$more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
if (isset($input['label'])) {
if ($i == 0) {
$more .= '<div class="tagtd'.(empty($input['tdclass']) ? ' tdtop' : (' tdtop '.$input['tdclass'])).'">'.$input['label'].'</div>';
} else {
$more .= '<div clas="tagtd'.(empty($input['tdclass']) ? '' : (' "'.$input['tdclass'])).'">&nbsp;</div>';
}
}
$more .= '<div class="tagtd'.($i == 0 ? ' tdtop' : '').'"><input type="radio" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name'].$selkey).'" name="'.dol_escape_htmltag($input['name']).'" value="'.$selkey.'"'.$moreattr;
if (!empty($input['disabled'])) {
@ -8456,8 +8458,13 @@ class Form
}
}
// Try also magic suggest
$out .= '<select id="'.$htmlname.'" class="multiselect'.($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n";
$useenhancedmultiselect = 0;
if (!empty($conf->use_javascript_ajax) && !empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) {
$useenhancedmultiselect = 1;
}
// Output select component
$out .= '<select id="'.$htmlname.'" class="multiselect'.($useenhancedmultiselect ? ' multiselectononeline' : '').($morecss ? ' '.$morecss : '').'" multiple name="'.$htmlname.'[]"'.($moreattrib ? ' '.$moreattrib : '').($width ? ' style="width: '.(preg_match('/%/', $width) ? $width : $width.'px').'"' : '').'>'."\n";
if (is_array($array) && !empty($array)) {
if ($value_as_key) {
$array = array_combine($array, $array);
@ -9777,7 +9784,7 @@ class Form
/**
* Return HTML to show the search and clear seach button
*
* @param string $pos position colon on liste value left or right
* @param string $pos Position of colon on the list. Value 'left' or 'right'
* @return string
*/
public function showFilterButtons($pos = '')

View File

@ -920,6 +920,9 @@ class FormFile
}
if (is_object($hookmanager)) {
$addcolumforpicto = ($delallowed || $printer || $morepicto);
$colspan = (4 + ($addcolumforpicto ? 1 : 0));
$colspanmore = 0;
$parameters = array('colspan'=>($colspan + $colspanmore), 'socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'modulepart'=>$modulepart, 'relativepath'=>$relativepath);
$res = $hookmanager->executeHooks('formBuilddocLineOptions', $parameters, $file);
if (empty($res)) {

View File

@ -231,7 +231,7 @@ class SMTPs
private $_errorsTo = '';
private $_deliveryReceipt = 0;
private $_trackId = '';
private $_moreInHeader = '';
private $_moreinheader = '';
/**
* An array of options for stream_context_create()
@ -1267,7 +1267,7 @@ class SMTPs
$_RCPT_list = array();
// walk down Recipients array and pull just email addresses
foreach ($this->_msgRecipients as $_host => $_list) {
if ($this->_msgRecipients[$_host][$_which]) {
if (!empty($this->_msgRecipients[$_host][$_which])) {
foreach ($this->_msgRecipients[$_host][$_which] as $_addr => $_realName) {
if ($_realName) { // @CHANGE LDR
$_realName = '"'.$_realName.'"';

View File

@ -66,6 +66,8 @@ print "jQuery(document).ready(function () {\n";
print ' var nowtime = Date.now();';
print ' var time_auto_update = '.max(1, getDolGlobalInt('MAIN_BROWSER_NOTIFICATION_FREQUENCY')).';'."\n"; // Always defined
print ' var time_js_next_test;'."\n";
print ' var dolnotif_nb_test_for_page = 0;'."\n";
print ' var dolnotif_idinterval = null;'."\n";
?>
/* Check if Notification is supported */
@ -82,7 +84,7 @@ if ("Notification" in window) {
//var time_first_execution = (time_auto_update + (time_js_next_test - nowtime)) * 1000; //need milliseconds
var time_first_execution = <?php echo max(3, empty($conf->global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION) ? 0 : $conf->global->MAIN_BROWSER_NOTIFICATION_CHECK_FIRST_EXECUTION); ?>;
setTimeout(first_execution, time_first_execution * 1000);
setTimeout(first_execution, time_first_execution * 1000); // Launch a first execution after a time_first_execution delay
time_js_next_test = nowtime + time_first_execution;
console.log("Launch browser notif check: setTimeout is set to launch 'first_execution' function after a wait of time_first_execution="+time_first_execution+". nowtime (time php page generation) = "+nowtime+" time_js_next_check = "+time_js_next_test);
} else {
@ -91,14 +93,19 @@ if ("Notification" in window) {
function first_execution() {
console.log("Call first_execution then set repeat time to time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update);
check_events(); //one check before setting the new time for other checks
setInterval(check_events, time_auto_update * 1000); // Set new time to run next check events
console.log("Call first_execution of check_events()");
result = check_events(); //one check before setting the new time for other checks
if (result > 0) {
console.log("check_events() is scheduled as a repeated task with a time_auto_update = MAIN_BROWSER_NOTIFICATION_FREQUENCY = "+time_auto_update+"s");
dolnotif_idinterval = setInterval(check_events, time_auto_update * 1000); // Set new time to run next check events. time_auto_update=nb of seconds
}
}
function check_events() {
if (Notification.permission === "granted")
{
var result = 0;
dolnotif_nb_test_for_page += 1;
if (Notification.permission === "granted") {
var currentToken = 'notrequired';
const allMeta = document.getElementsByTagName("meta");
for (let i = 0; i < allMeta.length; i++) {
@ -108,7 +115,8 @@ function check_events() {
}
}
time_js_next_test += time_auto_update;
console.log("Call ajax to check events with time_js_next_test = "+time_js_next_test);
console.log("Call ajax to check events with time_js_next_test = "+time_js_next_test+" dolnotif_nb_test_for_page="+dolnotif_nb_test_for_page);
$.ajax("<?php print DOL_URL_ROOT.'/core/ajax/check_notifications.php'; ?>", {
type: "post", // Usually post or get
@ -184,15 +192,24 @@ function check_events() {
data: { time_js_next_test: time_js_next_test, token: currentToken }
});
} else {
console.log("No reminder to do found, next search at "+time_js_next_test);
console.log("No remind to do found, next search at "+time_js_next_test);
}
}
});
result = 1;
} else {
console.log("Cancel check_events() with dolnotif_nb_test_for_page="+dolnotif_nb_test_for_page+". Check is useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https).");
result = 2; // We return a positive so the repeated check will done even if authroization is not yet allowed may be after this check)
}
else
{
console.log("Cancel check_events. Useless because javascript Notification.permission is "+Notification.permission+" (blocked manualy or web site is not https).");
if (dolnotif_nb_test_for_page >= 5) {
console.log("We did "+dolnotif_nb_test_for_page+" consecutive test on this page. We stop checking now from here by clearing dolnotif_idinterval="+dolnotif_idinterval);
clearInterval(dolnotif_idinterval);
}
return result;
}
<?php

View File

@ -421,6 +421,9 @@ function dol_shutdown()
/**
* Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
* Warning:
* For action=add, use: $var = GETPOST('var'); // No GETPOSTISSET, so GETPOST always called and default value is retreived if not a form POST, and value of form is retreived if it is a form POST.
* For action=update, use: $var = GETPOSTISSET('var') ? GETPOST('var') : $object->var;
*
* @param string $paramname Name or parameter to test
* @return boolean True if we have just submit a POST or GET request with the parameter provided (even if param is empty)
@ -949,6 +952,7 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options
}
break;
case 'restricthtml': // Recommended for most html textarea
case 'restricthtmlnolink':
case 'restricthtmlallowunvalid':
$out = dol_htmlwithnojs($out, 1, $check);
break;
@ -1385,7 +1389,7 @@ function dol_string_unaccent($str)
/**
* Clean a string from all punctuation characters to use it as a ref or login.
* This is a more complete function than dol_sanitizeFileName.
* This is a more complete function than dol_sanitizeFileName().
*
* @param string $str String to clean
* @param string $newstr String to replace forbidden chars with
@ -1397,7 +1401,7 @@ function dol_string_unaccent($str)
*/
function dol_string_nospecial($str, $newstr = '_', $badcharstoreplace = '', $badcharstoremove = '')
{
$forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°'); // more complete than dol_sanitizeFileName
$forbidden_chars_to_replace = array(" ", "'", "/", "\\", ":", "*", "?", "\"", "<", ">", "|", "[", "]", ",", ";", "=", '°', '$', ';'); // more complete than dol_sanitizeFileName
$forbidden_chars_to_remove = array();
//$forbidden_chars_to_remove=array("(",")");
@ -2350,7 +2354,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
if (method_exists($object, 'getBannerAddress') && !in_array($object->element, array('product', 'bookmark', 'ecm_directories', 'ecm_files'))) {
$moreaddress = $object->getBannerAddress('refaddress', $object);
if ($moreaddress) {
$morehtmlref .= '<div class="refidno">';
$morehtmlref .= '<div class="refidno refaddress">';
$morehtmlref .= $moreaddress;
$morehtmlref .= '</div>';
}
@ -4095,7 +4099,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'autofill', 'folder', 'folder-open', 'folder-plus',
'gears', 'generate', 'globe', 'globe-americas', 'graph', 'grip', 'grip_title', 'group',
'help', 'holiday',
'id-card', 'images', 'incoterm', 'info', 'intervention', 'inventory', 'intracommreport', 'knowledgemanagement',
'id-card', 'images', 'incoterm', 'info', 'intervention', 'inventory', 'intracommreport', 'jobprofile',
'knowledgemanagement',
'label', 'language', 'line', 'link', 'list', 'list-alt', 'listlight', 'loan', 'lock', 'lot', 'long-arrow-alt-right',
'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next',
'off', 'on', 'order',
@ -4110,7 +4115,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'technic', 'ticket',
'error', 'warning',
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss',
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'shapes', 'skill', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
'conferenceorbooth', 'eventorganization',
@ -4142,7 +4147,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'email'=>'at', 'establishment'=>'building', 'edit'=>'pencil-alt', 'entity'=>'globe',
'graph'=>'chart-line', 'grip_title'=>'arrows-alt', 'grip'=>'arrows-alt', 'help'=>'question-circle',
'generic'=>'file', 'holiday'=>'umbrella-beach',
'info'=>'info-circle', 'inventory'=>'boxes', 'intracommreport'=>'globe-europe', 'knowledgemanagement'=>'ticket-alt', 'label'=>'layer-group', 'line'=>'bars', 'loan'=>'money-bill-alt',
'info'=>'info-circle', 'inventory'=>'boxes', 'intracommreport'=>'globe-europe', 'jobprofile'=>'cogs',
'knowledgemanagement'=>'ticket-alt', 'label'=>'layer-group', 'line'=>'bars', 'loan'=>'money-bill-alt',
'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
'trip'=>'wallet', 'expensereport'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
'sign-out'=>'sign-out-alt',
@ -4158,7 +4164,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
'refresh'=>'redo', 'region'=>'map-marked', 'replacement'=>'exchange-alt', 'resource'=>'laptop-house', 'recurring'=>'history',
'service'=>'concierge-bell',
'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s',
'skill'=>'shapes', 'state'=>'map-marked-alt', 'security'=>'key', 'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s',
'supplier'=>'building', 'technic'=>'cogs',
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
'title_agenda'=>'calendar-alt',
@ -5370,10 +5376,10 @@ function load_fiche_titre($titre, $morehtmlright = '', $picto = 'generic', $pict
$return .= '<div class="titre inline-block">'.$titre.'</div>';
$return .= '</td>';
if (dol_strlen($morehtmlcenter)) {
$return .= '<td class="nobordernopadding center valignmiddle">'.$morehtmlcenter.'</td>';
$return .= '<td class="nobordernopadding center valignmiddle col-center">'.$morehtmlcenter.'</td>';
}
if (dol_strlen($morehtmlright)) {
$return .= '<td class="nobordernopadding titre_right wordbreakimp right valignmiddle">'.$morehtmlright.'</td>';
$return .= '<td class="nobordernopadding titre_right wordbreakimp right valignmiddle col-right">'.$morehtmlright.'</td>';
}
$return .= '</tr></table>'."\n";
@ -5445,11 +5451,11 @@ function print_barre_liste($titre, $page, $file, $options = '', $sortfield = '',
// Center
if ($morehtmlcenter) {
print '<td class="nobordernopadding center valignmiddle">'.$morehtmlcenter.'</td>';
print '<td class="nobordernopadding center valignmiddle col-center">'.$morehtmlcenter.'</td>';
}
// Right
print '<td class="nobordernopadding valignmiddle right">';
print '<td class="nobordernopadding valignmiddle right col-right">';
print '<input type="hidden" name="pageplusoneold" value="'.((int) $page + 1).'">';
if ($sortfield) {
$options .= "&sortfield=".urlencode($sortfield);
@ -7196,7 +7202,7 @@ function dol_nl2br($stringtoencode, $nl2brmode = 0, $forxml = false)
*
* @param string $stringtoencode String to encode
* @param int $nouseofiframesandbox Allow use of option MAIN_SECURITY_USE_SANDBOX_FOR_HTMLWITHNOJS for html sanitizing
* @param string $check 'restricthtml' or 'restricthtmlallowunvalid'
* @param string $check 'restricthtmlnolink' or 'restricthtml' or 'restricthtmlallowunvalid'
* @return string HTML sanitized
*/
function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = 'restricthtml')
@ -7269,9 +7275,16 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
// Check the limit of external links in a Rich text content. We count '<img' and 'url('
$reg = array();
preg_match_all('/(<img|url\()/i', $out, $reg);
if (count($reg[0]) > getDolGlobalInt("MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT", 1000)) {
$nbextlink = count($reg[0]);
if ($nbextlink > getDolGlobalInt("MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT", 1000)) {
$out = 'TooManyLinksIntoHTMLString';
}
//
if (!empty($conf->global->MAIN_DISALLOW_EXT_URL_INTO_DESCRIPTIONS) || $check == 'restricthtmlnolink') {
if ($nbextlink > 0) {
$out = 'ExternalLinksNotAllowed';
}
}
return $out;
}
@ -9804,7 +9817,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
$value = preg_replace('/\*/', '%', $value); // Replace * with %
}
if ($mode == 1) {
$value = preg_replace('/([<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
$value = preg_replace('/([!<>=]+)\s+([0-9'.preg_quote($langs->trans("DecimalSeparator"), '/').'\-])/', '\1\2', $value); // Clean string '< 10' into '<10' so we can the explode on space to get all tests to do
}
$value = preg_replace('/\s*\|\s*/', '|', $value);
@ -9824,10 +9837,10 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0)
foreach ($fields as $field) {
if ($mode == 1) {
$operator = '=';
$newcrit = preg_replace('/([<>=]+)/', '', $crit);
$newcrit = preg_replace('/([!<>=]+)/', '', $crit);
$reg = array();
preg_match('/([<>=]+)/', $crit, $reg);
preg_match('/([!<>=]+)/', $crit, $reg);
if (!empty($reg[1])) {
$operator = $reg[1];
}

View File

@ -179,6 +179,9 @@ function dolDecrypt($chain, $key = '')
if (preg_match('/^dolcrypt:([^:]+):(.+)$/', $chain, $reg)) {
$ciphering = $reg[1];
if (function_exists('openssl_decrypt')) {
if (empty($key)) {
return 'Error dolDecrypt decrypt key is empty';
}
$tmpexplode = explode(':', $reg[2]);
if (!empty($tmpexplode[1]) && is_string($tmpexplode[0])) {
$newchain = openssl_decrypt($tmpexplode[1], $ciphering, $key, 0, $tmpexplode[0]);
@ -186,7 +189,7 @@ function dolDecrypt($chain, $key = '')
$newchain = openssl_decrypt($tmpexplode[0], $ciphering, $key, 0, null);
}
} else {
$newchain = 'Error function openssl_decrypt() not available';
$newchain = 'Error dolDecrypt function openssl_decrypt() not available';
}
return $newchain;
} else {

View File

@ -69,7 +69,7 @@ function dolStripPhpCode($str, $replacewith = '')
*
* @param string $str String to clean
* @return string Result string with php code only
* @see dolStripPhpCode()
* @see dolStripPhpCode(), checkPHPCode()
*/
function dolKeepOnlyPhpCode($str)
{

View File

@ -680,6 +680,7 @@ function showWebsiteTemplates(Website $website)
* @param string $phpfullcodestringold PHP old string. For exemple "<?php echo 'a' ?><php echo 'b' ?>"
* @param string $phpfullcodestring PHP new string. For exemple "<?php echo 'a' ?><php echo 'c' ?>"
* @return int Error or not
* @see dolKeepOnlyPhpCode()
*/
function checkPHPCode($phpfullcodestringold, $phpfullcodestring)
{

View File

@ -2276,7 +2276,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu =
//$newmenu->add("/hrm/skill_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read'));
// Job (Description of work to do and skills required)
$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsPosition"), 1, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("JobsProfiles"), 1, $user->hasRight('hrm', 'all', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'technic', 'class="paddingright pictofixedwidth"'));
//$newmenu->add("/hrm/job_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->transnoentities("NewObject", $langs->trans("Job")), 1, $user->hasRight('hrm', 'all', 'write'));
//$newmenu->add("/hrm/job_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'all', 'read'));

View File

@ -916,7 +916,7 @@ class pdf_standard_asset extends ModelePDFAsset
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @param Translate $outputlangsbis Object lang for output bis
* @return void
* @return float
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
{

View File

@ -478,7 +478,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc
* @param CompanyBankAccount $object Object to show
* @param int $posy Y
* @param Translate $outputlangs Langs object
* @return void
* @return float
*/
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs)
{

View File

@ -401,7 +401,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts
* @param Object $object Object to show
* @param Translate $outputlangs Object lang for output
* @param int $hidefreetext 1=Hide free text
* @return void
* @return mixed
*/
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
{

View File

@ -230,7 +230,7 @@ class pdf_strato extends ModelePDFContract
$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
$heightforinfotot = 50; // Height reserved to output the info and total part
$heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page
$heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
$heightforfooter = $this->marge_basse + 9; // Height reserved to output the footer (value include bottom margin)
if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) {
$heightforfooter += 6;
}
@ -383,7 +383,6 @@ class pdf_strato extends ModelePDFContract
$pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txtpredefinedservice, dol_concatdesc($txt, $desc)), 0, 1, 0);
$pageposafter = $pdf->getPage();
$posyafter = $pdf->GetY();
if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text
if ($i == ($nblines - 1)) { // No more lines, and no space left to show total, so we create a new page
$pdf->AddPage('', '', true);
@ -437,6 +436,9 @@ class pdf_strato extends ModelePDFContract
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
}
@ -459,6 +461,7 @@ class pdf_strato extends ModelePDFContract
}
}
// Show square
if ($pagenb == 1) {
$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);

View File

@ -1618,7 +1618,7 @@ class pdf_sponge extends ModelePDFFactures
// Get Total HT
$total_ht = (isModEnabled("multicurrency") && $object->mylticurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1 ? $object->multicurrency_total_ht : $object->total_ht);
// Total remise
$total_line_remise = 0;
@ -2057,7 +2057,7 @@ class pdf_sponge extends ModelePDFFactures
* @param int $showaddress 0=no, 1=yes (usually set to 1 for first page, and 0 for next pages)
* @param Translate $outputlangs Object lang for output
* @param Translate $outputlangsbis Object lang for output bis
* @return int top shift of linked object lines
* @return array top shift of linked object lines
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
{

View File

@ -77,7 +77,7 @@ class mod_facture_mercure extends ModeleNumRefFactures
// Setting the prefix
$texte .= '<tr><td><span class="opacitymedium">'.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").'):</span></td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskinvoice" value="'.$conf->global->FACTURE_MERCURE_MASK_INVOICE.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskinvoice" value="'.getDolGlobalString("FACTURE_MERCURE_MASK_INVOICE").'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="left" rowspan="3">&nbsp; <input type="submit" class="button button-edit" name="Button"value="'.$langs->trans("Modify").'"></td>';
@ -85,17 +85,17 @@ class mod_facture_mercure extends ModeleNumRefFactures
// Prefix setting of replacement invoices
$texte .= '<tr><td><span class="opacitymedium">'.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'):</span></td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskreplacement" value="'.$conf->global->FACTURE_MERCURE_MASK_REPLACEMENT.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskreplacement" value="'.getDolGlobalString("FACTURE_MERCURE_MASK_REPLACEMENT").'">', $tooltip, 1, 1).'</td>';
$texte .= '</tr>';
// Prefix setting of credit note
$texte .= '<tr><td><span class="opacitymedium">'.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'):</span></td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskcredit" value="'.$conf->global->FACTURE_MERCURE_MASK_CREDIT.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskcredit" value="'.getDolGlobalString("FACTURE_MERCURE_MASK_CREDIT").'">', $tooltip, 1, 1).'</td>';
$texte .= '</tr>';
// Prefix setting of deposit
$texte .= '<tr><td><span class="opacitymedium">'.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'):</span></td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskdeposit" value="'.$conf->global->FACTURE_MERCURE_MASK_DEPOSIT.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="maskdeposit" value="'.getDolGlobalString("FACTURE_MERCURE_MASK_DEPOSIT").'">', $tooltip, 1, 1).'</td>';
$texte .= '</tr>';
$texte .= '</table>';

View File

@ -238,7 +238,7 @@ class ImportCsv extends ModeleImports
/**
* Return array of next record in input file.
*
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
* @return array|boolean Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
*/
public function import_read_record()
{

View File

@ -304,7 +304,7 @@ class ImportXlsx extends ModeleImports
/**
* Return array of next record in input file.
*
* @return Array Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
* @return array|boolean Array of field values. Data are UTF8 encoded. [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=not empty string)
*/
public function import_read_record()
{

View File

@ -461,7 +461,7 @@ class mailing_contacts1 extends MailingTargets
'other' =>
($langs->transnoentities("ThirdParty").'='.$obj->companyname).';'.
($langs->transnoentities("UserTitle").'='.($obj->civility_id ? $langs->transnoentities("Civility".$obj->civility_id) : '')).';'.
($langs->transnoentities("JobPosition").'='.$obj->jobposition),
($langs->transnoentities("PostOrFunction").'='.$obj->jobposition),
'source_url' => $this->url($obj->id),
'source_id' => $obj->id,
'source_type' => 'contact'

View File

@ -201,12 +201,14 @@ class modKnowledgeManagement extends DolibarrModules
// Boxes/Widgets
// Add here list of php file(s) stored in knowledgemanagement/core/boxes that contains a class to show a widget.
$this->boxes = array(
// 0 => array(
// 'file' => 'knowledgemanagementwidget1.php@knowledgemanagement',
// 'note' => 'Widget provided by KnowledgeManagement',
// 'enabledbydefaulton' => 'Home',
// ),
// ...
0 => array(
'file' => 'box_last_knowledgerecord.php',
'enabledbydefaulton' => 'ticketindex',
),
1 => array(
'file' => 'box_last_modified_knowledgerecord.php',
'enabledbydefaulton' => 'ticketindex',
),
);
// Cronjobs (List of cron jobs entries to add when module is enabled)
@ -271,7 +273,7 @@ class modKnowledgeManagement extends DolibarrModules
'langs'=>'knowledgemanagement', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000 + $r,
'enabled'=>'$conf->knowledgemanagement->enabled', // Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->read' if you want your menu with a permission rules
'perms'=>'1', // Use 'perms'=>'$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')' if you want your menu with a permission rules
'target'=>'',
'user'=>2, // 0=Menu for internal users, 1=external users, 2=both
);
@ -334,7 +336,7 @@ class modKnowledgeManagement extends DolibarrModules
// Define condition to show or hide menu entry. Use '$conf->knowledgemanagement->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'enabled'=>'$conf->knowledgemanagement->enabled',
// Use 'perms'=>'$user->rights->knowledgemanagement->level1->level2' if you want your menu with a permission rules
'perms'=>'$user->rights->knowledgemanagement->knowledgerecord->write',
'perms'=>'$user->hasRight("knowledgemanagement", "knowledgerecord", "write")',
'target'=>'',
// 0=Menu for internal users, 1=external users, 2=both
'user'=>2

View File

@ -1067,7 +1067,7 @@ class pdf_vinci extends ModelePDFMo
* @param CommandeFournisseur $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return void
* @return float|int
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{

View File

@ -191,7 +191,7 @@ abstract class ModeleProductCode
*
* @param DoliDB $dbs Database handler
* @param integer $maxfilenamelength Max length of value to show
* @return array List of numbers
* @return array|int List of numbers
*/
public static function liste_modeles($dbs, $maxfilenamelength = 0)
{

View File

@ -1484,7 +1484,7 @@ class pdf_azur extends ModelePDFPropales
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @param Translate $outputlangsbis Object lang for output bis
* @return void
* @return int|float
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
{

View File

@ -1547,7 +1547,7 @@ class pdf_cyan extends ModelePDFPropales
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @param Translate $outputlangsbis Object lang for output bis
* @return void
* @return float|int
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
{

View File

@ -1223,7 +1223,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
* @param CommandeFournisseur $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return void
* @return float|int
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{

View File

@ -1130,7 +1130,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
* @param CommandeFournisseur $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return void
* @return float|int
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{

View File

@ -1232,7 +1232,7 @@ class pdf_aurore extends ModelePDFSupplierProposal
* @param Object $object Object to show
* @param int $showaddress 0=no, 1=yes
* @param Translate $outputlangs Object lang for output
* @return void
* @return float|int
*/
protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
{

View File

@ -453,7 +453,6 @@ if ($action == 'confirm_crop') {
if ($result < 0) {
setEventMessages($ecmfile->error, $ecmfile->errors, 'warnings');
}
$result = $ecmfile->create($user);
}
if ($backtourl) {

View File

@ -535,7 +535,7 @@ class PaiementFourn extends Paiement
* Return list of supplier invoices the payment point to
*
* @param string $filter SQL filter. Warning: This value must not come from a user input.
* @return array Array of supplier invoice id
* @return array|int Array of supplier invoice id | <0 si ko
*/
public function getBillsArray($filter = '')
{

View File

@ -2278,7 +2278,7 @@ if ($action == 'create') {
// Standard invoice
print '<div class="tagtr listofinvoicetype"><div class="tagtd listofinvoicetype">';
$tmp = '<input type="radio" id="radio_standard" name="type" value="0"'.(GETPOST('type', 'int')? '' : 'checked').'> ';
$desc = $form->textwithpicto($tmp.$langs->trans("InvoiceStandardAsk"), $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3);
$desc = $form->textwithpicto($tmp.'<label for="radio_standard">'.$langs->trans("InvoiceStandardAsk").'</label>', $langs->transnoentities("InvoiceStandardDesc"), 1, 'help', '', 0, 3);
print $desc;
print '</div></div>';
@ -2456,7 +2456,7 @@ if ($action == 'create') {
});
});
</script>';
$text = $tmp.$langs->transnoentities("InvoiceAvoirAsk").' ';
$text = $tmp.'<label for="radio_creditnote">'.$langs->transnoentities("InvoiceAvoirAsk").'</label> ';
// $text.='<input type="text" value="">';
$text .= '<select class="flat valignmiddle" name="fac_avoir" id="fac_avoir"';
if (!$optionsav) {
@ -2521,16 +2521,16 @@ if ($action == 'create') {
print $form->selectDate($dateinvoice, '', '', '', '', "add", 1, 1);
print '</td></tr>';
// Due date
print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>';
print $form->selectDate($datedue, 'ech', '', '', '', "add", 1, 1);
print '</td></tr>';
// Payment term
print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td>';
print $form->getSelectConditionsPaiements(GETPOSTISSET('cond_reglement_id') ?GETPOST('cond_reglement_id', 'int') : $cond_reglement_id, 'cond_reglement_id');
print '</td></tr>';
// Due date
print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>';
print $form->selectDate($datedue, 'ech', '', '', '', "add", 1, 1);
print '</td></tr>';
// Payment mode
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td>';
print img_picto('', 'bank', 'class="pictofixedwidth"');

View File

@ -3,7 +3,7 @@
* Copyright (C) 2013-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2016 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
* Copyright (C) 2019-2022 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2019-2023 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -620,7 +620,7 @@ if ($resql) {
$valideurobjects = $validator->listUsersForGroup($excludefilter, 1);
$valideurarray = array();
foreach ($valideurobjects as $val) {
$valideurarray[$val->id] = $val->id;
$valideurarray[$val] = $val;
}
print $form->select_dolusers($search_valideur, "search_valideur", 1, "", 0, $valideurarray, '', 0, 0, 0, $morefilter, 0, '', 'maxwidth125');
print '</td>';

View File

@ -336,7 +336,7 @@ if (!empty($arrayfields['cpl.fk_user_action']['checked'])) {
$valideurobjects = $validator->listUsersForGroup($excludefilter, 1);
$valideurarray = array();
foreach ($valideurobjects as $val) {
$valideurarray[$val->id] = $val->id;
$valideurarray[$val] = $val;
}
print '<td class="liste_titre">';

View File

@ -67,7 +67,7 @@ require DOL_DOCUMENT_ROOT.'/core/actions_extrafields.inc.php';
* View
*/
$textobject = $langs->transnoentitiesnoconv("JobPosition");
$textobject = $langs->transnoentitiesnoconv("JobProfile");
$help_url = '';
$page_name = "HrmSetup";

View File

@ -119,7 +119,7 @@ class Evaluation extends CommonObject
'status' => array('type'=>'smallint', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'default'=>0, 'visible'=>5, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '6' => 'Closed'),),
'date_eval' => array('type'=>'date', 'label'=>'DateEval', 'enabled'=>'1', 'position'=>502, 'notnull'=>1, 'visible'=>1,),
'fk_user' => array('type'=>'integer:User:user/class/user.class.php:0', 'label'=>'User', 'enabled'=>'1', 'position'=>504, 'notnull'=>1, 'visible'=>1,),
'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobPosition', 'enabled'=>'1', 'position'=>505, 'notnull'=>1, 'visible'=>1,),
'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobProfile', 'enabled'=>'1', 'position'=>505, 'notnull'=>1, 'visible'=>1,),
);
public $rowid;
public $ref;

View File

@ -110,7 +110,7 @@ class Position extends CommonObject
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>-2,),
'fk_contrat' => array('type'=>'integer:Contrat:contrat/class/contrat.class.php', 'label'=>'fk_contrat', 'enabled'=>'1', 'position'=>50, 'notnull'=>0, 'visible'=>0,),
'fk_user' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'Employee', 'enabled'=>'1', 'position'=>55, 'notnull'=>1, 'visible'=>1, 'default'=>0),
'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobPosition', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,),
'fk_job' => array('type'=>'integer:Job:/hrm/class/job.class.php', 'label'=>'JobProfile', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1,),
'date_start' => array('type'=>'date', 'label'=>'DateStart', 'enabled'=>'1', 'position'=>51, 'notnull'=>1, 'visible'=>1,),
'date_end' => array('type'=>'date', 'label'=>'DateEnd', 'enabled'=>'1', 'position'=>52, 'notnull'=>0, 'visible'=>1,),
'abort_comment' => array('type'=>'varchar(255)', 'label'=>'AbandonmentComment', 'enabled'=>'getDolGlobalInt("HRM_JOB_POSITON_ENDING_COMMENT")', 'position'=>502, 'notnull'=>0, 'visible'=>1,),

View File

@ -155,7 +155,7 @@ $fk_usergroup1 = GETPOST('fk_usergroup1');
$TJobs[$j->id] = $j->label;
}
print $form->selectarray('fk_job', $TJobs, $fk_job, 1);
print img_picto('', 'jobprofile', 'class="pictofixedwidth"').$form->selectarray('fk_job', $TJobs, $fk_job, 1);
?></td>
</tr>
</table>

View File

@ -96,8 +96,10 @@ $permissiontoread = $user->rights->hrm->evaluation->read; // Used by the include
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
//restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
if (empty($conf->hrm->enabled)) accessforbidden();
//restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft);
if (!isModEnabled('hrm')) {
accessforbidden();
}
if (!$permissiontoread) accessforbidden();
@ -155,10 +157,10 @@ if ($object->id > 0) {
$morehtmlref .= $langs->trans('Label').' : '.$object->label;
$u_position = new User(($db));
$u_position->fetch($object->fk_user);
$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1);
$morehtmlref .= '<br>'.$u_position->getNomUrl(1);
$job = new Job($db);
$job->fetch($object->fk_job);
$morehtmlref .= '<br>'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1);
$morehtmlref .= '<br>'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1);
$morehtmlref .= '</div>';
@ -196,21 +198,25 @@ if ($object->id > 0) {
//$out.="</a>";
}
$morehtmlright = '';
print '<div class="tabsAction">';
//$messagingUrl = DOL_URL_ROOT.'/societe/messaging.php?socid='.$object->id;
//$morehtmlright .= dolGetButtonTitle($langs->trans('ShowAsConversation'), '', 'fa fa-comments imgforviewmode', $messagingUrl, '', 1);
//$messagingUrl = DOL_URL_ROOT.'/societe/agenda.php?socid='.$object->id;
//$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fa fa-bars imgforviewmode', $messagingUrl, '', 2);
if (isModEnabled('agenda')) {
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
if ($user->hasRight('agenda', 'myactions', 'create') || $user->hasRight('agenda', 'allactions', 'create')) {
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
} else {
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', 0);
}
}
print '</div>';
if (isModEnabled('agenda') && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$param = '&id='.$object->id.'&socid='.(!empty($socid) ? '&socid='.$socid : '');
print '<br>';
$param = '&id='.$object->id.(!empty($socid) ? '&socid='.$socid : '');
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
@ -218,8 +224,8 @@ if ($object->id > 0) {
$param .= '&limit='.urlencode($limit);
}
//print load_fiche_titre($langs->trans("ActionsOnEvaluation"), '', '');
//print load_fiche_titre($langs->trans("ActionsOnMyObject"), '', '');
print_barre_liste($langs->trans("Actions"), 0, $_SERVER["PHP_SELF"], '', $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
// List of all actions
$filters = array();

View File

@ -407,10 +407,10 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= $langs->trans('Label').' : '.$object->label;
$u_position = new User(($db));
$u_position->fetch($object->fk_user);
$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1);
$morehtmlref .= '<br>'.$u_position->getNomUrl(1);
$job = new Job($db);
$job->fetch($object->fk_job);
$morehtmlref .= '<br>'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1);
$morehtmlref .= '<br>'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1);
$morehtmlref .= '</div>';

View File

@ -142,10 +142,10 @@ if ($object->id) {
$morehtmlref .= $langs->trans('Label').' : '.$object->label;
$u_position = new User(($db));
$u_position->fetch($object->fk_user);
$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1);
$morehtmlref .= '<br>'.$u_position->getNomUrl(1);
$job = new Job($db);
$job->fetch($object->fk_job);
$morehtmlref .= '<br>'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1);
$morehtmlref .= '<br>'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1);
$morehtmlref .= '</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);

View File

@ -135,10 +135,10 @@ if ($object->id) {
$morehtmlref .= $langs->trans('Label').' : '.$object->label;
$u_position = new User(($db));
$u_position->fetch($object->fk_user);
$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1);
$morehtmlref .= '<br>'.$u_position->getNomUrl(1);
$job = new Job($db);
$job->fetch($object->fk_job);
$morehtmlref .= '<br>'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1);
$morehtmlref .= '<br>'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1);
$morehtmlref .= '</div>';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -134,13 +134,13 @@ $object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
// Permissions
$permissiontoread = $user->rights->hrm->evaluation->read;
$permissiontoreadall = $user->rights->hrm->evaluation->readall;
$permissiontoadd = $user->rights->hrm->evaluation->write;
$permissiontodelete = $user->rights->hrm->evaluation->delete;
$permissiontoread = $user->hasRight('hrm', 'evaluation', 'read');
$permissiontoreadall = $user->hasRight('hrm', 'evaluation', 'readall');
$permissiontoadd = $user->hasRight('hrm', 'evaluation', 'write');
$permissiontodelete = $user->hasRight('hrm', 'evaluation', 'delete');
// Security check
if (empty($conf->hrm->enabled)) {
if (!isModEnabled('hrm')) {
accessforbidden('Module not enabled');
}

View File

@ -110,10 +110,10 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= $langs->trans('Label').' : '.$object->label;
$u_position = new User(($db));
$u_position->fetch($object->fk_user);
$morehtmlref .= '<br>'.$langs->trans('Employee').' : '.$u_position->getNomUrl(1);
$morehtmlref .= '<br>'.$u_position->getNomUrl(1);
$job = new Job($db);
$job->fetch($object->fk_job);
$morehtmlref .= '<br>'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1);
$morehtmlref .= '<br>'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1);
$morehtmlref .= '</div>';

View File

@ -208,7 +208,7 @@ $now = dol_now();
//$help_url="EN:Module_Job|FR:Module_Job_FR|ES:Módulo_Job";
$help_url = '';
$title = $langs->trans("JobsPosition");
$title = $langs->trans("JobsProfiles");
$morejs = array();
$morecss = array();

View File

@ -40,7 +40,7 @@ function jobPrepareHead($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT."/hrm/job_card.php?id=".$object->id;
$head[$h][1] = $langs->trans("JobPosition");
$head[$h][1] = $langs->trans("JobProfile");
$head[$h][2] = 'job_card';
$h++;

View File

@ -158,7 +158,7 @@ if ($object->id > 0) {
$morehtmlref .= ($u_position->id > 0 ? $u_position->getNomUrl(1) : $langs->trans('Employee').' : ');
$job = new Job($db);
$job->fetch($object->fk_job);
$morehtmlref .= '<br>'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1);
$morehtmlref .= '<br>'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1);
$morehtmlref .= '</div>';

View File

@ -288,7 +288,7 @@ function displayPositionCard(&$object)
$morehtmlref .= ($u_position->id > 0 ? $u_position->getNomUrl(1) : $langs->trans('Employee').' : ');
$job = new Job($db);
$job->fetch($object->fk_job);
$morehtmlref .= '<br>'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1);
$morehtmlref .= '<br>'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1);
$morehtmlref .= '</div>';
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);

View File

@ -136,7 +136,7 @@ if ($object->id) {
$morehtmlref .= ($u_position->id > 0 ? $u_position->getNomUrl(1) : $langs->trans('Employee').' : ');
$job = new Job($db);
$job->fetch($object->fk_job);
$morehtmlref .= '<br>'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1);
$morehtmlref .= '<br>'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1);
$morehtmlref .= '</div>';

View File

@ -109,7 +109,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ($u_position->id > 0 ? $u_position->getNomUrl(1) : $langs->trans('Employee').' : ');
$job = new Job($db);
$job->fetch($object->fk_job);
$morehtmlref .= '<br>'.$langs->trans('JobPosition').' : '.$job->getNomUrl(1);
$morehtmlref .= '<br>'.$langs->trans('JobProfile').' : '.$job->getNomUrl(1);
$morehtmlref .= '</div>';

View File

@ -558,3 +558,6 @@ ALTER TABLE llx_element_tag ADD CONSTRAINT fk_element_tag_categorie_rowid FOREIG
-- Idea is to update this column manually in v15 with value in currency of company for bank that are not into the main currency and the transfer
-- into accounting will use it in priority if value is not null. The script repair.sql contains the sequence to fix datas in llx_bank.
ALTER TABLE llx_bank ADD COLUMN amount_main_currency double(24,8) NULL;
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN ref varchar(128);
ALTER TABLE llx_facture_fourn_det MODIFY COLUMN ref varchar(128);

View File

@ -395,3 +395,6 @@ ALTER TABLE llx_opensurvey_user_studs ADD COLUMN date_creation datetime NULL;
ALTER TABLE llx_opensurvey_comments ADD COLUMN date_creation datetime NULL;
ALTER TABLE llx_c_tva ADD COLUMN use_default tinyint DEFAULT 0;
ALTER TABLE llx_commande_fournisseurdet MODIFY COLUMN ref varchar(128);
ALTER TABLE llx_facture_fourn_det MODIFY COLUMN ref varchar(128);

View File

@ -25,7 +25,7 @@ create table llx_commande_fournisseurdet
fk_commande integer NOT NULL,
fk_parent_line integer NULL,
fk_product integer,
ref varchar(50), -- supplier product ref
ref varchar(128), -- supplier product ref
label varchar(255), -- product label
description text,
vat_src_code varchar(10) DEFAULT '', -- Vat code used as source of vat fields. Not strict foreign key here.

View File

@ -24,7 +24,7 @@ create table llx_facture_fourn_det
fk_facture_fourn integer NOT NULL,
fk_parent_line integer NULL,
fk_product integer NULL,
ref varchar(50), -- supplier product ref
ref varchar(128), -- supplier product ref
label varchar(255), -- product label
description text,
pu_ht double(24,8), -- unit price excluding tax

View File

@ -903,9 +903,8 @@ if ($ok && GETPOST('clean_product_stock_batch', 'alpha')) {
$sql = "SELECT p.rowid, p.ref, p.tobatch, ps.rowid as psrowid, ps.fk_entrepot, ps.reel, SUM(pb.qty) as reelbatch";
$sql .= " FROM ".MAIN_DB_PREFIX."product as p, ".MAIN_DB_PREFIX."product_stock as ps LEFT JOIN ".MAIN_DB_PREFIX."product_batch as pb ON ps.rowid = pb.fk_product_stock";
$sql .= " WHERE p.rowid = ps.fk_product";
$sql .= " AND p.tobatch > 0";
$sql .= " GROUP BY p.rowid, p.ref, p.tobatch, ps.rowid, ps.fk_entrepot, ps.reel";
$sql .= " HAVING reel != SUM(pb.qty) or SUM(pb.qty) IS NULL";
$sql .= " HAVING (SUM(pb.qty) IS NOT NULL AND reel != SUM(pb.qty)) OR (SUM(pb.qty) IS NULL AND p.tobatch > 0)";
print $sql;
$resql = $db->query($sql);
if ($resql) {
@ -915,53 +914,73 @@ if ($ok && GETPOST('clean_product_stock_batch', 'alpha')) {
$i = 0;
while ($i < $num) {
$obj = $db->fetch_object($resql);
print '<tr><td>Product '.$obj->rowid.'-'.$obj->ref.' in warehouse '.$obj->fk_entrepot.' (product_stock id '.$obj->psrowid.'): '.$obj->reel.' (Stock product_stock.reel) != '.($obj->reelbatch ? $obj->reelbatch : '0').' (Stock batch sum product_batch)';
print '<tr><td>Product '.$obj->rowid.'-'.$obj->ref.' in warehouse id='.$obj->fk_entrepot.' (product_stock.id='.$obj->psrowid.'): '.$obj->reel.' (Stock product_stock.reel) != '.($obj->reelbatch ? $obj->reelbatch : '0').' (Stock batch sum product_batch)';
// Fix
// Fix is required
if ($obj->reel != $obj->reelbatch) {
if ($methodtofix == 'updatebatch') {
// Method 1
print ' -> Insert qty '.($obj->reel - $obj->reelbatch).' with lot 000000 linked to fk_product_stock='.$obj->psrowid;
if (empty($obj->tobatch)) {
// If product is not a product that support batches, we can clean stock by deleting the product batch lines
print ' -> Delete qty '.$obj->reelbatch.' for any lot linked to fk_product_stock='.$obj->psrowid;
$sql2 = "DELETE FROM ".MAIN_DB_PREFIX."product_batch";
$sql2 .= " WHERE fk_product_stock = ".((int) $obj->psrowid);
print '<br>'.$sql2;
if (GETPOST('clean_product_stock_batch') == 'confirmed') {
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_batch(fk_product_stock, batch, qty)";
$sql2 .= "VALUES(".$obj->psrowid.", '000000', ".($obj->reel - $obj->reelbatch).")";
$resql2 = $db->query($sql2);
if (!$resql2) {
// TODO If it fails, we must make update
//$sql2 ="UPDATE ".MAIN_DB_PREFIX."product_batch";
//$sql2.=" SET ".$obj->psrowid.", '000000', ".($obj->reel - $obj->reelbatch).")";
//$sql2.=" WHERE fk_product_stock = ".((int) $obj->psrowid)
}
}
}
if ($methodtofix == 'updatestock') {
// Method 2
print ' -> Update qty of product_stock with qty = '.($obj->reelbatch ? ((float) $obj->reelbatch) : '0').' for ps.rowid = '.((int) $obj->psrowid);
if (GETPOST('clean_product_stock_batch') == 'confirmed') {
$error = 0;
$db->begin();
$sql2 = "UPDATE ".MAIN_DB_PREFIX."product_stock";
$sql2 .= " SET reel = ".($obj->reelbatch ? ((float) $obj->reelbatch) : '0')." WHERE rowid = ".((int) $obj->psrowid);
$resql2 = $db->query($sql2);
if ($resql2) {
// We update product_stock, so we must fill p.stock into product too.
$sql3 = 'UPDATE '.MAIN_DB_PREFIX.'product p SET p.stock= (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid)';
$resql3 = $db->query($sql3);
if (!$resql3) {
$error++;
dol_print_error($db);
}
} else {
$error++;
dol_print_error($db);
}
}
} else {
if ($methodtofix == 'updatebatch') {
// Method 1
print ' -> Insert qty '.($obj->reel - $obj->reelbatch).' with lot 000000 linked to fk_product_stock='.$obj->psrowid;
$sql2 = "INSERT INTO ".MAIN_DB_PREFIX."product_batch(fk_product_stock, batch, qty)";
$sql2 .= "VALUES(".((int) $obj->psrowid).", '000000', ".((float) ($obj->reel - $obj->reelbatch)).")";
print '<br>'.$sql2;
if (!$error) {
$db->commit();
} else {
$db->rollback();
if (GETPOST('clean_product_stock_batch') == 'confirmed') {
$resql2 = $db->query($sql2);
if (!$resql2) {
// TODO If it fails, we must make update
//$sql2 ="UPDATE ".MAIN_DB_PREFIX."product_batch";
//$sql2.=" SET ".$obj->psrowid.", '000000', ".($obj->reel - $obj->reelbatch).")";
//$sql2.=" WHERE fk_product_stock = ".((int) $obj->psrowid)
}
}
}
if ($methodtofix == 'updatestock') {
// Method 2
print ' -> Update qty of product_stock with qty = '.($obj->reelbatch ? ((float) $obj->reelbatch) : '0').' for ps.rowid = '.((int) $obj->psrowid);
$sql2 = "UPDATE ".MAIN_DB_PREFIX."product_stock";
$sql2 .= " SET reel = ".($obj->reelbatch ? ((float) $obj->reelbatch) : '0')." WHERE rowid = ".((int) $obj->psrowid);
print '<br>'.$sql2;
if (GETPOST('clean_product_stock_batch') == 'confirmed') {
$error = 0;
$db->begin();
$resql2 = $db->query($sql2);
if ($resql2) {
// We update product_stock, so we must fill p.stock into product too.
$sql3 = 'UPDATE '.MAIN_DB_PREFIX.'product p SET p.stock= (SELECT SUM(ps.reel) FROM '.MAIN_DB_PREFIX.'product_stock ps WHERE ps.fk_product = p.rowid)';
$resql3 = $db->query($sql3);
if (!$resql3) {
$error++;
dol_print_error($db);
}
} else {
$error++;
dol_print_error($db);
}
if (!$error) {
$db->commit();
} else {
$db->rollback();
}
}
}
}

View File

@ -70,7 +70,7 @@ class KnowledgeManagement extends DolibarrApi
*/
public function get($id)
{
if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
throw new RestException(401);
}
@ -144,7 +144,7 @@ class KnowledgeManagement extends DolibarrApi
$obj_ret = array();
$tmpobject = new KnowledgeRecord($this->db);
if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->read) {
if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
throw new RestException(401);
}
@ -249,7 +249,7 @@ class KnowledgeManagement extends DolibarrApi
*/
public function post($request_data = null)
{
if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->write) {
if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'write')) {
throw new RestException(401);
}
@ -282,7 +282,7 @@ class KnowledgeManagement extends DolibarrApi
*/
public function put($id, $request_data = null)
{
if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->write) {
if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'write')) {
throw new RestException(401);
}
@ -324,7 +324,7 @@ class KnowledgeManagement extends DolibarrApi
*/
public function delete($id)
{
if (!DolibarrApiAccess::$user->rights->knowledgemanagement->knowledgerecord->delete) {
if (!DolibarrApiAccess::$user->hasRight('knowledgemanagement', 'knowledgerecord', 'delete')) {
throw new RestException(401);
}
$result = $this->knowledgerecord->fetch($id);

View File

@ -129,7 +129,15 @@ class KnowledgeRecord extends CommonObject
public $fk_user_valid;
public $import_key;
public $model_pdf;
/**
* @var string question asked
*/
public $question;
/**
* @var string answer to question
*/
public $answer;
public $url;
public $status;
@ -192,7 +200,7 @@ class KnowledgeRecord extends CommonObject
}
// Example to show how to set values of fields definition dynamically
/*if ($user->rights->knowledgemanagement->knowledgerecord->read) {
/*if ($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
$this->fields['myfield']['visible'] = 1;
$this->fields['myfield']['noteditable'] = 0;
}*/
@ -265,8 +273,8 @@ class KnowledgeRecord extends CommonObject
if (property_exists($object, 'ref')) {
$object->ref = empty($this->fields['ref']['default']) ? "Copy_Of_".$object->ref : $this->fields['ref']['default'];
}
if (property_exists($object, 'label')) {
$object->label = empty($this->fields['label']['default']) ? $langs->trans("CopyOf")." ".$object->label : $this->fields['label']['default'];
if (property_exists($object, 'question')) {
$object->question = empty($this->fields['question']['default']) ? $langs->trans("CopyOf")." ".$object->question : $this->fields['question']['default'];
}
if (property_exists($object, 'status')) {
$object->status = self::STATUS_DRAFT;
@ -530,7 +538,7 @@ class KnowledgeRecord extends CommonObject
return 0;
}
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgerecord->write))
/*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->knowledgemanagement->knowledgerecord->knowledgerecord_advance->validate))))
{
$this->error='NotEnoughPermissions';
@ -706,6 +714,39 @@ class KnowledgeRecord extends CommonObject
return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'KNOWLEDGERECORD_REOPEN');
}
/**
* getTooltipContentArray
*
* @param array $params ex option, infologin
* @since v18
* @return array
*/
public function getTooltipContentArray($params)
{
global $conf, $langs;
$langs->loadLangs(['knowledgemanagement', 'languages']);
$datas = [];
$nofetch = empty($params['nofetch']) ? false : true;
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("KnowledgeRecord").'</u>';
if (isset($this->statut)) {
$datas['picto'] .= ' '.$this->getLibStatut(5);
}
$datas['label'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$datas['question'] = '<br><b>'.$langs->trans('Question').':</b> '.$this->question;
$labellang = ($this->lang ? $langs->trans('Language_'.$this->lang) : '');
$datas['lang'] = '<br><b>'.$langs->trans('Language').':</b> ' . picto_from_langcode($this->lang, 'class="paddingrightonly saturatemedium opacitylow"') . $labellang;
// show categories for this record only in ajax to not overload lists
if (isModEnabled('categorie') && !$nofetch) {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
$form = new Form($this->db);
$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_KNOWLEDGEMANAGEMENT, 1);
}
return $datas;
}
/**
* Return a link to the object card (with optionaly the picto)
*
@ -726,12 +767,19 @@ class KnowledgeRecord extends CommonObject
$result = '';
$label = img_picto('', $this->picto).' <u>'.$langs->trans("KnowledgeRecord").'</u>';
if (isset($this->status)) {
$label .= ' '.$this->getLibStatut(5);
$params = [
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
'nofetch' => 1,
];
$classfortooltip = 'classfortooltip';
$dataparams = '';
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
$classfortooltip = 'classforajaxtooltip';
$dataparams = ' data-params='.json_encode($params);
}
$label .= '<br>';
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label = implode($this->getTooltipContentArray($params));
$url = dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?id='.$this->id;
@ -752,8 +800,8 @@ class KnowledgeRecord extends CommonObject
$label = $langs->trans("ShowKnowledgeRecord");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
$linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
} else {
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
}
@ -774,7 +822,7 @@ class KnowledgeRecord extends CommonObject
if (empty($this->showphoto_on_popup)) {
if ($withpicto) {
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1);
}
} else {
if ($withpicto) {

Some files were not shown because too many files have changed in this diff Show More