Add buttons in project overview sections
This commit is contained in:
@@ -67,7 +67,7 @@ class ProjectEdit extends Base
|
||||
if ($valid) {
|
||||
if ($this->project->update($values)) {
|
||||
$this->flash->success(t('Project updated successfully.'));
|
||||
$this->response->redirect($this->helper->url->to('ProjectEdit', $redirect, array('project_id' => $project['id'])));
|
||||
$this->response->redirect($this->helper->url->to('ProjectEdit', $redirect, array('project_id' => $project['id'])), true);
|
||||
} else {
|
||||
$this->flash->failure(t('Unable to update this project.'));
|
||||
}
|
||||
|
||||
@@ -29,18 +29,37 @@ class UrlHelper extends Base
|
||||
}
|
||||
|
||||
/**
|
||||
* HTML Link tag
|
||||
* Button Link Element
|
||||
*
|
||||
* @access public
|
||||
* @param string $label Link label
|
||||
* @param string $icon Font-Awesome icon
|
||||
* @param string $label Link label
|
||||
* @param string $controller Controller name
|
||||
* @param string $action Action name
|
||||
* @param array $params Url parameters
|
||||
* @param boolean $csrf Add a CSRF token
|
||||
* @param string $class CSS class attribute
|
||||
* @param string $action Action name
|
||||
* @param array $params Url parameters
|
||||
* @param string $class CSS class attribute
|
||||
* @return string
|
||||
*/
|
||||
public function button($icon, $label, $controller, $action, array $params = array(), $class = '')
|
||||
{
|
||||
$icon = '<i class="fa '.$icon.' fa-fw"></i> ';
|
||||
$class = 'btn '.$class;
|
||||
return $this->link($icon.$label, $controller, $action, $params, false, $class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Link element
|
||||
*
|
||||
* @access public
|
||||
* @param string $label Link label
|
||||
* @param string $controller Controller name
|
||||
* @param string $action Action name
|
||||
* @param array $params Url parameters
|
||||
* @param boolean $csrf Add a CSRF token
|
||||
* @param string $class CSS class attribute
|
||||
* @param string $title
|
||||
* @param boolean $new_tab Open the link in a new tab
|
||||
* @param string $anchor Link Anchor
|
||||
* @param boolean $new_tab Open the link in a new tab
|
||||
* @param string $anchor Link Anchor
|
||||
* @return string
|
||||
*/
|
||||
public function link($label, $controller, $action, array $params = array(), $csrf = false, $class = '', $title = '', $new_tab = false, $anchor = '')
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Edit project') ?></h2>
|
||||
<ul>
|
||||
<li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
|
||||
<li class="active"><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
|
||||
<li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li class="active"><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'dates')) ?>" autocomplete="off">
|
||||
<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'dates')) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('id', $values) ?>
|
||||
<?= $this->form->hidden('name', $values) ?>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Edit project') ?></h2>
|
||||
<ul>
|
||||
<li><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
|
||||
<li class="active"><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li class="active"><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'description')) ?>" autocomplete="off">
|
||||
<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'description')) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('id', $values) ?>
|
||||
<?= $this->form->hidden('name', $values) ?>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Edit project') ?></h2>
|
||||
<ul>
|
||||
<li class="active"><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
|
||||
<li class="active"><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off">
|
||||
<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'edit')) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('id', $values) ?>
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<div class="page-header">
|
||||
<h2><?= t('Edit project') ?></h2>
|
||||
<ul>
|
||||
<li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id'])) ?></li>
|
||||
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id'])) ?></li>
|
||||
<li class="active"><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id'])) ?></li>
|
||||
<li ><?= $this->url->link(t('General'), 'ProjectEdit', 'edit', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li><?= $this->url->link(t('Dates'), 'ProjectEdit', 'dates', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li><?= $this->url->link(t('Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
<li class="active"><?= $this->url->link(t('Task priority'), 'ProjectEdit', 'priority', array('project_id' => $project['id']), false, 'popover-link') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<form method="post" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'priority')) ?>" autocomplete="off">
|
||||
<form method="post" class="popover-form" action="<?= $this->url->href('ProjectEdit', 'update', array('project_id' => $project['id'], 'redirect' => 'priority')) ?>" autocomplete="off">
|
||||
<?= $this->form->csrf() ?>
|
||||
<?= $this->form->hidden('id', $values) ?>
|
||||
<?= $this->form->hidden('name', $values) ?>
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
</div>
|
||||
<div class="accordion-content">
|
||||
<?php if ($this->user->hasProjectAccess('ProjectFile', 'create', $project['id'])): ?>
|
||||
<p style="margin-bottom: 15px;">
|
||||
<i class="fa fa-plus fa-fw"></i>
|
||||
<?= $this->url->link(t('Upload a file'), 'ProjectFile', 'create', array('project_id' => $project['id']), false, 'popover') ?>
|
||||
</p>
|
||||
<div class="buttons-header">
|
||||
<?= $this->url->button('fa-plus', t('Upload a file'), 'ProjectFile', 'create', array('project_id' => $project['id']), 'popover') ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<?= $this->render('project_overview/images', array('project' => $project, 'images' => $images)) ?>
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
<h3><a href="#" class="fa accordion-toggle"></a> <?= t('Description') ?></h3>
|
||||
</div>
|
||||
<div class="accordion-content">
|
||||
<?php if ($this->user->hasProjectAccess('ProjectEdit', 'description', $project['id'])): ?>
|
||||
<div class="buttons-header">
|
||||
<?= $this->url->button('fa-edit', t('Edit Description'), 'ProjectEdit', 'description', array('project_id' => $project['id']), 'popover') ?>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<article class="markdown">
|
||||
<?= $this->text->markdown($project['description']) ?>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user