public function execute($request)
 {
     $projectId = $request->getParameter("projectId");
     $timesheetDao = new TimesheetDao();
     $this->noProjectActivity = "no";
     if ($projectId == -1) {
         $this->activityList = "All";
     } else {
         $this->activityList = $timesheetDao->getProjectActivitiesByPorjectId($projectId);
         $this->allActivityList = $timesheetDao->getProjectActivitiesByPorjectId($projectId, true);
         if ($this->allActivityList == null) {
             $this->noProjectActivity = "yes";
         }
     }
 }
Example #2
0
 public function executeGetRelatedActiviesForAutoCompleteAjax(sfWebRequest $request)
 {
     $this->backAction = $this->getContext()->getUser()->getFlash('actionName');
     $this->getContext()->getUser()->setFlash('actionName', $this->backAction);
     $customerName = $request->getParameter('customerName');
     $projectName = $request->getParameter('projectName');
     //        $projectName = htmlspecialchars($projectName, ENT_QUOTES);
     //        $customerName = htmlspecialchars($customerName, ENT_QUOTES);
     $timesheetDao = new TimesheetDao();
     $customer = $timesheetDao->getCustomerByName($customerName);
     $customerId = $customer->getCustomerId();
     $project = $timesheetDao->getProjectByProjectNameAndCustomerId($projectName, $customerId);
     $projectId = $project->getProjectId();
     $this->activityList = $timesheetDao->getProjectActivitiesByPorjectId($projectId);
 }
 /**
  * Gets all the names of available projects, including deleted projects.
  * @return array() $projectNameList
  */
 private function _getDataList()
 {
     $activityNameList = array();
     $projectService = new ProjectService();
     $projectList = $projectService->getActiveProjectList();
     $projectId = -1;
     foreach ($projectList as $project) {
         $projectId = $project->getProjectId();
         break;
     }
     $timesheetDao = new TimesheetDao();
     $activityList = $timesheetDao->getProjectActivitiesByPorjectId($projectId);
     if ($activityList != null) {
         $activityNameList[-1] = __("All");
     } else {
         $activityNameList[null] = "--" . __("No Project Activities") . "--";
     }
     return $activityNameList;
 }