Changeset 17939

Show
Ignore:
Timestamp:
10/05/08 22:20:16 (2 months ago)
Author:
flack
Message:

remove some more midcom_helper_find_component_by_node calls

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/org.openpsa.contacts/handler/group.php

    r17644 r17939  
    322322                ); 
    323323            } 
    324  
    325             $invoices_node = midcom_helper_find_node_by_component('org.openpsa.invoices'); 
    326             if (!empty($invoices_node)) 
     324            $structure = new org_openpsa_core_structure(); 
     325 
     326            $invoices_url = $structure->get_node_full_url('org.openpsa.invoices'); 
     327            if ($invoices_url) 
    327328            { 
    328329                //TODO: Check for privileges somehow 
    329330                $this->_view_toolbar->add_item( 
    330331                    Array( 
    331                         MIDCOM_TOOLBAR_URL => $invoices_node[MIDCOM_NAV_FULLURL] . "list/customer/all/{$this->_request_data['group']->guid}", 
     332                        MIDCOM_TOOLBAR_URL => $invoices_url . "list/customer/all/{$this->_request_data['group']->guid}", 
    332333                        MIDCOM_TOOLBAR_LABEL => $this->_request_data['l10n']->get('customers invoices'), 
    333334                        MIDCOM_TOOLBAR_HELPTEXT => null, 
  • trunk/midcom/org.openpsa.contactwidget/main.php

    r17930 r17939  
    5959 
    6060    /** 
    61      * Default NAP org.openpsa.contacts node to be used for linking to groups. Will be autoprobed if not supplied. 
     61     * Default NAP org.openpsa.contacts URL to be used for linking to groups. Will be autoprobed if not supplied. 
    6262     * @var Array 
    6363     */ 
    64     var $contacts_node
     64    var $contacts_url
    6565 
    6666    /** 
     
    8989        parent::__construct(); 
    9090 
    91         // Hack to make $contacts_node static 
    92         static $contacts_node_local; 
    93         $this->contacts_node =& $contacts_node_local; 
     91        // Hack to make $contacts_url static 
     92        static $contacts_url_local; 
     93        $this->contacts_url =& $contacts_url_local; 
    9494 
    9595        // Read properties of provided person object/DM array 
     
    188188        elseif ($this->link_contacts) 
    189189        { 
    190             if (!$this->contacts_node) 
    191             { 
    192                 $this->contacts_node = midcom_helper_find_node_by_component('org.openpsa.contacts'); 
    193             } 
    194  
    195             if (!$this->contacts_node) 
     190            if (!$this->contacts_url) 
     191            { 
     192                $structure = new org_openpsa_core_structure(); 
     193                $this->contacts_url = $structure->get_node_full_url('org.openpsa.contacts'); 
     194            } 
     195 
     196            if (!$this->contacts_url) 
    196197            { 
    197198                return null; 
     
    199200            else 
    200201            { 
    201                 $url = "{$this->contacts_node[MIDCOM_NAV_FULLURL]}person/{$this->contact_details['guid']}/"; 
     202                $url = "{$this->contacts_url}person/{$this->contact_details['guid']}/"; 
    202203                return $url; 
    203204            } 
     
    365366                    if ($this->link_contacts) 
    366367                    { 
    367                         if (!$this->contacts_node
     368                        if (!$this->contacts_url
    368369                        { 
    369                             $this->contacts_node = midcom_helper_find_node_by_component('org.openpsa.contacts'); 
     370                            $structure = new org_openpsa_core_structure(); 
     371                            $this->contacts_url = $structure->get_node_full_url('org.openpsa.contacts'); 
    370372                        } 
    371373 
    372                         if (!$this->contacts_node
     374                        if (!$this->contacts_url
    373375                        { 
    374376                            $this->link_contacts = false; 
     
    376378                        else 
    377379                        { 
    378                             $group_label = "<a href=\"{$this->contacts_node[MIDCOM_NAV_FULLURL]}group/{$group->guid}/\">{$group_label}</a>"; 
     380                            $group_label = "<a href=\"{$this->contacts_url}group/{$group->guid}/\">{$group_label}</a>"; 
    379381                        } 
    380382                    } 
  • trunk/midcom/org.openpsa.invoices/handler/projects.php

    r17927 r17939  
    163163    { 
    164164 
    165         // Locate Contacts node for linking 
    166         $this->_request_data['projects_node'] = midcom_helper_find_node_by_component('org.openpsa.projects'); 
     165        $structure = new org_openpsa_core_structure(); 
     166 
     167        $this->_request_data['projects_url'] = $structure->get_node_full_url('org.openpsa.projects'); 
    167168 
    168169        midcom_show_style('show-projects-header'); 
  • trunk/midcom/org.openpsa.invoices/style/show-invoice.php

    r13524 r17939  
    33$view = $data['invoice_dm']; 
    44 
    5 $projects_node = midcom_helper_find_node_by_component('org.openpsa.projects'); 
     5$structure = new org_openpsa_core_structure(); 
     6$projects_url = $structure->get_node_full_url('org.openpsa.projects'); 
    67?> 
    78<div class="main org_openpsa_invoices_invoice"> 
     
    2526        $task = new org_openpsa_projects_task($task_id); 
    2627        // TODO: Link etc 
    27         echo "<h3><a href=\"{$projects_node[MIDCOM_NAV_FULLURL]}task/{$task->guid}/\">{$task->title}</a></h3>\n"; 
     28        echo "<h3><a href=\"{$projects_url}task/{$task->guid}/\">{$task->title}</a></h3>\n"; 
    2829        echo "<table>\n"; 
    2930        echo "    <tbody>\n"; 
  • trunk/midcom/org.openpsa.invoices/style/show-projects-customer-task.php

    r5048 r17939  
    88    <td> 
    99        <?php 
    10         if ($data['projects_node']) 
     10        if ($data['projects_url']) 
    1111        { 
    12             echo "<a href=\"{$data['projects_node'][MIDCOM_NAV_FULLURL]}task/{$data['task']->guid}/\">{$data['task']->title}</a>\n"; 
     12            echo "<a href=\"{$data['projects_url']}task/{$data['task']->guid}/\">{$data['task']->title}</a>\n"; 
    1313        } 
    1414        else 
  • trunk/midcom/org.openpsa.projects/handler/project/list.php

    r17935 r17939  
    271271        // Locate Contacts node for linking 
    272272        $structure = new org_openpsa_core_structure(); 
    273         $this->_request_data['contacts_url'] = $structure->get_node_url('org.openpsa.contacts'); 
     273        $this->_request_data['contacts_url'] = $structure->get_node_full_url('org.openpsa.contacts'); 
    274274 
    275275        if ($this->_request_data['view'] == 'all') 
  • trunk/midcom/org.openpsa.projects/handler/task/list.php

    r17935 r17939  
    8080 
    8181        $structure = new org_openpsa_core_structure(); 
    82         $this->_request_data['contacts_url'] = $structure->get_node_url('org.openpsa.contacts'); 
     82        $this->_request_data['contacts_url'] = $structure->get_node_full_url('org.openpsa.contacts'); 
    8383        $this->_request_data['sales_node'] = midcom_helper_find_node_by_component('org.openpsa.sales'); 
    8484        $this->_request_data['prefix'] = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX);