Esempio n. 1
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();
     $pid = CRM_Utils_Request::retrieve('pid', $this);
     $log = CRM_Utils_Request::retrieve('log', $this);
     if ($this->_action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD | CRM_CORE_ACTION_VIEW | CRM_CORE_ACTION_DELETE)) {
         $this->edit();
     }
     return parent::run();
 }
Esempio n. 2
0
 /**
  * Heart of the viewing process. The runner gets all the meta data for
  * the contact and calls the appropriate type of page to view.
  *
  * @return void
  * @access public
  *
  */
 function run()
 {
     $this->preProcess();
     if ($this->_action & CRM_Core_Action::UPDATE) {
         $this->edit();
     } else {
         $this->view();
     }
     return parent::run();
 }
Esempio n. 3
0
 /**
  * Heart of the viewing process. The runner gets all the meta data for
  * the contact and calls the appropriate type of page to view.
  *
  * @return void
  * @access public
  *
  */
 function run()
 {
     $this->preProcess();
     if ($this->_action & CRM_CORE_ACTION_UPDATE) {
         $this->edit();
     } else {
         $this->view();
     }
     return parent::run();
 }
 /**
  * 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();
     $this->setContext();
     if ($this->_action & CRM_CORE_ACTION_VIEW) {
         $this->view();
     } else {
         if ($this->_action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD | CRM_CORE_ACTION_DELETE)) {
             $this->edit();
         } else {
             $this->browse();
         }
     }
     return parent::run();
 }
Esempio n. 5
0
 /**
  * perform actions and display for activities.
  *
  * @return none
  *
  * @access public
  */
 function run()
 {
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray);
     $action = CRM_Utils_Request::retrieve('action', 'String', $this);
     $activityId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
     if ($context == 'standalone' || !$contactId && $action != CRM_Core_Action::DELETE && !$activityId) {
         $this->_action = CRM_Core_Action::ADD;
         $this->assign('action', $this->_action);
     } else {
         // we should call contact view, preprocess only for activity in contact summary
         $this->preProcess();
     }
     // route behaviour of contact/view/activity based on action defined
     if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::VIEW)) {
         $this->edit();
         $activityTypeId = CRM_Utils_Request::retrieve('atype', 'Positive', $this);
         if ($activityTypeId == 3) {
             return;
         }
     } elseif ($this->_action & (CRM_Core_Action::DELETE | CRM_Core_Action::DETACH)) {
         $this->delete();
     } else {
         $this->browse();
     }
     return parent::run();
 }
Esempio n. 6
0
 /**
  * Run the page.
  *
  * This method is called after the page is created. It checks for the  
  * type of action and executes that action. 
  *
  * @access public
  * @param object $page - the view page which created this one 
  * @return none
  * @static
  *
  */
 function run()
 {
     $this->preProcess();
     // get permission detail view or edit
     $permUser = CRM_Core_Permission::getPermission();
     $editCustomData = CRM_CORE_PERMISSION_VIEW == $permUser ? 0 : 1;
     $this->assign('editCustomData', $editCustomData);
     $controller =& new CRM_Core_Controller_Simple('CRM_Contact_Form_CustomData', ts('Custom Data'), $this->_action);
     $controller->setEmbedded(true);
     // set the userContext stack
     $doneURL = 'civicrm/contact/view/cd';
     $session =& CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url($doneURL, 'action=browse&gid=' . $this->_groupId), false);
     $controller->set('tableId', $this->_contactId);
     $controller->set('groupId', $this->_groupId);
     $controller->set('entityType', CRM_Contact_BAO_Contact::getContactType($this->_contactId));
     $controller->process();
     $controller->run();
     return parent::run();
 }
 /**
  * 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();
     if ($this->_action == CRM_CORE_ACTION_DELETE) {
         $groupContactId = CRM_Utils_Request::retrieve('gcid', $this);
         $status = CRM_Utils_Request::retrieve('st', $this);
         if (is_numeric($groupContactId) && $status) {
             $this->del($groupContactId, $status);
         }
     }
     $this->edit(CRM_CORE_ACTION_ADD);
     $this->browse();
     return parent::run();
 }
Esempio n. 8
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()
 {
     $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     if ($context == 'standalone' && !$contactID) {
         $this->_action = CRM_Core_Action::ADD;
         $this->assign('action', $this->_action);
     } else {
         // we should call contact view, preprocess only for pledge in contact summary
         $this->preProcess();
     }
     if ($this->_permission == CRM_Core_Permission::EDIT && !CRM_Core_Permission::check('edit pledges')) {
         $this->_permission = CRM_Core_Permission::VIEW;
         // demote to view since user does not have edit pledge rights
         $this->assign('permission', 'view');
     }
     // check if we can process credit card registration
     $processors = CRM_Core_PseudoConstant::paymentProcessor(false, false, "billing_mode IN ( 1, 3 )");
     if (count($processors) > 0) {
         $this->assign('newCredit', true);
     } else {
         $this->assign('newCredit', false);
     }
     $this->setContext();
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->view();
     } else {
         if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
             $this->edit();
         } else {
             if ($this->_action & CRM_Core_Action::DETACH) {
                 require_once 'CRM/Pledge/BAO/Payment.php';
                 require_once 'CRM/Contribute/PseudoConstant.php';
                 CRM_Pledge_BAO_Payment::updatePledgePaymentStatus($this->_id, null, null, array_search('Cancelled', CRM_Contribute_PseudoConstant::contributionStatus()));
                 $session =& CRM_Core_Session::singleton();
                 $session->setStatus(ts('Pledge has been Cancelled and all scheduled (not completed) payments have been cancelled.<br />'));
                 CRM_Utils_System::redirect($session->popUserContext());
             } else {
                 $this->browse();
             }
         }
     }
     return parent::run();
 }
Esempio n. 9
0
 /**
  * perform actions and display for activities.
  *
  * @return none
  *
  * @access public
  */
 function run()
 {
     $this->preProcess();
     CRM_Utils_System::setTitle(ts('CiviCRM Home'));
     //Get the id of Logged in User
     $session =& CRM_Core_Session::singleton();
     $contactId = $session->get('userID');
     $admin = CRM_Core_Permission::check('view all activities') || CRM_Core_Permission::check('administer CiviCRM');
     $this->browse($contactId, $admin);
     return parent::run();
 }
