Пример #1
0
    die('You should not access this file directly.');
}
global $AppUI;
$risk_id = intval(dPgetParam($_REQUEST, 'risk_id', 0));
$riskDescription = dPgetParam($_POST, 'risk_note_description', '');
$note = dPgetParam($_POST, 'note', false);
// check permissions
$perms =& $AppUI->acl();
$canEdit = $perms->checkModuleItem('risks', 'edit', $risk_id);
if (!$canEdit) {
    $AppUI->redirect("m=public&a=access_denied");
}
print_r($note);
$viewNotes = false;
$addNotes = false;
$risk = new dotProject_AddOn_Risks($risk_id);
$notes = $risk->getNotes($risk_id);
echo '
<table cellpadding="5" width="100%" class="tbl">
<tr>
	<th>Date</th>
	<th>User</th>
	<th>Note</th>
</tr>';
foreach ($notes as $n) {
    echo '
<tr>
	<td nowrap>' . $n['risk_note_date'] . '</td>
	<td nowrap>' . $n['risk_note_owner'] . '</td>
	<td width="100%">' . $n['risk_note_description'] . '</td>
</tr>';
Пример #2
0
<?php

if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
$del = dPgetParam($_POST, 'del', 0);
$isNotNew = dPgetParam($_POST, 'risk_id', 0);
$risk = new dotProject_AddOn_Risks();
if ($msg = $risk->bind($_POST)) {
    $AppUI->setMsg($msg, UI_MSG_ERROR);
    $AppUI->redirect();
}
$AppUI->setMsg('Risk');
if ($del) {
    if ($msg = $risk->delete()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
        $AppUI->redirect();
    } else {
        $AppUI->setMsg("deleted", UI_MSG_ALERT, true);
        $AppUI->redirect("m=risks");
    }
} else {
    if (!$isNotNew) {
        $risk->risk_owner = $AppUI->user_id;
    }
    if ($msg = $risk->store()) {
        $AppUI->setMsg($msg, UI_MSG_ERROR);
    } else {
        $AppUI->setMsg($isNotNew ? 'updated' : 'added', UI_MSG_OK, true);
    }
    $AppUI->redirect();
Пример #3
0
if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
global $AppUI;
$risk_id = intval(dPgetParam($_REQUEST, 'risk_id', 0));
$riskDescription = dPgetParam($_POST, 'risk_note_description', '');
$note = dPgetParam($_POST, 'note', false);
// check permissions
$perms =& $AppUI->acl();
$canEdit = $perms->checkModuleItem('risks', 'edit', $risk_id);
if (!$canEdit) {
    $AppUI->redirect("m=public&a=access_denied");
}
if ($note) {
    $risk = new dotProject_AddOn_Risks($risk_id);
    if ($risk->saveNote($AppUI->user_id, $riskDescription)) {
        $AppUI->setMsg('Note added', UI_MSG_OK);
    }
    $AppUI->redirect('m=risks&a=view&risk_id=' . $risk_id);
}
?>
<form name="editFrm" action="?m=risks&a=vw_note_add" method="post">
	<input type="hidden" name="risk_id" value="<?php 
echo $risk_id;
?>
" />
	<input type="hidden" name="note" value="true" />
<table>
<tr>
	<td align="right" valign="top"><?php