Plugin Directory

Changeset 1817159


Ignore:
Timestamp:
02/07/2018 09:39:26 AM (8 years ago)
Author:
tresrl
Message:

HQ60 Fidelity Card - V 1.7

Location:
hq60-fidelity-card/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • hq60-fidelity-card/trunk/hq60fidelitycard.php

    r1812663 r1817159  
    77Author: TRe Technology And Research S.r.l
    88Author URI: http://www.tresrl.it
    9 Version: 1.6.1
     9Version: 1.7
    1010License: GPL-2.0+
    1111*/
  • hq60-fidelity-card/trunk/readme.txt

    r1812663 r1817159  
    33Tags:
    44Requires at least: 4.8.2
    5 Tested up to: 4.9.2
    6 Stable tag: 1.6.1
     5Tested up to: 4.9.4
     6Stable tag: 1.7
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2626
    2727== Changelog ==
     28
     29= 1.7 =
     30* Visible la lista delle registrazioni non (ancora) confermate
    2831
    2932= 1.6.1 =
  • hq60-fidelity-card/trunk/src/Hq60fidelitycard/Admin/AdminMenu.php

    r1801667 r1817159  
    5151        parent::__construct($base_directory_plugin , $plugin_basename , $plugin_dir_url);
    5252       
     53        /*
     54         * Activate the action hooks
     55         */
     56        $this->perform_action_hooked_action();
     57       
     58        /*
     59         * Activate the filter hooks
     60         */
     61        $this->perform_filter_hooked_action();
     62       
    5363        // add the link to the settings dashboard
    5464        // see below for detail
     
    7080     */
    7181    /*********************************************************************************/
     82   
     83   
     84    /**
     85     * Perform all actions
     86     *
     87     * @since 1.7
     88     */
     89    private function perform_action_hooked_action() {
     90       
     91        // add other columns to the table on edit.php
     92        add_action('manage_hq60_temp_reg_cp_posts_custom_column' , array ( $this , 'add_content_to_unconfirmed_list'));
     93   
     94    }
     95   
     96    /**
     97     * Perform all hooks for filters
     98     *
     99     * @since 1.7
     100     */
     101    private function perform_filter_hooked_action() {
     102       
     103        // add columns
     104        add_filter('manage_hq60_temp_reg_cp_posts_columns' , array ( $this , 'add_columns_to_unconfirmed_list'));
     105       
     106        // add sortable functions
     107        //add_filter('manage_edit-simplestform_cp_sortable_columns' , array ( $this , 'add_sortable_to_summary_custom_post'));
     108       
     109        //add settings to link on plugin page
     110        //add_filter('plugin_action_links_'.$this->get_base_plugin_name() , array ( $this , 'add_link_settings_to_plugin_page' ));
     111       
     112    }
    72113   
    73114    /**
     
    118159        $this->add_submenu_page_shortcode_list();
    119160        $this->add_submenu_page_custom_post_temp_registration();
    120                
    121         //add_menu_page( $page_title , $menu_title , $capable_option , $slug , $function_callback , $icon , $priority  );
    122        
    123         //add_submenu_page( string $parent_slug, string $page_title, string $menu_title, string $capability, string $menu_slug, callable $function = '' );
    124        
    125         /*add_submenu_page(
    126                             $parent_slug,
    127                             $page_title,
    128                             $menu_title,
    129                             $capable_option,
    130                             $slug,
    131                             $function_callback
    132                         );*/
    133161       
    134162     }
     
    237265    }
    238266   
     267    /**
     268     *
     269     * Filter for add columns to summary custom post.
     270     *
     271     * Callback from perform_filter_hooked_action
     272     *
     273     * @since 1.7
     274     */
     275    public function add_columns_to_unconfirmed_list( $columns ) {
     276       
     277        // New columns to add to table
     278        $new_columns = array(
     279            $this->get_custom_post_name().'-card' => __( 'Card', $this->get_language_domain() ),
     280            $this->get_custom_post_name().'-email' => __( 'Email', $this->get_language_domain() ),
     281            $this->get_custom_post_name().'-privacy' => __( 'Privacy', $this->get_language_domain() ),
     282            $this->get_custom_post_name().'-privacy-art-4' => __( 'Privacy ART 4', $this->get_language_domain() ),
     283            $this->get_custom_post_name().'-privacy-art-5' => __( 'Privacy ART 5', $this->get_language_domain() ),
     284            $this->get_custom_post_name().'-date' => __( 'Data', $this->get_language_domain() ),
     285            //$this->get_custom_post_name().'-confirmed-on' => __( 'Confermato il', $this->get_language_domain() ),
     286           
     287        );
     288       
     289        // Remove CB. The del box!
     290        unset( $columns['cb'] );
     291       
     292        // Remove title column
     293        unset( $columns['title'] );
     294       
     295        // Remove unwanted publish date column
     296        unset( $columns['date'] );
     297         
     298        // Combine existing columns with new columns
     299        $filtered_columns = array_merge( $columns, $new_columns );
     300       
     301        // Return our filtered array of columns
     302        return $filtered_columns;
     303       
     304    }
     305   
     306    /**
     307     *
     308     * Filter for add content to columns to summary custom post.
     309     *
     310     * Callback from perform_action_hooked_action
     311     *
     312     * @since 1.7
     313     */
     314    public function add_content_to_unconfirmed_list( $columns ) {
     315       
     316        // Get the post object for this row so we can output relevant data
     317        global $post;
     318 
     319        // Check to see if $column matches our custom column names
     320        switch ( $columns ) {
     321           
     322                case $this->get_custom_post_name().'-card' :
     323                    // Retrieve post meta
     324                    $value = get_post_meta( $post->ID , $this->get_custom_post_name().'-card-number' , true );
     325     
     326                    // Echo output and then include break statement
     327                    if ( !empty($value) ) {
     328                       
     329                        echo $value;
     330                       
     331                    }
     332                   
     333                break;
     334               
     335                case $this->get_custom_post_name().'-email' :
     336                    // Retrieve post meta
     337                    $value = get_post_meta( $post->ID , $this->get_custom_post_name().'-email' , true );
     338     
     339                    // Echo output and then include break statement
     340                    if ( !empty($value) ) {
     341                       
     342                        echo $value;
     343                       
     344                    }
     345                   
     346                break;
     347               
     348                case $this->get_custom_post_name().'-privacy' :
     349                    // Retrieve post meta
     350                    $value = get_post_meta( $post->ID , $this->get_custom_post_name().'-privacy' , true );
     351     
     352                    // Echo output and then include break statement
     353                    if ( !empty($value) ) {
     354                       
     355                        if ( $value == 1) {
     356                           
     357                            $value = _e( 'Si' , $this->get_language_domain() );
     358                           
     359                        } else {
     360                           
     361                            $value = _e( 'No' , $this->get_language_domain() );
     362                           
     363                        }
     364                       
     365                    }
     366                   
     367                break;
     368               
     369                case $this->get_custom_post_name().'-privacy-art-4' :
     370                    // Retrieve post meta
     371                    $value = get_post_meta( $post->ID , $this->get_custom_post_name().'-privacy-art-4' , true );
     372                   
     373                    // Echo output and then include break statement
     374                    if ( !empty($value) ) {
     375                       
     376                        if ( $value == 1) {
     377                           
     378                            $value = _e( 'Si' , $this->get_language_domain() );
     379                           
     380                        } else {
     381                           
     382                            $value = _e( 'No' , $this->get_language_domain() );
     383                           
     384                        }
     385                       
     386                    } else {
     387                       
     388                        $value = _e( 'No' , $this->get_language_domain() );
     389                       
     390                    }
     391                   
     392                break;
     393               
     394                case $this->get_custom_post_name().'-privacy-art-5' :
     395                    // Retrieve post meta
     396                    $value = get_post_meta( $post->ID , $this->get_custom_post_name().'-privacy-art-5' , true );
     397     
     398                    // Echo output and then include break statement
     399                    if ( !empty($value) ) {
     400                       
     401                        if ( $value == 1) {
     402                           
     403                            $value = _e( 'Si' , $this->get_language_domain() );
     404                           
     405                        } else {
     406                           
     407                            $value = _e( 'No' , $this->get_language_domain() );
     408                           
     409                        }
     410                       
     411                    } else {
     412                       
     413                        $value = _e( 'No' , $this->get_language_domain() );
     414                       
     415                    }
     416                   
     417                break;
     418               
     419                case $this->get_custom_post_name().'-confirmed-on' :
     420                    // Retrieve post meta
     421                    $value = get_post_meta( $post->ID , $this->get_custom_post_name().'-confirmed-on' , true );
     422     
     423                    // Echo output and then include break statement
     424                    if ( !empty($value) ) {
     425                       
     426                        echo $value;
     427                       
     428                    }
     429                   
     430                break;
     431               
     432               
     433                case $this->get_custom_post_name().'-date' :
     434                    // Retrieve post meta
     435                    $value = get_the_date('d-m-Y H:i');
     436     
     437                    echo $value;
     438                   
     439                break;
     440     
     441            }
     442       
     443    }
     444   
    239445    /*********************************************************************************/
    240446    /**
  • hq60-fidelity-card/trunk/views/frontend/user-balance.php

    r1812663 r1817159  
    9090            if ( isset ( $balance->balance ) ) {
    9191               
    92                 if ( is_object ( $balance->balance ) && ( count ( (array)$balance->balance ) > 0 ) ) {
     92                if ( is_array ( $balance->balance ) && ( count ( $balance->balance ) > 0 ) ) {
    9393                   
    9494                    ?>
     
    115115                                   
    116116                                    <td><?php echo $bal->item ;?></td>
    117                                     <td><?php echo number_format_i18n( $bal->balance, $decimals ) ;?></td>
     117                                    <td><strong><?php echo number_format_i18n( $bal->balance, $decimals ) ;?></strong></td>
    118118                                   
    119119                                </tr>
     
    129129                        </tbody>
    130130                    </table>
     131                   
     132                    <hr />
    131133                       
    132134                        <?php
Note: See TracChangeset for help on using the changeset viewer.