Changeset 17936
- Timestamp:
- 10/05/08 21:43:15 (2 months ago)
- Files:
-
- trunk/midcom/org.openpsa.core/structure.php (modified) (4 diffs)
- trunk/midcom/org.openpsa.reports/viewer.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/org.openpsa.core/structure.php
r17934 r17936 24 24 private $components = array 25 25 ( 26 'org.openpsa.contacts' ,27 'org.openpsa.invoices' ,28 'org.openpsa.projects' ,29 'org.openpsa.sales' ,30 'net.nemein.wiki' ,26 'org.openpsa.contacts' => 'org.openpsa.contacts', 27 'org.openpsa.invoices' => 'org.openpsa.invoices', 28 'org.openpsa.projects' => 'org.openpsa.projects', 29 'org.openpsa.sales' => 'org.openpsa.sales', 30 'net.nemein.wiki' => 'net.nemein.wiki', 31 31 ); 32 32 … … 72 72 $this->set_config_value($last . '_url', $node_url); 73 73 } 74 //set auto_init to true to write only once 74 75 $this->set_config_value('auto_init', 'false'); 75 var_dump($this->snippet->code);76 76 $this->snippet->update(); 77 77 78 $_MIDCOM->uimessages->add($this->_i18n->get_string('org.openpsa.core'), $this->_i18n->get_string('site structure cache created'), 'info'); 78 79 } … … 93 94 { 94 95 $this->snippet->code = $this->snippet->code . " '" . $key . "' => " . $value . ",\n"; 95 var_dump($this->snippet->code);96 97 98 96 } 99 97 } … … 169 167 return $this->_config->get($last . '_url'); 170 168 } 169 170 /** 171 * Helper function to retrieve the GUID for the first topic of a given component 172 * 173 * @param string $component the component to look for 174 * @return mixed the component URL or false 175 */ 176 function get_node_guid($component) 177 { 178 if (!array_key_exists($component, $this->components)) 179 { 180 return false; 181 } 182 $parts = explode('.', $component); 183 $last = array_pop($parts); 184 return $this->_config->get($last . '_guid'); 185 } 171 186 } 172 187 ?> trunk/midcom/org.openpsa.reports/viewer.php
r17354 r17936 18 18 { 19 19 var $_datamanagers = array(); 20 var $_projects_handler = null;21 /*22 var $_contacts_handler = null;23 */24 20 25 21 /** … … 207 203 return $components; 208 204 } 205 $structure = new org_openpsa_core_structure(); 206 209 207 foreach ($components as $component => $loc) 210 208 { 211 $node = midcom_helper_find_node_by_component($component); 212 if ( empty($node) 213 || !$node[MIDCOM_NAV_OBJECT]->can_do('midgard:read')) 209 $node_guid = $structure->get_node_guid($component); 210 $topic = $_MIDCOM->dbfactory->get_object_by_guid($node_guid); 211 if ( empty($topic) 212 || !$topic->can_do('midgard:read')) 214 213 { 215 debug_add(" nodefor component '{$component}' not found or accessible");214 debug_add("topic for component '{$component}' not found or accessible"); 216 215 unset ($components[$component]); 217 216 }
