Merged in victorsl/processmaker/PM-1711 (pull request #1656)
PM-1711 "Al ir a la siguiente pagina en los listados..." SOLVED
This commit is contained in:
@@ -338,18 +338,18 @@ class propelTable
|
||||
if (($this->style[$r]['showInTable'] != '0') && (! (in_array( $this->fields[$r]['Name'], $this->masterdetail )))) {
|
||||
//if (($this->style[$r]['showInTable'] != '0' ))
|
||||
$this->tpl->newBlock( "headers" );
|
||||
$sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'ASC')) ? 'DESC' : 'ASC');
|
||||
$sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'DESC')) ? '' : $sortOrder);
|
||||
|
||||
$sortDir = "ASC";
|
||||
|
||||
if (isset($this->aOrder[$this->fields[$r]["Name"]])) {
|
||||
$sortDir = ($this->aOrder[$this->fields[$r]["Name"]] == "ASC")? "DESC" : "ASC";
|
||||
}
|
||||
|
||||
if ($this->style[$r]['titleVisibility'] != '0') {
|
||||
$this->style[$r]['href'] = $this->ownerPage . '?order=' . ($sortOrder !== '' ? (G::createUID( '', $this->fields[$r]['Name'] ) . '=' . $sortOrder) : '') . '&page=' . $this->currentPage;
|
||||
if ($this->sortable == '0') {
|
||||
$this->style[$r]['onsort'] = $this->id . '.doSort("' . G::createUID( '', $this->fields[$r]['Name'] ) . '" , ""); return false;';;
|
||||
} else {
|
||||
$this->style[$r]['onsort'] = $this->id . '.doSort("' . G::createUID( '', $this->fields[$r]['Name'] ) . '" , "' . $sortOrder . '"); return false;';
|
||||
}
|
||||
$this->style[$r]["href"] = "javascript:;";
|
||||
$this->style[$r]["onsort"] = $this->id . ".doSort(\"" . G::createUID("", $this->fields[$r]["Name"]) . "\", \"" . (($this->sortable == "0")? "" : $sortDir) . "\"); return false;";
|
||||
} else {
|
||||
$this->style[$r]['href'] = '#';
|
||||
$this->style[$r]["href"] = "javascript:;";
|
||||
$this->style[$r]['onsort'] = 'return false;';
|
||||
}
|
||||
if (isset( $this->style[$r]['href'] )) {
|
||||
@@ -378,10 +378,14 @@ class propelTable
|
||||
$this->tpl->assign( "align", 'text-align:' . $this->style[$r]['titleAlign'] . ';' );
|
||||
}
|
||||
if ($this->style[$r]['titleVisibility'] != '0') {
|
||||
$sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'ASC')) ? '<img src="/images/arrow-up.gif">' : '');
|
||||
$sortOrder = (((isset( $this->aOrder[$this->fields[$r]['Name']] )) && ($this->aOrder[$this->fields[$r]['Name']] === 'DESC')) ? '<img src="/images/arrow-down.gif">' : $sortOrder);
|
||||
$this->tpl->assign( "header", $this->fields[$r]['Label'] . $sortOrder );
|
||||
$this->tpl->assign( 'displaySeparator', (($this->colCount == 0) || (! isset( $this->fields[$r]['Label'] )) || ($this->fields[$r]['Label'] === '')) ? 'display:none;' : '' );
|
||||
$sortDirImg = "";
|
||||
|
||||
if (isset($this->aOrder[$this->fields[$r]["Name"]])) {
|
||||
$sortDirImg = ($this->aOrder[$this->fields[$r]["Name"]] == "ASC")? "<img src=\"/images/arrow-up.gif\" />" : "<img src=\"/images/arrow-down.gif\" />";
|
||||
}
|
||||
|
||||
$this->tpl->assign("header", $this->fields[$r]["Label"] . $sortDirImg);
|
||||
$this->tpl->assign("displaySeparator", ($this->colCount == 0 || !isset($this->fields[$r]["Label"]) || $this->fields[$r]["Label"] == "")? "display: none;" : "");
|
||||
} else {
|
||||
$this->tpl->assign( 'displaySeparator', 'display:none;' );
|
||||
}
|
||||
@@ -753,29 +757,30 @@ class propelTable
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$strjsCurrentOrder = $this->id . ".currentOrder = '" . addslashes($this->orderBy) . "';";
|
||||
|
||||
$this->tpl->assign( '_ROOT.gridRows', '=' . $gridRows ); //number of rows in the current page
|
||||
$this->tpl->newBlock( 'rowTag' );
|
||||
$this->tpl->assign( 'rowId', 'insertAtLast' );
|
||||
if ($this->currentPage > 1) {
|
||||
$firstUrl = $this->ownerPage . '?order=' . $this->orderBy . '&page=1';
|
||||
$firstAjax = $this->id . ".doGoToPage(1);return false;";
|
||||
$prevpage = $this->currentPage - 1;
|
||||
$prevUrl = $this->ownerPage . '?order=' . $this->orderBy . '&page=' . $prevpage;
|
||||
$prevAjax = $this->id . ".doGoToPage(" . $prevpage . ");return false;";
|
||||
$first = "<a href=\"" . htmlentities( $firstUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $firstAjax . "\" class='firstPage'> </a>";
|
||||
$prev = "<a href=\"" . htmlentities( $prevUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $prevAjax . "\" class='previousPage'> </a>";
|
||||
|
||||
$firstAjax = $strjsCurrentOrder . $this->id . ".doGoToPage(1); return false;";
|
||||
$prevAjax = $strjsCurrentOrder . $this->id . ".doGoToPage(" . $prevpage . "); return false;";
|
||||
$first = "<a href=\"javascript:;\" onclick=\"" . $firstAjax . "\" class=\"firstPage\"> </a>";
|
||||
$prev = "<a href=\"javascript:;\" onclick=\"" . $prevAjax . "\" class=\"previousPage\"> </a>";
|
||||
} else {
|
||||
$first = "<a class='noFirstPage'> </a>";
|
||||
$prev = "<a class='noPreviousPage'> </a>";
|
||||
}
|
||||
if ($this->currentPage < $this->totPages) {
|
||||
$lastUrl = $this->ownerPage . '?order=' . $this->orderBy . '&page=' . $this->totPages;
|
||||
$lastAjax = $this->id . ".doGoToPage(" . $this->totPages . ");return false;";
|
||||
$nextpage = $this->currentPage + 1;
|
||||
$nextUrl = $this->ownerPage . '?order=' . $this->orderBy . '&page=' . $nextpage;
|
||||
$nextAjax = $this->id . ".doGoToPage(" . $nextpage . ");return false;";
|
||||
$next = "<a href=\"" . htmlentities( $nextUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $nextAjax . "\" class='nextPage'> </a>";
|
||||
$last = "<a href=\"" . htmlentities( $lastUrl, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $lastAjax . "\" class='lastPage'> </a>";
|
||||
|
||||
$nextAjax = $strjsCurrentOrder . $this->id . ".doGoToPage(" . $nextpage . "); return false;";
|
||||
$lastAjax = $strjsCurrentOrder . $this->id . ".doGoToPage(" . $this->totPages . "); return false;";
|
||||
$next = "<a href=\"javascript:;\" onclick=\"" . $nextAjax . "\" class=\"nextPage\"> </a>";
|
||||
$last = "<a href=\"javascript:;\" onclick=\"" . $lastAjax . "\" class=\"lastPage\"> </a>";
|
||||
} else {
|
||||
$next = "<a class='noNextPage'> </a>";
|
||||
$last = "<a class='noLastPage'> </a>";
|
||||
@@ -783,9 +788,10 @@ class propelTable
|
||||
$pagesEnum = '';
|
||||
for ($r = 1; $r <= $this->totPages; $r ++) {
|
||||
if (($r >= ($this->currentPage - 5)) && ($r <= ($this->currentPage + 5))) {
|
||||
$pageAjax = $this->id . ".doGoToPage(" . $r . ");return false;";
|
||||
$pageAjax = $strjsCurrentOrder . $this->id . ".doGoToPage(" . $r . "); return false;";
|
||||
|
||||
if ($r != $this->currentPage) {
|
||||
$pagesEnum .= " <a href=\"" . htmlentities( $this->ownerPage . '?order=' . $this->orderBy . '&page=' . $r, ENT_QUOTES, 'utf-8' ) . "\" onclick=\"" . $pageAjax . "\">" . $r . "</a>";
|
||||
$pagesEnum .= " <a href=\"javascript:;\" onclick=\"" . $pageAjax . "\">" . $r . "</a>";
|
||||
} else {
|
||||
$pagesEnum .= " <a>" . $r . "</a>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user