Changeset 17937
- Timestamp:
- 10/05/08 22:06:04 (2 months ago)
- Files:
-
- trunk/midcom/org.openpsa.core/structure.php (modified) (4 diffs)
- trunk/midcom/org.openpsa.invoices/handler/list.php (modified) (1 diff)
- trunk/midcom/org.openpsa.mypage/handler/today.php (modified) (1 diff)
- trunk/midcom/org.openpsa.mypage/handler/weekreview.php (modified) (1 diff)
- trunk/midcom/org.openpsa.mypage/style/show-today.php (modified) (4 diffs)
- trunk/midcom/org.openpsa.mypage/style/weekreview-day-item-event.php (modified) (1 diff)
- trunk/midcom/org.openpsa.mypage/style/weekreview-day-item-hour-report.php (modified) (1 diff)
- trunk/midcom/org.openpsa.mypage/style/weekreview-day-item-task-status.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/org.openpsa.core/structure.php
r17936 r17937 25 25 ( 26 26 'org.openpsa.contacts' => 'org.openpsa.contacts', 27 'org.openpsa.calendar' => 'org.openpsa.calendar', 27 28 'org.openpsa.invoices' => 'org.openpsa.invoices', 28 29 'org.openpsa.projects' => 'org.openpsa.projects', … … 63 64 $last = array_pop($parts); 64 65 $node_guid = 'false'; 65 $node_ url = 'false';66 $node_full_url = 'false'; 66 67 if (is_array($node)) 67 68 { 68 69 $node_guid = "'" . $node[MIDCOM_NAV_OBJECT]->guid . "'"; 69 $node_url = "'" . $node[MIDCOM_NAV_FULLURL] . "'"; 70 $node_full_url = "'" . $node[MIDCOM_NAV_FULLURL] . "'"; 71 $node_relative_url = "'" . $node[MIDCOM_NAV_RELATIVEURL] . "'"; 70 72 } 71 73 $this->set_config_value($last . '_guid', $node_guid); 72 $this->set_config_value($last . '_url', $node_url); 73 } 74 //set auto_init to true to write only once 74 $this->set_config_value($last . '_full_url', $node_full_url); 75 $this->set_config_value($last . '_relative_url', $node_relative_url); 76 } 77 //set auto_init to true to write only once 75 78 $this->set_config_value('auto_init', 'false'); 76 79 $this->snippet->update(); … … 152 155 153 156 /** 154 * Helper function to retrieve the absoluteURL for the first topic of a given component157 * Helper function to retrieve the full URL for the first topic of a given component 155 158 * 156 159 * @param string $component the component to look for 157 * @return mixed the component URL or false158 */ 159 function get_node_ url($component)160 * @return mixed The component URL or false 161 */ 162 function get_node_full_url($component) 160 163 { 161 164 if (!array_key_exists($component, $this->components)) … … 165 168 $parts = explode('.', $component); 166 169 $last = array_pop($parts); 167 return $this->_config->get($last . '_url'); 168 } 169 170 return $this->_config->get($last . '_full_url'); 171 } 172 173 /** 174 * Helper function to retrieve the relative URL for the first topic of a given component 175 * 176 * @param string $component The component to look for 177 * @return mixed the component URL or false 178 */ 179 function get_node_full_url($component) 180 { 181 if (!array_key_exists($component, $this->components)) 182 { 183 return false; 184 } 185 $parts = explode('.', $component); 186 $last = array_pop($parts); 187 return $this->_config->get($last . '_relative_url'); 188 } 189 170 190 /** 171 191 * Helper function to retrieve the GUID for the first topic of a given component trunk/midcom/org.openpsa.invoices/handler/list.php
r17934 r17937 24 24 // Locate Contacts node for linking 25 25 $structure = new org_openpsa_core_structure(); 26 $this->_request_data['contacts_url'] = $structure->get_node_ url('org.openpsa.contacts');26 $this->_request_data['contacts_url'] = $structure->get_node_full_url('org.openpsa.contacts'); 27 27 } 28 28 trunk/midcom/org.openpsa.mypage/handler/today.php
r17350 r17937 173 173 function _show_today($handler_id, &$data) 174 174 { 175 $data['calendar_node'] = midcom_helper_find_node_by_component('org.openpsa.calendar'); 176 $data['projects_node'] = midcom_helper_find_node_by_component('org.openpsa.projects'); 177 $data['wiki_node'] = midcom_helper_find_node_by_component('net.nemein.wiki'); 175 $structure = new org_openpsa_core_structure(); 176 $data['calendar_url'] = $structure->get_node_relative_url('org.openpsa.calendar'); 177 $data['projects_url'] = $structure->get_node_full_url('org.openpsa.projects'); 178 $data['wiki_url'] = $structure->get_node_relative_url('net.nemein.wiki'); 178 179 179 180 midcom_show_style('show-today'); trunk/midcom/org.openpsa.mypage/handler/weekreview.php
r17917 r17937 281 281 function _show_review($handler_id, &$data) 282 282 { 283 $structure = new org_openpsa_core_structure(); 283 284 $data['calendar_node'] = midcom_helper_find_node_by_component('org.openpsa.calendar'); 284 $data['projects_ node'] = midcom_helper_find_node_by_component('org.openpsa.projects');285 $data['projects_url'] = $structure->get_node_full_url('org.openpsa.projects'); 285 286 286 287 $week_hours_invoiceable = 0; trunk/midcom/org.openpsa.mypage/style/show-today.php
r17819 r17937 7 7 <?php 8 8 9 if ($data['calendar_ node'])9 if ($data['calendar_url']) 10 10 { 11 11 ?> 12 12 <div class="agenda"> 13 13 <?php 14 $_MIDCOM->dynamic_load($data['calendar_ node'][MIDCOM_NAV_RELATIVEURL].'agenda/day/'.date('Y-m-d', $data['requested_time']));14 $_MIDCOM->dynamic_load($data['calendar_url'] . 'agenda/day/' . date('Y-m-d', $data['requested_time'])); 15 15 ?> 16 16 </div> … … 18 18 } 19 19 20 if ($data['wiki_ node'])20 if ($data['wiki_url']) 21 21 { 22 22 ?> 23 23 <div class="wiki"> 24 24 <?php 25 $_MIDCOM->dynamic_load($data['wiki_ node'][MIDCOM_NAV_RELATIVEURL].'latest/');25 $_MIDCOM->dynamic_load($data['wiki_url'] . 'latest/'); 26 26 ?> 27 27 </div> … … 33 33 <div class="sidebar"> 34 34 <?php 35 if ($data['projects_ node'])35 if ($data['projects_url']) 36 36 { 37 37 $tasks = org_openpsa_projects_task_resource::get_resource_tasks('guid'); … … 42 42 <div class="org_openpsa_projects_workingon"> 43 43 <h2><?php echo $_MIDCOM->i18n->get_string('now working on', 'org.openpsa.projects'); ?></h2> 44 <form method="post" action="<?php echo $data['projects_ node'][MIDCOM_NAV_FULLURL] . 'workingon/set/'; ?>">44 <form method="post" action="<?php echo $data['projects_url'] . 'workingon/set/'; ?>"> 45 45 <input type="hidden" name="url" value="&(prefix);" /> 46 46 <select name="task" onchange="this.form.submit();"> trunk/midcom/org.openpsa.mypage/style/weekreview-day-item-event.php
r5048 r17937 12 12 <?php 13 13 $event_label = $event->title; 14 if ($data['calendar_ node'])14 if ($data['calendar_url']) 15 15 { 16 16 $event_url = "{$data['calendar_node'][MIDCOM_NAV_FULLURL]}event/{$event->guid}"; trunk/midcom/org.openpsa.mypage/style/weekreview-day-item-hour-report.php
r5048 r17937 13 13 <?php 14 14 $task_label = $task->title; 15 if ($data['projects_ node'])15 if ($data['projects_url']) 16 16 { 17 $task_label = "<a href=\"{$data['projects_ node'][MIDCOM_NAV_FULLURL]}task/{$task->guid}\">{$task_label}</a>";17 $task_label = "<a href=\"{$data['projects_url']}task/{$task->guid}\">{$task_label}</a>"; 18 18 } 19 19 echo "{$task_label}, {$hour_report->description}: {$hour_report->hours}h"; trunk/midcom/org.openpsa.mypage/style/weekreview-day-item-task-status.php
r5048 r17937 13 13 <?php 14 14 $task_label = $task->title; 15 if ($data['projects_ node'])15 if ($data['projects_url']) 16 16 { 17 $task_label = "<a href=\"{$data['projects_ node'][MIDCOM_NAV_FULLURL]}task/{$task->guid}\">{$task_label}</a>";17 $task_label = "<a href=\"{$data['projects_url']}task/{$task->guid}\">{$task_label}</a>"; 18 18 } 19 19
