Example #1
0
 /**
  * Constructor
  *
  * @since 0.9
  */
 function __construct()
 {
     parent::__construct();
     // Register Extra task
     $this->registerTask('cleaneventimg', 'delete');
     $this->registerTask('cleanvenueimg', 'delete');
 }
Example #2
0
 /**
  * logic to create the edit venue view
  *
  * @access public
  * @return void
  * @since 0.9
  */
 function edit()
 {
     JRequest::setVar('view', 'settings');
     parent::display();
     $model = $this->getModel('settings');
     $model->checkout();
 }
Example #3
0
 /**
  * Constructor
  *
  * @since 0.9
  */
 function __construct()
 {
     parent::__construct();
     // Register Extra task
     $this->registerTask('eventimgup', 'uploadimage');
     $this->registerTask('venueimgup', 'uploadimage');
     $this->registerTask('categoryimgup', 'uploadimage');
 }
Example #4
0
 public function edit()
 {
     JRequest::setVar('hidemainmenu', 1);
     JRequest::setVar('layout', 'default');
     JRequest::setVar('view', 'session');
     JRequest::setVar('standalone', true);
     if (Jrequest::getVar('task') == 'edit') {
         JRequest::setVar('edit', true);
     } else {
         JRequest::setVar('edit', false);
     }
     parent::display();
 }
Example #5
0
 function doimport()
 {
     $replace = JRequest::getVar('replace', 0, 'post', 'int');
     $msg = '';
     if ($file = JRequest::getVar('import', null, 'files', 'array')) {
         $handle = fopen($file['tmp_name'], 'r');
         if (!$handle) {
             $msg = JText::_('COM_REDEVENT_Cannot_open_uploaded_file.');
             $this->setRedirect('index.php?option=com_redevent&controller=textlibrary&task=import', $msg, 'error');
             return;
         }
         // get fields, on first row of the file
         $fields = array();
         if (($data = fgetcsv($handle, 0, ',', '"')) !== FALSE) {
             $numfields = count($data);
             for ($c = 0; $c < $numfields; $c++) {
                 $fields[$c] = $data[$c];
             }
         }
         // If there is no validated fields, there is a problem...
         if (!count($fields)) {
             $msg .= "<p>Error parsing column names. Are you sure this is a proper csv export ?<br />try to export first to get an example of formatting</p>\n";
             $this->setRedirect('index.php?option=com_redevent&controller=textlibrary&task=import', $msg, 'error');
             return;
         } else {
             $msg .= "<p>" . $numfields . " fields found in first row</p>\n";
             $msg .= "<p>" . count($fields) . " fields were kept</p>\n";
         }
         // Now get the records, meaning the rest of the rows.
         $records = array();
         $row = 1;
         while (($data = fgetcsv($handle, 0, ',', '"')) !== FALSE) {
             $num = count($data);
             if ($numfields != $num) {
                 $msg .= "<p>Wrong number of fields ({$num}) record {$row}<br /></p>\n";
             } else {
                 $r = new stdclass();
                 // only extract columns with validated header, from previous step.
                 foreach ($fields as $k => $v) {
                     $r->{$v} = $data[$k];
                 }
                 $records[] = $r;
             }
             $row++;
         }
         fclose($handle);
         $msg .= "<p>total records found: " . count($records) . "<br /></p>\n";
         // database update
         if (count($records)) {
             $model = $this->getModel('textlibrary');
             $result = $model->import($records, $replace);
             $msg .= "<p>total added records: " . $result['added'] . "<br /></p>\n";
             $msg .= "<p>total updated records: " . $result['updated'] . "<br /></p>\n";
         }
         $this->setRedirect('index.php?option=com_redevent&controller=textlibrary&task=import', $msg);
     } else {
         parent::display();
     }
 }
 /**
  * Constructor
  *
  *@since 0.9
  */
 public function __construct()
 {
     parent::__construct();
 }
Example #7
0
 function groupacl()
 {
     JRequest::setVar('view', 'groupacl');
     parent::display();
 }
