Merge remote-tracking branch 'upstream/develop' into migration_cat_tickets

This commit is contained in:
Frédéric FRANCE 2021-08-02 09:01:27 +02:00
commit 099164c043
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
111 changed files with 1649 additions and 588 deletions

View File

@ -2,33 +2,12 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
***** ChangeLog for 13.0.4 compared to 13.0.2 *****
FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules).
FIX: 13.0 - fatal - missing inclusion of ajax.lib.php for calling `ajax_autocompleter()`
FIX: #17919 pictures in docs.
FIX: #18006
FIX: Accountancy - if we define a date start, automatic binding try to continue to solve old binding
FIX: Accoutancy Limit date payment not registered on purchases operations
FIX: Can't edit replacement invoice
FIX: deposit can create credit note in payment conf
FIX: division by zero on create
FIX: holiday: balances not updated correctly with pgsql because of case sensitivity field
FIX: holiday: status filter parameter has been renamed but not in links it was used
FIX: List and Create Companies Left Menus
FIX: method exists
FIX: need to add payment sum to getlibstatus function in object linked block
FIX: permission to close a proposal when using advanced permissions
FIX: Problem of z-index with popup and top menu
FIX: same thing on supplier orders
FIX: Status of invoice when making a replacement invoice
FIX: update contact birthday alert
***** ChangeLog for 14.0.0 compared to 13.0.0 *****
For users:
----------
NEW: Module Recruitement to follow application to job positions is now stable.
NEW: Module Recruitment to follow application to job positions is now stable.
NEW: Feature to make Stock Inventories
NEW: Several security issues after a second private bug hunting campaign.
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
@ -71,7 +50,7 @@ NEW: Make public bookmarks editable by admin users only
NEW: If main logo not defined, can use the squarred logo on login page
NEW: The manifest file can use the squared image if available
NEW: Enhance the multicurrency rate editor
NEW: Normalyse Type company field with ajax combobox
NEW: Normalise Type company field with ajax combobox
NEW: preload product description on selection for customer propal/order/invoice
NEW: Search usergroups & resources
NEW: Setup Page for module creation with module builder enhancement #FoundationFunding
@ -88,14 +67,15 @@ NEW: #16378 more E-Mail Contact substitution Values for better salutation
NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page
Accountancy
NEW: Accountancy - Add FEC import
NEW: Accountancy - Add a confirmation form with options on export
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
NEW: Accountancy - Format FEC - Add new field DateLimitReglmt
NEW: Accountancy - In ledger & journals, show link on bank transaction
NEW: Accountancy - Possibility to filter on journals in balance
NEW: Accountancy - Add a page to list subledger accounts
NEW: Multiselect ledger account code filter on book keeping list
NEW: Add FEC import
NEW: Add a confirmation form with options on export (for notified export and validate operations)
NEW: Add select date from/to in already bind customer and supplier list
NEW: FEC / FEC2 export - Add new field DateLimitReglmt
NEW: In ledger & journals, show link on bank transaction
NEW: Possibility to filter on journals in balance
NEW: Add a page to list subledger accounts
NEW: Multiselect journal code filter on journal / balance / ledger
NEW: Add first step to close fiscal year
Agenda
NEW: add support for Friday as a non working day
@ -114,7 +94,7 @@ NEW: can filter files in ECM/GED on status Shared / Not shared
NEW: add a check to avoid an invoice date in the future
NEW: add the total of margin in invoice list
NEW: can set a percentage when creating an invoice from another object
NEW: Support down payment on supplier invoice (& somes ajustments)
NEW: Support down payment on supplier invoice (& some adjustments)
Margin
NEW: add the total of margin in invoice list
@ -183,7 +163,7 @@ NEW: Add a security center page with all information and advices related to the
NEW: Add a performance center page with all information and advices related to the performance of your instance
Modules
NEW: Module Recruitement is now stable
NEW: Module Recruitment is now stable
NEW: start new experimental module Event Organization Management
NEW: start new experimental module Partnership Management
NEW: start new experimental module Knowledge Management
@ -192,11 +172,14 @@ NEW: Check update availability for externals modules using a button on module pa
Module SimplePOS is deprecated - TakePOS is recommended for the future
new Options
NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
NEW: add constant ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY to manage binding with accountancy account declared on thirdparty card
NEW: add constant MAIN_PRODUCT_PERENTITY_SHARED to manage some informations (Accounting account) when product is shared on several entities
NEW: add constant MAIN_COMPANY_PERENTITY_SHARED to manage some informations (Accounting account) when company is shared on several entities
For developers:
@ -230,7 +213,7 @@ NEW: hook printFieldListTitle for cabyprodserv.php
NEW: hook to allow external modules to add their own shortlist of recent objects
NEW: SQL-altering hooks in the turnover by product report
NEW: add form confirm hook on company card
NEW: add hook addSectionECMAuto method to add custom diretory into ECM auto files
NEW: add hook addSectionECMAuto method to add custom directory into ECM auto files
WARNING:
@ -240,15 +223,38 @@ Following changes may create regressions for some external modules, but were nec
* The ICS value for direct debit or credit transfer is now stored on each bank account instead of into the global setup.
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
* Field "total" renamed into "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
* Field "tva" renamed into "total_tva" for llx_facture, table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
* Field "total" renamed into "total_ttc" for table llx_propal, llx_supplier_proposal for better field name consistency
* If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
* If your database is MySQL or MariaDB, you need at least version 5.1
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
* removed deprecated subtituion key __REFCLIENT__ (replaced with __REF_CLIENT__)
* removed deprecated substitution key __REFCLIENT__ (replaced with __REF_CLIENT__)
* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries.
***** ChangeLog for 13.0.4 compared to 13.0.3 *****
FIX: Allow disabling of a module (not a dangerous action) even if there is problem with token (due to bugged modules).
FIX: 13.0 - fatal - missing inclusion of ajax.lib.php for calling `ajax_autocompleter()`
FIX: #17919 pictures in docs.
FIX: #18006
FIX: Accountancy - if we define a date start, automatic binding try to continue to solve old binding
FIX: Accoutancy Limit date payment not registered on purchases operations
FIX: Can't edit replacement invoice
FIX: deposit can create credit note in payment conf
FIX: division by zero on create
FIX: holiday: balances not updated correctly with pgsql because of case sensitivity field
FIX: holiday: status filter parameter has been renamed but not in links it was used
FIX: List and Create Companies Left Menus
FIX: method exists
FIX: need to add payment sum to getlibstatus function in object linked block
FIX: permission to close a proposal when using advanced permissions
FIX: Problem of z-index with popup and top menu
FIX: same thing on supplier orders
FIX: Status of invoice when making a replacement invoice
FIX: update contact birthday alert
***** ChangeLog for 13.0.3 compared to 13.0.2 *****
FIX: 13.0 warning - missing quotes around 'label'

View File

