Example #1
0
 /**
  * Returns a list of buttons for the frontend
  *
  * @return    array
  */
 public static function getSiteButtons()
 {
     $user = JFactory::getUser();
     $buttons = array();
     if ($user->authorise('core.create', 'com_pfmilestones')) {
         $buttons[] = array('title' => 'MOD_PF_DASH_BUTTONS_ADD_MILESTONE', 'link' => PFmilestonesHelperRoute::getMilestonesRoute() . '&task=form.add', 'icon' => JHtml::image('com_projectfork/projectfork/header/icon-48-milestoneform.add.png', JText::_('MOD_PF_DASH_BUTTONS_ADD_MILESTONE'), null, true));
     }
     return $buttons;
 }
Example #2
0
        echo $item->comments;
        ?>
 <?php 
        echo JText::_('Comments');
        ?>
	    	    			        </a>
	    	    			    </div>
	    	    				<?php 
    }
    ?>
	    	    				<?php 
    if ($milestones_enabled) {
        ?>
    	    	    				<div class="btn-group">
    	    	    			        <a class="btn btn-mini" href="<?php 
        echo JRoute::_(PFmilestonesHelperRoute::getMilestonesRoute($item->slug, $item->slug));
        ?>
">
    	    	    			            <span aria-hidden="true" class="icon-location"></span>
    	    	    			            <?php 
        echo (int) $item->milestones;
        ?>
 <?php 
        echo JText::_('JGRID_HEADING_MILESTONES');
        ?>
    	    	    			        </a>
    	    	    				</div>
    	    	    			<?php 
    }
    ?>
    	    	    			<?php 
Example #3
0
    <?php 
if ($this->params->get('show_page_heading', 1)) {
    ?>
        <h1><?php 
    echo $this->escape($this->params->get('page_heading'));
    ?>
</h1>
    <?php 
}
?>

    <div class="clearfix"></div>

    <div class="cat-items">
        <form name="adminForm" id="adminForm" action="<?php 
echo JRoute::_(PFmilestonesHelperRoute::getMilestonesRoute());
?>
" method="post">
            <div class="btn-toolbar btn-toolbar-top">
                <?php 
echo $this->toolbar;
?>
                <div class="filter-project btn-group">
                    <?php 
echo JHtml::_('pfhtml.project.filter');
?>
                </div>
            </div>

            <div class="<?php 
echo $filter_in;
Example #4
0
 /**
  * Generates the toolbar for the top of the view
  *
  * @return    string    Toolbar with buttons
  */
 protected function getToolbar()
 {
     $access = PFmilestonesHelper::getActions($this->item->id);
     $uid = JFactory::getUser()->get('id');
     $app = JFactory::getApplication();
     if ($this->item->id) {
         $slug = $this->item->id . ':' . $this->item->alias;
         $project_slug = $app->input->getCmd('filter_project');
         $return = base64_encode(PFmilestonesHelperRoute::getMilestoneRoute($slug, $project_slug));
         PFToolbar::button('COM_PROJECTFORK_ACTION_EDIT', '', false, array('access' => $access->get('core.edit') || $access->get('core.edit.own') && $uid == $this->item->created_by, 'href' => JRoute::_(PFmilestonesHelperRoute::getMilestonesRoute() . '&task=form.edit&id=' . $slug . '&return=' . $return)));
     }
     if (PFApplicationHelper::enabled('com_pftasks')) {
         PFToolbar::button(JText::sprintf('JGRID_HEADING_TASKLISTS_AND_TASKS', intval($this->item->lists), intval($this->item->tasks)), '', false, array('href' => JRoute::_(PFtasksHelperRoute::getTasksRoute($this->item->project_id, $this->item->id)), 'icon' => 'icon-chevron-right', 'class' => ''));
     }
     return PFToolbar::render();
 }
