diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 9b6237b92..2dd1bcade 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -187,7 +187,8 @@ protected function _formatcsvfield($type, $value) case 'endtimes': if ($value !== '' && strtoupper($value) !== 'NULL') { $time = strtotime($value); - $field = strftime('%H:%M', $time); + // $field = strftime('%H:%M', $time); + $field = date('Y-m-d h:m:s',$time); } else { $field = null; } @@ -197,7 +198,8 @@ protected function _formatcsvfield($type, $value) case 'recurrence_limit_date': if ($value !== '' && strtoupper($value) !== 'NULL') { $date = strtotime($value); - $field = strftime('%Y-%m-%d', $date); + // $field = strftime('%Y-%m-%d', $date); + $field = date('Y-m-d', $date); } else { $field = null; } diff --git a/admin/controllers/plugins.php b/admin/controllers/plugins.php index 6b31f1592..33b652b62 100644 --- a/admin/controllers/plugins.php +++ b/admin/controllers/plugins.php @@ -17,6 +17,9 @@ * @package JEM * */ +use Joomla\CMS\Language\Text; +use Joomla\CMS\Factory; + class JemControllerPlugins extends JControllerLegacy { /** @@ -35,7 +38,7 @@ public function __construct() */ public function plugins() { - $db = JFactory::getDBO(); + $db = Factory::getDBO(); $query = $db->getQuery(true); $query->select(array('count(*)')); @@ -48,11 +51,12 @@ public function plugins() //any plugins installed? if not redirect to installation screen if ($total > 0){ - $link = 'index.php?option=com_plugins&filter_search=jem'; + // $link = 'index.php?option=com_plugins&filter_search=jem'; + $link = 'index.php?option=com_plugins&filter[search]=jem'; $msg = ""; } else { $link = 'index.php?option=com_installer'; - $msg = JText::_("COM_JEM_PLUGINS_NOPLUGINSINSTALLED"); + $msg = Text::_("COM_JEM_PLUGINS_NOPLUGINSINSTALLED"); } $this->setRedirect($link, $msg); } diff --git a/admin/helpers/html/jemhtml.php b/admin/helpers/html/jemhtml.php index 348475dbb..5512e3010 100644 --- a/admin/helpers/html/jemhtml.php +++ b/admin/helpers/html/jemhtml.php @@ -32,7 +32,8 @@ static public function featured($i, $value = 0, $canChange = true) $states = array( 0 => array( 'disabled.png', - 'fa-star-o', //'fa-circle-o', + // 'fa-star-o', //'fa-circle-o', + 'fas fa-star', //'fa-circle-o', 'events.featured', 'COM_JEM_EVENTS_UNFEATURED', 'COM_JEM_EVENTS_TOGGLE_TO_FEATURE' @@ -178,7 +179,7 @@ static public function toggleAttendanceStatus($i, $value = 0, $canChange = true, $states = array( -99 => array( // fallback on wrong status value 'disabled.png', - 'fa-circle-o', + 'fa-circle', '', 'COM_JEM_STATUS_UNKNOWN', 'COM_JEM_STATUS_UNKNOWN', @@ -220,22 +221,22 @@ static public function toggleAttendanceStatus($i, $value = 0, $canChange = true, $backend = (bool)Factory::getApplication()->isClient('administrator'); $state = \Joomla\Utilities\ArrayHelper::getValue($states, (int) $value, $states[-99]); - + HTMLHelper::_('bootstrap.tooltip'); if (version_compare(JVERSION, '3.3', 'lt')) { // on Joomla! 2.5/3.2 we use good old tooltips - // HTMLHelper::_('behavior.tooltip'); - $attr = 'class="hasTip" title="'.Text::_('COM_JEM_STATUS').'::'.Text::_($state[$canChange ? 4 : 3]).'"'; + // HTMLHelper::_('behavior.tooltip'); + + $attr = 'class="hasTip" data-bs-toggle="tooltip" title="'.Text::_('COM_JEM_STATUS').'::'.Text::_($state[$canChange ? 4 : 3]).'"'; } else { // on Joomla! 3.3+ we must use the new tooltips - HTMLHelper::_('bootstrap.tooltip'); - $attr = 'class="hasTooltip" title="'.HTMLHelper::tooltipText(Text::_('COM_JEM_STATUS'), Text::_($state[$canChange ? 4 : 3]), 0).'"'; + $attr = 'class="hasTooltip" data-bs-toggle="tooltip" title="'.HTMLHelper::tooltipText(Text::_('COM_JEM_STATUS'), Text::_($state[$canChange ? 4 : 3]), 0).'"'; } if ($print) { - $html = HTMLHelper::_('jemhtml.icon', 'com_jem/'.$state[0], 'fa fa-fw fa-lg '.$state[1].' jem-attendance-status-'.$state[1], $state[3], 'class="icon-inline-left"', $backend); + $html = jemhtml::icon('com_jem/'.$state[0], 'fa fa-fw fa-lg '.$state[1].' jem-attendance-status-'.$state[1], $state[3], 'class="icon-inline-left"', $backend); $html .= Text::_($state[5]); } elseif ($canChange && !empty($state[2])) { - $html = HTMLHelper::_('jemhtml.icon', 'com_jem/'.$state[0], 'fa fa-fw fa-lg '.$state[1].' jem-attendance-status-'.$state[1], $state[3], null, $backend); + $html = jemhtml::icon('com_jem/'.$state[0], 'fa fa-fw fa-lg '.$state[1].' jem-attendance-status-'.$state[1], $state[3], null, $backend); if ($backend) { $attr .= ' onclick="return listItemTask(\'cb' . $i . '\',\'' . $state[2] . '\')"'; $url = '#'; @@ -244,9 +245,18 @@ static public function toggleAttendanceStatus($i, $value = 0, $canChange = true, } $html = HTMLHelper::_('link', $url, $html, $attr); } else { - $html = HTMLHelper::_('jemhtml.icon', 'com_jem/'.$state[0], 'fa fa-fw fa-lg '.$state[1].' jem-attendance-status-'.$state[1], $state[3], $attr, $backend); + $html = jemhtml::icon('com_jem/'.$state[0], 'fa fa-fw fa-lg '.$state[1].' jem-attendance-status-'.$state[1], $state[3], $attr, $backend); } - + //-------------start added for tooltips initialize----------- + $html .= ''; + //-------------end added for tooltips initialize----------- return $html; } diff --git a/admin/models/attendee.php b/admin/models/attendee.php index a14b37ce9..ff4df8b53 100644 --- a/admin/models/attendee.php +++ b/admin/models/attendee.php @@ -175,7 +175,8 @@ public function store($data) } } - $row = $this->getTable('jem_register', ''); + // $row = $this->getTable('jem_register', ''); + $row = JTable::getInstance('jem_register', ''); if ($id > 0) { $row->load($id); diff --git a/admin/models/event.php b/admin/models/event.php index fa4888451..e573c3b74 100644 --- a/admin/models/event.php +++ b/admin/models/event.php @@ -123,7 +123,7 @@ public function getItem($pk = null) $registry->loadString($item->metadata); $item->metadata = $registry->toArray(); - $item->articletext = trim($item->fulltext) != '' ? $item->introtext . "
" . $item->fulltext : $item->introtext; + $item->articletext = ($item->fulltext && trim($item->fulltext) != '') ? $item->introtext . "
" . $item->fulltext : $item->introtext; $db = JFactory::getDbo(); diff --git a/admin/models/fields/calendarjem.php b/admin/models/fields/calendarjem.php index ccf638df4..6035b72bd 100644 --- a/admin/models/fields/calendarjem.php +++ b/admin/models/fields/calendarjem.php @@ -44,7 +44,8 @@ protected function getLayoutData() // add hint regarding date/time format accepted in edit field $exampleTimestamp = strtotime("NOW"); - $hint = JText::sprintf('COM_JEM_DATEFIELD_HINT', strftime($this->format, $exampleTimestamp)); + // $hint = JText::sprintf('COM_JEM_DATEFIELD_HINT', strftime($this->format, $exampleTimestamp)); + $hint = JText::sprintf('COM_JEM_DATEFIELD_HINT', date($this->format, $exampleTimestamp)); $extraData = array( 'hint' => $hint, @@ -78,7 +79,8 @@ protected function getInput() if (empty($this->hint)) { // add hint regarding date/time format accepted in edit field $exampleTimestamp = strtotime("NOW"); - $this->hint = JText::sprintf('COM_JEM_DATEFIELD_HINT', strftime($this->format, $exampleTimestamp)); + // $this->hint = JText::sprintf('COM_JEM_DATEFIELD_HINT', strftime($this->format, $exampleTimestamp)); + $this->hint = JText::sprintf('COM_JEM_DATEFIELD_HINT', date($this->format, $exampleTimestamp)); } return parent::getInput(); diff --git a/admin/models/fields/modal/contact.php b/admin/models/fields/modal/contact.php index 79e8349b8..9b6b0e1d8 100644 --- a/admin/models/fields/modal/contact.php +++ b/admin/models/fields/modal/contact.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; jimport('joomla.form.formfield'); - +use Joomla\CMS\Factory; /** * Contact select */ @@ -39,13 +39,13 @@ protected function getInput() $script[] = ' }'; // Add to document head - JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); + Factory::getDocument()->addScriptDeclaration(implode("\n", $script)); // Setup variables for display $html = array(); $link = 'index.php?option=com_jem&view=contactelement&tmpl=component&function=jSelectContact_'.$this->id; - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select('name'); $query->from('#__contact_details'); diff --git a/admin/models/fields/modal/venue.php b/admin/models/fields/modal/venue.php index f8eac1ed1..60f2fd67a 100644 --- a/admin/models/fields/modal/venue.php +++ b/admin/models/fields/modal/venue.php @@ -8,6 +8,9 @@ */ defined('_JEXEC') or die; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; +use Joomla\CMS\Factory; jimport('joomla.form.formfield'); @@ -29,7 +32,7 @@ class JFormFieldModal_Venue extends JFormField protected function getInput() { // Load modal behavior - // JHtml::_('behavior.modal', 'a.modal'); + // HTMLHelper::_('behavior.modal', 'a.modal'); // Build the script $script = array(); @@ -41,13 +44,13 @@ protected function getInput() $script[] = ' }'; // Add to document head - JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); + Factory::getDocument()->addScriptDeclaration(implode("\n", $script)); // Setup variables for display $html = array(); $link = 'index.php?option=com_jem&view=venueelement&tmpl=component&function=jSelectVenue_'.$this->id; - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $query = $db->getQuery(true); $query->select('venue'); $query->from('#__jem_venues'); @@ -68,7 +71,7 @@ protected function getInput() } if (empty($venue)) { - $venue = JText::_('COM_JEM_SELECTVENUE'); + $venue = Text::_('COM_JEM_SELECTVENUE'); } $venue = htmlspecialchars($venue, ENT_QUOTES, 'UTF-8'); @@ -80,20 +83,20 @@ protected function getInput() // The venue select button $html[] = '
'; $html[] = '
'; - // $html[] = ' '. - // JText::_('COM_JEM_SELECT').''; - $html[] = JHtml::_( + // $html[] = ' '. + // Text::_('COM_JEM_SELECT').''; + $html[] = HTMLHelper::_( 'bootstrap.renderModal', 'venue-modal-1', array( 'url' => $link.'&'.JSession::getFormToken().'=1', - 'title' => JText::_('COM_JEM_SELECT'), + 'title' => Text::_('COM_JEM_SELECT'), 'width' => '800px', 'height' => '450px', 'footer' => '' ) ); - $html[] =''; $html[] = '
'; $html[] = '
'; diff --git a/admin/models/import.php b/admin/models/import.php index 5daab9056..ca517afdd 100644 --- a/admin/models/import.php +++ b/admin/models/import.php @@ -204,7 +204,7 @@ private function import($tablename, $prefix, $fieldsname, &$data, $replace = tru // collect categories for each event; we get array( itemid => array( catid => ordering ) ) $events[$row[$itemidx]][$row[$catidx]] = ($orderidx !== false) ? $row[$orderidx] : 0; } - echo "
";print_R($events);die;
+		
 			// store data
 			return $this->storeCatsEventRelations($events, $replace);
 		}
