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

This commit is contained in:
Laurent Destailleur 2022-12-17 11:43:49 +01:00
commit c489dbacfc
47 changed files with 337 additions and 188 deletions

View File

@ -49,7 +49,6 @@ NEW: Add employment anniversary in birthday box
NEW: Add extrafield type "IP" to store IP addresses NEW: Add extrafield type "IP" to store IP addresses
NEW: Add fail2ban rules examples to limit access to /public pages NEW: Add fail2ban rules examples to limit access to /public pages
NEW: Add filter "Product subject to lot/Serial" in stock per lot/serial NEW: Add filter "Product subject to lot/Serial" in stock per lot/serial
NEW: Add free membership amounts at the membership type level
NEW: Add hidden option MAIN_EMAIL_SUPPORT_ACK to restore Email ack checkbox (feature abandonned by mailers) NEW: Add hidden option MAIN_EMAIL_SUPPORT_ACK to restore Email ack checkbox (feature abandonned by mailers)
NEW: Add IMAP port setting on email collector module NEW: Add IMAP port setting on email collector module
NEW: Adding JAPAN Chart-of-Account and regions/departments NEW: Adding JAPAN Chart-of-Account and regions/departments
@ -67,7 +66,6 @@ NEW: Add option --force on CLI cron_run_jobs.php
NEW: Add option "Show price on the generated documents for receptions" NEW: Add option "Show price on the generated documents for receptions"
NEW: Add performance index (name for company and contact) and llx_bank_url(url_id) NEW: Add performance index (name for company and contact) and llx_bank_url(url_id)
NEW: Add picto property on sub-module for password generation NEW: Add picto property on sub-module for password generation
NEW: Add price to product box in TakePOS
NEW: add redirect on action confirm addconsumedline and addproduceline NEW: add redirect on action confirm addconsumedline and addproduceline
NEW: Add a new advanced permission "read price" NEW: Add a new advanced permission "read price"
NEW: Add substitution key __SENDEREMAIL_SIGNATURE__ NEW: Add substitution key __SENDEREMAIL_SIGNATURE__
@ -89,18 +87,11 @@ NEW: Can set a commercial discount by entering amount including VAT
NEW: Can set a monthly frequency (or multiple) in cron tasks. NEW: Can set a monthly frequency (or multiple) in cron tasks.
NEW: Can set start and end dates and comment on button "Activate all services" NEW: Can set start and end dates and comment on button "Activate all services"
NEW: can sort and preselected best supplier price NEW: can sort and preselected best supplier price
NEW: Website Can delete a whole website if disabled
NEW: Website Can remove a website template
NEW: Website can set header "Strict-Transport-Security" in web sites.
NEW: Website Can switch status of website and page from the website toolbar
NEW: Website Templates of websites are now directories and not zip into core repo
NEW: Website Add 4 other templates in website module
NEW: Can use products categories to make inventory NEW: Can use products categories to make inventory
NEW: Change filter type on tickets list into a multiselect combo NEW: Change filter type on tickets list into a multiselect combo
NEW: conf TIMESPENT_ALWAYS_UPDATE_THM, when it's on we always check current thm of user to update it in task time line NEW: conf TIMESPENT_ALWAYS_UPDATE_THM, when it's on we always check current thm of user to update it in task time line
NEW: constant PROPAL_NEW_AS_SIGNED NEW: constant PROPAL_NEW_AS_SIGNED
NEW: show date delivery planned on orders linked to company and product NEW: show date delivery planned on orders linked to company and product
NEW: default_lang for members
NEW: Default template of contract is not mandatory NEW: Default template of contract is not mandatory
NEW: Default values in extrafields are not more limited to 255 char. NEW: Default values in extrafields are not more limited to 255 char.
NEW: display currency in takepos menu NEW: display currency in takepos menu
@ -108,11 +99,21 @@ NEW: Enable online signature for interventions
NEW: Encrypt all sensitive constants in llx_const NEW: Encrypt all sensitive constants in llx_const
NEW: extrafield price with currency NEW: extrafield price with currency
NEW: filter on reception dates (from / to) in cheque paiement card NEW: filter on reception dates (from / to) in cheque paiement card
NEW: TakePOS Header Scroll in TakePOS NEW: Members: default_lang for members
NEW: TakePOS Add setup parameters, can setup terminal name NEW: Members: Table of membership types
NEW: TakePOS support of Stripe Terminal with Takepos NEW: Members: add free membership amounts at the membership type level
NEW: TakePOS Receipt preview in TakePOS setup NEW: TakePOS: Header Scroll in TakePOS
NEW: TakePOS different product list on smartphone NEW: TakePOS: add price to product box in TakePOS
NEW: TakePOS: add setup parameters, can setup terminal name
NEW: TakePOS: support of Stripe Terminal with TakePOS
NEW: TakePOS: Receipt preview in TakePOS setup
NEW: TakePOS: different product list on smartphone
NEW: Website: can delete a whole website if disabled
NEW: Website: can remove a website template
NEW: Website: can set header "Strict-Transport-Security" in web sites.
NEW: Website: can switch status of website and page from the website toolbar
NEW: Website: Templates of websites are now directories and not zip into core repo
NEW: Website: add 4 other templates in website module
NEW: If we select another view list mode, we keep it NEW: If we select another view list mode, we keep it
NEW: Init module bookcal NEW: Init module bookcal
NEW: Introduce dolEncrypt and dolDecrypt to be able to encrypt data in db NEW: Introduce dolEncrypt and dolDecrypt to be able to encrypt data in db
@ -121,7 +122,7 @@ NEW: invoice export : add accounting affectation
NEW: label on products categories filter NEW: label on products categories filter
NEW: The link "add to bookmark" is always on top in the bookmark popup NEW: The link "add to bookmark" is always on top in the bookmark popup
NEW: MAIN_SEARCH_CATEGORY_PRODUCT_ON_LISTS const to show category customer filter NEW: MAIN_SEARCH_CATEGORY_PRODUCT_ON_LISTS const to show category customer filter
NEW: Make module WebservicesClient deprecated. Use module WebHook instead NEW: Make module WebservicesClient deprecated. Use module WebHook instead.
NEW: manage no email with thirdparties (better for GDPR) NEW: manage no email with thirdparties (better for GDPR)
NEW: Manage Position (Rank) on Contract Lines NEW: Manage Position (Rank) on Contract Lines
NEW: Manage VAT on all lines on purchases cycle NEW: Manage VAT on all lines on purchases cycle
@ -159,7 +160,6 @@ NEW: SMTP using oauth2 authentication
NEW: can substitue project title in mail template NEW: can substitue project title in mail template
NEW: Supplier order list - Add column private and public note NEW: Supplier order list - Add column private and public note
NEW: Support IP type in extrafields NEW: Support IP type in extrafields
NEW: Table of membership types
NEW: The purge of files can purge only if older than a number of seconds NEW: The purge of files can purge only if older than a number of seconds
NEW: Update ActionComm type_code on email message ticket NEW: Update ActionComm type_code on email message ticket
NEW: VAT - Admin - Add information on deadline day for submission of VAT declaration NEW: VAT - Admin - Add information on deadline day for submission of VAT declaration

View File

