Merge pull request #4898 from monishdeb/CRM-15619-fix
[civicrm-core.git] / CRM / Event / Form / ManageEvent.php
index 70330d551f9512080972bdc3f6ef9673806afb96..53644e22878f1e9a27b35afaaa9a2e49b4d9f913 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -43,7 +43,6 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
    * The id of the event we are proceessing
    *
    * @var int
-   * @protected
    */
   public $_id;
 
@@ -51,7 +50,6 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
    * Is this the first page?
    *
    * @var boolean
-   * @access protected
    */
   protected $_first = FALSE;
 
@@ -59,7 +57,6 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
    * Are we in single form mode or wizard mode?
    *
    * @var boolean
-   * @access protected
    */
   protected $_single;
 
@@ -94,9 +91,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
    * Set variables up before form is built
    *
    * @return void
-   * @access public
    */
-  function preProcess() {
+  public function preProcess() {
     $config = CRM_Core_Config::singleton();
     if (in_array('CiviEvent', $config->enableComponents)) {
       $this->assign('CiviEvent', TRUE);
@@ -210,16 +206,22 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
         $this->_doneUrl = CRM_Utils_System::url('civicrm/event/manage',
           'reset=1'
         );
-        $breadCrumb = array(array('title' => ts('Manage Events'),
+        $breadCrumb = array(
+          array(
+            'title' => ts('Manage Events'),
             'url' => $this->_doneUrl,
-          ));
+          )
+        );
       }
     }
     else {
       $this->_doneUrl = CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1');
-      $breadCrumb = array(array('title' => ts('Manage Event Templates'),
+      $breadCrumb = array(
+        array(
+          'title' => ts('Manage Event Templates'),
           'url' => $this->_doneUrl,
-        ));
+        )
+      );
     }
     CRM_Utils_System::appendBreadCrumb($breadCrumb);
   }
@@ -228,11 +230,10 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
    * Set default values for the form. For edit/view mode
    * the default values are retrieved from the database
    *
-   * @access public
    *
    * @return void
    */
-  function setDefaultValues() {
+  public function setDefaultValues() {
     $defaults = array();
     if (isset($this->_id)) {
       $params = array('id' => $this->_id);
@@ -259,7 +260,6 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
    * Build the form object
    *
    * @return void
-   * @access public
    */
   public function buildQuickForm() {
     $session = CRM_Core_Session::singleton();
@@ -308,13 +308,13 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
       if (!$this->_first) {
         $buttons[] = array(
           'type' => 'back',
-          'name' => ts('<< Previous'),
+          'name' => ts('Previous'),
           'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
         );
       }
       $buttons[] = array(
         'type' => 'upload',
-        'name' => ts('Continue >>'),
+        'name' => ts('Continue'),
         'spacing' => '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
         'isDefault' => TRUE,
       );
@@ -329,7 +329,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
     $this->add('hidden', 'is_template', $this->_isTemplate);
   }
 
-  function endPostProcess() {
+  public function endPostProcess() {
     // make submit buttons keep the current working tab opened.
     if ($this->_action & CRM_Core_Action::UPDATE) {
       $className = CRM_Utils_String::getClassName($this->_name);
@@ -355,8 +355,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
       }
 
       CRM_Core_Session::setStatus(ts("'%1' information has been saved.",
-          array(1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className))
-        ), ts('Saved'), 'success');
+        array(1 => CRM_Utils_Array::value('title', CRM_Utils_Array::value($subPage, $this->get('tabHeader')), $className))
+      ), ts('Saved'), 'success');
 
       $config = CRM_Core_Config::singleton();
       if (in_array('CiviCampaign', $config->enableComponents)) {
@@ -370,7 +370,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
       $this->postProcessHook();
       if ($this->controller->getButtonName('submit') == "_qf_{$className}_upload_done") {
         if ($this->_isTemplate) {
-          CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1'));
+          CRM_Core_Session::singleton()
+            ->pushUserContext(CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1'));
         }
         else {
           CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/event/manage', 'reset=1'));
@@ -378,8 +379,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
       }
       else {
         CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url("civicrm/event/manage/{$subPage}",
-            "action=update&reset=1&id={$this->_id}"
-          ));
+          "action=update&reset=1&id={$this->_id}"
+        ));
       }
     }
   }
@@ -387,7 +388,7 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
   /**
    * @return string
    */
-  function getTemplateFileName() {
+  public function getTemplateFileName() {
     if ($this->controller->getPrint() || $this->getVar('_id') <= 0 || $this->_action & CRM_Core_Action::DELETE) {
       return parent::getTemplateFileName();
     }
@@ -401,9 +402,8 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form {
   /**
    * Pre-load libraries required by Online Registration Profile fields
    */
-  static function addProfileEditScripts() {
+  public static function addProfileEditScripts() {
     CRM_UF_Page_ProfileEditor::registerProfileScripts();
     CRM_UF_Page_ProfileEditor::registerSchemas(array('IndividualModel', 'ParticipantModel'));
   }
 }
-