Esempio n. 10
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();
     if ($this->_action & CRM_CORE_ACTION_VIEW) {
         $this->view();
     } else {
         if ($this->_action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD)) {
             $this->edit();
         } else {
             if ($this->_action & CRM_CORE_ACTION_DELETE) {
                 // we use the edit screen the confirm the delete
                 $this->edit();
             }
         }
     }
     $this->browse();
     return parent::run();
 }
Esempio n. 11
0
 /**
  * Run the page.
  *
  * This method is called after the page is created. It checks for the  
  * type of action and executes that action. 
  *
  * @access public
  * @param object $page - the view page which created this one 
  * @return none
  * @static
  *
  */
 function run()
 {
     $this->preProcess();
     //set the userContext stack
     $doneURL = 'civicrm/contact/view';
     $session =& CRM_Core_Session::singleton();
     $session->pushUserContext(CRM_Utils_System::url($doneURL, 'action=browse&selectedChild=custom_' . $this->_groupId), false);
     // get permission detail view or edit
     $permUser = CRM_Core_Permission::getPermission();
     $editCustomData = CRM_Core_Permission::VIEW == $permUser ? 0 : 1;
     $this->assign('editCustomData', $editCustomData);
     if ($this->_action == CRM_Core_Action::BROWSE) {
         //Custom Groups Inline
         $entityType = CRM_Contact_BAO_Contact::getContactType($this->_contactId);
         $entitySubType = CRM_Contact_BAO_Contact::getContactSubType($this->_contactId);
         $groupTree =& CRM_Core_BAO_CustomGroup::getTree($entityType, $this, $this->_contactId, $this->_groupId, $entitySubType);
         CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree);
     } else {
         $controller =& new CRM_Core_Controller_Simple('CRM_Contact_Form_CustomData', ts('Custom Data'), $this->_action);
         $controller->setEmbedded(true);
         $controller->set('tableId', $this->_contactId);
         $controller->set('groupId', $this->_groupId);
         $controller->set('entityType', CRM_Contact_BAO_Contact::getContactType($this->_contactId));
         $controller->set('entitySubType', CRM_Contact_BAO_Contact::getContactSubType($this->_contactId));
         $controller->process();
         $controller->run();
     }
     return parent::run();
 }
Esempio n. 12
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()
 {
     $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     if ($context == 'standalone' && !$contactID) {
         $this->_action = CRM_Core_Action::ADD;
         $this->assign('action', $this->_action);
     } else {
         // we should call contact view, preprocess only for grant in contact summary
         $this->preProcess();
     }
     $this->setContext();
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->view();
     } else {
         if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
             $this->edit();
         } else {
             $this->browse();
         }
     }
     return parent::run();
 }
Esempio n. 13
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();
     if ($this->_action & CRM_CORE_ACTION_VIEW) {
         $this->view();
     } else {
         if ($this->_action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD | CRM_CORE_ACTION_DELETE)) {
             $this->edit();
         } else {
             if ($this->_action & CRM_CORE_ACTION_DISABLE) {
                 CRM_Contact_BAO_Relationship::setIsActive($this->_id, 0);
             } else {
                 if ($this->_action & CRM_CORE_ACTION_ENABLE) {
                     CRM_Contact_BAO_Relationship::setIsActive($this->_id, 1);
                 }
             }
         }
     }
     $this->browse();
     return parent::run();
 }
