diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index 126f61e272c..80dddd28edb 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -430,7 +430,7 @@ if ($action != 'export_csv') {
print '
';
print ''.$accounting_account.' ';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
- print ''.price($opening_balance).' ';
+ print ''.price(price2num($opening_balance, 'MT')).' ';
}
$urlzoom = '';
@@ -444,9 +444,9 @@ if ($action != 'export_csv') {
}
}
// Debit
- print ''.price($line->debit).' ';
+ print ''.price(price2num($line->debit, 'MT')).' ';
// Credit
- print ''.price($line->credit).' ';
+ print ''.price(price2num($line->credit, 'MT')).' ';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print ''.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).' ';
@@ -467,10 +467,10 @@ if ($action != 'export_csv') {
if (!empty($show_subgroup)) {
print ' '.$langs->trans("SubTotal").': ';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
- print ''.price($sous_total_opening_balance).' ';
+ print ''.price(price2num($sous_total_opening_balance, 'MT')).' ';
}
- print ''.price($sous_total_debit).' ';
- print ''.price($sous_total_credit).' ';
+ print ''.price(price2num($sous_total_debit, 'MT')).' ';
+ print ''.price(price2num($sous_total_credit, 'MT')).' ';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . ' ';
} else {
@@ -482,10 +482,10 @@ if ($action != 'export_csv') {
print ''.$langs->trans("AccountBalance").': ';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
- print ''.price($total_opening_balance).' ';
+ print ''.price(price2num($total_opening_balance, 'MT')).' ';
}
- print ''.price($total_debit).' ';
- print ''.price($total_credit).' ';
+ print ''.price(price2num($total_debit, 'MT')).' ';
+ print ''.price(price2num($total_credit, 'MT')).' ';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . ' ';
} else {
diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php
index 1842c23f418..cff986c4729 100644
--- a/htdocs/accountancy/index.php
+++ b/htdocs/accountancy/index.php
@@ -81,7 +81,12 @@ $help_url = '';
llxHeader('', $langs->trans("AccountancyArea"), $help_url);
-if ($conf->accounting->enabled) {
+if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) {
+ print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
+
+ print ''.$langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")." \n";
+ print " ";
+} elseif ($conf->accounting->enabled) {
$step = 0;
$resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
@@ -258,7 +263,8 @@ if ($conf->accounting->enabled) {
} else {
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
- print ''.$langs->trans("Module10Desc")." \n";
+ print ''.$langs->trans("Module10Desc")." \n";
+ print " ";
}
// End of page
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index e33c811c161..5b73d995b5c 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -145,9 +145,9 @@ if ($action == 'updateMask') {
$draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
- $res3 = 0;
- if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
- $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
+ $res3 = 0;
+ if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
+ $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
}
$dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int');
@@ -156,7 +156,7 @@ if ($action == 'updateMask') {
$amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
$res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
- if (!($res1 > 0) || !($res2 > 0) || !($res3 > 0) || !($res4 >0) || !($res5 >0)) {
+ if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) {
$error++;
}
diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php
index 00fd1a91a8a..f10c7b10b48 100644
--- a/htdocs/api/class/api_documents.class.php
+++ b/htdocs/api/class/api_documents.class.php
@@ -120,7 +120,7 @@ class Documents extends DolibarrApi
*
* Test sample 1: { "modulepart": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }.
*
- * @param string $modulepart Name of module or area concerned by file download ('invoice', 'order', ...).
+ * @param string $modulepart Name of module or area concerned by file download ('thirdparty', 'member', 'proposal', 'supplier_proposal', 'order', 'supplier_order', 'invoice', 'supplier_invoice', 'shipment', 'project', ...)
* @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf).
* @param string $doctemplate Set here the doc template to use for document generation (If not set, use the default template).
* @param string $langcode Language code like 'en_US', 'fr_FR', 'es_ES', ... (If not set, use the default language).
@@ -325,6 +325,20 @@ class Documents extends DolibarrApi
throw new RestException(404, 'Proposal not found');
}
+ $upload_dir = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal');
+ } elseif ($modulepart == 'supplier_proposal') {
+ require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
+
+ if (!DolibarrApiAccess::$user->rights->supplier_proposal->read) {
+ throw new RestException(401);
+ }
+
+ $object = new Propal($this->db);
+ $result = $object->fetch($id, $ref);
+ if (!$result) {
+ throw new RestException(404, 'Supplier proposal not found');
+ }
+
$upload_dir = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal');
} elseif ($modulepart == 'commande' || $modulepart == 'order') {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
@@ -340,6 +354,22 @@ class Documents extends DolibarrApi
}
$upload_dir = $conf->commande->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'commande');
+ } elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') {
+ $modulepart = 'supplier_order';
+
+ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
+
+ if (empty(DolibarrApiAccess::$user->rights->fournisseur->commande->lire) && empty(DolibarrApiAccess::$user->rights->supplier_order->lire)) {
+ throw new RestException(401);
+ }
+
+ $object = new CommandeFournisseur($this->db);
+ $result = $object->fetch($id, $ref);
+ if (!$result) {
+ throw new RestException(404, 'Purchase order not found');
+ }
+
+ $upload_dir = $conf->fournisseur->dir_output."/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
} elseif ($modulepart == 'shipment' || $modulepart == 'expedition') {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
@@ -373,7 +403,7 @@ class Documents extends DolibarrApi
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
- if (!DolibarrApiAccess::$user->rights->fournisseur->facture->lire) {
+ if (empty(DolibarrApiAccess::$user->rights->fournisseur->facture->lire) && empty(DolibarrApiAccess::$user->rights->supplier_invoice->lire)) {
throw new RestException(401);
}
@@ -504,7 +534,7 @@ class Documents extends DolibarrApi
* Test sample for medias file: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }.
*
* @param string $filename Name of file to create ('FA1705-0123.txt')
- * @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...)
+ * @param string $modulepart Name of module or area concerned by file upload ('product', 'service', 'invoice', 'proposal', 'project', 'project_task', 'supplier_invoice', 'expensereport', 'member', ...)
* @param string $ref Reference of object (This will define subdir automatically and store submited file into it)
* @param string $subdir Subdirectory (Only if ref not provided)
* @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)
diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php
index 8f3cadeedc2..edd9bd69ef4 100644
--- a/htdocs/bom/lib/bom.lib.php
+++ b/htdocs/bom/lib/bom.lib.php
@@ -54,7 +54,9 @@ function bomAdminPrepareHead()
//$this->tabs = array(
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
//); // to remove a tab
- complete_head_from_modules($conf, $langs, null, $head, $h, 'bom');
+ complete_head_from_modules($conf, $langs, null, $head, $h, 'bom@mrp');
+
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@mrp', 'remove');
return $head;
}
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index b0109d69fe5..7f3865906c8 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -363,7 +363,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
}
print ''.price($obj->total_ttc).' ';
print ''.dol_print_date($db->jdate($obj->tms), 'day').' ';
- print ''.$facstatic->getLibStatut(3).' ';
+ $alreadypaid = $facstatic->getSommePaiement();
+ print ''.$facstatic->getLibStatut(3, $alreadypaid).' ';
print ' ';
$total_ht += $obj->total_ht;
$total_ttc += $obj->total_ttc;
diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index eccbf017735..ab6f0f5e574 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -416,10 +416,13 @@ if ($resql) {
print ''.$invoice->getLibStatut(5, $alreadypayed).' ';
print "\n";
- if ($objp->paye == 1) { // If at least one invoice is paid, disable delete
+
+ // If at least one invoice is paid, disable delete. INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED Can be use for maintenance purpose. Never use this in production
+ if ($objp->paye == 1 && empty($conf->global->INVOICE_CAN_DELETE_PAYMENT_EVEN_IF_INVOICE_CLOSED)) {
$disable_delete = 1;
$title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid"));
}
+
$total = $total + $objp->amount;
$i++;
}
diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php
index a6157d2a26b..e4483258b92 100644
--- a/htdocs/core/actions_addupdatedelete.inc.php
+++ b/htdocs/core/actions_addupdatedelete.inc.php
@@ -129,7 +129,6 @@ if ($action == 'add' && !empty($permissiontoadd)) {
if (!$error) {
$result = $object->create($user);
- var_dump($object);exit;
if ($result > 0) {
// Creation OK
if ($conf->categorie->enabled && method_exists($object, 'setCategories')) {
@@ -298,6 +297,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
}
$result = $object->delete($user);
+
if ($result > 0) {
// Delete OK
setEventMessages("RecordDeleted", null, 'mesgs');
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index f63081660d6..004dc184fa9 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5324,7 +5324,7 @@ abstract class CommonObject
$ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content
$ecmfile->keywords = ''; // keyword content
- $ecmfile->src_object_type = $this->table_element.(empty($this->module) ? '' : '@'.$this->module);
+ $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
$ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user);
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 0d1d838aad4..03faffb941b 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1578,7 +1578,7 @@ class FormFile
*
* @param string $upload_dir Directory that was scanned. This directory will contains files into subdirs REF/files
* @param array $filearray Array of files loaded by dol_dir_list function before calling this function
- * @param string $modulepart Value for modulepart used by download wrapper
+ * @param string $modulepart Value for modulepart used by download wrapper. Value can be $object->table_name (that is 'myobject' or 'mymodule_myobject') or $object->element.'-'.$module (for compatibility purpose)
* @param string $param Parameters on sort links
* @param int $forcedownload Force to open dialog box "Save As" when clicking on file
* @param string $relativepath Relative path of docs (autodefined if not provided)
@@ -1742,7 +1742,8 @@ class FormFile
$id = 0;
$ref = '';
- // To show ref or specific information according to view to show (defined by $module)
+ // To show ref or specific information according to view to show (defined by $modulepart)
+ // $modulepart can be $object->table_name (that is 'mymodule_myobject') or $object->element.'-'.$module (for compatibility purpose)
$reg = array();
if ($modulepart == 'company' || $modulepart == 'tax') {
preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg);
@@ -1848,10 +1849,9 @@ class FormFile
// File
// Check if document source has external module part, if it the case use it for module part on document.php
- preg_match('/^[^@]*@([^@]*)$/', $modulepart.'@expertisemedical', $modulesuffix);
print '';
//print "XX".$file['name']; //$file['name'] must be utf8
- print 'getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$');
- print $this->showPreview($file, (empty($modulesuffix) ? $modulepart : $modulesuffix[1]), $file['relativename']);
+ print $this->showPreview($file, $modulepart, $file['relativename']);
print " \n";
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index e18ec3e3678..193c4c3acb7 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -484,7 +484,7 @@ function getNumberInvoicesPieChart($mode)
$sql .= " sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub30, 'Y-m-d')."'", 1, 0).") as nblate30";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($datenowsub15, 'Y-m-d')."'", 1, 0).") as nblate15";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement < '".date_format($now, 'Y-m-d')."'", 1, 0).") as nblatenow";
- $sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($now, 'Y-m-d')."'", 1, 0).") as nbnotlatenow";
+ $sql .= ", sum(".$db->ifsql("f.date_lim_reglement >= '".date_format($now, 'Y-m-d')."' OR f.date_lim_reglement IS NULL", 1, 0).") as nbnotlatenow";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd15, 'Y-m-d')."'", 1, 0).") as nbnotlate15";
$sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd30, 'Y-m-d')."'", 1, 0).") as nbnotlate30";
if ($mode == 'customers') {
@@ -515,13 +515,20 @@ function getNumberInvoicesPieChart($mode)
,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15)
,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30)
,array($langs->trans('InvoiceNotLate30Days'), $obj->nbnotlate30));*/
- $dataseries[0]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30);
+ $dataseries[$i]=array($langs->trans('NbOfOpenInvoices'), $obj->nblate30, $obj->nblate15 - $obj->nblate30, $obj->nblatenow - $obj->nblate15, $obj->nbnotlatenow - $obj->nbnotlate15, $obj->nbnotlate15 - $obj->nbnotlate30, $obj->nbnotlate30);
$i++;
}
- foreach ($dataseries as $key=>$value) {
- $total += $value[1];
+ foreach ($dataseries[0] as $key=>$value) {
+ $total += $value;
}
- $legend = array($langs->trans('InvoiceLate30Days'), $langs->trans('InvoiceLate15Days'), $langs->trans('InvoiceLateMinus15Days'), $langs->trans('InvoiceNotLate'), $langs->trans('InvoiceNotLate15Days'), $langs->trans('InvoiceNotLate30Days'));
+ $legend = array(
+ $langs->trans('InvoiceLate30Days'),
+ $langs->trans('InvoiceLate15Days'),
+ $langs->trans('InvoiceLateMinus15Days'),
+ $mode == 'customers' ? $langs->trans('InvoiceNotLate') : $langs->trans("InvoiceToPay"),
+ $mode == 'customers' ? $langs->trans('InvoiceNotLate15Days') : $langs->trans("InvoiceToPay15Days"),
+ $mode == 'customers' ? $langs->trans('InvoiceNotLate30Days') : $langs->trans("InvoiceToPay30Days"),
+ );
$colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11, '-'.$badgeStatus11);
diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
index cf8b03f1fea..2752f9a9c9b 100644
--- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php
@@ -651,6 +651,11 @@ class pdf_espadon extends ModelePdfExpedition
$nexY = max($pdf->GetY(), $nexY);
}
+ if ($this->getColumnStatus('unit_order')) {
+ $this->printStdColumnContent($pdf, $curY, 'unit_order', measuringUnitString($object->lines[$i]->fk_unit));
+ $nexY = max($pdf->GetY(), $nexY);
+ }
+
if ($this->getColumnStatus('qty_shipped')) {
$this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped);
$nexY = max($pdf->GetY(), $nexY);
@@ -1312,6 +1317,20 @@ class pdf_espadon extends ModelePdfExpedition
),
);
+ $rank = $rank + 10;
+ $this->cols['unit_order'] = array(
+ 'rank' => $rank,
+ 'width' => 15, // in mm
+ 'status' => empty($conf->global->PRODUCT_USE_UNITS) ? 0 : 1,
+ 'title' => array(
+ 'textkey' => 'Unit'
+ ),
+ 'border-left' => true, // add left line separator
+ 'content' => array(
+ 'align' => 'C',
+ ),
+ );
+
$rank = $rank + 10;
$this->cols['qty_shipped'] = array(
'rank' => $rank,
diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php
index 328f3504497..6d0c77dc768 100644
--- a/htdocs/eventorganization/class/conferenceorbooth.class.php
+++ b/htdocs/eventorganization/class/conferenceorbooth.class.php
@@ -271,7 +271,6 @@ class ConferenceOrBooth extends ActionComm
*/
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{
-
//TODO set percent according status
global $conf;
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index 0826a53b772..bf3470b7445 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -105,9 +105,9 @@ class ConferenceOrBoothAttendee extends CommonObject
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>2, 'index'=>1, 'comment'=>"Reference of object"),
'fk_actioncomm' => array('type'=>'integer:ActionComm:comm/action/class/actioncomm.class.php:1', 'label'=>'ConferenceOrBooth', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>0, 'index'=>1, 'picto'=>'agenda'),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>20, 'notnull'=>1, 'visible'=>0, 'index'=>1, 'picto'=>'project', 'css'=>'tdoverflowmax150 maxwidth500'),
- 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1,),
- 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
- 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>0, 'visible'=>1, 'showoncombobox'=>'1',),
+ 'email' => array('type'=>'mail', 'label'=>'EmailAttendee', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'index'=>1, 'autofocusoncreate'=>1),
+ 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status = 1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'ThirdParty', 'enabled'=>'1', 'position'=>40, 'notnull'=>-1, 'visible'=>1, 'index'=>1, 'help'=>"OrganizationEventLinkToThirdParty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'),
+ 'date_subscription' => array('type'=>'datetime', 'label'=>'DateOfRegistration', 'enabled'=>'1', 'position'=>56, 'notnull'=>1, 'visible'=>1, 'showoncombobox'=>'1',),
'fk_invoice' => array('type'=>'integer:Facture:compta/facture/class/facture.class.php', 'label'=>'Invoice', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>-1, 'index'=>0, 'picto'=>'bill', 'css'=>'tdoverflowmax150 maxwidth500'),
'amount' => array('type'=>'price', 'label'=>'AmountPaid', 'enabled'=>'1', 'position'=>57, 'notnull'=>0, 'visible'=>1, 'default'=>'null', 'isameasure'=>'1', 'help'=>"AmountOfSubscriptionPaid",),
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,),
diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php
index 03e309aa41d..994ff9a7ee7 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_card.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_card.php
@@ -57,9 +57,10 @@ $projectstatic = new Project($db);
$diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array
+
if ($conf_or_booth_id > 0) {
$confOrBooth = new ConferenceOrBooth($db);
- $result = $confOrBooth->fetch($conf_or_booth_id);
+ $result = $confOrBooth->fetch($id > 0 ? $id : $conf_or_booth_id);
if ($result < 0) {
setEventMessages(null, $confOrBooth->errors, 'errors');
} else {
@@ -102,6 +103,10 @@ if (empty($action) && empty($id) && empty($ref)) {
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
+// Now we have loaded the attendee, we can force the project (in case value provided as parameter is wrong or value not provided)
+if ($object->fk_project > 0) {
+ $fk_project = $object->fk_project;
+}
$permissiontoread = $user->rights->eventorganization->read;
$permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
@@ -125,7 +130,7 @@ if (empty($reshook)) {
$error = 0;
if (!empty($withproject)) {
- $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1';
+ $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php?withproject=1&fk_project='.((int) $fk_project);
} else {
$backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php';
}
@@ -151,7 +156,6 @@ if (empty($reshook)) {
$action = '';
}
-
$triggermodname = 'EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_MODIFY'; // Name of trigger action code to execute when we modify record
// Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
@@ -653,14 +657,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($user->socid)) {
print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle');
}
- print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken().'', '', $permissiontoadd);
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit&token='.newToken(), '', $permissiontoadd);
// Clone
- print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().'&object=scrumsprint', '', $permissiontoadd);
-
+ print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontoadd);
// Delete (need delete permission, or if draft, just need create/modify permission)
- print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().'', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
+ print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete&token='.newToken().(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:''), '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
}
print ''."\n";
}
diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php
index 709d3255e13..a9422f8ddd7 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_list.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_list.php
@@ -699,7 +699,8 @@ print ' ';
print ' ';
print ' ';
-$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd);
+$params = array('morecss'=>'reposition');
+$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?action=create'.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').$withProjectUrl.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?projectid='.$projectstatic->id.(empty($confOrBooth->id) ? '' : '&conforboothid='.$confOrBooth->id).$withProjectUrl), '', $permissiontoadd, $params);
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index c87d2fcc5ce..1ba022efdb1 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -1160,10 +1160,16 @@ if ($action == 'create') {
print "\n";
}
+ // unit of order
+ $unit_order = '';
+ if ($conf->global->PRODUCT_USE_UNITS) {
+ $unit_order = measuringUnitString($line->fk_unit);
+ }
+
// Qty
print ''.$line->qty;
print ' ';
- print ' ';
+ print ''.$unit_order.'';
$qtyProdCom = $line->qty;
// Qty already shipped
@@ -1171,7 +1177,7 @@ if ($action == 'create') {
$quantityDelivered = $object->expeditions[$line->id];
print $quantityDelivered;
print ' ';
- print '';
+ print ''.$unit_order.'';
// Qty to ship
$quantityAsked = $line->qty;
@@ -2056,7 +2062,7 @@ if ($action == 'create') {
// Get list of products already sent for same source object into $alreadysent
$alreadysent = array();
if ($origin && $origin_id > 0) {
- $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end";
+ $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.fk_unit, obj.date_start, obj.date_end";
$sql .= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot";
$sql .= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition";
//if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received";
@@ -2176,8 +2182,13 @@ if ($action == 'create') {
print "\n";
}
+ $unit_order = '';
+ if ($conf->global->PRODUCT_USE_UNITS) {
+ $unit_order = measuringUnitString($lines[$i]->fk_unit);
+ }
+
// Qty ordered
- print ''.$lines[$i]->qty_asked.' ';
+ print ''.$lines[$i]->qty_asked.' '.$unit_order.' ';
// Qty in other shipments (with shipment and warehouse used)
if ($origin && $origin_id > 0) {
@@ -2241,7 +2252,7 @@ if ($action == 'create') {
print '';
print '';
// Qty to ship or shipped
- print ' ';
+ print ' '.$unit_order.' ';
// Warehouse source
print ''.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).' ';
// Batch number managment
@@ -2252,7 +2263,7 @@ if ($action == 'create') {
foreach ($lines[$i]->details_entrepot as $detail_entrepot) {
print ' ';
// Qty to ship or shipped
- print ' ';
+ print ' '.$unit_order.' ';
// Warehouse source
print ''.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).' ';
// Batch number managment
@@ -2267,7 +2278,7 @@ if ($action == 'create') {
print '';
print ' ';
// Qty to ship or shipped
- print ' ';
+ print ' '.$unit_order.' ';
// Warehouse source
print ' ';
// Batch number managment
@@ -2289,7 +2300,7 @@ if ($action == 'create') {
print '';
} else {
// Qty to ship or shipped
- print ''.$lines[$i]->qty_shipped.' ';
+ print ''.$lines[$i]->qty_shipped.' '.$unit_order.' ';
// Warehouse source
if (!empty($conf->stock->enabled)) {
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index a6ab016ef7b..b8814450030 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -617,7 +617,7 @@ if ($id > 0 || !empty($ref)) {
$sql = "SELECT cd.rowid, cd.fk_product, cd.product_type as type, cd.label, cd.description,";
$sql .= " cd.price, cd.tva_tx, cd.subprice,";
- $sql .= " cd.qty,";
+ $sql .= " cd.qty, cd.fk_unit,";
$sql .= ' cd.date_start,';
$sql .= ' cd.date_end,';
$sql .= ' cd.special_code,';
@@ -625,8 +625,10 @@ if ($id > 0 || !empty($ref)) {
$sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units,';
$sql .= ' p.surface, p.surface_units, p.volume, p.volume_units';
$sql .= ', p.tobatch, p.tosell, p.tobuy, p.barcode';
+ $sql .= ', u.short_label as unit_order';
$sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON cd.fk_product = p.rowid";
+ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_units as u ON cd.fk_unit = u.rowid";
$sql .= " WHERE cd.fk_commande = ".((int) $object->id);
$sql .= " ORDER BY cd.rang, cd.rowid";
@@ -766,7 +768,7 @@ if ($id > 0 || !empty($ref)) {
}
// Qty ordered
- print ''.$objp->qty.' ';
+ print ''.$objp->qty.($objp->unit_order ? ' '.$objp->unit_order : '').' ';
// Qty already shipped
$qtyProdCom = $objp->qty;
@@ -774,7 +776,7 @@ if ($id > 0 || !empty($ref)) {
// Nb of sending products for this line of order
$qtyAlreadyShipped = (!empty($object->expeditions[$objp->rowid]) ? $object->expeditions[$objp->rowid] : 0);
print $qtyAlreadyShipped;
- print '';
+ print ($objp->unit_order ? ' '.$objp->unit_order : '').'';
// Qty remains to ship
print '';
@@ -785,7 +787,7 @@ if ($id > 0 || !empty($ref)) {
} else {
print '0 ('.$langs->trans("Service").')';
}
- print ' ';
+ print ($objp->unit_order ? ' '.$objp->unit_order : '').'';
if ($objp->fk_product > 0) {
$product = new Product($db);
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 21d6e73eb39..02e52c8164b 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2377,7 +2377,7 @@ if ($action == 'create') {
print '';
- $objectsrc->printOriginLinesList();
+ $objectsrc->printOriginLinesList('', $selectedLines);
print '
';
}
diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
index 29c2aad9bd4..a9f1a669e52 100644
--- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
+++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
@@ -37,6 +37,7 @@ ALTER TABLE llx_prelevement_bons ADD COLUMN type varchar(16) DEFAULT 'debit-orde
ALTER TABLE llx_prelevement_facture CHANGE COLUMN fk_facture_foun fk_facture_fourn integer NULL;
+ALTER TABLE llx_prelevement_facture_demande ADD COLUMN fk_facture_fourn INTEGER NULL;
ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture (fk_facture);
ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn);
diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
index db0e40790dc..d6e21f17aeb 100644
--- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
+++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
@@ -76,6 +76,7 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1);
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1);
+UPDATE llx_accounting_system SET fk_country = 1 WHERE fk_country IS NULL;
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'auguria';
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'bureau2crea';
diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang
index 753f83ba6ad..ace3e518003 100644
--- a/htdocs/langs/en_US/compta.lang
+++ b/htdocs/langs/en_US/compta.lang
@@ -286,9 +286,12 @@ ReportPurchaseTurnover=Purchase turnover invoiced
ReportPurchaseTurnoverCollected=Purchase turnover collected
IncludeVarpaysInResults = Include various payments in reports
IncludeLoansInResults = Include loans in reports
-InvoiceLate30Days = Invoices late > 30 days
-InvoiceLate15Days = Invoices late > 15 days
-InvoiceLateMinus15Days = Invoices late
-InvoiceNotLate = To be collected < 15 days
-InvoiceNotLate15Days = To be collected in 15 days
-InvoiceNotLate30Days = To be collected in 30 days
+InvoiceLate30Days = Invoices late (> 30 days)
+InvoiceLate15Days = Invoices late (15 to 30 days)
+InvoiceLateMinus15Days = Invoices late (< 15 days)
+InvoiceNotLate = To be collected (< 15 days)
+InvoiceNotLate15Days = To be collected (15 to 30 days)
+InvoiceNotLate30Days = To be collected (> 30 days)
+InvoiceToPay=To pay (< 15 days)
+InvoiceToPay15Days=To pay (15 to 30 days)
+InvoiceToPay30Days=To pay (> 30 days)
\ No newline at end of file
diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang
index 5da6be656e5..8c91d842485 100644
--- a/htdocs/langs/en_US/eventorganization.lang
+++ b/htdocs/langs/en_US/eventorganization.lang
@@ -75,10 +75,10 @@ EventOrganizationMassEmailSpeakers = Communication to speakers
#
# Event
#
-AllowUnknownPeopleSuggestConf=Allow unknown people to suggest conferences
-AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest conferences
-AllowUnknownPeopleSuggestBooth=Allow unknown people to suggest booth
-AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to suggest booth
+AllowUnknownPeopleSuggestConf=Allow people to suggest conferences
+AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest a conference they want to do
+AllowUnknownPeopleSuggestBooth=Allow people to apply for a booth
+AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to apply for a booth
PriceOfRegistration=Price of registration
PriceOfRegistrationHelp=Price to pay to register or participate in the event
PriceOfBooth=Subscription price to stand a booth
@@ -106,9 +106,9 @@ EvntOrgCancelled = Cancelled
#
SuggestForm = Suggestion page
SuggestOrVoteForConfOrBooth = Page for suggestion or vote
-EvntOrgRegistrationHelpMessage = Here, you can vote for a conference or booth or suggest a new one for the event
-EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference for the project
-EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project
+EvntOrgRegistrationHelpMessage = Here, you can vote for a conference or suggest a new one for the event. You can also apply to have a booth during the event.
+EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference to animate during the event.
+EvntOrgRegistrationBoothHelpMessage = Here, you can apply to have a booth during the event.
ListOfSuggestedConferences = List of suggested conferences
ListOfSuggestedBooths = List of suggested booths
ListOfConferencesOrBooths=List of conferences or booths of event project
@@ -136,6 +136,10 @@ OrganizationEventPaymentOfBoothWasReceived=Your payment for your booth has been
OrganizationEventPaymentOfRegistrationWasReceived=Your payment for your event registration has been recorded
OrganizationEventBulkMailToAttendees=This is a remind about your participation in the event as an attendee
OrganizationEventBulkMailToSpeakers=This is a reminder on your participation in the event as a speaker
+OrganizationEventLinkToThirdParty=Link to third party (customer, supplier or partner)
+
+NewSuggestionOfBooth=Application for a booth
+NewSuggestionOfConference=Application for a conference
#
# Vote page
@@ -153,7 +157,7 @@ ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an e
Attendee = Attendee
PaymentConferenceAttendee = Conference attendee payment
PaymentBoothLocation = Booth location payment
-
+DeleteConferenceOrBoothAttendee=Remove attendee
RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email %s
EmailAttendee=Attendee email
EmailCompanyForInvoice=Company email (for invoice, if different of attendee email)
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index fb6e20adcca..6004482cb29 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -1157,3 +1157,4 @@ RecordsApproved=%s Record(s) approved
Properties=Properties
hasBeenValidated=%s has been validated
ClientTZ=Client Time Zone (user)
+NotClosedYet=Not yet closed
\ No newline at end of file
diff --git a/htdocs/modulebuilder/template/lib/mymodule.lib.php b/htdocs/modulebuilder/template/lib/mymodule.lib.php
index 2cfc428b7ce..32ae980e946 100644
--- a/htdocs/modulebuilder/template/lib/mymodule.lib.php
+++ b/htdocs/modulebuilder/template/lib/mymodule.lib.php
@@ -60,7 +60,9 @@ function mymoduleAdminPrepareHead()
//$this->tabs = array(
// 'entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'
//); // to remove a tab
- complete_head_from_modules($conf, $langs, null, $head, $h, 'mymodule');
+ complete_head_from_modules($conf, $langs, null, $head, $h, 'mymodule@mymodule');
+
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'mymodule@mymodule', 'remove');
return $head;
}
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index 99946ff54ce..59a3a1e72b0 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -266,7 +266,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
- $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : '');
+ $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
}
}
// Add fields from hooks
diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php
index 10470c17f6d..7c5c91c0511 100644
--- a/htdocs/mrp/mo_list.php
+++ b/htdocs/mrp/mo_list.php
@@ -207,7 +207,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
- $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key.', ' : '');
+ $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : "");
}
}
// Add fields from hooks
@@ -276,7 +276,7 @@ foreach($object->fields as $key => $val) {
// Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
- $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
+ $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.", " : "");
}
}
// Add where from hooks
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index 210960d627e..078082961a5 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -926,8 +926,8 @@ if ($action == 'create' && $user->rights->projet->creer) {
print '';
print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 0, 1);
print ' ';
- print ' ';
- print $langs->trans("AlsoCloseAProject");
+ print ' ';
+ print ''.$langs->trans("AlsoCloseAProject").' ';
print '
';
print ' ';
print ' ';
@@ -948,11 +948,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Date start
print ''.$langs->trans("DateStart").' ';
print $form->selectDate($object->date_start ? $object->date_start : -1, 'projectstart', 0, 0, 0, '', 1, 0);
- print ' '.$langs->trans("ProjectReportDate");
+ print '/>'.$langs->trans("ProjectReportDate").' ';
print ' ';
// Date end
diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php
index b6b4470dd15..56649af9a45 100644
--- a/htdocs/projet/graph_opportunities.inc.php
+++ b/htdocs/projet/graph_opportunities.inc.php
@@ -83,6 +83,9 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
$code = dol_getIdFromCode($db, $status, 'c_lead_status', 'rowid', 'code');
if ($code) {
$labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code);
+ if ($code == 'WON' || $code == 'LOST') {
+ $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code).' ('.$langs->transnoentitiesnoconv("NotClosedYet").")";
+ }
}
if (empty($labelStatus)) {
$labelStatus = $listofopplabel[$status];
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 6f670af2bb6..213691f4e25 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -152,7 +152,7 @@ if ($resql) {
while ($i < $num) {
$objp = $db->fetch_object($resql);
$listofoppstatus[$objp->rowid] = $objp->percent;
- $listofopplabel[$objp->rowid] = $objp->label;
+ $listofopplabel[$objp->rowid] = $objp->label; // default label if translation from "OppStatus".code not found.
$listofoppcode[$objp->rowid] = $objp->code;
switch ($objp->code) {
case 'PROSP':
diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php
index bb0f9005057..3990e31ba2f 100644
--- a/htdocs/public/project/index.php
+++ b/htdocs/public/project/index.php
@@ -13,21 +13,12 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
- *
- * For Paypal test: https://developer.paypal.com/
- * For Paybox test: ???
- * For Stripe test: Use credit card 4242424242424242 .More example on https://stripe.com/docs/testing
- *
- * Variants:
- * - When option STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION is on, we use the new PaymentIntent API
- * - When option STRIPE_USE_NEW_CHECKOUT is on, we use the new checkout API
- * - If no option set, we use old APIS (charge)
*/
/**
- * \file htdocs/public/payment/newpayment.php
+ * \file htdocs/public/project/index.php
* \ingroup core
- * \brief File to offer a way to make a payment for a particular Dolibarr object
+ * \brief File to offer a way to suggest a conference or a booth for an event
*/
if (!defined('NOLOGIN')) {
@@ -74,8 +65,8 @@ $langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox
$action = GETPOST('action', 'aZ09');
$id = GETPOST('id');
-$securekeyreceived = GETPOST("securekey");
-$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
+$securekeyreceived = GETPOST("securekey", 'alpha');
+$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
if ($securekeytocompare != $securekeyreceived) {
print $langs->trans('MissingOrBadSecureKey');
diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php
index b07b7350372..7e1607adbe2 100644
--- a/htdocs/public/project/suggestbooth.php
+++ b/htdocs/public/project/suggestbooth.php
@@ -16,9 +16,9 @@
*/
/**
- * \file htdocs/public/members/new.php
+ * \file htdocs/public/project/suggestbooth.php
* \ingroup member
- * \brief Example of form to add a new member
+ * \brief Example of form to suggest a booth
*
* Note that you can add following constant to change behaviour of page
* MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form
@@ -94,7 +94,7 @@ if ($resultproject < 0) {
// Security check
$securekeyreceived = GETPOST("securekey");
-$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
+$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
if ($securekeytocompare != $securekeyreceived) {
print $langs->trans('MissingOrBadSecureKey');
@@ -112,7 +112,7 @@ $extrafields = new ExtraFields($db);
$user->loadDefaultValues();
$cactioncomm = new CActionComm($db);
-$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'booth@eventorganization\'');
+$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='booth@eventorganization'");
// Security check
if (empty($conf->eventorganization->enabled)) {
@@ -224,20 +224,6 @@ if (empty($reshook) && $action == 'add') {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))." \n";
}
- if (empty($datestart)) {
- $error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))." \n";
- } elseif ($datestart < $project->date_start) {
- $error++;
- $errmsg .= $langs->trans("DateMustBeAfterThan", $langs->transnoentitiesnoconv("DateStart"), dol_print_date($project->date_start))." \n";
- }
- if (empty($dateend)) {
- $error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))." \n";
- } elseif ($dateend > dol_mktime(23, 59, 59, dol_print_date($project->date_end, '%m'), dol_print_date($project->date_end, '%d'), dol_print_date($project->date_end, '%Y'))) {
- $error++;
- $errmsg .= $langs->trans("DateMustBeBeforeThan", $langs->transnoentitiesnoconv("DateEnd"), dol_print_date($project->date_end))." \n";
- }
if (!GETPOST("email")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))." \n";
@@ -529,10 +515,10 @@ if (empty($reshook) && $action == 'add') {
$form = new Form($db);
$formcompany = new FormCompany($db);
-llxHeaderVierge($langs->trans("NewSuggestion"));
+llxHeaderVierge($langs->trans("NewSuggestionOfBooth"));
-print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center');
+print load_fiche_titre($langs->trans("NewSuggestionOfBooth"), '', '', 0, 0, 'center');
print '';
@@ -541,7 +527,7 @@ print '
';
// Welcome message
$text = '
'.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").' ';
-$text .= ''.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$id.'. '."\n";
+$text .= ''.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$project->label.'. '."\n";
$text .= ''.$project->note_public.' '."\n";
print $text;
print '';
@@ -636,24 +622,6 @@ print '
*'."\n";
print '
'."\n";
-// Start Date
-print '
'.$langs->trans("DateStart").'* ';
-if (!empty($project->date_start)) {
- print '('.$langs->trans('Min'). ' '.dol_print_date($project->date_start).')';
-}
-print ' '."\n";
-print '';
-print $form->selectDate((empty($datestart)?$project->date_start:$datestart), 'datestart');
-print ' '."\n";
-// End Date
-print '
'.$langs->trans("DateEnd").'* ';
-if (!empty($project->date_end)) {
- print '('.$langs->trans('Max'). ' '.dol_print_date($project->date_end).')';
-}
-print ' '."\n";
-print '';
-print $form->selectDate(empty($dateend)?$project->date_end:$dateend, 'dateend');
-print ' '."\n";
print "\n";
diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php
index 3119c7831a9..ff159e30943 100644
--- a/htdocs/public/project/suggestconference.php
+++ b/htdocs/public/project/suggestconference.php
@@ -16,9 +16,9 @@
*/
/**
- * \file htdocs/public/members/new.php
+ * \file htdocs/public/project/suggestconference.php
* \ingroup member
- * \brief Example of form to add a new member
+ * \brief Example of form to suggest a conference
*
* Note that you can add following constant to change behaviour of page
* MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form
@@ -95,7 +95,7 @@ if ($resultproject < 0) {
// Security check
$securekeyreceived = GETPOST("securekey");
-$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
+$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
if ($securekeytocompare != $securekeyreceived) {
print $langs->trans('MissingOrBadSecureKey');
@@ -113,7 +113,7 @@ $extrafields = new ExtraFields($db);
$user->loadDefaultValues();
$cactioncomm = new CActionComm($db);
-$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\'');
+$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='conference@eventorganization'");
// Security check
if (empty($conf->eventorganization->enabled)) {
@@ -213,10 +213,22 @@ if (empty($reshook) && $action == 'add') {
$db->begin();
+ if (!GETPOST("lastname")) {
+ $error++;
+ $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n";
+ }
+ if (!GETPOST("firstname")) {
+ $error++;
+ $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n";
+ }
if (!GETPOST("email")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n";
}
+ if (!GETPOST("societe")) {
+ $error++;
+ $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n";
+ }
if (!GETPOST("label")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."
\n";
@@ -225,30 +237,6 @@ if (empty($reshook) && $action == 'add') {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."
\n";
}
- if (!GETPOST("datestart")) {
- $error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."
\n";
- }
- if (!GETPOST("dateend")) {
- $error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."
\n";
- }
- if (!GETPOST("email")) {
- $error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n";
- }
- if (!GETPOST("lastname")) {
- $error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."
\n";
- }
- if (!GETPOST("firstname")) {
- $error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."
\n";
- }
- if (!GETPOST("societe")) {
- $error++;
- $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n";
- }
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
$error++;
$langs->load("errors");
@@ -460,10 +448,10 @@ if (empty($reshook) && $action == 'add') {
$form = new Form($db);
$formcompany = new FormCompany($db);
-llxHeaderVierge($langs->trans("NewSuggestion"));
+llxHeaderVierge($langs->trans("NewSuggestionOfConference"));
-print load_fiche_titre($langs->trans("NewSuggestion"), '', '', 0, 0, 'center');
+print load_fiche_titre($langs->trans("NewSuggestionOfConference"), '', '', 0, 0, 'center');
print '
';
@@ -472,7 +460,7 @@ print '
';
// Welcome message
$text = '
'.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").' ';
-$text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$id.'. '."\n";
+$text .= ''.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$project->label.'. '."\n";
$text .= ''.$project->note_public.' '."\n";
print $text;
print '';
@@ -568,13 +556,6 @@ print '
*'."\n";
print '
'."\n";
-// Start Date
-print '
'.$langs->trans("DateStart").' '."\n";
-print ''."\n";
-// End Date
-print '
'.$langs->trans("DateEnd").' '."\n";
-print ''."\n";
-
print "\n";
diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php
index 017dda834c6..f119f08239d 100644
--- a/htdocs/public/project/viewandvote.php
+++ b/htdocs/public/project/viewandvote.php
@@ -67,7 +67,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors",
$action = GETPOST('action', 'aZ09');
$id = GETPOST('id');
$securekeyreceived = GETPOST("securekey");
-$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
+$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
if ($securekeytocompare != $securekeyreceived) {
print $langs->trans('MissingOrBadSecureKey');
diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php
index 19fa8b8d12d..2199d92f50d 100644
--- a/htdocs/website/class/websitepage.class.php
+++ b/htdocs/website/class/websitepage.class.php
@@ -416,9 +416,9 @@ class WebsitePage extends CommonObject
$sqlwhere = array();
if (count($filter) > 0) {
foreach ($filter as $key => $value) {
- if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') {
+ if ($key == 't.rowid' || $key == 'rowid' || $key == 't.fk_website' || $key == 'fk_website' || $key == 'status' || $key == 't.status') {
$sqlwhere[] = $key." = ".((int) $value);
- } elseif ($key == 'type_container') {
+ } elseif ($key == 'type_container' || $key == 't.type_container') {
$sqlwhere[] = $key." = '".$this->db->escape($value)."'";
} elseif ($key == 'lang' || $key == 't.lang') {
$listoflang = array();
diff --git a/htdocs/website/samples/wrapper.php b/htdocs/website/samples/wrapper.php
index 34f6db8d044..26adb3ef220 100644
--- a/htdocs/website/samples/wrapper.php
+++ b/htdocs/website/samples/wrapper.php
@@ -104,7 +104,7 @@ if ($rss) {
$website->fetch('', $websitekey);
- $filters = array('type_container'=>'blogpost');
+ $filters = array('type_container'=>'blogpost', 'status'=>1);
if ($l) {
$filters['lang'] = $l;
}