Skip to content

Commit

Permalink
Debug v17
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 3, 2022
1 parent 57feb24 commit d0a824c
Show file tree
Hide file tree
Showing 13 changed files with 113 additions and 79 deletions.
7 changes: 4 additions & 3 deletions htdocs/bookmarks/card.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/* 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>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -186,7 +186,7 @@
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>';

// Owner
// Visibility / Owner
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 '</td><td class="hideonsmartphone"></td></tr>';
Expand Down Expand Up @@ -279,9 +279,10 @@
}
print '</td></tr>';

// Visibility / owner
print '<tr><td>'.$langs->trans("Visibility").'</td><td>';
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 {
if ($object->fk_user > 0) {
$fuser = new User($db);
Expand Down
108 changes: 62 additions & 46 deletions htdocs/bookmarks/list.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?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
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -39,13 +39,14 @@
$optioncss = GETPOST('optioncss', 'alpha');

// 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');
$sortorder = GETPOST('sortorder', 'aZ09comma');
$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;
} // 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;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand All @@ -72,6 +73,14 @@
* Actions
*/

if (GETPOST('cancel', 'alpha')) {
$action = 'list';
$massaction = '';
}
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
$massaction = '';
}

if ($action == 'delete') {
$res = $object->remove($id);
if ($res > 0) {
Expand Down Expand Up @@ -103,42 +112,49 @@
$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
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
/* The fast and low memory method to get and count full list converts the sql into a sql count */
$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
$page = 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) {
$num = $nbtotalofrecords;
} else {
$sql .= $db->plimit($limit + 1, $offset);

$resql = $db->query($sql);
if (!$resql) {
dol_print_error($db);
exit;
}
// Complete request and execute it with limit
$sql .= $db->order($sortfield.", position", $sortorder);
if ($limit) {
$sql .= $db->plimit($limit + 1, $offset);
}

$num = $db->num_rows($resql);
$resql = $db->query($sql);
if (!$resql) {
dol_print_error($db);
exit;
}

$param = "";
$num = $db->num_rows($resql);

$param = '';
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
$param .= '&contextpage='.urlencode($contextpage);
}
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.urlencode($limit);
}
if ($optioncss != '') {
$param = '&optioncss='.urlencode($optioncss);
$param .= '&optioncss='.urlencode($optioncss);
}

$moreforfilter = '';
Expand All @@ -150,15 +166,15 @@
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
);
if ($permissiontodelete) {
if (!empty($permissiontodelete)) {
$arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
$arrayofmassactions = array();
}
$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 != '') {
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
}
Expand All @@ -167,7 +183,9 @@
print '<input type="hidden" name="action" value="list">';
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
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="mode" value="'.$mode.'">';

$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));
Expand All @@ -179,13 +197,13 @@

print '<tr class="liste_titre">';
//print "<td>&nbsp;</td>";
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, 'align="left"', $sortfield, $sortorder);
print_liste_field_titre("Title", $_SERVER["PHP_SELF"], "b.title", "", $param, 'align="left"', $sortfield, $sortorder);
print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, 'align="left"', $sortfield, $sortorder);
print_liste_field_titre("Target", '', '', '', '', 'align="center"');
print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "b.dateb", "", $param, 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, 'class="right"', $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, '', $sortfield, $sortorder);
print_liste_field_titre("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
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, '', $sortfield, $sortorder, 'center ');
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, '', $sortfield, $sortorder, 'right ');
print_liste_field_titre('');
print "</tr>\n";

Expand All @@ -205,33 +223,31 @@
print $object->getNomUrl(1);
print '</td>';

$linkintern = 0;
$linkintern = 1;
if (preg_match('/^http/i', $obj->url)) {
$linkintern = 0;
}
$title = $obj->title;
$link = $obj->url;
$canedit = $user->rights->bookmark->supprimer;
$candelete = $user->rights->bookmark->creer;

// Title
print "<td>";
$linkintern = 1;
if ($linkintern) {
print '<a href="'.$obj->url.'">';
}
print $title;
if ($linkintern) {
print "</a>";
}
print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
print dol_escape_htmltag($title);
print "</td>\n";

