コード例 #1
0
ファイル: GroupContact.php プロジェクト: kidaa30/yes
 /**
  * called when action is update.
  *
  * @param int $groupId
  *
  * @return null
  */
 public function edit($groupId = NULL)
 {
     $this->assign('edit', $this->_edit);
     if (!$this->_edit) {
         return NULL;
     }
     $action = CRM_Utils_Request::retrieve('action', 'String', CRM_Core_DAO::$_nullObject, FALSE, 'browse');
     if ($action == CRM_Core_Action::DELETE) {
         $groupContactId = CRM_Utils_Request::retrieve('gcid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE);
         $status = CRM_Utils_Request::retrieve('st', 'String', CRM_Core_DAO::$_nullObject, TRUE);
         if (is_numeric($groupContactId) && $status) {
             CRM_Contact_Page_View_GroupContact::del($groupContactId, $status, $this->_contactId);
         }
         $url = CRM_Utils_System::url('civicrm/user', "reset=1&id={$this->_contactId}");
         CRM_Utils_System::redirect($url);
     }
     $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_GroupContact', ts("Contact's Groups"), CRM_Core_Action::ADD, FALSE, FALSE, TRUE, FALSE);
     $controller->setEmbedded(TRUE);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/user', "reset=1&id={$this->_contactId}"), FALSE);
     $controller->reset();
     $controller->set('contactId', $this->_contactId);
     $controller->set('groupId', $groupId);
     $controller->set('context', 'user');
     $controller->set('onlyPublicGroups', $this->_onlyPublicGroups);
     $controller->process();
     $controller->run();
 }
コード例 #2
0
ファイル: Tab.php プロジェクト: kidaa30/yes
 /**
  * called when action is update or new.
  *
  * @return null
  */
 public function edit()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Pledge', 'Create Pledge', $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->set('id', $this->_id);
     $controller->set('cid', $this->_contactId);
     return $controller->run();
 }
コード例 #3
0
ファイル: Tab.php プロジェクト: sushantpaste/civibooking
 /**
  * This function is called when action is cancel
  *
  * return null
  * @access public
  */
 function cancel()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Booking_Form_Booking_Cancel', ts('Booking'), $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->set('id', $this->_id);
     $controller->set('cid', $this->_contactId);
     return $controller->run();
 }
コード例 #4
0
 /**
  * This function is called when action is update or new
  *
  * return null
  * @access public
  */
 function edit()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Payment', 'Update Pledge Payment', $this->_action);
     $pledgePaymentId = CRM_Utils_Request::retrieve('ppId', 'Positive', $this);
     $controller->setEmbedded(TRUE);
     $controller->set('id', $pledgePaymentId);
     return $controller->run();
 }
コード例 #5
0
 /**
  * Run the page.
  *
  * This method is called after the page is created.
  *
  * @return void
  * @access public
  *
  */
 function run()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_Task_Useradd', ts('Add User'), CRM_Core_Action::ADD);
     $controller->setEmbedded(TRUE);
     $controller->process();
     $controller->run();
     return parent::run();
 }
コード例 #6
0
 /**
  * Function to list participations for the UF user
  *
  * return null
  * @access public
  */
 function listParticipations()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Event_Form_Search', ts('Events'), NULL);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('context', 'user');
     $controller->set('cid', $this->_contactId);
     $controller->set('force', 1);
     $controller->process();
     $controller->run();
 }
コード例 #7
0
ファイル: Summary.php プロジェクト: nielosz/civicrm-core
 /**
  * Edit name and address of a contact.
  */
 public function edit()
 {
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $this->_contactId);
     $session->pushUserContext($url);
     $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_Contact', ts('Contact Page'), CRM_Core_Action::UPDATE);
     $controller->setEmbedded(TRUE);
     $controller->process();
     return $controller->run();
 }
コード例 #8
0
 /**
  * This function is called when action is browse
  *
  * return null
  * @access public
  */
 function browse()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Tag_Form_Tag', ts('Contact Tags'), $this->_action);
     $controller->setEmbedded(TRUE);
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view', 'action=browse&selectedChild=tag'), FALSE);
     $controller->reset();
     $controller->set('contactId', $this->_contactId);
     $controller->process();
     $controller->run();
 }