@ -91,7 +91,6 @@ if ($action == 'update') {
if (!$error) {
foreach ($list as $constname) {
$constvalue = GETPOST($constname, 'alpha');
var_dump($constname);
if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) {
$error++;
}

View File

@ -637,6 +637,8 @@ if ($action == 'create') {
print_liste_field_titre("Credit", "", "", "", "", 'class="right"');
if (empty($object->date_validation)) {
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
} else {
print_liste_field_titre("");
}
print "</tr>\n";
@ -683,8 +685,8 @@ if ($action == 'create') {
print '<td class="right nowraponall amount">'.price($line->debit).'</td>';
print '<td class="right nowraponall amount">'.price($line->credit).'</td>';
if (empty($line->date_export) || empty($line->date_validation)) {
print '<td class="center">';
print '<td class="center">';
if (empty($line->date_export) && empty($line->date_validation)) {
print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
print img_edit('', 0, 'class="marginrightonly"');
print '</a> &nbsp;';
@ -713,7 +715,7 @@ if ($action == 'create') {
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings');
}
if (empty($object->date_export) || empty($object->date_validation)) {
if (empty($object->date_export) && empty($object->date_validation)) {
if ($action == "" || $action == 'add') {
print '<tr class="oddeven">';
print '<!-- td columns in add mode -->';

View File

@ -366,42 +366,42 @@ if (empty($reshook)) {
if (!empty($search_date_creation_start)) {
$filter['t.date_creation>='] = $search_date_creation_start;
$tmp = dol_getdate($search_date_creation_start);
$param .= '&date_creation_startmonth='.urlencode($tmp['mon']).'&date_creation_startday='.urlencode($tmp['mday']).'&date_creation_startyear='.urlencode($tmp['year']);
$param .= '&search_date_creation_startmonth='.urlencode($tmp['mon']).'&search_date_creation_startday='.urlencode($tmp['mday']).'&search_date_creation_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_creation_end)) {
$filter['t.date_creation<='] = $search_date_creation_end;
$tmp = dol_getdate($search_date_creation_end);
$param .= '&date_creation_endmonth='.urlencode($tmp['mon']).'&date_creation_endday='.urlencode($tmp['mday']).'&date_creation_endyear='.urlencode($tmp['year']);
$param .= '&search_date_creation_endmonth='.urlencode($tmp['mon']).'&search_date_creation_endday='.urlencode($tmp['mday']).'&search_date_creation_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_modification_start)) {
$filter['t.tms>='] = $search_date_modification_start;
$tmp = dol_getdate($search_date_modification_start);
$param .= '&date_modification_startmonth='.urlencode($tmp['mon']).'&date_modification_startday='.urlencode($tmp['mday']).'&date_modification_startyear='.urlencode($tmp['year']);
$param .= '&search_date_modification_startmonth='.urlencode($tmp['mon']).'&search_date_modification_startday='.urlencode($tmp['mday']).'&search_date_modification_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_modification_end)) {
$filter['t.tms<='] = $search_date_modification_end;
$tmp = dol_getdate($search_date_modification_end);
$param .= '&date_modification_endmonth='.urlencode($tmp['mon']).'&date_modification_endday='.urlencode($tmp['mday']).'&date_modification_endyear='.urlencode($tmp['year']);
$param .= '&search_date_modification_endmonth='.urlencode($tmp['mon']).'&search_date_modification_endday='.urlencode($tmp['mday']).'&search_date_modification_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_export_start)) {
$filter['t.date_export>='] = $search_date_export_start;
$tmp = dol_getdate($search_date_export_start);
$param .= '&date_export_startmonth='.urlencode($tmp['mon']).'&date_export_startday='.urlencode($tmp['mday']).'&date_export_startyear='.urlencode($tmp['year']);
$param .= '&search_date_export_startmonth='.urlencode($tmp['mon']).'&search_date_export_startday='.urlencode($tmp['mday']).'&search_date_export_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_export_end)) {
$filter['t.date_export<='] = $search_date_export_end;
$tmp = dol_getdate($search_date_export_end);
$param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']);
$param .= '&search_date_export_endmonth='.urlencode($tmp['mon']).'&search_date_export_endday='.urlencode($tmp['mday']).'&search_date_export_endyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_start)) {
$filter['t.date_validated>='] = $search_date_validation_start;
$tmp = dol_getdate($search_date_validation_start);
$param .= '&date_validation_startmonth='.urlencode($tmp['mon']).'&date_validation_startday='.urlencode($tmp['mday']).'&date_validation_startyear='.urlencode($tmp['year']);
$param .= '&search_date_validation_startmonth='.urlencode($tmp['mon']).'&search_date_validation_startday='.urlencode($tmp['mday']).'&search_date_validation_startyear='.urlencode($tmp['year']);
}
if (!empty($search_date_validation_end)) {
$filter['t.date_validated<='] = $search_date_validation_end;
$tmp = dol_getdate($search_date_validation_end);
$param .= '&date_validation_endmonth='.urlencode($tmp['mon']).'&date_validation_endday='.urlencode($tmp['mday']).'&date_validation_endyear='.urlencode($tmp['year']);
$param .= '&search_date_validation_endmonth='.urlencode($tmp['mon']).'&search_date_validation_endday='.urlencode($tmp['mday']).'&search_date_validation_endyear='.urlencode($tmp['year']);
}
if (!empty($search_debit)) {
$filter['t.debit'] = $search_debit;
@ -904,10 +904,10 @@ print $hookmanager->resPrint;
if (!empty($arrayfields['t.date_creation']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_creation_start, 'date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_creation_start, 'search_date_creation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_creation_end, 'date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print $form->selectDate($search_date_creation_end, 'search_date_creation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
@ -915,10 +915,10 @@ if (!empty($arrayfields['t.date_creation']['checked'])) {
if (!empty($arrayfields['t.tms']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_modification_start, 'date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_modification_start, 'search_date_modification_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_modification_end, 'date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_modification_end, 'search_date_modification_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '</td>';
}
@ -926,10 +926,10 @@ if (!empty($arrayfields['t.tms']['checked'])) {
if (!empty($arrayfields['t.date_export']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_export_start, 'date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_export_start, 'search_date_export_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_export_end, 'date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print $form->selectDate($search_date_export_end, 'search_date_export_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
@ -937,10 +937,10 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
if (!empty($arrayfields['t.date_validated']['checked'])) {
print '<td class="liste_titre center">';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_start, 'date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print $form->selectDate($search_date_validation_start, 'search_date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
print '</div>';
print '<div class="nowrap">';
print $form->selectDate($search_date_validation_end, 'date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print $form->selectDate($search_date_validation_end, 'search_date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
print '</div>';
print '</td>';
}
@ -1243,7 +1243,7 @@ while ($i < min($num, $limit)) {
// Action column
print '<td class="nowraponall center">';
if (empty($line->date_export) || empty($line->date_validation)) {
if (empty($line->date_export) && empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}

View File

@ -852,12 +852,14 @@ while ($i < min($num, $limit)) {
// Action column
print '<td class="nowraponall center">';
if (empty($line->date_export)) {
if (empty($line->date_export) && empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}
}
if (empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->supprimer) {
print ' &nbsp; <a class="paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
}
}
print '</td>';

View File

@ -866,12 +866,14 @@ while ($i < min($num, $limit)) {
// Action column
print '<td class="nowraponall center">';
if (empty($line->date_export)) {
if (empty($line->date_export) && empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->creer) {
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
}
}
if (empty($line->date_validation)) {
if ($user->rights->accounting->mouvements->supprimer) {
print ' &nbsp; <a class="paddingleft" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
}
}
print '</td>';

View File

@ -1506,6 +1506,7 @@ class BookKeeping extends CommonObject
$sql = "DELETE";
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql .= " WHERE piece_num = ".(int) $piecenum;
$sql .= " AND date_validated IS NULL"; // For security, exclusion of validated entries at the time of deletion
$sql .= " AND entity IN (".getEntity('accountancy').")";
$resql = $this->db->query($sql);

View File

@ -176,7 +176,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
$parameters = array('socid'=>$socid);
$parameters = array('socid'=>isset($socid) ? $socid : null);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');

View File

@ -115,7 +115,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
$massaction = '';
}
$parameters = array('socid'=>$socid);
$parameters = array('socid'=>isset($socid) ? $socid : null);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
@ -496,7 +496,7 @@ while ($i < min($num, $limit)) {
$adherent->gender = $obj->gender;
$adherent->morphy = $obj->morphy;
$adherent->email = $obj->email;
$adherent->typeid = $obj->type;
$adherent->typeid = $obj->fk_type;
$adherent->datefin = $db->jdate($obj->datef);
$typeid = ($obj->fk_type > 0 ? $obj->fk_type : $adherent->typeid);

View File

@ -43,6 +43,8 @@ $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$sall = GETPOST("sall", "alpha");
$filter = GETPOST("filter", 'alpha');
$search_lastname = GETPOST('search_lastname', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
$search_email = GETPOST('search_email', 'alpha');

View File

@ -157,7 +157,7 @@ $form = new Form($db);
$formadmin = new FormAdmin($db);
$head = member_type_prepare_head($object);
$titre = $langs->trans("MemberType".$object->type);
$titre = $langs->trans("MemberType".$object->id);
// Calculate $cnt_trans
$cnt_trans = 0;

View File

@ -52,22 +52,22 @@ if ($cancel) {
}
if ($action == 'update') {
dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_FORMAT')) dolibarr_set_const($db, "MAIN_PDF_FORMAT", GETPOST("MAIN_PDF_FORMAT"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_LEFT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_LEFT", GETPOST("MAIN_PDF_MARGIN_LEFT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_RIGHT')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_RIGHT", GETPOST("MAIN_PDF_MARGIN_TOP"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MARGIN_BOTTOM')) dolibarr_set_const($db, "MAIN_PDF_MARGIN_BOTTOM", GETPOST("MAIN_PDF_MARGIN_BOTTOM"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID1_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", GETPOST("MAIN_PROFID1_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID2_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", GETPOST("MAIN_PROFID2_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID3_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", GETPOST("MAIN_PROFID3_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID4_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", GETPOST("MAIN_PROFID4_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID5_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID5_IN_ADDRESS", GETPOST("MAIN_PROFID5_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PROFID6_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_PROFID6_IN_ADDRESS", GETPOST("MAIN_PROFID6_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT", GETPOST("MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_TVAINTRA_NOT_IN_ADDRESS')) dolibarr_set_const($db, "MAIN_TVAINTRA_NOT_IN_ADDRESS", GETPOST("MAIN_TVAINTRA_NOT_IN_ADDRESS"), 'chaine', 0, '', $conf->entity);
if (!empty($conf->projet->enabled)) {
if (GETPOST('PDF_SHOW_PROJECT_REF_OR_LABEL') == 'no') {
@ -82,20 +82,20 @@ if ($action == 'update') {
}
}
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_DESC')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_DESC", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_DESC"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_HIDE_REF')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", GETPOST("MAIN_GENERATE_DOCUMENTS_HIDE_REF"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_DOCUMENTS_LOGO_HEIGHT')) dolibarr_set_const($db, "MAIN_DOCUMENTS_LOGO_HEIGHT", GETPOST("MAIN_DOCUMENTS_LOGO_HEIGHT", 'int'), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_INVERT_SENDER_RECIPIENT')) dolibarr_set_const($db, "MAIN_INVERT_SENDER_RECIPIENT", GETPOST("MAIN_INVERT_SENDER_RECIPIENT"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_USE_ISO_LOCATION')) dolibarr_set_const($db, "MAIN_PDF_USE_ISO_LOCATION", GETPOST("MAIN_PDF_USE_ISO_LOCATION"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS", GETPOST("MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_SECOND_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_SECOND_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_SECOND_TAX"), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('MAIN_PDF_MAIN_HIDE_THIRD_TAX')) dolibarr_set_const($db, "MAIN_PDF_MAIN_HIDE_THIRD_TAX", GETPOST("MAIN_PDF_MAIN_HIDE_THIRD_TAX"), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE')) dolibarr_set_const($db, "PDF_USE_ALSO_LANGUAGE_CODE", GETPOST('PDF_USE_ALSO_LANGUAGE_CODE', 'alpha'), 'chaine', 0, '', $conf->entity);
if (GETPOSTISSET('SHOW_SUBPRODUCT_REF_IN_PDF')) dolibarr_set_const($db, "SHOW_SUBPRODUCT_REF_IN_PDF", GETPOST('SHOW_SUBPRODUCT_REF_IN_PDF', 'alpha'), 'chaine', 0, '', $conf->entity);
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
// Load translation files required by the page
$langs->loadLangs(array("install", "other", "admin"));
$langs->loadLangs(array("install", "other", "admin", "errors"));
if (!$user->admin) {
accessforbidden();
@ -198,6 +198,7 @@ if (empty($fileswithwritepermission)) {
}
}
print '<br>';
print '<br>';
print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: '; // $conffile is defined into filefunc.inc.php
$perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
@ -219,6 +220,16 @@ if ($perms) {
print img_warning().' '.$langs->trans("FailedToReadFile", $conffile);
}
print '<br>';
print '<br>';
$installlock = DOL_DATA_ROOT.'/install.lock';
print '<strong>'.$langs->trans("DolibarrSetup").'</strong>: ';
if (file_exists($installlock)) {
print img_picto('', 'tick').' '.$langs->trans("InstallAndUpgradeLockedBy", $installlock);
} else {
print img_warning().' '.$langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT);
}
print '<br>';
// File conf.php

View File

@ -297,7 +297,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

View File

@ -2340,7 +2340,7 @@ class ActionComm extends CommonObject
$sendContent = make_substitutions($langs->trans($arraymessage->content), $substitutionarray);
//Topic
$sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->trans('EventReminder'));
$sendTopic = (!empty($arraymessage->topic)) ? $arraymessage->topic : html_entity_decode($langs->transnoentities('EventReminder'));
// Recipient
$recipient = new User($this->db);

View File

@ -47,7 +47,7 @@ $massaction = GETPOST('massaction', 'alpha');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'actioncommlist'; // To manage different context of search
$resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int");
$pid = GETPOST("search_projectid", 'int', 3) ?GETPOST("search_projectid", 'int', 3) : GETPOST("projectid", 'int', 3);
$search_status = (GETPOST("search_status", 'alpha') != '') ?GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha');
$search_status = (GETPOST("search_status", 'aZ09') != '') ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09');
$type = GETPOST('search_type', 'alphanohtml') ?GETPOST('search_type', 'alphanohtml') : GETPOST('type', 'alphanohtml');
$optioncss = GETPOST('optioncss', 'alpha');
$year = GETPOST("year", 'int');

View File

@ -1003,7 +1003,7 @@ if ($action == 'create') {
$soc->fetch($socid);
}
if (GETPOST('origin') && GETPOST('originid')) {
if (GETPOST('origin') && GETPOST('originid', 'int')) {
// Parse element/subelement (ex: project_task)
$regs = array();
$element = $subelement = GETPOST('origin');
@ -1013,7 +1013,7 @@ if ($action == 'create') {
}
if ($element == 'project') {
$projectid = GETPOST('originid');
$projectid = GETPOST('originid', 'int');
} else {
// For compatibility
if ($element == 'order' || $element == 'commande') {
@ -1094,7 +1094,8 @@ if ($action == 'create') {
print '</td>';
} else {
print '<td>';
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300');
print img_picto('', 'company', 'class="pictofixedwidth"');
print $form->select_company('', 'socid', '', 'SelectThirdParty', 1, 0, null, 0, 'minwidth300 widthcentpercentminusxx maxwidth500');
print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
print '</td>';
}
@ -1121,11 +1122,13 @@ if ($action == 'create') {
// Commercial suivi
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPFOLL").'</span></td><td>';
print img_picto('', 'user', 'class="pictofixedwidth"');
print $form->select_dolusers(GETPOST("commercial_suivi_id") ?GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, '');
print '</td></tr>';
// Commercial signature
print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("TypeContact_contrat_internal_SALESREPSIGN").'</span></td><td>';
print img_picto('', 'user', 'class="pictofixedwidth"');
print $form->select_dolusers(GETPOST("commercial_signature_id") ?GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, '');
print '</td></tr>';
@ -1686,7 +1689,7 @@ if ($action == 'create') {
$colspan++;
}
// Ligne dates prevues
// Line dates planed
print '<tr class="oddeven">';
print '<td colspan="'.$colspan.'">';
print $langs->trans("DateStartPlanned").' ';
@ -1786,7 +1789,7 @@ if ($action == 'create') {
print '<table class="notopnoleftnoright tableforservicepart2'.($cursorline < $nbofservices ? ' boxtablenobottom' : '').'" width="100%">';
print '<tr class="oddeven" '.$moreparam.'>';
print '<td>'.$langs->trans("ServiceStatus").': '.$object->lines[$cursorline - 1]->getLibStatut(4).'</td>';
print '<td><span class="valignmiddle hideonsmartphone">'.$langs->trans("ServiceStatus").':</span> '.$object->lines[$cursorline - 1]->getLibStatut(4).'</td>';
print '<td width="30" class="right">';
if ($user->socid == 0) {
if ($object->statut > 0 && $action != 'activateline' && $action != 'unactivateline') {

View File

@ -27,17 +27,42 @@
// $permissiondellink must be defined
$dellinkid = GETPOST('dellinkid', 'int');
$addlink = GETPOST('addlink', 'alpha');
$addlinkid = GETPOST('idtolinkto', 'int');
$addlinkref = GETPOST('reftolinkto', 'alpha');
$cancellink = GETPOST('cancel', 'alpha');
// Link invoice to order
if ($action == 'addlink' && !empty($permissiondellink) && !GETPOST('cancel', 'alpha') && $id > 0 && $addlinkid > 0) {
if ($action == 'addlink' && !empty($permissiondellink) && !$cancellink && $id > 0 && $addlinkid > 0) {
$object->fetch($id);
$object->fetch_thirdparty();
$result = $object->add_object_linked(GETPOST('addlink', 'alpha'), $addlinkid);
$result = $object->add_object_linked($addlink, $addlinkid);
}
// Link by reference
if ($action == 'addlinkbyref' && ! empty($permissiondellink) && !$cancellink && $id > 0 && !empty($addlinkref) && !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
$element_prop = getElementProperties($addlink);
if (is_array($element_prop)) {
dol_include_once('/' . $element_prop['classpath'] . '/' . $element_prop['classfile'] . '.class.php');
$objecttmp = new $element_prop['classname']($db);
$ret = $objecttmp->fetch(0, $addlinkref);
if ($ret > 0) {
$object->fetch($id);
$object->fetch_thirdparty();
$result = $object->add_object_linked($addlink, $objecttmp->id);
if (isset($_POST['reftolinkto'])) unset($_POST['reftolinkto']);
} elseif ($ret < 0) {
setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
} else {
$langs->load('errors');
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
}
}
}
// Delete link
if ($action == 'dellink' && !empty($permissiondellink) && !GETPOST('cancel', 'alpha') && $dellinkid > 0) {
if ($action == 'dellink' && !empty($permissiondellink) && !$cancellink && $dellinkid > 0) {
$result = $object->deleteObjectLinked(0, '', 0, '', $dellinkid);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');

View File

@ -1547,7 +1547,7 @@ if (!$error && ($massaction == 'disable' || ($action == 'disable' && $confirm ==
$parameters['toselect'] = $toselect;
$parameters['uploaddir'] = $uploaddir;
$parameters['massaction'] = $massaction;
$parameters['diroutputmassaction'] = $diroutputmassaction;
$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null;
$reshook = $hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {

View File

@ -182,10 +182,15 @@ if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST
$tmparray = array();
if (trim($_POST['sendto'])) {
// Recipients are provided into free text
// Recipients are provided into free text field
$tmparray[] = trim($_POST['sendto']);
}
if (trim($_POST['tomail'])) {
// Recipients are provided into free hidden text field
$tmparray[] = trim($_POST['tomail']);
}
if (count($receiver) > 0) {
// Recipient was provided from combo list
foreach ($receiver as $key => $val) {

View File

@ -1628,7 +1628,7 @@ class CMailFile
* @return array array of email => name
* @see getValidAddress()
*/
public function getArrayAddress($address)
public static function getArrayAddress($address)
{
global $conf;

View File

@ -3791,7 +3791,6 @@ abstract class CommonObject
} elseif ($objecttype == 'contact') {
$module = 'societe';
}
// Set classfile
$classfile = strtolower($subelement);
$classname = ucfirst($subelement);
@ -3823,6 +3822,11 @@ abstract class CommonObject
$classfile = 'conferenceorboothattendee';
$classname = 'ConferenceOrBoothAttendee';
$module = 'eventorganization';
} elseif ($objecttype == 'conferenceorbooth') {
$classpath = 'eventorganization/class';
$classfile = 'conferenceorbooth';
$classname = 'ConferenceOrBooth';
$module = 'eventorganization';
}
// Here $module, $classfile and $classname are set

View File

@ -680,9 +680,7 @@ class dolReceiptPrinter extends Printer
foreach ($object->lines as $line) {
$total_localtax1 += $line->total_localtax1;
}
foreach ($vatarray as $vatkey => $vatvalue) {
$this->printer->text(str_pad(price($total_localtax1), 10, ' ', STR_PAD_LEFT)."\n");
}
$this->printer->text(str_pad(price($total_localtax1), 10, ' ', STR_PAD_LEFT)."\n");
break;
case 'DOL_PRINT_OBJECT_TAX2':
//var_dump($object);
@ -690,9 +688,7 @@ class dolReceiptPrinter extends Printer
foreach ($object->lines as $line) {
$total_localtax2 += $line->total_localtax2;
}
foreach ($vatarray as $vatkey => $vatvalue) {
$this->printer->text(str_pad(price($total_localtax2), 10, ' ', STR_PAD_LEFT)."\n");
}
$this->printer->text(str_pad(price($total_localtax2), 10, ' ', STR_PAD_LEFT)."\n");
break;
case 'DOL_PRINT_OBJECT_TOTAL':
$title = $langs->trans('TotalHT');

View File

@ -193,6 +193,7 @@ class HookManager
'getFormatedSupplierRef',
'getIdProfUrl',
'getInputIdProf',
'menuLeftMenuItems',
'moveUploadedFile',
'moreHtmlStatus',
'pdf_build_address',

View File

@ -1332,7 +1332,7 @@ class Form
}
// We search companies
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
if (!empty($conf->global->COMPANY_SHOW_ADDRESS_SELECTLIST)) {
$sql .= ", s.address, s.zip, s.town";
$sql .= ", dictp.code as country_code";
@ -1384,6 +1384,7 @@ class Form
$sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'";
}
$sql .= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'";
$sql .= " OR s.name_alias LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.tva_intra LIKE '".$this->db->escape($prefix.$filterkey)."%'";
$sql .= ")";
}
$sql .= $this->db->order("nom", "ASC");
@ -6974,13 +6975,15 @@ class Form
// Search data
$sql = "SELECT t.rowid, ".$fieldstoshow." FROM ".MAIN_DB_PREFIX.$objecttmp->table_element." as t";
if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0];
}
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
if (isset($objecttmp->ismultientitymanaged)) {
if (!is_numeric($objecttmp->ismultientitymanaged)) {
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
$sql .= ' INNER JOIN '.MAIN_DB_PREFIX.$tmparray[1].' as parenttable ON parenttable.rowid = t.'.$tmparray[0];
}
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
}
}
@ -6991,27 +6994,29 @@ class Form
$sql .= $hookmanager->resPrint;
} else {
$sql .= " WHERE 1=1";
if (isset($objecttmp->ismultientitymanaged) && $objecttmp->ismultientitymanaged == 1) {
$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
}
if (isset($objecttmp->ismultientitymanaged) && !is_numeric($objecttmp->ismultientitymanaged)) {
$sql .= ' AND parenttable.entity = t.'.$tmparray[0];
}
if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
if ($objecttmp->element == 'societe') {
$sql .= " AND t.rowid = ".$user->socid;
} else {
$sql .= " AND t.fk_soc = ".$user->socid;
if (isset($objecttmp->ismultientitymanaged)) {
if ($objecttmp->ismultientitymanaged == 1) {
$sql .= " AND t.entity IN (".getEntity($objecttmp->table_element).")";
}
if (!is_numeric($objecttmp->ismultientitymanaged)) {
$sql .= ' AND parenttable.entity = t.'.$tmparray[0];
}
if ($objecttmp->ismultientitymanaged == 1 && !empty($user->socid)) {
if ($objecttmp->element == 'societe') {
$sql .= " AND t.rowid = ".$user->socid;
} else {
$sql .= " AND t.fk_soc = ".$user->socid;
}
}
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
}
}
}
if ($searchkey != '') {
$sql .= natural_search(explode(',', $fieldstoshow), $searchkey);
}
if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
}
}
if ($objecttmp->filter) { // Syntax example "(t.ref:like:'SO-%') and (t.date_creation:<:'20160101')"
/*if (! DolibarrApi::_checkFilters($objecttmp->filter))
{
@ -7848,6 +7853,10 @@ class Form
$tplpath = 'expensereport';
} elseif ($objecttype == 'subscription') {
$tplpath = 'adherents';
} elseif ($objecttype == 'conferenceorbooth') {
$tplpath = 'eventorganization';
} elseif ($objecttype == 'conferenceorboothattendee') {
$tplpath = 'eventorganization';
}
global $linkedObjectBlock;
@ -7970,6 +7979,21 @@ class Form
if (!empty($possiblelink['perms']) && (empty($restrictlinksto) || in_array($key, $restrictlinksto)) && (empty($excludelinksto) || !in_array($key, $excludelinksto))) {
print '<div id="'.$key.'list"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display:none"').'>';
if (!empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
print '<br><form action="' . $_SERVER["PHP_SELF"] . '" method="POST" name="formlinkedbyref' . $key . '">';
print '<input type="hidden" name="id" value="' . $object->id . '">';
print '<input type="hidden" name="action" value="addlinkbyref">';
print '<input type="hidden" name="addlink" value="' . $key . '">';
print '<table class="noborder">';
print '<tr>';
print '<td>' . $langs->trans("Ref") . '</td>';
print '<td><input type="text" name="reftolinkto" value="' . dol_escape_htmltag(GETPOST('reftolinkto', 'alpha')) . '">&nbsp;<input type="submit" class="button valignmiddle" value="' . $langs->trans('ToLink') . '">&nbsp;<input type="submit" class="button" name="cancel" value="' . $langs->trans('Cancel') . '"></td>';
print '</tr>';
print '</table>';
print '</form>';
}
$sql = $possiblelink['sql'];
$resqllist = $this->db->query($sql);
@ -8027,7 +8051,7 @@ class Form
print '</div>';
//$linktoelem.=($linktoelem?' &nbsp; ':'');
if ($num > 0) {
if ($num > 0 || !empty($conf->global->MAIN_LINK_BY_REF_IN_LINKTO)) {
$linktoelemlist .= '<li><a href="#linkto'.$key.'" class="linkto dropdowncloseonclick" rel="'.$key.'">'.$langs->trans($possiblelink['label']).' ('.$num.')</a></li>';
// } else $linktoelem.=$langs->trans($possiblelink['label']);
} else {

View File

@ -97,7 +97,7 @@ class FormActions
function select_status() {
var defaultvalue = $('#select' + htmlname).val();
var percentage = $('input[name=percentage]');
var selected = '".(isset($selected) ? $selected : '')."';
var selected = '".(isset($selected) ? dol_escape_js($selected) : '')."';
var value = (selected>0?selected:(defaultvalue>=0?defaultvalue:''));
percentage.val(value);

View File

@ -1182,7 +1182,7 @@ class FormFile
);
$reshook = $hookmanager->executeHooks('showFilesList', $parameters, $object);
if (isset($reshook) && $reshook != '') { // null or '' for bypass
if (!empty($reshook)) { // null or '' for bypass
return $reshook;
} else {
if (!is_object($form)) {

View File

@ -1255,7 +1255,7 @@ class FormMail extends Form
*/
public function getEMailTemplate($db, $type_template, $user, $outputlangs, $id = 0, $active = 1, $label = '')
{
global $conf;
global $conf, $langs;
$ret = new ModelMail();

View File

@ -63,7 +63,7 @@ class FormOther
* @param string $jstoexecuteonadd Name of javascript function to call
* @return string HTML component
*/
public function getHTMLScannerForm($jstoexecuteonadd = 'barcodscannerjs')
public function getHTMLScannerForm($jstoexecuteonadd = 'barcodescannerjs')
{
global $langs;
@ -73,9 +73,9 @@ class FormOther
$out .= '<div class="div-for-modal-topright" style="padding: 15px">';
$out .= '<center><strong>Barcode scanner tool...</strong></center><br>';
$out .= '<input type="checkbox" name="barcodeforautodetect" checked="checked"> Autodetect if we scan a product barcode or a lot/serial barcode<br>';
$out .= '<input type="checkbox" name="barcodeforproduct"> Scan a product barcode<br>';
$out .= '<input type="checkbox" name="barcodeforlotserial"> Scan a product lot or serial number<br>';
$out .= '<input type="radio" name="barcodemode" value="barcodeforautodetect" checked="checked"> Autodetect if we scan a product barcode or a lot/serial barcode<br>';
$out .= '<input type="radio" name="barcodemode" value="barcodeforproduct"> Scan a product barcode<br>';
$out .= '<input type="radio" name="barcodemode" value="barcodeforlotserial"> Scan a product lot or serial number<br>';
$out .= $langs->trans("QtyToAddAfterBarcodeScan").' <input type="text" name="barcodeproductqty" class="width50 right" value="1"><br>';
$out .= '<textarea type="text" name="barcodelist" class="centpercent" autofocus rows="'.ROWS_3.'"></textarea>';
@ -88,13 +88,16 @@ class FormOther
*/
$out .= '<br>';
$out .= '<center>';
$out .= '<input type="submit" class="button marginleftonly marginrightonly" name="addscan" value="'.$langs->trans("Add").'">';
$out .= '<input type="submit" class="button marginleftonly marginrightonly" id ="exec'.dol_escape_js($jstoexecuteonadd).'" name="addscan" value="'.$langs->trans("Add").'">';
$out .= '<input type="submit" class="button marginleftonly marginrightonly" name="cancel" value="'.$langs->trans("Cancel").'">';
$out .= '<br>';
$out .= '<span class="opacitymedium">'.$langs->trans("FeatureNotYetAvailable").'</span>';
// TODO Add call of javascript $jstoexecuteonadd so each scan will add qty into the inventory page + an ajax save.
$out .= '<script>';
$out .= '$("#exec'.dol_escape_js($jstoexecuteonadd).'").click(function(){
console.log("We call js to execute '.dol_escape_js($jstoexecuteonadd).'");
'.dol_escape_js($jstoexecuteonadd).'();
})';
$out .= '</script>';
$out .= '</center>';
$out .= '</div>';

View File

@ -65,7 +65,7 @@ class Notify
// Les codes actions sont definis dans la table llx_notify_def
// codes actions supported are
// @todo defined also into interface_50_modNotificiation_Notificiation.class.php
// @todo defined also into interface_50_modNotification_Notification.class.php
public $arrayofnotifsupported = array(
'BILL_VALIDATE',
'BILL_PAYED',
@ -80,8 +80,8 @@ class Notify
'SHIPPING_VALIDATE',
'EXPENSE_REPORT_VALIDATE',
'EXPENSE_REPORT_APPROVE',
'HOLIDAY_VALIDATE',
'HOLIDAY_APPROVE',
'HOLIDAY_VALIDATE',
'HOLIDAY_APPROVE',
'ACTION_CREATE'
);
@ -546,7 +546,7 @@ class Notify
$object_type = 'holiday';
$labeltouse = $conf->global->HOLIDAY_APPROVE_TEMPLATE;
$mesg = $outputlangs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
break;
break;
case 'ACTION_CREATE':
$link = '<a href="'.$urlwithroot.'/comm/action/card.php?id='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
$dir_output = $conf->agenda->dir_output;
@ -567,10 +567,10 @@ class Notify
$subject = make_substitutions($arraydefaultmessage->topic, $substitutionarray, $outputlangs);
$message = make_substitutions($arraydefaultmessage->content, $substitutionarray, $outputlangs);
} else {
$message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification", $application, $mysoc->name)."\n";
$message .= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n";
$message .= "\n";
$message .= $mesg;
$message = $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification", $application, $mysoc->name)."\n";
$message .= $outputlangs->transnoentities("YouReceiveMailBecauseOfNotification2", $application, $mysoc->name)."\n";
$message .= "\n";
$message .= $mesg;
}
$ref = dol_sanitizeFileName($newref);
@ -687,7 +687,7 @@ class Notify
break;
case 'BILL_PAYED':
$link = '<a href="'.$urlwithroot.'/compta/facture/card.php?facid='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
$dir_output = $$conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
$dir_output = $conf->facture->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'invoice');
$object_type = 'facture';
$mesg = $langs->transnoentitiesnoconv("EMailTextInvoicePayed", $link);
break;
@ -782,7 +782,7 @@ class Notify
$dir_output = $conf->holiday->dir_output;
$object_type = 'holiday';
$mesg = $langs->transnoentitiesnoconv("EMailTextHolidayApproved", $link);
break;
break;
case 'ACTION_CREATE':
$link = '<a href="'.$urlwithroot.'/comm/action/card.php?id='.$object->id.'&entity='.$object->entity.'">'.$newref.'</a>';
$dir_output = $conf->agenda->dir_output;

View File

@ -131,8 +131,8 @@ function check_events() {
if (value.type == 'agenda')
{
url = '<?php print DOL_URL_ROOT.'/comm/action/card.php?id='; ?>' + value.id_agenda;
title = '<?php print dol_escape_js($langs->trans('EventReminder')) ?>';
url = '<?php print DOL_URL_ROOT.'/comm/action/card.php?id='; ?>' + value.id_agenda;
title = '<?php print dol_escape_js($langs->transnoentities('EventReminder')) ?>';
}
var extra = {
icon: '<?php print DOL_URL_ROOT.'/theme/common/bell.png'; ?>',

View File

@ -1,5 +1,6 @@
/* Copyright (C) 2014 delcroip <delcroip@gmail.com>
* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2021 Josep Lluís Amador <joseplluis@lliuretic.cat>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -257,7 +258,7 @@ function updateTotal(days,mode)
result=parseTime(jQuery('.totalDay'+stringdays).text(),taskTime);
if (result >= 0)
{
totalhour = totalhour + taskTime.getHours();
totalhour = totalhour + taskTime.getHours() + result*24;
totalmin = totalmin + taskTime.getMinutes();
}
}

View File

@ -61,13 +61,13 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
// Filters
//print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="get">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="year" value="'.$year.'">';
print '<input type="hidden" name="month" value="'.$month.'">';
print '<input type="hidden" name="day" value="'.$day.'">';
print '<input type="hidden" name="year" value="'.((int) $year).'">';
print '<input type="hidden" name="month" value="'.((int) $month).'">';
print '<input type="hidden" name="day" value="'.((int) $day).'">';
if ($massaction != 'predelete' && $massaction != 'preaffecttag') { // When $massaction == 'predelete', action may be already output to 'delete' by the mass action system.
print '<input type="hidden" name="action" value="'.$action.'">';
}
print '<input type="hidden" name="search_showbirthday" value="'.$showbirthday.'">';
print '<input type="hidden" name="search_showbirthday" value="'.((int) $showbirthday).'">';
if ($canedit) {
print '<div class="divsearchfield">';

View File

@ -1948,7 +1948,9 @@ function show_subsidiaries($conf, $langs, $db, $object)
$socstatic = new Societe($db);
print load_fiche_titre($langs->trans("Subsidiaries"), '', '');
print "\n".'<table class="noborder centpercent">'."\n";
print "\n".'<div class="div-table-responsive-no-min">'."\n";
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre"><td>'.$langs->trans("Company").'</td>';
print '<td>'.$langs->trans("Address").'</td><td>'.$langs->trans("Zip").'</td>';
@ -1976,17 +1978,17 @@ function show_subsidiaries($conf, $langs, $db, $object)
print '<tr class="oddeven">';
print '<td>';
print '<td class="tdoverflowmax150">';
print $socstatic->getNomUrl(1);
print '</td>';
print '<td>'.$obj->address.'</td>';
print '<td>'.$obj->zip.'</td>';
print '<td>'.$obj->town.'</td>';
print '<td>'.$obj->code_client.'</td>';
print '<td class="tdoverflowmax400" title="'.dol_escape_htmltag($obj->address).'">'.dol_escape_htmltag($obj->address).'</td>';
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->zip).'">'.$obj->zip.'</td>';
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->town).'">'.$obj->town.'</td>';
print '<td class="tdoverflowmax200" title="'.dol_escape_htmltag($obj->code_client).'">'.$obj->code_client.'</td>';
print '<td class="center">';
print '<a href="'.DOL_URL_ROOT.'/societe/card.php?socid='.$obj->rowid.'&amp;action=edit">';
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/societe/card.php?socid='.((int) $obj->rowid).'&action=edit">';
print img_edit();
print '</a></td>';
@ -1994,6 +1996,7 @@ function show_subsidiaries($conf, $langs, $db, $object)
$i++;
}
print "\n</table>\n";
print '</div>'."\n";
}
print "<br>\n";

View File

@ -10204,7 +10204,7 @@ function newToken()
*/
function currentToken()
{
return $_SESSION['token'];
return isset($_SESSION['token']) ? $_SESSION['token'] : '';
}
/**

View File

@ -98,7 +98,7 @@ function dol_decode($chain, $key = '1')
* If constant MAIN_SECURITY_SALT is defined, we use it as a salt (used only if hashing algorightm is something else than 'password_hash').
*
* @param string $chain String to hash
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @param string $type Type of hash ('0':auto will use MAIN_SECURITY_HASH_ALGO else md5, '1':sha1, '2':sha1+md5, '3':md5, '4':md5 for OpenLdap with no salt, '5':sha256, '6':password_hash). Use '3' here, if hash is not needed for security purpose, for security need, prefer '0'.
* @return string Hash of string
* @see getRandomPassword()
*/
@ -124,8 +124,10 @@ function dol_hash($chain, $type = '0')
return md5($chain);
} elseif ($type == '4' || $type == 'md5openldap') {
return '{md5}'.base64_encode(mhash(MHASH_MD5, $chain)); // For OpenLdap with md5 (based on an unencrypted password in base)
} elseif ($type == '5') {
} elseif ($type == '5' || $type == 'sha256') {
return hash('sha256', $chain);
} elseif ($type == '6' || $type == 'password_hash') {
return password_hash($chain, PASSWORD_DEFAULT);
} elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') {
return sha1($chain);
} elseif (!empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') {

View File

@ -690,7 +690,8 @@ function print_end_menu_array()
*/
function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabMenu, &$menu, $noout = 0, $forcemainmenu = '', $forceleftmenu = '', $moredata = null, $type_user = 0)
{
global $user, $conf, $langs, $dolibarr_main_db_name, $mysoc;
global $user, $conf, $langs, $dolibarr_main_db_name, $mysoc, $hookmanager;
//var_dump($tabMenu);
@ -1732,11 +1733,11 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$titleboth = $langs->trans("LeadsOrProjects");
$titlenew = $langs->trans("NewLeadOrProject"); // Leads and opportunities by default
if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
$titleboth = $langs->trans("Projects");
$titlenew = $langs->trans("NewProject");
}
if ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
$titleboth = $langs->trans("Leads");
$titlenew = $langs->trans("NewLead");
}
@ -1745,13 +1746,13 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/projet/index.php?leftmenu=projects".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titleboth, 0, $user->rights->projet->lire, '', $mainmenu, 'projects', 0, '', '', '', img_picto('', 'project', 'class="pictofixedwidth"'));
$newmenu->add("/projet/card.php?leftmenu=projects&action=create".($search_project_user ? '&search_project_user='.$search_project_user : ''), $titlenew, 1, $user->rights->projet->creer);
if ($conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
if (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 0) {
$newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : '').'&search_status=99', $langs->trans("List"), 1, $showmode, '', 'project', 'list');
} elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 1) {
} elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 1) {
$newmenu->add("/projet/list.php?leftmenu=projets".($search_project_user ? '&search_project_user='.$search_project_user : ''), $langs->trans("List"), 1, $showmode, '', 'project', 'list');
$newmenu->add('/projet/list.php?mainmenu=project&amp;leftmenu=list&search_usage_opportunity=1&search_status=99&search_opp_status=openedopp&contextpage=lead', $langs->trans("ListOpenLeads"), 2, $showmode);
$newmenu->add('/projet/list.php?mainmenu=project&amp;leftmenu=list&search_opp_status=notopenedopp&search_status=99&contextpage=project', $langs->trans("ListOpenProjects"), 2, $showmode);
} elseif ($conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
} elseif (isset($conf->global->PROJECT_USE_OPPORTUNITIES) && $conf->global->PROJECT_USE_OPPORTUNITIES == 2) { // 2 = leads only
$newmenu->add('/projet/list.php?mainmenu=project&amp;leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode);
}
@ -1958,6 +1959,28 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
return 0;
}
// Allow the $menu_array of the menu to be manipulated by modules
$parameters = array(
'mainmenu' => $mainmenu,
);
$hook_items = $menu_array;
$reshook = $hookmanager->executeHooks('menuLeftMenuItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks
if (is_numeric($reshook)) {
if ($reshook == 0 && !empty($hookmanager->results)) {
$menu_array[] = $hookmanager->results; // add
} elseif ($reshook == 1) {
$menu_array = $hookmanager->results; // replace
}
// @todo Sort menu items by 'position' value
// $position = array();
// foreach ($menu_array as $key => $row) {
// $position[$key] = $row['position'];
// }
// array_multisort($position, SORT_ASC, $menu_array);
}
// TODO Use the position property in menu_array to reorder the $menu_array
//var_dump($menu_array);
/*$new_menu_array = array();

View File

@ -138,7 +138,7 @@ abstract class ModeleNumRefBarCode
{
global $conf;
$langs->load("admin");
$langs->loadLangs(array("admin", "companies"));
$s = '';
$s .= $langs->trans("Name").': <b>'.$this->name.'</b><br>';

View File

@ -273,7 +273,7 @@ class modFacture extends DolibarrModules
$this->export_TypeFields_array[$r] = array(
's.rowid'=>'Numeric', 's.nom'=>'Text', 'ps.nom'=>'Text', 's.code_client'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 'c.code'=>'Text', 'cd.nom'=>'Text', 's.phone'=>'Text', 's.siren'=>'Text',
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text', 's.tva_intra'=>'Text',
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date",
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.ref_client'=>'Text', 'f.type'=>"Numeric", 'f.datec'=>"Date", 'f.datef'=>"Date", 'f.date_lim_reglement'=>"Date", 'f.fk_mode_reglement'=>'Numeric',
'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric", 'f.total_tva'=>"Numeric", 'f.localtax1'=>'Numeric', 'f.localtax2'=>'Numeric', 'f.paye'=>"Boolean", 'f.fk_statut'=>'Numeric', 'f.close_code'=>'Text', 'f.close_note'=>'Text',
'none.rest'=>"NumericCompute",
'f.note_private'=>"Text", 'f.note_public'=>"Text", 'f.fk_user_author'=>'Numeric', 'uc.login'=>'Text', 'f.fk_user_valid'=>'Numeric', 'uv.login'=>'Text',

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2021 Ferran Marcet <fmarcet@2byte.es>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -148,19 +149,19 @@ class modStock extends DolibarrModules
$this->rights[4][4] = 'mouvement';
$this->rights[4][5] = 'creer';
$this->rights[5][0] = 1011;
$this->rights[5][1] = 'inventoryReadPermission'; // Permission label
$this->rights[5][3] = 0; // Permission by default for new user (0/1)
$this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[6][0] = 1012;
$this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
$this->rights[6][3] = 0; // Permission by default for new user (0/1)
$this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
$this->rights[5][0] = 1011;
$this->rights[5][1] = 'inventoryReadPermission'; // Permission label
$this->rights[5][3] = 0; // Permission by default for new user (0/1)
$this->rights[5][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[5][5] = 'read'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[6][0] = 1012;
$this->rights[6][1] = 'inventoryCreatePermission'; // Permission label
$this->rights[6][3] = 0; // Permission by default for new user (0/1)
$this->rights[6][4] = 'inventory_advance'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[6][5] = 'write'; // In php code, permission will be checked by test if ($user->rights->permkey->level1->level2)
$this->rights[8][0] = 1014;
$this->rights[8][1] = 'inventoryValidatePermission'; // Permission label
$this->rights[8][3] = 0; // Permission by default for new user (0/1)

View File

@ -122,8 +122,18 @@ class modTicket extends DolibarrModules
}
$this->dictionaries = array(
'langs' => 'ticket',
'tabname' => array(MAIN_DB_PREFIX."c_ticket_type", MAIN_DB_PREFIX."c_ticket_severity", MAIN_DB_PREFIX."c_ticket_category", MAIN_DB_PREFIX."c_ticket_resolution"),
'tablib' => array("TicketDictType", "TicketDictSeverity", "TicketDictCategory", "TicketDictResolution"),
'tabname' => array(
MAIN_DB_PREFIX."c_ticket_type",
MAIN_DB_PREFIX."c_ticket_severity",
MAIN_DB_PREFIX."c_ticket_category",
MAIN_DB_PREFIX."c_ticket_resolution"
),
'tablib' => array(
"TicketDictType",
"TicketDictSeverity",
"TicketDictCategory",
"TicketDictResolution"
),
'tabsql' => array(
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_type as f',
'SELECT f.rowid as rowid, f.code, f.pos, f.label, f.active, f.use_default FROM '.MAIN_DB_PREFIX.'c_ticket_severity as f',
@ -135,7 +145,7 @@ class modTicket extends DolibarrModules
'tabfieldvalue' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
'tabfieldinsert' => array("code,label,pos,use_default", "code,label,pos,use_default", "code,label,pos,use_default,public,fk_parent", "code,label,pos,use_default"),
'tabrowid' => array("rowid", "rowid", "rowid", "rowid"),
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled),
'tabcond' => array($conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled, $conf->ticket->enabled && !empty($conf->global->TICKET_ENABLE_RESOLUTION)),
'tabhelp' => array(
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),
array('code'=>$langs->trans("EnterAnyCode"), 'use_default'=>$langs->trans("Enter0or1")),

View File

@ -118,7 +118,7 @@ class mod_codeproduct_elephant extends ModeleProductCode
$texte .= '<tr><td>'.$langs->trans("Mask").' ('.$langs->trans("ProductCodeModel").'):</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat minwidth175" name="value1" value="'.(!empty($conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT) ? $conf->global->PRODUCT_ELEPHANT_MASK_PRODUCT : '').'"'.$disabled.'>', $tooltip, 1, 1).'</td>';
$texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"'.$disabled.'></td>';
$texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button small" value="'.$langs->trans("Modify").'" name="Button"'.$disabled.'></td>';
$texte .= '</tr>';

View File

@ -193,7 +193,8 @@ abstract class ModeleProductCode
{
global $conf;
$langs->load("admin");
$langs->loadLangs(array("admin", "companies"));
$strikestart = '';
$strikeend = '';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {

View File

@ -524,8 +524,8 @@ class doc_generic_task_odt extends ModelePDFTask
//print "conf->societe->dir_temp=".$conf->societe->dir_temp;
dol_mkdir($conf->projet->dir_temp);
if (!is_writable($conf->task->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->task->dir_temp;
if (!is_writable($conf->projet->dir_temp)) {
$this->error = "Failed to write in temp directory ".$conf->projet->dir_temp;
dol_syslog('Error in write_file: '.$this->error, LOG_ERR);
return -1;
}

View File

@ -198,7 +198,8 @@ abstract class ModeleThirdPartyCode
{
global $conf;
$langs->load("admin");
$langs->loadLangs(array("admin", "companies"));
$strikestart = '';
$strikeend = '';
if (!empty($conf->global->MAIN_COMPANY_CODE_ALWAYS_REQUIRED) && !empty($this->code_null)) {

View File

@ -137,6 +137,13 @@ if ($action == 'presend') {
$formmail->fromname = '';
$formmail->fromtype = 'special';
}
if ($object->element === 'order_supplier' && !empty($conf->global->ORDER_SUPPLIER_EMAIL_SENDER)) {
$formmail->frommail = $conf->global->ORDER_SUPPLIER_EMAIL_SENDER;
$formmail->fromname = '';
$formmail->fromtype = 'special';
}
$formmail->trackid = $trackid;
if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set

View File

@ -43,7 +43,7 @@ $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object,
print $hookmanager->resPrint;
if (empty($reshook)) {
$params = array();
$params['cols'] = $parameters['colspanvalue'];
$params['cols'] = isset($parameters['colspanvalue']) ? $parameters['colspanvalue'] : null;
print $object->showOptionals($extrafields, 'edit', $params);
}

View File

@ -205,7 +205,7 @@ if ($massaction == 'predisable') {
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
$parameters = array(
'toselect' => $toselect,
'uploaddir' => $uploaddir
'uploaddir' => isset($uploaddir) ? $uploaddir : null
);
$reshook = $hookmanager->executeHooks('doPreMassActions', $parameters, $object, $action);

View File

@ -556,6 +556,21 @@ class InterfaceActionsAuto extends DolibarrTriggers
$object->actionmsg .= $langs->trans("Reason") . ': '.$object->refuse_note;
}
$object->sendtoid = 0;
} elseif ($action == 'ORDER_SUPPLIER_CANCEL') {
// Load translation files required by the page
$langs->loadLangs(array("agenda", "other", "orders", "main"));
if (empty($object->actionmsg2)) {
$object->actionmsg2 = $langs->transnoentities("OrderCanceledInDolibarr", $object->ref);
}
$object->actionmsg = $langs->transnoentities("OrderCanceledInDolibarr", $object->ref);
if (!empty($object->cancel_note)) {
$object->actionmsg .= '<br>';
$object->actionmsg .= $langs->trans("Reason") . ': '.$object->cancel_note;
}
$object->sendtoid = 0;
} elseif ($action == 'ORDER_SUPPLIER_SUBMIT') {
// Load translation files required by the page
@ -566,6 +581,11 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
$object->actionmsg = $langs->transnoentities("SupplierOrderSubmitedInDolibarr", ($object->newref ? $object->newref : $object->ref));
if (!empty($object->context['comments'])) {
$object->actionmsg .= '<br>';
$object->actionmsg .= $langs->trans("Comment") . ': '.$object->context['comments'];
}
$object->sendtoid = 0;
} elseif ($action == 'ORDER_SUPPLIER_RECEIVE') {
// Load translation files required by the page
@ -936,7 +956,11 @@ class InterfaceActionsAuto extends DolibarrTriggers
}
}
$object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$user->login, $object->actionmsg);
if (!empty($user->login)) {
$object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$user->login, $object->actionmsg);
} elseif (isset($object->origin_email)) {
$object->actionmsg = dol_concatdesc($langs->transnoentities("Author").': '.$object->origin_email, $object->actionmsg);
}
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
*/
class InterfaceNotification extends DolibarrTriggers
{
// @todo Defined also into notify.class.php)
// @todo Defined also into notify.class.php
public $listofmanagedevents = array(
'BILL_VALIDATE',
'BILL_PAYED',

View File

@ -330,7 +330,15 @@ if (!empty($withproject)) {
print "</td></tr>";
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
print '';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
print $message;
print "</td></tr>";
print '</table>';
@ -496,6 +504,41 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$keyforbreak='pubregister';
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
$object->fetchObjectLinked();
if (is_array($object->linkedObjects) && count($object->linkedObjects)>0 && array_key_exists("facture", $object->linkedObjects)) {
foreach ($object->linkedObjects["facture"] as $fac) {
/**
* @var $fac Facture
*/
if (empty($fac->paye)) {
$key = 'paymentlink_'.$fac->id;
print '<tr class="field_'.$key.'"><td';
print ' class="titlefield fieldname_'.$key;
print '">';
print img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("ToOfferALinkForOnlinePayment", $langs->transnoentitiesnoconv('Online')) . ' '. $fac->ref.'</span><br>';
print '</td>';
print '<td class="valuefield fieldname_'.$key;
print '">';
$sourcetouse = 'boothlocation';
$reftouse = $fac->id;
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?source='.$sourcetouse.'&ref='.$reftouse.'&booth='.$object->id;
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN)) {
if (!empty($conf->global->PAYMENT_SECURITY_TOKEN_UNIQUE)) {
$redirection .= '&securekey='.dol_hash($conf->global->PAYMENT_SECURITY_TOKEN . $sourcetouse . $reftouse, 2); // Use the source in the hash to avoid duplicates if the references are identical
} else {
$redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
}
}
print '<div class="urllink"><input type="text" id="onlinepaymenturl" class="quatrevingtpercent" value="'.$redirection.'">';
print '<a href="'.$redirection.'" target="_blank">'.img_picto('', 'globe', 'class="paddingleft"').'</a></div>';
print '</td>';
print '</tr>';
}
}
}
//var_dump($object);
// Other attributes. Fields from hook formObjectOptions and Extrafields.
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';

View File

@ -309,7 +309,15 @@ if (!empty($withproject)) {
print "</td></tr>";
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
print '';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
print $message;
print "</td></tr>";
print '</table>';

View File

@ -266,8 +266,15 @@ if (!empty($withproject)) {
print "</td></tr>";
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
print '';
//TODO fill with ics
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
print $message;
print "</td></tr>";
print '</table>';

View File

@ -173,7 +173,10 @@ if (GETPOST('cancel', 'alpha')) {
$action = 'list';
$massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend'
&& $massaction != 'presend_attendees'
&& $massaction != 'confirm_presend'
&& $massaction != 'confirm_presend_attendees') {
$massaction = '';
}
@ -211,6 +214,7 @@ if (empty($reshook)) {
$objectclass = 'ConferenceOrBooth';
$objectlabel = 'ConferenceOrBooth';
$uploaddir = $conf->eventorganization->dir_output;
include DOL_DOCUMENT_ROOT.'/eventorganization/core/actions_massactions_mail.inc.php';
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
}
@ -421,8 +425,6 @@ if ($projectid > 0) {
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectid.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
$message .= '</div>';
$message .= '<br>';
print $message;
print "</td></tr>";
@ -583,12 +585,13 @@ $arrayofmassactions = array(
//'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
//'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("ConferenceOrBooth"),
'presend_attendees'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail").' - '.$langs->trans("Attendees"),
);
if ($permissiontodelete) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'presend_attendees', 'predelete'))) {
$arrayofmassactions = array();
}
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
@ -612,9 +615,11 @@ print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sort
$topicmail = "SendConferenceOrBoothRef";
$modelmail = "conferenceorbooth";
$objecttmp = new ConferenceOrBooth($db);
$trackid = 'xxxx'.$object->id;
$trackid = 'conferenceorbooth_'.$object->id;
include DOL_DOCUMENT_ROOT.'/eventorganization/tpl/massactions_mail_pre.tpl.php';
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
if ($search_all) {
foreach ($fieldstosearchall as $key => $val) {
$fieldstosearchall[$key] = $langs->trans($val);

View File

@ -336,7 +336,15 @@ if (!empty($withproject)) {
print "</td></tr>";
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
print '';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
print $message;
print "</td></tr>";
print '</table>';

View File

@ -499,7 +499,15 @@ if ($confOrBooth->id > 0) {
print "</td></tr>";
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
print '';
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT;
// Show message
$message = '<a href="'.$urlwithroot.'/public/agenda/agendaexport.php?format=ical'.($conf->entity > 1 ? "&entity=".$conf->entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'</a>';
print $message;
print "</td></tr>";
print '</table>';

View File

@ -0,0 +1,315 @@
<?php
/* Copyright (C) 2015-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018-2021 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019-2021 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/
/**
* \file htdocs/core/actions_massactions.inc.php
* \brief Code for actions done with massaction button (send by email, merge pdf, delete, ...)
*/
// $massaction must be defined
// $objectclass and $objectlabel must be defined
// $parameters, $object, $action must be defined for the hook.
// $permissiontoread, $permissiontoadd, $permissiontodelete, $permissiontoclose may be defined
// $uploaddir may be defined (example to $conf->projet->dir_output."/";)
// $toselect may be defined
// $diroutputmassaction may be defined
// Protection
if (empty($objectclass) || empty($uploaddir)) {
dol_print_error(null, 'include of actions_massactions.inc.php is done but var $objectclass or $uploaddir was not defined');
exit;
}
// For backward compatibility
if (!empty($permtoread) && empty($permissiontoread)) {
$permissiontoread = $permtoread;
}
if (!empty($permtocreate) && empty($permissiontoadd)) {
$permissiontoadd = $permtocreate;
}
if (!empty($permtodelete) && empty($permissiontodelete)) {
$permissiontodelete = $permtodelete;
}
// Mass actions. Controls on number of lines checked.
$maxformassaction = (empty($conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS) ? 1000 : $conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS);
if (!empty($massaction) && is_array($toselect) && count($toselect) < 1) {
$error++;
setEventMessages($langs->trans("NoRecordSelected"), null, "warnings");
}
if (!$error && is_array($toselect) && count($toselect) > $maxformassaction) {
setEventMessages($langs->trans('TooManyRecordForMassAction', $maxformassaction), null, 'errors');
$error++;
}
if (!$error && $massaction == 'confirm_presend_attendees' && !GETPOST('sendmail')) { // If we do not choose button send (for example when we change template or limit), we must not send email, but keep on send email form
$massaction = 'presend_attendees';
}
if (!$error && $massaction == 'confirm_presend_attendees') {
$resaction = '';
$nbsent = 0;
$nbignored = 0;
$langs->load("mails");
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$listofobjectid = array();
$listofobjectref = array();
$oneemailperrecipient = (GETPOST('oneemailperrecipient') == 'on' ? 1 : 0);
if (!$error) {
require_once DOL_DOCUMENT_ROOT . '/eventorganization/class/conferenceorboothattendee.class.php';
$attendee = new ConferenceOrBoothAttendee($db);
$listofselectedid = array();
$listofselectedref = array();
$objecttmp = new $objectclass($db);
foreach ($toselect as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result > 0) {
$attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm' => $objecttmp->id));
if (is_array($attendees) && count($attendees) > 0) {
foreach ($attendees as $attmail) {
if (!empty($attmail->email)) {
$attmail->fetch_thirdparty();
$listofselectedid[$attmail->email] = $attmail;
$listofselectedref[$attmail->email] = $objecttmp;
}
}
}
}
}
}
// Check mandatory parameters
if (GETPOST('fromtype', 'alpha') === 'user' && empty($user->email)) {
$error++;
setEventMessages($langs->trans("NoSenderEmailDefined"), null, 'warnings');
$massaction = 'presend_attendees';
}
$receiver = $_POST['receiver'];
if (!is_array($receiver)) {
if (empty($receiver) || $receiver == '-1') {
$receiver = array();
} else {
$receiver = array($receiver);
}
}
if (!trim($_POST['sendto']) && count($receiver) == 0 && count($listofselectedid) == 1) { // if only one recipient, receiver is mandatory
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Recipient")), null, 'warnings');
$massaction = 'presend_attendees';
}
if (!GETPOST('subject', 'restricthtml')) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("MailTopic")), null, 'warnings');
$massaction = 'presend_attendees';
}
if (!$error) {
$objecttmp->fetch_thirdparty();
foreach ($listofselectedid as $email => $attendees) {
$sendto = '';
$sendtocc = '';
$sendtobcc = '';
$sendtoid = array();
// Define $sendto
$sendto = $attendees->thirdparty->name . '<' . trim($attendees->email) . '>';
// Define $sendtocc
$receivercc = $_POST['receivercc'];
if (!is_array($receivercc)) {
if ($receivercc == '-1') {
$receivercc = array();
} else {
$receivercc = array($receivercc);
}
}
$tmparray = array();
if (trim($_POST['sendtocc'])) {
$tmparray[] = trim($_POST['sendtocc']);
}
$sendtocc = implode(',', $tmparray);
$langs->load("commercial");
$reg = array();
$fromtype = GETPOST('fromtype');
if ($fromtype === 'user') {
$from = $user->getFullName($langs) . ' <' . $user->email . '>';
} elseif ($fromtype === 'company') {
$from = $conf->global->MAIN_INFO_SOCIETE_NOM . ' <' . $conf->global->MAIN_INFO_SOCIETE_MAIL . '>';
} elseif (preg_match('/user_aliases_(\d+)/', $fromtype, $reg)) {
$tmp = explode(',', $user->email_aliases);
$from = trim($tmp[($reg[1] - 1)]);
} elseif (preg_match('/global_aliases_(\d+)/', $fromtype, $reg)) {
$tmp = explode(',', $conf->global->MAIN_INFO_SOCIETE_MAIL_ALIASES);
$from = trim($tmp[($reg[1] - 1)]);
} elseif (preg_match('/senderprofile_(\d+)_(\d+)/', $fromtype, $reg)) {
$sql = 'SELECT rowid, label, email FROM ' . MAIN_DB_PREFIX . 'c_email_senderprofile WHERE rowid = ' . (int) $reg[1];
$resql = $db->query($sql);
$obj = $db->fetch_object($resql);
if ($obj) {
$from = $obj->label . ' <' . $obj->email . '>';
}
} else {
$from = $_POST['fromname'] . ' <' . $_POST['frommail'] . '>';
}
$replyto = $from;
$subject = GETPOST('subject', 'restricthtml');
$message = GETPOST('message', 'restricthtml');
$sendtobcc = GETPOST('sendtoccc');
// $objecttmp is a real object or an empty object if we choose to send one email per thirdparty instead of one per object
// Make substitution in email content
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $attendees);
if (!empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) {
$urlwithouturlroot = preg_replace('/' . preg_quote(DOL_URL_ROOT, '/') . '$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot . DOL_URL_ROOT;
$url_link = $urlwithroot . '/public/agenda/agendaexport.php?format=ical' . ($conf->entity > 1 ? "&entity=" . $conf->entity : "");
$url_link .= '&exportkey=' . ($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ? urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
$url_link .= "&project=" . $listofselectedref[$email]->fk_project . '&module=' . urlencode('@eventorganization') . '&status=' . ConferenceOrBooth::STATUS_CONFIRMED;
$html_link = '<a href="' . $url_link . '">' . $langs->trans('DownloadICSLink') . '</a>';
}
$substitutionarray['__EVENTORGANIZATION_ICS_LINK__'] = $html_link;
$substitutionarray['__EVENTORGANIZATION_URL_LINK__'] = $url_link;
$substitutionarray['__CHECK_READ__'] = '<img src="' . DOL_MAIN_URL_ROOT . '/public/emailing/mailing-read.php?tag=' . urlencode($attendees->thirdparty->tag) . '&securitykey=' . urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY) . '" width="1" height="1" style="width:1px;height:1px" border="0"/>';
$parameters = array('mode' => 'formemail');
if (!empty($listofobjectref)) {
$parameters['listofobjectref'] = $listofobjectref;
}
complete_substitutions_array($substitutionarray, $langs, $attendees, $parameters);
$subjectreplaced = make_substitutions($subject, $substitutionarray);
$messagereplaced = make_substitutions($message, $substitutionarray);
if (empty($sendcontext)) {
$sendcontext = 'standard';
}
// Send mail (substitutionarray must be done just before this)
require_once DOL_DOCUMENT_ROOT . '/core/class/CMailFile.class.php';
$mailfile = new CMailFile($subjectreplaced, $sendto, $from, $messagereplaced, array(), array(), array(), $sendtocc, $sendtobcc, $deliveryreceipt, -1, '', '', "attendees_".$attendees->id, '', $sendcontext);
if ($mailfile->error) {
$resaction .= '<div class="error">' . $mailfile->error . '</div>';
} else {
$result = $mailfile->sendfile();
if ($result) {
$resaction .= $langs->trans('MailSuccessfulySent', $mailfile->getValidAddress($from, 2), $mailfile->getValidAddress($sendto, 2)) . '<br>'; // Must not contain "
$error = 0;
dol_syslog("Try to insert email event into agenda for objid=" . $attendees->id . " => objectobj=" . get_class($attendees));
$actionmsg = $langs->transnoentities('MailSentBy') . ' ' . $from . ' ' . $langs->transnoentities('To') . ' ' . $sendto;
if ($message) {
if ($sendtocc) {
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('Bcc') . ": " . $sendtocc);
}
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('MailTopic') . ": " . $subjectreplaced);
$actionmsg = dol_concatdesc($actionmsg, $langs->transnoentities('TextUsedInTheMessageBody') . ":");
$actionmsg = dol_concatdesc($actionmsg, $messagereplaced);
}
$actionmsg2 = '';
$objectobj2 = $listofselectedref[$email];
// Initialisation donnees
$objectobj2->actionmsg = $actionmsg; // Long text
$objectobj2->actionmsg2 = $actionmsg2; // Short text
$objectobj2->fk_element = $objectobj2->id;
$objectobj2->elementtype = $objectobj2->element;
$triggername = 'CONFERENCEORBOOTHATTENDEE_SENTBYMAIL';
if (!empty($triggername)) {
// Call trigger
$result = $objectobj2->call_trigger($triggername, $user);
if ($result < 0) {
$error++;
}
// End call triggers
if ($error) {
setEventMessages($db->lasterror(), $objectobj2->errors, 'errors');
dol_syslog("Error in trigger " . $triggername . ' ' . $db->lasterror(), LOG_ERR);
}
}
$nbsent++; // Nb of object sent
} else {
$langs->load("other");
if ($mailfile->error) {
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto);
$resaction .= '<br><div class="error">' . $mailfile->error . '</div>';
} elseif (!empty($conf->global->MAIN_DISABLE_ALL_MAILS)) {
$resaction .= '<div class="warning">No mail sent. Feature is disabled by option MAIN_DISABLE_ALL_MAILS</div>';
} else {
$resaction .= $langs->trans('ErrorFailedToSendMail', $from, $sendto) . '<br><div class="error">(unhandled error)</div>';
}
}
}
}
}
$resaction .= ($resaction ? '<br>' : $resaction);
$resaction .= '<strong>' . $langs->trans("ResultOfMailSending") . ':</strong><br>' . "\n";
$resaction .= $langs->trans("NbSelected") . ': ' . count($toselect) . "\n<br>";
$resaction .= $langs->trans("NbIgnored") . ': ' . ($nbignored ? $nbignored : 0) . "\n<br>";
$resaction .= $langs->trans("NbSent") . ': ' . ($nbsent ? $nbsent : 0) . "\n<br>";
if ($nbsent) {
$action = ''; // Do not show form post if there was at least one successfull sent
//setEventMessages($langs->trans("EMailSentToNRecipients", $nbsent.'/'.count($toselect)), null, 'mesgs');
setEventMessages($langs->trans("EMailSentForNElements", $nbsent . '/' . count($toselect)), null, 'mesgs');
setEventMessages($resaction, null, 'mesgs');
} else {
//setEventMessages($langs->trans("EMailSentToNRecipients", 0), null, 'warnings'); // May be object has no generated PDF file
setEventMessages($resaction, null, 'warnings');
}
$action = 'list';
$massaction = '';
}
$parameters['toselect'] = $toselect;
$parameters['uploaddir'] = $uploaddir;
$parameters['massaction'] = $massaction;
$parameters['diroutputmassaction'] = isset($diroutputmassaction) ? $diroutputmassaction : null;
$reshook = $hookmanager->executeHooks('doMassActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}

View File

@ -0,0 +1,61 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
print "Error, template page can't be called as URL";
exit;
}
echo "<!-- BEGIN PHP TEMPLATE -->\n";
global $user;
$langs = $GLOBALS['langs'];
$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
$langs->load("eventorganization");
$total = 0;
foreach ($linkedObjectBlock as $key => $objectlink) {
echo '<tr class="oddeven">';
echo '<td>' . $langs->trans(get_class($objectlink)) . '</td>';
echo '<td>'.$objectlink->getNomUrl(1).'</td>';
echo '<td class="center">';
if (get_class($objectlink)=='ConferenceOrBooth') {
print dol_trunc($objectlink->label, 20);
}
print '</td>';
echo '<td class="center">';
if (get_class($objectlink)=='ConferenceOrBoothAttendee') {
print dol_print_date($objectlink->date_subscription);
} else {
print dol_print_date($objectlink->datep);
}
print '</td>';
echo '<td class="right">';
if (get_class($objectlink)=='ConferenceOrBoothAttendee') {
print price($objectlink->amount);
}
print '</td>';
echo '<td class="right">'.$objectlink->getLibStatut(3).'</td>';
echo '<td class="right"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').'</a></td>';
echo '</tr>';
}
echo "<!-- END PHP TEMPLATE -->\n";

View File

@ -0,0 +1,130 @@
<?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* or see https://www.gnu.org/
*/
// Following var must be set:
// $arrayofselected = array of id selected
// $object
// $objecttmp=new Propal($db);
// $topicmail="SendSupplierProposalRef";
// $modelmail="supplier_proposal_send";
// $trackid='ord'.$object->id;
if ($massaction == 'presend_attendees') {
$langs->load("mails");
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
$attendee = new ConferenceOrBoothAttendee($db);
$listofselectedid = array();
$listofselectedref = array();
if (!GETPOST('cancel', 'alpha')) {
foreach ($arrayofselected as $toselectid) {
$result = $objecttmp->fetch($toselectid);
if ($result > 0) {
$attendees = $attendee->fetchAll('', '', 0, 0, array('t.fk_actioncomm'=>$objecttmp->id));
if (is_array($attendees) && count($attendees)>0) {
foreach ($attendees as $attmail) {
if (!empty($attmail->email)) {
$listofselectedid[$attmail->email] = $attmail->id;
$listofselectedref[$attmail->id][$toselectid] = $objecttmp->ref;
}
}
}
}
}
}
print '<input type="hidden" name="massaction" value="confirm_presend_attendees">';
print '<input type="hidden" name="projectid" value="'.GETPOST('projectid', 'int').'">';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
print dol_get_fiche_head(null, '', '');
// Cree l'objet formulaire mail
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->withform = -1;
$formmail->fromtype = (GETPOST('fromtype') ? GETPOST('fromtype') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user'));
if ($formmail->fromtype === 'user') {
$formmail->fromid = $user->id;
}
$formmail->trackid = $trackid;
if (!empty($conf->global->MAIN_EMAIL_ADD_TRACK_ID) && ($conf->global->MAIN_EMAIL_ADD_TRACK_ID & 2)) { // If bit 2 is set
include DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
$formmail->frommail = dolAddEmailTrackId($formmail->frommail, $trackid);
}
$formmail->withfrom = 1;
$liste = $langs->trans("AllRecipientSelected", count($listofselectedid));
$formmail->withtoreadonly = 1;
$formmail->withoptiononeemailperrecipient = ((count($listofselectedref) == 1 && count(reset($listofselectedref)) == 1) || empty($liste)) ? 0 : ((GETPOST('oneemailperrecipient') == 'on') ? 1 : -1);
$formmail->withto = empty($liste) ? (GETPOST('sendto', 'alpha') ?GETPOST('sendto', 'alpha') : array()) : $liste;
$formmail->withtofree = empty($liste) ? 1 : 0;
$formmail->withtocc = 1;
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
$formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__');
$formmail->withfile = 0;
// $formmail->withfile = 2; Not yet supported in mass action
$formmail->withmaindocfile = 0; // Add a checkbox "Attach also main document"
$formmail->withbody = 1;
$formmail->withdeliveryreceipt = 1;
$formmail->withcancel = 1;
// Make substitution in email content
$substitutionarray = getCommonSubstitutionArray($langs, 0, null, $object);
$substitutionarray['__EMAIL__'] = $sendto;
$substitutionarray['__CHECK_READ__'] = (is_object($object) && is_object($object->thirdparty)) ? '<img src="'.DOL_MAIN_URL_ROOT.'/public/emailing/mailing-read.php?tag='.urlencode($object->thirdparty->tag).'&securitykey='.urlencode($conf->global->MAILING_EMAIL_UNSUBSCRIBE_KEY).'" width="1" height="1" style="width:1px;height:1px" border="0"/>' : '';
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
$substitutionarray['__CONTACTCIVNAME__'] = '';
$parameters = array(
'mode' => 'formemail'
);
complete_substitutions_array($substitutionarray, $langs, $object, $parameters);
// Tableau des substitutions
$formmail->substit = $substitutionarray;
// Tableau des parametres complementaires du post
$formmail->param['action'] = $action;
$formmail->param['models'] = $modelmail;
$formmail->param['models_id'] = empty(GETPOST('modelmailselected', 'int'))?$conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES:GETPOST('modelmailselected', 'int');
$formmail->param['id'] = join(',', $arrayofselected);
// $formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
if (!empty($conf->global->MAILING_LIMIT_SENDBYWEB) && count($listofselectedid) > $conf->global->MAILING_LIMIT_SENDBYWEB) {
$langs->load("errors");
print img_warning().' '.$langs->trans('WarningNumberOfRecipientIsRestrictedInMassAction', $conf->global->MAILING_LIMIT_SENDBYWEB);
print ' - <a href="javascript: window.history.go(-1)">'.$langs->trans("GoBack").'</a>';
$arrayofmassactions = array();
} else {
print $formmail->get_form();
}
print dol_get_fiche_end();
}
// Allow Pre-Mass-Action hook (eg for confirmation dialog)
$parameters = array(
'toselect' => $toselect,
'uploaddir' => isset($uploaddir) ? $uploaddir : null
);

View File

@ -169,7 +169,7 @@ class PaymentExpenseReport extends CommonObject
$sql .= " VALUES ($this->fk_expensereport, '".$this->db->idate($now)."',";
$sql .= " '".$this->db->idate($this->datepaid)."',";
$sql .= " ".price2num($totalamount).",";
$sql .= " ".$this->fk_typepayment.", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".$user->id.",";
$sql .= " ".((int) $this->fk_typepayment).", '".$this->db->escape($this->num_payment)."', '".$this->db->escape($this->note_public)."', ".((int) $user->id).",";
$sql .= " 0)";
dol_syslog(get_class($this)."::create", LOG_DEBUG);

View File

@ -11,6 +11,7 @@
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2021 Josep Lluís Amador <joseplluis@lliuretic.cat>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -460,7 +461,7 @@ class CommandeFournisseur extends CommonOrder
$sql .= " l.vat_src_code, l.tva_tx, l.remise_percent, l.subprice,";
$sql .= " l.localtax1_tx, l. localtax2_tx, l.localtax1_type, l. localtax2_type, l.total_localtax1, l.total_localtax2,";
$sql .= " l.total_ht, l.total_tva, l.total_ttc, l.special_code, l.fk_parent_line, l.rang,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc,";
$sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.description as product_desc, p.tobatch as product_tobatch, p.barcode as product_barcode,";
$sql .= " l.fk_unit,";
$sql .= " l.date_start, l.date_end,";
$sql .= ' l.fk_multicurrency, l.multicurrency_code, l.multicurrency_subprice, l.multicurrency_total_ht, l.multicurrency_total_tva, l.multicurrency_total_ttc';
@ -516,6 +517,8 @@ class CommandeFournisseur extends CommonOrder
$line->libelle = $objp->product_label; // deprecated
$line->product_label = $objp->product_label;
$line->product_desc = $objp->product_desc;
$line->product_tobatch = $objp->product_tobatch;
$line->product_barcode = $objp->product_barcode;
$line->ref = $objp->product_ref; // Ref of product
$line->product_ref = $objp->product_ref; // Ref of product

View File

@ -983,7 +983,9 @@ if (empty($reshook)) {
if ($action == 'commande') {
$methodecommande = GETPOST('methodecommande', 'int');
if ($methodecommande <= 0) {
if ($cancel) {
$action = '';
} elseif ($methodecommande <= 0) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("OrderMode")), null, 'errors');
$action = 'makeorder';
}
@ -1059,36 +1061,43 @@ if (empty($reshook)) {
// Set status of reception (complete, partial, ...)
if ($action == 'livraison' && $usercanreceived) {
$db->begin();
if ($cancel) {
$action = '';
} else {
$db->begin();
if (GETPOST("type") != '') {
$date_liv = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
if (GETPOST("type") != '') {
$date_liv = dol_mktime(GETPOST('rehour'), GETPOST('remin'), GETPOST('resec'), GETPOST("remonth"), GETPOST("reday"), GETPOST("reyear"));
$result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment")); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
if ($result > 0) {
$langs->load("deliveries");
setEventMessages($langs->trans("DeliveryStateSaved"), null);
$action = '';
} elseif ($result == -3) {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
$result = $object->Livraison($user, $date_liv, GETPOST("type"), GETPOST("comment")); // GETPOST("type") is 'tot', 'par', 'nev', 'can'
if ($result > 0) {
$langs->load("deliveries");
setEventMessages($langs->trans("DeliveryStateSaved"), null);
$action = '';
} elseif ($result == -3) {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
}
} else {
$error++;
setEventMessages($object->error, $object->errors, 'errors');
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors');
}
} else {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Delivery")), null, 'errors');
}
if (!$error) {
$db->commit();
} else {
$db->rollback();
if (!$error) {
$db->commit();
} else {
$db->rollback();
}
}
}
if ($action == 'confirm_cancel' && $confirm == 'yes' && $usercanorder) {
if (GETPOST('cancel_note')) {
$object->cancel_note = GETPOST('cancel_note');
}
$result = $object->cancel($user);
if ($result > 0) {
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id);
@ -1889,13 +1898,13 @@ if ($action == 'create') {
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("ApproveThisOrder"), $text, "confirm_".$action, $formquestion, 1, 1, 240);
}
// Confirmation de la desapprobation
// Confirmation of disapproval
if ($action == 'refuse') {
$formquestion = array(
array(
'type' => 'text',
'name' => 'refuse_note',
'label' => $langs->trans("MotifCP"),
'label' => $langs->trans("Reason"),
'value' => '',
'morecss' => 'minwidth300'
)
@ -1903,9 +1912,18 @@ if ($action == 'create') {
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("DenyingThisOrder"), $langs->trans("ConfirmDenyingThisOrder", $object->ref), "confirm_refuse", $formquestion, 0, 1);
}
// Confirmation de l'annulation
// Confirmation of cancellation
if ($action == 'cancel') {
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("Cancel"), $langs->trans("ConfirmCancelThisOrder", $object->ref), "confirm_cancel", '', 0, 1);
$formquestion = array(
array(
'type' => 'text',
'name' => 'cancel_note',
'label' => $langs->trans("Reason"),
'value' => '',
'morecss' => 'minwidth300'
)
);
$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id", $langs->trans("Cancel"), $langs->trans("ConfirmCancelThisOrder", $object->ref), "confirm_cancel", $formquestion, 0, 1);
}
// Confirmation de l'envoi de la commande
@ -2640,7 +2658,11 @@ if ($action == 'create') {
print '</td></tr>';
print '<tr><td>'.$langs->trans("Comment").'</td><td><input size="40" type="text" name="comment"></td></tr>';
print '<tr><td class="center" colspan="2"><input type="submit" class="button" value="'.$langs->trans("Receive").'"></td></tr>';
print '<tr><td class="center" colspan="2">';
print '<input type="submit" name="receive" class="button" value="'.$langs->trans("Receive").'">';
print ' &nbsp; &nbsp; ';
print '<input type="submit" name="cancel" class="button button-cancel" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
print "</table>\n";
print "</form>\n";
print "<br>";

View File

@ -70,7 +70,9 @@ function addDispatchLine(index, type, mode)
mode = mode || 'qtymissing'
console.log("fourn/js/lib_dispatch.js.php Split line type="+type+" index="+index+" mode="+mode);
var $row = $("tr[name='"+type+'_0_'+index+"']").clone(true); // clone first batch line to jQuery object
var $row0 = $("tr[name='"+type+'_0_'+index+"']");
var $dpopt = $row0.find('.hasDatepicker').first().datepicker('option', 'all'); // get current datepicker options to apply the same to the cloned datepickers
var $row = $row0.clone(true); // clone first batch line to jQuery object
var nbrTrs = $("tr[name^='"+type+"_'][name$='_"+index+"']").length; // position of line for batch
var qtyOrdered = parseFloat($("#qty_ordered_0_"+index).val()); // Qty ordered is same for all rows
var qty = parseFloat($("#qty_"+(nbrTrs - 1)+"_"+index).val());
@ -96,6 +98,18 @@ function addDispatchLine(index, type, mode)
} else if (qtyDispatched < qtyOrdered) {
//replace tr suffix nbr
$row.html($row.html().replace(/_0_/g,"_"+nbrTrs+"_"));
// jquery's deep clone is incompatible with date pickers (the clone shares data with the original)
// so we destroy and rebuild the new date pickers
setTimeout(() => {
$row.find('.hasDatepicker').each((i, dp) => {
$(dp).removeData()
.removeClass('hasDatepicker');
$(dp).next('img.ui-datepicker-trigger').remove();
$(dp).datepicker($dpopt);
});
}, 0);
//create new select2 to avoid duplicate id of cloned one
$row.find("select[name='"+'entrepot_'+nbrTrs+'_'+index+"']").select2();
// TODO find solution to copy selected option to new select

View File

@ -1296,11 +1296,11 @@ class Holiday extends CommonObject
*
* @param int $selected Id of preselected status
* @param string $htmlname Name of HTML select field
* @param string $morecss More CSS on select component
* @return string Show select of status
*/
public function selectStatutCP($selected = '', $htmlname = 'select_statut')
public function selectStatutCP($selected = '', $htmlname = 'select_statut', $morecss = 'minwidth125')
{
global $langs;
// Liste des statuts
@ -1308,7 +1308,7 @@ class Holiday extends CommonObject
$nb = count($name) + 1;
// Select HTML
$out = '<select name="'.$htmlname.'" id="'.$htmlname.'" class="flat">'."\n";
$out = '<select name="'.$htmlname.'" id="'.$htmlname.'" class="flat'.($morecss ? ' '.$morecss : '').'">'."\n";
$out .= '<option value="-1">&nbsp;</option>'."\n";
// Boucle des statuts

View File

@ -636,7 +636,7 @@ if ($resql) {
// Create date
if (!empty($arrayfields['cp.date_create']['checked'])) {
print '<td class="liste_titre center nowraponall">';
print '<td class="liste_titre center width200">';
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month_create" value="'.dol_escape_htmltag($search_month_create).'">';
$formother->select_year($search_year_create, 'search_year_create', 1, $min_year, 0);
print '</td>';
@ -644,7 +644,7 @@ if ($resql) {
// Create date
if (!empty($arrayfields['cp.tms']['checked'])) {
print '<td class="liste_titre center nowraponall">';
print '<td class="liste_titre center width200">';
print '<input class="flat valignmiddle maxwidth25" type="text" maxlength="2" name="search_month_update" value="'.dol_escape_htmltag($search_month_update).'">';
$formother->select_year($search_year_update, 'search_year_update', 1, $min_year, 0);
print '</td>';
@ -652,8 +652,8 @@ if ($resql) {
// Status
if (!empty($arrayfields['cp.statut']['checked'])) {
print '<td class="liste_titre maxwidthonsmartphone maxwidth200 right">';
$object->selectStatutCP($search_status, 'search_status');
print '<td class="liste_titre right">';
$object->selectStatutCP($search_status, 'search_status', 'minwidth125');
print '</td>';
}
@ -781,7 +781,7 @@ if ($resql) {
}
}
if (!empty($arrayfields['cp.fk_type']['checked'])) {
print '<td>';
print '<td class="minwidth100">';
$labeltypeleavetoshow = ($langs->trans($typeleaves[$obj->fk_type]['code']) != $typeleaves[$obj->fk_type]['code'] ? $langs->trans($typeleaves[$obj->fk_type]['code']) : $typeleaves[$obj->fk_type]['label']);
print empty($typeleaves[$obj->fk_type]['label']) ? $langs->trans("TypeWasDisabledOrRemoved", $obj->fk_type) : $labeltypeleavetoshow;
print '</td>';

View File

@ -102,13 +102,13 @@ if ($attachment) {
// List of targets fields
$headerlinefields = array();
$contentlinevalues = array();
$headerlinefields = array(); // Array of fields (label to show)
$contentlinevalues = array(); // Array of example values
$i = 0;
foreach ($fieldstarget as $code => $label) {
$withoutstar = preg_replace('/\*/', '', $fieldstarget[$code]);
$headerlinefields[] = $langs->transnoentities($withoutstar).($withoutstar != $fieldstarget[$code] ? '*' : '').' ('.$code.')';
$contentlinevalues[] = $valuestarget[$code];
$contentlinevalues[] = (isset($valuestarget[$code]) ? $valuestarget[$code] : '');
}
//var_dump($headerlinefields);
//var_dump($contentlinevalues);

View File

@ -100,7 +100,7 @@ print "<br>\n";
// Check PHP support for $_GET and $_POST
if (!isset($_GET["testget"]) && !isset($_POST["testpost"])) { // We must keep $_GET and $_POST here
print '<img src="../theme/eldy/img/warning.png" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo");
print ' (<a href="'.$_SERVER["PHP_SELF"].'?testget=ok">'.$langs->trans("Recheck").'</a>)';
print ' (<a href="'.dol_escape_htmltag($_SERVER["PHP_SELF"]).'?testget=ok">'.$langs->trans("Recheck").'</a>)';
print "<br>\n";
$checksok = 0;
} else {

View File

@ -415,3 +415,6 @@ a.button:hover {
vertical-align: text-bottom;
}
.text-security {
-webkit-text-security: disc;
}

View File

@ -476,13 +476,13 @@ if (!empty($force_install_noedit)) {
<tr class="hidesqlite">
<td class="label"><label for="db_pass"><b><?php echo $langs->trans("Password"); ?></b></label></td>
<td class="label">
<input type="password"
<input type="password" class="text-security";
id="db_pass" autocomplete="off"
name="db_pass"
value="<?php
// If $force_install_databasepass is on, we don't want to set password, we just show '***'. Real value will be extracted from the forced install file at step1.
$autofill = ((!empty($_SESSION['dol_save_pass'])) ? $_SESSION['dol_save_pass'] : str_pad('', strlen($force_install_databasepass), '*'));
if (!empty($dolibarr_main_prod)) {
if (!empty($dolibarr_main_prod) && empty($_SESSION['dol_save_pass'])) { // So value can't be found if install page still accessible
$autofill = '';
}
print dol_escape_htmltag($autofill);
@ -532,7 +532,7 @@ if (!empty($force_install_noedit)) {
id="db_user_root"
name="db_user_root"
class="needroot"
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : @$db_user_root; ?>"
value="<?php print (!empty($force_install_databaserootlogin)) ? $force_install_databaserootlogin : (isset($db_user_root) ? $db_user_root : ''); ?>"
<?php if ($force_install_noedit > 0 && !empty($force_install_databaserootlogin)) {
print ' disabled';
} ?>
@ -556,10 +556,10 @@ if (!empty($force_install_noedit)) {
autocomplete="off"
id="db_pass_root"
name="db_pass_root"
class="needroot"
class="needroot text-security"
value="<?php
// If $force_install_databaserootpass is on, we don't want to set password here, we just show '***'. Real value will be extracted from the forced install file at step1.
$autofill = ((!empty($force_install_databaserootpass)) ? str_pad('', strlen($force_install_databaserootpass), '*') : @$db_pass_root);
$autofill = ((!empty($force_install_databaserootpass)) ? str_pad('', strlen($force_install_databaserootpass), '*') : (isset($db_pass_root) ? $db_pass_root : ''));
if (!empty($dolibarr_main_prod)) {
$autofill = '';
}

View File

@ -57,19 +57,19 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (25
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (26,'SA','SAU','Saudi Arabia',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (27,'MC','MCO','Monaco',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (28,'AU','AUS','Australia',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (29,'SG','SGP','Singapour',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (29,'SG','SGP','Singapore',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (30,'AF','AFG','Afghanistan',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (31,'AX','ALA','Iles Aland',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (31,'AX','ALA','Åland Island',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (32,'AL','ALB','Albania',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (33,'AS','ASM','Samoa américaines',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (33,'AS','ASM','American Samoa',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (34,'AD','AND','Andorra',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (35,'AO','AGO','Angola',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (36,'AI','AIA','Anguilla',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (37,'AQ','ATA','Antarctique',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (38,'AG','ATG','Antigua-et-Barbuda',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (37,'AQ','ATA','Antarctica',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (38,'AG','ATG','Antigua and Barbuda',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (39,'AM','ARM','Armenia',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (41,'AT','AUT','Austria',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (42,'AZ','AZE','Azerbaïdjan',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (42,'AZ','AZE','Azerbaijan',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (43,'BS','BHS','Bahamas',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (44,'BH','BHR','Bahreïn',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (45,'BD','BGD','Bangladesh',1,0);

View File

@ -766,16 +766,16 @@ INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc
-- Panama - 10 Provinces (id country=178)
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-1', 17801, '', 0, '', 'Bocas del Toro');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-2', 17801, '', 0, '', 'Coclé');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-3', 17801, '', 0, '', 'Colón');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-4', 17801, '', 0, '', 'Chiriquí');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-5', 17801, '', 0, '', 'Darién');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-6', 17801, '', 0, '', 'Herrera');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-7', 17801, '', 0, '', 'Los Santos');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-8', 17801, '', 0, '', 'Panamá');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-9', 17801, '', 0, '', 'Veraguas');
INSERT INTO llx_c_departements (code_departement, fk_region, cheflieu, tncc, ncc, nom) VALUES ('PA-13', 17801, '', 0, '', 'Panamá Oeste');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-1', '', 0, '', 'Bocas del Toro');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-2', '', 0, '', 'Coclé');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-3', '', 0, '', 'Colón');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-4', '', 0, '', 'Chiriquí');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-5', '', 0, '', 'Darién');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-6', '', 0, '', 'Herrera');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-7', '', 0, '', 'Los Santos');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-8', '', 0, '', 'Panamá');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-9', '', 0, '', 'Veraguas');
INSERT INTO llx_c_departements (fk_region, code_departement, cheflieu, tncc, ncc, nom) VALUES (17801, 'PA-13', '', 0, '', 'Panamá Oeste');
-- Provinces Peru (id country=181)

View File

@ -67,6 +67,7 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SUBMIT','Supplier order request submited','Executed when a supplier order is approved','order_supplier',13);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_RECEIVE','Supplier order request received','Executed when a supplier order is received','order_supplier',13);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_REFUSE','Supplier order request refused','Executed when a supplier order is refused','order_supplier',13);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_SENTBYMAIL','Supplier order sent by mail','Executed when a supplier order is sent by mail','order_supplier',14);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_CLASSIFY_BILLED','Supplier order set billed','Executed when a supplier order is set as billed','order_supplier',14);
insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('ORDER_SUPPLIER_DELETE','Supplier order deleted','Executed when a supplier order is deleted','order_supplier',14);

View File

@ -35,9 +35,9 @@ INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private,
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, enabled, active, topic, content, content_lines, joinfiles) VALUES (0,'recruitment','recruitmentcandidature_send','',0,null,null,'(AnswerCandidature)' ,100,'$conf->recruitment->enabled',1,'[__[MAIN_INFO_SOCIETE_NOM]__] __(YourCandidature)__', '__(Hello)__ __CANDIDATE_FULLNAME__,<br><br>\n\n__(YourCandidatureAnswerMessage)__<br>__ONLINE_INTERVIEW_SCHEDULER_TEXT_AND_URL__\n<br><br>\n__(Sincerely)__<br>__USER_SIGNATURE__',null, 0);
-- Event organization
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailAskConf', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailAskBooth', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailSubsBooth', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationEmailSubsEvent', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__(Sincerely)__<br /><br />__MYCOMPANY_NAME__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationMassEmailAttendees', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, 'EventOrganizationMassEmailSpeakers', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskConf)', 10, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskConf)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventConfRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailAskBooth)', 20, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailAskBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothRequestWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsBooth)', 30, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsBooth)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBoothSubscriptionWasReceived)__<br /><br />__ONLINE_PAYMENT_TEXT_AND_URL__<br /><br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationEmailSubsEvent)', 40, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationEmailSubsEvent)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventEventSubscriptionWasReceived)__<br /><br />__(Sincerely)__<br /><br />__MYCOMPANY_NAME__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailAttendees)', 50, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailAttendees)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToAttendees)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);
INSERT INTO llx_c_email_templates (entity, module, type_template, lang, private, fk_user, datec, label, position, active, topic, content, content_lines, enabled, joinfiles) values (0, '', 'conferenceorbooth', '', 0, null, null, '(EventOrganizationMassEmailSpeakers)', 60, 1, '[__[MAIN_INFO_SOCIETE_NOM]__] __(EventOrganizationMassEmailSpeakers)__', '__(Hello)__ __THIRDPARTY_NAME__,<br /><br />__(ThisIsContentOfYourOrganizationEventBulkMailToSpeakers)__<br /><br />__(Sincerely)__<br />__USER_SIGNATURE__', null, '1', null);

View File

@ -33,8 +33,6 @@
-- Missing in v14 or lower
-- v15
CREATE TABLE llx_categorie_ticket
@ -50,3 +48,8 @@ ALTER TABLE llx_categorie_ticket ADD INDEX idx_categorie_ticket_fk_ticket (fk_ti
ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_ticket ADD CONSTRAINT fk_categorie_ticket_ticket_rowid FOREIGN KEY (fk_ticket) REFERENCES llx_ticket (rowid);
ALTER TABLE llx_product_fournisseur_price MODIFY COLUMN ref_fourn varchar(128);
ALTER TABLE llx_product_customer_price MODIFY COLUMN ref_customer varchar(128);
-- -- add action trigger
INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('ORDER_SUPPLIER_CANCEL','Supplier order request canceled','Executed when a supplier order is canceled','order_supplier',13);

View File

@ -48,6 +48,7 @@ create table llx_adherent
state_id integer,
country integer,
email varchar(255),
url varchar(255) NULL,
socialnetworks text DEFAULT NULL, -- json with socialnetworks
skype varchar(255), -- deprecated

View File

@ -28,7 +28,7 @@ create table llx_product_customer_price
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer NOT NULL,
fk_soc integer NOT NULL,
ref_customer varchar(30),
ref_customer varchar(128),
price double(24,8) DEFAULT 0,
price_ttc double(24,8) DEFAULT 0,
price_min double(24,8) DEFAULT 0,

View File

@ -27,7 +27,7 @@ create table llx_product_fournisseur_price
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
fk_product integer,
fk_soc integer,
ref_fourn varchar(30),
ref_fourn varchar(128),
desc_fourn text,
fk_availability integer,
price double(24,8) DEFAULT 0, -- price without tax for quantity

View File

@ -2150,4 +2150,5 @@ RandomlySelectedIfSeveral=Randomly selected if several pictures are available
DatabasePasswordObfuscated=Database password is obfuscated in conf file
DatabasePasswordNotObfuscated=Database password is NOT obfuscated in conf file
APIsAreNotEnabled=APIs modules are not enabled
YouShouldSetThisToOff=You should set this to 0 or off
YouShouldSetThisToOff=You should set this to 0 or off
InstallAndUpgradeLockedBy=Install and upgrades are locked by the file <b>%s</b>

View File

@ -119,6 +119,8 @@ EventType = Event type
LabelOfBooth=Booth label
LabelOfconference=Conference label
ConferenceIsNotConfirmed=Subcription not available, conference is not confirmed yet
DateMustBeBeforeThan=%s must be before %s
DateMustBeAfterThan=%s must be after %s
#
# Vote page

View File

@ -1148,3 +1148,4 @@ RecordsDisabled=%s record(s) disabled
RecordEnabled=Record enabled
RecordDisabled=Record disabled
Forthcoming=Forthcoming
Currently=Currently

View File

@ -255,4 +255,9 @@ MakeMovementsAndClose=Generate movements and close
AutofillWithExpected=Fill real quantity with expected quantity
ShowAllBatchByDefault=By default, show batch details on product "stock" tab
CollapseBatchDetailHelp=You can set batch detail default display in stocks module configuration
FieldCannotBeNegative=Field "%s" cannot be negative
FieldCannotBeNegative=Field "%s" cannot be negative
ErrorWrongBarcodemode=Unknown Barcode mode
ProductDoesNotExist=Product does not exist
ErrorSameBatchNumber=Same batch number found in inventory list
ProductBatchDoesNotExist=Product with batch/serial does not exist
ProductBarcodeDoesNotExist=Product with barcode does not exist

View File

@ -66,7 +66,7 @@ NeedMoreInformation=Waiting for reporter feedback
NeedMoreInformationShort=Waiting for feedback
Answered=Answered
Waiting=Waiting
Closed=Closed
SolvedClosed=Solved
Deleted=Deleted
# Dict
@ -186,9 +186,11 @@ TicketSeverity=Severity
ShowTicket=See ticket
RelatedTickets=Related tickets
TicketAddIntervention=Create intervention
CloseTicket=Close ticket
CloseATicket=Close a ticket
CloseTicket=Close|Solve ticket
AbandonTicket=Abandon ticket
CloseATicket=Close|Solve a ticket
ConfirmCloseAticket=Confirm ticket closing
ConfirmAbandonTicket=Do you confirm the closing of the ticket to status 'Abandonned'
ConfirmDeleteTicket=Please confirm ticket deleting
TicketDeletedSuccess=Ticket deleted with success
TicketMarkedAsClosed=Ticket marked as closed

View File

@ -40,8 +40,8 @@ EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF = Modèle de courriel à envoyer aprè
EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH = Modèle de courriel à envoyer après avoir reçu une suggestion d'un stand.
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Modèle de courriel à envoyer après paiement d'une inscription à un stand.
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Modèle de courriel à envoyer après paiement d'une inscription à un événement.
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Modèle de courriel pour action de masse aux participants
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Modèle de courriel pour action de masse aux intervenants
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Modèle de courriel pour action de masse aux intervenants
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Modèle de courriel pour action de masse aux participants
EVENTORGANIZATION_FILTERATTENDEES_CAT = Filtrer la liste de sélection des tiers dans la fiche/le formulaire de création des participants avec/selon la catégorie
EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filtrer la liste de sélection des tiers dans la fiche/le formulaire de création des participants avec le type de client

View File

@ -80,7 +80,7 @@ function realCharForNumericEntities($matches)
* Warning: Such a protection can't be enough. It is not reliable as it will always be possible to bypass this. Good protection can
* only be guaranted by escaping data during output.
*
* @param string $val Value brut found int $_GET, $_POST or PHP_SELF
* @param string $val Brut value found into $_GET, $_POST or PHP_SELF
* @param string $type 0=POST, 1=GET, 2=PHP_SELF, 3=GET without sql reserved keywords (the less tolerant test)
* @return int >0 if there is an injection, 0 if none
*/
@ -460,11 +460,15 @@ if (!defined('NOTOKENRENEWAL')) {
if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)) || defined('CSRFCHECK_WITH_TOKEN')) {
// Array of action code where CSRFCHECK with token will be forced (so token must be provided on url request)
$arrayofactiontoforcetokencheck = array(
'activate', 'add', 'addtimespent', 'update', 'install',
'confirm_create_user', 'confirm_create_thirdparty', 'confirm_purge', 'confirm_reject_check',
'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'disable',
'activate', 'add', 'addrights', 'addtimespent',
'confirm_create_user', 'confirm_create_thirdparty', 'confirm_delete', 'confirm_deletedir', 'confirm_deletefile', 'confirm_purge', 'confirm_reject_check',
'delete', 'deletefilter', 'deleteoperation', 'deleteprof', 'deletepayment', 'delrights',
'disable',
'doprev', 'donext', 'dvprev', 'dvnext',
'enable', 'setpricelevel'
'enable',
'install',
'setpricelevel',
'update'
);
$sensitiveget = false;
if (in_array(GETPOST('action', 'aZ09'), $arrayofactiontoforcetokencheck)) {

View File

@ -327,22 +327,21 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec
$sql .= $hookmanager->resPrint;
/* If a group by is required
$sql.= " GROUP BY ";
foreach($object->fields as $key => $val)
{
$sql.='t.'.$key.', ';
$sql .= " GROUP BY ";
foreach($object->fields as $key => $val) {
$sql .= 't.'.$key.', ';
}
// 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) {
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
}
}
// Add where from hooks
$parameters=array();
$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql.=$hookmanager->resPrint;
$sql=preg_replace('/,\s*$/','', $sql);
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;
$sql = preg_replace('/,\s*$/', '', $sql);
*/
$sql .= $db->order($sortfield, $sortorder);

View File

@ -295,13 +295,14 @@ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
print load_fiche_titre($langs->trans("ProductCodeChecker"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'."\n";
print '<tr class="liste_titre">'."\n";
print ' <td>'.$langs->trans("Name").'</td>';
print ' <td>'.$langs->trans("Description").'</td>';
print ' <td>'.$langs->trans("Example").'</td>';
print ' <td class="center" width="80">'.$langs->trans("Status").'</td>';
print ' <td class="center" width="60">'.$langs->trans("ShortInfo").'</td>';
print ' <td class="center"></td>';
print "</tr>\n";
foreach ($dirproduct as $dirroot) {
@ -333,7 +334,7 @@ foreach ($dirproduct as $dirroot) {
print '<tr class="oddeven">'."\n";
print '<td width="140">'.$modCodeProduct->name.'</td>'."\n";
print '<td>'.$modCodeProduct->info($langs).'</td>'."\n";
print '<td class="nowrap">'.$modCodeProduct->getExample($langs).'</td>'."\n";
print '<td class="nowrap"><span class="opacitymedium">'.$modCodeProduct->getExample($langs).'</span></td>'."\n";
if (!empty($conf->global->PRODUCT_CODEPRODUCT_ADDON) && $conf->global->PRODUCT_CODEPRODUCT_ADDON == $file) {
print '<td class="center">'."\n";
@ -366,6 +367,7 @@ foreach ($dirproduct as $dirroot) {
}
}
print '</table>';
print '</div>';
// Module to build doc
$def = array();
@ -390,13 +392,14 @@ print '<br>';
print load_fiche_titre($langs->trans("ProductDocumentTemplates"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>';
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
print '<td class="center" width="80">'.$langs->trans("ShortInfo").'</td>';
print '<td class="center"></td>';
print '<td class="center" width="80">'.$langs->trans("Preview").'</td>';
print "</tr>\n";
@ -499,6 +502,8 @@ foreach ($dirmodels as $reldir) {
}
print '</table>';
print '</div>';
print "<br>";
/*
@ -517,6 +522,7 @@ print '<input type="hidden" name="page_y" value="">';
print load_fiche_titre($langs->trans("ProductOtherConf"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
@ -611,6 +617,7 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
}
print '</table>';
print '</div>';
print '<div class="center">';
print '<input type="submit" class="button reposition" value="'.$langs->trans("Modify").'">';
@ -620,6 +627,7 @@ print '</div>';
print load_fiche_titre($langs->trans("UserInterface"), '', '');
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Parameters").'</td>'."\n";
@ -671,7 +679,7 @@ print $form->selectarray(
0,
0,
'',
'maxwidth400',
'minwidth100imp maxwidth400',
1
);
print '</td>';
@ -772,6 +780,7 @@ if (!empty($conf->global->PRODUCT_CANVAS_ABILITY)) {
}
print '</table>';
print '</div>';
print '<div class="center">';
print '<input type="submit" class="button reposition" value="'.$langs->trans("Modify").'">';

View File

@ -51,6 +51,9 @@ if (!empty($user->socid)) {
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productcompositioncard', 'globalcard'));
$object = new Product($db);
$objectid = 0;
if ($id > 0 || !empty($ref)) {

View File

@ -449,7 +449,7 @@ if ($object->id > 0) {
print dol_get_fiche_end();
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<form name="formrecord" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="token" value="'.newToken().'">';
print '<input type="hidden" name="action" value="updateinventorylines">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
@ -537,11 +537,116 @@ if ($object->id > 0) {
// Popup for mass barcode scanning
if ($action == 'updatebyscaning') {
if ($permissiontoadd) {
print '<script>';
print 'function barcodescannerjs(){
console.log("We catch inputs in sacnner box");
var barcodemode = $("input[name=barcodemode]:checked").val();
var barcodeproductqty = $("input[name=barcodeproductqty]").val();
var textarea = $("textarea[name=barcodelist]").val();
var textarray = textarea.split("\n");
if(textarray[0] != ""){
var tabproduct = [];
$(".expectedqty").each(function(){
id = this.id;
warehouse = $("#"+id+"_warehouse").children().first().text();
productbarcode = $("#"+id+"_product").children().first().attr("title");
productbarcode = productbarcode.split("<br>");
productbarcode = productbarcode.filter(barcode => barcode.includes("'.$langs->trans('BarCode').'"))[0];
productbarcode = productbarcode.slice(productbarcode.indexOf("</b> ")+5);
productbatchcode = $("#"+id+"_batch").text();
if(barcodemode != "barcodeforproduct"){
tabproduct.forEach(product=>{
if(product.Batch == productbatchcode){
alert("'.$langs->trans('ErrorSameBatchNumber').': "+productbatchcode);
throw"'.$langs->trans('ErrorSameBatchNumber').': "+productbatchcode;
}
})
}
tabproduct.push({\'Id\':id,\'Warehouse\':warehouse,\'Barcode\':productbarcode,\'Batch\':productbatchcode,\'Qty\':0});
})
switch(barcodemode){
case "barcodeforautodetect":
textarray.forEach(function(element,index){
console.log("Product autodetect "+(index+=1)+": "+element);
BatchCodeDoesNotExist=0;
tabproduct.forEach(product => {
if(product.Batch == element || product.Barcode == element){
product.Qty+=1;
}else{
BatchCodeDoesNotExist+=1;
}
})
if(BatchCodeDoesNotExist >= tabproduct.length){
alert("'.$langs->trans('ProductDoesNotExist').': "+element);
}
})
break;
case "barcodeforproduct":
textarray.forEach(function(element,index){
console.log("Product "+(index+=1)+": "+element);
BarCodeDoesNotExist=0;
tabproduct.forEach(product => {
if(product.Barcode == element){
product.Qty+=1;
}else{
BarCodeDoesNotExist+=1;
}
})
if(BarCodeDoesNotExist >= tabproduct.length){
alert("'.$langs->trans('ProductBarcodeDoesNotExist').': "+element);
}
})
break;
case "barcodeforlotserial":
textarray.forEach(function(element,index){
console.log("Product batch/serial "+(index+=1)+": "+element);
BatchCodeDoesNotExist=0;
tabproduct.forEach(product => {
if(product.Batch == element){
product.Qty+=1;
}else{
BatchCodeDoesNotExist+=1;
}
})
if(BatchCodeDoesNotExist >= tabproduct.length){
alert("'.$langs->trans('ProductBatchDoesNotExist').': "+element);
}
})
break;
default:
alert("'.$langs->trans("ErrorWrongBarcodemode").' \""+barcodemode+"\"");
throw"'.$langs->trans('ErrorWrongBarcodemode').' \""+barcodemode+"\"";
}
tabproduct.forEach(product => {
if(product.Qty!=0){
console.log("We change #"+product.Id+"_input to match input in scanner box");
$("#"+product.Id+"_input").val(product.Qty*barcodeproductqty);
}
})
document.forms["formrecord"].submit();
}
}';
print '</script>';
}
include DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$formother = new FormOther($db);
print $formother->getHTMLScannerForm();
}
//Call method to undo changes in real qty
print '<script>';
print 'jQuery(document).ready(function() {
$(".undochangesqty").on("click",function undochangesqty(){
id = this.id;
id = id.split("_")[1];
tmpvalue = $("#id_"+id+"_input_tmp").val()
$("#id_"+id+"_input")[0].value = tmpvalue;
document.forms["formrecord"].submit();
});
});';
print '</script>';
print '<div class="fichecenter">';
//print '<div class="fichehalfleft">';
@ -639,15 +744,15 @@ if ($object->id > 0) {
}
print '<tr class="oddeven">';
print '<td>';
print '<td id="id_'.$obj->rowid.'_warehouse">';
print $warehouse_static->getNomUrl(1);
print '</td>';
print '<td>';
print '<td id="id_'.$obj->rowid.'_product">';
print $product_static->getNomUrl(1);
print '</td>';
if ($conf->productbatch->enabled) {
print '<td>';
print '<td id="id_'.$obj->rowid.'_batch">';
print $obj->batch;
print '</td>';
}
@ -665,8 +770,11 @@ if ($object->id > 0) {
print '<input type="text" class="maxwidth75 right realqty" name="id_'.$obj->rowid.'" id="id_'.$obj->rowid.'_input" value="'.$qty_view.'">';
print '</td>';
print '<td class="right">';
print '<a id="undochangesqty_'.$obj->rowid.'" href="#" class="undochangesqty"><span class="fas fa-undo pictoundo" ></span></a> &nbsp';
print '<a class="reposition" href="'.DOL_URL_ROOT.'/product/inventory/inventory.php?id='.$object->id.'&lineid='.$obj->rowid.'&action=deleteline&token='.newToken().'">'.img_delete().'</a>';
print '</td>';
$qty_tmp = price2num(GETPOST("id_".$obj->rowid."_input_tmp", 'MS')) >= 0 ? GETPOST("id_".$obj->rowid."_input_tmp") : $qty_view;
print '<input type="hidden" class="maxwidth75 right realqty" name="id_'.$obj->rowid.'_input_tmp" id="id_'.$obj->rowid.'_input_tmp" value="'.$qty_tmp.'">';
} else {
print $obj->qty_view;
$totalfound += $obj->qty_view;
@ -685,7 +793,7 @@ if ($object->id > 0) {
print '</div>';
if ($object->status == $object::STATUS_VALIDATED) {
print '<center><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'"></center>';
print '<center><input id="submitrecord" type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'"></center>';
}
print '</div>';

View File

@ -1108,34 +1108,41 @@ print dol_get_fiche_end();
/*
* Action bar
*/
if (!$action || $action == 'delete' || $action == 'showlog_customer_price' || $action == 'showlog_default_price' || $action == 'add_customer_price'
|| $action == 'activate_price_by_qty' || $action == 'disable_price_by_qty') {
print "\n".'<div class="tabsAction">'."\n";
if ($object->isVariant()) {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoEditVariants")).'">'.$langs->trans("UpdateDefaultPrice").'</a></div>';
}
} else {
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit_price&amp;id='.$object->id.'">'.$langs->trans("UpdateDefaultPrice").'</a></div>';
}
}
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
if (empty($reshook)) {
if ($object->isVariant()) {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=add_customer_price&amp;id='.$object->id.'">'.$langs->trans("AddCustomerPrice").'</a></div>';
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="' . dol_escape_htmltag($langs->trans("NoEditVariants")) . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>';
}
}
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit_vat&amp;id='.$object->id.'">'.$langs->trans("UpdateVAT").'</a></div>';
} else {
if (empty($conf->global->PRODUIT_MULTIPRICES) && empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_price&amp;id=' . $object->id . '">' . $langs->trans("UpdateDefaultPrice") . '</a></div>';
}
}
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit_price&amp;id='.$object->id.'">'.$langs->trans("UpdateLevelPrices").'</a></div>';
if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER["PHP_SELF"] . '?action=add_customer_price&amp;id=' . $object->id . '">' . $langs->trans("AddCustomerPrice") . '</a></div>';
}
}
if (!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES)) {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_vat&amp;id=' . $object->id . '">' . $langs->trans("UpdateVAT") . '</a></div>';
}
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<div class="inline-block divButAction"><a class="butAction" href="' . $_SERVER['PHP_SELF'] . '?action=edit_price&amp;id=' . $object->id . '">' . $langs->trans("UpdateLevelPrices") . '</a></div>';
}
}
}
}

View File

@ -59,6 +59,9 @@ if (!empty($user->socid)) {
$fieldvalue = (!empty($id) ? $id : $ref);
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatscard', 'globalcard'));
$tmp = dol_getdate(dol_now());
$currentyear = $tmp['year'];
if (empty($search_year)) {

View File

@ -402,7 +402,7 @@ class Productlot extends CommonObject
$sql .= ' sellby = '.(!isset($this->sellby) || dol_strlen($this->sellby) != 0 ? "'".$this->db->idate($this->sellby)."'" : 'null').',';
$sql .= ' eol_date = '.(!isset($this->eol_date) || dol_strlen($this->eol_date) != 0 ? "'".$this->db->idate($this->eol_date)."'" : 'null').',';
$sql .= ' manufacturing_date = '.(!isset($this->manufacturing_date) || dol_strlen($this->manufacturing_date) != 0 ? "'".$this->db->idate($this->manufacturing_date)."'" : 'null').',';
$sql .= ' scrapping_date = '.(!isset($this->destruction_date) || dol_strlen($this->destruction_date) != 0 ? "'".$this->db->idate($this->destruction_date)."'" : 'null').',';
$sql .= ' scrapping_date = '.(!isset($this->scrapping_date) || dol_strlen($this->scrapping_date) != 0 ? "'".$this->db->idate($this->scrapping_date)."'" : 'null').',';
//$sql .= ' commissionning_date = '.(!isset($this->first_use_date) || dol_strlen($this->first_use_date) != 0 ? "'".$this->db->idate($this->first_use_date)."'" : 'null').',';
//$sql .= ' qc_frequency = '.(!isset($this->qc_frequency) || dol_strlen($this->qc_frequency) != 0 ? "'".$this->db->escape($this->qc_frequency)."'" : 'null').',';
$sql .= ' datec = '.(!isset($this->datec) || dol_strlen($this->datec) != 0 ? "'".$this->db->idate($this->datec)."'" : 'null').',';

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2018-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -299,7 +299,7 @@ if (is_numeric($nbtotalofrecords) && ($limit > $nbtotalofrecords || empty($limit
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id);
header("Location: ".DOL_URL_ROOT.'/product/stock/productlot_card.php?id='.$id);
exit;
}

View File

@ -62,98 +62,108 @@ if ($object->id > 0) {
restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('producttranslationcard', 'globalcard'));
/*
* Actions
*/
// retour a l'affichage des traduction si annulation
if ($cancel == $langs->trans("Cancel")) {
$action = '';
$parameters = array('id'=>$id, 'ref'=>$ref);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
}
if ($action == 'delete' && GETPOST('langtodelete', 'alpha')) {
$object = new Product($db);
$object->fetch($id);
$object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
$action = '';
}
// Add translation
if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
$object = new Product($db);
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
// update de l'objet
if (GETPOST("forcelangprod") == $current_lang) {
$object->label = GETPOST("libelle");
$object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
$object->update($object->id, $user);
} else {
$object->multilangs[GETPOST("forcelangprod")]["label"] = GETPOST("libelle");
$object->multilangs[GETPOST("forcelangprod")]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
$object->multilangs[GETPOST("forcelangprod")]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
}
// save in database
if (GETPOST("forcelangprod")) {
$result = $object->setMultiLangs($user);
} else {
$object->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Language"));
$result = -1;
}
if ($result > 0) {
if (empty($reshook)) {
// retour a l'affichage des traduction si annulation
if ($cancel == $langs->trans("Cancel")) {
$action = '';
} else {
$action = 'add';
setEventMessages($object->error, $object->errors, 'errors');
}
}
// Edit translation
if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
$object = new Product($db);
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
if ($action == 'delete' && GETPOST('langtodelete', 'alpha')) {
$object = new Product($db);
$object->fetch($id);
$object->delMultiLangs(GETPOST('langtodelete', 'alpha'), $user);
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
$action = '';
}
foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet
if ($key == $current_lang) {
$object->label = GETPOST("libelle-".$key);
$object->description = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
$object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
// Add translation
if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
$object = new Product($db);
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
// update de l'objet
if (GETPOST("forcelangprod") == $current_lang) {
$object->label = GETPOST("libelle");
$object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
$object->update($object->id, $user);
} else {
$object->multilangs[$key]["label"] = GETPOST("libelle-".$key);
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
$object->multilangs[GETPOST("forcelangprod")]["label"] = GETPOST("libelle");
$object->multilangs[GETPOST("forcelangprod")]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
$object->multilangs[GETPOST("forcelangprod")]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
}
// save in database
if (GETPOST("forcelangprod")) {
$result = $object->setMultiLangs($user);
} else {
$object->error = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Language"));
$result = -1;
}
if ($result > 0) {
$action = '';
} else {
$action = 'add';
setEventMessages($object->error, $object->errors, 'errors');
}
}
$result = $object->setMultiLangs($user);
if ($result > 0) {
$action = '';
} else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');
// Edit translation
if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
$object = new Product($db);
$object->fetch($id);
$current_lang = $langs->getDefaultLang();
foreach ($object->multilangs as $key => $value) { // enregistrement des nouvelles valeurs dans l'objet
if ($key == $current_lang) {
$object->label = GETPOST("libelle-" . $key);
$object->description = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml'));
$object->other = dol_htmlcleanlastbr(GETPOST("other-" . $key, 'restricthtml'));
} else {
$object->multilangs[$key]["label"] = GETPOST("libelle-" . $key);
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-" . $key, 'restricthtml'));
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-" . $key, 'restricthtml'));
}
}
$result = $object->setMultiLangs($user);
if ($result > 0) {
$action = '';
} else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
// Delete translation
if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
$object = new Product($db);
$object->fetch($id);
$langtodelete = GETPOST('langdel', 'alpha');
// Delete translation
if ($action == 'vdelete' && $cancel != $langs->trans("Cancel") && ($user->rights->produit->creer || $user->rights->service->creer)) {
$object = new Product($db);
$object->fetch($id);
$langtodelete = GETPOST('langdel', 'alpha');
$result = $object->delMultiLangs($langtodelete, $user);
if ($result > 0) {
$action = '';
} else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');
$result = $object->delMultiLangs($langtodelete, $user);
if ($result > 0) {
$action = '';
} else {
$action = 'edit';
setEventMessages($object->error, $object->errors, 'errors');
}
}
}
@ -216,11 +226,15 @@ print dol_get_fiche_end();
*/
print "\n".'<div class="tabsAction">'."\n";
if ($action == '') {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/traduction.php?action=add&id='.$object->id.'">'.$langs->trans("Add").'</a>';
if ($cnt_trans > 0) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/product/traduction.php?action=edit&id='.$object->id.'">'.$langs->trans("Update").'</a>';
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
if (empty($reshook)) {
if ($action == '') {
if ($user->rights->produit->creer || $user->rights->service->creer) {
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=add&id=' . $object->id . '">' . $langs->trans("Add") . '</a>';
if ($cnt_trans > 0) {
print '<a class="butAction" href="' . DOL_URL_ROOT . '/product/traduction.php?action=edit&id=' . $object->id . '">' . $langs->trans("Update") . '</a>';
}
}
}
}
@ -263,6 +277,9 @@ if ($action == 'edit') {
}
}
$parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print '<br>';
print '<div class="center">';
@ -334,6 +351,9 @@ if ($action == 'add' && ($user->rights->produit->creer || $user->rights->service
}
print '</table>';
$parameters = array();
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print dol_get_fiche_end();
print '<div class="center">';

View File

@ -89,6 +89,8 @@ $socid = GETPOST('socid', 'int');
//if ($user->socid > 0) $socid = $user->socid; // For external user, no check is done on company because readability is managed by public status of project and assignement.
restrictedArea($user, 'projet', $object->id, 'projet&project');
$permissiondellink = $user->rights->projet->creer; // Used by the include of actions_dellink.inc.php
/*
* Actions
@ -121,6 +123,8 @@ if (empty($reshook)) {
$action = '';
}
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
if ($action == 'add' && $user->rights->projet->creer) {
$error = 0;
if (!GETPOST('ref')) {
@ -132,9 +136,11 @@ if (empty($reshook)) {
$error++;
}
if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) {
$error++;
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if (GETPOST('opp_amount') != '' && !(GETPOST('opp_status') > 0)) {
$error++;
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
}
}
// Create with status validated immediatly
@ -270,9 +276,11 @@ if (empty($reshook)) {
}
}
if ($object->opp_amount && ($object->opp_status <= 0)) {
$error++;
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
if ($object->opp_amount && ($object->opp_status <= 0)) {
$error++;
setEventMessages($langs->trans("ErrorOppStatusRequiredIfAmount"), null, 'errors');
}
}
if (!$error) {
@ -511,7 +519,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Ref
$suggestedref = (GETPOST("ref") ? GETPOST("ref") : $defaultref);
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td><input size="12" type="text" name="ref" value="'.dol_escape_htmltag($suggestedref).'">';
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td><input size="25" type="text" name="ref" value="'.dol_escape_htmltag($suggestedref).'">';
print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref));
print '</td></tr>';
@ -796,7 +804,7 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Ref
$suggestedref = $object->ref;
print '<tr><td class="titlefield fieldrequired">'.$langs->trans("Ref").'</td>';
print '<td><input size="12" name="ref" value="'.$suggestedref.'">';
print '<td><input size="25" name="ref" value="'.$suggestedref.'">';
print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref));
print '</td></tr>';

View File

@ -744,7 +744,8 @@ class Project extends CommonObject
'datefieldname' => $datefieldname,
'dates' => $dates,
'datee' => $datee,
'fk_projet' => $projectkey
'fk_projet' => $projectkey,
'ids' => $ids,
);
$reshook = $hookmanager->executeHooks('getElementList', $parameters, $object, $action);
if ($reshook > 0) {

View File

@ -1136,6 +1136,8 @@ if ($ispaymentok) {
if ($resultattendee < 0) {
setEventMessages(null, $attendeetovalidate->errors, "errors");
} else {
$attendeetovalidate->amount=$FinalPaymentAmt;
$attendeetovalidate->update($user);
$attendeetovalidate->validate($user);
// Sending mail
@ -1156,8 +1158,9 @@ if ($ispaymentok) {
$arraydefaultmessage = null;
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT;
if (!empty($labeltouse)) {
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, '');
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
}
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
@ -1171,7 +1174,7 @@ if ($ispaymentok) {
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
$sendto = $thirdparty->email;
$sendto = $attendeetovalidate->email;
$from = $conf->global->MAILING_EMAIL_FROM;
$urlback = $_SERVER["REQUEST_URI"];
@ -1338,7 +1341,7 @@ if ($ispaymentok) {
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT;
if (!empty($labeltouse)) {
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, '');
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
}
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {

View File

@ -81,9 +81,8 @@ $email = GETPOST("email");
$societe = GETPOST("societe");
$label = GETPOST("label");
$note = GETPOST("note");
$datestart = GETPOST("datestart");
$dateend = GETPOST("dateend");
$datestart = dol_mktime(0, 0, 0, GETPOST('datestartmonth', 'int'), GETPOST('datestartday', 'int'), GETPOST('datestartyear', 'int'));
$dateend = dol_mktime(23, 59, 59, GETPOST('dateendmonth', 'int'), GETPOST('dateendday', 'int'), GETPOST('dateendyear', 'int'));
$id = GETPOST('id');
$project = new Project($db);
@ -225,13 +224,19 @@ if (empty($reshook) && $action == 'add') {
$error++;
$errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Note"))."<br>\n";
}
if (!GETPOST("datestart")) {
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 (!GETPOST("dateend")) {
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")) {
$error++;
@ -376,7 +381,7 @@ if (empty($reshook) && $action == 'add') {
$conforbooth->fk_project = $project->id;
$conforbooth->note = $note;
$conforbooth->fk_action = $eventtype;
$conforbooth->datep =$datestart;
$conforbooth->datep = $datestart;
$conforbooth->datep2 = $dateend;
$conforbooth->datec = dol_now();
$conforbooth->tms = dol_now();
@ -423,7 +428,7 @@ if (empty($reshook) && $action == 'add') {
$error++;
} else {
$db->commit();
$facture->add_object_linked($contact->element, $contact->id);
$facture->add_object_linked($conforbooth->element, $conforbooth->id);
}
}
@ -436,7 +441,7 @@ if (empty($reshook) && $action == 'add') {
$contact->errors = $facture->errors;
$error++;
}
if (!$error) {
/*if (!$error) {
$valid = true;
$sourcetouse = 'boothlocation';
$reftouse = $facture->id;
@ -450,54 +455,12 @@ if (empty($reshook) && $action == 'add') {
}
Header("Location: ".$redirection);
exit;
}
}*/
}
} else {
// If no price has been set for the booth, we confirm it as suggested and we update
$conforbooth->status = ConferenceOrBooth::STATUS_SUGGESTED;
$conforbooth->update($user);
// Sending mail
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH;
if (!empty($labeltouse)) {
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
}
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
$sendto = $thirdparty->email;
$from = $conf->global->MAILING_EMAIL_FROM;
$urlback = $_SERVER["REQUEST_URI"];
$ishtml = dol_textishtml($texttosend); // May contain urls
$mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml);
$result = $mailfile->sendfile();
if ($result) {
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
} else {
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
}
}
}
}
@ -505,6 +468,50 @@ if (empty($reshook) && $action == 'add') {
}
if (!$error) {
$db->commit();
// Sending mail
require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
// Set output language
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
// Load traductions files required by page
$outputlangs->loadLangs(array("main", "members"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH;
if (!empty($labeltouse)) {
$arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
}
if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
$subject = $arraydefaultmessage->topic;
$msg = $arraydefaultmessage->content;
}
$substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
complete_substitutions_array($substitutionarray, $outputlangs, $object);
$subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
$texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
$sendto = $thirdparty->email;
$from = $conf->global->MAILING_EMAIL_FROM;
$urlback = $_SERVER["REQUEST_URI"];
$ishtml = dol_textishtml($texttosend); // May contain urls
$mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml);
$result = $mailfile->sendfile();
if ($result) {
dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
} else {
dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
}
$securekeyurl = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 2);
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl;
Header("Location: ".$redirection);
@ -630,12 +637,23 @@ print '</td><td><input type="text" name="label" class="minwidth150" value="'.dol
print '<tr><td>'.$langs->trans("Description").'<FONT COLOR="red">*</FONT></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";
// Start Date
print '<tr><td>'.$langs->trans("DateStart").'<FONT COLOR="red">*</FONT></td>'."\n";
print '<td><input type="date" name="datestart" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('datestart')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("DateStart").'<FONT COLOR="red">*</FONT>';
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").'<FONT COLOR="red">*</FONT></td>'."\n";
print '<td><input type="date" name="dateend" class="minwidth150" value="'.dol_escape_htmltag(GETPOST('dateend')).'"></td></tr>'."\n";
print '<tr><td>'.$langs->trans("DateEnd").'<FONT COLOR="red">*</FONT>';
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";

View File

@ -258,7 +258,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('add', 'alpha')) {
$sendto = GETPOST('email', 'alpha');
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.' <'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
$replyto = $from;
$sendtocc = '';
$deliveryreceipt = 0;
@ -298,7 +298,6 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('add', 'alpha')) {
}
$message_admin .= '</ul>';
$message_admin .= '</ul>';
$message_admin .= '<p>'.$langs->trans('Message').' : <br>'.$object->message.'</p>';
$message_admin .= '<p><a href="'.dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id.'" rel="nofollow noopener">'.$langs->trans('SeeThisTicketIntomanagementInterface').'</a></p>';
@ -390,7 +389,7 @@ if ($action != "infos_success") {
print '<div class="error">';
print $langs->trans("ErrorFieldRequired", $langs->transnoentities("TicketEmailNotificationFrom")).'<br>';
print $langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentities("Ticket"));
print '<div>';
print '</div>';
} else {
print '<div class="info marginleftonly marginrightonly">'.$langs->trans('TicketPublicInfoCreateTicket').'</div>';
$formticket->showForm(0, 'edit', 1);

View File

@ -262,8 +262,10 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a
// Category
print '<tr><td>'.$langs->trans("Category").'</td><td>';
print img_picto('', 'category', 'class="pictofixedwidth"');
print dol_escape_htmltag($object->dao->category_label);
if ($object->dao->category_label) {
print img_picto('', 'category', 'class="pictofixedwidth"');
print dol_escape_htmltag($object->dao->category_label);
}
print '</td></tr>';
// Severity

View File

@ -101,13 +101,13 @@ class RecruitmentJobPosition extends CommonObject
public $fields = array(
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>'1', 'position'=>1, 'notnull'=>1, 'visible'=>0, 'noteditable'=>'1', 'index'=>1, 'comment'=>"Id"),
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'position'=>5, 'notnull'=>1, 'default'=>'1', 'index'=>1),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object"),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>'1', 'position'=>10, 'notnull'=>1, 'visible'=>4, 'noteditable'=>'1', 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'showoncombobox'=>'1', 'comment'=>"Reference of object", 'css'=>'nowraponall'),
'label' => array('type'=>'varchar(255)', 'label'=>'JobLabel', 'enabled'=>'1', 'position'=>30, 'notnull'=>1, 'visible'=>1, 'searchall'=>1, 'css'=>'minwidth500', 'csslist'=>'tdoverflowmax300', 'showoncombobox'=>'2', 'autofocusoncreate'=>1),
'qty' => array('type'=>'integer', 'label'=>'NbOfEmployeesExpected', 'enabled'=>'1', 'position'=>45, 'notnull'=>1, 'visible'=>1, 'default'=>'1', 'isameasure'=>'1', 'css'=>'maxwidth75imp'),
'fk_project' => array('type'=>'integer:Project:projet/class/project.class.php:1', 'label'=>'Project', 'enabled'=>'1', 'position'=>52, 'notnull'=>-1, 'visible'=>-1, 'index'=>1, 'css'=>'maxwidth500', 'picto'=>'project'),
'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax150'),
'fk_user_recruiter' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'ResponsibleOfRecruitement', 'enabled'=>'1', 'position'=>54, 'notnull'=>1, 'visible'=>1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'),
'email_recruiter' => array('type'=>'varchar(255)', 'label'=>'EmailRecruiter', 'enabled'=>'1', 'position'=>54, 'notnull'=>0, 'visible'=>-1, 'help'=>'ToUseAGenericEmail', 'picto'=>'email'),
'fk_user_supervisor' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'FutureManager', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'user.rowid',),
'fk_user_supervisor' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'FutureManager', 'enabled'=>'1', 'position'=>55, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'user.rowid', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax150', 'picto'=>'user'),
'fk_establishment' => array('type'=>'integer:Establishment:hrm/class/establishment.class.php', 'label'=>'Establishment', 'enabled'=>'$conf->hrm->enabled', 'position'=>56, 'notnull'=>0, 'visible'=>-1, 'foreignkey'=>'establishment.rowid',),
'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php:1:status=1 AND entity IN (__SHARED_ENTITIES__)', 'label'=>'WorkPlace', 'enabled'=>'1', 'position'=>57, 'notnull'=>-1, 'visible'=>-1, 'css'=>'maxwidth500', 'index'=>1, 'help'=>"IfJobIsLocatedAtAPartner", 'picto'=>'company'),
'date_planned' => array('type'=>'date', 'label'=>'DateExpected', 'enabled'=>'1', 'position'=>60, 'notnull'=>0, 'visible'=>1,),

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