Beispiel #1
0
$titleBlock = new w2p_Theme_TitleBlock('View Department', 'departments.png', $m, $m . '.' . $a);
if ($canEdit) {
    $titleBlock->addCell();
    $titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new department') . '">', '', '<form action="?m=departments&a=addedit&company_id=' . $department->dept_company . '&dept_parent=' . $dept_id . '" method="post" accept-charset="utf-8">', '</form>');
}
$titleBlock->addCrumb('?m=departments', 'department list');
$titleBlock->addCrumb('?m=companies', 'company list');
$titleBlock->addCrumb('?m=companies&a=view&company_id=' . $department->dept_company, 'view this company');
if ($canEdit) {
    $titleBlock->addCrumb('?m=departments&a=addedit&dept_id=' . $dept_id, 'edit this department');
    if ($canDelete) {
        $titleBlock->addCrumbDelete('delete department', $canDelete, $msg);
    }
}
$titleBlock->show();
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
$htmlHelper->stageRowData((array) $department);
?>
<script language="javascript" type="text/javascript">
<?php 
// security improvement:
// some javascript functions may not appear on client side in case of user not having write permissions
// else users would be able to arbitrarily run 'bad' functions
if ($canDelete) {
    ?>
function delIt() {
	if (confirm('<?php 
    echo $AppUI->_('departmentDelete', UI_OUTPUT_JS);
    ?>
')) {
		document.frmDelete.submit();
             $s .= $row[$field] ? '</a>' : '';
             $s .= '</td>';
             break;
         case 'department_list':
             $dept_array = CProject::getDepartments($AppUI, $row['project_id']);
             $s .= '<td>';
             foreach ($dept_array as $dept) {
                 $s .= '<a href="?m=departments&a=view&dept_id=' . $dept['dept_id'] . '">';
                 $s .= $dept['dept_name'];
                 $s .= '</a>';
                 $s .= '<br />';
             }
             $s .= '</td>';
             break;
         default:
             $s .= w2p_Output_HTMLHelper::renderColumn($AppUI, $field, $row);
     }
 }
 $s .= '<td class="center"><input type="checkbox" name="project_id[]" value="' . $row['project_id'] . '" /></td>';
 if ($show_all_projects) {
     $s .= '<td class="left" nowrap="nowrap">';
     $s .= $row['project_status'] == 0 ? $AppUI->_('Not Defined') : ($projectStatuses[0] ? $AppUI->_($project_statuses[$row['project_status'] + 2]) : $AppUI->_($project_statuses[$row['project_status'] + 1]));
     $s .= '</td>';
 }
 if ($level) {
     $s .= '</div>';
 }
 $s .= '</tr>';
 if ($project_id > 0 && !isset($projectArray[$project_id]) || !$project_id && !isset($projectArray[$row['project_id']])) {
     echo $s;
 }
Beispiel #3
0
    $task_name = $obj->getTaskName();
} elseif ($file_task) {
    $q = new w2p_Database_Query();
    $q->addTable('tasks');
    $q->addQuery('task_name');
    $q->addWhere('task_id=' . (int) $file_task);
    $task_name = $q->loadResult();
    $q->clear();
} else {
    $task_name = '';
}
$extra = array('where' => 'project_active<>0');
$project = new CProject();
$projects = $project->getAllowedRecords($AppUI->user_id, 'projects.project_id,project_name', 'project_name', null, $extra, 'projects');
$projects = arrayMerge(array('0' => $AppUI->_('All')), $projects);
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
?>

<script language="javascript" type="text/javascript">
function popFile( params ) {
    fileloader = window.open("fileviewer.php?"+params,"mywindow","location=1,status=1,scrollbars=0,width=80,height=80");
    fileloader.moveTo(0,0);
}
</script>

<form name="coFrm" action="?m=files" method="post" accept-charset="utf-8">
	<input type="hidden" name="dosql" value="do_file_co" />
	<input type="hidden" name="del" value="0" />
	<input type="hidden" name="file_id" value="<?php 
echo $file_id;
?>
Beispiel #4
0
    ?>
<!--                </a>-->
            </th><?php 
}
echo '<th></th>';
?>
    </tr>