diff --git a/admin/models/source.php b/admin/models/source.php
index 23f4d23c7..c3c367662 100644
--- a/admin/models/source.php
+++ b/admin/models/source.php
@@ -37,7 +37,7 @@ protected function populateState()
 		$id = $app->getUserState('com_jem.edit.source.id');
 
 		// Parse the template id out of the compound reference.
-		$temp = (base64_decode($id));
+		$temp = $id ? (base64_decode($id)) : $id;
 		$fileName = $temp;
 
 		$this->setState('filename', $fileName);
@@ -118,9 +118,9 @@ public function getSource()
 			$file = $fileName;
 			$filePath = JPath::clean(JPATH_ROOT . '/media/com_jem/css/' . $file);
 		}
-
+		
 		$item = new stdClass;
-		if (file_exists($filePath)) {
+		if ($file && file_exists($filePath)) {
 			$item->custom   = $custom !== false;
 			$item->filename = $file;
 			$item->source   = file_get_contents($filePath);
diff --git a/admin/sql/updates/2.1.7-dev1.sql b/admin/sql/updates/2.1.7-dev1.sql
index 847c29496..a728d8994 100644
--- a/admin/sql/updates/2.1.7-dev1.sql
+++ b/admin/sql/updates/2.1.7-dev1.sql
@@ -1,3 +1,3 @@
 -- insert new config values
 INSERT IGNORE INTO `#__jem_config` (`keyname`, `value`)
-	VALUES ('formathour', '%H'), ('csv_separator', ';');
+	VALUES ('formathour', 'H'), ('csv_separator', ';');
diff --git a/admin/tables/event.php b/admin/tables/event.php
index 9a0256783..ce577ab5e 100644
--- a/admin/tables/event.php
+++ b/admin/tables/event.php
@@ -24,11 +24,13 @@ public function __construct(&$db)
 	public function bind($array, $ignore = '')
 	{
 		// in here we are checking for the empty value of the checkbox
-
+		
 		if (!isset($array['registra'])) {
 			$array['registra'] = 0 ;
 		}
-
+		if(isset($array['contactid'])){
+			$array['contactid'] = (int) $array['contactid'];
+		}
 		if (!isset($array['unregistra'])) {
 			$array['unregistra'] = 0 ;
 		}
diff --git a/admin/views/attendee/tmpl/default.php b/admin/views/attendee/tmpl/default.php
index 666612339..3346cf8f0 100644
--- a/admin/views/attendee/tmpl/default.php
+++ b/admin/views/attendee/tmpl/default.php
@@ -22,15 +22,28 @@
 			->useScript('form.validate');
 
 $selectuser_link = Route::_('index.php?option=com_jem&task=attendee.selectuser&tmpl=component');
+echo JHtml::_(
+	'bootstrap.renderModal',
+	'user-modal',
+	array(		
+		'url'    => $selectuser_link.'&'.JSession::getFormToken().'=1',
+		'title'  => JText::_('COM_JEM_SELECT'),
+		'width'  => '800px',
+		'height' => '450px',
+		'footer' => ''
+	)
+);
 ?>
 
 
-"; print_R($this->item);die; ?>
 
diff --git a/admin/views/eventelement/tmpl/default.php b/admin/views/eventelement/tmpl/default.php index 80457338d..5e1abe66f 100644 --- a/admin/views/eventelement/tmpl/default.php +++ b/admin/views/eventelement/tmpl/default.php @@ -72,7 +72,8 @@ if (!$row->times) { $displaytime = '-'; } else { - $time = strftime( $this->jemsettings->formattime, strtotime( $row->times )); + // $time = strftime( $this->jemsettings->formattime, strtotime( $row->times )); + $time = date( $this->jemsettings->formattime, strtotime( $row->times )); $displaytime = $time.' '.$this->jemsettings->timename; } echo $displaytime; diff --git a/admin/views/events/tmpl/default.php b/admin/views/events/tmpl/default.php index 6b756e9ae..29862483f 100644 --- a/admin/views/events/tmpl/default.php +++ b/admin/views/events/tmpl/default.php @@ -22,6 +22,8 @@ $params = (isset($this->state->params)) ? $this->state->params : new JObject(); $settings = $this->settings; +$wa = $this->document->getWebAssetManager(); +$wa->useScript('table.columns'); ?>