Debug v17
This commit is contained in:
parent
b74d9829d1
commit
767b1d60d9
@ -33,11 +33,14 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
$massaction = GETPOST('massaction', 'alpha');
|
$massaction = GETPOST('massaction', 'alpha');
|
||||||
$show_files = GETPOST('show_files', 'int');
|
$show_files = GETPOST('show_files', 'int');
|
||||||
$confirm = GETPOST('confirm', 'alpha');
|
$confirm = GETPOST('confirm', 'alpha');
|
||||||
|
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||||
$toselect = GETPOST('toselect', 'array');
|
$toselect = GETPOST('toselect', 'array');
|
||||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search
|
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'bookmarklist'; // To manage different context of search
|
||||||
$id = GETPOST("id", 'int');
|
$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
|
||||||
$optioncss = GETPOST('optioncss', 'alpha');
|
$optioncss = GETPOST('optioncss', 'alpha');
|
||||||
$mode = GETPOST('mode', 'aZ09');
|
$mode = GETPOST('mode', 'aZ');
|
||||||
|
|
||||||
|
$id = GETPOST("id", 'int');
|
||||||
|
|
||||||
// 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;
|
||||||
@ -60,10 +63,17 @@ if (!$sortorder) {
|
|||||||
|
|
||||||
// Initialize Objects
|
// Initialize Objects
|
||||||
$object = new Bookmark($db);
|
$object = new Bookmark($db);
|
||||||
|
$extrafields = new ExtraFields($db);
|
||||||
|
$arrayfields = array();
|
||||||
|
$hookmanager->initHooks(array('bookmarklist')); // Note that conf->hooks_modules contains array
|
||||||
|
|
||||||
if ($id > 0) {
|
if ($id > 0) {
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$object->fields = dol_sort_array($object->fields, 'position');
|
||||||
|
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
restrictedArea($user, 'bookmark', $object);
|
restrictedArea($user, 'bookmark', $object);
|
||||||
|
|
||||||
@ -85,18 +95,39 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa
|
|||||||
$massaction = '';
|
$massaction = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'delete' && $permissiontodelete) {
|
$parameters = array();
|
||||||
$object->fetch($id);
|
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
$res = $object->delete($user);
|
if ($reshook < 0) {
|
||||||
if ($res > 0) {
|
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
|
||||||
exit;
|
|
||||||
} else {
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
$action = '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($reshook)) {
|
||||||
|
// Selection of new fields
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
|
||||||
|
|
||||||
|
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
||||||
|
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
|
||||||
|
$massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mass actions
|
||||||
|
$objectclass = 'Bookmark';
|
||||||
|
$objectlabel = 'Bookmark';
|
||||||
|
$uploaddir = $conf->bookmark->dir_output;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
|
if ($action == 'delete' && $permissiontodelete) {
|
||||||
|
$object->fetch($id);
|
||||||
|
$res = $object->delete($user);
|
||||||
|
if ($res > 0) {
|
||||||
|
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||||
|
exit;
|
||||||
|
} else {
|
||||||
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
|
$action = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -105,16 +136,34 @@ if ($action == 'delete' && $permissiontodelete) {
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
|
$now = dol_now();
|
||||||
|
|
||||||
|
//$help_url = "EN:Module_MyObject|FR:Module_MyObject_FR|ES:Módulo_MyObject";
|
||||||
|
$help_url = '';
|
||||||
$title = $langs->trans("Bookmarks");
|
$title = $langs->trans("Bookmarks");
|
||||||
|
$morejs = array();
|
||||||
|
$morecss = array();
|
||||||
|
|
||||||
llxHeader('', $title);
|
|
||||||
|
|
||||||
|
// Build and execute select
|
||||||
|
// --------------------------------------------------------------------
|
||||||
$sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
|
$sql = "SELECT b.rowid, b.dateb, b.fk_user, b.url, b.target, b.title, b.favicon, b.position,";
|
||||||
$sql .= " u.login, u.lastname, u.firstname";
|
$sql .= " u.login, u.lastname, u.firstname";
|
||||||
|
// 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 : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Add fields from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
||||||
|
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||||
|
|
||||||
$sqlfields = $sql; // $sql fields to remove for count total
|
$sqlfields = $sql; // $sql fields to remove for count total
|
||||||
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."bookmark as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
|
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as b LEFT JOIN ".MAIN_DB_PREFIX."user as u ON b.fk_user=u.rowid";
|
||||||
$sql .= " WHERE 1=1";
|
$sql .= " WHERE 1=1";
|
||||||
$sql .= " AND b.entity IN (".getEntity('bookmark').")";
|
$sql .= " AND b.entity IN (".getEntity('bookmark').")";
|
||||||
if (!$user->admin) {
|
if (!$user->admin) {
|
||||||
@ -156,7 +205,18 @@ if (!$resql) {
|
|||||||
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
|
|
||||||
|
// Output page
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
|
||||||
|
llxHeader('', $title);
|
||||||
|
|
||||||
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
|
if (!empty($mode)) {
|
||||||
|
$param .= '&mode='.urlencode($mode);
|
||||||
|
}
|
||||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||||
$param .= '&contextpage='.urlencode($contextpage);
|
$param .= '&contextpage='.urlencode($contextpage);
|
||||||
}
|
}
|
||||||
@ -166,8 +226,12 @@ if ($limit > 0 && $limit != $conf->liste_limit) {
|
|||||||
if ($optioncss != '') {
|
if ($optioncss != '') {
|
||||||
$param .= '&optioncss='.urlencode($optioncss);
|
$param .= '&optioncss='.urlencode($optioncss);
|
||||||
}
|
}
|
||||||
|
// Add $param from extra fields
|
||||||
$moreforfilter = '';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||||
|
// Add $param from hooks
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
$param .= $hookmanager->resPrint;
|
||||||
|
|
||||||
// List of mass actions available
|
// List of mass actions available
|
||||||
$arrayofmassactions = array(
|
$arrayofmassactions = array(
|
||||||
@ -195,18 +259,59 @@ 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="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||||
|
print '<input type="hidden" name="page_y" value="">';
|
||||||
print '<input type="hidden" name="mode" value="'.$mode.'">';
|
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'), '', $permissiontoadd);
|
$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'), '', $permissiontoadd);
|
||||||
|
|
||||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bookmark', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||||
|
|
||||||
print '<div class="div-table-responsive">';
|
// Add code for pre mass action (confirmation or email presend form)
|
||||||
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
$topicmail = "SendBookmarkRef";
|
||||||
|
$modelmail = "bookmark";
|
||||||
|
$objecttmp = new Bookmark($db);
|
||||||
|
$trackid = 'bookmark'.$object->id;
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||||
|
|
||||||
|
$moreforfilter = '';
|
||||||
|
|
||||||
|
$parameters = array();
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||||
|
if (empty($reshook)) {
|
||||||
|
$moreforfilter .= $hookmanager->resPrint;
|
||||||
|
} else {
|
||||||
|
$moreforfilter = $hookmanager->resPrint;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!empty($moreforfilter)) {
|
||||||
|
print '<div class="liste_titre liste_titre_bydiv centpercent">';
|
||||||
|
print $moreforfilter;
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||||
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
|
||||||
|
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||||
|
|
||||||
|
print '<div class="div-table-responsive">';
|
||||||
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
|
// Fields title search
|
||||||
|
// --------------------------------------------------------------------
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
|
||||||
|
// Fields title label
|
||||||
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
//print "<td> </td>";
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
|
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "b.rowid", "", $param, '', $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("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("Link", $_SERVER["PHP_SELF"], "b.url", "", $param, '', $sortfield, $sortorder);
|
||||||
@ -214,102 +319,176 @@ print_liste_field_titre("Target", $_SERVER["PHP_SELF"], "b.target", "", $param,
|
|||||||
print_liste_field_titre("Visibility", $_SERVER["PHP_SELF"], "u.lastname", "", $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("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("Position", $_SERVER["PHP_SELF"], "b.position", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
print_liste_field_titre('');
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print "</tr>\n";
|
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
|
||||||
|
// Loop on record
|
||||||
|
// --------------------------------------------------------------------
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < min($num, $limit)) {
|
$savnbfield = $totalarray['nbfield'];
|
||||||
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
$imaxinloop = ($limit ? min($num, $limit) : $num);
|
||||||
|
while ($i < $imaxinloop) {
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
if (empty($obj)) {
|
||||||
|
break; // Should not happen
|
||||||
|
}
|
||||||
|
|
||||||
$object->id = $obj->rowid;
|
$object->id = $obj->rowid;
|
||||||
$object->ref = $obj->rowid;
|
$object->ref = $obj->rowid;
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
if ($mode == 'kanban') {
|
||||||
|
if ($i == 0) {
|
||||||
// Id
|
print '<tr><td colspan="'.$savnbfield.'">';
|
||||||
print '<td class="nowraponall">';
|
print '<div class="box-flex-container">';
|
||||||
print $object->getNomUrl(1);
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
$linkintern = 1;
|
|
||||||
if (preg_match('/^http/i', $obj->url)) {
|
|
||||||
$linkintern = 0;
|
|
||||||
}
|
|
||||||
$title = $obj->title;
|
|
||||||
$link = $obj->url;
|
|
||||||
$canedit = $permissiontoadd;
|
|
||||||
$candelete = $permissiontodelete;
|
|
||||||
|
|
||||||
// Title
|
|
||||||
print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
|
|
||||||
print dol_escape_htmltag($title);
|
|
||||||
print "</td>\n";
|
|
||||||
|
|
||||||
// Url
|
|
||||||
print '<td class="tdoverflowmax200">';
|
|
||||||
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;
|
|
||||||
print '</a>';
|
|
||||||
print "</td>\n";
|
|
||||||
|
|
||||||
// Target
|
|
||||||
print '<td class="center">';
|
|
||||||
if ($obj->target == 0) {
|
|
||||||
print $langs->trans("BookmarkTargetReplaceWindowShort");
|
|
||||||
}
|
|
||||||
if ($obj->target == 1) {
|
|
||||||
print $langs->trans("BookmarkTargetNewWindowShort");
|
|
||||||
}
|
|
||||||
print "</td>\n";
|
|
||||||
|
|
||||||
// Author
|
|
||||||
print '<td class="center">';
|
|
||||||
if ($obj->fk_user > 0) {
|
|
||||||
if (empty($conf->cache['users'][$obj->fk_user])) {
|
|
||||||
$tmpuser = new User($db);
|
|
||||||
$tmpuser->fetch($obj->fk_user);
|
|
||||||
$conf->cache['users'][$obj->fk_user] = $tmpuser;
|
|
||||||
}
|
}
|
||||||
$tmpuser = $conf->cache['users'][$obj->fk_user];
|
// Output Kanban
|
||||||
print $tmpuser->getNomUrl(-1);
|
print $object->getKanbanView('');
|
||||||
} else {
|
if ($i == ($imaxinloop - 1)) {
|
||||||
print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
|
print '</div>';
|
||||||
if (!$user->admin) {
|
print '</td></tr>';
|
||||||
$candelete = false;
|
}
|
||||||
$canedit = false;
|
} else {
|
||||||
|
// Show here line of result
|
||||||
|
$j = 0;
|
||||||
|
print '<tr data-rowid="'.$object->id.'" class="oddeven">';
|
||||||
|
// Action column
|
||||||
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
|
print '<td class="nowrap center">';
|
||||||
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
print "</td>\n";
|
|
||||||
|
|
||||||
// Date creation
|
// Id
|
||||||
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>";
|
print '<td class="nowraponall">';
|
||||||
|
print $object->getNomUrl(1);
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Position
|
$linkintern = 1;
|
||||||
print '<td class="right">'.$obj->position."</td>";
|
if (preg_match('/^http/i', $obj->url)) {
|
||||||
|
$linkintern = 0;
|
||||||
|
}
|
||||||
|
$title = $obj->title;
|
||||||
|
$link = $obj->url;
|
||||||
|
$canedit = $permissiontoadd;
|
||||||
|
$candelete = $permissiontodelete;
|
||||||
|
|
||||||
// Actions
|
// Title
|
||||||
print '<td class="nowraponall right">';
|
print '<td class="tdoverflowmax200" alt="'.dol_escape_htmltag($title).'">';
|
||||||
if ($canedit) {
|
print dol_escape_htmltag($title);
|
||||||
print '<a class="editfielda marginleftonly marginrightonly" href="'.DOL_URL_ROOT.'/bookmarks/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
|
print "</td>\n";
|
||||||
|
|
||||||
|
// Url
|
||||||
|
print '<td class="tdoverflowmax200">';
|
||||||
|
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;
|
||||||
|
print '</a>';
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
// Target
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($obj->target == 0) {
|
||||||
|
print $langs->trans("BookmarkTargetReplaceWindowShort");
|
||||||
|
}
|
||||||
|
if ($obj->target == 1) {
|
||||||
|
print $langs->trans("BookmarkTargetNewWindowShort");
|
||||||
|
}
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
// Author
|
||||||
|
print '<td class="center">';
|
||||||
|
if ($obj->fk_user > 0) {
|
||||||
|
if (empty($conf->cache['users'][$obj->fk_user])) {
|
||||||
|
$tmpuser = new User($db);
|
||||||
|
$tmpuser->fetch($obj->fk_user);
|
||||||
|
$conf->cache['users'][$obj->fk_user] = $tmpuser;
|
||||||
|
}
|
||||||
|
$tmpuser = $conf->cache['users'][$obj->fk_user];
|
||||||
|
print $tmpuser->getNomUrl(-1);
|
||||||
|
} else {
|
||||||
|
print '<span class="opacitymedium">'.$langs->trans("Everybody").'</span>';
|
||||||
|
if (!$user->admin) {
|
||||||
|
$candelete = false;
|
||||||
|
$canedit = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print "</td>\n";
|
||||||
|
|
||||||
|
// Date creation
|
||||||
|
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>";
|
||||||
|
|
||||||
|
// Action column
|
||||||
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
|
print '<td class="nowrap center">';
|
||||||
|
if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
$selected = 0;
|
||||||
|
if (in_array($object->id, $arrayofselected)) {
|
||||||
|
$selected = 1;
|
||||||
|
}
|
||||||
|
print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
if (!$i) {
|
||||||
|
$totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
if ($candelete) {
|
|
||||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$obj->rowid.'">'.img_delete().'</a>';
|
|
||||||
}
|
|
||||||
print "</td>";
|
|
||||||
print "</tr>\n";
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print "</table>";
|
|
||||||
print '</div>';
|
// Show total line
|
||||||
|
include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
|
||||||
|
|
||||||
|
// If no record found
|
||||||
|
if ($num == 0) {
|
||||||
|
$colspan = 1;
|
||||||
|
foreach ($arrayfields as $key => $val) {
|
||||||
|
if (!empty($val['checked'])) {
|
||||||
|
$colspan++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
|
||||||
|
}
|
||||||
|
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
|
|
||||||
|
$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
|
||||||
|
$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
|
print $hookmanager->resPrint;
|
||||||
|
|
||||||
|
print '</table>'."\n";
|
||||||
|
print '</div>'."\n";
|
||||||
|
|
||||||
|
print '</form>'."\n";
|
||||||
|
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -684,7 +684,6 @@ if (!$error && $massaction == 'cancelorders') {
|
|||||||
|
|
||||||
$nbok = 0;
|
$nbok = 0;
|
||||||
|
|
||||||
|
|
||||||
$orders = GETPOST('toselect', 'array');
|
$orders = GETPOST('toselect', 'array');
|
||||||
foreach ($orders as $id_order) {
|
foreach ($orders as $id_order) {
|
||||||
$cmd = new Commande($db);
|
$cmd = new Commande($db);
|
||||||
|
|||||||
@ -8534,6 +8534,9 @@ class Form
|
|||||||
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
if (empty($array)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
|
$tmpvar = "MAIN_SELECTEDFIELDS_".$varpage; // To get list of saved selected fields to show
|
||||||
|
|
||||||
|
|||||||
@ -247,6 +247,9 @@ if (empty($reshook)) {
|
|||||||
$objectlabel = 'MyObject';
|
$objectlabel = 'MyObject';
|
||||||
$uploaddir = $conf->mymodule->dir_output;
|
$uploaddir = $conf->mymodule->dir_output;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||||
|
|
||||||
|
// You can add more action here
|
||||||
|
// if ($action == 'xxx' && $permissiontoxxx) ...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -547,7 +550,6 @@ $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('che
|
|||||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
|
|
||||||
// Fields title search
|
// Fields title search
|
||||||
// --------------------------------------------------------------------
|
// --------------------------------------------------------------------
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -620,6 +622,7 @@ $totalarray['nbfield'] = 0;
|
|||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
foreach ($object->fields as $key => $val) {
|
foreach ($object->fields as $key => $val) {
|
||||||
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
$cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
|
||||||
@ -651,10 +654,12 @@ print $hookmanager->resPrint;
|
|||||||
// Action column
|
// Action column
|
||||||
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
|
||||||
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
|
||||||
|
$totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
$totalarray['nbfield']++;
|
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
|
$totalarray = array();
|
||||||
|
$totalarray['nbfield'] = 0;
|
||||||
|
|
||||||
// Detect if we need a fetch on each output line
|
// Detect if we need a fetch on each output line
|
||||||
$needToFetchEachLine = 0;
|
$needToFetchEachLine = 0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user