@ -4,7 +4,7 @@
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2013 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr> * Copyright (C) 2013-2022 Open-DSI <support@open-dsi.fr>
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com> * Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2017-2021 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2017-2021 Frédéric France <frederic.france@netlogic.fr>
@ -1415,9 +1415,19 @@ function getSourceDocRef($val, $typerecord)
$sqlmid = ''; $sqlmid = '';
if ($typerecord == 'payment') { if ($typerecord == 'payment') {
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref'; if (getDolGlobalInt('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS')) {
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f"; $sqlmid = "SELECT payfac.fk_facture as id, ".$db->ifsql('f1.rowid IS NULL', 'f.ref', 'f1.ref')." as ref";
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".((int) $val["paymentid"]); $sqlmid .= " FROM ".$db->prefix()."paiement_facture as payfac";
$sqlmid .= " LEFT JOIN ".$db->prefix()."facture as f ON f.rowid = payfac.fk_facture";
$sqlmid .= " LEFT JOIN ".$db->prefix()."societe_remise_except as sre ON sre.fk_facture_source = payfac.fk_facture";
$sqlmid .= " LEFT JOIN ".$db->prefix()."facture as f1 ON f1.rowid = sre.fk_facture";
$sqlmid .= " WHERE payfac.fk_paiement=".((int) $val['paymentid']);
} else {
$sqlmid = "SELECT payfac.fk_facture as id, f.ref as ref";
$sqlmid .= " FROM ".$db->prefix()."paiement_facture as payfac";
$sqlmid .= " INNER JOIN ".$db->prefix()."facture as f ON f.rowid = payfac.fk_facture";
$sqlmid .= " WHERE payfac.fk_paiement=".((int) $val['paymentid']);
}
$ref = $langs->transnoentitiesnoconv("Invoice"); $ref = $langs->transnoentitiesnoconv("Invoice");
} elseif ($typerecord == 'payment_supplier') { } elseif ($typerecord == 'payment_supplier') {
$sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref'; $sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref';

View File

@ -204,6 +204,7 @@ class BlockedLog
} }
// Add more action to track from a conf variable // Add more action to track from a conf variable
// For example: STOCK_MOVEMENT,...
if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) { if (!empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED)) {
$tmparrayofmoresupportedevents = explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED); $tmparrayofmoresupportedevents = explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED);
foreach ($tmparrayofmoresupportedevents as $val) { foreach ($tmparrayofmoresupportedevents as $val) {
@ -305,6 +306,15 @@ class BlockedLog
} else { } else {
$this->error++; $this->error++;
} }
} elseif ($this->element === 'stockmouvement') {
require_once DOL_DOCUMENT_ROOT.'/product/stock/class/mouvementstock.class.php';
$object = new MouvementStock($this->db);
if ($object->fetch($this->fk_object) > 0) {
return $object->getNomUrl(1);
} else {
$this->error++;
}
} elseif ($this->action == 'MODULE_SET') { } elseif ($this->action == 'MODULE_SET') {
return '<i class="opacitymedium">'.$langs->trans("BlockedLogEnabled").'</i>'; return '<i class="opacitymedium">'.$langs->trans("BlockedLogEnabled").'</i>';
} elseif ($this->action == 'MODULE_RESET') { } elseif ($this->action == 'MODULE_RESET') {
@ -378,9 +388,14 @@ class BlockedLog
$this->date_object = $object->dateh; $this->date_object = $object->dateh;
} elseif ($object->element == 'cashcontrol') { } elseif ($object->element == 'cashcontrol') {
$this->date_object = $object->date_creation; $this->date_object = $object->date_creation;
} else { } elseif (property_exists($object, 'date')) {
// Generic case
$this->date_object = $object->date; $this->date_object = $object->date;
} elseif (property_exists($object, 'datem')) {
// Generic case (second chance, for example for stock movement)
$this->date_object = $object->datem;
} }
// ref // ref
$this->ref_object = ((!empty($object->newref)) ? $object->newref : $object->ref); // newref is set when validating a draft, ref is set in other cases $this->ref_object = ((!empty($object->newref)) ? $object->newref : $object->ref); // newref is set when validating a draft, ref is set in other cases
// type of object // type of object
@ -395,11 +410,18 @@ class BlockedLog
$arrayoffieldstoexclude = array( $arrayoffieldstoexclude = array(
'table_element', 'fields', 'ref_previous', 'ref_next', 'origin', 'origin_id', 'oldcopy', 'picto', 'error', 'errors', 'model_pdf', 'modelpdf', 'last_main_doc', 'civility_id', 'contact', 'contact_id', 'table_element', 'fields', 'ref_previous', 'ref_next', 'origin', 'origin_id', 'oldcopy', 'picto', 'error', 'errors', 'model_pdf', 'modelpdf', 'last_main_doc', 'civility_id', 'contact', 'contact_id',
'table_element_line', 'ismultientitymanaged', 'isextrafieldmanaged', 'table_element_line', 'ismultientitymanaged', 'isextrafieldmanaged',
'array_languages',
'childtables',
'contact_ids',
'context',
'labelStatus',
'labelStatusShort',
'linkedObjectsIds', 'linkedObjectsIds',
'linkedObjects', 'linkedObjects',
'fk_delivery_address', 'fk_delivery_address',
'context', 'projet', // There is already ->fk_project
'projet' // There is already ->fk_project 'restrictiononfksoc',
'specimen',
); );
// Add more fields to exclude depending on object type // Add more fields to exclude depending on object type
if ($this->element == 'cashcontrol') { if ($this->element == 'cashcontrol') {
@ -428,7 +450,7 @@ class BlockedLog
continue; // Discard if not into a dedicated list continue; // Discard if not into a dedicated list
} }
if (!is_object($value) && !is_null($value) && $value !== '') { if (!is_object($value) && !is_null($value) && $value !== '') {
$this->object_data->thirdparty->{$key} = $value; $this->object_data->thirdparty->$key = $value;
} }
} }
} }
@ -448,7 +470,7 @@ class BlockedLog
continue; // Discard if not into a dedicated list continue; // Discard if not into a dedicated list
} }
if (!is_object($value) && !is_null($value) && $value !== '') { if (!is_object($value) && !is_null($value) && $value !== '') {
$this->object_data->mycompany->{$key} = $value; $this->object_data->mycompany->$key = $value;
} }
} }
} }
@ -486,12 +508,12 @@ class BlockedLog
} }
if (!is_object($valueline) && !is_null($valueline) && $valueline !== '') { if (!is_object($valueline) && !is_null($valueline) && $valueline !== '') {
$this->object_data->invoiceline[$lineid]->{$keyline} = $valueline; $this->object_data->invoiceline[$lineid]->$keyline = $valueline;
} }
} }
} }
} elseif (!is_object($value) && !is_null($value) && $value !== '') { } elseif (!is_object($value) && !is_null($value) && $value !== '') {
$this->object_data->{$key} = $value; $this->object_data->$key = $value;
} }
} }
@ -509,7 +531,7 @@ class BlockedLog
continue; // Discard if not into a dedicated list continue; // Discard if not into a dedicated list
} }
if (!is_object($value) && !is_null($value) && $value !== '') { if (!is_object($value) && !is_null($value) && $value !== '') {
$this->object_data->{$key} = $value; $this->object_data->$key = $value;
} }
} }
@ -601,7 +623,7 @@ class BlockedLog
continue; // Discard if not into a dedicated list continue; // Discard if not into a dedicated list
} }
if (!is_object($value) && !is_null($value) && $value !== '') { if (!is_object($value) && !is_null($value) && $value !== '') {
$paymentpart->thirdparty->{$key} = $value; $paymentpart->thirdparty->$key = $value;
} }
} }
} }
@ -625,11 +647,11 @@ class BlockedLog
} }
if (!is_object($value) && !is_null($value) && $value !== '') { if (!is_object($value) && !is_null($value) && $value !== '') {
if ($this->element == 'payment_donation') { if ($this->element == 'payment_donation') {
$paymentpart->donation->{$key} = $value; $paymentpart->donation->$key = $value;
} elseif ($this->element == 'payment_various') { } elseif ($this->element == 'payment_various') {
$paymentpart->various->{$key} = $value; $paymentpart->various->$key = $value;
} else { } else {
$paymentpart->invoice->{$key} = $value; $paymentpart->invoice->$key = $value;
} }
} }
} }
@ -664,21 +686,30 @@ class BlockedLog
continue; // Discard if not into a dedicated list continue; // Discard if not into a dedicated list
} }
if (!is_object($value) && !is_null($value) && $value !== '') { if (!is_object($value) && !is_null($value) && $value !== '') {
$this->object_data->{$key} = $value; $this->object_data->$key = $value;
} }
} }
if (!empty($object->newref)) { if (!empty($object->newref)) {
$this->object_data->ref = $object->newref; $this->object_data->ref = $object->newref;
} }
} else // Generic case } elseif ($this->element == 'stockmouvement') {
{
foreach ($object as $key => $value) { foreach ($object as $key => $value) {
if (in_array($key, $arrayoffieldstoexclude)) { if (in_array($key, $arrayoffieldstoexclude)) {
continue; // Discard some properties continue; // Discard some properties
} }
if (!is_object($value) && !is_null($value) && $value !== '') { if (!is_object($value) && !is_null($value) && $value !== '') {
$this->object_data->{$key} = $value; $this->object_data->$key = $value;
}
}
} else {
// Generic case
foreach ($object as $key => $value) {
if (in_array($key, $arrayoffieldstoexclude)) {
continue; // Discard some properties
}
if (!is_object($value) && !is_null($value) && $value !== '') {
$this->object_data->$key = $value;
} }
} }

View File

@ -134,7 +134,7 @@ if ($tmp) {
* Draft customer proposals * Draft customer proposals
*/ */
if (isModEnabled("propal") && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->hasRight("propal", "lire")) {
$sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status"; $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";
@ -232,7 +232,7 @@ if (isModEnabled("propal") && $user->rights->propal->lire) {
* Draft supplier proposals * Draft supplier proposals
*/ */
if (isModEnabled('supplier_proposal') && $user->rights->supplier_proposal->lire) { if (isModEnabled('supplier_proposal') && $user->hasRight("supplier_proposal", "lire")) {
$sql = "SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status"; $sql = "SELECT p.rowid, p.ref, p.total_ht, p.total_tva, p.total_ttc, p.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";
@ -427,7 +427,7 @@ if (isModEnabled('commande') && $user->rights->commande->lire) {
* Draft purchase orders * Draft purchase orders
*/ */
if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->commande->lire) || (isModEnabled("supplier_order") && $user->rights->supplier_order->lire)) { if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "commande", "lire")) || (isModEnabled("supplier_order") && $user->hasRight("supplier_order", "lire"))) {
$sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status"; $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ht, cf.total_tva, cf.total_ttc, cf.fk_statut as status";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";
@ -819,7 +819,7 @@ if (((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERM
/* /*
* Latest contracts * Latest contracts
*/ */
if (isModEnabled('contrat') && $user->rights->contrat->lire && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT if (isModEnabled('contrat') && $user->hasRight("contrat", "lire") && 0) { // TODO A REFAIRE DEPUIS NOUVEAU CONTRAT
$staticcontrat = new Contrat($db); $staticcontrat = new Contrat($db);
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias"; $sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
@ -897,7 +897,7 @@ if (isModEnabled('contrat') && $user->rights->contrat->lire && 0) { // TODO A RE
/* /*
* Opened (validated) proposals * Opened (validated) proposals
*/ */
if (isModEnabled("propal") && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->hasRight("propal", "lire")) {
$sql = "SELECT p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql = "SELECT p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
$sql .= ", s.rowid as socid, s.nom as name, s.name_alias"; $sql .= ", s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client"; $sql .= ", s.code_client, s.code_compta, s.client";

View File

@ -1868,7 +1868,7 @@ if ($action == 'create' && $usercancreate) {
// Incoterms // Incoterms
if (isModEnabled('incoterm')) { if (isModEnabled('incoterm')) {
print '<tr>'; print '<tr>';
print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->label_incoterms, 1).'</label></td>'; print '<td><label for="incoterm_id">'.$form->textwithpicto($langs->trans("IncotermLabel"), !empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : $soc->fk_incoterms, 1).'</label></td>';
print '<td class="maxwidthonsmartphone">'; print '<td class="maxwidthonsmartphone">';
$incoterm_id = GETPOST('incoterm_id'); $incoterm_id = GETPOST('incoterm_id');
$incoterm_location = GETPOST('location_incoterms'); $incoterm_location = GETPOST('location_incoterms');

View File

@ -201,10 +201,10 @@ $arrayfields = array(
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>110), 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1), 'position'=>110),
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115),
'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116), 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116),
'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous ? 0 : 1)), 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") ? 0 : 1)),
'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)),
'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (!isModEnabled('margin') || !$user->hasRight("margins", "liretous") || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)),
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120), 'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120),
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125), 'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125),
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130),
@ -298,19 +298,19 @@ if (empty($reshook)) {
// Mass actions // Mass actions
$objectclass = 'Commande'; $objectclass = 'Commande';
$objectlabel = 'Orders'; $objectlabel = 'Orders';
$permissiontoread = $user->rights->commande->lire; $permissiontoread = $user->hasRight("commande", "lire");
$permissiontoadd = $user->rights->commande->creer; $permissiontoadd = $user->hasRight("commande", "creer");
$permissiontodelete = $user->rights->commande->supprimer; $permissiontodelete = $user->hasRight("commande", "supprimer");
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) { if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
$permissiontovalidate = $user->rights->commande->order_advance->validate; $permissiontovalidate = $user->hasRight("commande", "order_advance", "validate");
$permissiontoclose = $user->rights->commande->order_advance->close; $permissiontoclose = $user->hasRight("commande", "order_advance", "close");
$permissiontocancel = $user->rights->commande->order_advance->annuler; $permissiontocancel = $user->hasRight("commande", "order_advance", "annuler");
$permissiontosendbymail = $user->rights->commande->order_advance->send; $permissiontosendbymail = $user->hasRight("commande", "order_advance", "send");
} else { } else {
$permissiontovalidate = $user->rights->commande->creer; $permissiontovalidate = $user->hasRight("commande", "creer");
$permissiontoclose = $user->rights->commande->creer; $permissiontoclose = $user->hasRight("commande", "creer");
$permissiontocancel = $user->rights->commande->creer; $permissiontocancel = $user->hasRight("commande", "creer");
$permissiontosendbymail = $user->rights->commande->creer; $permissiontosendbymail = $user->hasRight("commande", "creer");
} }
$uploaddir = $conf->commande->multidir_output[$conf->entity]; $uploaddir = $conf->commande->multidir_output[$conf->entity];
$triggersendname = 'ORDER_SENTBYMAIL'; $triggersendname = 'ORDER_SENTBYMAIL';
@ -1287,7 +1287,7 @@ if ($resql) {
if ($permissiontocancel) { if ($permissiontocancel) {
$arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel"); $arrayofmassactions['cancelorders'] = img_picto('', 'close_title', 'class="pictofixedwidth"').$langs->trans("Cancel");
} }
if (isModEnabled('facture') && $user->rights->facture->creer) { if (isModEnabled('facture') && $user->hasRight("facture", "creer")) {
$arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer"); $arrayofmassactions['createbills'] = img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("CreateInvoiceForThisCustomer");
} }
if ($permissiontoclose) { if ($permissiontoclose) {
@ -1394,7 +1394,7 @@ if ($resql) {
$moreforfilter = ''; $moreforfilter = '';
// If the user can view prospects? sales other than his own // If the user can view prospects? sales other than his own
if ($user->rights->user->user->lire) { if ($user->hasRight("user", "user", "lire")) {
$langs->load("commercial"); $langs->load("commercial");
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
@ -1402,7 +1402,7 @@ if ($resql) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If the user can view other users // If the user can view other users
if ($user->rights->user->user->lire) { if ($user->hasRight("user", "user", "lire")) {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('LinkedToSpecificUsers'); $tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx'); $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
@ -1410,7 +1410,7 @@ if ($resql) {
} }
// If the user can view other products/services than his own // If the user can view other products/services than his own
if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag'); $tmptitle = $langs->trans('IncludingProductWithTag');
@ -1419,7 +1419,7 @@ if ($resql) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If Categories are enabled & user has rights to see // If Categories are enabled & user has rights to see
if (isModEnabled('categorie') && $user->rights->categorie->lire) { if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); $tmptitle = $langs->trans('CustomersProspectsCategoriesShort');

View File

@ -376,9 +376,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
if (empty($reshook)) { if (empty($reshook)) {
$objectclass = 'Facture'; $objectclass = 'Facture';
$objectlabel = 'Invoices'; $objectlabel = 'Invoices';
$permissiontoread = $user->rights->facture->lire; $permissiontoread = $user->hasRight("facture", "lire");
$permissiontoadd = $user->rights->facture->creer; $permissiontoadd = $user->hasRight("facture", "creer");
$permissiontodelete = $user->rights->facture->supprimer; $permissiontodelete = $user->hasRight("facture", "supprimer");
$uploaddir = $conf->facture->dir_output; $uploaddir = $conf->facture->dir_output;
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
} }
@ -1185,7 +1185,7 @@ if ($resql) {
if (!empty($socid)) { if (!empty($socid)) {
$url .= '&socid='.$socid; $url .= '&socid='.$socid;
} }
$newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->rights->facture->creer); $newcardbutton = dolGetButtonTitle($langs->trans('NewBill'), '', 'fa fa-plus-circle', $url, '', $user->hasRight("facture", "creer"));
} }
$i = 0; $i = 0;
@ -1237,7 +1237,7 @@ if ($resql) {
// If the user can view prospects other than his' // If the user can view prospects other than his'
$moreforfilter = ''; $moreforfilter = '';
if ($user->rights->user->user->lire) { if ($user->hasRight("user", "user", "lire")) {
$langs->load("commercial"); $langs->load("commercial");
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
@ -1245,14 +1245,14 @@ if ($resql) {
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// If the user can view prospects other than his' // If the user can view prospects other than his'
if ($user->rights->user->user->lire) { if ($user->hasRight("user", "user", "lire")) {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('LinkedToSpecificUsers'); $tmptitle = $langs->trans('LinkedToSpecificUsers');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250'); $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250');
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
// Filter on product tags // Filter on product tags
if (isModEnabled('categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) { if (isModEnabled('categorie') && $user->hasRight("categorie", "lire") && ($user->hasRight("produit", "lire") || $user->hasRight("service", "lire"))) {
include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('IncludingProductWithTag'); $tmptitle = $langs->trans('IncludingProductWithTag');
@ -1260,7 +1260,7 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth250', 1); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth250', 1);
$moreforfilter .= '</div>'; $moreforfilter .= '</div>';
} }
if (isModEnabled('categorie') && $user->rights->categorie->lire) { if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('CustomersProspectsCategoriesShort'); $tmptitle = $langs->trans('CustomersProspectsCategoriesShort');
@ -2574,8 +2574,8 @@ if ($resql) {
$urlsource .= str_replace('&amp;', '&', $param); $urlsource .= str_replace('&amp;', '&', $param);
$filedir = $diroutputmassaction; $filedir = $diroutputmassaction;
$genallowed = $user->rights->facture->lire; $genallowed = $user->hasRight("facture", "lire");
$delallowed = $user->rights->facture->creer; $delallowed = $user->hasRight("facture", "creer");
$title = ''; $title = '';
print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty); print $formfile->showdocuments('massfilesarea_invoices', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);

View File

@ -281,7 +281,7 @@ if (isModEnabled('facture') && !empty($user->rights->facture->lire)) {
// Last modified supplier invoices // Last modified supplier invoices
if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) { if ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire")) || (isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) {
$langs->load("boxes"); $langs->load("boxes");
$facstatic = new FactureFournisseur($db); $facstatic = new FactureFournisseur($db);
@ -590,7 +590,7 @@ if (isModEnabled('tax') && !empty($user->rights->tax->charges->lire)) {
/* /*
* Customers orders to be billed * Customers orders to be billed
*/ */
if (isModEnabled('facture') && isModEnabled('commande') && $user->rights->commande->lire && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) { if (isModEnabled('facture') && isModEnabled('commande') && $user->hasRight("commande", "lire") && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
$commandestatic = new Commande($db); $commandestatic = new Commande($db);
$langs->load("orders"); $langs->load("orders");

View File

@ -362,31 +362,31 @@ if ($type == 'directory') {
if ($module == 'medias') { if ($module == 'medias') {
$useinecm = 6; $useinecm = 6;
$modulepart = 'medias'; $modulepart = 'medias';
$perm = ($user->rights->website->write || $user->rights->emailing->creer); $perm = ($user->hasRight("website", "write") || $user->hasRight("emailing", "creer"));
$title = 'none'; $title = 'none';
} elseif ($module == 'ecm') { // DMS/ECM -> manual structure } elseif ($module == 'ecm') { // DMS/ECM -> manual structure
if ($user->rights->ecm->read) { if ($user->hasRight("ecm", "read")) {
// Buttons: Preview // Buttons: Preview
$useinecm = 2; $useinecm = 2;
} }
if ($user->rights->ecm->upload) { if ($user->hasRight("ecm", "upload")) {
// Buttons: Preview + Delete // Buttons: Preview + Delete
$useinecm = 4; $useinecm = 4;
} }
if ($user->rights->ecm->setup) { if ($user->hasRight("ecm", "setup")) {
// Buttons: Preview + Delete + Edit // Buttons: Preview + Delete + Edit
$useinecm = 5; $useinecm = 5;
} }
$perm = $user->rights->ecm->upload; $perm = $user->hasRight("ecm", "upload");
$modulepart = 'ecm'; $modulepart = 'ecm';
$title = ''; // Use default $title = ''; // Use default
} else { } else {
$useinecm = 5; $useinecm = 5;
$modulepart = 'ecm'; $modulepart = 'ecm';
$perm = $user->rights->ecm->upload; $perm = $user->hasRight("ecm", "upload");
$title = ''; // Use default $title = ''; // Use default
} }

View File

@ -68,22 +68,22 @@ $arrayresult = array();
// Define $searchform // Define $searchform
if (isModEnabled('adherent') && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->hasRight('adherent', 'lire')) { if (isModEnabled('adherent') && empty($conf->global->MAIN_SEARCHFORM_ADHERENT_DISABLED) && $user->hasRight('adherent', 'lire')) {
$arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintomember'] = array('position'=>8, 'shortcut'=>'M', 'img'=>'object_member', 'label'=>$langs->trans("SearchIntoMembers", $search_boxvalue), 'text'=>img_picto('', 'object_member', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMembers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/adherents/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (((isModEnabled('societe') && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice'))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->hasRight('societe', 'lire')) { if (((isModEnabled('societe') && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || isModEnabled('supplier_order') || isModEnabled('supplier_invoice'))) && empty($conf->global->MAIN_SEARCHFORM_SOCIETE_DISABLED) && $user->hasRight('societe', 'lire')) {
$arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintothirdparty'] = array('position'=>10, 'shortcut'=>'T', 'img'=>'object_company', 'label'=>$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'text'=>img_picto('', 'object_company', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoThirdparties", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/societe/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('societe') && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->hasRight('societe', 'lire')) { if (isModEnabled('societe') && empty($conf->global->MAIN_SEARCHFORM_CONTACT_DISABLED) && $user->hasRight('societe', 'lire')) {
$arrayresult['searchintocontact'] = array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('', 'object_contact', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintocontact'] = array('position'=>15, 'shortcut'=>'A', 'img'=>'object_contact', 'label'=>$langs->trans("SearchIntoContacts", $search_boxvalue), 'text'=>img_picto('', 'object_contact', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContacts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contact/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (((isModEnabled('product') && $user->hasRight('product', 'read')) || (isModEnabled('service') && $user->hasRight('service', 'read'))) && empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) { if (((isModEnabled('product') && $user->hasRight('product', 'read')) || (isModEnabled('service') && $user->hasRight('service', 'read'))) && empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_DISABLED)) {
$arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintoproduct'] = array('position'=>30, 'shortcut'=>'P', 'img'=>'object_product', 'label'=>$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'text'=>img_picto('', 'object_product', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoProductsOrServices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
// search on lot/serial numbers // search on lot/serial numbers
if (isModEnabled('productbatch')) { if (isModEnabled('productbatch')) {
$arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_lot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintobatch'] = array('position'=>32, 'shortcut'=>'B', 'img'=>'object_lot', 'label'=>$langs->trans("SearchIntoBatch", $search_boxvalue), 'text'=>img_picto('', 'object_lot', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoBatch", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/product/stock/productlot_list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
} }
@ -98,26 +98,26 @@ if (isModEnabled('project') && empty($conf->global->MAIN_SEARCHFORM_TASK_DISABLE
} }
if (isModEnabled('propal') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->hasRight('propal', 'lire')) { if (isModEnabled('propal') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_PROPAL_DISABLED) && $user->hasRight('propal', 'lire')) {
$arrayresult['searchintopropal'] = array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintopropal'] = array('position'=>60, 'img'=>'object_propal', 'label'=>$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'text'=>img_picto('', 'object_propal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/comm/propal/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('commande') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->hasRight('commande', 'lire')) { if (isModEnabled('commande') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_ORDER_DISABLED) && $user->hasRight('commande', 'lire')) {
$arrayresult['searchintoorder'] = array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintoorder'] = array('position'=>70, 'img'=>'object_order', 'label'=>$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'text'=>img_picto('', 'object_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('expedition') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->hasRight('expedition', 'lire')) { if (isModEnabled('expedition') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_SHIPMENT_DISABLED) && $user->hasRight('expedition', 'lire')) {
$arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintoshipment'] = array('position'=>80, 'img'=>'object_shipment', 'label'=>$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'text'=>img_picto('', 'object_shipment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerShipments", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expedition/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->hasRight('facture', 'lire')) { if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INVOICE_DISABLED) && $user->hasRight('facture', 'lire')) {
$arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintoinvoice'] = array('position'=>90, 'img'=>'object_bill', 'label'=>$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_bill', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/compta/facture/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('supplier_proposal') && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->hasRight('supplier_proposal', 'lire')) { if (isModEnabled('supplier_proposal') && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_PROPAL_DISABLED) && $user->hasRight('supplier_proposal', 'lire')) {
$arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_supplier_proposal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintosupplierpropal'] = array('position'=>100, 'img'=>'object_supplier_proposal', 'label'=>$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_proposal', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierProposals", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/supplier_proposal/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight('fournisseur', 'commande', 'lire')) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire'))) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED)) { if (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight('fournisseur', 'commande', 'lire')) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire'))) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_ORDER_DISABLED)) {
$arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_supplier_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : '')); $arrayresult['searchintosupplierorder'] = array('position'=>110, 'img'=>'object_supplier_order', 'label'=>$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_order', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierOrders", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/commande/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight('fournisseur', 'facture', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) { if (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight('fournisseur', 'facture', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && empty($conf->global->MAIN_SEARCHFORM_SUPPLIER_INVOICE_DISABLED)) {
$arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_supplier_invoice', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintosupplierinvoice'] = array('position'=>120, 'img'=>'object_supplier_invoice', 'label'=>$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'text'=>img_picto('', 'object_supplier_invoice', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoSupplierInvoices", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fourn/facture/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
// Customer payments // Customer payments
@ -127,7 +127,7 @@ if (isModEnabled('facture') && empty($conf->global->MAIN_SEARCHFORM_CUSTOMER_INV
'img'=>'object_payment', 'img'=>'object_payment',
'label'=>$langs->trans("SearchIntoCustomerPayments", $search_boxvalue), 'label'=>$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerPayments", $search_boxvalue), 'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoCustomerPayments", $search_boxvalue),
'url'=>DOL_URL_ROOT.'/compta/paiement/list.php?leftmenu=customers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); 'url'=>DOL_URL_ROOT.'/compta/paiement/list.php?leftmenu=customers_bills_payment'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
} }
// Vendor payments // Vendor payments
@ -137,7 +137,7 @@ if (((isModEnabled('fournisseur') && empty($conf->global->MAIN_USE_NEW_SUPPLIERM
'img'=>'object_payment', 'img'=>'object_payment',
'label'=>$langs->trans("SearchIntoVendorPayments", $search_boxvalue), 'label'=>$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoVendorPayments", $search_boxvalue), 'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoVendorPayments", $search_boxvalue),
'url'=>DOL_URL_ROOT.'/fourn/paiement/list.php?leftmenu=suppliers_bills_payment'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); 'url'=>DOL_URL_ROOT.'/fourn/paiement/list.php?leftmenu=suppliers_bills_payment'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
} }
// Miscellaneous payments // Miscellaneous payments
@ -147,28 +147,31 @@ if (isModEnabled('banque') && empty($conf->global->MAIN_SEARCHFORM_MISC_PAYMENTS
'img'=>'object_payment', 'img'=>'object_payment',
'label'=>$langs->trans("SearchIntoMiscPayments", $search_boxvalue), 'label'=>$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMiscPayments", $search_boxvalue), 'text'=>img_picto('', 'object_payment', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoMiscPayments", $search_boxvalue),
'url'=>DOL_URL_ROOT.'/compta/bank/various_payment/list.php?leftmenu=tax_various'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); 'url'=>DOL_URL_ROOT.'/compta/bank/various_payment/list.php?leftmenu=tax_various'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('contrat') && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->hasRight('contrat', 'lire')) { if (isModEnabled('contrat') && empty($conf->global->MAIN_SEARCHFORM_CONTRACT_DISABLED) && $user->hasRight('contrat', 'lire')) {
$arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintocontract'] = array('position'=>130, 'img'=>'object_contract', 'label'=>$langs->trans("SearchIntoContracts", $search_boxvalue), 'text'=>img_picto('', 'object_contract', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoContracts", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/contrat/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('ficheinter') && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->hasRight('ficheinter', 'lire')) { if (isModEnabled('ficheinter') && empty($conf->global->MAIN_SEARCHFORM_FICHINTER_DISABLED) && $user->hasRight('ficheinter', 'lire')) {
$arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintointervention'] = array('position'=>140, 'img'=>'object_intervention', 'label'=>$langs->trans("SearchIntoInterventions", $search_boxvalue), 'text'=>img_picto('', 'object_intervention', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoInterventions", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/fichinter/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
}
if (isModEnabled('knowledgemanagement') && empty($conf->global->MAIN_SEARCHFORM_KNOWLEDGEMANAGEMENT_DISABLED) && $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) {
$arrayresult['searchintoknowledgemanagement'] = array('position'=>145, 'img'=>'object_knowledgemanagement', 'label'=>$langs->trans("SearchIntoKM", $search_boxvalue), 'text'=>img_picto('', 'object_knowledgemanagement', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoKM", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('ticket') && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->hasRight('ticket', 'read')) { if (isModEnabled('ticket') && empty($conf->global->MAIN_SEARCHFORM_TICKET_DISABLED) && $user->hasRight('ticket', 'read')) {
$arrayresult['searchintotickets'] = array('position'=>145, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintotickets'] = array('position'=>146, 'img'=>'object_ticket', 'label'=>$langs->trans("SearchIntoTickets", $search_boxvalue), 'text'=>img_picto('', 'object_ticket', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoTickets", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/ticket/list.php?mainmenu=ticket'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
} }
// HR // HR
if (isModEnabled('user') && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->hasRight('user', 'user', 'lire')) { if (isModEnabled('user') && empty($conf->global->MAIN_SEARCHFORM_USER_DISABLED) && $user->hasRight('user', 'user', 'lire')) {
$arrayresult['searchintouser'] = array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('', 'object_user', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/list.php'.($search_boxvalue ? '?sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintouser'] = array('position'=>200, 'shortcut'=>'U', 'img'=>'object_user', 'label'=>$langs->trans("SearchIntoUsers", $search_boxvalue), 'text'=>img_picto('', 'object_user', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoUsers", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/user/list.php'.($search_boxvalue ? '?search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('expensereport') && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->hasRight('expensereport', 'lire')) { if (isModEnabled('expensereport') && empty($conf->global->MAIN_SEARCHFORM_EXPENSEREPORT_DISABLED) && $user->hasRight('expensereport', 'lire')) {
$arrayresult['searchintoexpensereport'] = array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('', 'object_trip', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintoexpensereport'] = array('position'=>210, 'img'=>'object_trip', 'label'=>$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'text'=>img_picto('', 'object_trip', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoExpenseReports", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
} }
if (isModEnabled('holiday') && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->hasRight('holiday', 'read')) { if (isModEnabled('holiday') && empty($conf->global->MAIN_SEARCHFORM_HOLIDAY_DISABLED) && $user->hasRight('holiday', 'read')) {
$arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&sall='.urlencode($search_boxvalue) : '')); $arrayresult['searchintoleaves'] = array('position'=>220, 'img'=>'object_holiday', 'label'=>$langs->trans("SearchIntoLeaves", $search_boxvalue), 'text'=>img_picto('', 'object_holiday', 'class="pictofixedwidth"').' '.$langs->trans("SearchIntoLeaves", $search_boxvalue), 'url'=>DOL_URL_ROOT.'/holiday/list.php?mainmenu=hrm'.($search_boxvalue ? '&search_all='.urlencode($search_boxvalue) : ''));
} }
// Execute hook addSearchEntry // Execute hook addSearchEntry

View File

@ -84,7 +84,7 @@ class box_activity extends ModeleBoxes
$totalnb = 0; $totalnb = 0;
$line = 0; $line = 0;
$cachetime = 3600; $cachetime = 3600;
$fileid = '-e'.$conf->entity.'-u'.$user->id.'-s'.$user->socid.'-r'.($user->rights->societe->client->voir ? '1' : '0').'.cache'; $fileid = '-e'.$conf->entity.'-u'.$user->id.'-s'.$user->socid.'-r'.($user->hasRight("societe", "client", "voir") ? '1' : '0').'.cache';
$now = dol_now(); $now = dol_now();
$nbofperiod = 3; $nbofperiod = 3;
@ -102,7 +102,7 @@ class box_activity extends ModeleBoxes
// list the summary of the propals // list the summary of the propals
if (isModEnabled("propal") && $user->rights->propal->lire) { if (isModEnabled("propal") && $user->hasRight("propal", "lire")) {
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
$propalstatic = new Propal($this->db); $propalstatic = new Propal($this->db);
@ -189,7 +189,7 @@ class box_activity extends ModeleBoxes
} }
// list the summary of the orders // list the summary of the orders
if (isModEnabled('commande') && $user->rights->commande->lire) { if (isModEnabled('commande') && $user->hasRight("commande", "lire")) {
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
$commandestatic = new Commande($this->db); $commandestatic = new Commande($this->db);
@ -278,7 +278,7 @@ class box_activity extends ModeleBoxes
// list the summary of the bills // list the summary of the bills
if (isModEnabled('facture') && $user->rights->facture->lire) { if (isModEnabled('facture') && $user->hasRight("facture", "lire")) {
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$facturestatic = new Facture($this->db); $facturestatic = new Facture($this->db);

View File

@ -131,8 +131,10 @@ class HookManager
dol_syslog(get_class($this)."::initHooks Loading hooks: ".join(', ', $arraytolog), LOG_DEBUG); dol_syslog(get_class($this)."::initHooks Loading hooks: ".join(', ', $arraytolog), LOG_DEBUG);
} }
if (!empty($this->hooks[$context])) { foreach ($arraycontext as $context) {
ksort($this->hooks[$context], SORT_NATURAL); if (!empty($this->hooks[$context])) {
ksort($this->hooks[$context], SORT_NATURAL);
}
} }
return 1; return 1;

View File

@ -5058,9 +5058,9 @@ class Form
$morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : ''); $morecss = (!empty($input['morecss']) ? ' '.$input['morecss'] : '');
if ($input['type'] == 'text') { if ($input['type'] == 'text') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n"; $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="text" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n";
} elseif ($input['type'] == 'password') { } elseif ($input['type'] == 'password') {
$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.$input['value'].'"'.$moreattr.' /></div></div>'."\n"; $more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd"><input type="password" class="flat'.$morecss.'" id="'.dol_escape_htmltag($input['name']).'" name="'.dol_escape_htmltag($input['name']).'"'.$size.' value="'.(empty($input['value']) ? '' : $input['value']).'"'.$moreattr.' /></div></div>'."\n";
} elseif ($input['type'] == 'textarea') { } elseif ($input['type'] == 'textarea') {
/*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">'; /*$more .= '<div class="tagtr"><div class="tagtd'.(empty($input['tdclass']) ? '' : (' '.$input['tdclass'])).'">'.$input['label'].'</div><div class="tagtd">';
$more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>'; $more .= '<textarea name="'.$input['name'].'" class="'.$morecss.'"'.$moreattr.'>';
@ -8320,7 +8320,7 @@ class Form
var separ = urlBase.indexOf("?") >= 0 ? "&" : "?"; var separ = urlBase.indexOf("?") >= 0 ? "&" : "?";
/* console.log("params.term="+params.term); */ /* console.log("params.term="+params.term); */
/* console.log("params.term encoded="+encodeURIComponent(params.term)); */ /* console.log("params.term encoded="+encodeURIComponent(params.term)); */
saveRemoteData[data.id].url = urlBase + separ + "sall=" + encodeURIComponent(params.term.replace(/\"/g, ""));'; saveRemoteData[data.id].url = urlBase + separ + "search_all=" + encodeURIComponent(params.term.replace(/\"/g, ""));';
} }
if (!$disableFiltering) { if (!$disableFiltering) {

View File

@ -73,9 +73,11 @@ function expedition_prepare_head(Expedition $object)
*/ */
function expedition_admin_prepare_head() function expedition_admin_prepare_head()
{ {
global $langs, $conf, $user; global $langs, $conf, $user, $db;
$langs->load("sendings"); $langs->load("sendings");
$extrafields = new ExtraFields($db);
$h = 0; $h = 0;
$head = array(); $head = array();
@ -87,23 +89,29 @@ function expedition_admin_prepare_head()
*/ */
if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) { if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) {
$extrafields->fetch_name_optionals_label('expedition');
$extrafields->fetch_name_optionals_label('expeditiondet');
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php"; $head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
$head[$h][1] = $langs->trans("Shipment"); $head[$h][1] = $langs->trans("Shipment");
$head[$h][2] = 'shipment'; $head[$h][2] = 'shipment';
$h++; $h++;
}
if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) {
$head[$h][0] = DOL_URL_ROOT.'/admin/expedition_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/expedition_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['expedition']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes_shipment'; $head[$h][2] = 'attributes_shipment';
$h++; $h++;
}
if (!empty($conf->global->MAIN_SUBMODULE_EXPEDITION)) {
$head[$h][0] = DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/expeditiondet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][1] = $langs->trans("ExtraFieldsLines");
$nbExtrafields = $extrafields->attributes['expeditiondet']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributeslines_shipment'; $head[$h][2] = 'attributeslines_shipment';
$h++; $h++;
} }
@ -114,15 +122,24 @@ function expedition_admin_prepare_head()
$h++; $h++;
if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) {
$extrafields->fetch_name_optionals_label('delivery');
$extrafields->fetch_name_optionals_label('deliverydet');
$head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFields"); $head[$h][1] = $langs->trans("ExtraFields");
$nbExtrafields = $extrafields->attributes['delivery']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributes_receivings'; $head[$h][2] = 'attributes_receivings';
$h++; $h++;
}
if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) {
$head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php'; $head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php';
$head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][1] = $langs->trans("ExtraFieldsLines");
$nbExtrafields = $extrafields->attributes['deliverydet']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'attributeslines_receivings'; $head[$h][2] = 'attributeslines_receivings';
$h++; $h++;
} }

View File

@ -19,6 +19,7 @@
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr> * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr> * Copyright (C) 2022 Anthony Berton <anthony.berton@bb2a.fr>
* Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2022 Charlene Benke <charlene@patas-monkey.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -9385,6 +9386,17 @@ function complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type,
continue; continue;
} }
if ($values[3]) { if ($values[3]) {
if ($filterorigmodule) { // If a filter of module origin has been requested
if (strpos($values[3], '@')) { // This is an external module
if ($filterorigmodule != 'external') {
continue;
}
} else { // This looks a core module
if ($filterorigmodule != 'core') {
continue;
}
}
}
$langs->load($values[3]); $langs->load($values[3]);
} }
if (preg_match('/SUBSTITUTION_([^_]+)/i', $values[2], $reg)) { if (preg_match('/SUBSTITUTION_([^_]+)/i', $values[2], $reg)) {

View File

@ -1043,7 +1043,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$regType = array(); $regType = array();
if (preg_match('/\{(t+)\}/i', $mask, $regType)) { if (preg_match('/\{(t+)\}/i', $mask, $regType)) {
$masktype = $regType[1]; $masktype = $regType[1];
$masktype_value = substr(preg_replace('/^TE_/', '', $objsoc->typent_code), 0, dol_strlen($regType[1])); // get n first characters of thirdparty typent_code (where n is length in mask) $masktype_value = dol_substr(preg_replace('/^TE_/', '', $objsoc->typent_code), 0, dol_strlen($regType[1])); // get n first characters of thirdparty typent_code (where n is length in mask)
$masktype_value = str_pad($masktype_value, dol_strlen($regType[1]), "#", STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask $masktype_value = str_pad($masktype_value, dol_strlen($regType[1]), "#", STR_PAD_RIGHT); // we fill on right with # to have same number of char than into mask
} else { } else {
$masktype = ''; $masktype = '';

View File

@ -201,7 +201,7 @@ function dolDecrypt($chain, $key = '')
* @param string $chain String to hash * @param string $chain String to hash
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4': for OpenLdap, '5':sha256, '6':password_hash). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'. * @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4': for OpenLdap, '5':sha256, '6':password_hash). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @return string Hash of string * @return string Hash of string
* @see getRandomPassword() * @see getRandomPassword(), dol_verifyHash()
*/ */
function dol_hash($chain, $type = '0') function dol_hash($chain, $type = '0')
{ {
@ -249,6 +249,7 @@ function dol_hash($chain, $type = '0')
* @param string $hash hash to compare * @param string $hash hash to compare
* @param string $type Type of hash ('0':auto, '1':sha1, '2':sha1+md5, '3':md5, '4': for OpenLdap, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'. * @param string $type Type of hash ('0':auto, '1':sha1, '2':sha1+md5, '3':md5, '4': for OpenLdap, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @return bool True if the computed hash is the same as the given one * @return bool True if the computed hash is the same as the given one
* @see dol_hash()
*/ */
function dol_verifyHash($chain, $hash, $type = '0') function dol_verifyHash($chain, $hash, $type = '0')
{ {

View File

@ -994,7 +994,9 @@ class ImportCsv extends ModeleImports
if ($sql) { if ($sql) {
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). if (!$is_table_category_link) {
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
}
$insertdone = true; $insertdone = true;
} else { } else {
//print 'E'; //print 'E';

View File

@ -1041,7 +1041,9 @@ class ImportXlsx extends ModeleImports
if ($sql) { if ($sql) {
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) { if ($resql) {
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr). if (!$is_table_category_link) {
$last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in Dolibarr).
}
$insertdone = true; $insertdone = true;
} else { } else {
//print 'E'; //print 'E';

View File

@ -139,7 +139,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
* Return an example of result returned by getNextValue * Return an example of result returned by getNextValue
* *
* @param Translate $langs Object langs * @param Translate $langs Object langs
* @param product $objproduct Object product * @param Product $objproduct Object product
* @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return string example * @return string Return string example
*/ */

View File

@ -33,10 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php'
class mod_codeproduct_leopard extends ModeleProductCode class mod_codeproduct_leopard extends ModeleProductCode
{ {
/* /*
* Attention ce module est utilise par defaut si aucun module n'a * Please note this module is used by default if no module has been defined in the configuration
* ete definit dans la configuration
* *
* Le fonctionnement de celui-ci doit donc rester le plus ouvert possible * Its operation must therefore remain as open as possible
*/ */
/** /**
@ -100,7 +99,7 @@ class mod_codeproduct_leopard extends ModeleProductCode
/** /**
* Return an example of result returned by getNextValue * Return an example of result returned by getNextValue
* *
* @param product $objproduct Object product * @param Product $objproduct Object product
* @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect)
* @return string Return next value * @return string Return next value
*/ */

View File

@ -132,7 +132,7 @@ class mod_lot_advanced extends ModeleNumRefBatch
* Return next free value * Return next free value
* *
* @param Societe $objsoc Object thirdparty * @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for * @param Productlot $object Object we need next value for
* @return string Value if KO, <0 if KO * @return string Value if KO, <0 if KO
*/ */
public function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)
@ -143,6 +143,15 @@ class mod_lot_advanced extends ModeleNumRefBatch
// We get cursor rule // We get cursor rule
$mask = getDolGlobalString('LOT_ADVANCED_MASK'); $mask = getDolGlobalString('LOT_ADVANCED_MASK');
$filter = '';
if (getDolGlobalString('PRODUCTBATCH_LOT_USE_PRODUCT_MASKS') && !empty($object->fk_product)) {
$product = new Product($db);
$res = $product->fetch($object->fk_product);
if ($res > 0 && !empty($product->batch_mask)) {
$mask = $product->batch_mask;
$filter = '';
}
}
if (!$mask) { if (!$mask) {
$this->error = 'NotConfigured'; $this->error = 'NotConfigured';
@ -151,7 +160,7 @@ class mod_lot_advanced extends ModeleNumRefBatch
$date = dol_now(); $date = dol_now();
$numFinal = get_next_value($db, $mask, 'product_lot', 'batch', '', null, $date); $numFinal = get_next_value($db, $mask, 'product_lot', 'batch', $filter, null, $date);
return $numFinal; return $numFinal;
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -26,16 +27,15 @@
require_once DOL_DOCUMENT_ROOT.'/core/modules/product_batch/modules_product_batch.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/product_batch/modules_product_batch.class.php';
/** /**
* \class mod_codeproduct_leopard * \class mod_lot_free
* \brief Classe permettant la gestion leopard des codes produits * \brief Class allowing lot_free management of batch numbers
*/ */
class mod_lot_free extends ModeleNumRefBatch class mod_lot_free extends ModeleNumRefBatch
{ {
/* /*
* Attention ce module est utilise par defaut si aucun module n'a * Please note this module is used by default if no module has been defined in the configuration
* ete definit dans la configuration
* *
* Le fonctionnement de celui-ci doit donc rester le plus ouvert possible * Its operation must therefore remain as open as possible
*/ */
@ -44,7 +44,10 @@ class mod_lot_free extends ModeleNumRefBatch
*/ */
public $name = 'lot_free'; public $name = 'lot_free';
public $code_modifiable; // Code modifiable /**
* @var string Code modifiable
*/
public $code_modifiable;
public $code_modifiable_invalide; // Code modifiable si il est invalide public $code_modifiable_invalide; // Code modifiable si il est invalide
@ -94,12 +97,11 @@ class mod_lot_free extends ModeleNumRefBatch
* Return an example of result returned by getNextValue * Return an example of result returned by getNextValue
* *
* @param Societe $objsoc Object thirdparty * @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for * @param Productlot $object Object we need next value for
* @return string Return next value * @return string Return next value
*/ */
public function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)
{ {
global $langs;
return ''; return '';
} }
} }

View File

@ -112,7 +112,7 @@ class mod_lot_standard extends ModeleNumRefBatch
* Return next free value * Return next free value
* *
* @param Societe $objsoc Object thirdparty * @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for * @param Productlot $object Object we need next value for
* @return string Value if KO, <0 if KO * @return string Value if KO, <0 if KO
*/ */
public function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)

View File

@ -132,7 +132,7 @@ class mod_sn_advanced extends ModeleNumRefBatch
* Return next free value * Return next free value
* *
* @param Societe $objsoc Object thirdparty * @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for * @param Productlot $object Object we need next value for
* @return string Value if KO, <0 if KO * @return string Value if KO, <0 if KO
*/ */
public function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)
@ -144,6 +144,16 @@ class mod_sn_advanced extends ModeleNumRefBatch
// We get cursor rule // We get cursor rule
$mask = getDolGlobalString('SN_ADVANCED_MASK'); $mask = getDolGlobalString('SN_ADVANCED_MASK');
$filter = '';
if (getDolGlobalString('PRODUCTBATCH_SN_USE_PRODUCT_MASKS') && !empty($object->fk_product)) {
$product = new Product($db);
$res = $product->fetch($object->fk_product);
if ($res > 0 && !empty($product->batch_mask)) {
$mask = $product->batch_mask;
$filter = '';
}
}
if (!$mask) { if (!$mask) {
$this->error = 'NotConfigured'; $this->error = 'NotConfigured';
return 0; return 0;
@ -151,7 +161,7 @@ class mod_sn_advanced extends ModeleNumRefBatch
$date = dol_now(); $date = dol_now();
$numFinal = get_next_value($db, $mask, 'product_lot', 'batch', '', null, $date); $numFinal = get_next_value($db, $mask, 'product_lot', 'batch', $filter, null, $date);
return $numFinal; return $numFinal;
} }

View File

@ -93,7 +93,7 @@ class mod_sn_free extends ModeleNumRefBatch
* Return an example of result returned by getNextValue * Return an example of result returned by getNextValue
* *
* @param Societe $objsoc Object thirdparty * @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for * @param Productlot $object Object we need next value for
* @return string Return next value * @return string Return next value
*/ */
public function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)

View File

@ -112,7 +112,7 @@ class mod_sn_standard extends ModeleNumRefBatch
* Return next free value * Return next free value
* *
* @param Societe $objsoc Object thirdparty * @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for * @param Productlot $object Object we need next value for
* @return string Value if KO, <0 if KO * @return string Value if KO, <0 if KO
*/ */
public function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)

View File

@ -125,7 +125,7 @@ abstract class ModeleNumRefBatch
* Returns next assigned value * Returns next assigned value
* *
* @param Societe $objsoc Object thirdparty * @param Societe $objsoc Object thirdparty
* @param Object $object Object we need next value for * @param Productlot $object Object we need next value for
* @return string Valeur * @return string Valeur
*/ */
public function getNextValue($objsoc, $object) public function getNextValue($objsoc, $object)

View File

@ -44,13 +44,13 @@ $permtoadd = 0;
$permtoupload = 0; $permtoupload = 0;
$showroot = 0; $showroot = 0;
if ($module == 'ecm') { if ($module == 'ecm') {
$permtoadd = $user->rights->ecm->setup; $permtoadd = $user->hasRight("ecm", "setup");
$permtoupload = $user->rights->ecm->upload; $permtoupload = $user->hasRight("ecm", "upload");
$showroot = 0; $showroot = 0;
} }
if ($module == 'medias') { if ($module == 'medias') {
$permtoadd = ($user->rights->mailing->creer || $user->rights->website->write); $permtoadd = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
$permtoupload = ($user->rights->mailing->creer || $user->rights->website->write); $permtoupload = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
$showroot = 1; $showroot = 1;
} }

View File

@ -64,9 +64,12 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
} }
// Test if event/record is qualified // Test if event/record is qualified
$listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription', 'payment_various', 'cashcontrol'); if (empty($conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED) || !in_array($action, explode(',', $conf->global->BLOCKEDLOG_ADD_ACTIONS_SUPPORTED))) {
if (!in_array($object->element, $listofqualifiedelement)) { // If custom actions are not set or if action not into custom actions, we can exclude action if object->elementis not valid
return 1; $listofqualifiedelement = array('facture', 'don', 'payment', 'payment_donation', 'subscription', 'payment_various', 'cashcontrol');
if (!in_array($object->element, $listofqualifiedelement)) {
return 1;
}
} }
dol_syslog("Trigger '".$this->name."' for action '".$action."' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '".$action."' launched by ".__FILE__.". id=".$object->id);
@ -100,7 +103,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
$amounts = (double) $object->amount; $amounts = (double) $object->amount;
} elseif ($action == 'CASHCONTROL_VALIDATE') { } elseif ($action == 'CASHCONTROL_VALIDATE') {
$amounts = (double) $object->cash + (double) $object->cheque + (double) $object->card; $amounts = (double) $object->cash + (double) $object->cheque + (double) $object->card;
} else { } elseif (property_exists($object, 'total_ttc')) {
$amounts = (double) $object->total_ttc; $amounts = (double) $object->total_ttc;
} }
} }
@ -132,7 +135,9 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
return 0; // not implemented action log return 0; // not implemented action log
} }
$result = $b->setObjectData($object, $action, $amounts, $user); // Set field date_object, ref_object, fk_object, element, object_data // Set field date_object, ref_object, fk_object, element, object_data
$result = $b->setObjectData($object, $action, $amounts, $user);
//var_dump($b); exit;
if ($result < 0) { if ($result < 0) {
$this->error = $b->error; $this->error = $b->error;

View File

@ -94,14 +94,14 @@ $permissiontoread = 0;
$permissiontoadd = 0; $permissiontoadd = 0;
$permissiontoupload = 0; $permissiontoupload = 0;
if ($module == 'ecm') { if ($module == 'ecm') {
$permissiontoread = $user->rights->ecm->read; $permissiontoread = $user->hasRight("ecm", "read");
$permissiontoadd = $user->rights->ecm->setup; $permissiontoadd = $user->hasRight("ecm", "setup");
$permissiontoupload = $user->rights->ecm->upload; $permissiontoupload = $user->hasRight("ecm", "upload");
} }
if ($module == 'medias') { if ($module == 'medias') {
$permissiontoread = ($user->rights->mailing->lire || $user->rights->website->read); $permissiontoread = ($user->hasRight("mailing", "lire") || $user->hasRight("website", "read"));
$permissiontoadd = ($user->rights->mailing->creer || $user->rights->website->write); $permissiontoadd = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
$permissiontoupload = ($user->rights->mailing->creer || $user->rights->website->write); $permissiontoupload = ($user->hasRight("mailing", "creer") || $user->hasRight("website", "write"));
} }
if (!$permissiontoread) { if (!$permissiontoread) {

View File

@ -37,6 +37,7 @@ $langs->loadLangs(array('ecm', 'companies', 'other', 'users', 'orders', 'propal'
// Get parameters // Get parameters
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$backtopage = GETPOST('backtopage', 'alpha');
$socid = GETPOST('socid', 'int'); $socid = GETPOST('socid', 'int');
$file_manager = GETPOST('file_manager', 'alpha'); $file_manager = GETPOST('file_manager', 'alpha');
@ -50,6 +51,7 @@ $overwritefile = GETPOST('overwritefile', 'int');
if (empty($action) && $file_manager) { if (empty($action) && $file_manager) {
$action = 'file_manager'; $action = 'file_manager';
} }
$pageid = GETPOST('pageid', 'int');
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');

View File

@ -175,21 +175,21 @@ class Export
$this->array_export_perms[$i] = $bool; $this->array_export_perms[$i] = $bool;
// Icon // Icon
$this->array_export_icon[$i] = (isset($module->export_icon[$r]) ? $module->export_icon[$r] : $module->picto); $this->array_export_icon[$i] = (isset($module->export_icon[$r]) ? $module->export_icon[$r] : $module->picto);
// Code du dataset export // Code of the export dataset / Code du dataset export
$this->array_export_code[$i] = $module->export_code[$r]; $this->array_export_code[$i] = $module->export_code[$r];
// Define a key for sort // Define a key for sort
$this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r]; // Add a key into the module $this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r]; // Add a key into the module
// Libelle du dataset export // Export Dataset Label / Libelle du dataset export
$this->array_export_label[$i] = $module->getExportDatasetLabel($r); $this->array_export_label[$i] = $module->getExportDatasetLabel($r);
// Tableau des champ a exporter (cle=champ, valeur=libelle) // Table of fields to export / Tableau des champ a exporter (cle=champ, valeur=libelle)
$this->array_export_fields[$i] = $module->export_fields_array[$r]; $this->array_export_fields[$i] = $module->export_fields_array[$r];
// Tableau des champs a filtrer (cle=champ, valeur1=type de donnees) on verifie que le module a des filtres // Table of fields to be filtered / Tableau des champs a filtrer (cle=champ, valeur1=type de donnees) on verifie que le module a des filtres
$this->array_export_TypeFields[$i] = (isset($module->export_TypeFields_array[$r]) ? $module->export_TypeFields_array[$r] : ''); $this->array_export_TypeFields[$i] = (isset($module->export_TypeFields_array[$r]) ? $module->export_TypeFields_array[$r] : '');
// Tableau des entites a exporter (cle=champ, valeur=entite) // Table of entities for export / Tableau des entites a exporter (cle=champ, valeur=entite)
$this->array_export_entities[$i] = $module->export_entities_array[$r]; $this->array_export_entities[$i] = $module->export_entities_array[$r];
// Tableau des entites qui requiert abandon du DISTINCT (cle=entite, valeur=champ id child records) // Tableau des entites qui requiert abandon du DISTINCT (cle=entite, valeur=champ id child records)
$this->array_export_dependencies[$i] = (!empty($module->export_dependencies_array[$r]) ? $module->export_dependencies_array[$r] : ''); $this->array_export_dependencies[$i] = (!empty($module->export_dependencies_array[$r]) ? $module->export_dependencies_array[$r] : '');
// Tableau des operations speciales sur champ // Table of special field operations / Tableau des operations speciales sur champ
$this->array_export_special[$i] = (!empty($module->export_special_array[$r]) ? $module->export_special_array[$r] : ''); $this->array_export_special[$i] = (!empty($module->export_special_array[$r]) ? $module->export_special_array[$r] : '');
// Array of examples // Array of examples
$this->array_export_examplevalues[$i] = (!empty($module->export_examplevalues_array[$r]) ? $module->export_examplevalues_array[$r] : null); $this->array_export_examplevalues[$i] = (!empty($module->export_examplevalues_array[$r]) ? $module->export_examplevalues_array[$r] : null);
@ -461,9 +461,9 @@ class Export
} }
break; break;
case 'List': case 'List':
// 0 : Type du champ // 0 : Type of the field / Type du champ
// 1 : Nom de la table // 1 : Name of the table / Nom de la table
// 2 : Nom du champ contenant le libelle // 2 : Name of the field containing the label / Nom du champ contenant le libelle
// 3 : Name of field with key (if it is not "rowid"). Used this field as key for combo list. // 3 : Name of field with key (if it is not "rowid"). Used this field as key for combo list.
// 4 : Name of element for getEntity(). // 4 : Name of element for getEntity().

View File

@ -103,7 +103,7 @@ class KnowledgeRecord extends CommonObject
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"), 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'css'=>'left', 'comment'=>"Id"),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'visible'=>5, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", "csslist"=>"nowraponall", "showoncombobox"=>1), 'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'visible'=>5, 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of object", "csslist"=>"nowraponall", "showoncombobox"=>1),
'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>20, 'index'=>1), 'entity' =>array('type'=>'integer', 'label'=>'Entity', 'default'=>1, 'enabled'=>1, 'visible'=>0, 'notnull'=>1, 'position'=>20, 'index'=>1),
'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'question' => array('type'=>'text', 'label'=>'Question', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'),
'lang' => array('type'=>'varchar(6)', 'label'=>'Language', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1, 'tdcss'=>'titlefieldcreate nowraponall', "csslist"=>"tdoverflowmax100"), 'lang' => array('type'=>'varchar(6)', 'label'=>'Language', 'enabled'=>'1', 'position'=>40, 'notnull'=>0, 'visible'=>1, 'tdcss'=>'titlefieldcreate nowraponall', "csslist"=>"tdoverflowmax100"),
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>'1', 'position'=>500, 'notnull'=>1, 'visible'=>-2,),
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>2,), 'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>'1', 'position'=>501, 'notnull'=>0, 'visible'=>2,),
@ -115,7 +115,7 @@ class KnowledgeRecord extends CommonObject
'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,), 'model_pdf' => array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>'1', 'position'=>1010, 'notnull'=>-1, 'visible'=>0,),
//'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'), //'url' => array('type'=>'varchar(255)', 'label'=>'URL', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'csslist'=>'tdoverflow200', 'help'=>'UrlForInfoPage'),
'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'isModEnabled("ticket")', 'position'=>520, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'), 'fk_c_ticket_category' => array('type'=>'integer:CTicketCategory:ticket/class/cticketcategory.class.php:0:(t.active:=:1):pos', 'label'=>'SuggestedForTicketsInGroup', 'enabled'=>'isModEnabled("ticket")', 'position'=>520, 'notnull'=>0, 'visible'=>-1, 'help'=>'YouCanLinkArticleToATicketCategory', 'csslist'=>'minwidth200 tdoverflowmax250'),
'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>3, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'), 'answer' => array('type'=>'html', 'label'=>'Solution', 'enabled'=>'1', 'position'=>600, 'notnull'=>0, 'visible'=>3, 'searchall'=>1, 'csslist'=>'tdoverflowmax300', 'copytoclipboard'=>1, 'tdcss'=>'titlefieldcreate nowraponall'),
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Obsolete'),), 'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>'1', 'position'=>1000, 'notnull'=>1, 'visible'=>5, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Validated', '9'=>'Obsolete'),),
); );
public $rowid; public $rowid;

View File

@ -1388,7 +1388,7 @@ GetBarCode=Get barcode
NumberingModules=Numbering models NumberingModules=Numbering models
DocumentModules=Document models DocumentModules=Document models
##### Module password generation ##### Module password generation
PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: %s characters containing shared numbers and characters in lowercase. PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: %s characters containing shared numbers and characters.
PasswordGenerationNone=Do not suggest a generated password. Password must be typed in manually. PasswordGenerationNone=Do not suggest a generated password. Password must be typed in manually.
PasswordGenerationPerso=Return a password according to your personally defined configuration. PasswordGenerationPerso=Return a password according to your personally defined configuration.
SetupPerso=According to your configuration SetupPerso=According to your configuration
@ -2346,4 +2346,4 @@ AllowOnlineSign=Allow online signing
AllowExternalDownload=Allow external download (without login, using a shared link) AllowExternalDownload=Allow external download (without login, using a shared link)
DeadlineDayVATSubmission=Deadline day for vat submission on the next month DeadlineDayVATSubmission=Deadline day for vat submission on the next month
MaxNumberOfAttachementOnForms=Max number of joinded files in a form MaxNumberOfAttachementOnForms=Max number of joinded files in a form
IfDefinedUseAValueBeetween=If defined, use a value between %s and %s IfDefinedUseAValueBeetween=If defined, use a value between %s and %s

View File

@ -68,6 +68,7 @@ ShipmentBackToDraftInDolibarr=Shipment %s go back to draft status
ShipmentDeletedInDolibarr=Shipment %s deleted ShipmentDeletedInDolibarr=Shipment %s deleted
ShipmentCanceledInDolibarr=Shipment %s canceled ShipmentCanceledInDolibarr=Shipment %s canceled
ReceptionValidatedInDolibarr=Reception %s validated ReceptionValidatedInDolibarr=Reception %s validated
ReceptionDeletedInDolibarr=Reception %s deleted
ReceptionClassifyClosedInDolibarr=Reception %s classified closed ReceptionClassifyClosedInDolibarr=Reception %s classified closed
OrderCreatedInDolibarr=Order %s created OrderCreatedInDolibarr=Order %s created
OrderValidatedInDolibarr=Order %s validated OrderValidatedInDolibarr=Order %s validated
@ -177,4 +178,4 @@ AddReminder=Create an automatic reminder notification for this event
ErrorReminderActionCommCreation=Error creating the reminder notification for this event ErrorReminderActionCommCreation=Error creating the reminder notification for this event
BrowserPush=Browser Popup Notification BrowserPush=Browser Popup Notification
ActiveByDefault=Enabled by default ActiveByDefault=Enabled by default
Until=until Until=until

View File

@ -1056,6 +1056,7 @@ SearchIntoContracts=Contracts
SearchIntoCustomerShipments=Customer shipments SearchIntoCustomerShipments=Customer shipments
SearchIntoExpenseReports=Expense reports SearchIntoExpenseReports=Expense reports
SearchIntoLeaves=Leave SearchIntoLeaves=Leave
SearchIntoKM=Knowledge base
SearchIntoTickets=Tickets SearchIntoTickets=Tickets
SearchIntoCustomerPayments=Customer payments SearchIntoCustomerPayments=Customer payments
SearchIntoVendorPayments=Vendor payments SearchIntoVendorPayments=Vendor payments

View File

@ -1002,7 +1002,8 @@ class Product extends CommonObject
$this->ref = dol_string_nospecial(trim($this->ref)); $this->ref = dol_string_nospecial(trim($this->ref));
$this->label = trim($this->label); $this->label = trim($this->label);
$this->description = trim($this->description); $this->description = trim($this->description);
$this->note = (isset($this->note) ? trim($this->note) : null); $this->note_private = (isset($this->note_private) ? trim($this->note_private) : null);
$this->note_public = (isset($this->note_public) ? trim($this->note_public) : null);
$this->net_measure = price2num($this->net_measure); $this->net_measure = price2num($this->net_measure);
$this->net_measure_units = trim($this->net_measure_units); $this->net_measure_units = trim($this->net_measure_units);
$this->weight = price2num($this->weight); $this->weight = price2num($this->weight);
@ -1197,7 +1198,8 @@ class Product extends CommonObject
$sql .= ", fk_state = ".($this->state_id > 0 ? (int) $this->state_id : 'null'); $sql .= ", fk_state = ".($this->state_id > 0 ? (int) $this->state_id : 'null');
$sql .= ", lifetime = ".($this->lifetime > 0 ? (int) $this->lifetime : 'null'); $sql .= ", lifetime = ".($this->lifetime > 0 ? (int) $this->lifetime : 'null');
$sql .= ", qc_frequency = ".($this->qc_frequency > 0 ? (int) $this->qc_frequency : 'null'); $sql .= ", qc_frequency = ".($this->qc_frequency > 0 ? (int) $this->qc_frequency : 'null');
$sql .= ", note = ".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : 'null'); $sql .= ", note = ".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : 'null');
$sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null');
$sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'";
if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";

View File

@ -1094,6 +1094,13 @@ class MouvementStock extends CommonObject
$label .= '<div width="100%">'; $label .= '<div width="100%">';
$label .= '<b>'.$langs->trans('Label').':</b> '.$this->label; $label .= '<b>'.$langs->trans('Label').':</b> '.$this->label;
$label .= '<br><b>'.$langs->trans('Qty').':</b> '.($this->qty > 0 ? '+' : '').$this->qty; $label .= '<br><b>'.$langs->trans('Qty').':</b> '.($this->qty > 0 ? '+' : '').$this->qty;
if ($this->batch) {
$label .= '<br><b>'.$langs->trans('Batch').':</b> '.$this->batch;
}
/* TODO Get also warehouse label in a property instead of id
if ($this->warehouse_id > 0) {
$label .= '<br><b>'.$langs->trans('Warehouse').':</b> '.$this->warehouse_id;
}*/
$label .= '</div>'; $label .= '</div>';
// Link to page of warehouse tab // Link to page of warehouse tab

View File

@ -110,10 +110,13 @@ class Productlot extends CommonObject
public $entity; public $entity;
/** /**
* @var int ID * @var int Product ID
*/ */
public $fk_product; public $fk_product;
/**
* @var string batch ref
*/
public $batch; public $batch;
public $eatby = ''; public $eatby = '';
public $sellby = ''; public $sellby = '';
@ -126,15 +129,18 @@ class Productlot extends CommonObject
public $tms = ''; public $tms = '';
/** /**
* @var int ID * @var int user ID
*/ */
public $fk_user_creat; public $fk_user_creat;
/** /**
* @var int ID * @var int user ID
*/ */
public $fk_user_modif; public $fk_user_modif;
/**
* @var string import key
*/
public $import_key; public $import_key;
@ -241,9 +247,6 @@ class Productlot extends CommonObject
} }
if (!$error && !$notrigger) { if (!$error && !$notrigger) {
// Uncomment this and change MYOBJECT to your own tag if you
// want this action to call a trigger.
// Call triggers // Call triggers
$result = $this->call_trigger('PRODUCTLOT_CREATE', $user); $result = $this->call_trigger('PRODUCTLOT_CREATE', $user);
if ($result < 0) { if ($result < 0) {

View File

@ -122,7 +122,7 @@ if ($object->element == 'stock') {
print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>'; print '<td class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td>';
print '<td>'; print '<td>';
if ($object->element == 'product' || $object->element == 'stock') { if ($object->element == 'product' || $object->element == 'stock') {
print '<select name="mouvement" id="mouvement" class="minwidth125 valignmiddle">'; print '<select name="mouvement" id="mouvement" class="minwidth100 valignmiddle">';
print '<option value="0">'.$langs->trans("Add").'</option>'; print '<option value="0">'.$langs->trans("Add").'</option>';
print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>'; print '<option value="1"'.(GETPOST('mouvement') ? ' selected="selected"' : '').'>'.$langs->trans("Delete").'</option>';
print '</select>'; print '</select>';

View File

@ -11,6 +11,7 @@
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop> * Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
* Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es> * Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr> * Copyright (C) 2018 Quentin Vial-Gouteyron <quentin.vial-gouteyron@atm-consulting.fr>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -115,6 +116,9 @@ class Reception extends CommonObject
public $meths; public $meths;
public $listmeths; // List of carriers public $listmeths; // List of carriers
/**
* @var CommandeFournisseurDispatch[]
*/
public $lines = array(); public $lines = array();

View File

@ -1,5 +1,6 @@
<?php <?php
/* Copyright (C) 2020 Adminson Alicealalalamdskfldmjgdfgdfhfghgfh <testldr9@dolicloud.com> /* Copyright (C) 2020 Adminson Alicealalalamdskfldmjgdfgdfhfghgfh <testldr9@dolicloud.com>
* Copyright (C) 2022 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -28,7 +29,11 @@
*/ */
function recruitmentAdminPrepareHead() function recruitmentAdminPrepareHead()
{ {
global $langs, $conf; global $langs, $conf, $db;
$extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label('recruitment_recruitmentjobposition');
$extrafields->fetch_name_optionals_label('recruitment_recruitmentcandidature');
$langs->load("recruitment"); $langs->load("recruitment");
@ -52,11 +57,19 @@ function recruitmentAdminPrepareHead()
$head[$h][0] = dol_buildpath("/recruitment/admin/jobposition_extrafields.php", 1); $head[$h][0] = dol_buildpath("/recruitment/admin/jobposition_extrafields.php", 1);
$head[$h][1] = $langs->trans("ExtrafieldsJobPosition"); $head[$h][1] = $langs->trans("ExtrafieldsJobPosition");
$nbExtrafields = $extrafields->attributes['recruitment_recruitmentjobposition']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'jobposition_extrafields'; $head[$h][2] = 'jobposition_extrafields';
$h++; $h++;
$head[$h][0] = dol_buildpath("/recruitment/admin/candidature_extrafields.php", 1); $head[$h][0] = dol_buildpath("/recruitment/admin/candidature_extrafields.php", 1);
$head[$h][1] = $langs->trans("ExtrafieldsApplication"); $head[$h][1] = $langs->trans("ExtrafieldsApplication");
$nbExtrafields = $extrafields->attributes['recruitment_recruitmentcandidature']['count'];
if ($nbExtrafields > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbExtrafields.'</span>';
}
$head[$h][2] = 'candidature_extrafields'; $head[$h][2] = 'candidature_extrafields';
$h++; $h++;

View File

@ -1986,6 +1986,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$object->town = GETPOST('town', 'alphanohtml'); $object->town = GETPOST('town', 'alphanohtml');
$object->country_id = GETPOST('country_id') ?GETPOST('country_id', 'int') : $mysoc->country_id; $object->country_id = GETPOST('country_id') ?GETPOST('country_id', 'int') : $mysoc->country_id;
$object->state_id = GETPOST('state_id', 'int'); $object->state_id = GETPOST('state_id', 'int');
$object->parent = GETPOST('parent_company_id', 'int');
$object->socialnetworks = array(); $object->socialnetworks = array();
if (isModEnabled('socialnetworks')) { if (isModEnabled('socialnetworks')) {
@ -2614,6 +2615,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3');
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
// Parent company
if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) {
print '<tr>';
print '<td>'.$langs->trans('ParentCompany').'</td>';
print '<td colspan="3" class="maxwidthonsmartphone">';
print img_picto('', 'company', 'class="paddingrightonly"');
print $form->select_company(GETPOST('parent_company_id') ? GETPOST('parent_company_id') : $object->parent, 'parent_company_id', '', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx');
print '</td></tr>';
}
// Webservices url/key // Webservices url/key
if (!empty($conf->syncsupplierwebservices->enabled)) { if (!empty($conf->syncsupplierwebservices->enabled)) {
print '<tr><td>'.$form->editfieldkey('WebServiceURL', 'webservices_url', '', $object, 0).'</td>'; print '<tr><td>'.$form->editfieldkey('WebServiceURL', 'webservices_url', '', $object, 0).'</td>';

View File

@ -184,7 +184,7 @@ if (!empty($conf->use_javascript_ajax) && ((round($third['prospect']) ? 1 : 0) +
$statstring .= "</tr>"; $statstring .= "</tr>";
} }
$statstring2 = ''; $statstring2 = '';
if (((isModEnabled('fournisseur') && $user->rights->fournisseur->facture->lire && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->rights->supplier_order->lire) || (isModEnabled('supplier_invoice') && $user->rights->supplier_invoice->lire)) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) { if (((isModEnabled('fournisseur') && $user->hasRight('fournisseur', 'facture', 'lire') && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled('supplier_order') && $user->hasRight('supplier_order', 'lire')) || (isModEnabled('supplier_invoice') && $user->hasRight('supplier_invoice', 'lire'))) && empty($conf->global->SOCIETE_DISABLE_SUPPLIERS_STATS)) {
$statstring2 = "<tr>"; $statstring2 = "<tr>";
$statstring2 .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=f">'.$langs->trans("Suppliers").'</a></td><td class="right">'.round($third['supplier']).'</td>'; $statstring2 .= '<td><a href="'.DOL_URL_ROOT.'/societe/list.php?type=f">'.$langs->trans("Suppliers").'</a></td><td class="right">'.round($third['supplier']).'</td>';
$statstring2 .= "</tr>"; $statstring2 .= "</tr>";

View File

@ -1027,7 +1027,7 @@ if ($search_all) {
// Filter on categories // Filter on categories
$moreforfilter = ''; $moreforfilter = '';
if (empty($type) || $type == 'c' || $type == 'p') { if (empty($type) || $type == 'c' || $type == 'p') {
if (isModEnabled('categorie') && $user->rights->categorie->lire) { if (isModEnabled('categorie') && $user->hasRight("categorie", "lire")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('Categories'); $tmptitle = $langs->trans('Categories');
@ -1038,7 +1038,7 @@ if (empty($type) || $type == 'c' || $type == 'p') {
} }
if (empty($type) || $type == 'f') { if (empty($type) || $type == 'f') {
if (isModEnabled("fournisseur") && isModEnabled('categorie') && $user->rights->categorie->lire) { if (isModEnabled("fournisseur") && isModEnabled('categorie') && $user->hasRight("categorie", "lire")) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('Categories'); $tmptitle = $langs->trans('Categories');
@ -1049,7 +1049,7 @@ if (empty($type) || $type == 'f') {
} }
// If the user can view prospects other than his' // If the user can view prospects other than his'
if ($user->rights->societe->client->voir || $socid) { if ($user->hasRight("societe", "client", "voir") || $socid) {
$moreforfilter .= '<div class="divsearchfield">'; $moreforfilter .= '<div class="divsearchfield">';
$tmptitle = $langs->trans('SalesRepresentatives'); $tmptitle = $langs->trans('SalesRepresentatives');
$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"'); $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"');

View File

@ -71,7 +71,7 @@ if ($id > 0 || $ref) {
} }
$selectedvariant = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : array(); $selectedvariant = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : array();
$selected = "";
// Security check // Security check
if (!isModEnabled('variants')) { if (!isModEnabled('variants')) {
accessforbidden('Module not enabled'); accessforbidden('Module not enabled');
@ -140,7 +140,7 @@ $productCombination2ValuePairs1 = array();
if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST('selectvariant', 'alpha') && empty($subaction)) { // We click on Create all defined combinations if (($action == 'add' || $action == 'create') && empty($massaction) && !GETPOST('selectvariant', 'alpha') && empty($subaction)) { // We click on Create all defined combinations
//$features = GETPOST('features', 'array'); //$features = GETPOST('features', 'array');
$features = $_SESSION['addvariant_'.$object->id]; $features = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : array();
if (!$features) { if (!$features) {
if ($action == 'create') { if ($action == 'create') {
@ -474,7 +474,7 @@ if (!empty($id) || !empty($ref)) {
if ($action == 'add') { if ($action == 'add') {
$title = $langs->trans('NewProductCombination'); $title = $langs->trans('NewProductCombination');
// print dol_get_fiche_head(); // print dol_get_fiche_head();
$features = $_SESSION['addvariant_'.$object->id]; $features = !empty($_SESSION['addvariant_'.$object->id]) ? $_SESSION['addvariant_'.$object->id] : array();
//First, sanitize //First, sanitize
$listofvariantselected = '<div id="parttoaddvariant">'; $listofvariantselected = '<div id="parttoaddvariant">';
if (!empty($features)) { if (!empty($features)) {