<?php 
// Pull the task comments
$task = new CTask();
//TODO: this method should be moved to CTaskLog
$logs = $task->getTaskLogs($task_id, $problem);
$s = '';
$hrs = 0;
$canEdit = canEdit('task_log');
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
$billingCategory = w2PgetSysVal('BudgetCategory');
$durnTypes = w2PgetSysVal('TaskDurationType');
$taskLogReference = w2PgetSysVal('TaskLogReference');
$status = w2PgetSysVal('TaskStatus');
$task_types = w2PgetSysVal('TaskType');
$customLookups = array('budget_category' => $billingCategory, 'task_duration_type' => $durnTypes, 'task_log_reference' => $taskLogReference, 'task_status' => $status, 'task_type' => $task_types);
if (count($logs)) {
    foreach ($logs as $row) {
        $s .= '<tr bgcolor="white" valign="top"><td>';
        if ($canEdit) {
            $s .= '<a href="?m=tasks&a=view&task_id=' . $task_id . '&tab=';
            $s .= $tab == -1 ? $AppUI->getState('TaskLogVwTab') : '1';
            $s .= '&task_log_id=' . $row['task_log_id'] . '">' . w2PshowImage('icons/stock_edit-16.png', 16, 16, '') . '</a>';
        }
        $s .= '<a name="tasklog' . $row['task_log_id'] . '"></a>';
Beispiel #5
0
    ?>
    <table class="tbl list center" width="50%">
        <tr>
            <?php 
    foreach ($fieldNames as $index => $name) {
        ?>
                <th><?php 
        echo $AppUI->_($fieldNames[$index]);
        ?>
</th>
            <?php 
    }
    ?>
        </tr>
        <?php 
    $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
    foreach ($rows as $row) {
        $htmlHelper->stageRowData($row);
        ?>
<tr><?php 
        echo $htmlHelper->createCell('na', $row['contact_first_name']);
        echo $htmlHelper->createCell('na', $row['contact_last_name']);
        echo $htmlHelper->createCell('user_ip', $row['user_ip']);
        echo $htmlHelper->createCell('log_in_datetime', $row['date_time_in']);
        echo $htmlHelper->createCell('log_out_datetime', $row['date_time_out']);
        ?>
</tr><?php 
    }
    ?>
    </table>
    <?php 
Beispiel #6
0
 echo '<table cellspacing="1" cellpadding="4" border="0" class="tbl"><tr>';
 if ($project_id == 0) {
     echo '<th>Project Name</th>';
 }
 echo '<th>Task Name</th>';
 echo '<th width=400>Task Description</th>';
 echo '<th>Assigned To</th>';
 echo '<th>Task Start Date</th>';
 echo '<th>Task End Date</th>';
 echo '<th>Completion</th></tr>';
 $pdfdata = array();
 $columns = array('<b>' . $AppUI->_('Task Name') . '</b>', '<b>' . $AppUI->_('Task Description') . '</b>', '<b>' . $AppUI->_('Assigned To') . '</b>', '<b>' . $AppUI->_('Task Start Date') . '</b>', '<b>' . $AppUI->_('Task End Date') . '</b>', '<b>' . $AppUI->_('Completion') . '</b>');
 if ($project_id == 0) {
     array_unshift($columns, '<b>' . $AppUI->_('Project Name') . '</b>');
 }
 $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
 if ($project_id == 0) {
     $myProject = new CProject();
     $projects = $myProject->getAllowedProjects($AppUI->user_id);
     $project_ids = array_keys($projects);
 } else {
     $project_ids = array($project_id);
 }
 $obj = new CTask();
 foreach ($project_ids as $project_id) {
     $taskTree = $obj->getTaskTree($project_id, 0);
     foreach ($taskTree as $task) {
         $str = '<tr>';
         if (count($project_ids) > 1) {
             $str .= '<td>' . $task['project_name'] . '</td>';
         }
function showtask_pr_ed(&$arr, $level = 0, $today_view = false)
{
    global $AppUI, $done;
    //Check for Tasks Access
    $tmpTask = new CTask();
    $tmpTask->load($arr['task_id']);
    $canAccess = $tmpTask->canAccess();
    if (!$canAccess) {
        return false;
    }
    $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
    $htmlHelper->df .= ' ' . $AppUI->getPref('TIMEFORMAT');
    $done[] = $arr['task_id'];
    $s = '<tr>';
    // dots
    $s .= '<td style="width: ' . ($today_view ? '20%' : '50%') . '" class="data _name">';
    for ($y = 0; $y < $level; $y++) {
        if ($y + 1 == $level) {
            $image = w2PfindImage('corner-dots.gif', $m);
        } else {
            $image = w2PfindImage('shim.gif', $m);
        }
        $s .= '<img src="' . $image . '" width="16" height="12"  border="0" alt="" />';
    }
    // name link
    $alt = mb_strlen($arr['task_description']) > 80 ? mb_substr($arr['task_description'], 0, 80) . '...' : $arr['task_description'];
    // instead of the statement below
    $alt = mb_str_replace('"', "&quot;", $alt);
    $alt = mb_str_replace("\r", ' ', $alt);
    $alt = mb_str_replace("\n", ' ', $alt);
    $open_link = w2PshowImage('collapse.gif');
    if ($arr['task_milestone'] > 0) {
        $s .= '&nbsp;<b>' . $arr["task_name"] . '</b><!--</a>--> <img src="' . w2PfindImage('icons/milestone.gif', $m) . '" border="0" alt="" />';
    } elseif ($arr['task_dynamic'] == '1') {
        $s .= $open_link;
        $s .= '<strong>' . $arr['task_name'] . '</strong>';
    } else {
        $s .= $arr['task_name'];
    }
    $s .= '</td>';
    $s .= $htmlHelper->createCell('task_percent_complete', $arr['task_percent_complete']);
    $s .= $htmlHelper->createCell('task_start_date', $arr['task_start_date']);
    $s .= $htmlHelper->createCell('task_end_date', $arr['task_end_date']);
    $s .= $htmlHelper->createCell('last_update', $arr['last_update']);
    $s .= '</tr>';
    return $s;
}
Beispiel #8
0
    $titleBlock->addCell();
    $titleBlock->addCell('
		<form action="?m=calendar&amp;a=addedit" method="post" accept-charset="utf-8">
			<input type="submit" class="button" value="' . $AppUI->_('new event') . '" />
		</form>', '', '', '');
}
$titleBlock->addCrumb('?m=calendar&amp;date=' . $start_date->format(FMT_TIMESTAMP_DATE), 'month view');
$titleBlock->addCrumb('?m=calendar&amp;a=day_view&amp;date=' . $start_date->format(FMT_TIMESTAMP_DATE) . '&amp;tab=0', 'day view');
if ($canEdit) {
    $titleBlock->addCrumb('?m=calendar&amp;a=addedit&amp;event_id=' . $event_id, 'edit this event');
    if ($canDelete) {
        $titleBlock->addCrumbDelete('delete event', $canDelete, $msg);
    }
}
$titleBlock->show();
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
$htmlHelper->df .= ' ' . $tf;
?>
<script language="javascript" type="text/javascript">
<?php 
// security improvement:
// some javascript functions may not appear on client side in case of user not having write permissions
// else users would be able to arbitrarily run 'bad' functions
if ($canDelete) {
    ?>
function delIt() {
	if (confirm( "<?php 
    echo $AppUI->_('eventDelete', UI_OUTPUT_JS);
    ?>
" )) {
		document.frmDelete.submit();
Beispiel #9
0
<?php

$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
$df = $AppUI->getPref('SHDATEFORMAT');
?>
<table id="tblProjects" class="std view projects">
<tr>
    <td style="border: outset #d1d1cd 1px;background-color:#<?php 
echo $project->project_color_identifier;
?>
" colspan="2" id="view-header">
        <?php 
echo '<font color="' . bestColor($project->project_color_identifier) . '"><strong>' . $project->project_name . '<strong></font>';
?>
    </td>
</tr>
<tr>
<td class="view-column">
    <strong><?php 
echo $AppUI->_('Details');
?>
</strong>
    <table cellspacing="1" cellpadding="2" border="0" width="100%" class="well">
        <tr>
            <td align="right" nowrap="nowrap"><?php 
echo $AppUI->_('Company');
?>
:</td>
            <?php 
echo $htmlHelper->createCell('project_company', $project->project_company);
?>
Beispiel #10
0
    ?>
</th>
        <?php 
}
?>
        <th></th>
    </tr>
<?php 
// Pull the task comments
$task = new CTask();
//TODO: this method should be moved to CTaskLog
$logs = $task->getTaskLogs($task_id, $problem);
$s = '';
$hrs = 0;
$canEdit = canEdit('task_log');
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
$billingCategory = w2PgetSysVal('BudgetCategory');
$durnTypes = w2PgetSysVal('TaskDurationType');
$taskLogReference = w2PgetSysVal('TaskLogReference');
$status = w2PgetSysVal('TaskStatus');
$task_types = w2PgetSysVal('TaskType');
$customLookups = array('budget_category' => $billingCategory, 'task_duration_type' => $durnTypes, 'task_log_reference' => $taskLogReference, 'task_status' => $status, 'task_type' => $task_types);
if (count($logs)) {
    foreach ($logs as $row) {
        $s .= '<tr>';
        $s .= '<td class="data _edit">';
        if ($canEdit) {
            $s .= '<a href="?m=tasks&a=view&task_id=' . $task_id . '&tab=';
            $s .= $tab == -1 ? $AppUI->getState('TaskLogVwTab') : '1';
            $s .= '&task_log_id=' . $row['task_log_id'] . '">' . w2PshowImage('icons/stock_edit-16.png', 16, 16, '') . '</a>';
        }
function displayFiles($AppUI, $folder_id, $task_id, $project_id, $company_id)
{
    global $m, $tab, $xpg_min, $xpg_pagesize, $showProject, $file_types, $company_id, $current_uri, $canEdit;
    // SETUP FOR FILE LIST
    $q = new w2p_Database_Query();
    $q->addQuery('f.*, max(f.file_id) as latest_id, count(f.file_version) as file_versions, round(max(file_version), 2) as file_lastversion, file_owner, user_id');
    $q->addQuery('ff.*, max(file_version) as file_version, f.file_date as file_datetime');
    $q->addTable('files', 'f');
    $q->addJoin('file_folders', 'ff', 'ff.file_folder_id = file_folder');
    $q->addJoin('projects', 'p', 'p.project_id = file_project');
    $q->addJoin('tasks', 't', 't.task_id = file_task');
    $q->addJoin('users', 'u', 'u.user_id = file_owner');
    $q->leftJoin('project_departments', 'project_departments', 'p.project_id = project_departments.project_id OR project_departments.project_id IS NULL');
    $q->leftJoin('departments', 'departments', 'departments.dept_id = project_departments.department_id OR dept_id IS NULL');
    //TODO: apply permissions properly
    $project = new CProject();
    $deny1 = $project->getDeniedRecords($AppUI->user_id);
    if (count($deny1) > 0) {
        $q->addWhere('file_project NOT IN (' . implode(',', $deny1) . ')');
    }
    //TODO: apply permissions properly
    $task = new CTask();
    $deny2 = $task->getDeniedRecords($AppUI->user_id);
    if (count($deny2) > 0) {
        $q->addWhere('file_task NOT IN (' . implode(',', $deny2) . ')');
    }
    if ($project_id) {
        $q->addWhere('file_project = ' . (int) $project_id);
    }
    if ($task_id) {
        $q->addWhere('file_task = ' . (int) $task_id);
    }
    if ($company_id) {
        $q->addWhere('project_company = ' . (int) $company_id);
    }
    //$tab = ($m == 'files') ? $tab-1 : -1;
    $temp_tab = $m == 'files' ? $tab - 1 : -1;
    if ($temp_tab >= 0 and count($file_types) - 1 > $temp_tab) {
        //if ($tab >= 0) {
        $q->addWhere('file_category = ' . (int) $temp_tab);
    }
    $q->setLimit($xpg_pagesize, $xpg_min);
    if ($folder_id > -1) {
        $q->addWhere('file_folder = ' . (int) $folder_id);
    }
    $q->addGroup('file_version_id DESC');
    $q->addOrder('project_name ASC, file_parent ASC, file_id DESC');
    $qv = new w2p_Database_Query();
    $qv->addTable('files');
    $qv->addQuery('file_id, file_version, file_project, file_name, file_task,
        file_description, file_owner, file_size, file_category,
        task_name, file_version_id, file_date as file_datetime, file_checkout, file_co_reason, file_type,
        file_date, cu.user_username as co_user, project_name,
        project_color_identifier, project_owner, u.user_id,
        con.contact_first_name, con.contact_last_name, con.contact_display_name as contact_name,
        co.contact_first_name as co_contact_first_name, co.contact_last_name as co_contact_last_name,
        co.contact_display_name as co_contact_name ');
    $qv->addJoin('projects', 'p', 'p.project_id = file_project');
    $qv->addJoin('users', 'u', 'u.user_id = file_owner');
    $qv->addJoin('contacts', 'con', 'con.contact_id = u.user_contact');
    $qv->addJoin('tasks', 't', 't.task_id = file_task');
    $qv->addJoin('file_folders', 'ff', 'ff.file_folder_id = file_folder');
    if ($project_id) {
        $qv->addWhere('file_project = ' . (int) $project_id);
    }
    if ($task_id) {
        $qv->addWhere('file_task = ' . (int) $task_id);
    }
    if ($company_id) {
        $qv->addWhere('project_company = ' . (int) $company_id);
    }
    if ($temp_tab >= 0 and count($file_types) - 1 > $temp_tab) {
        //if ($tab >= 0) {
        $qv->addWhere('file_category = ' . (int) $temp_tab);
    }
    $qv->leftJoin('users', 'cu', 'cu.user_id = file_checkout');
    $qv->leftJoin('contacts', 'co', 'co.contact_id = cu.user_contact');
    if ($folder_id > -1) {
        $qv->addWhere('file_folder = ' . (int) $folder_id);
    }
    $files = $q->loadList();
    $file_versions = $qv->loadHashList('file_id');
    $module = new w2p_System_Module();
    $fields = $module->loadSettings('files', 'index_list');
    if (count($fields) > 0) {
        $fieldList = array_keys($fields);
        $fieldNames = array_values($fields);
    } else {
        // TODO: This is only in place to provide an pre-upgrade-safe
        //   state for versions earlier than v3.0
        //   At some point at/after v4.0, this should be deprecated
        $fieldList = array('file_name', 'file_description', 'file_version', 'file_category', 'file_folder', 'file_task', 'file_owner', 'file_datetime');
        $fieldNames = array('File Name', 'Description', 'Version', 'Category', 'Folder', 'Task Name', 'Owner', 'Date');
        $module->storeSettings('files', 'index_list', $fieldList, $fieldNames);
    }
    $s = '<tr>';
    $s .= '<th></th>';
    $s .= '<th>' . $AppUI->_('co') . '</th>';
    foreach ($fieldNames as $index => $name) {
        $s .= '<th>' . $AppUI->_($fieldNames[$index]) . '</th>';
    }
    $s .= '<th></th>';
    $s .= '</tr>';
    $fp = -1;
    $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
    $htmlHelper->df .= ' ' . $AppUI->getPref('TIMEFORMAT');
    $file_types = w2PgetSysVal('FileType');
    $customLookups = array('file_category' => $file_types);
    foreach ($files as $row) {
        $latest_file = $file_versions[$row['latest_id']];
        if ($fp != $latest_file['file_project']) {
            if (!$latest_file['file_project']) {
                $latest_file['project_name'] = $AppUI->_('Not attached to a project');
                $latest_file['project_color_identifier'] = 'f4efe3';
            }
            if ($showProject) {
                $style = 'background-color:#' . $latest_file['project_color_identifier'] . ';color:' . bestColor($latest_file['project_color_identifier']);
                $s .= '<tr>';
                $s .= '<td colspan="20" style="text-align: left; border: outset 2px #eeeeee;' . $style . '">';
                if ($latest_file['file_project'] > 0) {
                    $href = './index.php?m=projects&a=view&project_id=' . $latest_file['file_project'];
                } else {
                    $href = './index.php?m=projects';
                }
                $s .= '<a href="' . $href . '">';
                $s .= '<span style="' . $style . '">' . $latest_file['project_name'] . '</span></a>';
                $s .= '</td></tr>';
            }
        }
        $fp = $latest_file['file_project'];
        $row['file_datetime'] = $latest_file['file_datetime'];
        $row['file_id'] = $latest_file['file_id'];
        $htmlHelper->stageRowData($row);
        $s .= '<tr>';
        $s .= '<td class="data">';
        if ($canEdit && (empty($latest_file['file_checkout']) || $latest_file['file_checkout'] == 'final' && ($canEdit || $latest_file['project_owner'] == $AppUI->user_id))) {
            $s .= '<a href="./index.php?m=files&a=addedit&file_id=' . $latest_file['file_id'] . '">' . w2PshowImage('kedit.png', '16', '16', 'edit file', 'edit file', 'files') . '</a>';
        }
        $s .= '</td>';
        $s .= '<td class="data">';
        if ($canEdit && empty($latest_file['file_checkout'])) {
            $s .= '<a href="?m=files&a=co&file_id=' . $latest_file['file_id'] . '">' . w2PshowImage('up.png', '16', '16', 'checkout', 'checkout file', 'files') . '</a>';
        } else {
            if ($latest_file['file_checkout'] == $AppUI->user_id) {
                $s .= '<a href="?m=files&a=addedit&ci=1&file_id=' . $latest_file['file_id'] . '">' . w2PshowImage('down.png', '16', '16', 'checkin', 'checkin file', 'files') . '</a>';
            } else {
                if ($latest_file['file_checkout'] == 'final') {
                    $s .= 'final';
                } else {
                    $s .= $latest_file['co_contact_name'] . '<br>(' . $latest_file['co_user'] . ')';
                }
            }
        }
        $version_link = '';
        $hidden_table = '';
        if ($row['file_versions'] > 1) {
            $version_link = '&nbsp<a href="javascript: void(0);" onClick="expand(\'versions_' . $latest_file['file_id'] . '\'); ">(' . $row['file_versions'] . ')</a>';
            $hidden_table = '<tr><td colspan="20">
                <table style="display: none" id="versions_' . $latest_file['file_id'] . '" class="tbl list">
                <tr>';
            foreach ($fieldNames as $index => $name) {
                $hidden_table .= '<th nowrap="nowrap">';
                $hidden_table .= $AppUI->_($fieldNames[$index]);
                $hidden_table .= '</th>';
            }
            $hidden_table .= '</tr>';
            $sub_htmlHelper = new w2p_Output_HTMLHelper($AppUI);
            $sub_htmlHelper->df .= ' ' . $AppUI->getPref('TIMEFORMAT');
            foreach ($file_versions as $file) {
                $sub_htmlHelper->stageRowData($file);
                if ($file['file_version_id'] == $latest_file['file_version_id']) {
                    foreach ($fieldList as $index => $column) {
                        $hidden_table .= $sub_htmlHelper->createCell($fieldList[$index], $file[$fieldList[$index]], $customLookups);
                    }
                    if ($canEdit && w2PgetConfig('files_show_versions_edit')) {
                        $hidden_table .= '<a href="./index.php?m=files&a=addedit&file_id=' . $file['file_id'] . '">' . w2PshowImage('kedit.png', '16', '16', 'edit file', 'edit file', 'files') . "</a>";
                    }
                    $hidden_table .= '</td><tr>';
                }
            }
            $hidden_table .= '</table>';
        }
        $s .= '</td>';
        foreach ($fieldList as $index => $column) {
            $cell = $htmlHelper->createCell($fieldList[$index], $row[$fieldList[$index]], $customLookups);
            if ('file_version' == $fieldList[$index]) {
                $cell = str_replace('</td>', $version_link . '</td>', $cell);
            }
            $s .= $cell;
        }
        $s .= '<td>';
        $s .= '<form name="frm_remove_file_' . $latest_file['file_id'] . '" action="?m=files" method="post" accept-charset="utf-8">
            <input type="hidden" name="dosql" value="do_file_aed" />
            <input type="hidden" name="del" value="1" />
            <input type="hidden" name="file_id" value="' . $latest_file['file_id'] . '" />
            <input type="hidden" name="redirect" value="' . $current_uri . '" />
            </form>';
        $s .= '<a href="javascript: void(0);" onclick="if (confirm(\'' . $AppUI->_('Are you sure you want to delete this file?') . '\')) {document.frm_remove_file_' . $latest_file['file_id'] . '.submit()}">' . w2PshowImage('remove.png', '16', '16', 'delete file', 'delete file', 'files') . '</a>';
        $s .= '</td>';
        $s .= '</tr>';
        $s .= $hidden_table;
    }
    if (0 == count($files)) {
        $s .= '<tr><td colspan="' . (count($fieldNames) + 3) . '">' . $AppUI->_('No data available') . '</td></tr>';
    }
    return $s;
}
 $st_projects_arr = array();
 if ($row['project_id'] == $row['project_original_parent']) {
     $tmpProject->project_original_parent = $row['project_original_parent'];
     $tmpProject->project_status = -1;
     if ($project_status_filter == -2) {
         $st_projects_arr = $tmpProject->getStructuredProjects(true);
     } else {
         $st_projects_arr = $tmpProject->getStructuredProjects();
     }
 } else {
     $st_projects_arr[0][1] = 0;
 }
 if (!is_array($st_projects_arr)) {
     continue;
 }
 $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
 foreach ($st_projects_arr as $st_project) {
     $multiproject_id = 0;
     $project_id = isset($st_project[0]) ? $st_project[0]['project_id'] : 0;
     $level = $st_project[1];
     if ($project_id) {
         if ($is_tabbed) {
             $row = $all_projects[getProjectIndex($all_projects, $project_id)];
         } else {
             $row = $items[getProjectIndex($items, $project_id)];
         }
     }
     $none = false;
     $end_date = intval($row['project_end_date']) ? new w2p_Utilities_Date($row['project_end_date']) : null;
     $actual_end_date = intval($row['project_actual_end_date']) ? new w2p_Utilities_Date($row['project_actual_end_date']) : null;
     $style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
    ?>
<th>
            <a href="?m=users&orderby=<?php 
    echo $fieldList[$index];
    ?>
" class="hdr">
                <?php 
    echo $AppUI->_($fieldNames[$index]);
    ?>
            </a>
        </th><?php 
}
?>
    </tr>
<?php 
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
foreach ($rows as $row) {
    $htmlHelper->stageRowData($row);
    $s = '<tr>';
    $s .= '<td align="center" nowrap="nowrap">';
    if ($canEdit && $canDelete) {
        $s .= '<input type="button" class="button" value="' . $AppUI->_('logout_session') . '" onclick="javascript:window.location=\'./index.php?m=users&tab=3&out_session=' . $row['session_id'] . '&out_user_log_id=' . $row['user_access_log_id'] . '&out_user_id=' . $row['u_user_id'] . '&out_name=' . addslashes($row['contact_display_name']) . '\';"></input>';
    }
    $s .= '</td><td align="center" nowrap="nowrap">';
    if ($canEdit && $canDelete && $logoutUserFlag) {
        $s .= '<input type="button" class=button value="' . $AppUI->_('logout_user') . '" onclick="javascript:window.location=\'./index.php?m=users&tab=3&out_user_id=' . $row['u_user_id'] . '&out_name=' . addslashes($row['contact_display_name']) . '\';"></input>';
    }
    $s .= '</td>';
    $s .= $htmlHelper->createCell('na', $row['user_username']);
    $s .= $htmlHelper->createCell('na', $row['contact_display_name']);
    $s .= $htmlHelper->createCell('contact_company', $row['contact_company']);
Beispiel #14
0
    ?>
" alt=""><?php 
    echo $AppUI->_($module['mod_name']);
    ?>
                    </a>
                <?php 
    echo w2PendTip();
    ?>
            </h2>
        </td>
    </tr>
    <?php 
    $fieldList = array('field_name', 'field_description', 'field_htmltype', 'field_published', 'field_order');
    $fieldNames = array('Name', 'Description', 'Type', 'Published', 'Order');
    $rows = $manager->getStructure($module['mod_name']);
    $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
    $s = '';
    if (count($rows)) {
        $s .= '<tr><th width="10"></th>';
        foreach ($fieldNames as $index => $name) {
            $s .= '<th>' . $AppUI->_($fieldNames[$index]) . '</th>';
        }
        $s .= '<th width="10"></th></tr>';
        foreach ($rows as $row) {
            $s .= '<tr><td class="hilite">';
            $s .= w2PtoolTip('', $AppUI->_('Click this icon to Edit this Custom Field.'), true);
            $s .= '<a href="?m=system&u=customfields&a=addedit&module=' . $module['mod_id'] . '&field_id=' . $row['field_id'] . '"><img src="' . w2PfindImage('icons/stock_edit-16.png') . '" /></a>';
            $s .= w2PendTip();
            $s .= $htmlHelper->createCell('na', $row['field_name']);
            $s .= $htmlHelper->createCell('field_description', $row['field_description']);
            $s .= '<td>' . $AppUI->_($manager->getType($row['field_htmltype'])) . '</td>';
Beispiel #15
0
foreach ($fieldNames as $index => $name) {
    ?>
            <th><?php 
    echo $AppUI->_($fieldNames[$index]);
    ?>
</th>
        <?php 
}
?>
    </tr>
<?php 
$none = true;
$project_statuses = w2PgetSysVal('ProjectStatus');
$project_types = w2PgetSysVal('ProjectType');
$customLookups = array('project_status' => $project_statuses, 'project_type' => $project_types);
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
foreach ($projects as $row) {
    $htmlHelper->stageRowData($row);
    if ($show_all_projects || $row['project_active'] && $row['project_status'] == $project_status_filter || $row['project_active'] && $row['project_status'] == $project_status_filter || !$row['project_active'] && $project_status_filter == -3) {
        $none = false;
        $end_date = intval($row['project_end_date']) ? new w2p_Utilities_Date($row['project_end_date']) : null;
        $actual_end_date = intval($row['project_actual_end_date']) ? new w2p_Utilities_Date($row['project_actual_end_date']) : null;
        $style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
        $s = '<tr><td width="65" align="center" style="border: outset #eeeeee 2px;background-color:#' . $row['project_color_identifier'] . '"><font color="' . bestColor($row['project_color_identifier']) . '">' . sprintf("%.1f%%", $row['project_percent_complete']) . '</font></td>';
        $s .= $htmlHelper->createCell('project_priority', $row['project_priority']);
        $s .= $htmlHelper->createCell('project_id', $row['project_id']);
        $s .= $htmlHelper->createCell('na', $row['project_name']);
        $s .= $htmlHelper->createCell('na', $row['company_name']);
        $s .= $htmlHelper->createCell('project_start_date', $row['project_start_date']);
        $s .= $htmlHelper->createCell('project_end_date', $row['project_end_date']);
        $s .= $htmlHelper->createCell('project_actual_end_date', $row['project_actual_end_date']);
Beispiel #16
0
//if $department contains the $company_prefix string that it's requesting a company and not a department.  So, clear the
// $department variable, and populate the $company_id variable.
if (!(strpos($department, $company_prefix) === false)) {
    $company_id = substr($department, strlen($company_prefix));
    $AppUI->setState('UsrProjIdxCompany', $company_id);
    unset($department);
}
$tab = $AppUI->processIntState('UserVwTab', $_GET, 'tab', 0);
// pull data
$user = new CUser();
$user->loadFull($user_id);
$contact = new CContact();
$contact->contact_id = $user->user_contact;
$methods = $contact->getContactMethods();
$methodLabels = w2PgetSysVal('ContactMethods');
$helper = new w2p_Output_HTMLHelper($AppUI);
if (!$user) {
    $titleBlock = new w2p_Theme_TitleBlock('Invalid User ID', 'helix-setup-user.png', $m, "{$m}.{$a}");
    $titleBlock->addCrumb('?m=admin', 'users list');
    $titleBlock->show();
} else {
    $countries = w2PgetSysVal('GlobalCountries');
    // setup the title block
    $titleBlock = new w2p_Theme_TitleBlock('View User', 'helix-setup-user.png', $m, "{$m}.{$a}");
    if ($canRead) {
        $titleBlock->addCrumb('?m=admin', 'users list');
    }
    if ($canEdit || $user_id == $AppUI->user_id) {
        $titleBlock->addCrumb('?m=admin&a=addedituser&user_id=' . $user_id, 'edit this user');
        $titleBlock->addCrumb('?m=contacts&a=addedit&contact_id=' . $user->contact_id, 'edit this contact');
        $titleBlock->addCrumb('?m=system&a=addeditpref&user_id=' . $user_id, 'edit preferences');
 public function __construct($AppUI)
 {
     $this->_AppUI = $AppUI;
     parent::__construct($AppUI);
 }
Beispiel #18
0
$dept_detail = $contact->getDepartmentDetails();
// Get the Contact info (phone, emails, etc) for the contact
$methods = $contact->getContactMethods();
$methodLabels = w2PgetSysVal('ContactMethods');
// setup the title block
$ttl = 'View Contact';
$titleBlock = new w2p_Theme_TitleBlock($ttl, 'monkeychat-48.png', $m, $m . '.' . $a);
$titleBlock->addCrumb('?m=contacts', 'contacts list');
if ($canEdit && $contact_id) {
    $titleBlock->addCrumb('?m=contacts&a=addedit&contact_id=' . $contact_id, 'edit this contact');
}
if ($canDelete && $contact_id) {
    $titleBlock->addCrumbDelete('delete contact', $canDelete, $msg);
}
$titleBlock->show();
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
$last_ask = new w2p_Utilities_Date($contact->contact_updateasked);
$lastupdated = new w2p_Utilities_Date($contact->contact_lastupdate);
?>
<form name="changecontact" action="?m=contacts" method="post" accept-charset="utf-8">
        <input type="hidden" name="dosql" value="do_contact_aed" />
        <input type="hidden" name="del" value="0" />
        <input type="hidden" name="contact_id" value="<?php 
echo $contact_id;
?>
" />
        <input type="hidden" name="contact_owner" value="<?php 
echo $contact->contact_owner ? $contact->contact_owner : $AppUI->user_id;
?>
" />
</form>
Beispiel #19
0
                    </td>
                </tr>
                <?php 
}
$contacts = $obj->getContacts($AppUI, $task_id);
if (count($contacts)) {
    echo '<tr><td><strong>' . $AppUI->_('Task Contacts') . '</strong></td></tr>';
    echo '<tr><td colspan="3" class="hilite">';
    echo w2p_Output_HTMLHelper::renderContactList($AppUI, $contacts);
    echo '</td></tr>';
}
$contacts = CProject::getContacts($AppUI, $obj->task_project);
if (count($contacts)) {
    echo '<tr><td><strong>' . $AppUI->_('Project Contacts') . '</strong></td></tr>';
    echo '<tr><td colspan="3" class="hilite">';
    echo w2p_Output_HTMLHelper::renderContactList($AppUI, $contacts);
    echo '</td></tr>';
}
?>
                <tr>
                    <td colspan="3">
                        <?php 
$custom_fields = new w2p_Core_CustomFields($m, $a, $obj->task_id, 'view');
$custom_fields->printHTML();
?>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
Beispiel #20
0
$projectArray = array();
for ($i = ($page - 1) * $xpg_pagesize; $i < $page * $xpg_pagesize && $i < $xpg_totalrecs; $i++) {
    $row = $projects[$i];
    if ($show_all_projects || $row['project_active'] && $row['project_status'] == $project_status_filter && $is_tabbed || $row['project_active'] && $row['project_status'] == $project_status_filter && !$is_tabbed || !$row['project_active'] && $project_status_filter == -3 && !$is_tabbed) {
        $st_projects_arr = array();
        if ($row['project_id'] == $row['project_original_parent']) {
            if ($project_status_filter == -2) {
                $structprojects = getStructuredProjects($row['project_original_parent'], '-1', true);
            } else {
                $structprojects = getStructuredProjects($row['project_original_parent'], '-1');
            }
        } else {
            $st_projects_arr[0][1] = 0;
        }
        $tmpProject = new CProject();
        $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
        foreach ($st_projects_arr as $st_project) {
            $multiproject_id = 0;
            $project_id = isset($st_project[0]) ? $st_project[0]['project_id'] : 0;
            $level = $st_project[1];
            if ($project_id) {
                if ($is_tabbed) {
                    $row = $all_projects[getProjectIndex($all_projects, $project_id)];
                } else {
                    $row = $projects[getProjectIndex($projects, $project_id)];
                }
            }
            $none = false;
            $end_date = intval($row['project_end_date']) ? new w2p_Utilities_Date($row['project_end_date']) : null;
            $actual_end_date = intval($row['project_actual_end_date']) ? new w2p_Utilities_Date($row['project_actual_end_date']) : null;
            $style = $actual_end_date > $end_date && !empty($end_date) ? 'style="color:red; font-weight:bold"' : '';
Beispiel #21
0
$titleBlock->addCrumb('?m=tasks', 'tasks list');
if ($canReadProject) {
    $titleBlock->addCrumb('?m=projects&a=view&project_id=' . $obj->task_project, 'view this project');
}
if ($canEdit && 0 == $obj->task_represents_project) {
    $titleBlock->addCrumb('?m=tasks&a=addedit&task_id=' . $task_id, 'edit this task');
}
//$obj->task_represents_project
if ($obj->task_represents_project) {
    $titleBlock->addCrumb('?m=projects&a=view&project_id=' . $obj->task_represents_project, 'view subproject');
}
if ($canDelete) {
    $titleBlock->addCrumbDelete('delete task', $canDelete, $msg);
}
$titleBlock->show();
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
?>
<script language="javascript" type="text/javascript">
function updateTask() {
	var f = document.editFrm;

	f.submit();
}
<?php 
if ($canDelete) {
    ?>
function delIt() {
	if (confirm( '<?php 
    echo $AppUI->_('doDelete', UI_OUTPUT_JS) . ' ' . $AppUI->_('Task', UI_OUTPUT_JS) . '?';
    ?>
' )) {
Beispiel #22
0
$canRead = canView('system');
if (!$canRead) {
    $AppUI->redirect(ACCESS_DENIED);
}
$module = new w2p_System_Module();
$hidden_modules = array('public', 'install');
$modules = __extract_from_modules_index($hidden_modules);
// get the modules actually installed on the file system
$loader = new w2p_FileSystem_Loader();
$modFiles = $loader->readDirs('modules');
$titleBlock = new w2p_Theme_TitleBlock('Modules', 'power-management.png', $m);
$titleBlock->addCrumb('?m=system', 'System Admin');
$titleBlock->show();
$fieldList = array('mod_name', 'mod_active', 'mod_customize', 'mod_type', 'mod_version', 'mod_ui_name', 'mod_ui_icon', 'mod_ui_active', 'mod_ui_order');
$fieldNames = array('Module', 'Status', 'Customize', 'Type', 'Version', 'Menu Text', 'Menu Icon', 'Menu Status', 'Order');
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
?>

<table class="tbl list modules">
    <?php 
echo '<tr><th></th>';
foreach ($fieldNames as $index => $name) {
    echo '<th>' . $AppUI->_($fieldNames[$index]) . '</th>';
}
echo '</tr>';
// do the modules that are installed on the system
foreach ($modules as $row) {
    // clear the file system entry
    if (isset($modFiles[$row['mod_directory']])) {
        $modFiles[$row['mod_directory']] = '';
    }
Beispiel #23
0
    ?>
<th nowrap="nowrap">
<!--                <a href="?m=departments&orderby=<?php 
    echo $fieldList[$index];
    ?>
" class="hdr">-->
                    <?php 
    echo $AppUI->_($fieldNames[$index]);
    ?>
<!--                </a>-->
            </th><?php 
}
?>
    </tr>
<?php 
if (count($depts)) {
    $htmlHelper = new w2p_Output_HTMLHelper($AppUI);
    foreach ($depts as $row) {
        echo '<tr>';
        $htmlHelper->stageRowData($row);
        //TODO: how do we tweak this to get the parent/child relationship to display?
        foreach ($fieldList as $index => $column) {
            echo $htmlHelper->createCell($fieldList[$index], $row[$fieldList[$index]], $customLookups);
        }
        echo '</tr>';
    }
} else {
    echo '<tr><td colspan="' . count($fieldNames) . '">' . $AppUI->_('No data available') . '</td></tr>';
}
?>
</table>
Beispiel #24
0
foreach ($avail_modules as $avail_module) {
    $modules[$avail_module['value']] = $avail_module['value'];
}
$module = isset($modules[$module]) ? $module : 'all';
$actions = array('all' => 'All Actions', 'access' => 'access', 'add' => 'add', 'delete' => 'delete', 'edit' => 'edit', 'view' => 'view');
$action = isset($actions[$action]) ? $action : 'all';
$users = array('' => '(' . $AppUI->_('Select User') . ')') + w2PgetUsers();
$permissions = getPermissions($perms, $user_id, $module, $action);
$titleBlock = new w2p_Theme_TitleBlock('Permission Result Table', 'icon.png', $m);
$titleBlock->addCell('
    <form action="?m=system&a=acls_view" method="post" name="pickUser" accept-charset="utf-8">' . $AppUI->_('View Users Permissions') . ': ' . arraySelect($users, 'user', 'class="text" onchange="javascript:document.pickUser.submit()"', $user_id) . $AppUI->_('View by Module') . ': ' . arraySelect($modules, 'module', 'class="text" onchange="javascript:document.pickUser.submit()"', $module) . $AppUI->_('View by Action') . ': ' . arraySelect($actions, 'action', 'class="text" onchange="javascript:document.pickUser.submit()"', $action) . '</form>', '', '', '');
$titleBlock->addCrumb('?m=system', 'system admin');
$titleBlock->addCrumb('?m=system&u=roles', 'user roles');
$titleBlock->show();
$fieldNames = array('UserID', 'User', 'Display Name', 'Module', 'Item', 'Item Name', 'Action', 'Allow', 'ACL_ID');
$htmlHelper = new w2p_Output_HTMLHelper($AppUI);
?>
<table class="tbl list">
    <tr>
        <?php 
foreach ($fieldNames as $index => $name) {
    ?>
            <th><?php 
    echo $AppUI->_($fieldNames[$index]);
    ?>
</th>
        <?php 
}
?>
    </tr>
<?php