Merge branch 'Dolibarr:develop' into SELECT_PRODUITS_LIST

This commit is contained in:
marcusdeangabriel 2023-02-15 15:03:12 +01:00 committed by GitHub
commit e0c7d60b4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
467 changed files with 5575 additions and 2770 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

@ -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

@ -2153,7 +2153,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 +3118,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();
@ -4322,7 +4326,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);
}

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

@ -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

@ -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

@ -1371,12 +1371,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 +1419,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

@ -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

@ -5154,10 +5154,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'])) {
@ -8480,8 +8482,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);
@ -9801,7 +9808,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

@ -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("(",")");
@ -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

@ -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

@ -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) {

View File

@ -90,7 +90,7 @@ if ($id > 0 || !empty($ref)) {
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, '', 'rowid', $isdraft);
$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php
$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_addupdatedelete.inc.php
/*

View File

@ -74,12 +74,12 @@ if (empty($action) && empty($id) && empty($ref)) {
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
$permissiontoread = $user->rights->knowledgemanagement->knowledgerecord->read;
$permissiontovalidate = $user->rights->knowledgemanagement->knowledgerecord->write;
$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->rights->knowledgemanagement->knowledgerecord->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
$permissionnote = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_dellink.inc.php
$permissiontoread = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read');
$permissiontovalidate = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
$permissiontodelete = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'delete') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
$permissionnote = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_setnotes.inc.php
$permissiondellink = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_dellink.inc.php
$upload_dir = $conf->knowledgemanagement->multidir_output[isset($object->entity) ? $object->entity : 1];
// Security check - Protection if external user
@ -538,8 +538,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->knowledgemanagement->dir_output.'/'.$object->element.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed = $user->rights->knowledgemanagement->knowledgerecord->read; // If you can read, you can build the PDF to read content
$delallowed = $user->rights->knowledgemanagement->knowledgerecord->write; // If you can create/edit, you can remove a file on card
$genallowed = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read'); // If you can read, you can build the PDF to read content
$delallowed = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('knowledgemanagement:KnowledgeRecord', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
}

View File

@ -56,7 +56,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, '', 'rowid', $isdraft);
$permission = $user->rights->knowledgemanagement->knowledgerecord->write;
$permission = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
/*

View File

@ -81,7 +81,7 @@ if ($id > 0 || !empty($ref)) {
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->module, $object->id, $object->table_element, $object->element, '', 'rowid', $isdraft);
$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php
@ -183,9 +183,9 @@ if ($object->id) {
print dol_get_fiche_end();
$modulepart = 'knowledgemanagement';
//$permission = $user->rights->knowledgemanagement->knowledgerecord->write;
//$permission = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
$permission = 1;
//$permtoedit = $user->rights->knowledgemanagement->knowledgerecord->write;
//$permtoedit = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
$permtoedit = 1;
$param = '&id='.$object->id;

View File

@ -140,9 +140,9 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
$object->fields = dol_sort_array($object->fields, 'position');
$arrayfields = dol_sort_array($arrayfields, 'position');
$permissiontoread = $user->rights->knowledgemanagement->knowledgerecord->read;
$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write;
$permissiontodelete = $user->rights->knowledgemanagement->knowledgerecord->delete;
$permissiontoread = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read');
$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write');
$permissiontodelete = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'delete');
// Security check
if (empty($conf->knowledgemanagement->enabled)) {
@ -428,7 +428,7 @@ if ($permissiontodelete) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (isModEnabled('category') && $user->rights->knowledgemanagement->knowledgerecord->write) {
if (isModEnabled('category') && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write')) {
$arrayofmassactions['preaffecttag'] = img_picto('', 'category', 'class="pictofixedwidth"').$langs->trans("AffectTag");
}

View File

@ -52,8 +52,8 @@ if ($id > 0 || !empty($ref)) {
$upload_dir = $conf->knowledgemanagement->multidir_output[$object->entity]."/".$object->id;
}
$permissionnote = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_setnotes.inc.php
$permissiontoadd = $user->rights->knowledgemanagement->knowledgerecord->write; // Used by the include of actions_addupdatedelete.inc.php
$permissionnote = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_setnotes.inc.php
$permissiontoadd = $user->hasRight('knowledgemanagement', 'knowledgerecord', 'write'); // Used by the include of actions_addupdatedelete.inc.php
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();

View File

@ -451,7 +451,7 @@ ExtrafieldCheckBox=مربعات الاختيار
ExtrafieldCheckBoxFromList=مربعات الاختيار من الجدول
ExtrafieldLink=رابط إلى كائن
ComputedFormula=المجال المحسوب
ComputedFormulaDesc=يمكنك هنا إدخال صيغة باستخدام خصائص أخرى للكائن أو أي ترميز PHP للحصول على قيمة محسوبة ديناميكية. يمكنك استخدام أي صيغ متوافقة مع PHP بما في ذلك "؟" عامل الشرط ، والعنصر العام التالي: <strong> $ db ، $ conf ، $ langs ، $ mysoc ، $ user ، $ object </strong>. <br> <strong> تحذير </strong>: قد تتوفر بعض خصائص $ object فقط. إذا كنت بحاجة إلى خصائص غير محملة ، فما عليك سوى إحضار الكائن إلى الصيغة الخاصة بك كما في المثال الثاني. <br> يعني استخدام حقل محسوب أنه لا يمكنك إدخال أي قيمة لنفسك من الواجهة. أيضًا ، إذا كان هناك خطأ في بناء الجملة ، فقد لا ترجع الصيغة شيئًا. <br> <br> مثال على الصيغة: <br> $ object-> id < 10 ? round($object-> id / 2، 2): ($ object-> id + 2 * $ user-> id) * (int) substr ($ mysoc- 2> zip، 1 ) <br> <br> مثال لإعادة تحميل الكائن <br> (($ reloadedobj = new Societe ($ db)) && ($ reloadedobj-> fetchNoCompute ($ obj-> id؟ $ obj-> id؟ > rowid: $ object-> id))> 0))؟ $ reloadedobj-> array_options ['options_extrafieldkey'] * $ reloadedobj-> capital / 5: '-1' <br> <br> مثال آخر للصيغة لفرض تحميل الكائن وكائنه الأصلي: <br> (($ reloadedobj = $ dbj = )) && ($ reloadedobj-> fetchNoCompute ($ object-> id)> 0) && ($ secondloadedobj = مشروع جديد ($ db)) && ($ secondloadedobj-> fetchNoCompute ($ reloadedobj-> fk_project)> 0))؟ $ secondloadedobj-> ref: "المشروع الرئيسي غير موجود"
ComputedFormulaDesc=You can enter here a formula using other properties of object or any PHP coding to get a dynamic computed value. You can use any PHP compatible formulas including the "?" condition operator, and following global object: <strong>$db, $conf, $langs, $mysoc, $user, $objectoffield</strong>.<br><strong>WARNING</strong>: If you need properties of an object not loaded, just fetch yourself the object into your formula like in the second example.<br>Using a computed field means you can't enter yourself any value from interface. Also, if there is a syntax error, the formula may return nothing.<br><br>Example of formula:<br>$objectoffield->id < 10 ? round($objectoffield->id / 2, 2): ($objectoffield->id + 2 * $user->id) * (int) substr($mysoc->zip, 1, 2)<br><br>Example to reload object<br>(($reloadedobj = new Societe($db)) && ($reloadedobj->fetchNoCompute($objectoffield->id) > 0 ? $reloadedobj->array_options['options_extrafieldkey'] * $reloadedobj->capital / 5: '-1')<br><br>Other example of formula to force load of object and its parent object:<br>(($reloadedobj = new Task($db)) && ($reloadedobj->fetchNoCompute($objectoffield->id) > 0) && ($secondloadedobj = new Project($db)) && ($secondloadedobj->fetchNoCompute($reloadedobj->fk_project) > 0)) ? $secondloadedobj->ref: 'Parent project not found'
Computedpersistent=تخزين المجال المحسوب
ComputedpersistentDesc=سيتم تخزين الحقول الإضافية المحسوبة في قاعدة البيانات ، ومع ذلك ، سيتم إعادة حساب القيمة فقط عند تغيير كائن هذا الحقل. إذا كان الحقل المحسوب يعتمد على كائنات أخرى أو بيانات عالمية ، فقد تكون هذه القيمة خاطئة !!
ExtrafieldParamHelpPassword=يعني ترك هذا الحقل فارغًا أنه سيتم تخزين هذه القيمة بدون تشفير (يجب إخفاء الحقل فقط بنجمة على الشاشة). <br> اضبط "تلقائي" لاستخدام قاعدة التشفير الافتراضية لحفظ كلمة المرور في قاعدة البيانات (عندئذٍ ستكون القيمة المقروءة هي التجزئة فقط ، ولا توجد طريقة لاسترداد القيمة الأصلية)
@ -645,6 +645,8 @@ Module2300Name=المهام المجدولة
Module2300Desc=إدارة الوظائف المجدولة (الاسم المستعار كرون أو جدول كرونو)
Module2400Name=الأحداث / الأجندة
Module2400Desc=تتبع الأحداث. سجل الأحداث التلقائية لأغراض التتبع أو سجل الأحداث أو الاجتماعات اليدوية. هذه هي الوحدة الرئيسية للإدارة الجيدة لعلاقات العملاء أو البائعين.
Module2430Name=Booking Calendar System
Module2430Desc=Provide an online calendar to allow anyone to book rendez-vous, according to predefined ranges or availabilities.
Module2500Name=DMS / ECM
Module2500Desc=نظام إدارة الوثائق / إدارة المحتوى الإلكتروني. التنظيم التلقائي للمستندات التي تم إنشاؤها أو تخزينها. شاركهم عند الحاجة.
Module2600Name=API / Web services (SOAP server)
@ -660,6 +662,8 @@ Module2900Name=GeoIPMaxmind
Module2900Desc=GeoIP التحويلات Maxmind القدرات
Module3200Name=المحفوظات غير القابلة للتغيير
Module3200Desc=تمكين سجل غير قابل للتغيير لأحداث العمل. يتم أرشفة الأحداث في الوقت الحقيقي. السجل هو جدول للقراءة فقط للأحداث المتسلسلة التي يمكن تصديرها. قد تكون هذه الوحدة إلزامية لبعض البلدان.
Module3300Name=Module Builder
Module3200Desc=تمكين سجل غير قابل للتغيير لأحداث العمل. يتم أرشفة الأحداث في الوقت الحقيقي. السجل هو جدول للقراءة فقط للأحداث المتسلسلة التي يمكن تصديرها. قد تكون هذه الوحدة إلزامية لبعض البلدان.
Module3400Name=الشبكات الاجتماعية
Module3400Desc=قم بتمكين حقول الشبكات الاجتماعية في عناوين وعناوين الأطراف الثالثة (سكايب ، تويتر ، فيسبوك ، ...).
Module4000Name=HRM
@ -700,8 +704,10 @@ Module62000Name=شروط التجارة الدولية
Module62000Desc=إضافة ميزات لإدارة Incoterms
Module63000Name=مصادر
Module63000Desc=إدارة الموارد (طابعات ، سيارات ، غرف ، ...) لتخصيصها للمناسبات
Module66000Name=Enable OAuth2 authentication
Module66000Desc=Provide a tool to generate and manage OAuth2 tokens. The token can then be used by some other modules.
Module94160Name=Receptions
Permission11=قراءة الفواتير
Permission11=Read customer invoices (and payments)
Permission12=إنشاء / تعديل فواتير العملاء
Permission13=إبطال فواتير العميل
Permission14=التحقق من صحة الفواتير
@ -943,7 +949,7 @@ Permission1190=الموافقة على (الموافقة الثانية) أوا
Permission1191=أوامر تصدير الموردين وخصائصها
Permission1201=ونتيجة للحصول على التصدير
Permission1202=إنشاء / تعديل للتصدير
Permission1231=استعراض فاتورة المشتريات
Permission1231=Read vendor invoices (and payments)
Permission1232=Create/modify vendor invoices
Permission1233=Validate vendor invoices
Permission1234=احذف فواتير البائع
@ -1230,7 +1236,7 @@ SetupDescription4= <a href="%s"> %s -> %s </a> <br> <br> هذا البرنامج
SetupDescription5=قائمة الإعدادات الأخرى تقوم بإدارة المعطيات الاختيارية.
SetupDescriptionLink= <a href="%s"> %s - %s </a>
SetupDescription3b=المعلمات الأساسية المستخدمة لتخصيص السلوك الافتراضي لتطبيقك (مثل الميزات المتعلقة بالبلد).
SetupDescription4b=هذا البرنامج عبارة عن مجموعة من العديد من الوحدات / التطبيقات. يجب تمكين الوحدات النمطية المتعلقة باحتياجاتك وتكوينها. ستظهر إدخالات القائمة مع تنشيط هذه الوحدات.
SetupDescription4b=This software is a suite of many modules/applications. The modules related to your needs must be activated. Menu entries will appears with the activation of these modules.
AuditedSecurityEvents=الأحداث الأمنية التي يتم تدقيقها
NoSecurityEventsAreAduited=لم يتم تدقيق أي أحداث أمنية. يمكنك تمكينهم من القائمة %s
Audit=أحداث أمنية
@ -1270,6 +1276,7 @@ TriggerActiveAsModuleActive=المشغلات في هذا الملف نشطة ح
GeneratedPasswordDesc=اختر الطريقة التي سيتم استخدامها لكلمات المرور التي يتم إنشاؤها تلقائيًا.
DictionaryDesc=أدخل جميع البيانات المرجعية. يمكنك إضافة القيم الخاصة بك إلى الافتراضي.
ConstDesc=تتيح لك هذه الصفحة تحرير (تجاوز) المعلمات غير المتوفرة في الصفحات الأخرى. هذه معلمات محجوزة في الغالب للمطورين / استكشاف الأخطاء وإصلاحها المتقدمة فقط.
MiscellaneousOptions=Miscellaneous options
MiscellaneousDesc=يتم تعريف جميع المعلمات الأخرى المتعلقة بالأمان هنا.
LimitsSetup=حدود / الدقيقة الإعداد
LimitsDesc=يمكنك تحديد الحدود والدقة والتحسينات التي تستخدمها Dolibarr هنا
@ -1826,6 +1833,9 @@ AGENDA_USE_EVENT_TYPE=استخدام أنواع الأحداث (المُدارة
AGENDA_USE_EVENT_TYPE_DEFAULT=قم بتعيين هذه القيمة الافتراضية تلقائيًا لنوع الحدث في نموذج إنشاء الحدث
AGENDA_DEFAULT_FILTER_TYPE=عيِّن هذا النوع من الأحداث تلقائيًا في فلتر البحث لطريقة عرض الأجندة
AGENDA_DEFAULT_FILTER_STATUS=عيّن هذه الحالة تلقائيًا للأحداث في فلتر البحث لعرض جدول الأعمال
AGENDA_EVENT_PAST_COLOR=Past event color
AGENDA_EVENT_CURRENT_COLOR=Current event color
AGENDA_EVENT_FUTURE_COLOR=Future event color
AGENDA_DEFAULT_VIEW=أي طريقة عرض تريد فتحها بشكل افتراضي عند تحديد جدول أعمال القائمة
AGENDA_REMINDER_BROWSER=قم بتمكين تذكير الحدث <b> على متصفح المستخدم </b> (عند الوصول إلى تاريخ التذكير ، تظهر نافذة منبثقة بواسطة المتصفح. يمكن لكل مستخدم تعطيل هذه الإشعارات من إعداد إعلام المتصفح الخاص به).
AGENDA_REMINDER_BROWSER_SOUND=تمكين الإعلام الصوتي
@ -2129,6 +2139,7 @@ CodeLastResult=Latest result code
NbOfEmailsInInbox=عدد رسائل البريد الإلكتروني في دليل المصدر
LoadThirdPartyFromName=تحميل بحث الطرف الثالث على %s (تحميل فقط)
LoadThirdPartyFromNameOrCreate=قم بتحميل بحث الطرف الثالث على %s (أنشئ إذا لم يتم العثور عليه)
LoadContactFromEmailOrCreate=Load contact searching on %s (create if not found)
AttachJoinedDocumentsToObject=احفظ الملفات المرفقة في مستندات الكائن إذا تم العثور على مرجع لكائن في موضوع البريد الإلكتروني.
WithDolTrackingID=رسالة من محادثة بدأت بأول بريد إلكتروني مرسل من Dolibarr
WithoutDolTrackingID=رسالة من محادثة بدأها أول بريد إلكتروني لم يتم إرساله من Dolibarr
@ -2355,3 +2366,9 @@ AllowExternalDownload=Allow external download (without login, using a shared lin
DeadlineDayVATSubmission=Deadline day for vat submission on the next month
MaxNumberOfAttachementOnForms=Max number of joinded files in a form
IfDefinedUseAValueBeetween=If defined, use a value between %s and %s
Reload=Reload
ConfirmReload=Confirm module reload
WarningModuleHasChangedLastVersionCheckParameter=Warning: the module %s has set a parameter to check its version at each page access. This is a bad and not allowed practice that may make the page to administer modules instable. Please contact author of module to fix this.
WarningModuleHasChangedSecurityCsrfParameter=Warning: the module %s has disabled the CSRF security of your instance. This action is suspect and your installation may no more be secured. Please contact the author of the module for explanation.
EMailsInGoingDesc=Incoming emails are managed by the module %s. You must enable and configure it if you need to support ingoing emails.
MAIN_IMAP_USE_PHPIMAP=Use the PHP-IMAP library for IMAP instead of native PHP IMAP. This also allows the use of an OAuth2 connection for IMAP (module OAuth must also be activated).

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