Plugin Directory

Changeset 3356304


Ignore:
Timestamp:
09/04/2025 07:27:55 PM (7 months ago)
Author:
automaticbnb
Message:

Rilascio versione 1.27.0 di SyncBooking

Location:
syncbooking
Files:
182 added
6 edited

Legend:

Unmodified
Added
Removed
  • syncbooking/trunk/php/bar-sync/form.php

    r3355672 r3356304  
    4242$structure_data = get_option('syncbooking_website_data');
    4343$total_rooms = $structure_data['total_rooms'] ?? "";
     44$accommodation_type = $structure_data['accommodation_type'] ?? "";
     45
     46// Mappa singolare/plurale
     47$map = [
     48    'houses'   => ['sing' => 'house',   'plur' => 'houses'],
     49    'rooms'    => ['sing' => 'room',    'plur' => 'rooms'],
     50    'masserie' => ['sing' => 'masseria','plur' => 'masserie'],
     51    'suites'   => ['sing' => 'suite',   'plur' => 'suites'],
     52];
     53
     54// Default di fallback
     55$need_str = $accommodation_type;
     56
     57// Applica logica solo se l'accommodation_type è noto
     58if (isset($map[$accommodation_type])) {
     59    if ((int)$total_rooms > 1) {
     60        $need_str = $map[$accommodation_type]['plur'];
     61    } else {
     62        $need_str = $map[$accommodation_type]['sing'];
     63    }
     64}
     65
     66// Prima lettera maiuscola
     67$need_str = ucfirst($need_str);
    4468
    4569?>
     
    7094          </select>
    7195        </div>
    72         <div class="syncbooking_fields_standard_1" <?php if (intval($total_rooms) == 1) echo 'style="display:none"'; ?>>
    73           <div class="syncbooking_fieldtitle">Rooms</div><select id="syncbooking_houses" name="syncbooking_houses" data-name="syncbooking_houses" required="" class="syncbooking_select w-node-fb710099-db7c-2639-34c4-66414496ad51-32c5e373 w-select">
     96        <div class="syncbooking_fields_standard_1" <?php //if (intval($total_rooms) == 1) echo 'style="display:none"'; ?>>
     97          <div class="syncbooking_fieldtitle"><?php echo esc_html("$need_str"); ?></div><select id="syncbooking_houses" name="syncbooking_houses" data-name="syncbooking_houses" required="" class="syncbooking_select w-node-fb710099-db7c-2639-34c4-66414496ad51-32c5e373 w-select">
    7498            <option value="1">1</option>
    7599            <option value="2">2</option>
  • syncbooking/trunk/php/theme-sync/page/common_functions.php

    r3355658 r3356304  
    2121$general_gallery = $structure_data['general_gallery'] ?? "";
    2222
     23// Rooms Numner
     24$total_rooms = $structure_data['total_rooms'] ?? '';
     25$accommodation_type = $structure_data['accommodation_type'] ?? "";
     26
     27// Mappa singolare/plurale
     28$map = [
     29    'houses'   => ['sing' => 'house',   'plur' => 'houses'],
     30    'rooms'    => ['sing' => 'room',    'plur' => 'rooms'],
     31    'masserie' => ['sing' => 'masseria','plur' => 'masserie'],
     32    'suites'   => ['sing' => 'suite',   'plur' => 'suites'],
     33];
     34
     35// Default di fallback
     36$need_str = $accommodation_type;
     37
     38// Applica logica solo se l'accommodation_type è noto
     39if (isset($map[$accommodation_type])) {
     40    if ((int)$total_rooms > 1) {
     41        $need_str = $map[$accommodation_type]['plur'];
     42    } else {
     43        $need_str = $map[$accommodation_type]['sing'];
     44    }
     45}
     46
     47// Prima lettera maiuscola
     48$need_str = ucfirst($need_str);
     49
    2350//Gallery
    2451$decoded_gallery = json_decode($general_gallery, true);
     
    2855$image_4 = $decoded_gallery['4'] ?? '';
    2956$image_5 = $decoded_gallery['5'] ?? '';
    30 
    31 // Rooms Numner
    32 $total_rooms = $decoded_gallery['total_rooms'] ?? '';
    3357
    3458
  • syncbooking/trunk/php/theme-sync/page/website/include/js/js_calendar.js

    r3335386 r3356304  
    451451  }
    452452
    453   function mostra(ID) {
    454     console.log("Funzione mostra chiamata con ID:", ID);
    455 
     453function mostra(ids) {
     454  console.log("Funzione mostra chiamata con:", ids);
     455
     456  if (!ids) return;
     457
     458  // Normalizza e splitta in array
     459  const idArray = String(ids)
     460    .split(",")
     461    .map(s => s.trim())
     462    .filter(Boolean);
     463
     464  if (idArray.length === 0) {
     465    alert("Errore: nessun ID valido fornito!");
     466    return;
     467  }
     468
     469  const elements = [];
     470  const seen = new Set();
     471
     472  idArray.forEach(ID => {
    456473    const galleryContainer = document.querySelector("#galleriaJS" + ID);
    457474    if (!galleryContainer) {
    458       console.error("Errore: Galleria non trovata per ID:", ID);
    459       alert("Errore: Galleria non trovata!");
     475      console.warn("Galleria non trovata per ID:", ID);
    460476      return;
    461477    }
    462478
    463479    const links = galleryContainer.querySelectorAll("a.glightbox");
    464     console.log("Numero di immagini trovate:", links.length);
    465 
    466     if (links.length === 0) {
    467       console.error("Errore: Nessuna immagine trovata per ID:", ID);
    468       alert("Errore: Nessuna immagine trovata!");
    469       return;
    470     }
    471 
    472     const lightbox = GLightbox({ selector: ".glightbox" });
    473 
    474     console.log("Glightbox inizializzato con successo per ID:", ID);
    475 
    476     setTimeout(() => {
    477       links[0].click();
    478     }, 500);
    479   }
    480 
    481   // ✅ Rende la funzione accessibile globalmente
    482   window.mostra = mostra;
     480    console.log(`ID ${ID}: trovate ${links.length} immagini`);
     481
     482    links.forEach(a => {
     483      const href = a.getAttribute("href");
     484      if (href && !seen.has(href)) {
     485        seen.add(href);
     486        elements.push({
     487          href: href,
     488          type: "image",
     489          title: a.getAttribute("data-title") || ""
     490        });
     491      }
     492    });
     493  });
     494
     495  if (elements.length === 0) {
     496    alert("Errore: nessuna immagine trovata!");
     497    return;
     498  }
     499
     500  const lightbox = GLightbox({ elements });
     501  lightbox.open();
     502  console.log("Glightbox aperto con", elements.length, "immagini combinate.");
     503}
     504
     505// ✅ Rende la funzione accessibile globalmente
     506window.mostra = mostra;
    483507});
  • syncbooking/trunk/php/theme-sync/page/website/search.php

    r3355672 r3356304  
    3636                            </div>
    3737                            <div class="structure_selectdate" <?php if (intval($total_rooms) == 1) echo 'style="display:none"'; ?>>
    38                               <div id="house_data" class="structure_date"><label class="search_field">Number of rooms</label>
     38                              <div id="house_data" class="structure_date"><label class="search_field">Number of <?php echo esc_html("$need_str"); ?></label>
    3939                                <div><select id="house_number" name="house_number" data-name="house_number" required="" class="text_field_1 w-select">
    4040                                    <option value="1">1</option>
  • syncbooking/trunk/readme.txt

    r3355672 r3356304  
    33Requires at least: 5.0 
    44Tested up to: 6.8 
    5 Stable tag: 1.26.0 
     5Stable tag: 1.27.0 
    66Requires PHP: 7.2 
    77Contributors: automaticbnb 
  • syncbooking/trunk/sync-booking.php

    r3355672 r3356304  
    44Plugin URI: http://syncbooking.com/plugin
    55Description: Sync All Booking of your Hotel or BnB, and get new bookings!.
    6 Version: 1.26.0
     6Version: 1.27.0
    77Author: SyncBooking.com
    88Author URI: http://syncbooking.com/
     
    1717define( 'syncbooking_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    1818define( 'syncbooking_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    19 define( 'syncbooking_PLUGIN_VERSION', "1.26.0" );
     19define( 'syncbooking_PLUGIN_VERSION', "1.27.0" );
    2020
    2121global $syncbooking_structure_data;
Note: See TracChangeset for help on using the changeset viewer.