[evolvis-commits] r17658: [#2204] customize-pm-display pending merges:↵ Thorsten Glaser 2011-10-28 add dropdown-onchange to paging forms too and hide their submit button wi...

mirabilos at evolvis.org mirabilos at evolvis.org
Fri Oct 28 19:29:56 CEST 2011


Author: mirabilos
Date: 2011-10-28 19:29:56 +0200 (Fri, 28 Oct 2011)
New Revision: 17658

Modified:
   trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
   trunk/gforge_base/evolvisforge-5.1/src/www/pm/browse_task.php
   trunk/gforge_base/evolvisforge-5.1/src/www/tracker/browse.php
Log:
[#2204] customize-pm-display pending merges:
  Thorsten Glaser 2011-10-28 add dropdown-onchange to paging forms too and hide their submit button wi...


Modified: trunk/gforge_base/evolvisforge-5.1/src/debian/changelog
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2011-10-28 17:29:52 UTC (rev 17657)
+++ trunk/gforge_base/evolvisforge-5.1/src/debian/changelog	2011-10-28 17:29:56 UTC (rev 17658)
@@ -14,6 +14,7 @@
   * Change art_cust* prefs to use JSON serialisation
   * Move php-htmlpurifier dependency to gforge-common package
   * [#2204] Tracker dropdown “Quick Browse” onchange event activation
+    and ECMAscript-driven submit button hiding
   * [#2030] [#2158] Some theming improvements
   * Update lintian overrides
   * [#2030] Make boxen collapsible; some are cookie-remembered
@@ -26,7 +27,7 @@
   * [#1850] Fix merge glitch
   * [#1859] [#1906] Port code from Evolvis 4.8 to 5.1
 
- -- Thorsten Glaser <t.glaser at tarent.de>  Wed, 26 Oct 2011 15:33:07 +0200
+ -- Thorsten Glaser <t.glaser at tarent.de>  Fri, 28 Oct 2011 19:19:30 +0200
 
 fusionforge (5.1.1-1+) UNRELEASED; urgency=low
 

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/pm/browse_task.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/pm/browse_task.php	2011-10-28 17:29:52 UTC (rev 17657)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/pm/browse_task.php	2011-10-28 17:29:56 UTC (rev 17658)
@@ -333,14 +333,10 @@
 	<td> </td>
 	</tr>
 	<tr>
-	<td><input type="button" name="selectColumns" onclick="openWinSelectColumns();" value="'._('Add/Remove Columns').'" /></td>
-	<td> </td>
-	<td> </td>
-	<td> </td>
-	<td> </td>
-	<td> </td>
-	<td> </td>
-	<td> </td>
+	<td colspan="8">
+		' . _("Customise display:") . '
+		<input type="button" name="selectColumns" onclick="openWinSelectColumns();" value="'._('Add/Remove Columns').'" />
+	</td>
 	</tr>
 	</table>
 	</form>
@@ -348,12 +344,23 @@
 
 	<script language="JavaScript" type="text/javascript">/* <![CDATA[ */
 
-	document.headerForm._assigned_to.onchange = submitForm;
-document.headerForm._status.onchange = submitForm;
-document.headerForm._category_id.onchange = submitForm;
-document.headerForm._order.onchange = submitForm;
-document.headerForm._view.onchange = submitForm;
+	function submitHeaderForm() {
+		document.headerForm.submit.click();
+	}
 
+	document.headerForm._assigned_to.onchange = submitHeaderForm;
+	document.headerForm._status.onchange = submitHeaderForm;
+	document.headerForm._category_id.onchange = submitHeaderForm;
+	document.headerForm._order.onchange = submitHeaderForm;
+	document.headerForm._view.onchange = submitHeaderForm;
+
+	function submitPagingForm() {
+		document.pagingForm.setpaging.click();
+	}
+
+	document.pagingForm.nres.onchange = submitPagingForm;
+	document.pagingForm.setpaging.style.display = "none";
+
 if (gup("showAll") == "showAllSubProjects" || document.headerForm.showAll.value == "showAllSubProjects") {
 	document.headerForm.select_subprojects.selectedIndex= document.headerForm.select_subprojects.length-1;
 
@@ -369,10 +376,6 @@
 	}
 }
 
-function submitForm() {
-	document.headerForm.submit.click();
-}
-
 /* ]]> */</script>
 
  ';
@@ -388,17 +391,20 @@
 } else {
 	if (session_loggedin()) {
 		/* logged in users get configurable paging */
-		echo '<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&group_project_id='.$pg->getID().'&offset='.$offset.'" method="post">'."\n";
+		echo '<form name="pagingForm" action="' .
+		    getStringFromServer('PHP_SELF') . '?group_id=' .
+		    $group_id . '&group_project_id=' . $pg->getID() .
+		    '&offset=' . $offset . '" method="post">' . "\n";
 
 	}
 	printf('<p>' . _('Displaying results %1$d‒%2$d.'), $offset + 1, $offset + $rows);
 
 	if (session_loggedin()) {
 		printf(' ' . _('Displaying %2$s results.') . "\n\t<input " .
-		       'type="submit" name="setpaging" value="%1$s" class="hidePartForPrinting" />' .
-		       "\n</p>\n</form>\n", _('Change'),
-		       html_build_select_box_from_array(array(
-								'10', '25', '50', '100', '1000'), 'nres', $paging, 1));
+		    'type="submit" name="setpaging" value="%1$s" />' .
+		    "\n</p>\n</form>\n", _('Change'),
+		    html_build_select_box_from_array(array('10', '25', '50',
+		    '100', '1000'), 'nres', $paging, 1));
 	} else {
 		echo "</p>\n";
 	}	

Modified: trunk/gforge_base/evolvisforge-5.1/src/www/tracker/browse.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/src/www/tracker/browse.php	2011-10-28 17:29:52 UTC (rev 17657)
+++ trunk/gforge_base/evolvisforge-5.1/src/www/tracker/browse.php	2011-10-28 17:29:56 UTC (rev 17658)
@@ -238,11 +238,14 @@
 	$focus = 0;
 }
 $paging = 0;
+$paging_form = "";
 if (session_loggedin()) {
 	/* logged in users get configurable paging */
 	$paging = $u->getPreference("paging");
-	echo '<form action="'. getStringFromServer('PHP_SELF') .'?group_id='.$group_id.'&atid='.$ath->getID().'&start='.
-		$start.'" method="post">'."\n";
+	$paging_form .= '<form name="pagingForm" action="' .
+	    getStringFromServer('PHP_SELF') . '?group_id=' . $group_id .
+	    '&atid=' . $ath->getID() . '&start=' . $start .
+	    '" method="post">' . "\n";
 }
 if (!$paging) {
 	$paging = 25;
@@ -260,16 +263,16 @@
 	$max = 0;
 }
 
-printf('<p>' . _('Displaying results %1$d‒%2$d out of %3$d total.'),
+$paging_form .= sprintf('<p>' . _('Displaying results %1$d‒%2$d out of %3$d total.'),
        $start + 1, $max, $art_cnt);
 if (session_loggedin()) {
-	printf(' ' . _('Displaying %2$s results.') . "\n\t<input " .
-	       'type="submit" name="setpaging" value="%1$s" class="hidePartForPrinting" />' .
-	       "\n</p>\n</form>\n", _('Change'),
-	       html_build_select_box_from_array(array(
-							'10', '25', '50', '100', '1000'), 'nres', $paging, 1));
+	$paging_form .= sprintf(' ' . _('Displaying %2$s results.') . "\n\t<input " .
+	    'type="submit" name="setpaging" value="%1$s" />' .
+	    "\n</p>\n</form>\n", _('Change'),
+	    html_build_select_box_from_array(array('10', '25', '50',
+	    '100', '1000'), 'nres', $paging, 1));
 } else {
-	echo "</p>\n";
+	$paging_form .= "</p>\n";
 }
 
 /**
@@ -421,17 +424,26 @@
 	</table>
 	</form>
 
+	<div>'.$paging_form.'</div>
+
 	<script type="text/javascript">//<![CDATA[
 
-	function submitForm() {
+	function submitHeaderForm() {
 		document.headerForm.submit.click();
 	}
 
-	document.headerForm._assigned_to.onchange = submitForm;
-	document.headerForm.elements["'.$status_box_name.'"].onchange = submitForm;
-	document.headerForm._sort_col.onchange = submitForm;
-	document.headerForm._sort_ord.onchange = submitForm;
+	document.headerForm._assigned_to.onchange = submitHeaderForm;
+	document.headerForm.elements["'.$status_box_name.'"].onchange = submitHeaderForm;
+	document.headerForm._sort_col.onchange = submitHeaderForm;
+	document.headerForm._sort_ord.onchange = submitHeaderForm;
 
+	function submitPagingForm() {
+		document.pagingForm.setpaging.click();
+	}
+
+	document.pagingForm.nres.onchange = submitPagingForm;
+	document.pagingForm.setpaging.style.display = "none";
+
 	//]]></script>
 
 	</div>';



More information about the evolvis-commits mailing list