当前位置: 首页>>代码示例>>PHP>>正文


PHP tree::change_order_bulk方法代码示例

本文整理汇总了PHP中tree::change_order_bulk方法的典型用法代码示例。如果您正苦于以下问题:PHP tree::change_order_bulk方法的具体用法?PHP tree::change_order_bulk怎么用?PHP tree::change_order_bulk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tree的用法示例。


在下文中一共展示了tree::change_order_bulk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: migrate_cc_specs

function migrate_cc_specs(&$source_db, &$target_db, &$items, &$old_new)
{
    $mgtcom_keys = array('intro' => 'introduction', 'scope' => 'scope', 'ref' => 'references', 'method' => 'methodology', 'lim' => 'limitations');
    $mgtcat_keys = array('objective' => 'objective', 'config' => 'configuration', 'data' => 'data', 'tools' => 'tools');
    $tproject_mgr = new testproject($target_db);
    $ts_mgr = new testsuite($target_db);
    $tree_mgr = new tree($target_db);
    foreach ($items as $prod_id => $pd) {
        $old_new['product'][$prod_id] = @$tproject_mgr->create($pd['name'], $pd['color'], $pd['option_reqs'], EMPTY_NOTES, $pd['active']);
        echo "<pre><font color='blue'>Product {$pd['name']} has became a test project!</font></pre>";
        flush();
        $tproject_id = $old_new['product'][$prod_id];
        $sql = "SELECT * FROM mgtcomponent WHERE prodid={$prod_id}";
        $comp = $source_db->fetchRowsIntoMap($sql, 'id');
        // for change_order_bulk($hash_node_id, $hash_node_order)
        // $hash_node_id=array(10=>10, 23=>23, 30=>30);
        // $hash_node_order=array(10=>3, 23=>1, 30=>2);
        // $hash_node_id=array();
        // $hash_node_order=array();
        // 20071021 - francisco.mancardi@gruppotesi.com
        //
        // $hash_order_node_order=array(3=>10, 1=>23, 2=>30);
        // means:  node_id: 10 order:3
        //         node_id: 23 order:1
        //         node_id: 30 order:2
        $hash_order_node_id = array();
        if (count($comp) > 0) {
            foreach ($comp as $coid => $cod) {
                $details = '';
                foreach ($mgtcom_keys as $key => $val) {
                    $details .= $val . ": <br>" . $cod[$key] . "<p>";
                }
                $ret = $ts_mgr->create($tproject_id, $cod['name'], $details);
                if ($ret['status_ok']) {
                    echo "<pre>Component " . htmlentities($cod['name']) . " Migrated<br></pre>";
                    flush();
                    $mgtcomp_id = $ret['id'];
                    $old_new['mgtcomp'][$coid] = $mgtcomp_id;
                }
                // ----------------------------------------------------------------------------------
                $sql = "SELECT * FROM mgtcategory WHERE compid={$coid}";
                $cat = $source_db->fetchRowsIntoMap($sql, 'id');
                if (count($cat) > 0) {
                    foreach ($cat as $caid => $cad) {
                        // ----------------------------------------------------------------------------------
                        $details = '';
                        foreach ($mgtcat_keys as $key => $val) {
                            $details .= $val . ": <br>" . $cad[$key] . "<p>";
                        }
                        // ----------------------------------------------------------------------------------
                        $ret = $ts_mgr->create($mgtcomp_id, $cad['name'], $details);
                        if ($ret['status_ok']) {
                            echo "<pre>    Category " . htmlentities($cad['name']) . " Migrated<br></pre>";
                            flush();
                            $mgtcat_id = $ret['id'];
                            $old_new['mgtcat'][$caid] = $mgtcat_id;
                            if ($cad['CATorder'] != 0) {
                                // 20071021 - franciscom
                                // $hash_node_id[$mgtcat_id]=$mgtcat_id;
                                // $hash_node_order[$mgtcat_id]=$cad['CATorder'];
                                $node_id = $mgtcat_id;
                                $node_order = $cad['CATorder'];
                                $hash_order_node_id[$node_order] = $node_id;
                            }
                        }
                        // ----------------------------------------------------------------------------------
                    }
                }
            }
            // 20060725 - franciscom
            // $tree_mgr->change_order_bulk($hash_node_id, $hash_node_order) ;
            $tree_mgr->change_order_bulk($hash_order_node_id);
        }
    }
}
开发者ID:moraesmv,项目名称:testlink-code,代码行数:75,代码来源:migrate_16_to_17_functions.php

示例2: init_args

*   rev: 20080605 - franciscom
*        
*/
require_once '../../config.inc.php';
require_once 'common.php';
testlinkInitPage($db);
// check if this is really needed
$exclude_node_types = array('testplan' => 1, 'requirement' => 1, 'requirement_spec' => 1);
$args = init_args();
$treeMgr = new tree($db);
switch ($args->doAction) {
    case 'changeParent':
        $treeMgr->change_parent($args->nodeid, $args->newparentid);
        break;
    case 'doReorder':
        $dummy = explode(',', $args->nodelist);
        $treeMgr->change_order_bulk($dummy);
        break;
}
function init_args()
{
    $args = new stdClass();
    $key2loop = array('nodeid', 'newparentid', 'doAction', 'top_or_bottom', 'nodeorder', 'nodelist');
    foreach ($key2loop as $key) {
        $args->{$key} = isset($_REQUEST[$key]) ? $_REQUEST[$key] : null;
    }
    return $args;
}
?>

                                                                                              
开发者ID:tamtrong,项目名称:testlink,代码行数:29,代码来源:dragdroptprojectnodes.php


注:本文中的tree::change_order_bulk方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。