Merge branch 'develop' of github.com:Dolibarr/dolibarr into NEW_dev_filter_from_dt_to_dt_actionlist

This commit is contained in:
Florian HENRY 2021-10-07 20:19:38 +02:00
commit ac41d76b22
36 changed files with 214 additions and 175 deletions

View File

@ -430,7 +430,7 @@ if ($action != 'export_csv') {
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$accounting_account.'</td>'; print '<td>'.$accounting_account.'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price($opening_balance).'</td>'; print '<td class="right nowraponall amount">'.price(price2num($opening_balance, 'MT')).'</td>';
} }
$urlzoom = ''; $urlzoom = '';
@ -444,9 +444,9 @@ if ($action != 'export_csv') {
} }
} }
// Debit // Debit
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>'; print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->debit, 'MT')).'</a></td>';
// Credit // Credit
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>'; print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price(price2num($line->credit, 'MT')).'</a></td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>'; print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
@ -467,10 +467,10 @@ if ($action != 'export_csv') {
if (!empty($show_subgroup)) { if (!empty($show_subgroup)) {
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>'; print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>'; print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance, 'MT')).'</td>';
} }
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>'; print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>'; print '<td class="right nowraponall amount">'.price(price2num($sous_total_credit, 'MT')).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>'; print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
} else { } else {
@ -482,10 +482,10 @@ if ($action != 'export_csv') {
print '<tr class="liste_total"><td class="right">'.$langs->trans("AccountBalance").':</td>'; print '<tr class="liste_total"><td class="right">'.$langs->trans("AccountBalance").':</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="nowrap right">'.price($total_opening_balance).'</td>'; print '<td class="nowrap right">'.price(price2num($total_opening_balance, 'MT')).'</td>';
} }
print '<td class="right nowraponall amount">'.price($total_debit).'</td>'; print '<td class="right nowraponall amount">'.price(price2num($total_debit, 'MT')).'</td>';
print '<td class="right nowraponall amount">'.price($total_credit).'</td>'; print '<td class="right nowraponall amount">'.price(price2num($total_credit, 'MT')).'</td>';
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) { if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>'; print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
} else { } else {

View File

@ -81,7 +81,12 @@ $help_url = '';
llxHeader('', $langs->trans("AccountancyArea"), $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 '<span class="opacitymedium">'.$langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")."</span>\n";
print "<br>";
} elseif ($conf->accounting->enabled) {
$step = 0; $step = 0;
$resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) $resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb)
@ -258,7 +263,8 @@ if ($conf->accounting->enabled) {
} else { } else {
print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy');
print '<span class="opacitymedium">'.$langs->trans("Module10Desc")."</span><br>\n"; print '<span class="opacitymedium">'.$langs->trans("Module10Desc")."</span>\n";
print "<br>";
} }
// End of page // End of page

View File

@ -156,7 +156,7 @@ if ($action == 'updateMask') {
$amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int'); $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); $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++; $error++;
} }

View File

@ -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" }. * 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 $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 $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). * @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'); 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'); $upload_dir = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal');
} elseif ($modulepart == 'commande' || $modulepart == 'order') { } elseif ($modulepart == 'commande' || $modulepart == 'order') {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; 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'); $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') { } elseif ($modulepart == 'shipment' || $modulepart == 'expedition') {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; 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'; 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); 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" }. * 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 $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 $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 $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) * @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)

View File

@ -54,7 +54,9 @@ function bomAdminPrepareHead()
//$this->tabs = array( //$this->tabs = array(
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__' // 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
//); // to remove a tab //); // 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; return $head;
} }

View File

@ -363,7 +363,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
} }
print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).'</span></td>'; print '<td class="nowrap right"><span class="amount">'.price($obj->total_ttc).'</span></td>';
print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->tms), 'day').'</td>';
print '<td>'.$facstatic->getLibStatut(3).'</td>'; $alreadypaid = $facstatic->getSommePaiement();
print '<td>'.$facstatic->getLibStatut(3, $alreadypaid).'</td>';
print '</tr>'; print '</tr>';
$total_ht += $obj->total_ht; $total_ht += $obj->total_ht;
$total_ttc += $obj->total_ttc; $total_ttc += $obj->total_ttc;

View File

@ -416,10 +416,13 @@ if ($resql) {
print '<td class="right">'.$invoice->getLibStatut(5, $alreadypayed).'</td>'; print '<td class="right">'.$invoice->getLibStatut(5, $alreadypayed).'</td>';
print "</tr>\n"; print "</tr>\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; $disable_delete = 1;
$title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid")); $title_button = dol_escape_htmltag($langs->transnoentitiesnoconv("CantRemovePaymentWithOneInvoicePaid"));
} }
$total = $total + $objp->amount; $total = $total + $objp->amount;
$i++; $i++;
} }

View File

