Changeset 988019
- Timestamp:
- 09/12/2014 07:35:08 AM (12 years ago)
- Location:
- mgrt/trunk
- Files:
-
- 16 edited
-
Mgrt/Wordpress/Manager/DataManager.php (modified) (1 diff)
-
Mgrt/Wordpress/Manager/ViewManager.php (modified) (1 diff)
-
Mgrt/Wordpress/Sync/ExportSyncProcessor.php (modified) (3 diffs)
-
Mgrt/Wordpress/Sync/ImportSyncProcessor.php (modified) (1 diff)
-
Mgrt/Wordpress/View/Profile.php (modified) (2 diffs)
-
Mgrt/Wordpress/View/Start.php (modified) (1 diff)
-
assets/js/mgrt.js (modified) (3 diffs)
-
mgrt.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (3 diffs)
-
vendor/mgrt/mgrt-php/.git/index (modified) (previous)
-
vendor/mgrt/mgrt-php/.git/logs/HEAD (modified) (1 diff)
-
vendor/mgrt/mgrt-php/.git/logs/refs/heads/master (modified) (1 diff)
-
vendor/mgrt/mgrt-php/.git/logs/refs/remotes/composer/master (modified) (1 diff)
-
vendor/mgrt/mgrt-php/.git/logs/refs/remotes/origin/HEAD (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mgrt/trunk/Mgrt/Wordpress/Manager/DataManager.php
r986149 r988019 37 37 'public_key' => $this->getApiKey(), 38 38 'private_key' => $this->getApiSecret(), 39 'base_url' => '{scheme}://{hostname}', 40 'hostname' => MGRT__API, 41 'scheme' => MGRT__API_USE_HTTPS ? 'https' : 'http' 39 'hostname' => MGRT__API 42 40 )); 43 41 } -
mgrt/trunk/Mgrt/Wordpress/Manager/ViewManager.php
r986149 r988019 122 122 } 123 123 124 public function getViewKey($view) 125 { 126 $this->initView($view); 127 if (isset($this->loaded[$view])) { 128 return $this->loaded[$view]->getViewKey(); 129 } 130 } 131 132 public function getViewName($view) 133 { 134 $this->initView($view); 135 if (isset($this->loaded[$view])) { 136 return $this->loaded[$view]->getViewName(); 137 } 138 } 139 124 140 /** 125 141 * Display a specific view/action -
mgrt/trunk/Mgrt/Wordpress/Sync/ExportSyncProcessor.php
r986149 r988019 244 244 } 245 245 246 if (!empty($fields[Profile::getViewKey()])) { 246 $viewKey = $this->getViewManager()->getViewKey('Profile'); 247 248 if (!empty($fields[$viewKey])) { 247 249 if (!($additional_fields = $this->getDataManager()->getOption('custom_fields_additional'))) { 248 250 $additional_fields = array(); … … 251 253 foreach ($additional_fields as $fieldId) { 252 254 253 if (empty($fields[ Profile::getViewKey()][Profile::FIELD_KEY.$fieldId])) {255 if (empty($fields[$viewKey][Profile::FIELD_KEY.$fieldId])) { 254 256 if ($overwrite) { 255 $fields[ Profile::getViewKey()][Profile::FIELD_KEY.$fieldId] = '';257 $fields[$viewKey][Profile::FIELD_KEY.$fieldId] = ''; 256 258 } else { 257 259 continue; … … 261 263 $customFields[] = (new CustomField()) 262 264 ->setId(intval($fieldId)) 263 ->setValue($fields[ Profile::getViewKey()][Profile::FIELD_KEY.$fieldId]);265 ->setValue($fields[$viewKey][Profile::FIELD_KEY.$fieldId]); 264 266 } 265 267 } -
mgrt/trunk/Mgrt/Wordpress/Sync/ImportSyncProcessor.php
r986149 r988019 60 60 public function onCreate(Contact $contact, $overwrite = true) 61 61 { 62 $ u= get_user_by('email', $contact->getEmail());63 if ($ u=== false) {62 $wp_id = get_user_by('email', $contact->getEmail()); 63 if ($wp_id === false) { 64 64 $wp_id = wp_create_user($contact->getEmail(), $contact->getEmail()); 65 } 65 if (!is_int($wp_id)) { 66 return false; 67 } 68 } else { 69 $wp_id = $wp_id->ID; 70 } 71 66 72 if ($contact->getEmail() == 'alexandre@yzalis.com') { 67 73 return $wp_id; -
mgrt/trunk/Mgrt/Wordpress/View/Profile.php
r986149 r988019 39 39 const DATE_PATTERN = '/^(\d{4})-(\d{2})-(\d{2})$/'; 40 40 41 public function getFieldKey()41 public static function getFieldKey() 42 42 { 43 43 return self::FIELD_KEY; 44 } 45 46 public function getViewKey() 47 { 48 return MGRT__OPTION_KEY.'-profile'; 49 } 50 51 public function getViewName() 52 { 53 return 'Profile'; 44 54 } 45 55 … … 81 91 return; 82 92 } 83 }84 85 public function getViewKey()86 {87 return MGRT__OPTION_KEY.'-profile';88 }89 90 public function getViewName()91 {92 return 'Profile';93 93 } 94 94 -
mgrt/trunk/Mgrt/Wordpress/View/Start.php
r986149 r988019 261 261 </span> 262 262 <select name="<?php echo $this->getViewKey().'[custom_fields]['.$wp_field_name.']' ?>"> 263 <option value="-1"<?php echo -1 == $enabled_custom_fields[$wp_field_name] ? ' selected="selected"' : ''?>><?php _e('form.sync.field.custom.ignore', 'mgrt-wordpress') ?></option>263 <option value="-1"<?php echo (isset($enabled_custom_fields[$wp_field_name]) && (-1 == $enabled_custom_fields[$wp_field_name]) ? ' selected="selected"' : '') ?>><?php _e('form.sync.field.custom.ignore', 'mgrt-wordpress') ?></option> 264 264 <?php foreach ($this->custom_fields as $custom_field): ?> 265 <option value="<?php echo $custom_field->getId() ?>"<?php echo $custom_field->getId() == $enabled_custom_fields[$wp_field_name] ? ' selected="selected"' : ''?>><?php echo $custom_field->getName() ?></option>265 <option value="<?php echo $custom_field->getId() ?>"<?php echo (isset($enabled_custom_fields[$wp_field_name]) && ($custom_field->getId() == $enabled_custom_fields[$wp_field_name]) ? ' selected="selected"' : '') ?>><?php echo $custom_field->getName() ?></option> 266 266 <?php endforeach; ?> 267 267 </select> -
mgrt/trunk/assets/js/mgrt.js
r986149 r988019 66 66 67 67 var animations_duration = 1000; 68 var first_state = '';69 var current_pass;70 68 var total_users = 0; 71 69 var current_users = 0; … … 97 95 return; 98 96 } 99 console.log(r); 97 100 98 times = times.concat(r.times); 101 99 console.log(moy(times) + 's per contact'); 102 100 103 if (first_state == '') { 104 first_state = r.last_recall.mode; 105 current_pass = r.last_recall.mode; 106 } 107 if (current_pass != r.last_recall.mode && r['continue']) { 108 current_pass = r.last_recall.mode; 101 current_users += r.count; 102 prettyCounter(jQuery('#'+(r.last_recall.sequence == 0 ? 'first' : 'second')+'-pass span'), current_users); 103 104 if (r.next_recall.mode != r.last_recall.mode && r['continue']) { 109 105 total_users = current_users; 110 106 current_users = 0; … … 114 110 console.log('Next step'); 115 111 } 116 117 current_users += r.count;118 prettyCounter(jQuery('#'+(r.last_recall.sequence == 0 ? 'first' : 'second')+'-pass span'), current_users);119 112 120 113 if (r['continue']) { -
mgrt/trunk/mgrt.php
r986149 r988019 19 19 define('MGRT__PLUGIN_DIR', plugin_dir_path(__FILE__)); 20 20 define('MGRT__PLUGIN_DIR_REL', dirname(plugin_basename(__FILE__)) . '/'); 21 define('MGRT__API', 'api.mgrt.net'); 22 define('MGRT__API_USE_HTTPS', true); 21 @define('MGRT__API', 'api.mgrt.net'); 23 22 define('MGRT__OPTION_KEY', 'mgrt-settings'); 24 23 define('MGRT__WEBHOOK_NAME', 'mgrt_webhook_wordpress'); -
mgrt/trunk/readme.txt
r986582 r988019 1 1 === Mgrt for Wordpress === 2 Contributors: mgrt 2 3 Tags: mgrt,email,campaign,link 3 4 Requires at least: 3.0.1 4 5 Tested up to: 4.0 5 6 Stable tag: trunk 6 Contributors: mgrt7 7 License: MIT 8 8 License URI: http://opensource.org/licenses/mit-license.php … … 11 11 12 12 == Description == 13 Mgrt for Wordpress allows you to sync your website \'s database with Mgrt. Just enter your API key and API secret, and you\'re done!13 Mgrt for Wordpress allows you to sync your website's database with Mgrt. Just enter your API key and API secret, and you're done! 14 14 15 15 This plugin adds two shortcodes, and two widgets for you. -
mgrt/trunk/vendor/autoload.php
r986149 r988019 5 5 require_once __DIR__ . '/composer' . '/autoload_real.php'; 6 6 7 return ComposerAutoloaderInit 9dfb9bf072c528104682014c183f7470::getLoader();7 return ComposerAutoloaderInitdea41aaff7a9ac591f8543b489dce4c1::getLoader(); -
mgrt/trunk/vendor/composer/autoload_real.php
r986149 r988019 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 9dfb9bf072c528104682014c183f74705 class ComposerAutoloaderInitdea41aaff7a9ac591f8543b489dce4c1 6 6 { 7 7 private static $loader; … … 20 20 } 21 21 22 spl_autoload_register(array('ComposerAutoloaderInit 9dfb9bf072c528104682014c183f7470', 'loadClassLoader'), true, true);22 spl_autoload_register(array('ComposerAutoloaderInitdea41aaff7a9ac591f8543b489dce4c1', 'loadClassLoader'), true, true); 23 23 self::$loader = $loader = new \Composer\Autoload\ClassLoader(); 24 spl_autoload_unregister(array('ComposerAutoloaderInit 9dfb9bf072c528104682014c183f7470', 'loadClassLoader'));24 spl_autoload_unregister(array('ComposerAutoloaderInitdea41aaff7a9ac591f8543b489dce4c1', 'loadClassLoader')); 25 25 26 26 $map = require __DIR__ . '/autoload_namespaces.php'; … … 45 45 } 46 46 47 function composerRequire 9dfb9bf072c528104682014c183f7470($file)47 function composerRequiredea41aaff7a9ac591f8543b489dce4c1($file) 48 48 { 49 49 require $file; -
mgrt/trunk/vendor/mgrt/mgrt-php/.git/logs/HEAD
r986149 r988019 1 0000000000000000000000000000000000000000 c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410 330478+0200 clone: from git://github.com/mgrt/mgrt-php.git2 c945bf684a22dcc0277b671fa83024e82742647b c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410 330479+0200 checkout: moving from master to master1 0000000000000000000000000000000000000000 c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410507122 +0200 clone: from git://github.com/mgrt/mgrt-php.git 2 c945bf684a22dcc0277b671fa83024e82742647b c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410507123 +0200 checkout: moving from master to master -
mgrt/trunk/vendor/mgrt/mgrt-php/.git/logs/refs/heads/master
r986149 r988019 1 0000000000000000000000000000000000000000 c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410 330478+0200 clone: from git://github.com/mgrt/mgrt-php.git1 0000000000000000000000000000000000000000 c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410507122 +0200 clone: from git://github.com/mgrt/mgrt-php.git -
mgrt/trunk/vendor/mgrt/mgrt-php/.git/logs/refs/remotes/composer/master
r986149 r988019 1 0000000000000000000000000000000000000000 c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410 330479+0200 fetch composer: storing head1 0000000000000000000000000000000000000000 c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410507123 +0200 fetch composer: storing head -
mgrt/trunk/vendor/mgrt/mgrt-php/.git/logs/refs/remotes/origin/HEAD
r986149 r988019 1 0000000000000000000000000000000000000000 c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410 330478+0200 clone: from git://github.com/mgrt/mgrt-php.git1 0000000000000000000000000000000000000000 c945bf684a22dcc0277b671fa83024e82742647b ThisIsAreku <alexandre.boucey@gmail.com> 1410507122 +0200 clone: from git://github.com/mgrt/mgrt-php.git
Note: See TracChangeset
for help on using the changeset viewer.