Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: isOwner and Availability addon

  1. #1
    Join Date
    Mar 2004
    Age
    99
    Posts
    207

    Default isOwner and Availability addon

    Hi there,
    I am just finishing adapting http://www.cbolson.com/code/availability-calendar/ as a free availability addon and am rusty with OR code. Is their a quick and easy isOwner permission tag? I want to let a listing agent update his calendar on the public side, but seem to remember {check_agent} allows all agents to see info.

    Will be adding two availability searches later, one to show all listings that have no bookings inside a defined date period and a second to show all listings that have available days inside a defined date period.

    When the addon is finished all users who like it should donate something to Chris because he has written a really neat script.

    If there is such a template tag I would also like to look at creating something like the Spip 'crayons' addon so that listing agents could also edit individual fields directly on the public side. ............ unless someone has done this.

    Will post the addon as soon as it is finished.

    Best,
    Rob

  2. #2
    Join Date
    Mar 2004
    Age
    99
    Posts
    207

    Default Re: isOwner and Availability addon

    Have bodged it using
    <<$listingagentid = listing_pages::getListingAgentID($listing_id);
    $userid = $_SESSION['userID'];
    if ($_SESSION['edit_all_listings'] == 'yes' || $_SESSION['admin_privs'] == 'yes') {
    $day_link_start ='<a href="#" onclick="ajax_mod_state(\''.$id.'\',\''.$this_date .'\',\''.$day_counter.'\',event); return false" title="'.$slang["modify_availability_for"].' '.$slang["day_".$week_day.""].' '. $date_format.'" class="cal_day">';
    $day_link_end ='</a>';
    } elseif (($_SESSION['isAgent'] == 'yes') && ($listingagentid == $userid)) >>

    But would prefer something slicker, surely there is a form of permission tag in OR?

    Best,
    Rob

    Had to change $listingagentid = listing_pages::getListingAgentID($listing_id); to $listingagentid = listing_pages::getListingAgentID($listingID);

    And now it works. Will tidy it up and release it

  3. #3
    Join Date
    Mar 2004
    Age
    99
    Posts
    207

    Smile Ajax Availabilty Calendar Demo

    Hi,
    It is now done and can be picked up here
    http://support.open-realty.org/showthread.php?t=22022
    You can try it online at http://www.betterlets.com/listing-the-chateau-1.html

    login as bloggs pass bloggs and you can edit availability on the public page, logout and refresh and the calendar is uneditable.

    Best,
    Rob

  4. #4
    Join Date
    Dec 2004
    Location
    German, since 2000 in Spain
    Age
    51
    Posts
    826

    Default Re: Ajax Availabilty Calendar Demo

    Hi Rob,

    excellent idea/work!
    Thanks a lot for this very simple to use avbl. calendar!!

    cheers,
    Gregor

  5. #5
    Join Date
    Aug 2009
    Posts
    11

    Default Ajax Availabilty Calendar Demo

    Hi
    the download link does not seem to work. Please could you repost ?
    thanks

  6. #6
    Join Date
    Mar 2004
    Posts
    17

    Smile Re: isOwner and Availability addon

    Hi Rob

    Well done, really cool addon, I have been playing around with it and works really well.

    But having trouble when trying to get it to work in Spanish language, i have the es.lang.php file in the lang folder.

    In config_inc.php I changed to show Spanish rather than English: -

    // default lang to use - lang file MUST exist in "lang" folder (currently "en" or "es" )
    //define("DEFAULT_LANG", "en"); # english
    define("DEFAULT_LANG", "es"); # spanish

    But it still uses the English lang file, I tried changing the title in the Eng lang file and it does change on the Calendar display, so it is still picking up that from the eng lang file rather than the Spanish one, again in the English file if you for instance change January to Enero in the month array is still shows January on the calendar.

    So not sure if it is something I am doing wrong or a bug.

    Thanks

    Jez

  7. #7
    Join Date
    Mar 2004
    Age
    99
    Posts
    207

    Default Re: isOwner and Availability addon

    Hi there,
    No it is not a bug, just lazy writing by me However will be completely redoing the addon with a lot of new functions + admin panel options, so am not going to change the existing one.
    Change the months and days names in functions.inc.php,
    here
    function draw_cal($id,$month, $year, $booked_days,$show_link){
    global $config, $current_ID, $conn, $slang;

    $slang=array();
    $slang["months"] = array("January","February","March","April","May"," June","July","August","September","October","Novem ber","December");
    $slang["days"] = array("Sunday","Monday","Tuesday","Wednesday","Thu rsday","Friday","Saturday");

    Best,
    Rob

  8. #8
    Join Date
    Mar 2004
    Age
    99
    Posts
    207

    Default Version 3

    There is a new release in the free addons thread
    http://support.open-realty.org/showthread.php?t=22022

    This includes better documentation but more importantly now works with the new addon manager functions.

    I have done nothing on the languages side etc as there will be a much fuller rewrite in the hear feature with an admin panel etc.

    Best,
    Rob

  9. #9
    Join Date
    Jun 2004
    Posts
    93

    Default Re: isOwner and Availability addon

    Thank you....just what i was needing for a client project!

  10. #10
    Join Date
    Mar 2004
    Age
    99
    Posts
    207

    Default Re: isOwner and Availability addon

    Good!
    that is what it is for.
    Think of making a paypal donation to Chris Big or small he merits it.
    He spent a lot of time devising the original light but effectivr script, and mention open realty at the same time.

    Best,
    rob

Similar Threads

  1. Availability Calendar?
    By vrwired in forum Addon help, ideas and discussion (CLOSED)
    Replies: 2
    Last Post: 07-09-2008, 02:32 AM
  2. Availability Calendar
    By Burtie in forum Addon help, ideas and discussion (CLOSED)
    Replies: 3
    Last Post: 10-18-2006, 10:45 AM
  3. Availability calendar
    By Shile in forum Addon help, ideas and discussion (CLOSED)
    Replies: 16
    Last Post: 01-17-2006, 05:40 PM
  4. Availability Mod
    By lasor in forum Mods (CLOSED)
    Replies: 3
    Last Post: 01-10-2005, 08:12 PM
  5. Rental Availability
    By pedro in forum HELP (CLOSED)
    Replies: 3
    Last Post: 01-21-2004, 11:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •