2
0
forked from Wavyzz/dolibarr

Debug v17

This commit is contained in:
Laurent Destailleur
2022-11-03 16:13:35 +01:00
parent 57feb24f4a
commit d0a824c5e9
13 changed files with 114 additions and 80 deletions

View File

@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com> * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@@ -186,7 +186,7 @@ if ($action == 'create') {
print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300'); print $form->selectarray('target', $liste, GETPOSTISSET('target') ? GETPOST('target', 'int') : $defaulttarget, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth300');
print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>'; print '</td><td class="hideonsmartphone"><span class="opacitymedium">'.$langs->trans("ChooseIfANewWindowMustBeOpenedOnClickOnBookmark").'</span></td></tr>';
// Owner // Visibility / Owner
print '<tr><td>'.$langs->trans("Visibility").'</td><td>'; print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx'); print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, ($user->admin ? '' : array($user->id)), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300 widthcentpercentminusx');
print '</td><td class="hideonsmartphone"></td></tr>'; print '</td><td class="hideonsmartphone"></td></tr>';
@@ -279,9 +279,10 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
} }
print '</td></tr>'; print '</td></tr>';
// Visibility / owner
print '<tr><td>'.$langs->trans("Visibility").'</td><td>'; print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
if ($action == 'edit' && $user->admin) { if ($action == 'edit' && $user->admin) {
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : ($object->fk_user ? $object->fk_user : ''), 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx');
} else { } else {
if ($object->fk_user > 0) { if ($object->fk_user > 0) {
$fuser = new User($db); $fuser = new User($db);

View File

@@ -1,5 +1,5 @@
<?php <?php
/* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2005-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@@ -39,13 +39,14 @@ $id = GETPOST("id", 'int');
$optioncss = GETPOST('optioncss', 'alpha'); $optioncss = GETPOST('optioncss', 'alpha');
// Load variable for pagination // Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma'); $sortfield = GETPOST('sortfield', 'aZ09comma');
$sortorder = GETPOST('sortorder', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma');
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) { 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; $page = 0;
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action }
$offset = $limit * $page; $offset = $limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
@@ -72,6 +73,14 @@ $permissiontodelete = !empty($user->rights->bookmark->supprimer);
* Actions * Actions
*/ */
if (GETPOST('cancel', 'alpha')) {
$action = 'list';
$massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
}
if ($action == 'delete') { if ($action == 'delete') {
$res = $object->remove($id); $res = $object->remove($id);
if ($res > 0) { if ($res > 0) {
@@ -103,34 +112,41 @@ if (!$user->admin) {
$sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)"; $sql .= " AND (b.fk_user = ".((int) $user->id)." OR b.fk_user is NULL OR b.fk_user = 0)";
} }
$sql .= $db->order($sortfield.", position", $sortorder);
// Count total nb of records // Count total nb of records
$nbtotalofrecords = ''; $nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$resql = $db->query($sql); /* The fast and low memory method to get and count full list converts the sql into a sql count */
$nbtotalofrecords = $db->num_rows($resql); $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
$resql = $db->query($sqlforcount);
if ($resql) {
$objforcount = $db->fetch_object($resql);
$nbtotalofrecords = $objforcount->nbtotalofrecords;
} else {
dol_print_error($db);
}
if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
$page = 0; $page = 0;
$offset = 0; $offset = 0;
} }
$db->free($resql);
} }
// if total of record found is smaller than limit, no need to do paging and to restart another select with limits set.
if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) { // Complete request and execute it with limit
$num = $nbtotalofrecords; $sql .= $db->order($sortfield.", position", $sortorder);
} else { if ($limit) {
$sql .= $db->plimit($limit + 1, $offset); $sql .= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
if (!$resql) {
dol_print_error($db);
exit;
}
$num = $db->num_rows($resql);
} }
$param = ""; $resql = $db->query($sql);
if (!$resql) {
dol_print_error($db);
exit;
}
$num = $db->num_rows($resql);
$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage); $param .= '&contextpage='.urlencode($contextpage);
} }
@@ -138,7 +154,7 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit); $param .= '&limit='.urlencode($limit);
} }
if ($optioncss != '') { if ($optioncss != '') {
$param = '&optioncss='.urlencode($optioncss); $param .= '&optioncss='.urlencode($optioncss);
} }
$moreforfilter = ''; $moreforfilter = '';
@@ -150,7 +166,7 @@ $arrayofmassactions = array(
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"), //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
); );
if ($permissiontodelete) { if (!empty($permissiontodelete)) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete"); $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
} }
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) { if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
@@ -158,7 +174,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr
} }
$massactionbutton = $form->selectMassAction('', $arrayofmassactions); $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
if ($optioncss != '') { if ($optioncss != '') {
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">'; print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
} }
@@ -167,7 +183,9 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
print '<input type="hidden" name="action" value="list">'; print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">'; print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">'; print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">'; print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
print '<input type="hidden" name="mode" value="'.$mode.'">';
$newcardbutton = ''; $newcardbutton = '';
$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer)); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bookmarks/card.php?action=create&backtopage='.urlencode(DOL_URL_ROOT.'/bookmarks/list.php'), '', !empty($user->rights->bookmark->creer));
@@ -179,13 +197,13 @@ print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" :
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
//print "<td>&nbsp;</td>"; //print "<td>&nbsp;</td>";
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, 'align="left"', $sortfield, $sortorder); print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("Target", '', '', '', '', 'align="center"'); print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param, 'align="center"', $sortfield, $sortorder); print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "b.dateb", "", $param, '', $sortfield, $sortorder, 'center ');
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'class="right"', $sortfield, $sortorder); print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre(''); print_liste_field_titre('');
print "</tr>\n"; print "</tr>\n";
@@ -205,33 +223,31 @@ while ($i < min($num, $limit)) {
print $object->getNomUrl(1); print $object->getNomUrl(1);
print '</td>'; print '</td>';
$linkintern = 0; $linkintern = 1;
if (preg_match('/^http/i', $obj->url)) {
$linkintern = 0;
}
$title = $obj->title; $title = $obj->title;
$link = $obj->url; $link = $obj->url;
$canedit = $user->rights->bookmark->supprimer; $canedit = $user->rights->bookmark->supprimer;
$candelete = $user->rights->bookmark->creer; $candelete = $user->rights->bookmark->creer;
// Title // Title
print "<td>"; print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
$linkintern = 1; print dol_escape_htmltag($title);
if ($linkintern) {
print '<a href="'.$obj->url.'">';
}
print $title;
if ($linkintern) {
print "</a>";
}
print "</td>\n"; print "</td>\n";
// Url // Url
print '<td class="tdoverflowmax200">'; print '<td class="tdoverflowmax200">';
if (!$linkintern) { if (empty($linkintern)) {
print '<a href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>'; print img_picto('', 'url', 'class="pictofixedwidth"');
print '<a class="" href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
} else {
//print img_picto('', 'rightarrow', 'class="pictofixedwidth"');
print '<a class="" href="'.$obj->url.'">';
} }
print $link; print $link;
if (!$linkintern) { print '</a>';
print '</a>';
}
print "</td>\n"; print "</td>\n";
// Target // Target
@@ -264,7 +280,7 @@ while ($i < min($num, $limit)) {
print "</td>\n"; print "</td>\n";
// Date creation // Date creation
print '<td class="center">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>"; print '<td class="center" title="'.dol_escape_htmltag(dol_print_date($db->jdate($obj->dateb), 'dayhour')).'">'.dol_print_date($db->jdate($obj->dateb), 'day')."</td>";
// Position // Position
print '<td class="right">'.$obj->position."</td>"; print '<td class="right">'.$obj->position."</td>";

View File

@@ -4072,7 +4072,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss', 'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss',
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice', 'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda', 'timespent', 'title_setup', 'title_accountancy', 'title_bank', 'title_hrm', 'title_agenda',
'uncheck', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private', 'uncheck', 'url', 'user-cog', 'user-injured', 'user-md', 'vat', 'website', 'workstation', 'webhook', 'world', 'private',
'conferenceorbooth', 'eventorganization' 'conferenceorbooth', 'eventorganization'
))) { ))) {
$fakey = $pictowithouttext; $fakey = $pictowithouttext;
@@ -4121,7 +4121,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'supplier'=>'building', 'technic'=>'cogs', 'supplier'=>'building', 'technic'=>'cogs',
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', 'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
'title_agenda'=>'calendar-alt', 'title_agenda'=>'calendar-alt',
'uncheck'=>'times', 'uparrow'=>'share', 'vat'=>'money-check-alt', 'vcard'=>'address-card', 'uncheck'=>'times', 'uparrow'=>'share', 'url'=>'external-link-alt', 'vat'=>'money-check-alt', 'vcard'=>'address-card',
'jabber'=>'comment-o', 'jabber'=>'comment-o',
'website'=>'globe-americas', 'workstation'=>'pallet', 'webhook'=>'bullseye', 'world'=>'globe', 'private'=>'user-lock', 'website'=>'globe-americas', 'workstation'=>'pallet', 'webhook'=>'bullseye', 'world'=>'globe', 'private'=>'user-lock',
'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram' 'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram'

View File

@@ -2451,6 +2451,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
$arrayidtypeofcontact = array(); $arrayidtypeofcontact = array();
print '<!-- print_projecttasks_array -->';
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">'; print '<table class="noborder centpercent">';
@@ -2650,12 +2651,12 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
$plannedworkload = $objp->planned_workload; $plannedworkload = $objp->planned_workload;
$total_plannedworkload += $plannedworkload; $total_plannedworkload += $plannedworkload;
if (!in_array('plannedworkload', $hiddenfields)) { if (!in_array('plannedworkload', $hiddenfields)) {
print '<td class="right">'.($plannedworkload ?convertSecondToTime($plannedworkload) : '').'</td>'; print '<td class="right nowraponall">'.($plannedworkload ?convertSecondToTime($plannedworkload) : '').'</td>';
} }
if (!in_array('declaredprogress', $hiddenfields)) { if (!in_array('declaredprogress', $hiddenfields)) {
$declaredprogressworkload = $objp->declared_progess_workload; $declaredprogressworkload = $objp->declared_progess_workload;
$total_declaredprogressworkload += $declaredprogressworkload; $total_declaredprogressworkload += $declaredprogressworkload;
print '<td class="right">'; print '<td class="right nowraponall">';
//print $objp->planned_workload.'-'.$objp->declared_progess_workload."<br>"; //print $objp->planned_workload.'-'.$objp->declared_progess_workload."<br>";
print ($plannedworkload ?round(100 * $declaredprogressworkload / $plannedworkload, 0).'%' : ''); print ($plannedworkload ?round(100 * $declaredprogressworkload / $plannedworkload, 0).'%' : '');
print '</td>'; print '</td>';

View File

@@ -2409,6 +2409,7 @@ function get_left_menu_members($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=1&amp;filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=1&amp;filter=uptodate", $langs->trans("UpToDate"), 3, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=1&amp;filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=1&amp;filter=outofdate", $langs->trans("OutOfDate"), 3, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=0", $langs->trans("MenuMembersResiliated"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/list.php?leftmenu=members&amp;statut=-2", $langs->trans("MenuMembersExcluded"), 2, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'read')); $newmenu->add("/adherents/stats/index.php?leftmenu=members", $langs->trans("MenuMembersStats"), 1, $user->hasRight('adherent', 'read'));
$newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export')); $newmenu->add("/adherents/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export'));

