From 60b90d01cd6ab67d7966b2c5ac71dd33ed9e5d54 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 9 Dec 2006 21:17:34 +0000 Subject: [PATCH] r1338: Incomplete JavaScript implementation of column ordering options --- docs/arrow_solid.psd | Bin 0 -> 31974 bytes docs/schema_changes.sql | 2 ++ includes/api_user.php | 18 ++++++++++++- includes/init.php | 1 + includes/permissions.php | 30 ++++++++++++++++++++++ templates/images/arrow_down.gif | Bin 0 -> 60 bytes templates/images/arrow_up.gif | Bin 0 -> 60 bytes templates/userctrl.tpl | 43 +++++++++++++++++++++++++++++--- userctrl.php | 20 ++++++++++++++- 9 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 docs/arrow_solid.psd create mode 100644 templates/images/arrow_down.gif create mode 100644 templates/images/arrow_up.gif diff --git a/docs/arrow_solid.psd b/docs/arrow_solid.psd new file mode 100644 index 0000000000000000000000000000000000000000..52a8d5542c7115ea3b29004be8d0713c9f00b8ec GIT binary patch literal 31974 zcmeG_2Y6J))^oRJH=CZ&%Mv;y*_N#&A;~5ofdoPdO%yh}H_5^_wvb{+LmQC5?FkZ;HL-rZ60&v#V4p`FRq@~ zKyZC9PCYSeXroQ1pGrH0HFTZPlAZd)>swQWMniV$Sb3Sa%%-L5jm6D&y0Up>mA-kZ zUTsJnn#0d()HIrHX4HY#uqahXNSsr%Q)L;F3`x2~B2CTV z3x&cgyP;N7QBdTK38C!NdZ*K-5s4Za8ZsJW8CH9pNTOD&MPjK)DoqE9bVrlLscTHP zIC^`S`1lmi4!zxIa~iD{A?B;AvAUeusi`<2|K$zHc``1Pc2)Y<%ETO8h$^;WY85FoNRRAc~Zw02tOwA!nzR#Q$ME)!w7Pf($@QYtLd z>5UdFcoyanLLSgsmLEkI=$v$pR4i7ci#K$k!XO8T%Img`FR9Uw&Vc@WzacwH^e2F_75nGva}~te66HVD=k#2r3DJ5RxT%64UHG76Tp>N98R4@ zPy2XE@|DUwty-#5i`AH?xq}7)`~ILnk$BC z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;2_uNC~VZ}op_ELhf$f+ zsSV}f`PZk>E}a3;xV1(3CZTVgg0yDC?3R#lg&`DQWw$tdljzYpgQ3j(pMpLZAFm}; z&<2;D_Q{ce=h*C3SaO){a@wt?5TOzR8S|n+ESx`q308Ay13?GpQ{bpK);bG;lhMCI zg0m6_6KVCdJGE;YLerVb6h%(6{ZhodQomB3;x)4|7qBpW^|9*E}2mxq#=LZTh3 z4bKI(%t9hjXb1-9q7wd}6CNp`QIi$cBFc2|>ASsLM?OaMCDqj#w9MH;71!5Lr&eN{ zVd=}KENn+{4RlQPC@{dU20VSe&SIfWo@Fa{^r6Y7f$VGD)8Nmsg!#XC6zF)sWydyFW(` zK9QpoTgIQQ1v2tkhP8vz&9IaN&p_M5@~(Gc^W%EI!|+g|zLy^;V1qe39LkHqNq-d#ToM+dzf$RROgNyiqt7 zzK9N15^pzitsT~fNNW|8XWvkg3FB%ea$f}s7}F9n$Lsphc*qD(&#H6}LfwP#AYTMn zVE?!qCe7j6gB`dAK&J^Yu79%()&{(yi)A#qELb)H+${1E(ts=k-eknJ7Hf&Doa;?B zIDagxY>bBuIE`LB2~V|5^;J?2Ux%$W7;n;>@S1pterg--Hh^KBkZbE%pO3tg;I#1< z4>zOj}>jfZo>#@_OK-@di97 z+!(t3WSE5X)Luw9*jD2a?u40#RcjJ?1t4aN{Q)6}&m&$NSWJPnUJkt=_Jh6SKjHTL zI8Zb2&le7T{?6E++`ivM$ihYUC8(O0+?U;#(Pj4)_eFHYkN44eo__!}`pNsd2 array(TYPE_BOOL, REQ_NO), 'hidestatuses' => array(TYPE_STR, REQ_NO, ':self'), 'defaultsortkey' => array(TYPE_STR, REQ_NO, ':self'), - 'defaultsortas' => array(TYPE_STR, REQ_NO, ':self') + 'defaultsortas' => array(TYPE_STR, REQ_NO, ':self'), + 'columnoptions' => array(TYPE_STR, REQ_NO, ':self') ); /** @@ -314,6 +315,21 @@ class UserAPI extends API return true; } + + // ################################################################### + /** + * Verify: columnoptions + * + * @access private + */ + function verify_columnoptions() + { + if (is_array($this->values['columnoptiopns'])) + { + $this->set('columnoptions', serialize($this->values['columnoptions'])); + } + return true; + } } /*=====================================================================*\ diff --git a/includes/init.php b/includes/init.php index dcf4dca..783f9b8 100755 --- a/includes/init.php +++ b/includes/init.php @@ -110,6 +110,7 @@ if ($userid) $userinfo['permissions'] = (int)$bugsys->datastore['usergroup']["$userinfo[usergroupid]"]['permissions']; $userinfo['displaytitle'] = $bugsys->datastore['usergroup']["$userinfo[usergroupid]"]['displaytitle']; $bugsys->userinfo = $userinfo; + $bugsys->userinfo['columnoptions'] = unserialize($bugsys->userinfo['columnoptions']); $funct->cookie(COOKIE_PREFIX . 'userid', $bugsys->userinfo['userid']); $funct->cookie(COOKIE_PREFIX . 'authkey', $bugsys->userinfo['authkey']); } diff --git a/includes/permissions.php b/includes/permissions.php index 8ef5a2b..fbd9353 100644 --- a/includes/permissions.php +++ b/includes/permissions.php @@ -71,6 +71,36 @@ $bugsys->emailoptions = array( ) ); +$bugsys->columns = array( + 'bugid' => 1, + 'summary' => 2, + 'userid' => 4, + 'product' => 8, + 'component' => 16, + 'version' => 32, + 'status' => 64, + 'resolution' => 128, + 'priority' => 256, + 'severity' => 512, + 'lastpost' => 1024, + 'votes' => 2048 +); + +$bugsys->columnNames = array( + 'bugid' => _('Bug ID'), + 'summary' => _('Summary'), + 'userid' => _('Reporter'), + 'product' => _('Product'), + 'component' => _('Component'), + 'version' => _('Version'), + 'status' => _('Status'), + 'resolution' => _('Resolution'), + 'priority' => _('Priority'), + 'severity' => _('Severity'), + 'lastpost' => _('Last Post'), + 'votes' => _('Votes') +); + /*=====================================================================*\ || ################################################################### || # $HeadURL$ diff --git a/templates/images/arrow_down.gif b/templates/images/arrow_down.gif new file mode 100644 index 0000000000000000000000000000000000000000..1e4aef55d103caa18e5a3a0f1eb3aa59ac187f67 GIT binary patch literal 60 zcmZ?wbhEHbjEB<5wG8q|kKzxu41Cwx1|H{*E`5!ZGX-ZqaI`A}q JTM{FKH2|~H5O@Fp literal 0 HcmV?d00001 diff --git a/templates/images/arrow_up.gif b/templates/images/arrow_up.gif new file mode 100644 index 0000000000000000000000000000000000000000..314c44951f957a28115d1113d5ac0cade0f3bfa5 GIT binary patch literal 60 zcmZ?wbhEHbjEB<5wG8q|kKzxu41Cwx1|H{*E`2{-`?CX-gxA8ZB Jn {$bugsys->options['trackertitle']} - {@"User Options"} + + @@ -64,9 +96,7 @@ $header - -
- +
@@ -202,6 +232,13 @@ $header {@"Default Sort Order Direction"} $defaultsortas + +
+ {@"Bug List Columns"} + + $columnOptions +
+
diff --git a/userctrl.php b/userctrl.php index caece8b..1e6c181 100644 --- a/userctrl.php +++ b/userctrl.php @@ -20,7 +20,8 @@ \*=====================================================================*/ $fetchtemplates = array( - 'userctrl' + 'userctrl', + 'userctrl_column' ); define('SVN', '$Id$'); @@ -225,6 +226,23 @@ if ($_REQUEST['do'] == 'modify') } } + $position = 0; + $columns = '{ '; + $array = ((is_array($bugsys->userinfo['columnoptions']) AND sizeof($bugsys->userinfo['columnoptions']) == sizeof($bugsys->columns)) ? $bugsys->userinfo['columnoptions'] : $bugsys->columns); + foreach ($array AS $column => $mask) + { + $columnName = $bugsys->columnNames["$column"]; + eval('$columnOptions .= "' . $template->fetch('userctrl_column') . '";'); + $columns = ''; + $position++; + } + + $columns = array(); + if (!is_array($bugsys->in['columns'])) + { + $columns = '{"' . implode('": "', $bugsys->userinfo['columnoptions']) . '"}'; + } + eval('$template->flush("' . $template->fetch('userctrl') . '");'); } -- 2.43.5