Esempio n. 14
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()
 {
     $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     if ($context == 'standalone' && !$contactID) {
         $this->_action = CRM_Core_Action::ADD;
         $this->assign('action', $this->_action);
     } else {
         // we should call contact view, preprocess only for membership in contact summary
         if ($this->_action != CRM_Core_Action::VIEW) {
             $this->preProcess();
         }
     }
     if ($this->_permission == CRM_Core_Permission::EDIT && !CRM_Core_Permission::check('edit memberships')) {
         $this->_permission = CRM_Core_Permission::VIEW;
         // demote to view since user does not have edit membership rights
         $this->assign('permission', 'view');
     }
     // check if we can process credit card membership
     $processors = CRM_Core_PseudoConstant::paymentProcessor(false, false, "billing_mode IN ( 1, 3 )");
     if (count($processors) > 0) {
         $this->assign('newCredit', true);
         $this->_isPaymentProcessor = true;
     } else {
         $this->assign('newCredit', false);
         $this->_isPaymentProcessor = false;
     }
     // Only show credit card membership signup if user has CiviContribute permission
     if (CRM_Core_Permission::access('CiviContribute')) {
         $this->_accessContribution = true;
         $this->assign('accessContribution', true);
     } else {
         $this->_accessContribution = false;
         $this->assign('accessContribution', false);
     }
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->view();
     } else {
         if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) {
             $this->setContext();
             $this->edit();
         } else {
             $this->setContext();
             $this->browse();
         }
     }
     return parent::run();
 }
Esempio n. 15
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();
     $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) {
             $this->del($groupContactId, $status, $this->_contactId);
         }
         $session =& CRM_Core_Session::singleton();
         CRM_Utils_System::redirect($session->popUserContext());
     }
     $this->edit(null, CRM_Core_Action::ADD);
     $this->browse();
     return parent::run();
 }
Esempio n. 16
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();
     $this->setContext();
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->view();
     } elseif ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
         $this->edit();
     } else {
         $this->browse();
     }
     return parent::run();
 }
Esempio n. 17
0
 /**
  * perform actions and display for activities.
  *
  * @return none
  *
  * @access public
  */
 function run()
 {
     $this->preProcess();
     // get selector type ? open or closed activities ?
     $history = CRM_Utils_Request::retrieve('history', $this);
     if ($this->_action & CRM_CORE_ACTION_DELETE) {
         $url = 'civicrm/contact/view/activity';
         $session =& CRM_Core_Session::singleton();
         $session->pushUserContext(CRM_Utils_System::url($url, 'action=browse&history=1&show=1'));
         $controller =& new CRM_Core_Controller_Simple('CRM_History_Form_Activity', ts('Delete Activity History'), $this->_action);
         $controller->set('id', $this->_id);
         $controller->setEmbedded(true);
         $controller->process();
         $controller->run();
     }
     $this->browse($history);
     return parent::run();
 }
Esempio n. 18
0
File: Tab.php Progetto: kidaa30/yes
 /**
  * The main function that is called when the page loads.
  *
  * It decides the which action has to be taken for the page.
  */
 public function run()
 {
     $this->preProcess();
     $this->browse();
     parent::run();
 }
Esempio n. 19
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();
     $this->setContext();
     $this->_caseId = CRM_Utils_Request::retrieve('caseID', 'Integer', $this);
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->view();
     } else {
         if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE)) {
             $this->edit();
         } else {
             if ($this->_action & CRM_Core_Action::DISABLE) {
                 CRM_Contact_BAO_Relationship::disableEnableRelationship($this->_id, CRM_Core_Action::DISABLE);
                 CRM_Contact_BAO_Relationship::setIsActive($this->_id, 0);
                 $session =& CRM_Core_Session::singleton();
                 CRM_Utils_System::redirect($session->popUserContext());
             } else {
                 if ($this->_action & CRM_Core_Action::ENABLE) {
                     CRM_Contact_BAO_Relationship::disableEnableRelationship($this->_id, CRM_Core_Action::ENABLE);
                     CRM_Contact_BAO_Relationship::setIsActive($this->_id, 1);
                     $session =& CRM_Core_Session::singleton();
                     CRM_Utils_System::redirect($session->popUserContext());
                 }
             }
         }
     }
     // if this is called from case view, suppress browse relationships form
     if (!$this->_caseId) {
         $this->browse();
     }
     return parent::run();
 }
Esempio n. 20
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();
     $this->browse();
     return parent::run();
 }
Esempio n. 21
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()
 {
     $contactID = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullArray);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this);
     if ($context == 'standalone' && !$contactID) {
         $this->_action = CRM_Core_Action::ADD;
         $this->assign('action', $this->_action);
     } else {
         // we need to call parent preprocess only when we are viewing / editing / adding participant record
         $this->preProcess();
     }
     $this->setContext();
     if ($this->_action & CRM_Core_Action::VIEW) {
         $this->view();
     } else {
         if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) {
             $this->edit();
         } else {
             if ($this->_contactId) {
                 $this->browse();
             }
         }
     }
     return parent::run();
 }