View File

@@ -107,7 +107,7 @@ if ($nolinesbefore) {
<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?> <?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td class="linecolnum center"></td> <td class="linecolnum center"></td>
<?php } ?> <?php } ?>
<td class="linecoldescription minwidth500imp"> <td class="linecoldescription minwidth400imp">
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span> <div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span>
</td> </td>
<?php <?php
@@ -176,8 +176,7 @@ if ($nolinesbefore) {
} }
$coldisplay++; $coldisplay++;
?> ?>
<td class="nobottom linecoldescription minwidth500imp"> <td class="nobottom linecoldescription minwidth400imp">
<?php <?php
$freelines = false; $freelines = false;
if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) { if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) {

View File

@@ -35,8 +35,8 @@ DateSubscription=Date of membership
DateEndSubscription=End date of membership DateEndSubscription=End date of membership
EndSubscription=End of membership EndSubscription=End of membership
SubscriptionId=Contribution ID SubscriptionId=Contribution ID
WithoutSubscription=Without contribution WithoutSubscription=Without membership
WaitingSubscription=Waiting contribution WaitingSubscription=Membership pending
MemberId=Member Id MemberId=Member Id
MemberRef=Member Ref MemberRef=Member Ref
NewMember=New member NewMember=New member

View File

@@ -87,7 +87,7 @@ require_once __DIR__.'/class/myobject.class.php';
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array("mymodule@mymodule", "other")); $langs->loadLangs(array("mymodule@mymodule", "other"));
$action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ? $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation

