コード例 #1
0
ファイル: view.php プロジェクト: pnagaraju25/fengoffice
        } else {
            if ($milestone->isTrashed()) {
                add_page_action(lang('restore from trash'), "javascript:if(confirm(lang('confirm restore objects'))) og.openLink('" . $milestone->getUntrashUrl() . "');", 'ico-restore', null, null, true);
                add_page_action(lang('delete permanently'), "javascript:if(confirm(lang('confirm delete permanently'))) og.openLink('" . $milestone->getDeleteUrl() . "');", 'ico-delete', null, null, true);
            } else {
                add_page_action(lang('move to trash'), "javascript:if(confirm(lang('confirm move to trash'))) og.openLink('" . $milestone->getTrashUrl() . "');", 'ico-trash', null, null, true);
            }
        }
    }
    // if
    if (!$milestone->isTrashed() && !logged_user()->isGuest()) {
        if ($milestone->getIsTemplate()) {
            add_page_action(lang('new milestone from template'), get_url("milestone", "copy_milestone", array("id" => $milestone->getId())), 'ico-copy');
        } else {
            add_page_action(lang('copy milestone'), get_url("milestone", "copy_milestone", array("id" => $milestone->getId())), 'ico-copy');
            if (can_manage_templates(logged_user())) {
                add_page_action(lang('add to a template'), get_url("template", "add_to", array("manager" => 'ProjectMilestones', "id" => $milestone->getId())), 'ico-template');
            }
        }
    }
    ?>

<div style="padding:7px">
<div class="milestone">
<?php 
    $content = '';
    if ($milestone->getDueDate()->getYear() > DateTimeValueLib::now()->getYear()) {
        $content = '<div class="dueDate"><b>' . lang('due date') . ':</b> ' . format_date($milestone->getDueDate(), null, 0) . '</div>';
    } else {
        $content = '<div class="dueDate"><b>' . lang('due date') . ':</b> ' . format_descriptive_date($milestone->getDueDate(), 0) . '</div>';
    }
コード例 #2
0
 /**
  * Check if specific user can delete this template
  *
  * @access public
  * @param User $user
  * @return boolean
  */
 function canDelete(User $user)
 {
     return can_manage_templates($user);
 }
コード例 #3
0
 /**
  * List all templates
  *
  * @param void
  * @return null
  */
 function task_templates()
 {
     if (!can_manage_templates(logged_user())) {
         flash_error(lang('no access permissions'));
         ajx_current("empty");
         return;
     }
     // if
     tpl_assign('task_templates', ProjectTasks::getAllTaskTemplates());
 }
コード例 #4
0
	/**
	 * Check if specific user can delete this template
	 *
	 * @access public
	 * @param Contact $user
	 * @return boolean
	 */
	function canDelete(Contact $user) {
		return can_manage_templates($user);
	} // canDelete
コード例 #5
0
 function assign_to_ws()
 {
     if (!can_manage_templates(logged_user())) {
         flash_error(lang("no access permissions"));
         ajx_current("empty");
         return;
     }
     $template_id = get_id();
     $cotemplate = COTemplates::findById($template_id);
     if (!$cotemplate instanceof COTemplate) {
         flash_error(lang("template dnx"));
         ajx_current("empty");
         return;
     }
     $selected = WorkspaceTemplates::getWorkspacesByTemplate($template_id);
     tpl_assign('workspaces', logged_user()->getWorkspaces());
     tpl_assign('selected', $selected);
     tpl_assign('cotemplate', $cotemplate);
     $checked = array_var($_POST, 'ws_ids');
     if ($checked != null) {
         try {
             DB::beginWork();
             WorkspaceTemplates::deleteByTemplate($template_id);
             $wss = Projects::findByCSVIds($checked);
             foreach ($wss as $ws) {
                 $obj = new WorkspaceTemplate();
                 $obj->setWorkspaceId($ws->getId());
                 $obj->setTemplateId($template_id);
                 $obj->setInludeSubWs(false);
                 $obj->save();
             }
             DB::commit();
             flash_success(lang('success assign workspaces'));
             ajx_current("back");
         } catch (Exception $exc) {
             DB::rollback();
             flash_error(lang('error assign workspace') . $exc->getMessage());
             ajx_current("empty");
         }
     }
 }
コード例 #6
0
ファイル: index.php プロジェクト: abhinay100/feng_app
<?php

$genid = gen_id();
$gs_step = config_option('getting_started_step');
$all_set = array_var($_REQUEST, 'more_settings_expanded');
?>

<div class="more-panel-container">
	<div class="title"><?php 
echo lang('learn about and manage your Feng Office');
?>
</div>

<?php 
if (can_manage_configuration(logged_user()) || can_manage_security(logged_user()) || can_manage_templates(logged_user()) || can_manage_billing(logged_user())) {
    ?>
	<div class="more-panel-section">
		<h1><?php 
    echo lang('quick system configuration and settings');
    ?>
</h1>
		<div class="section-content section1" style="<?php 
    echo $gs_step < 99 && !$all_set ? "max-width:100%;" : "";
    ?>
">
		<?php 
    tpl_assign('genid', $genid);
    $this->includeTemplate(get_template_path('section1', 'more'));
    ?>
		</div>
	</div>