Example #5
0
    $db = JFactory::getDbo();
    $query = $db->getQuery(true);
    $query->select('attribs')->from('#__pf_projects')->where('id = ' . $db->quote($pid));
    $db->setQuery($query);
    $project_attribs = $db->loadResult();
    $project_params = new JRegistry();
    $project_params->loadString($project_attribs);
    $repo_dir = (int) $project_params->get('repo_dir');
} else {
    $repo_dir = 1;
}
// Prepare component base links
$link_tasks = class_exists('PFtasksHelperRoute') ? PFtasksHelperRoute::getTasksRoute() : 'index.php?option=com_pftasks';
$link_projects = class_exists('PFprojectsHelperRoute') ? PFprojectsHelperRoute::getProjectsRoute() : 'index.php?option=com_pfprojects';
$link_time = class_exists('PFtimeHelperRoute') ? PFtimeHelperRoute::getTimesheetRoute() : 'index.php?option=com_pftime';
$link_ms = class_exists('PFmilestonesHelperRoute') ? PFmilestonesHelperRoute::getMilestonesRoute() : 'index.php?option=com_pfmilestones';
$link_forum = class_exists('PFforumHelperRoute') ? PFforumHelperRoute::getTopicsRoute() : 'index.php?option=com_pfforum';
$link_repo = class_exists('PFrepoHelperRoute') ? PFrepoHelperRoute::getRepositoryRoute($pid, $repo_dir) : 'index.php?option=com_pfrepo&filter_project=' . $pid . '&parent_id=' . $repo_dir;
// Logout link return
$return = base64_encode($this->baseurl);
?>
<!DOCTYPE html>
<html>
<head>
	<jdoc:include type="head" />
    <?php 
// Detecting Home
$site_app = JFactory::getApplication('Site');
$menu = $site_app->getMenu();
if ($menu->getActive() == $menu->getDefault()) {
    $siteHome = 1;
 /**
  * Function that allows child controller access to model data after the data has been saved.
  *
  * @param     jmodel    $model        The data model object.
  * @param     array     $validData    The validated data.
  *
  * @return    void
  */
 protected function postSaveHook(&$model, $validData)
 {
     $task = $this->getTask();
     switch ($task) {
         case 'save2copy':
         case 'save2new':
             // No redirect because its already set
             break;
         case 'save2milestone':
             $link = JRoute::_(PFmilestonesHelperRoute::getMilestonesRoute() . '&task=form.add');
             $this->setRedirect($link);
             break;
         case 'save2tasklist':
             $link = JRoute::_(PFtasksHelperRoute::getTasksRoute() . '&task=tasklistform.add');
             $this->setRedirect($link);
             break;
         default:
             $this->setRedirect($this->getReturnPage());
             break;
     }
 }
Example #7
0
$list_order = $this->escape($this->state->get('list.ordering'));
$list_dir = $this->escape($this->state->get('list.direction'));
$user = JFactory::getUser();
$uid = $user->get('id');
$pid = (int) $this->state->get('filter.project');
$filter_in = $this->state->get('filter.isset') ? 'in ' : '';
$tasks_enabled = PFApplicationHelper::enabled('com_pftasks');
$repo_enabled = PFApplicationHelper::enabled('com_pfrepo');
$cmnts_enabled = PFApplicationHelper::enabled('com_pfcomments');
$doc = JFactory::getDocument();
$style = '.large {' . 'font-size: 20px;' . 'line-height: 24px;' . '}' . '.medium {' . 'font-size: 16px;' . 'line-height: 22px;' . '}' . '.margin-none {' . 'margin: 0;' . '}';
$doc->addStyleDeclaration($style);
$print_url = PFmilestonesHelperRoute::getMilestonesRoute($this->state->get('filter.project')) . '&tmpl=component&layout=print';
$print_opt = 'width=1024,height=600,resizable=yes,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no';
$itemid = PFApplicationHelper::getActiveMenuItemId();
$list_url = PFmilestonesHelperRoute::getMilestonesRoute($this->params->get('filter_category'), $itemid);
$return_url = base64_encode($list_url);
?>
<div id="projectfork" class="category-list<?php 
echo $this->pageclass_sfx;
?>
 view-milestones PrintArea all">

    <?php 
if ($this->params->get('show_page_heading', 1)) {
    ?>
        <h1><?php 
    echo $this->escape($this->params->get('page_heading'));
    ?>
</h1>
    <?php