Plugin Directory

Changeset 1791771


Ignore:
Timestamp:
12/23/2017 07:37:32 PM (8 years ago)
Author:
eewee
Message:

1.11

  • Add deadline on opportunity
Location:
eewee-sellsy/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • eewee-sellsy/trunk/changelog

    r1790856 r1791771  
     1= 1.11 =
     2* Add deadline on opportunity
     3
    14= 1.1 =
    2 * Create table version
     5* Create table version and update version auto
    36
    47= 1.0.14 =
  • eewee-sellsy/trunk/controllers/CookieController.php

    r1790856 r1791771  
    4646        public function get()
    4747        {
     48            if (!isset($_COOKIE[$this->_name])) { return false; }
     49
    4850            $cookie = stripslashes($_COOKIE[$this->_name]);
    49 
    50             if (!isset($cookie)) { return false; }
    5151
    5252            // check cookie isn't json, delete
  • eewee-sellsy/trunk/controllers/InstallController.php

    r1790856 r1791771  
    9898              `contact_form_setting_opportunity_step` int(11) NOT NULL,
    9999              `contact_form_setting_notification_email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
     100              `contact_form_setting_deadline` int(11) NOT NULL DEFAULT '30',
    100101
    101102              `contact_form_company_name` int(11) NOT NULL,
  • eewee-sellsy/trunk/controllers/SellsyCustomFieldsController.php

    r1789048 r1791771  
    219219        }
    220220
    221 
    222221    }//fin class
    223222}//fin if
  • eewee-sellsy/trunk/controllers/ShortcodeController.php

    r1791694 r1791771  
    503503                                'funnelid'  => $contact[0]->contact_form_setting_opportunity_pipeline,
    504504                                'stepid'    => $contact[0]->contact_form_setting_opportunity_step,
    505                                 'stickyNote'=> $api_opportunity['stickyNote']
     505                                'deadline'  => $contact[0]->contact_form_setting_deadline,
     506                                'stickyNote'=> $api_opportunity['stickyNote'],
    506507                            ));
    507508                            // API : success
     
    653654                        } elseif (isset($api_third['web']) && !empty($api_third['web'])) {
    654655                            $contact_form_website = $api_third['web'];
    655                         }
     656                        } else {
     657                            $contact_form_website = "";
     658                        }
    656659
    657660                        $render .= '
  • eewee-sellsy/trunk/forms/FContactFormEdit.php

    r1790856 r1791771  
    147147                                    $t_opportunities    = new models\TSellsyOpportunities();
    148148                                    $responseOppFun     = $t_opportunities->getFunnels();
    149                                     if (isset($responseOppFun->response) && !empty($responseOppFun->response)) {
     149                                    if (isset($responseOppFun->response) && !empty($responseOppFun->response)) {
    150150                                        foreach ( $responseOppFun->response as $vOppFun ) {
    151151                                            if ( isset( $vOppFun->status ) && $vOppFun->status == 'ok' ) {
     
    197197                                </td>
    198198                            </tr>
     199                            <tr>
     200                                <th>
     201                                    <?php _e('Deadline (in days)', PLUGIN_NOM_LANG); ?> :
     202                                </th>
     203                                <td>
     204                                    <?php
     205                                    // DEADLINE
     206                                    echo '
     207                                    <input name="contact_form_setting_deadline" id="contact_form_setting_deadline" value="'.$contactForm[0]->contact_form_setting_deadline.'">
     208                                    <p class="description">'.__('Only if you use the option "add prospect and opportunity"', PLUGIN_NOM_LANG).'</p>';
     209                                    ?>
     210                                </td>
     211                            </tr>
    199212
    200213
  • eewee-sellsy/trunk/helpers/dbUpdate.php

    r1790856 r1791771  
    7373            $this->updateVersion("1.1");
    7474
    75             //$table_name = EEWEE_SELLSY_PREFIXE_BDD . 'version';
    76             //$sql = "ALTER TABLE `".$table_name."` ADD `test` VARCHAR(255) NOT NULL AFTER `version_value`";
    77             //$wpdb->query($sql);
     75            $table_name = EEWEE_SELLSY_PREFIXE_BDD . 'contact_form';
     76            $sql = "ALTER TABLE `".$table_name."` ADD ` contact_form_setting_deadline` INT(11) NOT NULL DEFAULT '30' AFTER `contact_form_setting_notification_email`;
     77            ";
     78            $wpdb->query($sql);
    7879        }
    7980
  • eewee-sellsy/trunk/index.php

    r1790856 r1791771  
    44Plugin URI: http://www.eewee.fr
    55Description: Simple form for : add support ticket to Sellsy, add prospect to Sellsy.
    6 Version: 1.1
     6Version: 1.11
    77Author: Michael DUMONTET
    88Author URI: http://www.eewee.fr/wordpress/
     
    1919 */
    2020global $wpdb;
    21 define( 'EEWEE_VERSION', '1.1' );
     21define( 'EEWEE_VERSION', '1.11' );
    2222define( 'EEWEE_SELLSY_PLUGIN_DIR',      WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
    2323define( 'EEWEE_SELLSY_PLUGIN_URL',      WP_PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) );
     
    102102
    103103use fr\eewee\eewee_sellsy\controllers;
     104use fr\eewee\eewee_sellsy\helpers;
    104105
    105106$s = new controllers\ShortcodeController();
     
    107108
    108109// UPDATE DB
    109 use fr\eewee\eewee_sellsy\helpers;
    110 $dbUpdate = new helpers\DbUpdate();
    111 $dbVersion = $dbUpdate->getVersion();
    112 if (EEWEE_VERSION > $dbVersion) { $dbUpdate->updateDb($dbVersion); }
     110if (is_admin()) {
     111    $dbUpdate = new helpers\DbUpdate();
     112    $dbVersion = $dbUpdate->getVersion();
     113    if (EEWEE_VERSION > $dbVersion) { $dbUpdate->updateDb($dbVersion); }
     114}
    113115
    114116/**
  • eewee-sellsy/trunk/models/TContactForm.php

    r1787929 r1791771  
    7878            $contact_form_setting_opportunity_pipeline  = (int)$p['contact_form_setting_opportunity_pipeline'];
    7979            $contact_form_setting_opportunity_step      = (int)$p['contact_form_setting_opportunity_step'];
    80             $contact_form_custom_fields_quantity        = (int)$p['contact_form_custom_fields_quantity'];
    81             $contact_form_custom_fields_value           = array();
    82             for ($i=0; $i<$contact_form_custom_fields_quantity; $i++) {
    83                 $contact_form_custom_fields_value[] = (int)$p['contact_form_custom_fields_value_'.$i];
     80            $contact_form_custom_fields_quantity        = 0;
     81            $contact_form_custom_fields_value_json      = "";
     82
     83            if (isset($p['contact_form_custom_fields_quantity']) && !empty($p['contact_form_custom_fields_quantity'])) {
     84                $contact_form_custom_fields_quantity = (int)$p['contact_form_custom_fields_quantity'];
     85                $contact_form_custom_fields_value = array();
     86                for ($i=0; $i<$contact_form_custom_fields_quantity; $i++) {
     87                    $contact_form_custom_fields_value[] = (int)$p['contact_form_custom_fields_value_'.$i];
     88                }
     89                $contact_form_custom_fields_value_json = json_encode($contact_form_custom_fields_value, JSON_FORCE_OBJECT);
    8490            }
    85             $contact_form_custom_fields_value_json = json_encode($contact_form_custom_fields_value, JSON_FORCE_OBJECT);
    8691
    8792            $r = $wpdb->update(
     
    98103                    'contact_form_setting_opportunity_step'     => $contact_form_setting_opportunity_step,
    99104                    'contact_form_setting_notification_email'   => $p['contact_form_setting_notification_email'],
     105                    'contact_form_setting_deadline'             => $p['contact_form_setting_deadline'],
    100106
    101107                    'contact_form_company_name'                 => $p['contact_form_company_name'],
     
    133139                    '%d',
    134140                    '%s',
     141                    '%d',
    135142
    136143                    '%d',
  • eewee-sellsy/trunk/models/TSellsyOpportunities.php

    r1787929 r1791771  
    9393            $funnelid       = (int)$d['funnelid'];
    9494            $stepid         = (int)$d['stepid'];
     95            $deadline       = (int)$d['deadline'];
    9596            $stickyNote     = (string)$d['stickyNote'];
    9697            $currentIdent   = $this->getCurrentIdent();
     
    104105                        'ident'     => $currentIdent->response,
    105106                        'sourceid'  => $sourceid,
    106                         'dueDate'   => strtotime('+1 month'), // @todo : BO custom - Ex : 1 week, 1 month
     107                        'dueDate'   => strtotime('+'.$deadline.' day'),
    107108                        //'creationDate'  => {{creationDate}},
    108109                        'name'      => $name,                       // @todo : BO custom
  • eewee-sellsy/trunk/readme.md

    r1790856 r1791771  
    442. Add a contact form shortcode (Wordpress > Sellsy prospect).
    553. Add a contact form shortcode (Wordpress > Sellsy prospect and opportunity).
     64. Tracking page views
     75. You can use the Sellsy custom fields
    68
    79Form with captcha
  • eewee-sellsy/trunk/readme.txt

    r1790856 r1791771  
    5454== Changelog ==
    5555
     56= 1.11 =
     57* Add deadline on opportunity
     58
    5659= 1.1 =
    57 * Create table version
     60* Create table version and update auto sql
    5861
    5962= 1.0.14 =
  • eewee-sellsy/trunk/view/manuel.php

    r1787929 r1791771  
    5555            echo '<u>'.__('Default setting', PLUGIN_NOM_LANG).' : </u><br>
    5656            - '.__('Prospect', PLUGIN_NOM_LANG).'<br>
    57             - '.__('Deadline: +1 month', PLUGIN_NOM_LANG).'<br>
     57            - '.__('Deadline: +30 days', PLUGIN_NOM_LANG).'<br>
    5858            - '.__('Name: website', PLUGIN_NOM_LANG).'<br>
    5959            - '.__('Probability: 10%', PLUGIN_NOM_LANG).'<br>
Note: See TracChangeset for help on using the changeset viewer.