@ -129,7 +129,6 @@ if ($action == 'add' && !empty($permissiontoadd)) {
if (!$error) { if (!$error) {
$result = $object->create($user); $result = $object->create($user);
var_dump($object);exit;
if ($result > 0) { if ($result > 0) {
// Creation OK // Creation OK
if ($conf->categorie->enabled && method_exists($object, 'setCategories')) { if ($conf->categorie->enabled && method_exists($object, 'setCategories')) {
@ -298,6 +297,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
} }
$result = $object->delete($user); $result = $object->delete($user);
if ($result > 0) { if ($result > 0) {
// Delete OK // Delete OK
setEventMessages("RecordDeleted", null, 'mesgs'); setEventMessages("RecordDeleted", null, 'mesgs');

View File

@ -5324,7 +5324,7 @@ abstract class CommonObject
$ecmfile->gen_or_uploaded = 'generated'; $ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content $ecmfile->description = ''; // indexed content
$ecmfile->keywords = ''; // keyword 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; $ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user); $result = $ecmfile->create($user);

View File

@ -1578,7 +1578,7 @@ class FormFile
* *
* @param string $upload_dir Directory that was scanned. This directory will contains files into subdirs REF/files * @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 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 string $param Parameters on sort links
* @param int $forcedownload Force to open dialog box "Save As" when clicking on file * @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) * @param string $relativepath Relative path of docs (autodefined if not provided)
@ -1742,7 +1742,8 @@ class FormFile
$id = 0; $id = 0;
$ref = ''; $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(); $reg = array();
if ($modulepart == 'company' || $modulepart == 'tax') { if ($modulepart == 'company' || $modulepart == 'tax') {
preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg); preg_match('/(\d+)\/[^\/]+$/', $relativefile, $reg);
@ -1848,10 +1849,9 @@ class FormFile
// File // File
// Check if document source has external module part, if it the case use it for module part on document.php // 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 '<td>'; print '<td>';
//print "XX".$file['name']; //$file['name'] must be utf8 //print "XX".$file['name']; //$file['name'] must be utf8
print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.(empty($modulesuffix) ? $modulepart : $modulesuffix[1]); print '<a href="'.DOL_URL_ROOT.'/document.php?modulepart='.urlencode($modulepart);
if ($forcedownload) { if ($forcedownload) {
print '&attachment=1'; print '&attachment=1';
} }
@ -1862,7 +1862,7 @@ class FormFile
//print $this->getDocumentsLink($modulepart, $modulesubdir, $filedir, '^'.preg_quote($file['name'],'/').'$'); //print $this->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 "</td>\n"; print "</td>\n";

View File

@ -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($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($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 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($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"; $sql .= ", sum(".$db->ifsql("f.date_lim_reglement > '".date_format($datenowadd30, 'Y-m-d')."'", 1, 0).") as nbnotlate30";
if ($mode == 'customers') { if ($mode == 'customers') {
@ -515,13 +515,20 @@ function getNumberInvoicesPieChart($mode)
,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15) ,array($langs->trans('InvoiceNotLate'), $obj->nbnotlatenow - $obj->nbnotlate15)
,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30) ,array($langs->trans('InvoiceNotLate15Days'), $obj->nbnotlate15 - $obj->nbnotlate30)
,array($langs->trans('InvoiceNotLate30Days'), $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++; $i++;
} }
foreach ($dataseries as $key=>$value) { foreach ($dataseries[0] as $key=>$value) {
$total += $value[1]; $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); $colorseries = array($badgeStatus8, $badgeStatus1, $badgeStatus3, $badgeStatus4, $badgeStatus11, '-'.$badgeStatus11);

View File

@ -651,6 +651,11 @@ class pdf_espadon extends ModelePdfExpedition
$nexY = max($pdf->GetY(), $nexY); $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')) { if ($this->getColumnStatus('qty_shipped')) {
$this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped); $this->printStdColumnContent($pdf, $curY, 'qty_shipped', $object->lines[$i]->qty_shipped);
$nexY = max($pdf->GetY(), $nexY); $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; $rank = $rank + 10;
$this->cols['qty_shipped'] = array( $this->cols['qty_shipped'] = array(
'rank' => $rank, 'rank' => $rank,

View File

@ -271,7 +271,6 @@ class ConferenceOrBooth extends ActionComm
*/ */
public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND') public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
{ {
//TODO set percent according status //TODO set percent according status
global $conf; global $conf;

View File

@ -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"), '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_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'), '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,), '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'=>"LinkToThirparty", 'picto'=>'company', 'css'=>'tdoverflowmax150 maxwidth500'), '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'=>0, 'visible'=>1, 'showoncombobox'=>'1',), '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'), '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",), '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,), 'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>'1', 'position'=>61, 'notnull'=>0, 'visible'=>3,),

View File

@ -57,9 +57,10 @@ $projectstatic = new Project($db);
$diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id; $diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array $hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array
if ($conf_or_booth_id > 0) { if ($conf_or_booth_id > 0) {
$confOrBooth = new ConferenceOrBooth($db); $confOrBooth = new ConferenceOrBooth($db);
$result = $confOrBooth->fetch($conf_or_booth_id); $result = $confOrBooth->fetch($id > 0 ? $id : $conf_or_booth_id);
if ($result < 0) { if ($result < 0) {
setEventMessages(null, $confOrBooth->errors, 'errors'); setEventMessages(null, $confOrBooth->errors, 'errors');
} else { } else {
@ -102,6 +103,10 @@ if (empty($action) && empty($id) && empty($ref)) {
// Load object // Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once. 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; $permissiontoread = $user->rights->eventorganization->read;
$permissiontoadd = $user->rights->eventorganization->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php $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; $error = 0;
if (!empty($withproject)) { 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 { } else {
$backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php'; $backurlforlist = DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_list.php';
} }
@ -151,7 +156,6 @@ if (empty($reshook)) {
$action = ''; $action = '';
} }
$triggermodname = 'EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_MODIFY'; // Name of trigger action code to execute when we modify record $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 // 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)) { 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('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 // 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) // 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 '</div>'."\n"; print '</div>'."\n";
} }

View File

@ -699,7 +699,8 @@ print '<input type="hidden" name="withproject" value="'.$withproject.'">';
print '<input type="hidden" name="fk_project" value="'.$fk_project.'">'; print '<input type="hidden" name="fk_project" value="'.$fk_project.'">';
print '<input type="hidden" name="page_y" value="">'; print '<input type="hidden" name="page_y" value="">';
$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); print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);

View File

@ -1160,10 +1160,16 @@ if ($action == 'create') {
print "</td>\n"; print "</td>\n";
} }
// unit of order
$unit_order = '';
if ($conf->global->PRODUCT_USE_UNITS) {
$unit_order = measuringUnitString($line->fk_unit);
}
// Qty // Qty
print '<td class="center">'.$line->qty; print '<td class="center">'.$line->qty;
print '<input name="qtyasked'.$indiceAsked.'" id="qtyasked'.$indiceAsked.'" type="hidden" value="'.$line->qty.'">'; print '<input name="qtyasked'.$indiceAsked.'" id="qtyasked'.$indiceAsked.'" type="hidden" value="'.$line->qty.'">';
print '</td>'; print ''.$unit_order.'</td>';
$qtyProdCom = $line->qty; $qtyProdCom = $line->qty;
// Qty already shipped // Qty already shipped
@ -1171,7 +1177,7 @@ if ($action == 'create') {
$quantityDelivered = $object->expeditions[$line->id]; $quantityDelivered = $object->expeditions[$line->id];
print $quantityDelivered; print $quantityDelivered;
print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">'; print '<input name="qtydelivered'.$indiceAsked.'" id="qtydelivered'.$indiceAsked.'" type="hidden" value="'.$quantityDelivered.'">';
print '</td>'; print ''.$unit_order.'</td>';
// Qty to ship // Qty to ship
$quantityAsked = $line->qty; $quantityAsked = $line->qty;
@ -2056,7 +2062,7 @@ if ($action == 'create') {
// Get list of products already sent for same source object into $alreadysent // Get list of products already sent for same source object into $alreadysent
$alreadysent = array(); $alreadysent = array();
if ($origin && $origin_id > 0) { 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 .= ", 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"; $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"; //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 "</td>\n"; print "</td>\n";
} }
$unit_order = '';
if ($conf->global->PRODUCT_USE_UNITS) {
$unit_order = measuringUnitString($lines[$i]->fk_unit);
}
// Qty ordered // Qty ordered
print '<td class="center linecolqty">'.$lines[$i]->qty_asked.'</td>'; print '<td class="center linecolqty">'.$lines[$i]->qty_asked.' '.$unit_order.'</td>';
// Qty in other shipments (with shipment and warehouse used) // Qty in other shipments (with shipment and warehouse used)
if ($origin && $origin_id > 0) { if ($origin && $origin_id > 0) {
@ -2241,7 +2252,7 @@ if ($action == 'create') {
print '<!-- case edit 2 -->'; print '<!-- case edit 2 -->';
print '<tr>'; print '<tr>';
// Qty to ship or shipped // Qty to ship or shipped
print '<td><input class="qtyl" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'"></td>'; print '<td><input class="qtyl" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'">'.$unit_order.'</td>';
// Warehouse source // Warehouse source
print '<td>'.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).'</td>'; print '<td>'.$formproduct->selectWarehouses($lines[$i]->entrepot_id, 'entl'.$line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).'</td>';
// Batch number managment // Batch number managment
@ -2252,7 +2263,7 @@ if ($action == 'create') {
foreach ($lines[$i]->details_entrepot as $detail_entrepot) { foreach ($lines[$i]->details_entrepot as $detail_entrepot) {
print '<tr>'; print '<tr>';
// Qty to ship or shipped // Qty to ship or shipped
print '<td><input class="qtyl" name="qtyl'.$detail_entrepot->line_id.'" id="qtyl'.$detail_entrepot->line_id.'" type="text" size="4" value="'.$detail_entrepot->qty_shipped.'"></td>'; print '<td><input class="qtyl" name="qtyl'.$detail_entrepot->line_id.'" id="qtyl'.$detail_entrepot->line_id.'" type="text" size="4" value="'.$detail_entrepot->qty_shipped.'">'.$unit_order.'</td>';
// Warehouse source // Warehouse source
print '<td>'.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).'</td>'; print '<td>'.$formproduct->selectWarehouses($detail_entrepot->entrepot_id, 'entl'.$detail_entrepot->line_id, '', 1, 0, $lines[$i]->fk_product, '', 1).'</td>';
// Batch number managment // Batch number managment
@ -2267,7 +2278,7 @@ if ($action == 'create') {
print '<!-- case edit 5 -->'; print '<!-- case edit 5 -->';
print '<tr>'; print '<tr>';
// Qty to ship or shipped // Qty to ship or shipped
print '<td><input class="qtyl" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'"></td>'; print '<td><input class="qtyl" name="qtyl'.$line_id.'" id="qtyl'.$line_id.'" type="text" size="4" value="'.$lines[$i]->qty_shipped.'">'.$unit_order.'</td>';
// Warehouse source // Warehouse source
print '<td></td>'; print '<td></td>';
// Batch number managment // Batch number managment
@ -2289,7 +2300,7 @@ if ($action == 'create') {
print '</table></td>'; print '</table></td>';
} else { } else {
// Qty to ship or shipped // Qty to ship or shipped
print '<td class="linecolqtytoship center">'.$lines[$i]->qty_shipped.'</td>'; print '<td class="linecolqtytoship center">'.$lines[$i]->qty_shipped.' '.$unit_order.'</td>';
// Warehouse source // Warehouse source
if (!empty($conf->stock->enabled)) { if (!empty($conf->stock->enabled)) {

View File

@ -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 = "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.price, cd.tva_tx, cd.subprice,";
$sql .= " cd.qty,"; $sql .= " cd.qty, cd.fk_unit,";
$sql .= ' cd.date_start,'; $sql .= ' cd.date_start,';
$sql .= ' cd.date_end,'; $sql .= ' cd.date_end,';
$sql .= ' cd.special_code,'; $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.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.surface, p.surface_units, p.volume, p.volume_units';
$sql .= ', p.tobatch, p.tosell, p.tobuy, p.barcode'; $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 .= " 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."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 .= " WHERE cd.fk_commande = ".((int) $object->id);
$sql .= " ORDER BY cd.rang, cd.rowid"; $sql .= " ORDER BY cd.rang, cd.rowid";
@ -766,7 +768,7 @@ if ($id > 0 || !empty($ref)) {
} }
// Qty ordered // Qty ordered
print '<td class="center">'.$objp->qty.'</td>'; print '<td class="center">'.$objp->qty.($objp->unit_order ? ' '.$objp->unit_order : '').'</td>';
// Qty already shipped // Qty already shipped
$qtyProdCom = $objp->qty; $qtyProdCom = $objp->qty;
@ -774,7 +776,7 @@ if ($id > 0 || !empty($ref)) {
// Nb of sending products for this line of order // Nb of sending products for this line of order
$qtyAlreadyShipped = (!empty($object->expeditions[$objp->rowid]) ? $object->expeditions[$objp->rowid] : 0); $qtyAlreadyShipped = (!empty($object->expeditions[$objp->rowid]) ? $object->expeditions[$objp->rowid] : 0);
print $qtyAlreadyShipped; print $qtyAlreadyShipped;
print '</td>'; print ($objp->unit_order ? ' '.$objp->unit_order : '').'</td>';
// Qty remains to ship // Qty remains to ship
print '<td class="center">'; print '<td class="center">';
@ -785,7 +787,7 @@ if ($id > 0 || !empty($ref)) {
} else { } else {
print '0 ('.$langs->trans("Service").')'; print '0 ('.$langs->trans("Service").')';
} }
print '</td>'; print ($objp->unit_order ? ' '.$objp->unit_order : '').'</td>';
if ($objp->fk_product > 0) { if ($objp->fk_product > 0) {
$product = new Product($db); $product = new Product($db);

View File

@ -2377,7 +2377,7 @@ if ($action == 'create') {
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
$objectsrc->printOriginLinesList(); $objectsrc->printOriginLinesList('', $selectedLines);
print '</table>'; print '</table>';
} }

View File

@ -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 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 (fk_facture);
ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn); ALTER TABLE llx_prelevement_facture_demande ADD INDEX idx_prelevement_facture_demande_fk_facture_fourn (fk_facture_fourn);

View File

@ -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 ( 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); 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')__ = 'auguria';
UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'bureau2crea'; UPDATE llx_const set value = __ENCRYPT('eldy')__ WHERE __DECRYPT('value')__ = 'bureau2crea';

View File

@ -286,9 +286,12 @@ ReportPurchaseTurnover=Purchase turnover invoiced
ReportPurchaseTurnoverCollected=Purchase turnover collected ReportPurchaseTurnoverCollected=Purchase turnover collected
IncludeVarpaysInResults = Include various payments in reports IncludeVarpaysInResults = Include various payments in reports
IncludeLoansInResults = Include loans in reports IncludeLoansInResults = Include loans in reports
InvoiceLate30Days = Invoices late > 30 days InvoiceLate30Days = Invoices late (> 30 days)
InvoiceLate15Days = Invoices late > 15 days InvoiceLate15Days = Invoices late (15 to 30 days)
InvoiceLateMinus15Days = Invoices late InvoiceLateMinus15Days = Invoices late (< 15 days)
InvoiceNotLate = To be collected < 15 days InvoiceNotLate = To be collected (< 15 days)
InvoiceNotLate15Days = To be collected in 15 days InvoiceNotLate15Days = To be collected (15 to 30 days)
InvoiceNotLate30Days = To be collected in 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)

View File

@ -75,10 +75,10 @@ EventOrganizationMassEmailSpeakers = Communication to speakers
# #
# Event # Event
# #
AllowUnknownPeopleSuggestConf=Allow unknown people to suggest conferences AllowUnknownPeopleSuggestConf=Allow people to suggest conferences
AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest conferences AllowUnknownPeopleSuggestConfHelp=Allow unknown people to suggest a conference they want to do
AllowUnknownPeopleSuggestBooth=Allow unknown people to suggest booth AllowUnknownPeopleSuggestBooth=Allow people to apply for a booth
AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to suggest booth AllowUnknownPeopleSuggestBoothHelp=Allow unknown people to apply for a booth
PriceOfRegistration=Price of registration PriceOfRegistration=Price of registration
PriceOfRegistrationHelp=Price to pay to register or participate in the event PriceOfRegistrationHelp=Price to pay to register or participate in the event
PriceOfBooth=Subscription price to stand a booth PriceOfBooth=Subscription price to stand a booth
@ -106,9 +106,9 @@ EvntOrgCancelled = Cancelled
# #
SuggestForm = Suggestion page SuggestForm = Suggestion page
SuggestOrVoteForConfOrBooth = Page for suggestion or vote SuggestOrVoteForConfOrBooth = Page for suggestion or vote
EvntOrgRegistrationHelpMessage = Here, you can vote for a conference or booth or suggest a new one for the event 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 for the project EvntOrgRegistrationConfHelpMessage = Here, you can suggest a new conference to animate during the event.
EvntOrgRegistrationBoothHelpMessage = Here, you can suggest a new booth for the project EvntOrgRegistrationBoothHelpMessage = Here, you can apply to have a booth during the event.
ListOfSuggestedConferences = List of suggested conferences ListOfSuggestedConferences = List of suggested conferences
ListOfSuggestedBooths = List of suggested booths ListOfSuggestedBooths = List of suggested booths
ListOfConferencesOrBooths=List of conferences or booths of event project 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 OrganizationEventPaymentOfRegistrationWasReceived=Your payment for your event registration has been recorded
OrganizationEventBulkMailToAttendees=This is a remind about your participation in the event as an attendee 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 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 # Vote page
@ -153,7 +157,7 @@ ConfAttendeeSubscriptionConfirmation = Confirmation of your subscription to an e
Attendee = Attendee Attendee = Attendee
PaymentConferenceAttendee = Conference attendee payment PaymentConferenceAttendee = Conference attendee payment
PaymentBoothLocation = Booth location payment PaymentBoothLocation = Booth location payment
DeleteConferenceOrBoothAttendee=Remove attendee
RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email <b>%s</b> RegistrationAndPaymentWereAlreadyRecorder=A registration and a payment were already recorded for the email <b>%s</b>
EmailAttendee=Attendee email EmailAttendee=Attendee email
EmailCompanyForInvoice=Company email (for invoice, if different of attendee email) EmailCompanyForInvoice=Company email (for invoice, if different of attendee email)

View File

@ -1157,3 +1157,4 @@ RecordsApproved=%s Record(s) approved
Properties=Properties Properties=Properties
hasBeenValidated=%s has been validated hasBeenValidated=%s has been validated
ClientTZ=Client Time Zone (user) ClientTZ=Client Time Zone (user)
NotClosedYet=Not yet closed

View File

@ -60,7 +60,9 @@ function mymoduleAdminPrepareHead()
//$this->tabs = array( //$this->tabs = array(
// 'entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__' // 'entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'
//); // to remove a tab //); // 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; return $head;
} }

View File

@ -266,7 +266,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields // Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) { if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { 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 // Add fields from hooks

View File

@ -207,7 +207,7 @@ $sql .= $object->getFieldList('t');
// Add fields from extrafields // Add fields from extrafields
if (!empty($extrafields->attributes[$object->table_element]['label'])) { if (!empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { 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 // Add fields from hooks
@ -276,7 +276,7 @@ foreach($object->fields as $key => $val) {
// Add fields from extrafields // Add fields from extrafields
if (! empty($extrafields->attributes[$object->table_element]['label'])) { if (! empty($extrafields->attributes[$object->table_element]['label'])) {
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { 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 // Add where from hooks

View File

@ -927,7 +927,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 0, 1); print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'inline-block valignmiddle', 0, 1);
print '<div id="divtocloseproject" class="inline-block valign" style="display: none;"> &nbsp; &nbsp; '; print '<div id="divtocloseproject" class="inline-block valign" style="display: none;"> &nbsp; &nbsp; ';
print '<input type="checkbox" id="inputcloseproject" name="closeproject" />'; print '<input type="checkbox" id="inputcloseproject" name="closeproject" />';
print $langs->trans("AlsoCloseAProject"); print '<label for="inputcloseproject">'.$langs->trans("AlsoCloseAProject").'</label>';
print '</div>'; print '</div>';
print '</td>'; print '</td>';
print '</tr>'; print '</tr>';
@ -948,11 +948,11 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Date start // Date start
print '<tr><td>'.$langs->trans("DateStart").'</td><td>'; print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
print $form->selectDate($object->date_start ? $object->date_start : -1, 'projectstart', 0, 0, 0, '', 1, 0); print $form->selectDate($object->date_start ? $object->date_start : -1, 'projectstart', 0, 0, 0, '', 1, 0);
print ' &nbsp; &nbsp; <input type="checkbox" class="valignmiddle" name="reportdate" value="yes" '; print ' &nbsp; &nbsp; <input type="checkbox" class="valignmiddle" id="reportdate" name="reportdate" value="yes" ';
if ($comefromclone) { if ($comefromclone) {
print ' checked '; print ' checked ';
} }
print '/> '.$langs->trans("ProjectReportDate"); print '/><label for="reportdate">'.$langs->trans("ProjectReportDate").'</label>';
print '</td></tr>'; print '</td></tr>';
// Date end // Date end

View File

@ -83,6 +83,9 @@ if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
$code = dol_getIdFromCode($db, $status, 'c_lead_status', 'rowid', 'code'); $code = dol_getIdFromCode($db, $status, 'c_lead_status', 'rowid', 'code');
if ($code) { if ($code) {
$labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code); $labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code);
if ($code == 'WON' || $code == 'LOST') {
$labelStatus = $langs->transnoentitiesnoconv("OppStatus".$code).' ('.$langs->transnoentitiesnoconv("NotClosedYet").")";
}
} }
if (empty($labelStatus)) { if (empty($labelStatus)) {
$labelStatus = $listofopplabel[$status]; $labelStatus = $listofopplabel[$status];

View File

@ -152,7 +152,7 @@ if ($resql) {
while ($i < $num) { while ($i < $num) {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$listofoppstatus[$objp->rowid] = $objp->percent; $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; $listofoppcode[$objp->rowid] = $objp->code;
switch ($objp->code) { switch ($objp->code) {
case 'PROSP': case 'PROSP':

View File

@ -13,21 +13,12 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* 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 * \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')) { if (!defined('NOLOGIN')) {
@ -74,8 +65,8 @@ $langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$id = GETPOST('id'); $id = GETPOST('id');
$securekeyreceived = GETPOST("securekey"); $securekeyreceived = GETPOST("securekey", 'alpha');
$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2); $securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
if ($securekeytocompare != $securekeyreceived) { if ($securekeytocompare != $securekeyreceived) {
print $langs->trans('MissingOrBadSecureKey'); print $langs->trans('MissingOrBadSecureKey');

View File

@ -16,9 +16,9 @@
*/ */
/** /**
* \file htdocs/public/members/new.php * \file htdocs/public/project/suggestbooth.php
* \ingroup member * \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 * Note that you can add following constant to change behaviour of page
* MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form
@ -94,7 +94,7 @@ if ($resultproject < 0) {
// Security check // Security check
$securekeyreceived = GETPOST("securekey"); $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) { if ($securekeytocompare != $securekeyreceived) {
print $langs->trans('MissingOrBadSecureKey'); print $langs->trans('MissingOrBadSecureKey');
@ -112,7 +112,7 @@ $extrafields = new ExtraFields($db);
$user->loadDefaultValues(); $user->loadDefaultValues();
$cactioncomm = new CActionComm($db); $cactioncomm = new CActionComm($db);
$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'booth@eventorganization\''); $arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='booth@eventorganization'");
// Security check // Security check
if (empty($conf->eventorganization->enabled)) { if (empty($conf->eventorganization->enabled)) {
@ -224,20 +224,6 @@ if (empty($reshook) && $action == 'add') {
$error++; $error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."<br>\n"; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."<br>\n";
} }
if (empty($datestart)) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."<br>\n";
} elseif ($datestart < $project->date_start) {
$error++;
$errmsg .= $langs->trans("DateMustBeAfterThan", $langs->transnoentitiesnoconv("DateStart"), dol_print_date($project->date_start))."<br>\n";
}
if (empty($dateend)) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."<br>\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))."<br>\n";
}
if (!GETPOST("email")) { if (!GETPOST("email")) {
$error++; $error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n"; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
@ -529,10 +515,10 @@ if (empty($reshook) && $action == 'add') {
$form = new Form($db); $form = new Form($db);
$formcompany = new FormCompany($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 '<div align="center">'; print '<div align="center">';
@ -541,7 +527,7 @@ print '<div class="center subscriptionformhelptext justify">';
// Welcome message // Welcome message
$text = '<tr><td class="textpublicpayment"><strong>'.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").'</strong></td></tr></br>'; $text = '<tr><td class="textpublicpayment"><strong>'.$langs->trans("EvntOrgRegistrationBoothWelcomeMessage").'</strong></td></tr></br>';
$text .= '<tr><td class="textpublicpayment">'.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$id.'.<br><br></td></tr>'."\n"; $text .= '<tr><td class="textpublicpayment">'.$langs->trans("EvntOrgRegistrationBoothHelpMessage").' '.$project->label.'.<br><br></td></tr>'."\n";
$text .= '<tr><td class="textpublicpayment">'.$project->note_public.'</td></tr>'."\n"; $text .= '<tr><td class="textpublicpayment">'.$project->note_public.'</td></tr>'."\n";
print $text; print $text;
print '</div>'; print '</div>';
@ -636,24 +622,6 @@ print '</td><td><input type="text" name="label" class="minwidth150" value="'.dol
// Note // Note
print '<tr><td>'.$langs->trans("Description").'<span style="color: red">*</span></td>'."\n"; print '<tr><td>'.$langs->trans("Description").'<span style="color: red">*</span></td>'."\n";
print '<td><textarea name="note" id="note" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n"; print '<td><textarea name="note" id="note" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
// Start Date
print '<tr><td>'.$langs->trans("DateStart").'<span style="color: red">*</span>';
if (!empty($project->date_start)) {
print '('.$langs->trans('Min'). ' '.dol_print_date($project->date_start).')';
}
print '</td>'."\n";
print '<td>';
print $form->selectDate((empty($datestart)?$project->date_start:$datestart), 'datestart');
print '</td></tr>'."\n";
// End Date
print '<tr><td>'.$langs->trans("DateEnd").'<span style="color: red">*</span>';
if (!empty($project->date_end)) {
print '('.$langs->trans('Max'). ' '.dol_print_date($project->date_end).')';
}
print '</td>'."\n";
print '<td>';
print $form->selectDate(empty($dateend)?$project->date_end:$dateend, 'dateend');
print '</td></tr>'."\n";
print "</table>\n"; print "</table>\n";

View File

@ -16,9 +16,9 @@
*/ */
/** /**
* \file htdocs/public/members/new.php * \file htdocs/public/project/suggestconference.php
* \ingroup member * \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 * Note that you can add following constant to change behaviour of page
* MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form * MEMBER_NEWFORM_AMOUNT Default amount for auto-subscribe form
@ -95,7 +95,7 @@ if ($resultproject < 0) {
// Security check // Security check
$securekeyreceived = GETPOST("securekey"); $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) { if ($securekeytocompare != $securekeyreceived) {
print $langs->trans('MissingOrBadSecureKey'); print $langs->trans('MissingOrBadSecureKey');
@ -113,7 +113,7 @@ $extrafields = new ExtraFields($db);
$user->loadDefaultValues(); $user->loadDefaultValues();
$cactioncomm = new CActionComm($db); $cactioncomm = new CActionComm($db);
$arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, 'module=\'conference@eventorganization\''); $arrayofeventtype = $cactioncomm->liste_array('', 'id', '', 0, "module='conference@eventorganization'");
// Security check // Security check
if (empty($conf->eventorganization->enabled)) { if (empty($conf->eventorganization->enabled)) {
@ -213,30 +213,6 @@ if (empty($reshook) && $action == 'add') {
$db->begin(); $db->begin();
if (!GETPOST("email")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
}
if (!GETPOST("label")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."<br>\n";
}
if (!GETPOST("note")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."<br>\n";
}
if (!GETPOST("datestart")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateStart"))."<br>\n";
}
if (!GETPOST("dateend")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd"))."<br>\n";
}
if (!GETPOST("email")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
}
if (!GETPOST("lastname")) { if (!GETPOST("lastname")) {
$error++; $error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."<br>\n"; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Lastname"))."<br>\n";
@ -245,10 +221,22 @@ if (empty($reshook) && $action == 'add') {
$error++; $error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n"; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Firstname"))."<br>\n";
} }
if (!GETPOST("email")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."<br>\n";
}
if (!GETPOST("societe")) { if (!GETPOST("societe")) {
$error++; $error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."<br>\n"; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."<br>\n";
} }
if (!GETPOST("label")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"))."<br>\n";
}
if (!GETPOST("note")) {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."<br>\n";
}
if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { if (GETPOST("email") && !isValidEmail(GETPOST("email"))) {
$error++; $error++;
$langs->load("errors"); $langs->load("errors");
@ -460,10 +448,10 @@ if (empty($reshook) && $action == 'add') {
$form = new Form($db); $form = new Form($db);
$formcompany = new FormCompany($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 '<div align="center">'; print '<div align="center">';
@ -472,7 +460,7 @@ print '<div class="center subscriptionformhelptext justify">';
// Welcome message // Welcome message
$text = '<tr><td class="textpublicpayment"><strong>'.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").'</strong></td></tr></br>'; $text = '<tr><td class="textpublicpayment"><strong>'.$langs->trans("EvntOrgRegistrationConfWelcomeMessage").'</strong></td></tr></br>';
$text .= '<tr><td class="textpublicpayment">'.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$id.'.<br><br></td></tr>'."\n"; $text .= '<tr><td class="textpublicpayment">'.$langs->trans("EvntOrgRegistrationConfHelpMessage").' '.$project->label.'.<br><br></td></tr>'."\n";
$text .= '<tr><td class="textpublicpayment">'.$project->note_public.'</td></tr>'."\n"; $text .= '<tr><td class="textpublicpayment">'.$project->note_public.'</td></tr>'."\n";
print $text; print $text;
print '</div>'; print '</div>';
@ -568,13 +556,6 @@ print '</td><td><input type="text" name="label" class="minwidth150" value="'.dol
// Note // Note
print '<tr><td>'.$langs->trans("Description").'<span style="color: red">*</span></td>'."\n"; print '<tr><td>'.$langs->trans("Description").'<span style="color: red">*</span></td>'."\n";
print '<td><textarea name="note" id="note" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n"; print '<td><textarea name="note" id="note" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag(GETPOST('note', 'restricthtml'), 0, 1).'</textarea></td></tr>'."\n";
// Start Date
print '<tr><td>'.$langs->trans("DateStart").'</td>'."\n";
print '<td><input type="date" name="datestart" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('datestart')).'"></td></tr>'."\n";
// End Date
print '<tr><td>'.$langs->trans("DateEnd").'</td>'."\n";
print '<td><input type="date" name="dateend" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('dateend')).'"></td></tr>'."\n";
print "</table>\n"; print "</table>\n";

View File

@ -67,7 +67,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors",
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$id = GETPOST('id'); $id = GETPOST('id');
$securekeyreceived = GETPOST("securekey"); $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) { if ($securekeytocompare != $securekeyreceived) {
print $langs->trans('MissingOrBadSecureKey'); print $langs->trans('MissingOrBadSecureKey');

View File

@ -416,9 +416,9 @@ class WebsitePage extends CommonObject
$sqlwhere = array(); $sqlwhere = array();
if (count($filter) > 0) { if (count($filter) > 0) {
foreach ($filter as $key => $value) { 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); $sqlwhere[] = $key." = ".((int) $value);
} elseif ($key == 'type_container') { } elseif ($key == 'type_container' || $key == 't.type_container') {
$sqlwhere[] = $key." = '".$this->db->escape($value)."'"; $sqlwhere[] = $key." = '".$this->db->escape($value)."'";
} elseif ($key == 'lang' || $key == 't.lang') { } elseif ($key == 'lang' || $key == 't.lang') {
$listoflang = array(); $listoflang = array();

View File

@ -104,7 +104,7 @@ if ($rss) {
$website->fetch('', $websitekey); $website->fetch('', $websitekey);
$filters = array('type_container'=>'blogpost'); $filters = array('type_container'=>'blogpost', 'status'=>1);
if ($l) { if ($l) {
$filters['lang'] = $l; $filters['lang'] = $l;
} }