Plugin Directory

Changeset 2857158


Ignore:
Timestamp:
01/30/2023 03:13:05 PM (3 years ago)
Author:
chuhpl
Message:

BUGFIX: Fixed the sorting for the order check out list so it's correct
BUGFIX: Changed the display in several places from post title to the Item Name

Location:
lendingq
Files:
46 added
5 edited

Legend:

Unmodified
Added
Removed
  • lendingq/trunk/lendingq.php

    r2599442 r2857158  
    44Plugin URI: https://wordpress.org/plugins/lendingq/
    55Description: A simple system to manage the lending of items (like hotspots) with an integrated waiting list.
    6 Version: 0.98
     6Version: 1.0
    77License: GPLv2 or later
    88Text Domain: lendingq
     
    981981                            $form_time = current( array_filter( $meta['form_time'] ) );
    982982                        }
    983                         #preme( $form_time );
     983                       
    984984                        $waiting_date = strtotime( date_i18n( 'Y-m-d', current( array_filter( $meta['waiting_date'] ) ) ) . ' ' . $form_time );
    985985                       
     
    10011001                    $waiting_date = $val;
    10021002                    $hold_list['dates_nice'][$key] = date_i18n( get_option('date_format'), $waiting_date ) . '<br>' . date_i18n( 'g:i:s a', $waiting_date );
    1003                 }
    1004             }
    1005            
     1003                }               
     1004            }
    10061005            return $hold_list;
    10071006        }
     
    10121011                        'post_status'    => 'any' ];
    10131012            $item_list_raw = get_posts( $args );
    1014            
     1013
    10151014            $items = [];
    10161015            foreach( $item_list_raw as $key => $val ) {
     
    10271026                                    ];
    10281027            } // END foreach( $item_list_raw as $key => $val )
     1028           
    10291029            return $items;
    10301030        }
     
    20522052           
    20532053            $hold_list = $this->get_holds();
     2054           
    20542055           
    20552056            $this->show_error();
  • lendingq/trunk/readme.txt

    r2599442 r2857158  
    3333
    3434== Changelog ==
     35= 1.0 =
     36* BUGFIX: Fixed the sorting for the order check out list so it's correct
     37* BUGFIX: Changed the display in several places from post title to the Item Name
     38
    3539= 0.98 =
    3640* BUGFIX: If you try to add a hold on an item type that isn't in the stock for that location, the hold will error and go to draft.
  • lendingq/trunk/template_check_in_list.php

    r2334348 r2857158  
    2929                }
    3030            }
     31           
    3132            uasort($holds, function($a, $b) {
    3233                 if ($a['due_date'] == $b['due_date']) {
     
    8081                    echo "                            <td class=\"column-location\">{$locations[$hval['location']]}</td>";
    8182                    echo "                            <td class=\"column-location\">{$due_date}<br>{$due_message}</td>";
    82                     echo "                            <td class=\"column-wait_date\">{$hval['name']}</td>";
     83                    echo "                            <td class=\"column-wait_date\">{$hval['item']['item_name']}</td>";
    8384                    echo "                            <td class=\"column-check-in\">";
    8485                    echo "                              <a href=\"{$check_in_link}\">".__( 'Check In', 'lendingq' )."</a>
  • lendingq/trunk/template_check_out_form.php

    r2332943 r2857158  
    7272                        $item_list = get_posts( $args );
    7373                        $available = [];
     74                        $item = $this->get_items();
     75
    7476                        foreach( $item_list as $key => $post ) {
    7577                            $temp = [];
     
    7981                            $item_type          = $item_type_raw[0]->slug;
    8082                            if( $location == $lend['location'] and $item_type == $lend['item_type'] ) {
    81                                 $available[$post->ID] = $post;   
     83                                $available[$post->ID] = $item[$post->ID][item_name];
    8284                            }
    8385                        }
     
    8789                            echo '<select name="lending_item" id="lending_item">';
    8890                            foreach( $available as $key => $val ) {
    89                                 echo "<option value=\"{$key}\">{$val->post_title}</option>";
     91                                echo "<option value=\"{$key}\">{$val}</option>";
    9092                            }
    9193                            echo '</select>';
  • lendingq/trunk/template_check_out_list.php

    r2346122 r2857158  
    2525    }
    2626}
     27
     28
     29
    2730?>
    2831<div class="wrap">
     
    122125                    # make a list of hold IDS to sort by waiting date
    123126                    $hold_ids       = array_column( $cur_holds, 'waiting_date', 'post_id' );
    124                     ksort( $hold_ids );
     127                   
     128                    asort( $hold_ids );
    125129                    $on_deck_ids    = array_slice( $hold_ids, count( $cur_stock ), null, TRUE );
    126130                    $hold_ids       = array_slice( $hold_ids, 0, count( $cur_stock ), TRUE );
Note: See TracChangeset for help on using the changeset viewer.