// Url
print '<td class="tdoverflowmax200">';
if (!$linkintern) {
print '<a href="'.$obj->url.'"'.($obj->target ? ' target="newlink" rel="noopener"' : '').'>';
if (empty($linkintern)) {
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;
if (!$linkintern) {
print '</a>';
}
print '</a>';
print "</td>\n";

// Target
Expand Down Expand Up @@ -264,7 +280,7 @@
print "</td>\n";

// 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
print '<td class="right">'.$obj->position."</td>";
Expand Down
4 changes: 2 additions & 2 deletions htdocs/core/lib/functions.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4072,7 +4072,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'recent', 'reception', 'recruitmentcandidature', 'recruitmentjobposition', 'replacement', 'resource', 'recurring','rss',
'shapes', 'square', 'stop-circle', 'supplier', 'supplier_proposal', 'supplier_order', 'supplier_invoice',
'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'
))) {
$fakey = $pictowithouttext;
Expand Down Expand Up @@ -4121,7 +4121,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'supplier'=>'building', 'technic'=>'cogs',
'timespent'=>'clock', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach',
'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',
'website'=>'globe-americas', 'workstation'=>'pallet', 'webhook'=>'bullseye', 'world'=>'globe', 'private'=>'user-lock',
'conferenceorbooth'=>'chalkboard-teacher', 'eventorganization'=>'project-diagram'
Expand Down
5 changes: 3 additions & 2 deletions htdocs/core/lib/project.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2451,6 +2451,7 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks

$arrayidtypeofcontact = array();

print '<!-- print_projecttasks_array -->';
print '<div class="div-table-responsive-no-min">';
print '<table class="noborder centpercent">';

Expand Down Expand Up @@ -2650,12 +2651,12 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
$plannedworkload = $objp->planned_workload;
$total_plannedworkload += $plannedworkload;
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)) {
$declaredprogressworkload = $objp->declared_progess_workload;
$total_declaredprogressworkload += $declaredprogressworkload;
print '<td class="right">';
print '<td class="right nowraponall">';
//print $objp->planned_workload.'-'.$objp->declared_progess_workload."<br>";
print ($plannedworkload ?round(100 * $declaredprogressworkload / $plannedworkload, 0).'%' : '');
print '</td>';
Expand Down
1 change: 1 addition & 0 deletions htdocs/core/menus/standard/eldy.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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=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=-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/cartes/carte.php?leftmenu=export", $langs->trans("MembersCards"), 1, $user->hasRight('adherent', 'export'));
Expand Down
5 changes: 2 additions & 3 deletions htdocs/core/tpl/objectline_create.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<?php if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) { ?>
<td class="linecolnum center"></td>
<?php } ?>
<td class="linecoldescription minwidth500imp">
<td class="linecoldescription minwidth400imp">
<div id="add"></div><span class="hideonsmartphone"><?php echo $langs->trans('AddNewLine'); ?></span>
</td>
<?php
Expand Down Expand Up @@ -176,8 +176,7 @@
}
$coldisplay++;
?>
<td class="nobottom linecoldescription minwidth500imp">

<td class="nobottom linecoldescription minwidth400imp">
<?php
$freelines = false;
if (empty($conf->global->MAIN_DISABLE_FREE_LINES)) {
Expand Down
4 changes: 2 additions & 2 deletions htdocs/langs/en_US/members.lang
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ DateSubscription=Date of membership
DateEndSubscription=End date of membership
EndSubscription=End of membership
SubscriptionId=Contribution ID
WithoutSubscription=Without contribution
WaitingSubscription=Waiting contribution
WithoutSubscription=Without membership
WaitingSubscription=Membership pending
MemberId=Member Id
MemberRef=Member Ref
NewMember=New member
Expand Down
2 changes: 1 addition & 1 deletion htdocs/modulebuilder/template/myobject_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
// Load translation files required by the page
$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)
$show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
Expand Down
4 changes: 3 additions & 1 deletion htdocs/projet/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,9 @@
// Ref
$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 ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref));
if ($suggestedref) {
print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref));
}
print '</td></tr>';

// Label
Expand Down
2 changes: 1 addition & 1 deletion htdocs/projet/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/* 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) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
*
Expand Down
4 changes: 4 additions & 0 deletions htdocs/theme/eldy/global.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -5163,6 +5163,10 @@
/* Module website */
/* ============================================================================== */

.previewnotyetavailable {
opacity: 0.5;
}

.websiteformtoolbar {
position: sticky;
top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '32px' : '52px') : '0'; ?>;
Expand Down
9 changes: 7 additions & 2 deletions htdocs/theme/md/style.css.php
Original file line number Diff line number Diff line change
Expand Up @@ -5018,6 +5018,11 @@
/* Module website */
/* ============================================================================== */


.previewnotyetavailable {
opacity: 0.5;
}

.websiteformtoolbar {
position: sticky;
top: <?php echo empty($dol_hide_topmenu) ? ($disableimages ? '36px' : '50px') : '0'; ?>;
Expand Down Expand Up @@ -5754,7 +5759,7 @@
width: calc(100% - 100px);
overflow: hidden;
white-space: break-spaces;
word-break: break-all;
word-break: break-all;
}
ul.ecmjqft a:active {
font-weight: bold !important;
Expand Down Expand Up @@ -6216,7 +6221,7 @@
.select2-container.select2-container--open .select2-dropdown--below {
min-width: 220px !important;
}

.select2-container--open .select2-dropdown--below {
border-top: 1px solid var(--inputbordercolor);
/* border-top: 1px solid #aaaaaa; */
Expand Down
Loading

0 comments on commit d0a824c

Please sign in to comment.