コード例 #9
0
 /**
  * This function is the main function that is called when the page loads,
  * it decides the which action has to be taken for the page.
  *
  * return null
  * @access public
  */
 function run()
 {
     $this->preProcess();
     $controller = new CRM_Core_Controller_Simple('CRM_Grant_Form_Search', ts('grants'), NULL);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('limit', 10);
     $controller->set('force', 1);
     $controller->set('context', 'dashboard');
     $controller->process();
     $controller->run();
     return parent::run();
 }
コード例 #10
0
 /**
  * This function is called when action is update
  *
  * @param int    $groupID group id
  *
  * return null
  * @access public
  */
 function edit($groupId = NULL)
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_GroupContact', ts('Contact\'s Groups'), $this->_action);
     $controller->setEmbedded(TRUE);
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view', "action=browse&selectedChild=group&cid={$this->_contactId}"), FALSE);
     $controller->reset();
     $controller->set('contactId', $this->_contactId);
     $controller->set('groupId', $groupId);
     $controller->process();
     $controller->run();
 }
コード例 #11
0
 /**
  * This function is called when action is update or new
  *
  * return null
  * @access public
  */
 function edit()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_APIKey', ts('API Key'), $this->_action);
     $controller->setEmbedded(TRUE);
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/contact/view/apikey', 'action=browse&selectedChild=apikey&cid=' . $this->_contactId);
     $session->pushUserContext($url);
     $controller->reset();
     $controller->set('contactId', $this->_contactId);
     $controller->process();
     $controller->run();
 }
コード例 #12
0
 /**
  * Function to list participations for the UF user
  *
  * return null
  * @access public
  */
 function listActivities()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_Search', ts('Activities'), NULL, FALSE, FALSE, TRUE, FALSE);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('context', 'user');
     $controller->set('cid', $this->_contactId);
     $controller->set('status', array(1 => 'on', 7 => 'on'));
     $controller->set('activity_role', 2);
     $controller->set('force', 1);
     $controller->process();
     $controller->run();
     return;
 }
コード例 #13
0
 /**
  * List participations for the UF user.
  *
  * @return bool
  */
 public function listActivities()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_Search', ts('Activities'), NULL, FALSE, FALSE, TRUE, FALSE);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('context', 'user');
     $controller->set('cid', $this->_contactId);
     // Limit to status "Scheduled" and "Available"
     $controller->set('status', array('IN' => array(1, 7)));
     $controller->set('activity_role', 2);
     $controller->set('force', 1);
     $controller->process();
     $controller->run();
     return FALSE;
 }
コード例 #14
0
ファイル: Actions.php プロジェクト: FundingWorks/civicrm-core
 /**
  * Run the page.
  *
  * This method is called after the page is created.
  */
 public function run()
 {
     $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, TRUE, NULL, $_REQUEST);
     $this->assign('contactId', $contactId);
     $this->assign('actionsMenuList', CRM_Contact_BAO_Contact::contextMenu($contactId));
     CRM_Contact_Page_View::addUrls($this, $contactId);
     // also create the form element for the activity links box
     $controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_ActivityLinks', ts('Activity Links'), NULL);
     $controller->setEmbedded(TRUE);
     $controller->run();
     // check logged in user permission
     CRM_Contact_Page_View::checkUserPermission($this, $contactId);
     // finally call parent
     parent::run();
 }
コード例 #15
0
 /**
  * Run the page.
  *
  * This method is called after the page is created. It checks for the
  * type of action and executes that action.
  * Finally it calls the parent's run method.
  *
  * @return void
  * @access public
  *
  */
 function run()
 {
     //if javascript is enabled
     if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', $this, '', '', 'GET')) {
         CRM_Core_BAO_CMSUser::synchronize();
         return;
     }
     $controller = new CRM_Core_Controller_Simple('CRM_Admin_Form_CMSUser', 'Synchronize CMS Users');
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin', 'reset=1'));
     $controller->setEmbedded(TRUE);
     $controller->process();
     $controller->run();
     return parent::run();
 }
