From: <sy...@us...> - 2008-08-22 19:26:18
|
Revision: 14489 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=14489&view=rev Author: sylvieg Date: 2008-08-22 19:26:27 +0000 (Fri, 22 Aug 2008) Log Message: ----------- [MOD]tracker: page selector tracker field - only automatic feed 1 (the page the item is created) is working now Modified Paths: -------------- trunk/lib/trackers/trackerlib.php trunk/lib/wiki-plugins/wikiplugin_tracker.php trunk/lib/wiki-plugins/wikiplugin_trackerlist.php Modified: trunk/lib/trackers/trackerlib.php =================================================================== --- trunk/lib/trackers/trackerlib.php 2008-08-22 18:54:17 UTC (rev 14488) +++ trunk/lib/trackers/trackerlib.php 2008-08-22 19:26:27 UTC (rev 14489) @@ -2303,6 +2303,16 @@ <dt>Description: <dd><strong>[auto-assign]</strong> will auto-populate the field with the IP address of the user who created the item if set to 1, or will set the field to the IP of the user who last modified the item if set to 2, or will be a free IP for other values. </dl>')); + $type['k'] = array( + 'label'=>tra('page selector'), + 'opt'=>true, + 'help'=>tra('<dl> + <dt>Function: Allows a section fron the list of pages. + <dt>Usage: <strong>auto-assign</strong> + <dt>Description: + <dd><strong>[auto-assign]</strong> will auto-assign the creator of the item if set to 1 + <dd> + </dl>')); $type['y'] = array( 'label'=>tra('country selector'), 'opt'=>true, Modified: trunk/lib/wiki-plugins/wikiplugin_tracker.php =================================================================== --- trunk/lib/wiki-plugins/wikiplugin_tracker.php 2008-08-22 18:54:17 UTC (rev 14488) +++ trunk/lib/wiki-plugins/wikiplugin_tracker.php 2008-08-22 19:26:27 UTC (rev 14489) @@ -251,7 +251,7 @@ } else { $newItemRate = NULL; } - } elseif (($flds['data'][$cpt]['type'] == 'u' || $flds['data'][$cpt]['type'] == 'g' || $flds['data'][$cpt]['type'] == 'I') && ($flds['data'][$cpt]['options_array'][0] == '1' || $flds['data'][$cpt]['options_array'][0] == '2') && $tiki_p_admin_trackers != 'y' && empty($_REQUEST['track'][$fl['fieldId']])) { + } elseif (($flds['data'][$cpt]['type'] == 'u' || $flds['data'][$cpt]['type'] == 'g' || $flds['data'][$cpt]['type'] == 'I' || $flds['data'][$cpt]['type'] == 'k') && ($flds['data'][$cpt]['options_array'][0] == '1' || $flds['data'][$cpt]['options_array'][0] == '2') && $tiki_p_admin_trackers != 'y' && empty($_REQUEST['track'][$fl['fieldId']])) { if (empty($itemId) && ($flds['data'][$cpt]['options_array'][0] == '1' || $flds['data'][$cpt]['options_array'][0] == '2')) { if ($flds['data'][$cpt]['type'] == 'u') $_REQUEST['track'][$fl['fieldId']] = empty($user)?(empty($_REQUEST['name'])? '':$_REQUEST['name']):$user; @@ -259,6 +259,8 @@ $_REQUEST['track'][$fl['fieldId']] = $group; elseif ($flds['data'][$cpt]['type'] == 'I') $_REQUEST['track'][$fl['fieldId']] = isset($_SERVER['REMOTE_ADDR'])?$_SERVER['REMOTE_ADDR']: ''; + elseif ($flds['data'][$cpt]['type'] == 'k') + $_REQUEST['track'][$fl['fieldId']] = isset($_REQUEST['page'])?$_REQUEST['page']: ''; } elseif (!empty($itemId) && $flds['data'][$cpt]['options_array'][0] == '2') { if ($flds['data'][$cpt]['type'] == 'u') $_REQUEST['track'][$fl['fieldId']] = $user; Modified: trunk/lib/wiki-plugins/wikiplugin_trackerlist.php =================================================================== --- trunk/lib/wiki-plugins/wikiplugin_trackerlist.php 2008-08-22 18:54:17 UTC (rev 14488) +++ trunk/lib/wiki-plugins/wikiplugin_trackerlist.php 2008-08-22 19:26:27 UTC (rev 14489) @@ -3,7 +3,7 @@ function wikiplugin_trackerlist_help() { $help = tra("Displays the output of a tracker content, fields are indicated with numeric ids.").":\n"; - $help.= "~np~{TRACKERLIST(trackerId=1,fields=2:4:5, sort=y, popup=6:7, stickypopup=y, showtitle=y, showlinks=y, showdesc=y, shownbitems=n, showinitials=y, showstatus=y, showcreated=y, showlastmodif=y, showfieldname=n, status=o|p|c|op|oc|pc|opc, sort_mode=, max=, filterfield=1:2, filtervalue=x:y, exactvalue=x:y, checkbox=fieldId/name/title/submit/action/tpl,goIfOne=y,more=y,moreurl=,view=user,tpl=,wiki=,view_user=user,itemId=,url=,ldelim=,rdelim=)}Notice{TRACKERLIST}~/np~"; + $help.= "~np~{TRACKERLIST(trackerId=1,fields=2:4:5, sort=y, popup=6:7, stickypopup=y, showtitle=y, showlinks=y, showdesc=y, shownbitems=n, showinitials=y, showstatus=y, showcreated=y, showlastmodif=y, showfieldname=n, status=o|p|c|op|oc|pc|opc, sort_mode=, max=, filterfield=1:2, filtervalue=x:y, exactvalue=x:y, checkbox=fieldId/name/title/submit/action/tpl,goIfOne=y,more=y,moreurl=,view=user|page,tpl=,wiki=,view_user=user,itemId=,url=,ldelim=,rdelim=)}Notice{TRACKERLIST}~/np~"; return $help; } @@ -138,7 +138,7 @@ 'view' => array( 'required' => false, 'name' => tra('View'), - 'description' => tra('?'), + 'description' => 'user|page '.tra('Select automatically the item of the current user or the page'), ), 'tpl' => array( 'required' => false, @@ -163,7 +163,7 @@ 'url' => array( 'required' => false, 'name' => tra('URL'), - 'description' => tra('?'), + 'description' => tra('link url'), ), 'ldelim' => array( 'required' => false, @@ -391,6 +391,13 @@ $exactvalue[] = isset($view)? $user: $view_user; } } + if (isset($view) && $view == 'page' && $_REQUEST['page']) { + if ($f = $trklib->get_field_id_from_type($trackerId, 'k', '1%')) { + $filterfield[] = $f; + $filtervalue[] = ''; + $exactvalue[] = $_REQUEST['page']; + } + } if (!isset($filtervalue)) { $filtervalue = ''; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |