Your IP : 216.73.216.240


Current Path : /home/j/u/v/juvelize/www/components/com_icagenda/tmpl/manager/
Upload File :
Current File : /home/j/u/v/juvelize/www/components/com_icagenda/tmpl/manager/event_edit.php

<?php
/**
 *----------------------------------------------------------------------------
 * iCagenda     Events Management Extension for Joomla!
 *----------------------------------------------------------------------------
 * @version     3.9.4 2024-06-15
 *
 * @package     iCagenda.Site
 * @subpackage  tmpl.manager
 * @link        https://www.icagenda.com
 *
 * @author      Cyril Rezé
 * @copyright   (c) 2012-2024 Cyril Rezé / iCagenda. All rights reserved.
 * @license     GNU General Public License version 3 or later; see LICENSE.txt
 *
 * @since       3.8
 *----------------------------------------------------------------------------
*/

defined('_JEXEC') or die;

use iCutilities\Customfields\Customfields as icagendaCustomfields;
use iCutilities\Maps\Google\Search as icagendaMapsGoogleSearch;
use iCutilities\Maps\Leaflet\Search as icagendaMapsLeafletSearch;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_contenthistory');
$wa->useScript('keepalive')
	->useScript('form.validate')
	->useScript('com_contenthistory.admin-history-versions');

HTMLHelper::_('script', 'com_icagenda/icform.js', array('relative' => true, 'version' => 'auto'), array('async' => 'async'));

$document = Factory::getDocument();
$language = Factory::getLanguage();

$language->load('com_icagenda', JPATH_ADMINISTRATOR, 'en-GB', true);
$language->load('com_icagenda', JPATH_ADMINISTRATOR, null, true);

$params = $this->state->get('params');

$maps_service = $params->get('maps_service', 1);

$ic_style = 'div.tip img.media-preview {display:none}';
$document->addStyleDeclaration($ic_style);

// Styles for multiple dates main Add Button
//$add_date_btn_style = '.subform-repeatable > .btn-toolbar .group-add:after { content: " ' . Text::_('JGLOBAL_FIELD_ADD') . ' "; font-weight: bold; } .subform-repeatable > .btn-toolbar .group-add {width: 100%; }';
$add_date_btn_style = '.subform-repeatable > .btn-toolbar .group-add {width: 100%; }';
$document->addStyleDeclaration($add_date_btn_style);

$paramsfields = $this->form->getFieldsets('params');
?>