コード例 #16
0
 /**
  * called when action is browse.
  */
 public function listPledges()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), NULL, FALSE, FALSE, TRUE, FALSE);
     $controller->setEmbedded(TRUE);
     $controller->reset();
     $controller->set('limit', 12);
     $controller->set('cid', $this->_contactId);
     $controller->set('context', 'user');
     $controller->set('force', 1);
     $controller->process();
     $controller->run();
     // add honor block.
     $honorParams = array();
     $honorParams = CRM_Pledge_BAO_Pledge::getHonorContacts($this->_contactId);
     if (!empty($honorParams)) {
         // assign vars to templates
         $this->assign('pledgeHonorRows', $honorParams);
         $this->assign('pledgeHonor', TRUE);
     }
     $session = CRM_Core_Session::singleton();
     $loggedUserID = $session->get('userID');
     $this->assign('loggedUserID', $loggedUserID);
 }
コード例 #17
0
ファイル: Activity.php プロジェクト: nielosz/civicrm-core
 /**
  * List activities as dashlet.
  *
  * @return void
  */
 public function run()
 {
     $session = CRM_Core_Session::singleton();
     $contactID = $session->get('userID');
     $this->assign('contactID', $contactID);
     $this->assign('contactId', $contactID);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'dashlet');
     $this->assign('context', $context);
     // a user can always view their own activity
     // if they have access CiviCRM permission
     $permission = CRM_Core_Permission::VIEW;
     // make the permission edit if the user has edit permission on the contact
     if (CRM_Contact_BAO_Contact_Permission::allow($contactID, CRM_Core_Permission::EDIT)) {
         $permission = CRM_Core_Permission::EDIT;
     }
     $admin = CRM_Core_Permission::check('view all activities') || CRM_Core_Permission::check('administer CiviCRM');
     $this->assign('admin', $admin);
     // also create the form element for the activity filter box
     $controller = new CRM_Core_Controller_Simple('CRM_Activity_Form_ActivityFilter', ts('Activity Filter'), NULL);
     $controller->setEmbedded(TRUE);
     $controller->run();
     return parent::run();
 }
コード例 #18
0
 /**
  * called when action is update or new.
  *
  */
 public function edit()
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Contact_Form_Relationship', ts('Contact Relationships'), $this->_action);
     $controller->setEmbedded(TRUE);
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     // if this is called from case view, we need to redirect back to same page
     if ($this->_caseId) {
         $url = CRM_Utils_System::url('civicrm/contact/view/case', "action=view&reset=1&cid={$this->_contactId}&id={$this->_caseId}");
     } else {
         $url = CRM_Utils_System::url('civicrm/contact/view', "action=browse&selectedChild=rel&reset=1&cid={$this->_contactId}");
     }
     $session->pushUserContext($url);
     if (CRM_Utils_Request::retrieve('confirmed', 'Boolean', CRM_Core_DAO::$_nullObject)) {
         if ($this->_caseId) {
             //create an activity for case role removal.CRM-4480
             CRM_Case_BAO_Case::createCaseRoleActivity($this->_caseId, $this->_id);
             CRM_Core_Session::setStatus(ts('Case Role has been deleted successfully.'), ts('Record Deleted'), 'success');
         }
         // delete relationship
         CRM_Contact_BAO_Relationship::del($this->_id);
         CRM_Utils_System::redirect($url);
     }
     $controller->set('contactId', $this->_contactId);
     $controller->set('id', $this->_id);
     $controller->process();
     $controller->run();
 }
コード例 #19
0
ファイル: DashBoard.php プロジェクト: hguru/224Civi
 /**
  * This function is the main function that is called when the page loads,
  * it decides the which action has to be taken for the page.
  *
  * return null
  * @access public
  */
 function run()
 {
     $this->preProcess();
     $controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Search', ts('Contributions'), NULL);
     $controller->setEmbedded(TRUE);
     $controller->set('limit', 10);
     $controller->set('force', 1);
     $controller->set('context', 'dashboard');
     $controller->process();
     $controller->run();
     $chartForm = new CRM_Core_Controller_Simple('CRM_Contribute_Form_ContributionCharts', ts('Contributions Charts'), NULL);
     $chartForm->setEmbedded(TRUE);
     $chartForm->process();
     $chartForm->run();
     CRM_Core_Resources::singleton()->addScriptFile('civicrm', 'templates/CRM/Contribute/Page/DashBoard.js');
     return parent::run();
 }
コード例 #20
0
ファイル: Option.php プロジェクト: hguru/224Civi
 /**
  * edit custom Option.
  *
  * editing would involved modifying existing fields + adding data to new fields.
  *
  * @param string  $action   the action to be invoked
  *
  * @return void
  * @access public
  */
 function edit($action)
 {
     $oid = CRM_Utils_Request::retrieve('oid', 'Positive', $this, FALSE, 0);
     $params = array();
     if ($oid) {
         $params['oid'] = $oid;
         $sid = CRM_Price_BAO_PriceSet::getSetId($params);
         $usedBy = CRM_Price_BAO_PriceSet::getUsedBy($sid);
     }
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price/field/option', "reset=1&action=browse&fid={$this->_fid}&sid={$this->_sid}"));
     $controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Option', ts('Price Field Option'), $action);
     $controller->set('fid', $this->_fid);
     $controller->setEmbedded(TRUE);
     $controller->process();
     $controller->run();
     $this->browse();
     if ($action & CRM_Core_Action::DELETE) {
         // add breadcrumb
         $url = CRM_Utils_System::url('civicrm/admin/price/field/option', 'reset=1');
         CRM_Utils_System::appendBreadCrumb(ts('Price Option'), $url);
         $this->assign('usedPriceSetTitle', CRM_Price_BAO_PriceFieldValue::getOptionLabel($oid));
         $this->assign('usedBy', $usedBy);
         $comps = array("Event" => "civicrm_event", "Contribution" => "civicrm_contribution_page");
         $priceSetContexts = array();
         foreach ($comps as $name => $table) {
             if (array_key_exists($table, $usedBy)) {
                 $priceSetContexts[] = $name;
             }
         }
         $this->assign('contexts', $priceSetContexts);
     }
 }
コード例 #21
0
ファイル: Tab.php プロジェクト: archcidburnziso/civicrm-core
 /**
  * This function is called when action is update or new
  *
  * return null
  * @access public
  */
 function edit()
 {
     // set https for offline cc transaction
     $mode = CRM_Utils_Request::retrieve('mode', 'String', $this);
     if ($mode == 'test' || $mode == 'live') {
         CRM_Utils_System::redirectToSSL();
     }
     $controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Contribution', 'Create Contribution', $this->_action);
     $controller->setEmbedded(TRUE);
     $controller->set('id', $this->_id);
     $controller->set('cid', $this->_contactId);
     return $controller->run();
 }
コード例 #22
0
 /**
  * Preview custom group
  *
  * @param int $id custom group id
  *
  * @return void
  * @access public
  */
 function preview($id)
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Custom_Form_Preview', ts('Preview Custom Data'), NULL);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/custom/group', 'action=browse'));
     $controller->set('groupId', $id);
     $controller->setEmbedded(TRUE);
     $controller->process();
     $controller->run();
 }
コード例 #23
0
ファイル: PCP.php プロジェクト: hampelm/Ginsberg-CiviDemo
 function search()
 {
     if ($this->_action & CRM_Core_Action::DELETE) {
         return;
     }
     $form = new CRM_Core_Controller_Simple('CRM_Contribute_Form_PCP_PCP', ts('Search Campaign Pages'), CRM_Core_Action::ADD);
     $form->setEmbedded(true);
     $form->setParent($this);
     $form->process();
     $form->run();
 }
