Пример #1
0
 /**
  * List all time total for a project (both billed and unbilled)
  *
  * @access public
  * @param void
  * @return null
  */
 function byproject()
 {
     $this->setLayout('administration');
     if (!logged_user()->isAdministrator(owner_company())) {
         flash_error(lang('no access permissions'));
         $this->redirectTo('dashboard');
     }
     // if
     $project_id = (int) array_var($_GET, 'id', 0);
     if ($project_id < 0) {
         $project_id = 0;
     }
     $redirect_to = array_var($_GET, 'redirect_to');
     if ($redirect_to == '') {
         $redirect_to = get_url('time', 'byproject', array('id' => $project_id));
         $redirect_to = str_replace('&amp;', '&', trim($redirect_to));
     }
     // if
     $unbilled = ProjectTimes::getTimeByProjectStatus(Projects::findById($project_id));
     $billed = ProjectTimes::getTimeByProjectStatus(Projects::findById($project_id), 1);
     tpl_assign('unbilled', $unbilled);
     tpl_assign('billed', $billed);
     tpl_assign('project', Projects::findById($project_id));
     tpl_assign('redirect_to', $redirect_to);
     $this->setSidebar(get_template_path('index_sidebar', 'time'));
 }
Пример #2
0
"><?php 
        echo clean($project->getName());
        ?>
</a>
    </td>
    <td class="middle">
      &nbsp;<?php 
        echo ProjectTimes::getTimeByProjectStatus($project, 0, 'hours');
        ?>
&nbsp;<?php 
        echo lang('hrs');
        ?>
    </td>
    <td class="middle">
      &nbsp;<?php 
        echo ProjectTimes::getTimeByProjectStatus($project, 1, 'hours');
        ?>
&nbsp;<?php 
        echo lang('hrs');
        ?>
    </td>
  </tr> 
<?php 
    }
    // foreach
    ?>
</table>
<?php 
} else {
    echo lang('no projects owned by company');
}