View File

@@ -561,7 +561,9 @@ if ($action == 'create' && $user->rights->projet->creer) {
// Ref // Ref
$suggestedref = (GETPOST("ref") ? GETPOST("ref") : $defaultref); $suggestedref = (GETPOST("ref") ? GETPOST("ref") : $defaultref);
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td class><input class="maxwidth150onsmartphone" type="text" name="ref" value="'.dol_escape_htmltag($suggestedref).'">'; print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td class><input class="maxwidth150onsmartphone" type="text" name="ref" value="'.dol_escape_htmltag($suggestedref).'">';
print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref)); if ($suggestedref) {
print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref));
}
print '</td></tr>'; print '</td></tr>';
// Label // Label

View File

@@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com> * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
* *

View File

@@ -5163,6 +5163,10 @@ tr.visible {
/* Module website */ /* Module website */
/* ============================================================================== */ /* ============================================================================== */
.previewnotyetavailable {
opacity: 0.5;
}
.websiteformtoolbar { .websiteformtoolbar {
position: sticky; position: sticky;
top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '32px' : '52px') : '0'; ?>; top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '32px' : '52px') : '0'; ?>;

View File

@@ -5018,6 +5018,11 @@ tr.visible {
/* Module website */ /* Module website */
/* ============================================================================== */ /* ============================================================================== */
.previewnotyetavailable {
opacity: 0.5;
}
.websiteformtoolbar { .websiteformtoolbar {
position: sticky; position: sticky;
top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '36px' : '50px') : '0'; ?>; top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '36px' : '50px') : '0'; ?>;
@@ -5754,7 +5759,7 @@ ul.ecmjqft > a {
width: calc(100% - 100px); width: calc(100% - 100px);
overflow: hidden; overflow: hidden;
white-space: break-spaces; white-space: break-spaces;
word-break: break-all; word-break: break-all;
} }
ul.ecmjqft a:active { ul.ecmjqft a:active {
font-weight: bold !important; font-weight: bold !important;
@@ -6216,7 +6221,7 @@ ul.select2-results__options li {
.select2-container.select2-container--open .select2-dropdown--below { .select2-container.select2-container--open .select2-dropdown--below {
min-width: 220px !important; min-width: 220px !important;
} }
.select2-container--open .select2-dropdown--below { .select2-container--open .select2-dropdown--below {
border-top: 1px solid var(--inputbordercolor); border-top: 1px solid var(--inputbordercolor);
/* border-top: 1px solid #aaaaaa; */ /* border-top: 1px solid #aaaaaa; */

View File

@@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org> * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2022 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2021 Regis Houssin <regis.houssin@inodbox.com> * Copyright (C) 2005-2021 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk> * Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
@@ -1434,7 +1434,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '<div class="fichehalfleft">'; print '<div class="fichehalfleft">';
print '<div class="underbanner clearboth"></div>'; print '<div class="underbanner clearboth"></div>';
print '<table class="border tableforfield" width="100%">'; print '<table class="border tableforfield centpercent">';
// Login // Login
print '<tr><td class="titlefieldmiddle">'.$langs->trans("Login").'</td>'; print '<tr><td class="titlefieldmiddle">'.$langs->trans("Login").'</td>';
@@ -1739,9 +1739,11 @@ if ($action == 'create' || $action == 'adduserldap') {
print "</table>\n"; print "</table>\n";
// Credentials // Credentials
print '<br>';
print '<div class="div-table-responsive-no-min">'; print '<div class="div-table-responsive-no-min">';
print '<table class="border tableforfield margintable centpercent">'; print '<table class="border tableforfield centpercent">';
print '<tr class="liste_titre"><td class="liste_titre">'; print '<tr class="liste_titre"><td class="liste_titre">';
print img_picto('', 'security', 'class="paddingleft pictofixedwidth"').$langs->trans("Credentials"); print img_picto('', 'security', 'class="paddingleft pictofixedwidth"').$langs->trans("Credentials");
print '</td>'; print '</td>';
@@ -1749,7 +1751,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '</tr>'; print '</tr>';
// Date login validity // Date login validity
print '<tr><td>'.$langs->trans("RangeOfLoginValidity").'</td>'; print '<tr class="nooddeven"><td class="titlefield">'.$langs->trans("RangeOfLoginValidity").'</td>';
print '<td>'; print '<td>';
if ($object->datestartvalidity) { if ($object->datestartvalidity) {
print '<span class="opacitymedium">'.$langs->trans("FromDate").'</span> '; print '<span class="opacitymedium">'.$langs->trans("FromDate").'</span> ';
@@ -1763,9 +1765,6 @@ if ($action == 'create' || $action == 'adduserldap') {
print "</tr>\n"; print "</tr>\n";
// Password // Password
print '<tr><td class="titlefield">'.$langs->trans("Password").'</td>';
print '<td class="wordbreak">';
$valuetoshow = ''; $valuetoshow = '';
if (preg_match('/ldap/', $dolibarr_main_authentication)) { if (preg_match('/ldap/', $dolibarr_main_authentication)) {
if (!empty($object->ldap_sid)) { if (!empty($object->ldap_sid)) {
@@ -1785,6 +1784,7 @@ if ($action == 'create' || $action == 'adduserldap') {
if (preg_match('/http/', $dolibarr_main_authentication)) { if (preg_match('/http/', $dolibarr_main_authentication)) {
$valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("HTTPBasicPassword"); $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').$langs->trans("HTTPBasicPassword");
} }
/*
if (preg_match('/dolibarr/', $dolibarr_main_authentication)) { if (preg_match('/dolibarr/', $dolibarr_main_authentication)) {
if ($object->pass) { if ($object->pass) {
$valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : ''); $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '');
@@ -1792,15 +1792,15 @@ if ($action == 'create' || $action == 'adduserldap') {
} else { } else {
if ($user->admin && $user->id == $object->id) { if ($user->admin && $user->id == $object->id) {
$valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : ''); $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '');
//$valuetoshow .= '<span class="opacitymedium">'.$langs->trans("Crypted").' - </span>';
$valuetoshow .= '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>'; $valuetoshow .= '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
// TODO Add a feature to reveal the hash
$valuetoshow .= '<!-- Crypted into '.$object->pass_indatabase_crypted.' -->'; $valuetoshow .= '<!-- Crypted into '.$object->pass_indatabase_crypted.' -->';
} else { } else {
$valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').'<span class="opacitymedium">'.$langs->trans("Hidden").'</span>'; $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '');
$valuetoshow .= '<span class="opacitymedium">'.$langs->trans("Hidden").'</span>';
} }
} }
} }
*/
// Other form for user password // Other form for user password
$parameters = array('valuetoshow' => $valuetoshow); $parameters = array('valuetoshow' => $valuetoshow);
@@ -1811,13 +1811,17 @@ if ($action == 'create' || $action == 'adduserldap') {
$valuetoshow .= $hookmanager->resPrint; // to add $valuetoshow .= $hookmanager->resPrint; // to add
} }
print $valuetoshow; if (dol_string_nohtmltag($valuetoshow)) { // If there is a real visible content to show
print "</td>"; print '<tr class="nooddeven"><td class="titlefield">'.$langs->trans("Password").'</td>';
print '</tr>'."\n"; print '<td class="wordbreak">';
print $valuetoshow;
print "</td>";
print '</tr>'."\n";
}
// API key // API key
if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->hasRight("api", "apikey", "generate"))) { if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->hasRight("api", "apikey", "generate"))) {
print '<tr><td>'.$langs->trans("ApiKey").'</td>'; print '<tr class="nooddeven"><td>'.$langs->trans("ApiKey").'</td>';
print '<td>'; print '<td>';
if (!empty($object->api_key)) { if (!empty($object->api_key)) {
print '<span class="opacitymedium">'; print '<span class="opacitymedium">';
@@ -1827,7 +1831,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print '</td></tr>'; print '</td></tr>';
} }
print '<tr><td class="titlefield">'.$langs->trans("LastConnexion").'</td>'; print '<tr class="nooddeven"><td>'.$langs->trans("LastConnexion").'</td>';
print '<td>'; print '<td>';
if ($object->datepreviouslogin) { if ($object->datepreviouslogin) {
print dol_print_date($object->datepreviouslogin, "dayhour").' <span class="opacitymedium">('.$langs->trans("Previous").')</span>, '; print dol_print_date($object->datepreviouslogin, "dayhour").' <span class="opacitymedium">('.$langs->trans("Previous").')</span>, ';
@@ -1838,7 +1842,8 @@ if ($action == 'create' || $action == 'adduserldap') {
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
print '</table></div>'; print '</table>';
print '</div>';
print '</div>'; print '</div>';