コード例 #24
0
ファイル: Set.php プロジェクト: hampelm/Ginsberg-CiviDemo
 /**
  * Preview price set
  *
  * @param int $id price set id
  * @return void
  * @access public
  */
 function preview($sid)
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Preview', ts('Preview Price Set'), null);
     $session = CRM_Core_Session::singleton();
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     if ($context == 'field') {
         $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price/field', "action=browse&sid={$sid}"));
     } else {
         $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price', 'action=browse'));
     }
     $controller->set('groupId', $sid);
     $controller->setEmbedded(true);
     $controller->process();
     $controller->run();
 }
コード例 #25
0
 public function search()
 {
     if (isset($this->_action) & (CRM_Core_Action::ADD | CRM_Core_Action::UPDATE | CRM_Core_Action::DELETE)) {
         return;
     }
     $form = new CRM_Core_Controller_Simple('CRM_Contribute_Form_SearchContribution', ts('Search Contribution'), CRM_Core_Action::ADD);
     $form->setEmbedded(TRUE);
     $form->setParent($this);
     $form->process();
     $form->run();
 }
コード例 #26
0
ファイル: Group.php プロジェクト: hguru/224Civi
 /**
  * this function is for preview mode for ufoup
  *
  * @param int $id uf group id
  *
  * @return void
  * @access public
  */
 function preview($id, $action)
 {
     $controller = new CRM_Core_Controller_Simple('CRM_UF_Form_Preview', ts('CiviCRM Profile Group Preview'), NULL);
     $controller->set('id', $id);
     $controller->setEmbedded(TRUE);
     $controller->process();
     $controller->run();
 }
コード例 #27
0
ファイル: Field.php プロジェクト: ruchirapingale/civicrm-core
 /**
  * Preview price field
  *
  * @param $fid
  *
  * @internal param int $id price field id
  *
  * @return void
  * @access public
  */
 function preview($fid)
 {
     $controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Preview', ts('Preview Form Field'), CRM_Core_Action::PREVIEW);
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price/field', 'reset=1&action=browse&sid=' . $this->_sid));
     $controller->set('fieldId', $fid);
     $controller->set('groupId', $this->_sid);
     $controller->setEmbedded(TRUE);
     $controller->process();
     $controller->run();
 }
コード例 #28
0
ファイル: Browse.php プロジェクト: hampelm/Ginsberg-CiviDemo
 function search()
 {
     if ($this->_action & (CRM_Core_Action::ADD | CRM_Core_Action::UPDATE)) {
         return;
     }
     $form = new CRM_Core_Controller_Simple('CRM_Mailing_Form_Search', ts('Search Mailings'), CRM_Core_Action::ADD);
     $form->setEmbedded(true);
     $form->setParent($this);
     $form->process();
     $form->run();
 }
コード例 #29
0
 /**
  * This function is the main function that is called when the page loads,
  * it decides the which action has to be taken for the page.
  *
  * return null
  * @access public
  */
 function run()
 {
     $this->preProcess();
     $controller = new CRM_Core_Controller_Simple('CRM_Contribute_Form_Search', ts('Contributions'), NULL);
     $controller->setEmbedded(TRUE);
     $controller->set('limit', 10);
     $controller->set('force', 1);
     $controller->set('context', 'dashboard');
     $controller->process();
     $controller->run();
     $chartForm = new CRM_Core_Controller_Simple('CRM_Contribute_Form_ContributionCharts', ts('Contributions Charts'), NULL);
     $chartForm->setEmbedded(TRUE);
     $chartForm->process();
     $chartForm->run();
     return parent::run();
 }
コード例 #30
0
ファイル: Option.php プロジェクト: sdekok/civicrm-core
 /**
  * Edit custom Option.
  *
  * editing would involved modifying existing fields + adding data to new fields.
  *
  * @param string $action
  *   The action to be invoked.
  *
  * @return void
  */
 public function edit($action)
 {
     // create a simple controller for editing custom data
     $controller = new CRM_Core_Controller_Simple('CRM_Custom_Form_Option', ts('Custom Option'), $action);
     // set the userContext stack
     $session = CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url('civicrm/admin/custom/group/field/option', "reset=1&action=browse&fid={$this->_fid}&gid={$this->_gid}"));
     $controller->setEmbedded(TRUE);
     $controller->process();
     $controller->run();
     $this->browse();
 }