forked from Wavyzz/dolibarr
Merge branch '14.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
42
ChangeLog
42
ChangeLog
@@ -7,7 +7,7 @@ English Dolibarr ChangeLog
|
||||
|
||||
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)
|
||||
@@ -50,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
|
||||
@@ -67,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
|
||||
@@ -93,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
|
||||
@@ -162,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
|
||||
@@ -171,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:
|
||||
@@ -209,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:
|
||||
@@ -224,7 +228,7 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* 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.
|
||||
|
||||
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
@@ -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> ';
|
||||
@@ -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 -->';
|
||||
|
||||
@@ -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>';
|
||||
}
|
||||
|
||||
@@ -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 ' <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>';
|
||||
|
||||
@@ -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 ' <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>';
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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') {
|
||||
|
||||
@@ -1733,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");
|
||||
}
|
||||
@@ -1746,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&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&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&leftmenu=list&search_usage_opportunity=1&search_status=99', $langs->trans("List"), 2, $showmode);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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")),
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -941,7 +941,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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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>
|
||||
@@ -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
|
||||
|
||||
@@ -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&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&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&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&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&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&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&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&id=' . $object->id . '">' . $langs->trans("UpdateLevelPrices") . '</a></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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').',';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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">';
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -251,6 +251,8 @@ if (!empty($conf->categorie->enabled) && !empty($conf->global->CATEGORY_GRAPHSTA
|
||||
$thirdpartycateggraph .= '</td></tr>';
|
||||
$thirdpartycateggraph .= '</table>';
|
||||
$thirdpartycateggraph .= '</div>';
|
||||
} else {
|
||||
$thirdpartycateggraph = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ $search_categ_cus = trim(GETPOST("search_categ_cus", 'int'));
|
||||
$search_categ_sup = trim(GETPOST("search_categ_sup", 'int'));
|
||||
$search_country = GETPOST("search_country", 'intcomma');
|
||||
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
|
||||
$search_price_level = GETPOST('search_prive_level', 'int');
|
||||
$search_price_level = GETPOST('search_price_level', 'int');
|
||||
$search_staff = GETPOST("search_staff", 'int');
|
||||
$search_status = GETPOST("search_status", 'int');
|
||||
$search_type = GETPOST('search_type', 'alpha');
|
||||
@@ -356,7 +356,7 @@ if (empty($reshook)) {
|
||||
$search_idprof6 = '';
|
||||
$search_vat = '';
|
||||
$search_type = '';
|
||||
$search_prive_level = '';
|
||||
$search_price_level = '';
|
||||
$search_type_thirdparty = '';
|
||||
$search_staff = '';
|
||||
$search_status = -1;
|
||||
@@ -639,8 +639,8 @@ if ($search_status != '' && $search_status >= 0) {
|
||||
if (!empty($conf->barcode->enabled) && $search_barcode) {
|
||||
$sql .= natural_search("s.barcode", $search_barcode);
|
||||
}
|
||||
if ($search_prive_level && $search_prive_level != '-1') {
|
||||
$sql .= natural_search("s.price_level", $search_prive_level, 2);
|
||||
if ($search_price_level && $search_price_level != '-1') {
|
||||
$sql .= natural_search("s.price_level", $search_price_level, 2);
|
||||
}
|
||||
if ($search_type_thirdparty && $search_type_thirdparty > 0) {
|
||||
$sql .= natural_search("s.fk_typent", $search_type_thirdparty, 2);
|
||||
@@ -654,8 +654,8 @@ if ($search_level) {
|
||||
if ($search_parent_name) {
|
||||
$sql .= natural_search("s2.nom", $search_parent_name);
|
||||
}
|
||||
if ($search_stcomm != '' && $search_stcomm != -2) {
|
||||
$sql .= natural_search("s.fk_stcomm", $search_stcomm, 2);
|
||||
if ($search_stcomm != '' && $search_stcomm != '-2') { // -2 is not filter
|
||||
$sql .= natural_search("s.fk_stcomm", $search_stcomm, 1);
|
||||
}
|
||||
if ($search_import_key) {
|
||||
$sql .= natural_search("s.import_key", $search_import_key);
|
||||
@@ -813,8 +813,8 @@ if ($search_idprof6 != '') {
|
||||
if ($search_vat != '') {
|
||||
$param .= '&search_vat='.urlencode($search_vat);
|
||||
}
|
||||
if ($search_prive_level != '') {
|
||||
$param .= '&search_prive_level='.urlencode($search_prive_level);
|
||||
if ($search_price_level != '') {
|
||||
$param .= '&search_price_level='.urlencode($search_price_level);
|
||||
}
|
||||
if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
|
||||
$param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
|
||||
@@ -830,7 +830,7 @@ if (is_array($search_level) && count($search_level)) {
|
||||
if ($search_status != '') {
|
||||
$param .= '&search_status='.urlencode($search_status);
|
||||
}
|
||||
if ($search_stcomm != '') {
|
||||
if ($search_stcomm != '' && $search_stcomm != '-2') { // -2 is no filter
|
||||
$param .= '&search_stcomm='.urlencode($search_stcomm);
|
||||
}
|
||||
if ($search_parent_name != '') {
|
||||
@@ -1100,7 +1100,7 @@ if (!empty($arrayfields['typent.code']['checked'])) {
|
||||
// Multiprice level
|
||||
if (!empty($arrayfields['s.price_level']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat searchstring maxwidth50imp" type="text" name="search_prive_level" value="'.dol_escape_htmltag($search_prive_level).'">';
|
||||
print '<input class="flat searchstring maxwidth50imp" type="text" name="search_price_level" value="'.dol_escape_htmltag($search_price_level).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Staff
|
||||
|
||||
@@ -435,10 +435,10 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == "confirm_close" && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) {
|
||||
if (($action == "confirm_close" || $action == "confirm_abandon") && GETPOST('confirm', 'alpha') == 'yes' && $user->rights->ticket->write) {
|
||||
$object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha'));
|
||||
|
||||
if ($object->close($user)) {
|
||||
if ($object->close($user, ($action == "confirm_abandon" ? 1 : 0))) {
|
||||
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
|
||||
|
||||
$url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha');
|
||||
@@ -758,7 +758,7 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '</div>';
|
||||
|
||||
print '</form>'; */
|
||||
} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|
||||
} elseif (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'dellink' || $action == 'presend' || $action == 'presend_addmessage' || $action == 'close' || $action == 'abandon' || $action == 'delete' || $action == 'editcustomer' || $action == 'progression' || $action == 'reopen'
|
||||
|| $action == 'editsubject' || $action == 'edit_extras' || $action == 'update_extras' || $action == 'edit_extrafields' || $action == 'set_extrafields' || $action == 'classify' || $action == 'sel_contract' || $action == 'edit_message_init' || $action == 'set_status' || $action == 'dellink') {
|
||||
if ($res > 0) {
|
||||
// or for unauthorized internals users
|
||||
@@ -773,6 +773,13 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
// Confirmation abandon
|
||||
if ($action == 'abandon') {
|
||||
print $form->formconfirm($url_page_current."?track_id=".$object->track_id, $langs->trans("AbandonTicket"), $langs->trans("ConfirmAbandonTicket"), "confirm_abandon", '', '', 1);
|
||||
if ($ret == 'html') {
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
// Confirmation delete
|
||||
if ($action == 'delete') {
|
||||
print $form->formconfirm($url_page_current."?track_id=".$object->track_id, $langs->trans("Delete"), $langs->trans("ConfirmDeleteTicket"), "confirm_delete_ticket", '', '', 1);
|
||||
@@ -1135,15 +1142,21 @@ if ($action == 'create' || $action == 'presend') {
|
||||
} else {
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>';
|
||||
print $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);
|
||||
if (!empty($object->type_code)) {
|
||||
print $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);
|
||||
}
|
||||
print '</td></tr>';
|
||||
// Group
|
||||
print '<tr><td>'.$langs->trans("TicketCategory").'</td><td>';
|
||||
print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
|
||||
if (!empty($object->category_code)) {
|
||||
print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
|
||||
}
|
||||
print '</td></tr>';
|
||||
// Severity
|
||||
print '<tr><td>'.$langs->trans("TicketSeverity").'</td><td>';
|
||||
print $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code);
|
||||
if (!empty($object->severity_code)) {
|
||||
print $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
print '</table>'; // End table actions
|
||||
@@ -1312,8 +1325,13 @@ if ($action == 'create' || $action == 'presend') {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id='.$object->track_id.'&action=close">'.$langs->trans('CloseTicket').'</a></div>';
|
||||
}
|
||||
|
||||
// Abadon ticket if statut is read
|
||||
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id='.$object->track_id.'&action=abandon">'.$langs->trans('AbandonTicket').'</a></div>';
|
||||
}
|
||||
|
||||
// Re-open ticket
|
||||
if (!$user->socid && $object->fk_statut == Ticket::STATUS_CLOSED && !$user->socid) {
|
||||
if (!$user->socid && ($object->fk_statut == Ticket::STATUS_CLOSED || $object->fk_statut == Ticket::STATUS_CANCELED) && !$user->socid) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?track_id='.$object->track_id.'&action=reopen">'.$langs->trans('ReOpen').'</a></div>';
|
||||
}
|
||||
|
||||
|
||||
@@ -408,7 +408,7 @@ class ActionsTicket
|
||||
if ($status == 1) {
|
||||
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=mark_ticket_read'; // To set as read, we use a dedicated action
|
||||
} else {
|
||||
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=set_status&token='.newToken().'&new_status='.$status;
|
||||
$urlforbutton = $_SERVER['PHP_SELF'].'?track_id='.$object->track_id.'&action=confirm_set_status&token='.newToken().'&new_status='.$status;
|
||||
}
|
||||
|
||||
print '<a class="butAction butStatus marginbottomonly" href="'.$urlforbutton.'">';
|
||||
|
||||
@@ -218,8 +218,8 @@ class Ticket extends CommonObject
|
||||
const STATUS_IN_PROGRESS = 3;
|
||||
const STATUS_NEED_MORE_INFO = 5;
|
||||
const STATUS_WAITING = 7; // on hold
|
||||
const STATUS_CLOSED = 8;
|
||||
const STATUS_CANCELED = 9;
|
||||
const STATUS_CLOSED = 8; // Closed - Solved
|
||||
const STATUS_CANCELED = 9; // Closed - Not solved
|
||||
|
||||
|
||||
/**
|
||||
@@ -272,8 +272,8 @@ class Ticket extends CommonObject
|
||||
'message' => array('type'=>'text', 'label'=>'Message', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1,),
|
||||
'email_msgid' => array('type'=>'varchar(255)', 'label'=>'EmailMsgID', 'visible'=>-2, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'help'=>'EmailMsgIDDesc'),
|
||||
'progress' => array('type'=>'varchar(100)', 'label'=>'Progression', 'visible'=>-1, 'enabled'=>1, 'position'=>540, 'notnull'=>-1, 'css'=>'right', 'help'=>"", 'isameasure'=>1),
|
||||
'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>1, 'position'=>550, 'notnull'=>1),
|
||||
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'Closed', 9 => 'Deleted')),
|
||||
'resolution' => array('type'=>'integer', 'label'=>'Resolution', 'visible'=>-1, 'enabled'=>'$conf->global->TICKET_ENABLE_RESOLUTION', 'position'=>550, 'notnull'=>1),
|
||||
'fk_statut' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>600, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array(0 => 'Unread', 1 => 'Read', 3 => 'Answered', 4 => 'Assigned', 5 => 'InProgress', 6 => 'Waiting', 8 => 'SolvedClosed', 9 => 'Deleted')),
|
||||
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>900),
|
||||
);
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
@@ -286,6 +286,8 @@ class Ticket extends CommonObject
|
||||
*/
|
||||
public function __construct($db)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
$this->statuts_short = array(
|
||||
@@ -295,7 +297,7 @@ class Ticket extends CommonObject
|
||||
self::STATUS_IN_PROGRESS => 'InProgress',
|
||||
self::STATUS_WAITING => 'OnHold',
|
||||
self::STATUS_NEED_MORE_INFO => 'NeedMoreInformationShort',
|
||||
self::STATUS_CLOSED => 'Closed',
|
||||
self::STATUS_CLOSED => 'SolvedClosed',
|
||||
self::STATUS_CANCELED => 'Canceled'
|
||||
);
|
||||
$this->statuts = array(
|
||||
@@ -305,7 +307,7 @@ class Ticket extends CommonObject
|
||||
self::STATUS_IN_PROGRESS => 'InProgress',
|
||||
self::STATUS_WAITING => 'OnHold',
|
||||
self::STATUS_NEED_MORE_INFO => 'NeedMoreInformation',
|
||||
self::STATUS_CLOSED => 'Closed',
|
||||
self::STATUS_CLOSED => 'SolvedClosed',
|
||||
self::STATUS_CANCELED => 'Canceled'
|
||||
);
|
||||
}
|
||||
@@ -459,7 +461,7 @@ class Ticket extends CommonObject
|
||||
$sql .= " ".(!isset($this->progress) ? '0' : "'".$this->db->escape($this->progress)."'").",";
|
||||
$sql .= " ".(!isset($this->timing) ? 'NULL' : "'".$this->db->escape($this->timing)."'").",";
|
||||
$sql .= " ".(!isset($this->type_code) ? 'NULL' : "'".$this->db->escape($this->type_code)."'").",";
|
||||
$sql .= " ".(!isset($this->category_code) ? 'NULL' : "'".$this->db->escape($this->category_code)."'").",";
|
||||
$sql .= " ".(empty($this->category_code) || $this->category_code == '-1' ? 'NULL' : "'".$this->db->escape($this->category_code)."'").",";
|
||||
$sql .= " ".(!isset($this->severity_code) ? 'NULL' : "'".$this->db->escape($this->severity_code)."'").",";
|
||||
$sql .= " ".(!isset($this->datec) || dol_strlen($this->datec) == 0 ? 'NULL' : "'".$this->db->idate($this->datec)."'").",";
|
||||
$sql .= " ".(!isset($this->date_read) || dol_strlen($this->date_read) == 0 ? 'NULL' : "'".$this->db->idate($this->date_read)."'").",";
|
||||
@@ -1749,21 +1751,22 @@ class Ticket extends CommonObject
|
||||
/**
|
||||
* Close a ticket
|
||||
*
|
||||
* @param User $user User that close
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param User $user User that close
|
||||
* @param int $mode 0=Close solved, 1=Close abandonned
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function close(User $user)
|
||||
public function close(User $user, $mode = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
if ($this->fk_statut != Ticket::STATUS_CLOSED) { // not closed
|
||||
if ($this->fk_statut != Ticket::STATUS_CLOSED && $this->fk_statut != Ticket::STATUS_CANCELED) { // not closed
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."ticket";
|
||||
$sql .= " SET fk_statut=".Ticket::STATUS_CLOSED.", progress=100, date_close='".$this->db->idate(dol_now())."'";
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " SET fk_statut=".($mode ? Ticket::STATUS_CANCELED : Ticket::STATUS_CLOSED).", progress=100, date_close='".$this->db->idate(dol_now())."'";
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::close sql=".$sql);
|
||||
dol_syslog(get_class($this)."::close mode=".$mode);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
$error = 0;
|
||||
|
||||
@@ -45,9 +45,9 @@ $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk
|
||||
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
|
||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||
$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'tickep#selectedfieldstlist'; // To manage different context of search
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'tickep#selectedfieldstlist'; // To manage different context of search
|
||||
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$msg_id = GETPOST('msg_id', 'int');
|
||||
@@ -73,8 +73,9 @@ $sortfield = GETPOST('sortfield', 'aZ09comma');
|
||||
$sortorder = GETPOST('sortorder', 'aZ09comma');
|
||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
|
||||
// If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
$page = 0;
|
||||
} // If $page is not defined, or '' or -1 or if we click on clear filters
|
||||
}
|
||||
$offset = $limit * $page;
|
||||
$pageprev = $page - 1;
|
||||
$pagenext = $page + 1;
|
||||
@@ -107,12 +108,16 @@ if (GETPOST('search_fk_status', 'alpha') == 'non_closed') {
|
||||
}
|
||||
|
||||
// Initialize array of search criterias
|
||||
$search_all = trim(GETPOSTISSET("search_all") ?GETPOSTISSET("search_all", 'alpha') : GETPOST('sall'));
|
||||
$search_all = (GETPOSTISSET("search_all") ? GETPOST("search_all", 'alpha') : GETPOST('sall'));
|
||||
$search = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha')) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
|
||||
$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
|
||||
}
|
||||
}
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
@@ -126,12 +131,19 @@ $fieldstosearchall['s.name_alias'] = "AliasNameShort";
|
||||
$fieldstosearchall['s.zip'] = "Zip";
|
||||
$fieldstosearchall['s.town'] = "Town";
|
||||
|
||||
// Definition of fields for list
|
||||
// Definition of array of fields for columns
|
||||
$arrayfields = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) {
|
||||
$arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>$val['enabled'], 'position'=>$val['position']);
|
||||
$visible = (int) dol_eval($val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
'label'=>$val['label'],
|
||||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
|
||||
'position'=>$val['position'],
|
||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
@@ -139,8 +151,6 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
//if ($socid > 0) $arrayfields['t.fk_soc']['enabled']=0;
|
||||
//if ($projectid > 0) $arrayfields['t.fk_project']['enabled']=0;
|
||||
|
||||
|
||||
// Security check
|
||||
|
||||
@@ -2326,7 +2326,7 @@ if ($action == 'generatesitemaps' && $usercanedit) {
|
||||
$domainname = $objp->virtualhost;
|
||||
}
|
||||
if (! preg_match('/^http/i', $domainname)) {
|
||||
$domainname .= 'https://'.$domainname;
|
||||
$domainname = 'https://'.$domainname;
|
||||
}
|
||||
//$pathofpage = $dolibarr_main_url_root.'/'.$pageurl.'.php';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user