Example #8
0
 /**
  * import event
  */
 public function import()
 {
     $input = JFactory::getApplication()->input;
     $duplicate_method = $input->get('duplicate_method', 'ignore', 'word');
     $msg = '';
     if ($file = $input->files->get('import')) {
         $handle = fopen($file['tmp_name'], 'r');
         if (!$handle) {
             $msg = JText::_('COM_REDEVENT_Cannot_open_uploaded_file.');
             $this->setRedirect('index.php?option=com_redevent&controller=events&task=export', $msg, 'error');
             return;
         }
         // get fields, on first row of the file
         $fields = array();
         if (($data = fgetcsv($handle, 0, ',', '"')) !== FALSE) {
             $numfields = count($data);
             for ($c = 0; $c < $numfields; $c++) {
                 // here, we make sure that the field match one of the fields of eventlist_venues table or special fields,
                 // otherwise, we don't add it
                 //          if ( array_key_exists($data[$c], $object_fields) ) {
                 $fields[$c] = $data[$c];
                 //          }
             }
         }
         // If there is no validated fields, there is a problem...
         if (!count($fields)) {
             $msg .= "<p>Error parsing column names. Are you sure this is a proper csv export ?<br />try to export first to get an example of formatting</p>\n";
             $this->setRedirect('index.php?option=com_redevent&controller=events&task=export', $msg, 'error');
             return;
         } else {
             $msg .= "<p>" . $numfields . " fields found in first row</p>\n";
             $msg .= "<p>" . count($fields) . " fields were kept</p>\n";
         }
         // Now get the records, meaning the rest of the rows.
         $records = array();
         $row = 1;
         while (($data = fgetcsv($handle, 0, ',', '"')) !== FALSE) {
             $num = count($data);
             if ($numfields != $num) {
                 $msg .= "<p>Wrong number of fields ({$num}) record {$row}<br /></p>\n";
             } else {
                 $r = new stdclass();
                 // only extract columns with validated header, from previous step.
                 foreach ($fields as $k => $v) {
                     $r->{$v} = $this->_formatcsvfield($v, $data[$k]);
                 }
                 $records[] = $r;
             }
             $row++;
         }
         fclose($handle);
         $msg .= "<p>total records found: " . count($records) . "<br /></p>\n";
         // database update
         if (count($records)) {
             $model = $this->getModel('import');
             $result = $model->eventsimport($records, $duplicate_method);
             $msg .= "<p>total added records: " . $result['added'] . "<br /></p>\n";
             $msg .= "<p>total updated records: " . $result['updated'] . "<br /></p>\n";
             $msg .= "<p>total ignored records: " . $result['ignored'] . "<br /></p>\n";
         }
         $this->setRedirect('index.php?option=com_redevent&controller=events&task=export', $msg);
     } else {
         parent::display();
     }
 }
Example #9
0
 function exportattendees()
 {
     JRequest::setVar('view', 'attendees');
     JRequest::setVar('layout', 'exportattendees');
     parent::display();
 }
Example #10
0
 function email()
 {
     $task = JRequest::getVar('task');
     if ($task == 'email') {
         $cid = JRequest::getVar('cid', array(), 'post', 'array');
     } else {
         $cid = null;
     }
     $xref = JRequest::getInt('xref');
     JRequest::setVar('view', 'emailattendees');
     parent::display();
 }
Example #11
0
 function edit()
 {
     JRequest::setvar('layout', 'edit');
     parent::display();
 }
 /**
  * Logic to create the view for the edit categoryscreen
  *
  * @access public
  * @return void
  * @since 0.9
  */
 function edit()
 {
     JRequest::setVar('view', 'venuescategory');
     JRequest::setVar('hidemainmenu', 1);
     $model = $this->getModel('venuescategory');
     $user =& JFactory::getUser();
     // Error if checkedout by another administrator
     if ($model->isCheckedOut($user->get('id'))) {
         $this->setRedirect('index.php?option=com_redevent&view=venuescategories', JText::_('COM_REDEVENT_EDITED_BY_ANOTHER_ADMIN'));
     }
     $model->checkout();
     parent::display();
 }
Example #13
0
 /**
  * logic to create the edit event screen
  *
  * @access public
  * @return void
  * @since 0.9
  */
 function edit()
 {
     JRequest::setVar('view', 'groupmember');
     JRequest::setVar('hidemainmenu', 1);
     $group_id = JRequest::getVar('group_id', 0, '', 'int') or die('Missing group id');
     $model = $this->getModel('groupmember');
     $user =& JFactory::getUser();
     // Error if checkedout by another administrator
     if ($model->isCheckedOut($user->get('id'))) {
         $this->setRedirect('index.php?option=com_redevent&view=groupmembers&group_id=' . $group_id, JText::_('COM_REDEVENT_EDITED_BY_ANOTHER_ADMIN'));
     }
     $model->checkout();
     parent::display();
 }
Example #14
0
 function confirm()
 {
     if (JRequest::getVar('task') == 'review') {
         JRequest::setVar('layout', 'review');
     } else {
         JRequest::setVar('layout', 'confirmed');
     }
     JRequest::setVar('view', 'registration');
     parent::display();
 }