<div class="edit item-page<?php echo $this->pageclass_sfx; ?>">
	<?php if ($params->get('show_page_heading')) : ?>
	<div class="page-header">
		<h1>
			<?php echo $this->escape($params->get('page_heading')); ?> <small><?php echo $this->item->title; ?></small>
		</h1>
	</div>
	<?php endif; ?>

	<form class="form-validate"
		id="adminForm"
		name="adminForm"
		action="<?php echo Route::_('index.php?option=com_icagenda&event_id=' . (int) $this->item->id); ?>"
		method="post"
		enctype="multipart/form-data"
		>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary validate" name="task" value="event.save">
					<span class="icon-ok" aria-hidden="true"></span>
					<?php echo Text::_('JSAVE'); ?>
				</button>
				<button type="submit" class="btn btn-danger" name="task" value="event.cancel" formnovalidate>
					<span class="icon-cancel" aria-hidden="true"></span>
					<?php echo Text::_('JCANCEL'); ?>
				</button>
			</div>
		</div>

		<?php // Captcha ?>
		<?php echo $this->form->renderField('captcha'); ?>

		<hr />

		<fieldset>
			<?php echo HTMLHelper::_('uitab.startTabSet', 'icTab', ['active' => 'event', 'recall' => true, 'breakpoint' => 768]); ?>

			<!-- Panel Event -->
			<?php echo HTMLHelper::_('uitab.addTab', 'icTab', 'event', Text::_('COM_ICAGENDA_TITLE_EVENT')); ?>

				<div class="row-fluid form-vertical">
					<?php echo $this->form->renderField('title'); ?>
					<?php echo $this->form->renderField('catid'); ?>
					<?php echo $this->form->renderField('image'); ?>
				</div>

				<br />

			<?php echo HTMLHelper::_('uitab.endTab'); ?>

			<!-- Panel Dates -->
			<?php echo HTMLHelper::_('uitab.addTab', 'icTab', 'dates', Text::_('COM_ICAGENDA_LEGEND_DATES')); ?>

				<?php echo $this->form->renderField('period_title'); ?>
				<div class="row">
					<div class="col-6">
						<?php echo $this->form->renderField('startdate'); ?>
						<?php echo $this->form->renderField('enddate'); ?>
					</div>
					<div class="col-6">
						<?php echo $this->form->renderField('weekdays'); ?>
						<?php echo $this->form->renderField('weekdays_info'); ?>
					</div>
				</div>
				<?php //echo $this->form->renderField('period_spacer'); ?>

				<?php echo $this->form->renderField('dates_title'); ?>
				<div class="row">
					<?php echo $this->form->getInput('dates'); ?>
				</div>
				<?php //echo $this->form->renderField('dates_spacer'); ?>

				<?php echo $this->form->renderField('dates_options_title'); ?>
				<div class="row">
					<?php echo $this->form->renderField('displaytime'); ?>
				</div>
				<?php //echo $this->form->renderField('dates_options_spacer'); ?>

				<br />

			<?php echo HTMLHelper::_('uitab.endTab'); ?>

			<!-- Panel Description -->
			<?php echo HTMLHelper::_('uitab.addTab', 'icTab', 'desc', Text::_('COM_ICAGENDA_LEGEND_DESC')); ?>

				<?php echo $this->form->renderField('shortdesc_title'); ?>
				<?php echo $this->form->renderField('shortdesc_info'); ?>
				<?php echo $this->form->getInput('shortdesc'); ?>
				<?php //echo $this->form->renderField('shortdesc_spacer'); ?>

				<?php echo $this->form->renderField('desc_title'); ?>
				<div class="row-fluid">
					<?php echo $this->form->getInput('desc'); ?>
				</div>
				<?php //echo $this->form->renderField('desc_spacer'); ?>

				<?php echo $this->form->renderField('metadesc_title'); ?>
				<?php echo $this->form->renderField('metadesc_info'); ?>
				<?php echo $this->form->getInput('metadesc'); ?>
				<?php //echo $this->form->renderField('metadesc_spacer'); ?>

				<br />

			<?php echo HTMLHelper::_('uitab.endTab'); ?>

			<!-- Panel Information -->
			<?php echo HTMLHelper::_('uitab.addTab', 'icTab', 'infos', Text::_('COM_ICAGENDA_LEGEND_INFORMATION')); ?>

				<div class="row">
					<div class="ic-col-6">
						<?php echo $this->form->renderField('global_info_title'); ?>
						<?php echo $this->form->renderField('place'); ?>
						<?php echo $this->form->renderField('website'); ?>
					</div>
					<div class="ic-col-6">
						<?php echo $this->form->renderField('contact_title'); ?>
						<?php echo $this->form->renderField('email'); ?>
						<?php echo $this->form->renderField('phone'); ?>
					</div>
				</div>
				<?php //echo $this->form->renderField('global_info_spacer'); ?>

				<?php echo $this->form->renderField('attachments_title'); ?>
				<div class="row">
					<?php echo $this->form->renderField('file'); ?>
				</div>
				<?php //echo $this->form->renderField('attachments_spacer'); ?>

				<?php echo $this->form->renderField('features_title'); ?>
				<div class="row">
					<?php echo $this->form->renderField('features'); ?>
				</div>
				<?php //echo $this->form->renderField('features_spacer'); ?>

				<?php $customFields = icagendaCustomfields::loader(2); // Load Custom fields - Event form (2) ?>
				<?php if ($customFields && $this->params->get('submit_customfieldsDisplay', 1)) : ?>
					<?php echo $this->form->renderField('custom_fields_title'); ?>
					<?php echo $customFields; ?>
					<?php //echo $this->form->renderField('custom_fields_spacer'); ?>
				<?php endif; ?>

				<br />

			<?php echo HTMLHelper::_('uitab.endTab'); ?>

			<!-- Panel Map -->
			<?php if ($this->params->get('submit_gmapDisplay', 1)) : ?>

			<?php echo HTMLHelper::_('uitab.addTab', 'icTab', 'icmap', Text::_('COM_ICAGENDA_LEGEND_MAP')); ?>

				<?php if ( ! $maps_service) : ?>
					<?php echo $this->form->renderField('address'); ?>
					<div class="alert alert-warning">
						<?php echo Text::_('COM_ICAGENDA_MAPS_SERVICE_NOT_SET'); ?>
					</div>

				<!-- LeafLet OpenStreetMap -->
				<?php elseif ($maps_service == '1') : ?>
					<div class="row">
						<div class="col-lg-12">
							<div class="icmap-address">
								<div class="control-group">
									<div class="control-label">
										<?php echo $this->form->getLabel('address'); ?>
									</div>
									<div class="controls">
										<div id="findbox"></div>
										<?php echo $this->form->getInput('address'); ?>
									</div>
								</div>
							</div>
						</div>
					</div>
					<br />
					<div class="row">
						<div class="col-lg-4">
							<div class="icmap-field">
								<?php echo $this->form->getInput('city'); ?>
							</div>
							<div class="icmap-field">
								<?php echo $this->form->getInput('country'); ?>
							</div>
							<div class="icmap-field">
								<?php echo $this->form->getInput('lat'); ?>
							</div>
							<div class="icmap-field">
								<?php echo $this->form->getInput('lng'); ?>
							</div>
						</div>
						<div class="col-lg-8">
							<div class="ic-map-container">
								<div class="ic-map-wrapper" id="ic-map-<?php echo (int) $this->item->id; ?>"></div>
							</div>
						</div>
					</div>
					<?php icagendaMapsLeafletSearch::addJS('ic-map-' . (int) $this->item->id, 'jform_address', array('tab' => 'a[href=\"#icmap\"]')); ?>

				<!-- Google Maps Embed API -->
				<?php elseif ($maps_service == '2') : ?>
					<div class="row">
						<div class="col-lg-12">
							<div class="icmap-address">
								<div class="control-group">
									<div class="control-label">
										<?php echo $this->form->getLabel('address'); ?>
									</div>
									<div class="controls">
										<div class="input-append">
											<?php echo $this->form->getInput('address'); ?>
											<span class="btn btn-default" onclick="checkGoogleMap(document.getElementById('jform_address').value)"><?php echo Text::_('IC_CHECK'); ?></span>
										</div>
									</div>
								</div>
							</div>
							<div class="ic-map-container">
								<div id="embed_map" class="ic-map-wrapper"></div>
							</div>
						</div>
					</div>
					<?php
					$apiKey = $params->get('googlemaps_embed_key', '');
					?>
					<?php icagendaMapsGoogleSearch::addEmbedJS('embed_map', 'jform_address', array('apiKey' => $apiKey)); ?>

				<!-- Google Maps Javascript API -->
				<?php elseif ($maps_service == '3') : ?>
					<div class="form-horizontal">
						<!--h3><?php echo Text::_('COM_ICAGENDA_GOOGLE_MAPS_SUBTITLE_LBL'); ?></h3>
						<div>
							<?php echo Text::_('COM_ICAGENDA_GOOGLE_MAPS_NOTE1'); ?>
							<br/>
							<?php echo Text::_('COM_ICAGENDA_GOOGLE_MAPS_NOTE2'); ?>
							<br/>
						</div>
						<div style="clear:both"></div-->
						<div class="icmap-address">
							<?php echo $this->form->renderField('address'); ?>
						</div>
					</div>
					<br />
					<div class="row">
						<div class="col-lg-4">
							<div class="icmap-field">
								<?php echo $this->form->getInput('city'); ?>
							</div>
							<div class="icmap-field">
								<?php echo $this->form->getInput('country'); ?>
							</div>
							<div class="icmap-field">
								<?php echo $this->form->getInput('lat'); ?>
							</div>
							<div class="icmap-field">
								<?php echo $this->form->getInput('lng'); ?>
							</div>
						</div>
						<div class="col-lg-8">
							<div class="ic-map-container">
								<div class="ic-reverse-geocode text-end">
									<label id="geo_label" for="reverseGeocode"><?php echo Text::_('COM_ICAGENDA_GOOGLE_MAPS_REVERSE'); ?></label>
									<select id="reverseGeocode">
										<option value="false" selected><?php echo Text::_('JNO'); ?></option>
										<option value="true"><?php echo Text::_('JYES'); ?></option>
									</select>
								</div>
								<div id="map" class="ic-map-wrapper"></div>
								<div id="legend" class="ic-map-legend"><?php echo Text::_('COM_ICAGENDA_GOOGLE_MAPS_LEGEND'); ?></div>
							</div>
							<?php
								$apiKey    = $this->params->get('googlemaps_browser_key', '');
								$apiClient = $this->params->get('googlemaps_client_id', '');
							?>
							<?php icagendaMapsGoogleSearch::addJS('map', 'jform_address', array('apiKey' => $apiKey, 'apiClient' => $apiClient)); ?>
						</div>
					</div>

				<?php endif; ?>

				<br />

			<?php echo HTMLHelper::_('uitab.endTab'); ?>

			<?php endif; ?>

			<!-- Panel Registrations -->
			<?php if ($this->params->get('submit_regoptionsDisplay', 1)) : ?>

			<?php echo HTMLHelper::_('uitab.addTab', 'icTab', 'registrations', Text::_('COM_ICAGENDA_REGISTRATIONS_LABEL')); ?>

				<div class="row">
					<?php foreach ($paramsfields as $name => $fieldSet) : ?>
						<?php if ( $name == 'registration') : ?>
							<div class="row">
								<?php foreach ($this->form->getFieldset($name) as $field) : ?>
									<?php echo $field->renderField(); ?>
								<?php endforeach; ?>
							</div>
						<?php endif; ?>
						<?php if ( $name == 'registration_tickets') : ?>
							<div class="row">
								<div class="col-lg-8">
									<?php echo $this->form->renderField('maxReg', 'params'); ?>
								</div>
								<div class="col-lg-4">
									<?php echo $this->form->renderField('typeReg', 'params'); ?>
								</div>
							</div>
							<!--div class="row">
								<?php //echo $this->form->renderField('tickets_note', 'params'); ?>
							</div-->
						<?php endif; ?>
						<?php if ( ! in_array($name, array('frontend', 'options', 'publishing', 'registration', 'registration_tickets'))) : ?>
							<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
								<p class="tip"><?php echo $this->escape(Text::_($fieldSet->description));?></p>
							<?php endif; ?>
							<div<?php if (in_array($name, array('registration_options', 'registration_button'))) echo ' class="col-lg-6"'; ?>>
								<h3><?php echo $this->escape(Text::_($fieldSet->label)); ?></h3>
								<?php foreach ($this->form->getFieldset($name) as $field) : ?>
									<?php echo $field->renderField(); ?>
								<?php endforeach; ?>
							</div>
						<?php endif; ?>
					<?php endforeach; ?>
				</div>

				<br />

			<?php echo HTMLHelper::_('uitab.endTab'); ?>

			<?php endif; ?>

			<!-- Panel Options -->
			<?php //echo HTMLHelper::_('uitab.addTab', 'icTab', 'options', Text::_('JOPTIONS')); ?>

				<!--div class="row-fluid form-vertical">
					<?php foreach ($paramsfields as $name => $fieldSet) : ?>
						<?php if ($name == 'options') : ?>
							<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
								<p class="tip"><?php echo $this->escape(Text::_($fieldSet->description));?></p>
							<?php endif; ?>
							<div class="span6 iCleft">
								<?php foreach ($this->form->getFieldset($name) as $field) : ?>
									<div class="control-group">
										<div class="control-label">
											<?php echo $field->label; ?>
										</div>
										<div class="controls">
											<?php
											$language = Factory::getLanguage();
											$language->load('com_icagenda', JPATH_SITE, 'en-GB', true);
											$language->load('com_icagenda', JPATH_SITE, null, true);
											echo $field->input;
											?>
										</div>
									</div>
								<?php endforeach; ?>
							</div>
						<?php endif; ?>
					<?php endforeach; ?>
				</div>
				<hr /-->

			<?php //echo HTMLHelper::_('uitab.endTab'); ?>

			<!-- Panel Publishing -->
			<?php echo HTMLHelper::_('uitab.addTab', 'icTab', 'publishing', Text::_('COM_ICAGENDA_MANAGER_PUBLISHING')); ?>

				<div class="row-fluid">
					<?php foreach ($paramsfields as $name => $fieldSet) : ?>
						<?php if ($name == 'publishing') : ?>
							<?php if (isset($fieldSet->description) && trim($fieldSet->description)) : ?>
								<p class="tip"><?php echo $this->escape(Text::_($fieldSet->description));?></p>
							<?php endif; ?>
							<div class="iCleft">
								<h3><?php echo $this->escape(Text::_($fieldSet->label)); ?></h3>
								<?php foreach ($this->form->getFieldset($name) as $field) : ?>
									<?php echo $field->renderField(); ?>
								<?php endforeach; ?>
							</div>
						<?php endif; ?>
					<?php endforeach; ?>
				</div>
				<?php echo $this->form->renderField('id'); ?>
				<?php echo $this->form->renderField('approval'); ?>
				<?php //echo $this->form->renderField('checked_out'); ?>
				<?php //echo $this->form->renderField('checked_out_time'); ?>
				<?php echo $this->form->renderField('state'); ?>
				<?php echo $this->form->renderField('access'); ?>
				<?php echo $this->form->renderField('language'); ?>
				<?php //if (!empty($this->item->site_itemid)) : ?>
					<!--h3>
						<?php //echo $this->escape(Text::_('COM_ICAGENDA_FORM_FRONTEND_OPTIONS'));?>
					</h3>
					<hr /-->
					<?php //echo $this->form->renderField('site_itemid'); ?>
					<?php //echo $this->form->renderField('username'); ?>
				<?php //endif; ?>

				<br />

			<?php echo HTMLHelper::_('uitab.endTab'); ?>

			<?php echo HTMLHelper::_('uitab.endTabSet'); ?>

			<input name="current_menuitem" type="hidden" value="<?php echo Factory::getApplication()->input->getInt('Itemid'); ?>" />
			<input type="hidden" name="return" value="<?php echo $this->return_page; ?>" />
			<?php echo HTMLHelper::_('form.token'); ?>

		</fieldset>
	</form>
</div>