Plugin Directory

Changeset 1792771


Ignore:
Timestamp:
12/26/2017 07:21:13 PM (8 years ago)
Author:
eewee
Message:

1.12

  • Add "assigned to" and "probability" on opportunity
Location:
eewee-sellsy/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • eewee-sellsy/trunk/changelog

    r1791771 r1792771  
     1= 1.12 =
     2* Add "assigned to" and "probability" on opportunity
     3
    14= 1.11 =
    25* Add deadline on opportunity
  • eewee-sellsy/trunk/controllers/InstallController.php

    r1792769 r1792771  
    9999              `contact_form_setting_notification_email` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
    100100              `contact_form_setting_deadline` int(11) NOT NULL DEFAULT '".EEWEE_DEADLINE."',
     101              `contact_form_setting_probability` int(11) NOT NULL DEFAULT '".EEWEE_PROBABILITY."',             
     102              `contact_form_setting_linkedid` int(11) NOT NULL,
    101103
    102104              `contact_form_company_name` int(11) NOT NULL,
     
    152154        for ($i=1 ; $i<=25 ; $i++) {
    153155            $sql[] = "
    154                 INSERT INTO `" . EEWEE_SELLSY_PREFIXE_BDD . "contact_form` VALUES (".$i.", '" . current_time('mysql') . "', '" . current_time('mysql') . "', 'Contact ".$i."', '0', 'Website form ".$i."', '0', '0', '0', '" . get_bloginfo('admin_email') . "', ".EEWEE_DEADLINE.", '1', '1', '1', '1', '0', '0', '0', '1', '1', '1', '0', '0', '0', '0', '');
     156                INSERT INTO `" . EEWEE_SELLSY_PREFIXE_BDD . "contact_form` VALUES (".$i.", '" . current_time('mysql') . "', '" . current_time('mysql') . "', 'Contact ".$i."', '0', 'Website form ".$i."', '0', '0', '0', '" . get_bloginfo('admin_email') . "', ".EEWEE_DEADLINE.", ".EEWEE_PROBABILITY.", '0', '1', '1', '1', '1', '0', '0', '0', '1', '1', '1', '0', '0', '0', '0', '');
    155157            ";
    156158        }
  • eewee-sellsy/trunk/controllers/ShortcodeController.php

    r1791771 r1792771  
    498498                            $t_sellsyOpportunities = new models\TSellsyOpportunities();
    499499                            $responseOpp = $t_sellsyOpportunities->create(array(
    500                                 'linkedid'  => $tbl_contact['linkedid'],
    501                                 'sourceid'  => $contact[0]->contact_form_setting_opportunity_source,
    502                                 'name'      => $contact[0]->contact_form_setting_name_opportunity,
    503                                 'funnelid'  => $contact[0]->contact_form_setting_opportunity_pipeline,
    504                                 'stepid'    => $contact[0]->contact_form_setting_opportunity_step,
    505                                 'deadline'  => $contact[0]->contact_form_setting_deadline,
    506                                 'stickyNote'=> $api_opportunity['stickyNote'],
     500                                'linkedid'    => $tbl_contact['linkedid'],
     501                                'sourceid'    => $contact[0]->contact_form_setting_opportunity_source,
     502                                'name'        => $contact[0]->contact_form_setting_name_opportunity,
     503                                'funnelid'    => $contact[0]->contact_form_setting_opportunity_pipeline,
     504                                'stepid'      => $contact[0]->contact_form_setting_opportunity_step,
     505                                'deadline'    => $contact[0]->contact_form_setting_deadline,
     506                                'probability' => $contact[0]->contact_form_setting_probability,
     507                                'staffId'     => $contact[0]->contact_form_setting_linkedid,
     508                                'stickyNote'  => $api_opportunity['stickyNote'],
    507509                            ));
    508510                            // API : success
  • eewee-sellsy/trunk/forms/FContactFormEdit.php

    r1792769 r1792771  
    215215                                </td>
    216216                            </tr>
     217                            <tr>
     218                                <th>
     219                                    <?php _e('Probability', PLUGIN_NOM_LANG); ?> :
     220                                </th>
     221                                <td>
     222                                    <?php
     223                                    // PROBABILITY
     224                                    $probability = 0;
     225                                    if (isset($contactForm[0]->contact_form_setting_probability) && !empty($contactForm[0]->contact_form_setting_deadline)) {
     226                                        $probability = $contactForm[0]->contact_form_setting_probability;
     227                                    }
     228
     229                                    echo '
     230                                    <input name="contact_form_setting_probability" id="contact_form_setting_probability" value="'.$probability.'">
     231                                    <p class="description">'.__('Only if you use the option "add prospect and opportunity"', PLUGIN_NOM_LANG).'</p>';
     232                                    ?>
     233                                </td>
     234                            </tr>
     235                            <tr>
     236                                <th>
     237                                    <?php _e('Assigned to', PLUGIN_NOM_LANG); ?> :
     238                                </th>
     239                                <td>
     240                                    <?php
     241                                    $t_sellsyStaffs = new models\TSellsyStaffs();
     242                                    $staffsList = $t_sellsyStaffs->getStaffsList();
     243                                    if ($staffsList) {
     244                                        echo '
     245                                        <select name="contact_form_setting_linkedid">
     246                                            <option value="0">---- '.__('Nobody', PLUGIN_NOM_LANG).' ----</option>';
     247                                            foreach ($staffsList as $k => $v) {
     248                                                $selected = '';
     249                                                if ($k == $r[0]->contact_form_setting_linkedid) { $selected = 'selected'; }
     250                                                echo '<option value="'.$k.'" '.$selected.'>'.$v.'</option>';
     251                                            }
     252                                        echo '
     253                                        </select>
     254                                        <p class="description">'.__('Only if you use the option "add prospect and opportunity"', PLUGIN_NOM_LANG).'</p>';
     255                                    }
     256                                    ?>
     257                                </td>
     258                            </tr>
    217259
    218260
  • eewee-sellsy/trunk/helpers/dbUpdate.php

    r1792769 r1792771  
    4242                $dbVersion=1.11;
    4343            }
     44            if ( $dbVersion < 1.12 ) {
     45                if ($dbVersion==EEWEE_VERSION) { return EEWEE_VERSION; }
     46                $this->upgrade_1_12();
     47                $dbVersion=1.12;
     48            }
    4449        }
    4550
     
    7883
    7984            $table_name = EEWEE_SELLSY_PREFIXE_BDD . 'contact_form';
    80             $sql = "ALTER TABLE `".$table_name."` ADD `contact_form_setting_deadline` INT(11) NOT NULL DEFAULT '".EEWEE_DEADLINE."' AFTER `contact_form_setting_notification_email`;
    81             ";
     85            $sql = "ALTER TABLE `".$table_name."` ADD `contact_form_setting_deadline` INT(11) NOT NULL DEFAULT '".EEWEE_DEADLINE."' AFTER `contact_form_setting_notification_email`;";
    8286            $wpdb->query($sql);
    8387        }
    8488
     89        function upgrade_1_12()
     90        {
     91            global $wpdb;
     92            $this->updateVersion("1.12");
     93
     94            $table_name = EEWEE_SELLSY_PREFIXE_BDD . 'contact_form';
     95            $sql = "
     96            ALTER TABLE `$table_name` ADD `contact_form_setting_linkedid` INT(11) NOT NULL AFTER `contact_form_setting_deadline`;
     97            ALTER TABLE `$table_name` ADD `contact_form_setting_probability` INT(11) NOT NULL AFTER `contact_form_setting_deadline`;
     98            ";
     99            $wpdb->query($sql);
     100        }
     101
     102
     103
     104
    85105    }//fin class
    86106}//fin if
  • eewee-sellsy/trunk/index.php

    r1792769 r1792771  
    44Plugin URI: http://www.eewee.fr
    55Description: Simple form for : add support ticket to Sellsy, add prospect to Sellsy.
    6 Version: 1.11
     6Version: 1.12
    77Author: Michael DUMONTET
    88Author URI: http://www.eewee.fr/wordpress/
     
    1919 */
    2020global $wpdb;
    21 define('EEWEE_VERSION', '1.11' );
     21define('EEWEE_VERSION', '1.12' );
    2222define('EEWEE_SELLSY_PLUGIN_DIR',       WP_PLUGIN_DIR . '/' . dirname( plugin_basename( __FILE__ ) ) );
    2323define('EEWEE_SELLSY_PLUGIN_URL',       WP_PLUGIN_URL . '/' . dirname( plugin_basename( __FILE__ ) ) );
     
    3232load_plugin_textdomain(PLUGIN_NOM_LANG, false, dirname( plugin_basename( __FILE__ ) ) . '/lang');
    3333define('EEWEE_DEADLINE', 30);
     34define('EEWEE_PROBABILITY', 10);
    3435
    3536/**
  • eewee-sellsy/trunk/models/TContactForm.php

    r1791771 r1792771  
    104104                    'contact_form_setting_notification_email'   => $p['contact_form_setting_notification_email'],
    105105                    'contact_form_setting_deadline'             => $p['contact_form_setting_deadline'],
     106                    'contact_form_setting_linkedid'             => $p['contact_form_setting_linkedid'],
     107                    'contact_form_setting_probability'          => $p['contact_form_setting_probability'],
    106108
    107109                    'contact_form_company_name'                 => $p['contact_form_company_name'],
     
    139141                    '%d',
    140142                    '%s',
    141                     '%d',
     143                    '%d',
     144                    '%d',
     145                    '%d',
    142146
    143                     '%d',
     147                    '%d',
    144148                    '%d',
    145149                    '%d',
  • eewee-sellsy/trunk/models/TSellsyOpportunities.php

    r1791771 r1792771  
    9494            $stepid         = (int)$d['stepid'];
    9595            $deadline       = (int)$d['deadline'];
     96            $probability    = (int)$d['probability'];
    9697            $stickyNote     = (string)$d['stickyNote'];
    9798            $currentIdent   = $this->getCurrentIdent();
     99            $staffId        = (int)$d['staffId'];
    98100
    99101            $request = array(
     
    110112                        'funnelid'  => $funnelid,
    111113                        'stepid'    => $stepid,
    112                         'proba'     => 10,                          // @todo : BO custom
     114                        'proba'     => $probability,
    113115                        //'brief'     => {{brief}},                 // @todo : BO custom
    114116                        'stickyNote'=> $stickyNote,
    115117                        'tags'      => 'wordpress',
    116                         //'staffs'    => {{staffs}},                // @todo : BO custom
     118                        'staffs'    => array($staffId),
    117119                        //'contacts'  => {{contacts}}               // @todo : BO custom
    118120                    )
  • eewee-sellsy/trunk/readme.txt

    r1791771 r1792771  
    5353
    5454== Changelog ==
     55
     56= 1.12 =
     57* Add "assigned to" and "probability" on opportunity
    5558
    5659= 1.11 =
Note: See TracChangeset for help on using the changeset viewer.