Merge branch '20.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2024-06-20 20:41:09 +02:00
commit 587e6347ff
16 changed files with 115 additions and 61 deletions

View File

@ -328,19 +328,6 @@ if (getDolGlobalString('BANK_DISABLE_DIRECT_INPUT')) {
}
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ACCOUNTANCY_ER_DATE_RECORD").'</td>';
if (getDolGlobalInt('ACCOUNTANCY_ER_DATE_RECORD')) {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_ER_DATE_RECORD&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_ER_DATE_RECORD&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ACCOUNTANCY_COMBO_FOR_AUX");
print ' - <span class="opacitymedium">'.$langs->trans("NotRecommended").'</span>';
@ -389,20 +376,6 @@ foreach ($list as $key) {
print '</tr>';
}
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ACCOUNTING_BANK_CONCILIATED").'</td>';
if (getDolGlobalInt('ACCOUNTING_BANK_CONCILIATED') == 2) {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_BANK_CONCILIATED&value=1">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_BANK_CONCILIATED&value=2">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print '</table>';
print '</div>';
@ -476,6 +449,34 @@ if (getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) {
}
print '</tr>';
if (!getDolGlobalString('ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS')) {
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ACCOUNTANCY_ER_DATE_RECORD").'</td>';
if (getDolGlobalInt('ACCOUNTANCY_ER_DATE_RECORD')) {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_ER_DATE_RECORD&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTANCY_ER_DATE_RECORD&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
}
print '<tr class="oddeven">';
print '<td>'.$langs->trans("ACCOUNTING_BANK_CONCILIATED").'</td>';
if (getDolGlobalInt('ACCOUNTING_BANK_CONCILIATED') == 2) {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_BANK_CONCILIATED&value=1">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td class="right"><a class="reposition" href="'.$_SERVER['PHP_SELF'].'?token='.newToken().'&action=setACCOUNTING_BANK_CONCILIATED&value=2">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print '</table>';
print '</div>';

View File

@ -300,7 +300,7 @@ if (!empty($current_fiscal_period)) {
print load_fiche_titre($langs->trans("Closure") . " - " . $fiscal_period_nav_text, '', 'title_accountancy');
if (empty($current_fiscal_period)) {
print $langs->trans('ErrorNoFiscalPeriodActiveFound');
print $langs->trans('ErrorNoFiscalPeriodActiveFound', $langs->trans("Accounting"), $langs->trans("Setup"), $langs->trans("FiscalPeriod"));
}
if (isset($current_fiscal_period)) {

View File

@ -289,7 +289,7 @@ $tabsql[DICT_INVOICE_SUBTYPE] = "SELECT t.rowid, t.code, t.label, c.label as cou
$tabsql[DICT_HRM_PUBLIC_HOLIDAY] = "SELECT a.id as rowid, a.entity, a.code, a.fk_country as country_id, c.code as country_code, c.label as country, a.dayrule, a.day, a.month, a.year, a.active FROM ".MAIN_DB_PREFIX."c_hrm_public_holiday as a LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON a.fk_country=c.rowid AND c.active=1";
$tabsql[DICT_HRM_DEPARTMENT] = "SELECT t.rowid, t.pos, t.code, t.label, t.active FROM ".MAIN_DB_PREFIX."c_hrm_department as t";
$tabsql[DICT_HRM_FUNCTION] = "SELECT t.rowid, t.pos, t.code, t.label, t.c_level, t.active FROM ".MAIN_DB_PREFIX."c_hrm_function as t";
$tabsql[DICT_EXP_TAX_CAT] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c as c";
$tabsql[DICT_EXP_TAX_CAT] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat as c";
$tabsql[DICT_EXP_TAX_RANGE] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r";
$tabsql[DICT_UNITS] = "SELECT r.rowid, r.code, r.sortorder, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r";
$tabsql[DICT_SOCIALNETWORKS] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity IN (".getEntity($tabname[DICT_SOCIALNETWORKS]).")";

View File

@ -2007,14 +2007,14 @@ class ActionComm extends CommonObject
$sql .= " p.date_start_event as datep,"; // Start
$sql .= " p.date_end_event as datep2,"; // End
$sql .= " p.datec, p.tms as datem,";
$sql .= " p.title as label, '' as code, p.note_private, p.note_public, 0 as type_id,";
$sql .= " p.title as label, '' as code, p.note_public, p.note_private, 0 as type_id,";
$sql .= " p.fk_soc,";
$sql .= " p.fk_user_creat as fk_user_author, p.fk_user_modif as fk_user_mod,";
$sql .= " 0 as fk_user_action,";
$sql .= " 0 as fk_contact, 100 as percentage,";
$sql .= " 0 as fk_element, '' as elementtype,";
$sql .= " 1 as priority, 0 as fulldayevent, p.location, 0 as transparency,";
$sql .= " u.firstname, u.lastname, u.email,";
$sql .= " u.firstname, u.lastname, '".$this->db->escape(getDolGlobalString("MAIN_INFO_SOCIETE_MAIL"))."' as email,";
$sql .= " s.nom as socname,";
$sql .= " 0 as type_id, '' as type_code, '' as type_label";
$sql .= " FROM ".MAIN_DB_PREFIX."projet as p";
@ -2060,7 +2060,7 @@ class ActionComm extends CommonObject
$sql .= " a.datep,"; // Start
$sql .= " a.datep2,"; // End
$sql .= " a.datec, a.tms as datem,";
$sql .= " a.label, a.code, a.note as note_private, '' as note_public, a.fk_action as type_id,";
$sql .= " a.label, a.code, '' as note_public, a.note as note_private, a.fk_action as type_id,";
$sql .= " a.fk_soc,";
$sql .= " a.fk_user_author, a.fk_user_mod,";
$sql .= " a.fk_user_action,";
@ -2231,7 +2231,11 @@ class ActionComm extends CommonObject
$duration = ($datestart && $dateend) ? ($dateend - $datestart) : 0;
$event['summary'] = $obj->label.($obj->socname ? " (".$obj->socname.")" : "");
$event['desc'] = $obj->note_private;
if (!empty($filters['module']) && $filters['module'] == 'project@eventorganization') {
$event['desc'] = $obj->note_public;
} else {
$event['desc'] = $obj->note_private;
}
$event['startdate'] = $datestart;
$event['enddate'] = $dateend; // Not required with type 'journal'
$event['duration'] = $duration; // Not required with type 'journal'
@ -2243,13 +2247,13 @@ class ActionComm extends CommonObject
$event['category'] = $obj->type_label;
$event['email'] = $obj->email;
// Public URL of event
if ($eventorganization != '') {
// Define $urlwithroot
$urlwithouturlroot = preg_replace('/'.preg_quote(DOL_URL_ROOT, '/').'$/i', '', trim($dolibarr_main_url_root));
$urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
$url = $urlwithroot.'/comm/action/card.php?id='.$obj->id;
$event['url'] = $url;
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.((int) $obj->id).'&type=global&noregistration=1';
$encodedsecurekey = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $obj->id), 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
$event['url'] = $link_subscription;
}
$event['created'] = $this->db->jdate($obj->datec) - (!getDolGlobalString('AGENDA_EXPORT_FIX_TZ') ? 0 : ($conf->global->AGENDA_EXPORT_FIX_TZ * 3600));

View File

@ -420,13 +420,13 @@ if (isModEnabled("bank")) {
}
// Comments
print '<tr><td class="tdtop">'.$form->editfieldkey("Comments", 'note', $object->note_private, $object, $user->hasRight('facture', 'paiement')).'</td><td>';
print '<tr><td class="tdtop">'.$form->editfieldkey("Comments", 'note', $object->note_private, $object, $user->hasRight('facture', 'paiement')).'</td><td class="wordbreak">';
print $form->editfieldval("Note", 'note', $object->note_private, $object, $user->hasRight('facture', 'paiement'), 'textarea:'.ROWS_3.':90%');
print '</td></tr>';
if (!empty($object->ext_payment_id)) {
// External payment ID
print '<tr><td class="tdtop">'.$langs->trans("StripePaymentId").'</td><td>';
print '<tr><td class="tdtop">'.$langs->trans("StripePaymentId").'</td><td class="wordbreak">';
if (isModEnabled('stripe') && in_array($object->ext_payment_site, array('Stripe', 'StripeLive'))) {
$tmp1 = explode('@', $object->ext_payment_id);
if (!empty($tmp1[1])) {
@ -529,7 +529,7 @@ if ($resql) {
print '<tr class="oddeven">';
// Invoice
print '<td>';
print '<td class="tdoverflowmax150">';
print $invoice->getNomUrl(1);
print "</td>\n";

View File

@ -3964,9 +3964,10 @@ function dol_print_profids($profID, $profIDtype, $countrycode = '', $addcpButton
* @param string $withpicto Show picto ('fax', 'phone', 'mobile')
* @param string $titlealt Text to show on alt
* @param int $adddivfloat Add div float around phone.
* @param string $morecss Add more css
* @return string Formatted phone number
*/
function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addlink = '', $separ = "&nbsp;", $withpicto = '', $titlealt = '', $adddivfloat = 0)
function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addlink = '', $separ = "&nbsp;", $withpicto = '', $titlealt = '', $adddivfloat = 0, $morecss = '')
{
global $conf, $user, $langs, $mysoc, $hookmanager;
@ -3983,7 +3984,7 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
}
// Short format for small screens
if ($conf->dol_optimize_smallscreen) {
if (!empty($conf->dol_optimize_smallscreen) && $separ != 'hidenum') {
$separ = '';
}
@ -4269,9 +4270,9 @@ function dol_print_phone($phone, $countrycode = '', $cid = 0, $socid = 0, $addli
}
}
if ($adddivfloat == 1) {
$rep .= '<div class="nospan float" style="margin-right: 10px">';
$rep .= '<div class="nospan float'.($morecss ? ' '.$morecss : '').'" style="margin-right: 10px">';
} elseif (empty($adddivfloat)) {
$rep .= '<span style="margin-right: 10px;">';
$rep .= '<span'.($morecss ? ' class="'.$morecss.'"' : '').' style="margin-right: 10px;">';
}
$rep .= $newphoneastart;

View File

@ -397,3 +397,5 @@ INSERT INTO llx_c_revenuestamp(rowid,fk_pays,taux,revenuestamp_type,note,active)
INSERT INTO llx_c_revenuestamp(rowid,fk_pays,taux,revenuestamp_type,note,active) values (1022, 102, 2.4, 'percent', 'Συντελεστής 2,4 %', 1);
INSERT INTO llx_c_revenuestamp(rowid,fk_pays,taux,revenuestamp_type,note,active) values (1023, 102, 3.6, 'percent', 'Συντελεστής 3,6 %', 1);
INSERT INTO llx_c_revenuestamp(rowid,fk_pays,taux,revenuestamp_type,note,active) values (1024, 102, 1.0, 'fixed', 'Λοιπές περιπτώσεις Χαρτοσήμου', 1);
ALTER TABLE llx_hrm_evaluation ADD COLUMN entity INTEGER DEFAULT 1 NOT NULL;

View File

@ -19,6 +19,7 @@
CREATE TABLE llx_hrm_evaluation(
-- BEGIN MODULEBUILDER FIELDS
rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL,
entity INTEGER DEFAULT 1 NOT NULL, -- multi company id
ref varchar(128) DEFAULT '(PROV)' NOT NULL,
label varchar(255),
description text,

View File

@ -455,7 +455,7 @@ AccountancyErrorMismatchBalanceAmount=The balance (%s) is not equal to 0
AccountancyErrorLetteringBookkeeping=Errors have occurred concerning the transactions: %s
ErrorAccountNumberAlreadyExists=The accounting number %s already exists
ErrorArchiveAddFile=Can't put "%s" file in archive
ErrorNoFiscalPeriodActiveFound=No active fiscal period found
ErrorNoFiscalPeriodActiveFound=No active fiscal period found. You can create one from menu %s - %s - %s.
ErrorBookkeepingDocDateNotOnActiveFiscalPeriod=The bookkeeping doc date is not inside the active fiscal period
ErrorBookkeepingDocDateIsOnAClosedFiscalPeriod=The bookkeeping doc date is inside a closed fiscal period
## Import

View File

@ -2452,15 +2452,24 @@ class Project extends CommonObject
*
* @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link)
* @param array $arraydata Array of data
* @return string HTML Code for Kanban thumb.
* @param string $size Size of thumb (''=auto, 'large'=large, 'small'=small)
* @return string HTML Code for Kanban thumb.
*/
public function getKanbanView($option = '', $arraydata = null)
public function getKanbanView($option = '', $arraydata = null, $size = '')
{
global $langs;
global $conf, $langs;
$selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']);
$return = '<div class="box-flex-item box-flex-grow-zero">';
if (empty($size)) {
if (empty($conf->dol_optimize_smallscreen)) {
$size = 'large';
} else {
$size = 'small';
}
}
$return = '<div class="box-flex-item '.($size == 'small' ? 'box-flex-item-small' : '').' box-flex-grow-zero">';
$return .= '<div class="info-box info-box-sm">';
$return .= '<span class="info-box-icon bg-infobox-action">';
$return .= img_picto('', $this->public ? 'projectpub' : $this->picto);
@ -2491,7 +2500,7 @@ class Project extends CommonObject
if (property_exists($this, 'thirdparty') && is_object($this->thirdparty)) {
$return .= '<br><div class="info-box-ref tdoverflowmax150 inline-block valignmiddle">'.$this->thirdparty->getNomUrl(1);
$return .= '</div><div class="inline-block valignmiddle">';
$return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone');
$return .= dol_print_phone($this->thirdparty->phone, $this->thirdparty->country_code, 0, $this->thirdparty->id, 'tel', 'hidenum', 'phone', $this->thirdparty->phone, 0, 'marginleftonly');
$return .= '</div>';
}
if (!empty($arraydata['assignedusers'])) {

View File

@ -266,9 +266,9 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
// Add a groupby field. Set $groupby and $groupbyvalues.
// TODO Move this into a inc file
$groupbyvalues = array();
if ($mode == 'kanban') {
$groupbyold = null;
$groupbyvalues = array();
$groupby = GETPOST('groupby', 'aZ09'); // Example: $groupby = 'p.fk_opp_status' or $groupby = 'p.fk_statut'
$groupbyfield = preg_replace('/[a-z]\./', '', $groupby);
if (!empty($object->fields[$groupbyfield]['alias'])) {
@ -1105,7 +1105,7 @@ print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
print '<input type="hidden" name="groupby" value="'.$groupby.'">';
// Show description of content
$texthelp = '';
@ -1654,7 +1654,12 @@ while ($i < $imaxinloop) {
print '<div class="box-flex-container-columns kanban">'; // Start div for all kanban columns
}
// Start kanban column
if ($groupbyold !== $obj->$groupbyfield) {
if (is_null($obj->$groupbyfield)) {
$groupbyvalue = 'undefined';
} else {
$groupbyvalue = $obj->$groupbyfield;
}
if ($groupbyold !== $groupbyvalue) {
if (!is_null($groupbyold)) {
print '</div>'; // We need a new kanban column - end box-flex-container
}
@ -1662,9 +1667,9 @@ while ($i < $imaxinloop) {
//
//var_dump($groupbyvalues);
//var_dump($obj->$groupbyfield);
print '<div class="box-flex-container-column kanban column" data-html="column_'.preg_replace('/[^a-z0-9]/', '', $obj->$groupbyfield).'">'; // Start new column
print '<div class="box-flex-container-column kanban column" data-html="column_'.preg_replace('/[^a-z0-9]/', '', $groupbyvalue).'">'; // Start new column
}
$groupbyold = $obj->$groupbyfield;
$groupbyold = $groupbyvalue;
} elseif ($i == 0) {
print '<div class="box-flex-container kanban">';
}
@ -1679,7 +1684,7 @@ while ($i < $imaxinloop) {
}
$arrayofdata = array('assignedusers' => $stringassignedusers, 'thirdparty' => $companystatic, 'selected' => $selected);
print $object->getKanbanView('', $arrayofdata);
print $object->getKanbanView('', $arrayofdata, ($groupby ? 'small' : ''));
// if no more elements to show
if ($i == ($imaxinloop - 1)) {

View File

@ -1308,7 +1308,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print $s;
print '</td>';
print '<td>';
print dol_print_date($companypaymentmodetemp->date_modification, 'dayhour');
print dol_print_date($companypaymentmodetemp->date_modification, 'dayhour', 'tzuserrel');
print '</td>';
// Fields from hook
$parameters = array('arrayfields' => array(), 'obj' => $obj, 'linetype' => 'stripecard');

View File

@ -4168,7 +4168,7 @@ table.liste td, table.noborder td, div.noborder form div, table.tableforservicep
height: 28px;
}
table.liste tr.trkanban td {
padding: 10px 12px 10px 12px; /* t r b l */
padding: 12px 15px 12px 15px; /* t r b l */
}
div.liste_titre_bydiv .divsearchfield {
padding: 2px 1px 2px 7px; /* t r b l */
@ -4790,6 +4790,9 @@ ul.noborder li:nth-child(even):not(.liste_titre) {
margin-left: 0 !important;
margin-right: 0 !important;
}
table.liste tr.trkanban td {
padding: 10px 6px 10px 6px; /* t r b l */
}
a.tab:link, a.tab:visited, a.tab:hover, a.tab#active {
padding: 12px 12px 13px;

View File

@ -557,6 +557,18 @@ a.vmenu span, span.vmenu, span.vmenu span {
line-height: 1.4em;
}
/* css for small kanban */
.box-flex-item-small {
width: 200px !important;
}
.box-flex-item-small .info-box-sm .info-box-content {
margin-left: 0;
}
.box-flex-item-small .info-box-icon.bg-infobox-action {
display: none;
}
.info-box-title {
width: calc(100% - 20px);
}

View File

@ -609,6 +609,18 @@ if (GETPOSTISSET('THEME_SATURATE_RATIO')) {
line-height: 1.4em;
}
/* css for small kanban */
.box-flex-item-small {
width: 200px !important;
}
.box-flex-item-small .info-box-sm .info-box-content {
margin-left: 0;
}
.box-flex-item-small .info-box-icon.bg-infobox-action {
display: none;
}
@media only screen and (max-width: 767px)
{
.box-flex-container {

View File

@ -2091,6 +2091,10 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select
padding-right: 10px !important;
}
table.liste tr.trkanban td {
padding: 10px 6px 10px 6px; /* t r b l */
}
.hideonsmartphone { display: none; }
.hideonsmartphoneimp { display: none !important; }
.showonsmartphone { display: block !important; }
@ -4268,7 +4272,7 @@ table.liste td, table.noborder td, div.noborder form div, table.tableforservicep
height: 22px;
}
table.liste tr.trkanban td {
padding: 10px 14px 10px 14px; /* t r b l */
padding: 12px 15px 12px 15px; /* t r b l */
}
form.tagtable {