Plugin Directory

Changeset 1389114


Ignore:
Timestamp:
04/07/2016 08:50:25 AM (10 years ago)
Author:
Sadesign
Message:

send to mgtsk only if 'mail_sent'
log file destination
add dependencies plugin check ...

Location:
cf7-mgtsk-add/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cf7-mgtsk-add/trunk/cf7_mgtsk_add.php

    r1388987 r1389114  
    33/*
    44  Plugin Name: Мегатаск [WPCF]
     5  Depends: Contact From 7
    56  Description: Плагин для интеграции CMS Wordpress и CRM Мегаплана. Работает как дополнение к основному плагину contactform7. Все формы, созданные через плагин, автоматически интегрируются с вашей CRM.
    67  Version: 1.0
     
    1314 */
    1415
    15 register_activation_hook(__FILE__, array('cf7_mgtsk_add', 'on_activation'));
     16
     17/**
     18 *  Activation Class
     19 **/
     20if (!class_exists('cf7_mgtsk_add_install')) {
     21  class cf7_mgtsk_add_install
     22  {
     23    static function install()
     24    {
     25      if (!in_array('contact-form-7/wp-contact-form-7.php', apply_filters('active_plugins', get_option('active_plugins')))) {
     26
     27        // Deactivate the plugin
     28        deactivate_plugins(__FILE__);
     29
     30        // Throw an error in the wordpress admin console
     31        $error_message = __('Contact From 7 is not installed', 'cf7_mgtsk_add');
     32        wp_die($error_message);
     33
     34      }
     35    }
     36  }
     37}
     38
     39register_activation_hook(__FILE__, array('cf7_mgtsk_add_install', 'install'));
    1640
    1741class cf7_mgtsk_add
     
    2044  public function __construct()
    2145  {
    22     add_action('admin_init', array($this, 'addClasses'));
    2346    add_action('init', array($this, 'addClasses'));
    2447
     
    3659
    3760    require_once __DIR__ . '/cf7_mgtsk_add_filters.php';
     61    file_put_contents(__DIR__ . "/cf7_mgtsk_add.log", '');
    3862  }
    3963
     
    5175      require_once($file);
    5276    }
    53   }
    54 
    55   public static function on_activation()
    56   {
    57     if (!current_user_can('activate_plugins'))
    58       return;
    59     $plugin = isset($_REQUEST['plugin']) ? $_REQUEST['plugin'] : '';
    60     check_admin_referer("activate-plugin_{$plugin}");
    61 
    62     file_put_contents(WP_PLUGIN_DIR . "/cf7_mgtsk_add/cf7_mgtsk_add.log", '');
    6377  }
    6478
     
    294308  {
    295309    $use_mgtsk = get_post_meta($object->id(), 'use_mgtsk', true);
    296     if (!empty($use_mgtsk)) {
     310    if (!empty($use_mgtsk) && $result['status'] == 'mail_sent') {
    297311      $fields = cf7_mgtsk_Helper::cleanFormContent($object->prop('form'));
    298312      $valueCommentRaw[] = array(
     
    366380        if (!empty($mgtskOption['mgtsk_log'])) {
    367381          file_put_contents(
    368             WP_PLUGIN_DIR . "/cf7_mgtsk_add/cf7_mgtsk_add.log",
     382            __DIR__ . "/cf7_mgtsk_add.log",
    369383            date('l jS \of F Y h:i:s A') . ': ' . $url . ': ' . serialize(array('method' => 'POST', 'body' => $body)) . PHP_EOL . PHP_EOL,
    370384            FILE_APPEND
     
    397411    />
    398412    <?php
    399     if(!empty($val['description'])) {
     413    if (!empty($val['description'])) {
    400414      echo '<p>' . $val['description'] . '</p>';
    401415    }
  • cf7-mgtsk-add/trunk/languages/cf7_mgtsk_add-ru_RU.po

    r1388987 r1389114  
    55"POT-Creation-Date: Thu Mar 24 2016 15:33:51 GMT+0300 (Московское "
    66"время (зима))\n"
    7 "PO-Revision-Date: Tue Apr 05 2016 11:27:19 GMT+0300 (Московское "
     7"PO-Revision-Date: Thu Apr 07 2016 11:18:15 GMT+0300 (Московское "
    88"время (зима))\n"
    99"Last-Translator: admin <sn@sadesign.pro>\n"
     
    2626"X-Generator: Loco - https://localise.biz/"
    2727
     28#. Name of the plugin
     29msgid "Мегатаск [WPCF]"
     30msgstr ""
     31
     32#. Description of the plugin
     33msgid ""
     34"Плагин для интеграции CMS Wordpress и CRM Мегаплана. Работает как дополнение "
     35"к основному плагину contactform7. Все формы, созданные через плагин, "
     36"автоматически интегрируются с вашей CRM."
     37msgstr ""
     38
    2839#. Author of the plugin
    2940msgid "sadesign"
     
    3445msgstr ""
    3546
    36 #: ../cf7_mgtsk_add.php:143
     47#: ../cf7_mgtsk_add.php:31
     48msgid "Contact From 7 is not installed"
     49msgstr "Плагин Contact From 7 не установлен"
     50
     51#: ../cf7_mgtsk_add.php:108
     52msgid "cf7_mgtsk_add Page Title"
     53msgstr "Мегатаск [WPCF]"
     54
     55#: ../cf7_mgtsk_add.php:109
     56msgid "cf7_mgtsk_add Menu Title"
     57msgstr "Мегатаск [WPCF]"
     58
     59#: ../cf7_mgtsk_add.php:136
     60msgid "cf7_mgtsk_add Page H1"
     61msgstr "Мегатаск [WPCF]"
     62
     63#: ../cf7_mgtsk_add.php:157
    3764msgid "cf7_mgtsk_add Log Page H1"
    3865msgstr "Журнал сообщений"
    3966
    40 #: ../cf7_mgtsk_add.php:189
     67#: ../cf7_mgtsk_add.php:181
     68msgid "Key MGTSK"
     69msgstr "Введите ключ MGTSK"
     70
     71#: ../cf7_mgtsk_add.php:194
     72msgid "Write log"
     73msgstr "Вести лог?"
     74
     75#: ../cf7_mgtsk_add.php:203
    4176#, php-format
    4277msgid "go to <a href=\"%s\">log page</a>"
    4378msgstr "Перейти на <a href=\"%s\">страницу логирования</a>"
    4479
    45 #. Name of the plugin
    46 msgid "cf7_mgtsk_add"
    47 msgstr "Мегатаск [WPCF]"
    48 
    49 #: ../cf7_mgtsk_add.php:94
    50 msgid "cf7_mgtsk_add Page Title"
    51 msgstr "Мегатаск [WPCF]"
    52 
    53 #: ../cf7_mgtsk_add.php:95
    54 msgid "cf7_mgtsk_add Menu Title"
    55 msgstr "Мегатаск [WPCF]"
    56 
    57 #: ../cf7_mgtsk_add.php:122
    58 msgid "cf7_mgtsk_add Page H1"
    59 msgstr "Мегатаск [WPCF]"
    60 
    61 #: ../cf7_mgtsk_add.php:167
    62 msgid "Key MGTSK"
    63 msgstr "Введите ключ MGTSK"
    64 
    65 #: ../cf7_mgtsk_add.php:180
    66 msgid "Write log"
    67 msgstr "Вести лог?"
    68 
    69 #: ../cf7_mgtsk_add.php:203
     80#: ../cf7_mgtsk_add.php:217
    7081msgid "Settings Box title"
    7182msgstr "Настройки плагина"
    7283
    73 #: ../cf7_mgtsk_add.php:206
     84#: ../cf7_mgtsk_add.php:220
    7485msgid "cf7_mgtsk_add settings"
    7586msgstr ""
     
    8192"распределить типы событий и&nbsp;ответственных.</p>"
    8293
    83 #: ../cf7_mgtsk_add.php:299
     94#: ../cf7_mgtsk_add.php:313
    8495msgid "form_title"
    8596msgstr "Название формы"
    8697
    87 #: ../cf7_mgtsk_add.php:341
     98#: ../cf7_mgtsk_add.php:355
    8899msgid "other_email"
    89100msgstr "Другие адреса e-mail"
    90101
    91 #: ../cf7_mgtsk_add.php:349
     102#: ../cf7_mgtsk_add.php:363
    92103msgid "other_phone"
    93104msgstr "Другие номера телефона"
  • cf7-mgtsk-add/trunk/readme.txt

    r1388987 r1389114  
    19192. Административная страница плагина Мегатаск [WPCF]
    20203. Задача, автоматически созданная в CRM Мегаплан
    21 4. Задачи в истории клиента
     214. Задачи и сделки в истории клиента
    22225. Административная страница интеграции в сервисе Мегатаск
Note: See TracChangeset for help on using the changeset viewer.