Merge remote-tracking branch 'upstream/develop' into uniformizecode
This commit is contained in:
commit
680092cb8a
@ -7,13 +7,14 @@ English Dolibarr ChangeLog
|
||||
|
||||
For users:
|
||||
----------
|
||||
NEW: Feature to make inventories
|
||||
NEW: Module Recruitement to follow application to job positions is now stable.
|
||||
NEW: Feature to make Stock Inventories
|
||||
NEW: Several security issues after a second private bug hunting campaign.
|
||||
NEW: Add a security center page with all information and advices related to the security of your instance
|
||||
NEW: Add a performance center page with all information and advices related to the performance of your instance
|
||||
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
|
||||
NEW: All main menu entries are using the picto of the module
|
||||
NEW: Accountancy - Add closure menu
|
||||
NEW: Add an example of scheduled job to send email reminder for unpayed invoices
|
||||
NEW: Accountancy - Add FEC import
|
||||
NEW: Accountancy - Add a confirmation form with options on export
|
||||
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
|
||||
|
||||
@ -84,7 +84,7 @@ print "<br>\n";
|
||||
|
||||
$head = reception_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'attributeslines_reception', $langs->trans("Receptions"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'attributeslines_reception', $langs->trans("Receptions"), -1, 'reception');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -84,7 +84,7 @@ print "<br>\n";
|
||||
|
||||
$head = reception_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'attributes_reception', $langs->trans("Receptions"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'attributes_reception', $langs->trans("Receptions"), -1, 'reception');
|
||||
|
||||
require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@ print load_fiche_titre($langs->trans("ReceptionsSetup"), $linkback, 'title_setup
|
||||
print '<br>';
|
||||
$head = reception_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'reception', $langs->trans("Receptions"), -1, 'reception');
|
||||
|
||||
// Reception numbering model
|
||||
|
||||
|
||||
@ -344,8 +344,8 @@ class Commande extends CommonOrder
|
||||
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270),
|
||||
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275),
|
||||
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>400),
|
||||
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
|
||||
@ -163,21 +163,21 @@ $checkedtypetiers = 0;
|
||||
$arrayfields = array(
|
||||
'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
|
||||
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10),
|
||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20),
|
||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>-1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20),
|
||||
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25),
|
||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>1, 'position'=>31),
|
||||
's.town'=>array('label'=>"Town", 'checked'=>1, 'position'=>35),
|
||||
's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>40),
|
||||
's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>-1, 'position'=>31),
|
||||
's.town'=>array('label'=>"Town", 'checked'=>-1, 'position'=>35),
|
||||
's.zip'=>array('label'=>"Zip", 'checked'=>-1, 'position'=>40),
|
||||
'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45),
|
||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>50),
|
||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
|
||||
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60),
|
||||
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65),
|
||||
'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>0, 'position'=>66 , 'enabled'=>!empty($conf->expedition->enabled)),
|
||||
'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>0, 'position'=>67),
|
||||
'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>0, 'position'=>68),
|
||||
'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>0, 'position'=>69),
|
||||
'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>!empty($conf->expedition->enabled)),
|
||||
'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67),
|
||||
'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68),
|
||||
'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69),
|
||||
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75),
|
||||
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80),
|
||||
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85),
|
||||
@ -186,15 +186,15 @@ $arrayfields = array(
|
||||
'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100),
|
||||
'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105),
|
||||
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110),
|
||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10, 'position'=>115),
|
||||
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500, 'position'=>120),
|
||||
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500, 'position'=>125),
|
||||
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500, 'position'=>130),
|
||||
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135),
|
||||
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140),
|
||||
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>990, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>145),
|
||||
'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>995, 'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>150),
|
||||
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155)
|
||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115),
|
||||
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>120),
|
||||
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>125),
|
||||
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130),
|
||||
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135),
|
||||
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140),
|
||||
'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>990),
|
||||
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995),
|
||||
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000)
|
||||
);
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
@ -1115,7 +1115,7 @@ if ($resql) {
|
||||
// Channel
|
||||
if (!empty($arrayfields['c.fk_input_reason']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
$form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1);
|
||||
$form->selectInputReason($search_fk_input_reason, 'search_fk_input_reason', '', 1, '', 1);
|
||||
print '</td>';
|
||||
}
|
||||
if (!empty($arrayfields['c.total_ht']['checked'])) {
|
||||
@ -1838,6 +1838,9 @@ if ($resql) {
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Billed
|
||||
|
||||
@ -4956,7 +4956,11 @@ class Facture extends CommonInvoice
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
$stmpidate = dol_print_date($tmpidate, 'day', 'gmt');
|
||||
$this->output .= $langs->trans("SearchUnpaidInvoicesWithDueDate", $stmpidate).'<br>';
|
||||
$this->output .= $langs->transnoentitiesnoconv("SearchUnpaidInvoicesWithDueDate", $stmpidate);
|
||||
if (!empty($paymentmode) && $paymentmode != 'all') {
|
||||
$this->output .= ' ('.$langs->transnoentitiesnoconv("PaymentMode").' '.$paymentmode.')';
|
||||
}
|
||||
$this->output .= '<br>';
|
||||
|
||||
if ($resql) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
|
||||
@ -31,6 +31,7 @@ if ($action == 'update' && is_array($arrayofparameters)) {
|
||||
$db->begin();
|
||||
|
||||
foreach ($arrayofparameters as $key => $val) {
|
||||
var_dump($key);
|
||||
// Modify constant only if key was posted (avoid resetting key to the null value)
|
||||
if (GETPOSTISSET($key)) {
|
||||
if (preg_match('/category:/', $val['type'])) {
|
||||
|
||||
@ -142,6 +142,10 @@ class box_factures_fourn extends ModeleBoxes
|
||||
$facturestatic->status = $objp->status;
|
||||
$facturestatic->ref_supplier = $objp->ref_supplier;
|
||||
|
||||
$alreadypaid = $facturestatic->getSommePaiement();
|
||||
|
||||
$facturestatic->alreadypaid = $alreadypaid ? $alreadypaid : 0;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
@ -188,9 +192,6 @@ class box_factures_fourn extends ModeleBoxes
|
||||
'text' => dol_print_date($date, 'day'),
|
||||
);
|
||||
|
||||
$fac = new FactureFournisseur($this->db);
|
||||
$fac->fetch($objp->facid);
|
||||
$alreadypaid = $fac->getSommePaiement();
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $alreadypaid, $objp->type),
|
||||
|
||||
@ -134,6 +134,10 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
$facturestatic->statut = $objp->status;
|
||||
$facturestatic->status = $objp->status;
|
||||
|
||||
$alreadypaid = $facturestatic->getSommePaiement();
|
||||
|
||||
$facturestatic->alreadypaid = $alreadypaid ? $alreadypaid : 0;
|
||||
|
||||
$thirdpartystatic->id = $objp->socid;
|
||||
$thirdpartystatic->name = $objp->name;
|
||||
$thirdpartystatic->name_alias = $objp->name_alias;
|
||||
@ -174,9 +178,6 @@ class box_factures_fourn_imp extends ModeleBoxes
|
||||
'text' => dol_print_date($datelimite, 'day'),
|
||||
);
|
||||
|
||||
$fac = new FactureFournisseur($this->db);
|
||||
$fac->fetch($objp->facid);
|
||||
$alreadypaid = $fac->getSommePaiement();
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right" width="18"',
|
||||
'text' => $facturestatic->LibStatut($objp->paye, $objp->status, 3, $alreadypaid, $objp->type),
|
||||
|
||||
@ -132,7 +132,9 @@ class box_factures_imp extends ModeleBoxes
|
||||
|
||||
while ($line < $num) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
|
||||
$datelimite = $this->db->jdate($objp->datelimite);
|
||||
|
||||
$facturestatic->id = $objp->facid;
|
||||
$facturestatic->ref = $objp->ref;
|
||||
$facturestatic->type = $objp->type;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Module descriptor for ticket system
|
||||
* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -113,9 +113,6 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
while ($i < $num) {
|
||||
$objp = $this->db->fetch_object($resql);
|
||||
$datec = $this->db->jdate($objp->datec);
|
||||
$dateterm = $this->db->jdate($objp->fin_validite);
|
||||
$dateclose = $this->db->jdate($objp->date_cloture);
|
||||
$late = '';
|
||||
|
||||
$ticket = new Ticket($this->db);
|
||||
$ticket->id = $objp->id;
|
||||
@ -162,7 +159,6 @@ class box_last_modified_ticket extends ModeleBoxes
|
||||
);
|
||||
$r++;
|
||||
|
||||
|
||||
// Date creation
|
||||
$this->info_box_contents[$i][$r] = array(
|
||||
'td' => 'class="right"',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012-2018 Charlene BENKE <charlie@patas-monkey.com>
|
||||
* Copyright (C) 2015-2020 Frederic France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2015-2021 Frederic France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -150,7 +150,7 @@ class box_task extends ModeleBoxes
|
||||
}
|
||||
|
||||
$sql = "SELECT pt.rowid, pt.ref, pt.fk_projet, pt.fk_task_parent, pt.datec, pt.dateo, pt.datee, pt.datev, pt.label, pt.description, pt.duration_effective, pt.planned_workload, pt.progress";
|
||||
$sql .= ", p.rowid project_id, p.ref project_ref, p.title project_title";
|
||||
$sql .= ", p.rowid project_id, p.ref project_ref, p.title project_title, p.fk_statut";
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."projet_task as pt";
|
||||
$sql .= " JOIN ".MAIN_DB_PREFIX."projet as p ON (pt.fk_projet = p.rowid)";
|
||||
|
||||
@ -1386,7 +1386,9 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
|
||||
return;
|
||||
}
|
||||
|
||||
$message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
|
||||
if (empty($conf->global->MAIN_SHOW_PASSWORD_INTO_LOG)) {
|
||||
$message = preg_replace('/password=\'[^\']*\'/', 'password=\'hidden\'', $message); // protection to avoid to have value of password in log
|
||||
}
|
||||
|
||||
// If adding log inside HTML page is required
|
||||
if ((!empty($_REQUEST['logtohtml']) && !empty($conf->global->MAIN_ENABLE_LOG_TO_HTML))
|
||||
@ -3509,8 +3511,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
|
||||
'partnership', 'payment', 'pencil-ruler', 'preview', 'project', 'projectpub', 'projecttask', 'refresh', 'salary', 'shipment', 'supplier_invoice', 'technic', 'ticket',
|
||||
'error', 'warning',
|
||||
'recruitmentcandidature', 'recruitmentjobposition', 'resource',
|
||||
'shapes', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||
'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'resource',
|
||||
'shapes', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
|
||||
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
|
||||
'uncheck', 'user-cog', 'website', 'workstation',
|
||||
'conferenceorbooth', 'eventorganization'
|
||||
@ -3554,7 +3556,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'reception'=>'dolly', 'recruitmentjobposition'=>'id-card-alt', 'recruitmentcandidature'=>'id-badge',
|
||||
'resize'=>'crop', 'supplier_order'=>'dol-order_supplier', 'supplier_proposal'=>'file-signature',
|
||||
'refresh'=>'redo', 'resource'=>'laptop-house',
|
||||
'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
|
||||
'salary'=>'wallet', 'shipment'=>'dolly', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'stripe'=>'stripe-s',
|
||||
'supplier'=>'building', 'supplier_invoice'=>'file-invoice-dollar', 'technic'=>'cogs', 'ticket'=>'ticket-alt',
|
||||
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
|
||||
'title_agenda'=>'calendar-alt',
|
||||
'uncheck'=>'times', 'uparrow'=>'share', 'vcard'=>'address-card',
|
||||
@ -3596,7 +3599,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
if (in_array($pictowithouttext, array('conferenceorbooth', 'collab', 'eventorganization', 'holiday', 'info', 'project', 'workstation'))) {
|
||||
$morecss = 'em088';
|
||||
}
|
||||
if (in_array($pictowithouttext, array('intervention', 'payment', 'loan', 'partnership', 'stock', 'technic'))) {
|
||||
if (in_array($pictowithouttext, array('asset', 'intervention', 'payment', 'loan', 'partnership', 'stock', 'technic'))) {
|
||||
$morecss = 'em080';
|
||||
}
|
||||
|
||||
@ -3632,7 +3635,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
'reception'=>'flip', 'recruitmentjobposition'=>'infobox-adherent', 'recruitmentcandidature'=>'infobox-adherent',
|
||||
'resource'=>'infobox-action',
|
||||
'salary'=>'infobox-bank_account', 'shipment'=>'infobox-commande', 'supplier_invoice'=>'infobox-order_supplier', 'supplier_invoicea'=>'infobox-order_supplier', 'supplier_invoiced'=>'infobox-order_supplier',
|
||||
'supplier_order'=>'infobox-order_supplier', 'supplier_proposal'=>'infobox-supplier_proposal',
|
||||
'supplier'=>'infobox-order_supplier', 'supplier_order'=>'infobox-order_supplier', 'supplier_proposal'=>'infobox-supplier_proposal',
|
||||
'ticket'=>'infobox-contrat', 'title_accountancy'=>'infobox-bank_account', 'title_hrm'=>'infobox-holiday', 'expensereport'=>'infobox-expensereport', 'trip'=>'infobox-expensereport', 'title_agenda'=>'infobox-action',
|
||||
//'title_setup'=>'infobox-action', 'tools'=>'infobox-action',
|
||||
'list-alt'=>'imgforviewmode', 'calendar'=>'imgforviewmode', 'calendarweek'=>'imgforviewmode', 'calendarmonth'=>'imgforviewmode', 'calendarday'=>'imgforviewmode', 'calendarperuser'=>'imgforviewmode'
|
||||
|
||||
@ -1233,7 +1233,7 @@ function pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w,
|
||||
/**
|
||||
* Output line description into PDF
|
||||
*
|
||||
* @param TCPDF $pdf PDF object
|
||||
* @param TCPDF $pdf PDF object
|
||||
* @param Object $object Object
|
||||
* @param int $i Current line number
|
||||
* @param Translate $outputlangs Object lang for output
|
||||
|
||||
@ -69,7 +69,7 @@ class modAsset extends DolibarrModules
|
||||
// Name of image file used for this module.
|
||||
// If file is in theme/yourtheme/img directory under name object_pictovalue.png, use this->picto='pictovalue'
|
||||
// If file is in module/img directory under name object_pictovalue.png, use this->picto='pictovalue@module'
|
||||
$this->picto = 'accounting';
|
||||
$this->picto = 'asset';
|
||||
|
||||
// Defined all module parts (triggers, login, substitutions, menus, css, etc...)
|
||||
// for default path (eg: /asset/core/xxxxx) (0=disable, 1=enable)
|
||||
|
||||
@ -388,6 +388,18 @@ class pdf_squille extends ModelePdfReception
|
||||
// Description of product line
|
||||
$curX = $this->posxdesc - 1;
|
||||
|
||||
// The desc of line is not store into reception, so we force it to the value of product.
|
||||
/*
|
||||
if (empty($object->lines[0]->desc)) {
|
||||
// TODO We must get value from fk_commendefourndet
|
||||
$sqldesc = 'SELECT description FROM '.MAIN_DB_PREFIX.' WHERE rowid = '.((int) $object->lines[0]->fk_commandefourndet);
|
||||
$resqldesc = $this->db->query($sqldesc);
|
||||
if ($resqldesc) {
|
||||
$objdesc = $this->db->fetch_object($resqldesc);
|
||||
$object->lines[0]->desc = $objdesc->description;
|
||||
}
|
||||
}*/
|
||||
|
||||
$pdf->startTransaction();
|
||||
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX, 3, $curX, $curY, $hideref, $hidedesc);
|
||||
|
||||
|
||||
@ -1211,6 +1211,9 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
{
|
||||
global $langs, $conf, $mysoc;
|
||||
|
||||
$ltrdirection = 'L';
|
||||
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
|
||||
|
||||
// Load translation files required by the page
|
||||
$outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings"));
|
||||
|
||||
@ -1248,7 +1251,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
}
|
||||
} else {
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
|
||||
}
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||
@ -1369,7 +1372,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
$pdf->SetFont('', '', $default_font_size - 2);
|
||||
$pdf->SetXY($posx, $posy - 5);
|
||||
$pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L');
|
||||
$pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection);
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetFillColor(230, 230, 230);
|
||||
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
|
||||
@ -1378,13 +1381,13 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
// Show sender name
|
||||
$pdf->SetXY($posx + 2, $posy + 3);
|
||||
$pdf->SetFont('', 'B', $default_font_size);
|
||||
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
|
||||
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection);
|
||||
$posy = $pdf->getY();
|
||||
|
||||
// Show sender information
|
||||
$pdf->SetXY($posx + 2, $posy);
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, $ltrdirection);
|
||||
|
||||
|
||||
|
||||
@ -1422,20 +1425,20 @@ class pdf_cornas extends ModelePDFSuppliersOrders
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
$pdf->SetFont('', '', $default_font_size - 2);
|
||||
$pdf->SetXY($posx + 2, $posy - 5);
|
||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection);
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx + 2, $posy + 3);
|
||||
$pdf->SetFont('', 'B', $default_font_size);
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, $ltrdirection);
|
||||
|
||||
$posy = $pdf->getY();
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->SetXY($posx + 2, $posy);
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
|
||||
}
|
||||
|
||||
return $top_shift;
|
||||
|
||||
@ -1119,6 +1119,9 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
{
|
||||
global $langs, $conf, $mysoc;
|
||||
|
||||
$ltrdirection = 'L';
|
||||
if ($outputlangs->trans("DIRECTION") == 'rtl') $ltrdirection = 'R';
|
||||
|
||||
// Load translation files required by the page
|
||||
$outputlangs->loadLangs(array("main", "orders", "companies", "bills", "sendings"));
|
||||
|
||||
@ -1156,7 +1159,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
}
|
||||
} else {
|
||||
$text = $this->emetteur->name;
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
|
||||
$pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, $ltrdirection);
|
||||
}
|
||||
|
||||
$pdf->SetFont('', 'B', $default_font_size + 3);
|
||||
@ -1277,7 +1280,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
$pdf->SetFont('', '', $default_font_size - 2);
|
||||
$pdf->SetXY($posx, $posy - 5);
|
||||
$pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, 'L');
|
||||
$pdf->MultiCell(80, 5, $outputlangs->transnoentities("BillFrom"), 0, $ltrdirection);
|
||||
$pdf->SetXY($posx, $posy);
|
||||
$pdf->SetFillColor(230, 230, 230);
|
||||
$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
|
||||
@ -1286,13 +1289,13 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
// Show sender name
|
||||
$pdf->SetXY($posx + 2, $posy + 3);
|
||||
$pdf->SetFont('', 'B', $default_font_size);
|
||||
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
|
||||
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, $ltrdirection);
|
||||
$posy = $pdf->getY();
|
||||
|
||||
// Show sender information
|
||||
$pdf->SetXY($posx + 2, $posy);
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
|
||||
$pdf->MultiCell(80, 4, $carac_emetteur, 0, $ltrdirection);
|
||||
|
||||
|
||||
// If CUSTOMER contact defined on order, we use it. Note: Even if this is a supplier object, the code for external contat that follow order is 'CUSTOMER'
|
||||
@ -1329,20 +1332,20 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
||||
$pdf->SetTextColor(0, 0, 0);
|
||||
$pdf->SetFont('', '', $default_font_size - 2);
|
||||
$pdf->SetXY($posx + 2, $posy - 5);
|
||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillTo"), 0, $ltrdirection);
|
||||
$pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
|
||||
|
||||
// Show recipient name
|
||||
$pdf->SetXY($posx + 2, $posy + 3);
|
||||
$pdf->SetFont('', 'B', $default_font_size);
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0, $ltrdirection);
|
||||
|
||||
$posy = $pdf->getY();
|
||||
|
||||
// Show recipient information
|
||||
$pdf->SetFont('', '', $default_font_size - 1);
|
||||
$pdf->SetXY($posx + 2, $posy);
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, 'L');
|
||||
$pdf->MultiCell($widthrecbox, 4, $carac_client, 0, $ltrdirection);
|
||||
}
|
||||
|
||||
return $top_shift;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2014 Maxime Kohlhaas <support@atm-consulting.fr>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -59,7 +60,7 @@ if ($reshook < 0) {
|
||||
|
||||
|
||||
//var_dump($extrafields->attributes[$object->table_element]);
|
||||
if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]['label'])) {
|
||||
if (empty($reshook) && isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$lastseparatorkeyfound = '';
|
||||
$extrafields_collapse_num = '';
|
||||
$extrafields_collapse_num_old = '';
|
||||
|
||||
@ -352,7 +352,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
|
||||
print '<tr class="blockmethod"><td>';
|
||||
print $langs->trans('CronModule')."</td><td>";
|
||||
print "<input type=\"text\" size=\"20\" name=\"module_name\" value=\"".$object->module_name."\" /> ";
|
||||
print "<input type=\"text\" class=\"width200\" name=\"module_name\" value=\"".$object->module_name."\" /> ";
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
print $form->textwithpicto('', $langs->trans("CronModuleHelp"), 1, 'help');
|
||||
@ -370,7 +370,7 @@ if (($action == "create") || ($action == "edit")) {
|
||||
|
||||
print '<tr class="blockmethod"><td>';
|
||||
print $langs->trans('CronObject')."</td><td>";
|
||||
print "<input type=\"text\" size=\"20\" name=\"objectname\" value=\"".$object->objectname."\" /> ";
|
||||
print "<input type=\"text\" class=\"width200\" name=\"objectname\" value=\"".$object->objectname."\" /> ";
|
||||
print "</td>";
|
||||
print "<td>";
|
||||
print $form->textwithpicto('', $langs->trans("CronObjectHelp"), 1, 'help');
|
||||
|
||||
@ -27,15 +27,7 @@ require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||
require_once '../lib/datapolicy.lib.php';
|
||||
|
||||
// Translations
|
||||
$langs->load('admin');
|
||||
$langs->load('companies');
|
||||
$langs->load('members');
|
||||
$langs->load('datapolicy@datapolicy');
|
||||
|
||||
// Access control
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
$langs->loadLangs(array('admin', 'companies', 'members', 'datapolicy@datapolicy'));
|
||||
|
||||
// Parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
@ -43,35 +35,27 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
||||
|
||||
$arrayofparameters = array();
|
||||
$arrayofparameters['ThirdParty'] = array(
|
||||
'DATAPOLICY_TIERS_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_TIERS_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')),
|
||||
'DATAPOLICY_TIERS_PROSPECT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')),
|
||||
'DATAPOLICY_TIERS_PROSPECT_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')),
|
||||
'DATAPOLICY_TIERS_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'company', 'class="pictofixedwidth"')),
|
||||
'DATAPOLICY_TIERS_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'supplier', 'class="pictofixedwidth"')),
|
||||
);
|
||||
if (!empty($conf->global->DATAPOLICY_USE_SPECIFIC_DELAY_FOR_CONTACT)) {
|
||||
$arrayofparameters['Contact'] = array(
|
||||
'DATAPOLICY_CONTACT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_PROSPECT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_CONTACT_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
|
||||
'DATAPOLICY_CONTACT_PROSPECT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
|
||||
'DATAPOLICY_CONTACT_PROSPECT_CLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
|
||||
'DATAPOLICY_CONTACT_NIPROSPECT_NICLIENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
|
||||
'DATAPOLICY_CONTACT_FOURNISSEUR'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'contact', 'class="pictofixedwidth"')),
|
||||
);
|
||||
}
|
||||
if (!empty($conf->adherent->enabled)) {
|
||||
$arrayofparameters['Member'] = array(
|
||||
'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200'),
|
||||
'DATAPOLICY_ADHERENT'=>array('css'=>'minwidth200', 'picto'=>img_picto('', 'member', 'class="pictofixedwidth"')),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
|
||||
|
||||
$valTab = array(
|
||||
'' => $langs->trans('Never'),
|
||||
'6' => $langs->trans('NB_MONTHS', 6),
|
||||
@ -85,6 +69,40 @@ $valTab = array(
|
||||
'240' => $langs->trans('NB_YEARS', 20),
|
||||
);
|
||||
|
||||
// Access control
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
foreach ($arrayofparameters as $title => $tab) {
|
||||
foreach ($tab as $key => $val) {
|
||||
// Modify constant only if key was posted (avoid resetting key to the null value)
|
||||
if (GETPOSTISSET($key)) {
|
||||
if (preg_match('/category:/', $val['type'])) {
|
||||
if (GETPOST($key, 'int') == '-1') {
|
||||
$val_const = '';
|
||||
} else {
|
||||
$val_const = GETPOST($key, 'int');
|
||||
}
|
||||
} else {
|
||||
$val_const = GETPOST($key, 'alpha');
|
||||
}
|
||||
|
||||
$result = dolibarr_set_const($db, $key, $val_const, 'chaine', 0, '', $conf->entity);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -96,11 +114,11 @@ llxHeader('', $langs->trans($page_name));
|
||||
// Subheader
|
||||
$linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'object_generic');
|
||||
print load_fiche_titre($langs->trans($page_name), $linkback, 'generic');
|
||||
|
||||
// Configuration header
|
||||
$head = datapolicyAdminPrepareHead();
|
||||
print dol_get_fiche_head($head, 'settings', '', -1, "datapolicy@datapolicy");
|
||||
print dol_get_fiche_head($head, 'settings', '', -1, '');
|
||||
|
||||
// Setup page goes here
|
||||
echo '<span class="opacitymedium">'.$langs->trans("datapolicySetupPage").'</span><br><br>';
|
||||
@ -118,6 +136,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="trforbreak"><td class="titlefield trforbreak" colspan="2">'.$langs->trans($title).'</td></tr>';
|
||||
foreach ($tab as $key => $val) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $val['picto'];
|
||||
print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
|
||||
print '</td><td>';
|
||||
print '<select name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'">';
|
||||
@ -147,6 +166,7 @@ if ($action == 'edit') {
|
||||
print '<tr class="trforbreak"><td class="titlefield trforbreak" colspan="2">'.$langs->trans($title).'</td></tr>';
|
||||
foreach ($tab as $key => $val) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $val['picto'];
|
||||
print $form->textwithpicto($langs->trans($key), $langs->trans('DATAPOLICY_Tooltip_SETUP'));
|
||||
print '</td><td>'.($conf->global->$key == '' ? $langs->trans('None') : $valTab[$conf->global->$key]).'</td></tr>';
|
||||
}
|
||||
|
||||
@ -54,27 +54,26 @@ class DataPolicyCron
|
||||
$errormsg = '';
|
||||
$nbupdated = $nbdeleted = 0;
|
||||
|
||||
// FIXME Removed hardcoded values of id
|
||||
// FIXME Exclude data from the selection if there is at least 1 invoice.
|
||||
$arrayofparameters = array(
|
||||
'DATAPOLICIES_TIERS_CLIENT' => array(
|
||||
'sql' => "
|
||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||
WHERE (s.fk_forme_juridique IN (11, 12, 13, 15, 17, 18, 19, 35, 60, 312, 316, 401, 600, 700, 1005) OR s.fk_typent = 8)
|
||||
AND s.entity = %d
|
||||
WHERE s.entity = %d
|
||||
AND s.client = 1
|
||||
AND s.fournisseur = 0
|
||||
AND s.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_soc
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_soc IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Societe",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php',
|
||||
'fields_anonym' => array(
|
||||
'name' => $langs->trans('ANONYME'),
|
||||
'name' => 'MAKEANONYMOUS',
|
||||
'name_bis' => '',
|
||||
'name_alias' => '',
|
||||
'address' => '',
|
||||
@ -87,29 +86,28 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
'DATAPOLICIES_TIERS_PROSPECT' => array(
|
||||
'sql' => "
|
||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||
WHERE (s.fk_forme_juridique IN (11, 12, 13, 15, 17, 18, 19, 35, 60, 312, 316, 401, 600, 700, 1005) OR s.fk_typent = 8)
|
||||
AND s.entity = %d
|
||||
WHERE s.entity = %d
|
||||
AND s.client = 2
|
||||
AND s.fournisseur = 0
|
||||
AND s.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_soc
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_soc IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Societe",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php',
|
||||
'fields_anonym' => array(
|
||||
'name' => $langs->trans('ANONYME'),
|
||||
'name' => 'MAKEANONYMOUS',
|
||||
'name_bis' => '',
|
||||
'name_alias' => '',
|
||||
'address' => '',
|
||||
@ -122,29 +120,28 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
'DATAPOLICIES_TIERS_PROSPECT_CLIENT' => array(
|
||||
'sql' => "
|
||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||
WHERE (s.fk_forme_juridique IN (11, 12, 13, 15, 17, 18, 19, 35, 60, 312, 316, 401, 600, 700, 1005) OR s.fk_typent = 8)
|
||||
AND s.entity = %d
|
||||
WHERE s.entity = %d
|
||||
AND s.client = 3
|
||||
AND s.fournisseur = 0
|
||||
AND s.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_soc
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_soc IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Societe",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php',
|
||||
'fields_anonym' => array(
|
||||
'name' => $langs->trans('ANONYME'),
|
||||
'name' => 'MAKEANONYMOUS',
|
||||
'name_bis' => '',
|
||||
'name_alias' => '',
|
||||
'address' => '',
|
||||
@ -157,29 +154,28 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
'DATAPOLICIES_TIERS_NIPROSPECT_NICLIENT' => array(
|
||||
'sql' => "
|
||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||
WHERE (s.fk_forme_juridique IN (11, 12, 13, 15, 17, 18, 19, 35, 60, 312, 316, 401, 600, 700, 1005) OR s.fk_typent = 8)
|
||||
AND s.entity = %d
|
||||
WHERE s.entity = %d
|
||||
AND s.client = 0
|
||||
AND s.fournisseur = 0
|
||||
AND s.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_soc
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_soc IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Societe",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php',
|
||||
'fields_anonym' => array(
|
||||
'name' => $langs->trans('ANONYME'),
|
||||
'name' => 'MAKEANONYMOUS',
|
||||
'name_bis' => '',
|
||||
'name_alias' => '',
|
||||
'address' => '',
|
||||
@ -192,28 +188,27 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
'DATAPOLICIES_TIERS_FOURNISSEUR' => array(
|
||||
'sql' => "
|
||||
SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s
|
||||
WHERE (s.fk_forme_juridique IN (11, 12, 13, 15, 17, 18, 19, 35, 60, 312, 316, 401, 600, 700, 1005) OR s.fk_typent = 8)
|
||||
AND s.entity = %d
|
||||
WHERE s.entity = %d
|
||||
AND s.fournisseur = 1
|
||||
AND s.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_soc
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_contact IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_soc = s.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Societe",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php',
|
||||
'fields_anonym' => array(
|
||||
'name' => $langs->trans('ANONYME'),
|
||||
'name' => 'MAKEANONYMOUS',
|
||||
'name_bis' => '',
|
||||
'name_alias' => '',
|
||||
'address' => '',
|
||||
@ -226,7 +221,7 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
@ -238,17 +233,17 @@ class DataPolicyCron
|
||||
AND c.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.client = 1
|
||||
AND s.fournisseur = 0
|
||||
AND c.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_contact
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_contact IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Contact",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php',
|
||||
'fields_anonym' => array(
|
||||
'lastname' => $langs->trans('ANONYME'),
|
||||
'lastname' => 'MAKEANONYMOUS',
|
||||
'firstname' => '',
|
||||
'civility_id' => '',
|
||||
'poste' => '',
|
||||
@ -264,8 +259,7 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'jabberid' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
@ -277,17 +271,17 @@ class DataPolicyCron
|
||||
AND c.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.client = 2
|
||||
AND s.fournisseur = 0
|
||||
AND c.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_contact
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_contact IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Contact",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php',
|
||||
'fields_anonym' => array(
|
||||
'lastname' => $langs->trans('ANONYME'),
|
||||
'lastname' => 'MAKEANONYMOUS',
|
||||
'firstname' => '',
|
||||
'civility_id' => '',
|
||||
'poste' => '',
|
||||
@ -303,8 +297,7 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'jabberid' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
@ -316,17 +309,17 @@ class DataPolicyCron
|
||||
AND c.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.client = 3
|
||||
AND s.fournisseur = 0
|
||||
AND c.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_contact
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_contact IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Contact",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php',
|
||||
'fields_anonym' => array(
|
||||
'lastname' => $langs->trans('ANONYME'),
|
||||
'lastname' => 'MAKEANONYMOUS',
|
||||
'firstname' => '',
|
||||
'civility_id' => '',
|
||||
'poste' => '',
|
||||
@ -342,8 +335,7 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'jabberid' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
@ -355,17 +347,17 @@ class DataPolicyCron
|
||||
AND c.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.client = 0
|
||||
AND s.fournisseur = 0
|
||||
AND c.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_contact
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_contact IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Contact",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php',
|
||||
'fields_anonym' => array(
|
||||
'lastname' => $langs->trans('ANONYME'),
|
||||
'lastname' => 'MAKEANONYMOUS',
|
||||
'firstname' => '',
|
||||
'civility_id' => '',
|
||||
'poste' => '',
|
||||
@ -381,8 +373,7 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'jabberid' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
@ -393,17 +384,17 @@ class DataPolicyCron
|
||||
WHERE c.entity = %d
|
||||
AND c.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND s.fournisseur = 1
|
||||
AND c.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_contact
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.fk_contact IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_contact = c.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
)
|
||||
AND NOT EXISTS (
|
||||
SELECT rowid FROM ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.rowid
|
||||
)
|
||||
",
|
||||
"class" => "Contact",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php',
|
||||
'fields_anonym' => array(
|
||||
'lastname' => $langs->trans('ANONYME'),
|
||||
'lastname' => 'MAKEANONYMOUS',
|
||||
'firstname' => '',
|
||||
'civility_id' => '',
|
||||
'poste' => '',
|
||||
@ -419,8 +410,7 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'jabberid' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
@ -429,19 +419,15 @@ class DataPolicyCron
|
||||
SELECT a.rowid FROM ".MAIN_DB_PREFIX."adherent as a
|
||||
WHERE a.entity = %d
|
||||
AND a.tms < DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.rowid NOT IN (
|
||||
SELECT DISTINCT a.fk_element
|
||||
FROM ".MAIN_DB_PREFIX."actioncomm as a
|
||||
WHERE a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH)
|
||||
AND a.elementtype LIKE 'member'
|
||||
AND a.fk_element IS NOT NULL
|
||||
AND NOT EXISTS (
|
||||
SELECT id FROM ".MAIN_DB_PREFIX."actioncomm as a WHERE a.fk_element = a.rowid AND a.tms > DATE_SUB(NOW(), INTERVAL %d MONTH) AND a.elementtype LIKE 'member'
|
||||
)
|
||||
",
|
||||
"class" => "Adherent",
|
||||
"file" => DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php',
|
||||
'fields_anonym' => array(
|
||||
'lastname' => $langs->trans('ANONYME'),
|
||||
'firstname' => $langs->trans('ANONYME'),
|
||||
'lastname' => 'MAKEANONYMOUS',
|
||||
'firstname' => 'MAKEANONYMOUS',
|
||||
'civility_id' => '',
|
||||
'societe' => '',
|
||||
'address' => '',
|
||||
@ -456,7 +442,7 @@ class DataPolicyCron
|
||||
'state' => '',
|
||||
'country' => '',
|
||||
'state_id' => '',
|
||||
'skype' => '',
|
||||
'socialnetworks' => '',
|
||||
'country_id' => '',
|
||||
)
|
||||
),
|
||||
@ -483,27 +469,27 @@ class DataPolicyCron
|
||||
$object->fetch($obj->rowid);
|
||||
$object->id = $obj->rowid;
|
||||
|
||||
if ($object->isObjectUsed($obj->rowid) > 0) { // If object to clean is used
|
||||
foreach ($params['fields_anonym'] as $fields => $val) {
|
||||
$object->$fields = $val;
|
||||
}
|
||||
$result = $object->update($obj->rowid, $user);
|
||||
if ($result > 0) {
|
||||
if ($params['class'] == 'Societe') {
|
||||
// We delete contacts of thirdparty
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = ".$obj->rowid;
|
||||
$result = $this->db->query($sql);
|
||||
if ($result < 0) {
|
||||
$errormsg = $this->db->lasterror();
|
||||
$error++;
|
||||
$action = 'anonymize'; // TODO Offer also action "delete" in setup of module
|
||||
|
||||
if ($action == 'anonymize') {
|
||||
if ($object->isObjectUsed($obj->rowid) == 0) { // If object to clean is used
|
||||
foreach ($params['fields_anonym'] as $fields => $val) {
|
||||
if ($val == 'MAKEANONYMOUS') {
|
||||
$object->$fields = $fields.'-anonymous-'.$obj->rowid;
|
||||
} else {
|
||||
$object->$fields = $val;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$errormsg = $object->error;
|
||||
$error++;
|
||||
$result = $object->update($obj->rowid, $user);
|
||||
if ($result > 0) {
|
||||
$errormsg = $object->error;
|
||||
$error++;
|
||||
}
|
||||
$nbupdated++;
|
||||
}
|
||||
$nbupdated++;
|
||||
} else { // If object to clean is not used
|
||||
}
|
||||
|
||||
if ($action == 'delete') { // If object to clean is not used
|
||||
if ($object->element == 'adherent') {
|
||||
$result = $object->delete($obj->rowid, $user);
|
||||
} else {
|
||||
|
||||
@ -82,21 +82,6 @@ if (empty($origin_id)) {
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$line_id = GETPOST('lineid', 'int') ?GETPOST('lineid', 'int') : '';
|
||||
|
||||
// Security check
|
||||
$socid = '';
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
if ($origin == 'expedition') {
|
||||
$result = restrictedArea($user, $origin, $id);
|
||||
} else {
|
||||
$result = restrictedArea($user, 'expedition');
|
||||
if (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
}
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
@ -121,18 +106,24 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('expeditioncard', 'globalcard'));
|
||||
|
||||
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
|
||||
//var_dump($object->lines[0]->detail_batch);
|
||||
|
||||
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$object->fetch($id, $ref);
|
||||
$object->fetch_thirdparty();
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = '';
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
$result = restrictedArea($user, 'expedition', $object->id, '');
|
||||
|
||||
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
|
||||
//var_dump($object->lines[0]->detail_batch);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -1525,7 +1516,7 @@ if ($action == 'create') {
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
$head = shipping_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'shipping', $langs->trans("Shipment"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'shipping', $langs->trans("Shipment"), -1, $object->picto);
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
|
||||
@ -108,13 +108,6 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
/*
|
||||
elseif ($action == 'setaddress' && $user->rights->expedition->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
@ -143,7 +136,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$langs->trans("OrderCard");
|
||||
|
||||
$head = shipping_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'contact', $langs->trans("Shipment"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'contact', $langs->trans("Shipment"), -1, $object->picto);
|
||||
|
||||
|
||||
// Shipment card
|
||||
|
||||
@ -99,7 +99,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
$upload_dir = $conf->expedition->dir_output.'/sending/'.dol_sanitizeFileName($object->ref);
|
||||
|
||||
$head = shipping_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'documents', $langs->trans("Shipment"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'documents', $langs->trans("Shipment"), -1, $object->picto);
|
||||
|
||||
|
||||
// Build file list
|
||||
|
||||
@ -89,7 +89,7 @@ $form = new Form($db);
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$head = shipping_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'note', $langs->trans("Shipment"), -1, 'sending');
|
||||
print dol_get_fiche_head($head, 'note', $langs->trans("Shipment"), -1, $object->picto);
|
||||
|
||||
|
||||
// Shipment card
|
||||
|
||||
@ -2501,6 +2501,10 @@ class FactureFournisseur extends CommonInvoice
|
||||
}
|
||||
if (isset($this->status)) {
|
||||
$alreadypaid = -1;
|
||||
if (isset($this->alreadypaid)) {
|
||||
$alreadypaid = $this->alreadypaid;
|
||||
}
|
||||
|
||||
$label .= ' '.$this->getLibStatut(5, $alreadypaid);
|
||||
}
|
||||
if (!empty($this->ref)) {
|
||||
@ -2527,9 +2531,6 @@ class FactureFournisseur extends CommonInvoice
|
||||
if ($moretitle) {
|
||||
$label .= ' - '.$moretitle;
|
||||
}
|
||||
if (isset($this->statut) && isset($this->alreadypaid)) {
|
||||
$label .= '<br><b>'.$langs->trans("Status").":</b> ".$this->getLibStatut(5, $this->alreadypaid);
|
||||
}
|
||||
|
||||
$ref = $this->ref;
|
||||
if (empty($ref)) {
|
||||
@ -2567,8 +2568,6 @@ class FactureFournisseur extends CommonInvoice
|
||||
$result .= '<a href="'.DOL_URL_ROOT.'/fourn/facture/note.php?id='.$this->id.'" class="classfortooltip" title="'.dol_escape_htmltag($notetoshow).'">';
|
||||
$result .= img_picto('', 'note');
|
||||
$result .= '</a>';
|
||||
//$result.=img_picto($langs->trans("ViewNote"),'object_generic');
|
||||
//$result.='</a>';
|
||||
$result .= '</span>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -397,7 +397,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->fourn
|
||||
$qty = $supplierorderdispatch->qty;
|
||||
$entrepot = $supplierorderdispatch->fk_entrepot;
|
||||
$product = $supplierorderdispatch->fk_product;
|
||||
$price = GETPOST('price');
|
||||
$price = price2num(GETPOST('price', 'alpha'), 'MU');
|
||||
$comment = $supplierorderdispatch->comment;
|
||||
$eatby = $supplierorderdispatch->eatby;
|
||||
$sellby = $supplierorderdispatch->sellby;
|
||||
|
||||
@ -1768,7 +1768,7 @@ AGENDA_DEFAULT_VIEW=Which view do you want to open by default when selecting men
|
||||
AGENDA_REMINDER_BROWSER=Enable event reminder <b>on user's browser</b> (When remind date is reached, a popup is shown by the browser. Each user can disable such notifications from its browser notification setup).
|
||||
AGENDA_REMINDER_BROWSER_SOUND=Enable sound notification
|
||||
AGENDA_REMINDER_EMAIL=Enable event reminder <b>by emails</b> (remind option/delay can be defined on each event).
|
||||
AGENDA_REMINDER_EMAIL_NOTE=Note: The frequency of the task %s must be enough to be sure that the remind are sent at the correct moment.
|
||||
AGENDA_REMINDER_EMAIL_NOTE=Note: The frequency of the scheduled job %s must be enough to be sure that the remind are sent at the correct moment.
|
||||
AGENDA_SHOW_LINKED_OBJECT=Show linked object into agenda view
|
||||
##### Clicktodial #####
|
||||
ClickToDialSetup=Click To Dial module setup
|
||||
|
||||
@ -1960,7 +1960,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead
|
||||
*/
|
||||
function top_menu_user($hideloginname = 0, $urllogout = '')
|
||||
{
|
||||
global $langs, $conf, $db, $hookmanager, $user;
|
||||
global $langs, $conf, $db, $hookmanager, $user, $mysoc;
|
||||
global $dolibarr_main_authentication, $dolibarr_main_demo;
|
||||
global $menumanager;
|
||||
|
||||
@ -1985,13 +1985,27 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
||||
$dropdownBody .= '<span id="topmenulogincompanyinfo-btn"><i class="fa fa-caret-right"></i> '.$langs->trans("ShowCompanyInfos").'</span>';
|
||||
$dropdownBody .= '<div id="topmenulogincompanyinfo" >';
|
||||
|
||||
if (!empty($conf->global->MAIN_INFO_SIREN)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId1Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).'</span>';
|
||||
if (!empty($conf->global->MAIN_INFO_SIRET)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId2Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).'</span>';
|
||||
if (!empty($conf->global->MAIN_INFO_APE)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId3Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).'</span>';
|
||||
if (!empty($conf->global->MAIN_INFO_RCS)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId4Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).'</span>';
|
||||
if (!empty($conf->global->MAIN_INFO_PROFID5)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId5Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).'</span>';
|
||||
if (!empty($conf->global->MAIN_INFO_PROFID6)) $dropdownBody .= '<br><b>'.$langs->transcountry("ProfId6Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).'</span>';
|
||||
if (!empty($conf->global->MAIN_INFO_TVAINTRA)) $dropdownBody .= '<br><b>'.$langs->trans("VATIntraShort").'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).'</span>';
|
||||
if (!empty($conf->global->MAIN_INFO_SIREN)) {
|
||||
$dropdownBody .= '<br><b>'.$langs->transcountry("ProfId1Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIREN).'</span>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_INFO_SIRET)) {
|
||||
$dropdownBody .= '<br><b>'.$langs->transcountry("ProfId2Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_SIRET).'</span>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_INFO_APE)) {
|
||||
$dropdownBody .= '<br><b>'.$langs->transcountry("ProfId3Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_APE).'</span>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_INFO_RCS)) {
|
||||
$dropdownBody .= '<br><b>'.$langs->transcountry("ProfId4Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_RCS).'</span>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_INFO_PROFID5)) {
|
||||
$dropdownBody .= '<br><b>'.$langs->transcountry("ProfId5Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID5).'</span>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_INFO_PROFID6)) {
|
||||
$dropdownBody .= '<br><b>'.$langs->transcountry("ProfId6Short", $mysoc->country_code).'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_PROFID6).'</span>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_INFO_TVAINTRA)) {
|
||||
$dropdownBody .= '<br><b>'.$langs->trans("VATIntraShort").'</b>: <span>'.showValueWithClipboardCPButton($conf->global->MAIN_INFO_TVAINTRA).'</span>';
|
||||
}
|
||||
|
||||
$dropdownBody .= '</div>';
|
||||
|
||||
|
||||
@ -1521,7 +1521,7 @@ if ($dirins && $action == 'generatepackage') {
|
||||
|
||||
$arrayversion = explode('.', $moduleobj->version, 3);
|
||||
if (count($arrayversion)) {
|
||||
$FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].($arrayversion[1] ? '.'.$arrayversion[1] : '').($arrayversion[2] ? '.'.$arrayversion[2] : '').'.zip';
|
||||
$FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? '.'.$arrayversion[2] : '').'.zip';
|
||||
|
||||
$dirofmodule = dol_buildpath($modulelowercase, 0).'/bin';
|
||||
$outputfilezip = $dirofmodule.'/'.$FILENAMEZIP;
|
||||
@ -3022,7 +3022,7 @@ if ($module == 'initmodule') {
|
||||
print '<input type="hidden" name="tabobj" value="'.dol_escape_htmltag($tabobj).'">';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder">';
|
||||
print '<table class="noborder small">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print_liste_field_titre("Type", $_SERVER["PHP_SELF"], '', "", $param, '', $sortfield, $sortorder);
|
||||
@ -3044,51 +3044,51 @@ if ($module == 'initmodule') {
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td>';
|
||||
print $menu['type'];
|
||||
print dol_escape_htmltag($menu['type']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['fk_menu'];
|
||||
print dol_escape_htmltag($menu['fk_menu']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['titre'];
|
||||
print dol_escape_htmltag($menu['titre']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['mainmenu'];
|
||||
print dol_escape_htmltag($menu['mainmenu']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['leftmenu'];
|
||||
print dol_escape_htmltag($menu['leftmenu']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowmax300" title="'.dol_escape_htmltag($menu['url']).'">';
|
||||
print dol_escape_htmltag($menu['url']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['url'];
|
||||
print dol_escape_htmltag($menu['langs']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['langs'];
|
||||
print dol_escape_htmltag($menu['position']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['enabled']).'">';
|
||||
print dol_escape_htmltag($menu['enabled']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($menu['perms']).'">';
|
||||
print dol_escape_htmltag($menu['perms']);
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['position'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['enabled'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['perms'];
|
||||
print '</td>';
|
||||
|
||||
print '<td>';
|
||||
print $menu['target'];
|
||||
print dol_escape_htmltag($menu['target']);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="right">';
|
||||
print $menu['user'];
|
||||
print dol_escape_htmltag($menu['user']);
|
||||
print '</td>';
|
||||
|
||||
print '</tr>';
|
||||
@ -3447,7 +3447,7 @@ if ($module == 'initmodule') {
|
||||
print '</tr>';
|
||||
}
|
||||
} else {
|
||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("NoWidget");
|
||||
print '<tr><td><span class="fa fa-file-o"></span> '.$langs->trans("WidgetFile").' : <span class="opacitymedium">'.$langs->trans("NoWidget").'</span>';
|
||||
print '</td><td><a href="'.$_SERVER['PHP_SELF'].'?tab='.$tab.'&module='.$module.($forceddirread ? '@'.$dirread : '').'&action=initwidget&format=php">'.img_picto('Generate', 'generate', 'class="paddingleft"').'</a>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -3792,7 +3792,7 @@ if ($module == 'initmodule') {
|
||||
print $outputfiledoc;
|
||||
print '</a>';
|
||||
print '</strong>';
|
||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')';
|
||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledoc), 'dayhour').')</span>';
|
||||
}
|
||||
print '</strong><br>';
|
||||
|
||||
@ -3806,7 +3806,7 @@ if ($module == 'initmodule') {
|
||||
print $outputfiledocpdf;
|
||||
print '</a>';
|
||||
print '</strong>';
|
||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')';
|
||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfiledocpdf), 'dayhour').')</span>';
|
||||
}
|
||||
print '</strong><br>';
|
||||
|
||||
@ -3860,7 +3860,7 @@ if ($module == 'initmodule') {
|
||||
|
||||
$arrayversion = explode('.', $moduleobj->version, 3);
|
||||
if (count($arrayversion)) {
|
||||
$FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].'.'.$arrayversion[1].($arrayversion[2] ? ".".$arrayversion[2] : "").".zip";
|
||||
$FILENAMEZIP = "module_".$modulelowercase.'-'.$arrayversion[0].(empty($arrayversion[1]) ? '.0' : '.'.$arrayversion[1]).($arrayversion[2] ? ".".$arrayversion[2] : '').".zip";
|
||||
$outputfilezip = dol_buildpath($modulelowercase, 0).'/bin/'.$FILENAMEZIP;
|
||||
}
|
||||
|
||||
@ -3872,7 +3872,7 @@ if ($module == 'initmodule') {
|
||||
} else {
|
||||
$relativepath = $modulelowercase.'/bin/'.$FILENAMEZIP;
|
||||
print '<strong><a href="'.DOL_URL_ROOT.'/document.php?modulepart=packages&file='.urlencode($relativepath).'">'.$outputfilezip.'</a></strong>';
|
||||
print ' ('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')';
|
||||
print ' <span class="opacitymedium">('.$langs->trans("GeneratedOn").' '.dol_print_date(dol_filemtime($outputfilezip), 'dayhour').')</span>';
|
||||
}
|
||||
print '</strong><br>';
|
||||
|
||||
|
||||
@ -117,6 +117,26 @@ $permissiondellink = $user->rights->reception->creer; // Used by the include of
|
||||
|
||||
$date_delivery = dol_mktime(GETPOST('date_deliveryhour', 'int'), GETPOST('date_deliverymin', 'int'), 0, GETPOST('date_deliverymonth', 'int'), GETPOST('date_deliveryday', 'int'), GETPOST('date_deliveryyear', 'int'));
|
||||
|
||||
$object = new Reception($db);
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$object->fetch($id, $ref);
|
||||
$object->fetch_thirdparty();
|
||||
|
||||
if (!empty($object->origin)) {
|
||||
$origin = $object->origin;
|
||||
|
||||
$object->fetch_origin();
|
||||
$typeobject = $object->origin;
|
||||
}
|
||||
|
||||
// Linked documents
|
||||
if ($origin == 'order_supplier' && $object->$typeobject->id && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))) {
|
||||
$origin_id = $object->$typeobject->id;
|
||||
$objectsrc = new CommandeFournisseur($db);
|
||||
$objectsrc->fetch($object->$typeobject->id);
|
||||
}
|
||||
}
|
||||
|
||||
// Security check
|
||||
$socid = '';
|
||||
if ($user->socid) {
|
||||
@ -124,13 +144,10 @@ if ($user->socid) {
|
||||
}
|
||||
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $id);
|
||||
$result = restrictedArea($user, 'reception', $id);
|
||||
} else {
|
||||
$result = restrictedArea($user, 'reception');
|
||||
if ($origin == 'supplierorder') {
|
||||
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
|
||||
$result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
|
||||
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
@ -150,14 +167,12 @@ if ($reshook < 0) {
|
||||
if (empty($reshook)) {
|
||||
if ($cancel) {
|
||||
$action = '';
|
||||
$object->fetch($id); // show reception also after canceling modification
|
||||
}
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
|
||||
|
||||
// Reopen
|
||||
if ($action == 'reopen' && $user->rights->reception->creer) {
|
||||
$object->fetch($id);
|
||||
$result = $object->reOpen();
|
||||
}
|
||||
|
||||
@ -192,7 +207,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
if ($action == 'setref_supplier') {
|
||||
$result = $object->fetch($id);
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
@ -328,8 +342,6 @@ if (empty($reshook)) {
|
||||
$sellby = "dluo".$i;
|
||||
$batch = "batch".$i;
|
||||
|
||||
$timeFormat = '%d/%m/%Y';
|
||||
|
||||
if (GETPOST($qty, 'int') > 0 || (GETPOST($qty, 'int') == 0 && $conf->global->RECEPTION_GETS_ALL_ORDER_PRODUCTS)) {
|
||||
$ent = "entl".$i;
|
||||
|
||||
@ -354,7 +366,6 @@ if (empty($reshook)) {
|
||||
$eatbydate = str_replace('/', '-', $eatby);
|
||||
$sellbydate = str_replace('/', '-', $sellby);
|
||||
|
||||
|
||||
$ret = $object->addline($entrepot_id, GETPOST($idl, 'int'), GETPOST($qty, 'int'), $array_options[$i], GETPOST($comment, 'alpha'), strtotime($eatbydate), strtotime($sellbydate), GETPOST($batch, 'alpha'));
|
||||
if ($ret < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
@ -531,14 +542,12 @@ if (empty($reshook)) {
|
||||
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
|
||||
}
|
||||
} elseif ($action == 'classifybilled') {
|
||||
$object->fetch($id);
|
||||
$result = $object->setBilled();
|
||||
if ($result >= 0) {
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit();
|
||||
}
|
||||
} elseif ($action == 'classifyclosed') {
|
||||
$object->fetch($id);
|
||||
$result = $object->setClosed();
|
||||
if ($result >= 0) {
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
@ -546,7 +555,6 @@ if (empty($reshook)) {
|
||||
}
|
||||
} elseif ($action == 'deleteline' && !empty($line_id)) {
|
||||
// delete a line
|
||||
$object->fetch($id);
|
||||
$lines = $object->lines;
|
||||
$line = new CommandeFournisseurDispatch($db);
|
||||
|
||||
@ -958,6 +966,7 @@ if ($action == 'create') {
|
||||
if ($numAsked) {
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Comment").'</td>';
|
||||
print '<td class="center">'.$langs->trans("QtyOrdered").'</td>';
|
||||
print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
|
||||
print '<td class="center">'.$langs->trans("QtyToReceive");
|
||||
@ -1056,18 +1065,22 @@ if ($action == 'create') {
|
||||
print "</td>\n";
|
||||
}
|
||||
|
||||
// Comment
|
||||
//$defaultcomment = 'Line create from order line id '.$line->id;
|
||||
$defaultcomment = '';
|
||||
print '<td>';
|
||||
print '<input type="text" class="maxwidth100" name="comment'.$indiceAsked.'" value="'.$defaultcomment.'">';
|
||||
print '</td>';
|
||||
|
||||
// Qty
|
||||
print '<td class="center">'.$line->qty;
|
||||
print '<input type="hidden" name="fk_commandefournisseurdet'.$indiceAsked.'" value=\''.$line->id.'\' />';
|
||||
print '<textarea style="display:none;" name="comment'.$indiceAsked.'" >'.$line->desc.'</textarea>';
|
||||
print '<input type="hidden" name="fk_commandefournisseurdet'.$indiceAsked.'" value="'.$line->id.'">';
|
||||
print '<input name="qtyasked'.$indiceAsked.'" id="qtyasked'.$indiceAsked.'" type="hidden" value="'.$line->qty.'">';
|
||||
print '</td>';
|
||||
$qtyProdCom = $line->qty;
|
||||
|
||||
// Qty already received
|
||||
print '<td class="center">';
|
||||
|
||||
|
||||
$quantityDelivered = $object->receptions[$line->id];
|
||||
print $quantityDelivered;
|
||||
print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">';
|
||||
@ -1137,8 +1150,8 @@ if ($action == 'create') {
|
||||
print '<td colspan="3"></td>';
|
||||
}
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
print "</tr>\n";
|
||||
|
||||
//Display lines extrafields
|
||||
if (is_array($extralabelslines) && count($extralabelslines) > 0) {
|
||||
@ -1321,7 +1334,6 @@ if ($action == 'create') {
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$object->picto = 'sending';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
@ -1329,7 +1341,7 @@ if ($action == 'create') {
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Linked documents
|
||||
if ($typeobject == 'commande' && $object->$typeobject->id && !empty($conf->commande->enabled)) {
|
||||
@ -1493,11 +1505,11 @@ if ($action == 'create') {
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
|
||||
// Reception method
|
||||
print '<tr><td height="10">';
|
||||
print '<table class="nobordernopadding" width="100%"><tr><td>';
|
||||
print '<table class="nobordernopadding centpercent"><tr><td>';
|
||||
print $langs->trans('ReceptionMethod');
|
||||
print '</td>';
|
||||
|
||||
@ -1584,7 +1596,7 @@ if ($action == 'create') {
|
||||
// Product/Service
|
||||
print '<td>'.$langs->trans("Products").'</td>';
|
||||
// Comment
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td>'.$langs->trans("Comment").'</td>';
|
||||
// Qty
|
||||
print '<td class="center">'.$langs->trans("QtyOrdered").'</td>';
|
||||
if ($origin && $origin_id > 0) {
|
||||
@ -1747,9 +1759,9 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
if ($action == 'editline' && $lines[$i]->id == $line_id) {
|
||||
print '<td><textarea name="comment'.$line_id.'" id="comment'.$line_id.'" /> '.$lines[$i]->comment.'</textarea></td>';
|
||||
print '<td><input name="comment'.$line_id.'" id="comment'.$line_id.'" value="'.dol_escape_htmltag($lines[$i]->comment).'"></td>';
|
||||
} else {
|
||||
print '<td style="white-space: pre-wrap;max-width: 200px;" >'.$lines[$i]->comment.'</td>';
|
||||
print '<td style="white-space: pre-wrap; max-width: 200px;">'.dol_escape_htmltag($lines[$i]->comment).'</td>';
|
||||
}
|
||||
|
||||
|
||||
@ -1778,7 +1790,7 @@ if ($action == 'create') {
|
||||
$htmltext = $langs->trans("DateValidation").' : '.(empty($receptionline_var['date_valid']) ? $langs->trans("Draft") : dol_print_date($receptionline_var['date_valid'], 'dayhour'));
|
||||
if (!empty($conf->stock->enabled) && $receptionline_var['warehouse'] > 0) {
|
||||
$warehousestatic->fetch($receptionline_var['warehouse']);
|
||||
$htmltext .= '<br>'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1);
|
||||
$htmltext .= '<br>'.$langs->trans("From").' : '.$warehousestatic->getNomUrl(1, '', 0, 1);
|
||||
}
|
||||
print ' '.$form->textwithpicto('', $htmltext, 1);
|
||||
}
|
||||
|
||||
@ -1043,13 +1043,15 @@ class Reception extends CommonObject
|
||||
$line = new CommandeFournisseurDispatch($this->db);
|
||||
$line->fetch($obj->rowid);
|
||||
$line->fetch_product();
|
||||
$sql_commfourndet = 'SELECT qty, ref, label, tva_tx, vat_src_code, subprice, multicurrency_subprice, remise_percent FROM llx_commande_fournisseurdet WHERE rowid='.$line->fk_commandefourndet;
|
||||
$sql_commfourndet = 'SELECT qty, ref, label, description, tva_tx, vat_src_code, subprice, multicurrency_subprice, remise_percent';
|
||||
$sql_commfourndet .= ' FROM '.MAIN_DB_PREFIX.'commande_fournisseurdet';
|
||||
$sql_commfourndet .= ' WHERE rowid = '.((int) $line->fk_commandefourndet);
|
||||
$resql_commfourndet = $this->db->query($sql_commfourndet);
|
||||
if (!empty($resql_commfourndet)) {
|
||||
$obj = $this->db->fetch_object($resql_commfourndet);
|
||||
$line->qty_asked = $obj->qty;
|
||||
$line->description = $line->comment;
|
||||
$line->desc = $line->comment;
|
||||
$line->description = $obj->description;
|
||||
$line->desc = $obj->description;
|
||||
$line->tva_tx = $obj->tva_tx;
|
||||
$line->vat_src_code = $obj->vat_src_code;
|
||||
$line->subprice = $obj->subprice;
|
||||
@ -1060,6 +1062,7 @@ class Reception extends CommonObject
|
||||
} else {
|
||||
$line->qty_asked = 0;
|
||||
$line->description = '';
|
||||
$line->desc = '';
|
||||
$line->label = $obj->label;
|
||||
}
|
||||
|
||||
|
||||
@ -35,9 +35,7 @@ if (!empty($conf->projet->enabled)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
|
||||
$langs->load("orders");
|
||||
$langs->load("receptions");
|
||||
$langs->load("companies");
|
||||
$langs->loadLangs(array("orders", "receptions", "companies"));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
@ -62,7 +60,6 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
@ -70,11 +67,8 @@ if ($user->socid > 0) {
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $object->id);
|
||||
} else {
|
||||
$result = restrictedArea($user, 'reception');
|
||||
if ($origin == 'supplierorder') {
|
||||
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
|
||||
$result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
|
||||
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
@ -119,13 +113,6 @@ if ($action == 'addcontact' && $user->rights->reception->creer) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
/*
|
||||
elseif ($action == 'setaddress' && $user->rights->reception->creer)
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result=$object->setDeliveryAddress($_POST['fk_address']);
|
||||
if ($result < 0) dol_print_error($db,$object->error);
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
@ -141,11 +128,7 @@ $contactstatic = new Contact($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
|
||||
/* *************************************************************************** */
|
||||
/* */
|
||||
/* Mode vue et edition */
|
||||
/* */
|
||||
/* *************************************************************************** */
|
||||
// View mode
|
||||
|
||||
if ($id > 0 || !empty($ref)) {
|
||||
$langs->trans("OrderCard");
|
||||
@ -199,7 +182,6 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$object->picto = 'sending';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
@ -70,13 +70,14 @@ if ($user->socid > 0) {
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $object->id);
|
||||
} else {
|
||||
$result = restrictedArea($user, 'reception');
|
||||
if ($origin == 'supplierorder') {
|
||||
if (empty($user->rights->fournisseur->commande->lire) && empty($user->rights->fournisseur->commande->read)) {
|
||||
if ($origin == 'reception') {
|
||||
$result = restrictedArea($user, $origin, $object->id);
|
||||
} else {
|
||||
if ($origin == 'supplierorder' || $origin == 'order_supplier') {
|
||||
$result = restrictedArea($user, 'fournisseur', $origin_id, 'commande_fournisseur', 'commande');
|
||||
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
} elseif (empty($user->rights->{$origin}->lire) && empty($user->rights->{$origin}->read)) {
|
||||
accessforbidden();
|
||||
}
|
||||
}
|
||||
|
||||
@ -147,7 +148,6 @@ if ($id > 0 || !empty($ref)) {
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
$object->picto = 'sending';
|
||||
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2016 Christophe Battarel <christophe@altairis.fr>
|
||||
* Copyright (C) 2018 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -211,14 +212,14 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Auto assign user
|
||||
if ($conf->global->TICKET_AUTO_ASSIGN_USER_CREATE) {
|
||||
if (!empty($conf->global->TICKET_AUTO_ASSIGN_USER_CREATE)) {
|
||||
$result = $object->assignUser($user, $user->id, 1);
|
||||
$object->add_contact($user->id, "SUPPORTTEC", 'internal');
|
||||
}
|
||||
|
||||
// Auto assign contrat
|
||||
$contractid = 0;
|
||||
if ($conf->global->TICKET_AUTO_ASSIGN_CONTRACT_CREATE) {
|
||||
if (!empty($conf->global->TICKET_AUTO_ASSIGN_CONTRACT_CREATE)) {
|
||||
$contrat = new Contrat($db);
|
||||
$contrat->socid = $object->fk_soc;
|
||||
$list = $contrat->getListOfContracts();
|
||||
@ -233,7 +234,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
|
||||
// Auto create fiche intervention
|
||||
if ($conf->global->TICKET_AUTO_CREATE_FICHINTER_CREATE) {
|
||||
if (!empty($conf->global->TICKET_AUTO_CREATE_FICHINTER_CREATE)) {
|
||||
$fichinter = new Fichinter($db);
|
||||
$fichinter->socid = $object->fk_soc;
|
||||
$fichinter->fk_project = $projectid;
|
||||
@ -751,7 +752,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') {
|
||||
if ($res > 0) {
|
||||
// or for unauthorized internals users
|
||||
if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
|
||||
if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
|
||||
accessforbidden('', 0, 1);
|
||||
}
|
||||
|
||||
@ -853,7 +854,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
|
||||
if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
|
||||
$object->next_prev_filter = "te.fk_user_assign = '".$user->id."'";
|
||||
} elseif ($user->socid > 0) {
|
||||
$object->next_prev_filter = "te.fk_soc = '".$user->socid."'";
|
||||
@ -1030,7 +1031,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '</tr>';
|
||||
|
||||
// Timing (Duration sum of linked fichinter)
|
||||
if ($conf->fichinter->enabled) {
|
||||
if ($conf->ficheinter->enabled) {
|
||||
$object->fetchObjectLinked();
|
||||
$num = count($object->linkedObjects);
|
||||
$timing = 0;
|
||||
|
||||
@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
$langs->loadLangs(array("companies", "other", "ticket", "mails"));
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$track_id = GETPOST('track_id', 'alpha');
|
||||
$action = GETPOST('action', 'alpha');
|
||||
@ -104,7 +105,7 @@ if ($object->id) {
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
|
||||
if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
|
||||
$object->next_prev_filter = "te.fk_user_assign = '".$user->id."'";
|
||||
} elseif ($user->socid > 0) {
|
||||
$object->next_prev_filter = "te.fk_soc = '".$user->socid."'";
|
||||
|
||||
@ -118,7 +118,7 @@ foreach ($object->fields as $key => $val) {
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if ($val['searchall']) {
|
||||
if (!empty($val['searchall'])) {
|
||||
$fieldstosearchall['t.'.$key] = $val['label'];
|
||||
}
|
||||
}
|
||||
@ -340,7 +340,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje
|
||||
$sql .= $hookmanager->resPrint;
|
||||
$sql = preg_replace('/, $/', '', $sql);
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (t.fk_soc = s.rowid)";
|
||||
|
||||
@ -91,7 +91,7 @@ if ($user->socid > 0 && ($object->fk_soc != $user->socid)) {
|
||||
accessforbidden();
|
||||
}
|
||||
// or for unauthorized internals users
|
||||
if (!$user->socid && ($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
|
||||
if (!$user->socid && (!empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) && $object->fk_user_assign != $user->id) && !$user->rights->ticket->manage) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ if ($socid > 0) {
|
||||
print dol_get_fiche_end();
|
||||
}
|
||||
|
||||
if (!$user->socid && $conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY) {
|
||||
if (!$user->socid && !empty($conf->global->TICKET_LIMIT_VIEW_ASSIGNED_ONLY)) {
|
||||
$object->next_prev_filter = "te.fk_user_assign = '".$user->id."'";
|
||||
} elseif ($user->socid > 0) {
|
||||
$object->next_prev_filter = "te.fk_soc = '".$user->socid."'";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user