public function display() { global $mod_strings; if ($_REQUEST['return_module'] == 'Project') { $project = new Project(); $project->retrieve($_REQUEST['return_id']); //Get project resources (users & contacts) $resources1 = $project->get_linked_beans('project_users_1', 'User'); $resources2 = $project->get_linked_beans('project_contacts_1', 'Contact'); //sort into descending order ksort($resources1); ksort($resources2); echo "<script type='text/javascript'>"; echo "var users = [];"; echo "var contacts = [];"; foreach ($resources1 as $user) { echo "var user = ['" . $user->id . "', '" . $user->name . "', 'User'];"; echo "users.push(user);"; } foreach ($resources2 as $contact) { echo "var user = ['" . $contact->id . "', '" . $contact->name . "', 'Contact'];"; echo "contacts.push(user);"; } echo "</script>"; } parent::display(); }
function display() { $this->ev->process(); //echo "<!-- \n"; //var_dump($_REQUEST); //var_dump($this->ev->fieldDefs); //echo "-->"; if (empty($this->ev->focus->id) && $_REQUEST['return_relationship'] == 'projects_cases') { $parent = new Project(); $parent->retrieve($_REQUEST['return_id']); $accts = $parent->get_linked_beans('accounts', 'Account'); $i = 0; $acctlist = array(); foreach ($accts as $acct) { $acctlist[i] = $acct->id; $i++; } if (isset($parent->facility_c) && $this->ev->fieldDefs['jobnumber_c']['value'] == "") { $this->ev->fieldDefs['jobnumber_c']['value'] = $parent->jobnumber_c; } if ($i > 0 && $this->ev->fieldDefs['account_id']['value'] == "") { $this->ev->fieldDefs['account_id']['value'] = $acct->id; $this->ev->fieldDefs['account_name']['value'] = $acct->name; } } echo $this->ev->display(); }
function displayList(&$layout_def) { global $app_strings; global $current_user; $parent_record_id = $_REQUEST['record']; $parent_module = $_REQUEST['module']; if ($layout_def['module'] == 'Holidays') { $action = 'DeleteHolidayRelationship'; } else { if ($layout_def['module'] == 'Users' || $layout_def['module'] == 'Contacts') { $action = 'DeleteResourceRelationship'; } else { $action = 'DeleteRelationship'; } } $record = $layout_def['fields']['ID']; $current_module = $layout_def['module']; $hideremove = false; $return_module = $_REQUEST['module']; $return_action = 'SubPanelViewer'; $subpanel = $layout_def['subpanel_id']; $return_id = $_REQUEST['record']; $focus = new Project(); $focus->retrieve($return_id); if ($current_user->id == $focus->assigned_user_id || is_admin($current_user)) { $is_owner = true; } else { $is_owner = false; } if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) { $linked_field = $layout_def['linked_field_set']; } else { $linked_field = $layout_def['linked_field']; } $refresh_page = 0; if (!empty($layout_def['refresh_page'])) { $refresh_page = 1; } $return_url = "index.php?module={$return_module}&action={$return_action}&subpanel={$subpanel}&record={$return_id}&sugar_body_only=1&inline=1"; $icon_remove_text = strtolower($app_strings['LBL_ID_FF_REMOVE']); $icon_remove_html = SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', ''); //setting alt to blank on purpose on subpanels for 508 $remove_url = $layout_def['start_link_wrapper'] . "index.php?module={$parent_module}" . "&action={$action}" . "&record={$parent_record_id}" . "&linked_field={$linked_field}" . "&linked_id={$record}" . "&return_url=" . urlencode(urlencode($return_url)) . "&refresh_page=1" . $layout_def['end_link_wrapper']; $remove_confirmation_text = $app_strings['NTC_REMOVE_CONFIRMATION']; //based on listview since that lets you select records if ($layout_def['ListView'] && !$hideremove && $is_owner) { return '<a href="' . $remove_url . '"' . ' class="listViewTdToolsS1"' . " onclick=\"return confirm('{$remove_confirmation_text}');\"" . ">{$icon_remove_html} {$icon_remove_text}</a>"; } else { return ''; } }
function display() { //Set Default Assigned User if (empty($this->bean->fetched_row['id'])) { $this->bean->assigned_user_name = 'Operations Group'; $this->bean->assigned_user_id = 'd2853b4a-80b4-7697-9a42-4e5698bb1544'; } $this->ev->process(); //echo "<!-- \n"; //var_dump($_REQUEST); //echo "-->"; if (empty($this->ev->focus->id) && $_REQUEST['return_relationship'] == 'projects_cases') { $parent = new Project(); $parent->retrieve($_REQUEST['return_id']); if (isset($parent->facility_c) && $this->ev->fieldDefs['facility_c']['value'] == "") { $this->ev->fieldDefs['facility_c']['value'] = $parent->facility_c; } if (isset($parent->wellname_c) && $this->ev->fieldDefs['wellname_c']['value'] == "") { $this->ev->fieldDefs['wellname_c']['value'] = $parent->wellname_c; } if (isset($parent->afe_c) && $this->ev->fieldDefs['afe_c']['value'] == "") { $this->ev->fieldDefs['afe_c']['value'] = $parent->afe_c; } if (isset($parent->po_c) && $this->ev->fieldDefs['po_c']['value'] == "") { $this->ev->fieldDefs['po_c']['value'] = $parent->po_c; } if (isset($parent->parish_c) && $this->ev->fieldDefs['parish_c']['value'] == "") { $this->ev->fieldDefs['parish_c']['value'] = $parent->parish_c; } if (isset($parent->areablock_c) && $this->ev->fieldDefs['areablock_c']['value'] == "") { $this->ev->fieldDefs['areablock_c']['value'] = $parent->areablock_c; } if (isset($parent->specialbilling_c) && $this->ev->fieldDefs['specialbilling_c']['value'] == "") { $this->ev->fieldDefs['specialbilling_c']['value'] = $parent->specialbilling_c; } if (isset($parent->lat_c) && $this->ev->fieldDefs['lat_c']['value'] == "") { $this->ev->fieldDefs['lat_c']['value'] = $parent->lat_c; } if (isset($parent->longitude_c) && $this->ev->fieldDefs['longitude_c']['value'] == "") { $this->ev->fieldDefs['longitude_c']['value'] = $parent->longitude_c; } if (isset($parent->drivingdirections_c) && $this->ev->fieldDefs['drivingdirections_c']['value'] == "") { $this->ev->fieldDefs['drivingdirections_c']['value'] = $parent->drivingdirections_c; } if (isset($parent->customer_c) && $this->ev->fieldDefs['customer_c']['value'] == "") { $this->ev->fieldDefs['customer_c']['value'] = $parent->customer_c; } } echo $this->ev->display($this->showTitle); }
function display() { global $beanFiles; require_once $beanFiles['Project']; $focus = new Project(); $focus->retrieve($_REQUEST['record']); global $app_list_strings, $current_user, $mod_strings; $this->ss->assign('APP_LIST_STRINGS', $app_list_strings); if ($current_user->id == $focus->assigned_user_id || $current_user->is_admin) { $this->ss->assign('OWNER_ONLY', true); } else { $this->ss->assign('OWNER_ONLY', false); } parent::display(); }
function display() { $this->populateCurrency(); $this->populateQuoteTemplates(); $this->populateLineItems(); $this->populateAccounts(); $this->ev->process(); if (empty($this->ev->focus->id) && $_REQUEST['return_module'] == 'Project') { $parent = new Project(); $parent->retrieve($_REQUEST['return_id']); if (isset($parent->facility_c) && $this->ev->fieldDefs['facility_c']['value'] == "") { $this->ev->fieldDefs['facility_c']['value'] = $parent->facility_c; } } //parent::display(); echo $this->ev->display(); $this->displayJS(); }
function update(&$bean, $event, $arguments) { if (!$this->IsNullOrEmptyString($bean->project_id)) { if ($this->IsNullOrEmptyString($bean->set_project_end_date)) { global $current_user; $dateformat = $current_user->getPreference('datef'); $project = new Project(); $project->retrieve($bean->project_id); $projectend = DateTime::createFromFormat($dateformat, $project->estimated_end_date); $projectend = $projectend->format('Y-m-d'); $taskend = $bean->date_finish; //if the task end date is after the projects end date, extend the project to fit the new task end date. if (strtotime($taskend) > strtotime($projectend)) { $project->estimated_end_date = $taskend; $project->save(); } } } }
* of this program must display Appropriate Legal Notices, as required under * Section 5 of the GNU Affero General Public License version 3. * * In accordance with Section 7(b) of the GNU Affero General Public License version 3, * these Appropriate Legal Notices must retain the display of the "Powered by * SugarCRM" logo. If the display of the logo is not reasonably feasible for * technical reasons, the Appropriate Legal Notices must display the words * "Powered by SugarCRM". ********************************************************************************/ $sugarbean = new Project(); // perform the delete if given a record to delete if (empty($_REQUEST['record'])) { Log::info('delete called without a record id specified'); } else { $record = $_REQUEST['record']; $sugarbean->retrieve($record); if (!$sugarbean->ACLAccess('Delete')) { ACLController::displayNoAccess(true); sugar_cleanup(true); } Log::info("deleting record: {$record}"); $sugarbean->mark_deleted($record); } // handle the return location variables $return_module = empty($_REQUEST['return_module']) ? 'Project' : $_REQUEST['return_module']; $return_action = empty($_REQUEST['return_action']) ? 'index' : $_REQUEST['return_action']; $return_id = empty($_REQUEST['return_id']) ? '' : $_REQUEST['return_id']; $return_location = "index.php?module={$return_module}&action={$return_action}"; // append the return_id if given if (!empty($return_id)) { $return_location .= "&record={$return_id}";
public function display() { global $db, $mod_strings, $app_list_strings; echo '<link rel="stylesheet" type="text/css" href="custom/modules/Project/css/style.css" />'; echo '<link rel="stylesheet" type="text/css" href="custom/modules/Project/qtip/jquery.qtip.min.css" />'; echo '<script type="text/javascript" src="custom/modules/Project/js/main_lib.js"></script>'; echo '<script type="text/javascript" src="custom/modules/Project/js/splitter.js"></script>'; echo '<script type="text/javascript" src="custom/modules/Project/js/jquery.blockUI.js"></script>'; echo '<script type="text/javascript" src="custom/modules/Project/js/jquery.validate.min.js"></script>'; $project = new Project(); $project->retrieve($_REQUEST["project_id"]); //Get project resources (users & contacts) $resources1 = $project->get_linked_beans('project_users_1', 'User'); $resources2 = $project->get_linked_beans('project_contacts_1', 'Contact'); //Combine resources into array of objects $resource_array = array(); foreach ($resources1 as $user) { $resource = new stdClass(); $resource->id = $user->id; $resource->name = $user->name; $resource->type = 'user'; $resource_array[] = $resource; } foreach ($resources2 as $contact) { $resource = new stdClass(); $resource->id = $contact->id; $resource->name = $contact->name; $resource->type = 'contact'; $resource_array[] = $resource; } //Get the start and end date of the project in database format $query = "SELECT estimated_start_date FROM project WHERE id = '{$project->id}'"; $start_date = $db->getOne($query); $query = "SELECT estimated_end_date FROM project WHERE id = '{$project->id}'"; $end_date = $db->getOne($query); ?> <!--Create task pop-up--> <div style="display: none;"> <div id="dialog" title="<?php echo $mod_strings['LBL_ADD_NEW_TASK']; ?> "> <p> <?php echo $mod_strings['LBL_EDIT_TASK_PROPERTIES']; ?> </p> <form id="popup_form"> <fieldset> <input type="hidden" name="project_id" id="project_id" value="<?php echo $project->id; ?> "> <input type="text" style="display: none;" name="task_id" id="task_id" value=""> <input type="radio" name="Milestone" value="Subtask" checked="checked" id="Subtask"/> <label id="Subtask_label" for="Subtask"><?php echo $mod_strings['LBL_SUBTASK']; ?> </label> <input type="radio" name="Milestone" value="Milestone" id="Milestone"/> <label id="Milestone_label" for="Milestone"><?php echo $mod_strings['LBL_MILESTONE_FLAG']; ?> </label> <br/><br/> <label id="parent_task_id" for="parent_task" style="display: none;"><?php echo $mod_strings['LBL_PARENT_TASK_ID']; ?> </label> <input id="parent_task" class="text ui-widget-content ui-corner-all" style="display: none;" type="text" name="parent_task" value=""/> <label for="name"><?php echo $mod_strings['LBL_TASK_NAME']; ?> </label> <input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all"/> <label for="Predecessor"><?php echo $mod_strings['LBL_PREDECESSORS']; ?> </label> <?php echo '<select id="Predecessor" name="Predecessor" class="text ui-widget-content ui-corner-all" />'; /* foreach ($tasks as $task) { echo '<option rel="'.$task->id.'" value="'.$task->order_number.'">'.$task->name.'</opion>'; }*/ echo '</select>'; ?> <label for="relation_type"><?php echo $mod_strings['LBL_RELATIONSHIP_TYPE']; ?> </label> <?php echo '<select id="relation_type" name="relation_type" class="text ui-widget-content ui-corner-all"> ' . get_select_options_with_id($app_list_strings['relationship_type_list'], '') . ' </select>'; ?> <label for="Lag"><?php echo $mod_strings['LBL_LAG']; ?> </label> <input type="text" name="Lag" value="0" id="Lag" class="text ui-widget-content ui-corner-all"/> <select id="Lag_unit" name="Lag_unit" class="text ui-widget-content ui-corner-all"/> <option value="Days"><?php echo $mod_strings['LBL_DAYS']; ?> </option> <!-- <option value="Hours">--><?php //echo $mod_strings['LBL_HOURS']; ?> <!--</option>--> </select> <label for="start"><?php echo $mod_strings['LBL_START']; ?> </label> <input type="text" name="Start" id="Start" value="" class="text ui-widget-content ui-corner-all"/> <script type="text/javascript"> var now = new Date(); Calendar.setup({ inputField: "Start", ifFormat: cal_date_format, daFormat: "%m/%d/%Y %I:%M%P", button: "Start", singleClick: true, step: 1, weekNumbers: false, startWeekday: 0 }); </script> <label for="Duration"><?php echo $mod_strings['LBL_DURATION_TITLE']; ?> </label> <input type="text" name="Duration" id="Duration" class="text ui-widget-content ui-corner-all"/> <select id="Duration_unit" name="Duration_unit" class="text ui-widget-content ui-corner-all"/> <?php echo get_select_options_with_id($app_list_strings['duration_unit_dom'], ''); ?> </select> <label for="Resources"><?php echo $mod_strings['LBL_ASSIGNED_USER_ID']; ?> </label> <?php echo '<select id="Resources" name="Resources" class="text ui-widget-content ui-corner-all" />'; echo '<option value="0">' . $mod_strings['LBL_UNASSIGNED'] . '</option>'; foreach ($resource_array as $resource) { echo '<option rel="' . $resource->type . '" value="' . $resource->id . '">' . $resource->name . '</opion>'; } echo '</select>'; ?> <label for="%Complete"><?php echo $mod_strings['LBL_PERCENT_COMPLETE']; ?> </label> <input type="text" name="Complete" id="Complete" value="0" class="text ui-widget-content ui-corner-all"/> <label for="Actual_duration"><?php echo $mod_strings['LBL_ACTUAL_DURATION']; ?> </label> <input type="text" name="Actual_duration" id="Actual_duration" value="" class="text ui-widget-content ui-corner-all"/> <label for="Notes"><?php echo $mod_strings['LBL_DESCRIPTION']; ?> </label> <textarea id="Notes" cols="34" name="Notes" class="text ui-widget-content ui-corner-all"></textarea> </fieldset> </form> </div> <!--Delete task pop-up--> <div id="delete_dialog" title="<?php echo $mod_strings['LBL_DELETE_TASK']; ?> "> <p> Are you sure you want to delete this task? </p> </div> </div> <!-- Pop-up End --> <!--Mark-up for the main body of the view--> <div id="wrapper"> <table id="header_table"> <tr> <td colspan="4"><h2><a title="<?php echo $mod_strings['LBL_PROJECT_TITLE_HOVER']; ?> " href="index.php?module=Project&action=DetailView&record=<?php echo $project->id; ?> "><?php echo $project->name; ?> </a> </h2></td> </tr> <tr> <td class="heading"><?php echo $mod_strings['LBL_START']; ?> </td> <td><?php echo $project->estimated_start_date; ?> </td> <td class="heading"><?php echo $mod_strings['LBL_FINISH']; ?> </td> <td><?php echo $project->estimated_end_date; ?> </td> </tr> <tr> <td class="heading"><?php echo $mod_strings['LBL_VIEW_GANTT_DURATION']; ?> </td> <td><?php echo $this->time_range($start_date, $end_date); ?> </td> <td class="heading"><?php echo $mod_strings['LBL_STATUS']; ?> </td> <td><?php echo $app_list_strings['project_status_dom'][$project->status]; ?> </td> </tr> <tr> <td class="heading"><?php echo $mod_strings['LBL_ASSIGNED_USER_NAME']; ?> </td> <td><?php echo $project->assigned_user_name; ?> </td> <td class="heading"><?php echo $mod_strings['LBL_PRIORITY']; ?> </td> <td><?php echo $app_list_strings['projects_priority_options'][$project->priority]; ?> </td> </tr> <tr> <td class="heading"><?php echo $mod_strings['LBL_DESCRIPTION']; ?> </td> <td colspan="3"><?php echo $project->description; ?> </td> </tr> <tr> <td class="header_gap" colspan="4"> <span id="exportToPDFSpan"> <?php if (ACLController::checkAccess('Project', 'edit', true)) { echo '<button id="add_button" class="gantt_button">Add New Task</button>'; echo '<input id="is_editable" name="is_editable" type="hidden" value="1" >'; } ?> </span> </td> </tr> </table> <input id="project_id" type="hidden" name="project_id" value="<?php echo $_REQUEST["project_id"]; ?> "/> <div id="project_wrapper"> </div> </div> <!--Main body end--> <?php }
function action_update_chart() { global $db; include 'modules/Project/chart.php'; //Get specified dates and users $start = $_POST['start']; //$end = $_POST['end']; $users = $_POST['resources']; $month = $_POST['month']; $flag = $_POST['flag']; $type = $_POST['type']; $start = new DateTime($start); if ($month == '-1') { $start->modify($month . ' month'); $start->modify('+2 week'); } elseif ($month == '1') { $start->modify($month . ' month'); $start->modify('+1 week'); } if ($flag == '0') { $start->sub(new DateInterval('P1W')); } $first_day = $start->modify('this week'); $start = $start->format('Y-m-d'); $end = $first_day->add(new DateInterval('P66D')); $end->modify('this week'); $end->add(new DateInterval('P1D')); $end = $end->format('Y-m-d'); //set query to get all users if ($users == 'all') { //Get the users data from the database $resource_query = "SELECT project_users_1users_idb as id, first_name, last_name, 'project_users_1_c' AS type\n FROM project_users_1_c\n JOIN users ON users.id = project_users_1users_idb\n WHERE project_users_1_c.deleted =0\n UNION\n SELECT project_contacts_1contacts_idb AS id, first_name, last_name, 'project_contacts_1_c' AS type\n FROM project_contacts_1_c\n JOIN contacts ON contacts.id = project_contacts_1contacts_idb\n WHERE project_contacts_1_c.deleted =0"; } else { //get specified user if ($type == 'project_users_1_c') { $resource_query = "SELECT DISTINCT project_users_1users_idb as id, first_name, last_name, 'project_users_1_c' AS type\n FROM project_users_1_c\n JOIN users ON users.id = project_users_1users_idb\n WHERE project_users_1_c.deleted =0 AND project_users_1users_idb ='" . $users . "'"; } else { if ($type == 'project_contacts_1_c') { $resource_query = "SELECT DISTINCT project_contacts_1contacts_idb AS id, first_name, last_name, 'project_contacts_1_c' AS type\n FROM project_contacts_1_c\n JOIN contacts ON contacts.id = project_contacts_1contacts_idb\n WHERE project_contacts_1_c.deleted =0 AND project_contacts_1contacts_idb='" . $users . "'"; } } } $resources = $db->query($resource_query); //create array to hold the users $resource_list = array(); //Loop through users while ($row = $db->fetchByAssoc($resources)) { //get each users associated project tasks $Task = BeanFactory::getBean('ProjectTask'); $tasks = $Task->get_full_list("date_start", "project_task.assigned_user_id = '" . $row['id'] . "'"); //put users tasks in an array $taskarr = array(); $t = 0; if (!is_null($tasks)) { foreach ($tasks as $task) { $taskarr[$t]['id'] = $task->id; $taskarr[$t]['name'] = $task->name; $taskarr[$t]['status'] = $task->status; $taskarr[$t]['% cpl'] = $task->percent_complete; $taskarr[$t]['start_day'] = $this->count_days($start, $task->date_start); //Works out how many days into the chart the task starts $taskarr[$t]['duration'] = $task->duration; //how many days long is the task $taskarr[$t]['end_day'] = $this->count_days($start, $task->date_finish); //Works out how many days from start of the chart the task end day is. $taskarr[$t]['start_date'] = $task->date_start; $taskarr[$t]['end_date'] = $task->date_finish; $taskarr[$t]['project_id'] = $task->project_id; //parent projects id //get the project name (don't think this is really necessary) $project = new Project(); $project->retrieve($task->project_id); $taskarr[$t]['project_name'] = $project->name; //parent projects id $t++; } } $row['task_count'] = $t; //the number of tasks for the user $row['tasks'] = $taskarr; //add users tasks to main user array //convert user array to an array of user objects $resource_list[] = (object) $row; } //Generate the resource chart by passing in the start date, end date and the array of user objects new chart($start, $end, $resource_list); /* echo '<pre>'; print_r($resource_list); echo '</pre>';*/ die; }
public function draw($tasks) { global $mod_strings, $app_list_strings; // Instantiate the TimeDate Class $timeDate = new TimeDate(); echo '<table id="Task_table" class="project_table_header"> <tr class="disable_sort"> <td style="min-width:32px;" class="project_table_headings">' . $mod_strings['LBL_TASK_ID'] . '</td> <td style="min-width:85px;" class="project_table_headings">' . $mod_strings['LBL_TASK_NAME'] . '</td> <td style="min-width:100px;" class="project_table_headings">' . $mod_strings['LBL_PREDECESSORS'] . '</td> <td style="min-width:100px;" class="project_table_headings">' . $mod_strings['LBL_START'] . '</td> <td style="min-width:100px;" class="project_table_headings">' . $mod_strings['LBL_FINISH'] . '</td> <td style="min-width:100px;" class="project_table_headings">' . $mod_strings['LBL_DURATION'] . '</td> <td style="min-width:120px;" class="project_table_headings">' . $mod_strings['LBL_ASSIGNED_USER_ID'] . '</td> <td style="min-width:48px;" class="project_table_headings">' . $mod_strings['LBL_PERCENT_COMPLETE'] . '</td> <td style="min-width:80px;" class="project_table_headings">' . $mod_strings['LBL_MILESTONE_FLAG'] . '</td> <td style="min-width:80px;" class="project_table_headings">' . $mod_strings['LBL_ACTUAL_DURATION'] . '</td> <td style="min-width:30px;" class="project_table_headings"></td> </tr> '; $task_count = 0; if (!is_null($tasks)) { foreach ($tasks as $task) { //Get resources $project = new Project(); $project->retrieve($task->project_id); //Get project resources (users & contacts) $resources1 = $project->get_linked_beans('project_users_1', 'User'); $resources2 = $project->get_linked_beans('project_contacts_1', 'Contact'); //Combine resources into array of objects $resource_array = array(); foreach ($resources1 as $user) { $resource = new stdClass(); $resource->id = $user->id; $resource->name = $user->name; $resource->type = 'user'; $resource_array[] = $resource; } foreach ($resources2 as $contact) { $resource = new stdClass(); $resource->id = $contact->id; $resource->name = $contact->name; $resource->type = 'contact'; $resource_array[] = $resource; } echo '<tr class="row_sortable"> <td class="project_table_cells"><input class="order_number" name="order_number[]" rel="' . $task->id . '" type="hidden" value="' . $task->order_number . '" />' . $task->project_task_id . '</td>'; if (ACLController::checkAccess('Project', 'edit', true)) { echo '<td class="project_table_cells" ><span class="Task_name" ><a data = "' . $task->id . ',' . $task->predecessors . ',' . $task->relationship_type . ',' . $timeDate->to_display_date($task->date_start, true) . ',' . $task->duration . ',' . $task->duration_unit . ',' . $task->assigned_user_id . ',' . $task->milestone_flag . ',' . $task->percent_complete . ',' . $task->description . ',' . $task->actual_duration . '" onclick = "edit_task($(this));"title = "' . $mod_strings['LBL_TASK_TITLE'] . '" href = "#" > ' . $task->name . '</a ></span ></td>'; } else { echo '<td class="project_table_cells" ><span class="Task_name" >' . $task->name . '</span ></td>'; } echo '<td class="project_table_cells">'; foreach ($tasks as $predecessor) { if ($predecessor->project_task_id == $task->predecessors) { echo $predecessor->name; } } echo ' </td> <td class="project_table_cells">' . $timeDate->to_display_date($task->date_start, true) . '</td> <td class="project_table_cells">' . $timeDate->to_display_date($task->date_finish, true) . '</td> <td class="project_table_cells">' . $task->duration . ' ' . $app_list_strings['duration_unit_dom'][$task->duration_unit] . '</td> <td style="min-width:105px;" class="project_table_cells" >'; $rflag = '0'; foreach ($resource_array as $resource) { if ($resource->id == $task->assigned_user_id) { if ($resource->type == 'user') { echo '<a target="blank" href="index.php?module=Users&action=DetailView&record=' . $resource->id . '">' . $resource->name . '</a>'; $rflag = '1'; } elseif ($resource->type == 'contact') { echo '<a target="blank" href="index.php?module=Contacts&action=DetailView&record=' . $resource->id . '">' . $resource->name . '</a>'; $rflag = '1'; } } } if ($rflag == '0') { echo $mod_strings['LBL_UNASSIGNED']; } if ($task->milestone_flag == '1') { $checked = $app_list_strings['checkbox_dom']['1']; } else { $checked = $app_list_strings['checkbox_dom']['2']; } echo '</td> <td class="project_table_cells">' . $task->percent_complete . '</td> <td class="project_table_cells">' . $checked . '</td> <td class="project_table_cells">' . $task->actual_duration . '</td> <td class="project_table_cells"> <span id="exportToPDFSpan">'; if (ACLController::checkAccess('Project', 'delete', true)) { echo '<button style = "height:20px;width:20px;" class="remove_button" value = "' . $task->id . '" class="gantt_button" > Delete Task </button >'; } else { echo '<button disabled="disabled" style = "height:20px;width:20px;" class="remove_button" value = "' . $task->id . '" class="gantt_button" > Delete Task </button >'; } echo '</span> </td> </tr>'; $task_count++; } } echo '</table>'; }
* Contributor(s): ______________________________________. */ require_once 'XTemplate/xtpl.php'; require_once 'data/Tracker.php'; require_once 'modules/Project/Project.php'; require_once 'include/time.php'; require_once 'modules/Project/Forms.php'; global $timedate; global $app_strings; global $app_list_strings; global $current_language; global $current_user; global $sugar_version, $sugar_config; $focus = new Project(); if (!empty($_REQUEST['record'])) { $focus->retrieve($_REQUEST['record']); } echo "\n<p>\n"; echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_NAME'] . ": " . $focus->name, true); echo "\n</p>\n"; global $theme; $theme_path = "themes/" . $theme . "/"; $image_path = $theme_path . "images/"; require_once $theme_path . 'layout_utils.php'; $GLOBALS['log']->info("Project detail view"); $xtpl = new XTemplate('modules/Project/EditView.html'); /// Users Popup $json = getJSONobj(); $popup_request_data = array('call_back_function' => 'set_return', 'form_name' => 'EditView', 'field_to_name_array' => array('id' => 'assigned_user_id', 'user_name' => 'assigned_user_name')); $xtpl->assign('encoded_users_popup_request_data', $json->encode($popup_request_data)); ///
public function updateParentProjectTaskPercentage() { if (empty($this->parent_task_id)) { return; } $projectId = $this->project_id; if (!empty($projectId)) { $project = new Project(); $project->retrieve($projectId); $projectTasks = $project->getAllProjectTasks(); $dependentTaskId = $this->parent_task_id; $collectPercentage = 0; $parentProjectTask = false; foreach ($projectTasks as $key => $value) { if ($value->project_task_id == $dependentTaskId) { $parentProjectTask = $value; continue; } $collectPercentage += $value->percent_complete; } if ($parentProjectTask) { $parentProjectTask->percent_complete = round($collectPercentage / (count($projectTasks) - 1)); $parentProjectTask->save(isset($GLOBALS['check_notify']) ? $GLOBALS['check_notify'] : ''); } } }