Exemplo n.º 1
0
 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     $this->_vid = CRM_Utils_Request::retrieve('vid', 'Positive', $this, TRUE);
     if (!CRM_Volunteer_Permission::checkProjectPerms(CRM_Core_Action::UPDATE, $this->_vid)) {
         CRM_Utils_System::permissionDenied();
     }
     $this->_batchInfo['item_count'] = 50;
     $params = array('project_id' => $this->_vid);
     $this->_volunteerData = CRM_Volunteer_BAO_Assignment::retrieve($params);
     $projects = CRM_Volunteer_BAO_Project::retrieve(array('id' => $this->_vid));
     $project = $projects[$this->_vid];
     $this->_entityID = $project->entity_id;
     $this->_entityTable = $project->entity_table;
     $this->_title = $project->title;
     $this->_title .= ' ( ' . CRM_Utils_Date::customFormat($project->start_date);
     $this->_start_date = $project->start_date;
     if ($project->end_date) {
         $this->_title .= ' - ' . CRM_Utils_Date::customFormat($project->end_date) . ' )';
     } else {
         $this->_title .= ' )';
     }
     /*
      * Because CiviCRM's asset management framework isn't mature yet (e.g., adding
      * assets to forms rendered in pop-ups using CRM_Core_Resources doesn't work),
      * we pass a URL fragment to the template and include them via HTML.
      */
     $this->assign('extResourceURL', CRM_Core_Resources::singleton()->getUrl('org.civicrm.volunteer'));
     $this->assign('vid', $this->_vid);
 }
Exemplo n.º 2
0
 /**
  * build all the data structures needed to build the form
  *
  * @return void
  * @access public
  */
 function preProcess()
 {
     $this->_vid = CRM_Utils_Request::retrieve('vid', 'Positive', $this, TRUE);
     $this->_batchInfo['item_count'] = 50;
     $params = array('project_id' => $this->_vid);
     $this->_volunteerData = CRM_Volunteer_BAO_Assignment::retrieve($params);
     $projects = CRM_Volunteer_BAO_Project::retrieve(array('id' => $this->_vid));
     $project = $projects[$this->_vid];
     $this->_entityID = $project->entity_id;
     $this->_entityTable = $project->entity_table;
     $this->_title = $project->title;
     $this->_title .= ' ( ' . CRM_Utils_Date::customFormat($project->start_date);
     $this->_start_date = $project->start_date;
     if ($project->end_date) {
         $this->_title .= ' - ' . CRM_Utils_Date::customFormat($project->end_date) . ' )';
     } else {
         $this->_title .= ' )';
     }
 }
/**
 * Returns array of assignments matching a set of one or more group properties
 *
 * @param array $params  Associative array of property name/value pairs
 *                       describing the assignments to be retrieved.
 * @example
 * @return array ID-indexed array of matching assignments
 * {@getfields assignment_get}
 * @access public
 */
function civicrm_api3_volunteer_assignment_get($params)
{
    $result = CRM_Volunteer_BAO_Assignment::retrieve($params);
    return civicrm_api3_create_success($result, $params, 'Activity', 'get');
}
Exemplo n.º 4
0
 /**
  * Facilitates propagatation of changes in a Project to associated Activities.
  *
  * This method takes no arguments because the Assignment BAO handles
  * propagation internally.
  *
  * @see CRM_Volunteer_BAO_Assignment::setActivityDefaults()
  */
 public function updateAssociatedActivities()
 {
     $activities = CRM_Volunteer_BAO_Assignment::retrieve(array('project_id' => $this->id));
     foreach ($activities as $activity) {
         CRM_Volunteer_BAO_Assignment::createVolunteerActivity(array('id' => $activity['id']));
     }
 }