Version Description
-
*
Download this release
Release Info
Developer | hannanstd |
Plugin | گرویتی فرم فارسی |
Version | 2.3.1 |
Comparing to | |
See all releases |
Code changes from version 2.3.0.2 to 2.3.1
- includes/class-core.php +28 -3
- includes/class-merge-tag.php +12 -11
- includes/class-payments.php +53 -14
- includes/class-settings.php +19 -6
- includes/class-snippets.php +1 -2
- index.php +2 -2
- languages/gravityforms/gravityforms-fa_IR.mo +0 -0
- languages/gravityforms/gravityforms-fa_IR.po +8 -9
- readme.txt +6 -3
includes/class-core.php
CHANGED
@@ -9,11 +9,15 @@ class GFPersian_Core {
|
|
9 |
public function __construct() {
|
10 |
|
11 |
if ( ! class_exists( 'GFCommon' ) ) {
|
12 |
-
add_action( 'admin_notices', array( $this, '
|
13 |
|
14 |
return;
|
15 |
}
|
16 |
|
|
|
|
|
|
|
|
|
17 |
add_action( 'admin_notices', array( $this, 'plugin_update' ), 9999 );
|
18 |
add_filter( 'load_textdomain_mofile', array( $this, 'load_translate' ), 10, 2 );
|
19 |
add_action( 'gform_loaded', array( $this, 'load_settings' ), 5 );
|
@@ -23,11 +27,16 @@ class GFPersian_Core {
|
|
23 |
$this->include_files();
|
24 |
}
|
25 |
|
26 |
-
public function
|
27 |
$message = sprintf( 'شما فقط بسته گرویتی فرم پارسی را نصب کرده اید. در حالیکه نصب هسته اصلی گرویتی فرم هم نیاز است. %sسوالات متداول%s', '<a href="http://gravityforms.ir/faq/" target="_blank">', '</a>' );
|
28 |
printf( '<div class="notice notice-error"><p>%s</p></div>', $message );
|
29 |
}
|
30 |
|
|
|
|
|
|
|
|
|
|
|
31 |
public function plugin_update() {
|
32 |
|
33 |
if ( get_option( 'gform_pending_installation' ) ) {
|
@@ -64,6 +73,11 @@ class GFPersian_Core {
|
|
64 |
|
65 |
echo '<div class="notice notice-success is-dismissible"><p>' . sprintf( 'گرویتی فرم پارسی با موفقیت بروز شد. %sرفتن به صفحه تنظیمات%s', '<a href="' . admin_url( 'admin.php?page=gf_settings&subview=persian' ) . '">', '</a>' ) . '</p></div>';
|
66 |
}
|
|
|
|
|
|
|
|
|
|
|
67 |
}
|
68 |
|
69 |
public function tooltips( $tooltips ) {
|
@@ -191,7 +205,18 @@ class GFPersian_Core {
|
|
191 |
}
|
192 |
|
193 |
public static function get_base_url() {
|
194 |
-
return plugins_url( '', dirname(__FILE__) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
195 |
}
|
196 |
}
|
197 |
|
9 |
public function __construct() {
|
10 |
|
11 |
if ( ! class_exists( 'GFCommon' ) ) {
|
12 |
+
add_action( 'admin_notices', array( $this, 'gform_not_exist' ) );
|
13 |
|
14 |
return;
|
15 |
}
|
16 |
|
17 |
+
/*if ( version_compare( GFCommon::$version, '1.9.9.9.9', "<=" ) ) {
|
18 |
+
add_action( 'admin_notices', array( $this, 'gform_min_version' ) );
|
19 |
+
}*/
|
20 |
+
|
21 |
add_action( 'admin_notices', array( $this, 'plugin_update' ), 9999 );
|
22 |
add_filter( 'load_textdomain_mofile', array( $this, 'load_translate' ), 10, 2 );
|
23 |
add_action( 'gform_loaded', array( $this, 'load_settings' ), 5 );
|
27 |
$this->include_files();
|
28 |
}
|
29 |
|
30 |
+
public function gform_not_exist() {
|
31 |
$message = sprintf( 'شما فقط بسته گرویتی فرم پارسی را نصب کرده اید. در حالیکه نصب هسته اصلی گرویتی فرم هم نیاز است. %sسوالات متداول%s', '<a href="http://gravityforms.ir/faq/" target="_blank">', '</a>' );
|
32 |
printf( '<div class="notice notice-error"><p>%s</p></div>', $message );
|
33 |
}
|
34 |
|
35 |
+
public function gform_min_version() {
|
36 |
+
$message = sprintf( 'برای استفاده از کلیه پلاگین های گرویتی فرم پارسی نسخه هسته گرویتی فرم شما باید حداقل 2.0 به بالا باشد. هرچه سریعتر نسبت به ارتقای هسته گرویتی فرم خود اقدام نمایید. وگرنه ممکن است در حین کار با پلاگین ها دچار مشکل شوید. %sراهنمای بروز رسانی%s', '<a href="http://gravityforms.ir/11378/" target="_blank">', '</a>' );
|
37 |
+
printf( '<div class="notice notice-error"><p>%s</p></div>', $message );
|
38 |
+
}
|
39 |
+
|
40 |
public function plugin_update() {
|
41 |
|
42 |
if ( get_option( 'gform_pending_installation' ) ) {
|
73 |
|
74 |
echo '<div class="notice notice-success is-dismissible"><p>' . sprintf( 'گرویتی فرم پارسی با موفقیت بروز شد. %sرفتن به صفحه تنظیمات%s', '<a href="' . admin_url( 'admin.php?page=gf_settings&subview=persian' ) . '">', '</a>' ) . '</p></div>';
|
75 |
}
|
76 |
+
|
77 |
+
if ( ! get_option( 'gf_persian_gateway' ) ) {
|
78 |
+
update_option( 'gf_persian_gateway', GF_PERSIAN_VERSION );
|
79 |
+
echo '<div class="notice notice-success is-dismissible"><p>' . sprintf( 'بعد از مشاهده این پیام میتوانید درگاه های پرداخت گرویتی فرم را بروز نمایید. %sمشاهده راهنمای بروز رسانی%s', '<a target="_blank" href="http://gravityforms.ir/33598">', '</a>' ) . '</p></div>';
|
80 |
+
}
|
81 |
}
|
82 |
|
83 |
public function tooltips( $tooltips ) {
|
205 |
}
|
206 |
|
207 |
public static function get_base_url() {
|
208 |
+
return plugins_url( '', dirname( __FILE__ ) );
|
209 |
+
}
|
210 |
+
|
211 |
+
|
212 |
+
public static function get_entry( $entry_id ) {
|
213 |
+
$entry = GFAPI::get_entry( $entry_id );
|
214 |
+
|
215 |
+
if ( is_wp_error( $entry ) ) {
|
216 |
+
return false;
|
217 |
+
}
|
218 |
+
|
219 |
+
return $entry;
|
220 |
}
|
221 |
}
|
222 |
|
includes/class-merge-tag.php
CHANGED
@@ -4,8 +4,9 @@
|
|
4 |
|
5 |
class GFPersian_Merge_Tags extends GFPersian_Core {
|
6 |
|
7 |
-
public static $_entry = null;
|
8 |
private $entry_time = 0;
|
|
|
|
|
9 |
|
10 |
public function __construct() {
|
11 |
|
@@ -98,7 +99,7 @@ class GFPersian_Merge_Tags extends GFPersian_Core {
|
|
98 |
|
99 |
$text = str_ireplace( array_keys( $deprecated_tags ), array_values( $deprecated_tags ), $text );
|
100 |
|
101 |
-
$entry =
|
102 |
$transaction_id = rgar( $entry, 'transaction_id' );
|
103 |
$payment_status = GFPersian_Payments::_payment_status( $entry );
|
104 |
$payment_gateway = gform_get_meta( rgar( $entry, 'id' ), 'payment_gateway' );
|
@@ -361,12 +362,12 @@ class GFPersian_Merge_Tags extends GFPersian_Core {
|
|
361 |
$entry_id = rgget( 'entry' );
|
362 |
|
363 |
if ( $entry_id ) {
|
364 |
-
if ( ! $entry_time
|
365 |
|
366 |
if ( method_exists( 'GFCommon', 'openssl_decrypt' ) ) {
|
367 |
-
$entry_id = GFCommon::openssl_decrypt( $entry_id );
|
368 |
} elseif ( method_exists( 'GFCommon', 'decrypt' ) ) {
|
369 |
-
$entry_id = GFCommon::decrypt( $entry_id );
|
370 |
}
|
371 |
$entry_id = intval( $entry_id );
|
372 |
}
|
@@ -378,7 +379,7 @@ class GFPersian_Merge_Tags extends GFPersian_Core {
|
|
378 |
}
|
379 |
|
380 |
if ( $entry_id ) {
|
381 |
-
$entry =
|
382 |
}
|
383 |
|
384 |
self::$_entry = ! empty( $entry ) && $entry ? $entry : false;
|
@@ -487,9 +488,9 @@ class GFPersian_Merge_Tags extends GFPersian_Core {
|
|
487 |
|
488 |
if ( ! $this->entry_time ) {
|
489 |
if ( method_exists( 'GFCommon', 'openssl_encrypt' ) ) {
|
490 |
-
$entry_id = rawurlencode( GFCommon::openssl_encrypt( $entry_id ) );
|
491 |
} elseif ( method_exists( 'GFCommon', 'encrypt' ) ) {
|
492 |
-
$entry_id = rawurlencode( GFCommon::encrypt( $entry_id ) );
|
493 |
}
|
494 |
}
|
495 |
|
@@ -650,8 +651,8 @@ class GFPersian_Merge_Tags extends GFPersian_Core {
|
|
650 |
|
651 |
public function create_entry( $form ) {
|
652 |
|
653 |
-
if ( empty( self::$
|
654 |
-
self::$
|
655 |
if ( class_exists( 'GFCache' ) ) {
|
656 |
foreach ( $form['fields'] as &$field ) {
|
657 |
if ( GFFormsModel::get_input_type( $field ) == 'total' ) {
|
@@ -661,7 +662,7 @@ class GFPersian_Merge_Tags extends GFPersian_Core {
|
|
661 |
}
|
662 |
}
|
663 |
|
664 |
-
return self::$
|
665 |
}
|
666 |
/*-------------------------------------------------------------*/
|
667 |
/*--------End of Pre Submission Merge Tags---------------------*/
|
4 |
|
5 |
class GFPersian_Merge_Tags extends GFPersian_Core {
|
6 |
|
|
|
7 |
private $entry_time = 0;
|
8 |
+
private static $_entry = null;
|
9 |
+
private static $_virual_entry = null;
|
10 |
|
11 |
public function __construct() {
|
12 |
|
99 |
|
100 |
$text = str_ireplace( array_keys( $deprecated_tags ), array_values( $deprecated_tags ), $text );
|
101 |
|
102 |
+
$entry = self::get_entry( rgar( $entry, 'id' ) );
|
103 |
$transaction_id = rgar( $entry, 'transaction_id' );
|
104 |
$payment_status = GFPersian_Payments::_payment_status( $entry );
|
105 |
$payment_gateway = gform_get_meta( rgar( $entry, 'id' ), 'payment_gateway' );
|
362 |
$entry_id = rgget( 'entry' );
|
363 |
|
364 |
if ( $entry_id ) {
|
365 |
+
if ( ( ! $entry_time ) && ( ! is_numeric( $entry_id ) || intval( $entry_id ) <= 0 ) ) {
|
366 |
|
367 |
if ( method_exists( 'GFCommon', 'openssl_decrypt' ) ) {
|
368 |
+
$entry_id = GFCommon::openssl_decrypt( strval( $entry_id ) );
|
369 |
} elseif ( method_exists( 'GFCommon', 'decrypt' ) ) {
|
370 |
+
$entry_id = GFCommon::decrypt( strval( $entry_id ) );
|
371 |
}
|
372 |
$entry_id = intval( $entry_id );
|
373 |
}
|
379 |
}
|
380 |
|
381 |
if ( $entry_id ) {
|
382 |
+
$entry = self::get_entry( $entry_id );
|
383 |
}
|
384 |
|
385 |
self::$_entry = ! empty( $entry ) && $entry ? $entry : false;
|
488 |
|
489 |
if ( ! $this->entry_time ) {
|
490 |
if ( method_exists( 'GFCommon', 'openssl_encrypt' ) ) {
|
491 |
+
$entry_id = rawurlencode( GFCommon::openssl_encrypt( strval( $entry_id ) ) );
|
492 |
} elseif ( method_exists( 'GFCommon', 'encrypt' ) ) {
|
493 |
+
$entry_id = rawurlencode( GFCommon::encrypt( strval( $entry_id ) ) );
|
494 |
}
|
495 |
}
|
496 |
|
651 |
|
652 |
public function create_entry( $form ) {
|
653 |
|
654 |
+
if ( empty( self::$_virual_entry ) ) {
|
655 |
+
self::$_virual_entry = GFFormsModel::create_lead( $form );
|
656 |
if ( class_exists( 'GFCache' ) ) {
|
657 |
foreach ( $form['fields'] as &$field ) {
|
658 |
if ( GFFormsModel::get_input_type( $field ) == 'total' ) {
|
662 |
}
|
663 |
}
|
664 |
|
665 |
+
return self::$_virual_entry;
|
666 |
}
|
667 |
/*-------------------------------------------------------------*/
|
668 |
/*--------End of Pre Submission Merge Tags---------------------*/
|
includes/class-payments.php
CHANGED
@@ -26,6 +26,7 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
26 |
|
27 |
add_filter( 'gform_entry_meta', array( $this, 'gform_entry_meta' ) );
|
28 |
add_filter( 'gform_is_value_match', array( $this, 'is_value_match' ), 10, 6 );
|
|
|
29 |
}
|
30 |
|
31 |
public static function _payment_status( $entry, $only_name = false, $status = '' ) {
|
@@ -34,7 +35,7 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
34 |
|
35 |
$status = ucfirst( $status );
|
36 |
|
37 |
-
if ( in_array( $status, array( 'Completed', 'Paid', 'Active', 'Approved' ) ) ) {
|
38 |
$status = array( '#3d804c', 'موفق' );
|
39 |
|
40 |
} elseif ( $status == 'Failed' ) {
|
@@ -186,7 +187,7 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
186 |
$ui_settings['payment_status_hint'] = '
|
187 |
<tr>
|
188 |
<th><label for="stickylist_confirmation_type">وضعیت پرداخت</label></th>
|
189 |
-
<td>' . sprintf( 'برای محدود کردن این %s به وضعیت پرداخت های مورد نظر، از طریق منطق شرطی بالا وضعیت پرداخت مورد نظر را ست نمایید. توجه نمایید که همه درگاه های پرداخت از وضعیت "
|
190 |
</tr>';
|
191 |
|
192 |
return $ui_settings;
|
@@ -246,8 +247,8 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
246 |
index = bits[bits.length - 1],
|
247 |
prep = bits.indexOf('rule'),
|
248 |
prefix = bits.slice(0, prep).join('_'),
|
249 |
-
$input = $('#
|
250 |
-
$operator = $('#
|
251 |
$operator.find(":not(option[value^='is'])").each(function () {
|
252 |
$(this).remove();
|
253 |
});
|
@@ -265,7 +266,7 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
265 |
input_name = input_id;
|
266 |
var options = '<option value="completed">موفق</option>';
|
267 |
options += '<option value="failed">ناموفق</option>';
|
268 |
-
options += '<option value="cancelled"
|
269 |
options = options.replace(/ selected="selected"/g, '');
|
270 |
options = options.replace("value=\"" + input_value + "\"", "value=\"" + input_value + "\" selected=\"selected\"");
|
271 |
if (typeof $input[0] == 'undefined') {
|
@@ -299,11 +300,17 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
299 |
|
300 |
public function is_value_match( $is_match, $field_value/*entry['payment_status']*/, $rule_value, $rule_operator, $source_field = null, $rule ) {
|
301 |
|
302 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
303 |
|
304 |
$field_value = strtolower( $field_value );
|
305 |
|
306 |
-
if ( in_array( $field_value, array( 'completed', 'paid', 'active', 'approved' ) ) ) {
|
307 |
$field_value = 'completed';
|
308 |
}
|
309 |
|
@@ -321,7 +328,7 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
321 |
/*-----------------------------------------------------------------------------------*/
|
322 |
/*-----------------------------------------------------------------------------------*/
|
323 |
public static function notification( $form, $entry ) {
|
324 |
-
$entry =
|
325 |
$notifications = GFCommon::get_notifications_to_send( 'form_submission', $form, $entry );
|
326 |
$_notifications = array();
|
327 |
foreach ( (array) $notifications as $notification ) {
|
@@ -347,7 +354,7 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
347 |
require_once( GFCommon::get_base_path() . "/form_display.php" );
|
348 |
}
|
349 |
|
350 |
-
$entry =
|
351 |
$confirmation = GFFormDisplay::handle_confirmation( $form, $entry );
|
352 |
if ( is_array( $confirmation ) && isset( $confirmation["redirect"] ) ) {
|
353 |
header( "Location: {$confirmation["redirect"]}" );
|
@@ -368,7 +375,7 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
368 |
public static function currency( $entry = '', $form = '' ) {
|
369 |
|
370 |
if ( is_numeric( $entry ) ) {
|
371 |
-
$entry =
|
372 |
}
|
373 |
|
374 |
if ( rgar( $entry, 'currency' ) ) {
|
@@ -432,7 +439,7 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
432 |
if ( ! empty( $check ) ) {
|
433 |
|
434 |
if ( is_numeric( $entry ) ) {
|
435 |
-
$entry =
|
436 |
}
|
437 |
|
438 |
$entry["payment_date"] = gmdate( "Y-m-d H:i:s" );
|
@@ -497,14 +504,46 @@ class GFPersian_Payments extends GFPersian_Core {
|
|
497 |
return $version;
|
498 |
}
|
499 |
|
500 |
-
public static function transaction_id($entry) {
|
501 |
-
|
502 |
-
|
503 |
|
504 |
public static function nusoap() {
|
505 |
require_once 'lib/nusoap.php';
|
506 |
}
|
507 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
508 |
}
|
509 |
|
510 |
new GFPersian_Payments;
|
26 |
|
27 |
add_filter( 'gform_entry_meta', array( $this, 'gform_entry_meta' ) );
|
28 |
add_filter( 'gform_is_value_match', array( $this, 'is_value_match' ), 10, 6 );
|
29 |
+
add_action( 'gf_gateway_js', array( $this, 'prev_gateways_chart_js' ) );
|
30 |
}
|
31 |
|
32 |
public static function _payment_status( $entry, $only_name = false, $status = '' ) {
|
35 |
|
36 |
$status = ucfirst( $status );
|
37 |
|
38 |
+
if ( in_array( $status, array( 'Completed', 'Paid', 'Active', 'Actived', 'Approved' ) ) ) {
|
39 |
$status = array( '#3d804c', 'موفق' );
|
40 |
|
41 |
} elseif ( $status == 'Failed' ) {
|
187 |
$ui_settings['payment_status_hint'] = '
|
188 |
<tr>
|
189 |
<th><label for="stickylist_confirmation_type">وضعیت پرداخت</label></th>
|
190 |
+
<td>' . sprintf( 'برای محدود کردن این %s به وضعیت پرداخت های مورد نظر، از طریق منطق شرطی بالا وضعیت پرداخت مورد نظر را ست نمایید. توجه نمایید که همه درگاه های پرداخت از وضعیت "منصرف شده" پشتیبانی نمیکنند. ضمن اینکه نسخه درگاه پرداخت ایرانی شما باید حداقل 2.3 باشد.', $current_action ) . '</td>
|
191 |
</tr>';
|
192 |
|
193 |
return $ui_settings;
|
247 |
index = bits[bits.length - 1],
|
248 |
prep = bits.indexOf('rule'),
|
249 |
prefix = bits.slice(0, prep).join('_'),
|
250 |
+
$input = $('#' + prefix + '_rule_value_' + index),
|
251 |
+
$operator = $('#' + prefix + '_rule_operator_' + index);
|
252 |
$operator.find(":not(option[value^='is'])").each(function () {
|
253 |
$(this).remove();
|
254 |
});
|
266 |
input_name = input_id;
|
267 |
var options = '<option value="completed">موفق</option>';
|
268 |
options += '<option value="failed">ناموفق</option>';
|
269 |
+
options += '<option value="cancelled">منصرف شده</option>';
|
270 |
options = options.replace(/ selected="selected"/g, '');
|
271 |
options = options.replace("value=\"" + input_value + "\"", "value=\"" + input_value + "\" selected=\"selected\"");
|
272 |
if (typeof $input[0] == 'undefined') {
|
300 |
|
301 |
public function is_value_match( $is_match, $field_value/*entry['payment_status']*/, $rule_value, $rule_operator, $source_field = null, $rule ) {
|
302 |
|
303 |
+
$fieldId = rgar( $rule, 'fieldId' );
|
304 |
+
if ( empty( $fieldId ) ) {
|
305 |
+
/*یه باگ مسخره توی گرویتی فرم ۱٫۹ بود*/
|
306 |
+
$fieldId = rgar( $source_field, 'fieldId' );
|
307 |
+
}
|
308 |
+
|
309 |
+
if ( $fieldId == 'payment_status' ) {
|
310 |
|
311 |
$field_value = strtolower( $field_value );
|
312 |
|
313 |
+
if ( in_array( $field_value, array( 'completed', 'paid', 'active', 'actived', 'approved' ) ) ) {
|
314 |
$field_value = 'completed';
|
315 |
}
|
316 |
|
328 |
/*-----------------------------------------------------------------------------------*/
|
329 |
/*-----------------------------------------------------------------------------------*/
|
330 |
public static function notification( $form, $entry ) {
|
331 |
+
$entry = self::get_entry( rgar( $entry, 'id' ) );
|
332 |
$notifications = GFCommon::get_notifications_to_send( 'form_submission', $form, $entry );
|
333 |
$_notifications = array();
|
334 |
foreach ( (array) $notifications as $notification ) {
|
354 |
require_once( GFCommon::get_base_path() . "/form_display.php" );
|
355 |
}
|
356 |
|
357 |
+
$entry = self::get_entry( rgar( $entry, 'id' ) );
|
358 |
$confirmation = GFFormDisplay::handle_confirmation( $form, $entry );
|
359 |
if ( is_array( $confirmation ) && isset( $confirmation["redirect"] ) ) {
|
360 |
header( "Location: {$confirmation["redirect"]}" );
|
375 |
public static function currency( $entry = '', $form = '' ) {
|
376 |
|
377 |
if ( is_numeric( $entry ) ) {
|
378 |
+
$entry = self::get_entry( $entry );
|
379 |
}
|
380 |
|
381 |
if ( rgar( $entry, 'currency' ) ) {
|
439 |
if ( ! empty( $check ) ) {
|
440 |
|
441 |
if ( is_numeric( $entry ) ) {
|
442 |
+
$entry = self::get_entry( $entry );
|
443 |
}
|
444 |
|
445 |
$entry["payment_date"] = gmdate( "Y-m-d H:i:s" );
|
504 |
return $version;
|
505 |
}
|
506 |
|
507 |
+
public static function transaction_id( $entry ) {
|
508 |
+
return GFPersian_Transaction_ID::create_transaction_id( $entry, 'return' );
|
509 |
+
}
|
510 |
|
511 |
public static function nusoap() {
|
512 |
require_once 'lib/nusoap.php';
|
513 |
}
|
514 |
|
515 |
+
public function prev_gateways_chart_js() {
|
516 |
+
|
517 |
+
wp_dequeue_script( 'jquery-ui-jdatepicker' );
|
518 |
+
wp_deregister_script( 'jquery-ui-jdatepicker' );
|
519 |
+
|
520 |
+
wp_register_script( 'jquery-ui-jdatepicker', GFPersian_Payments::get_base_url() . '/assets/js/jalali-datepicker.js', array(
|
521 |
+
'jquery',
|
522 |
+
'jquery-migrate',
|
523 |
+
'jquery-ui-core',
|
524 |
+
), GFCommon::$version, true );
|
525 |
+
wp_enqueue_script( 'jquery-ui-jdatepicker' );
|
526 |
+
|
527 |
+
}
|
528 |
+
|
529 |
+
public static function fix_mobile( $Mobile = '' ) {
|
530 |
+
|
531 |
+
if ( empty( $Mobile ) ) {
|
532 |
+
return '';
|
533 |
+
}
|
534 |
+
|
535 |
+
$Mobile = str_ireplace( array( '۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹' ),
|
536 |
+
array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ), $Mobile ); //farsi
|
537 |
+
|
538 |
+
$Mobile = str_ireplace( array( '٠', '١', '٢', '٣', '٤', '٥', '٦', '٧', '٨', '٩' ),
|
539 |
+
array( '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' ), $Mobile ); //arabi
|
540 |
+
|
541 |
+
$Mobile = preg_replace( '/\D/is', '', $Mobile );
|
542 |
+
$Mobile = ltrim( $Mobile, '0' );
|
543 |
+
$Mobile = substr( $Mobile, 0, 2 ) == '98' ? substr( $Mobile, 2 ) : $Mobile;
|
544 |
+
|
545 |
+
return '0' . $Mobile;
|
546 |
+
}
|
547 |
}
|
548 |
|
549 |
new GFPersian_Payments;
|
includes/class-settings.php
CHANGED
@@ -4,16 +4,26 @@
|
|
4 |
|
5 |
class GFPersian_Settings extends GFAddOn {
|
6 |
|
7 |
-
protected $_version
|
8 |
-
protected $
|
9 |
-
protected $_path
|
10 |
-
protected $_full_path
|
11 |
-
protected $_slug = GF_PERSIAN_SLUG;
|
12 |
protected $_short_title = 'گرویتی فرم پارسی';
|
13 |
protected $_title = 'بسته گرویتی فرم پارسی';
|
|
|
14 |
|
15 |
private static $_instance = null;
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
public static function get_instance() {
|
18 |
|
19 |
if ( self::$_instance == null ) {
|
@@ -324,7 +334,10 @@ class GFPersian_Settings extends GFAddOn {
|
|
324 |
'default_value' => '1',
|
325 |
'choices' => array(
|
326 |
array( 'label' => 'همواره فعال باشد', 'value' => '0' ),
|
327 |
-
array(
|
|
|
|
|
|
|
328 |
),
|
329 |
),
|
330 |
)
|
4 |
|
5 |
class GFPersian_Settings extends GFAddOn {
|
6 |
|
7 |
+
protected $_version;
|
8 |
+
protected $_slug;
|
9 |
+
protected $_path;
|
10 |
+
protected $_full_path;
|
|
|
11 |
protected $_short_title = 'گرویتی فرم پارسی';
|
12 |
protected $_title = 'بسته گرویتی فرم پارسی';
|
13 |
+
protected $_min_gravityforms_version = '1.9';
|
14 |
|
15 |
private static $_instance = null;
|
16 |
|
17 |
+
public function __construct() {
|
18 |
+
|
19 |
+
parent::__construct();
|
20 |
+
|
21 |
+
$this->_version = GF_PERSIAN_VERSION;
|
22 |
+
$this->_slug = GF_PERSIAN_SLUG;
|
23 |
+
$this->_path = GF_PERSIAN_DIR . 'index.php';
|
24 |
+
$this->_full_path = __FILE__;
|
25 |
+
}
|
26 |
+
|
27 |
public static function get_instance() {
|
28 |
|
29 |
if ( self::$_instance == null ) {
|
334 |
'default_value' => '1',
|
335 |
'choices' => array(
|
336 |
array( 'label' => 'همواره فعال باشد', 'value' => '0' ),
|
337 |
+
array(
|
338 |
+
'label' => 'فقط زمانیکه تمام مراحل طی شدند و به مرحله آخر رسید فعال شود',
|
339 |
+
'value' => '1'
|
340 |
+
),
|
341 |
),
|
342 |
),
|
343 |
)
|
includes/class-snippets.php
CHANGED
@@ -19,7 +19,7 @@ class GFPersian_Snippets extends GFPersian_Core {
|
|
19 |
add_filter( 'gform_before_resend_notifications', array( $this, 'add_notification_filter' ) );
|
20 |
}
|
21 |
}
|
22 |
-
|
23 |
public function add_private_post_status( $post_statuses ) {
|
24 |
$post_statuses['private'] = 'خصوصی';
|
25 |
|
@@ -61,7 +61,6 @@ class GFPersian_Snippets extends GFPersian_Core {
|
|
61 |
/*----------End of NewsLetter------------------------------------------------------------------*/
|
62 |
/*---------------------------------------------------------------------------------------------*/
|
63 |
|
64 |
-
|
65 |
}
|
66 |
|
67 |
new GFPersian_Snippets;
|
19 |
add_filter( 'gform_before_resend_notifications', array( $this, 'add_notification_filter' ) );
|
20 |
}
|
21 |
}
|
22 |
+
|
23 |
public function add_private_post_status( $post_statuses ) {
|
24 |
$post_statuses['private'] = 'خصوصی';
|
25 |
|
61 |
/*----------End of NewsLetter------------------------------------------------------------------*/
|
62 |
/*---------------------------------------------------------------------------------------------*/
|
63 |
|
|
|
64 |
}
|
65 |
|
66 |
new GFPersian_Snippets;
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: گرویتی فرم پارسی
|
4 |
Description: بسته کامل بومی ساز گرویتی فرم برای ایرانیان - به همراه امکانات جانبی
|
5 |
Plugin URI: https://wordpress.org/plugins/persian-gravity-forms/
|
6 |
-
Version: 2.3.
|
7 |
Author: گرویتی فرم پارسی
|
8 |
Author URI: http://www.gravityforms.ir/
|
9 |
Domain Path: /languages/
|
@@ -14,7 +14,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
14 |
}
|
15 |
|
16 |
if ( ! defined( 'GF_PERSIAN_VERSION' ) ) {
|
17 |
-
define( 'GF_PERSIAN_VERSION', '2.3.
|
18 |
}
|
19 |
|
20 |
if ( ! defined( 'GF_PERSIAN_SLUG' ) ) {
|
3 |
Plugin Name: گرویتی فرم پارسی
|
4 |
Description: بسته کامل بومی ساز گرویتی فرم برای ایرانیان - به همراه امکانات جانبی
|
5 |
Plugin URI: https://wordpress.org/plugins/persian-gravity-forms/
|
6 |
+
Version: 2.3.1
|
7 |
Author: گرویتی فرم پارسی
|
8 |
Author URI: http://www.gravityforms.ir/
|
9 |
Domain Path: /languages/
|
14 |
}
|
15 |
|
16 |
if ( ! defined( 'GF_PERSIAN_VERSION' ) ) {
|
17 |
+
define( 'GF_PERSIAN_VERSION', '2.3.1' );
|
18 |
}
|
19 |
|
20 |
if ( ! defined( 'GF_PERSIAN_SLUG' ) ) {
|
languages/gravityforms/gravityforms-fa_IR.mo
CHANGED
Binary file
|
languages/gravityforms/gravityforms-fa_IR.po
CHANGED
@@ -3,7 +3,7 @@ msgstr ""
|
|
3 |
"Project-Id-Version: Gravity Forms v2.2.1.2\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: 2018-05-26 17:28+0000\n"
|
6 |
-
"PO-Revision-Date: 2018-05-
|
7 |
"Last-Translator: hannanstd <hannanstd@gmail.com>\n"
|
8 |
"Language-Team: فارسی\n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -4728,7 +4728,7 @@ msgstr "تغییر مسیر URL"
|
|
4728 |
#: form_settings.php:1681 entry_detail.php:50 notification.php:237
|
4729 |
#: notification.php:585 notification.php:589
|
4730 |
msgid "Notifications"
|
4731 |
-
msgstr "اعلان ها
|
4732 |
|
4733 |
#: form_settings.php:1761
|
4734 |
msgid "You must specify a Confirmation Name."
|
@@ -6599,7 +6599,7 @@ msgstr "بین پیام های ورودی جداکننده صفحه اضافه
|
|
6599 |
|
6600 |
#: settings.php:129 settings.php:216 settings.php:228
|
6601 |
msgid "Uninstall Gravity Forms"
|
6602 |
-
msgstr "حذف
|
6603 |
|
6604 |
#: settings.php:135
|
6605 |
msgid "You don't have adequate permission to uninstall Gravity Forms."
|
@@ -6859,7 +6859,7 @@ msgstr "تنظیمات"
|
|
6859 |
|
6860 |
#: settings.php:753 includes/addon/class-gf-addon.php:4857
|
6861 |
msgid "Uninstall"
|
6862 |
-
msgstr "حذف
|
6863 |
|
6864 |
#: gravityforms.php:1286
|
6865 |
msgid "Update Available"
|
@@ -7903,8 +7903,7 @@ msgid ""
|
|
7903 |
"%s has been successfully uninstalled. It can be re-activated from the "
|
7904 |
"%splugins page%s."
|
7905 |
msgstr ""
|
7906 |
-
"%s با موفقیت حذف
|
7907 |
-
"%s فعال کرد."
|
7908 |
|
7909 |
#: includes/addon/class-gf-addon.php:4801
|
7910 |
#: includes/addon/class-gf-addon.php:5092
|
@@ -7915,16 +7914,16 @@ msgstr "شما مجوز کافی برای به روز رسانی تنظیمات
|
|
7915 |
#: includes/addon/class-gf-addon.php:4900
|
7916 |
#, php-format
|
7917 |
msgid "Uninstall %s"
|
7918 |
-
msgstr "حذف
|
7919 |
|
7920 |
#: includes/addon/class-gf-addon.php:5163
|
7921 |
#, php-format
|
7922 |
msgid "Uninstall %s Add-On"
|
7923 |
-
msgstr "حذف
|
7924 |
|
7925 |
#: includes/addon/class-gf-addon.php:5169
|
7926 |
msgid "Uninstall Add-On"
|
7927 |
-
msgstr "حذف
|
7928 |
|
7929 |
#: includes/addon/class-gf-addon.php:5180
|
7930 |
#, php-format
|
3 |
"Project-Id-Version: Gravity Forms v2.2.1.2\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
"POT-Creation-Date: 2018-05-26 17:28+0000\n"
|
6 |
+
"PO-Revision-Date: 2018-05-27 13:39+0000\n"
|
7 |
"Last-Translator: hannanstd <hannanstd@gmail.com>\n"
|
8 |
"Language-Team: فارسی\n"
|
9 |
"MIME-Version: 1.0\n"
|
4728 |
#: form_settings.php:1681 entry_detail.php:50 notification.php:237
|
4729 |
#: notification.php:585 notification.php:589
|
4730 |
msgid "Notifications"
|
4731 |
+
msgstr "اعلان ها"
|
4732 |
|
4733 |
#: form_settings.php:1761
|
4734 |
msgid "You must specify a Confirmation Name."
|
6599 |
|
6600 |
#: settings.php:129 settings.php:216 settings.php:228
|
6601 |
msgid "Uninstall Gravity Forms"
|
6602 |
+
msgstr "حذف گرویتی فرم"
|
6603 |
|
6604 |
#: settings.php:135
|
6605 |
msgid "You don't have adequate permission to uninstall Gravity Forms."
|
6859 |
|
6860 |
#: settings.php:753 includes/addon/class-gf-addon.php:4857
|
6861 |
msgid "Uninstall"
|
6862 |
+
msgstr "حذف"
|
6863 |
|
6864 |
#: gravityforms.php:1286
|
6865 |
msgid "Update Available"
|
7903 |
"%s has been successfully uninstalled. It can be re-activated from the "
|
7904 |
"%splugins page%s."
|
7905 |
msgstr ""
|
7906 |
+
"%s با موفقیت حذف شد. می توان دوباره آن را از %s صفحه پلاگین ها %s فعال کرد."
|
|
|
7907 |
|
7908 |
#: includes/addon/class-gf-addon.php:4801
|
7909 |
#: includes/addon/class-gf-addon.php:5092
|
7914 |
#: includes/addon/class-gf-addon.php:4900
|
7915 |
#, php-format
|
7916 |
msgid "Uninstall %s"
|
7917 |
+
msgstr "حذف %s"
|
7918 |
|
7919 |
#: includes/addon/class-gf-addon.php:5163
|
7920 |
#, php-format
|
7921 |
msgid "Uninstall %s Add-On"
|
7922 |
+
msgstr "حذف افزودنی %s"
|
7923 |
|
7924 |
#: includes/addon/class-gf-addon.php:5169
|
7925 |
msgid "Uninstall Add-On"
|
7926 |
+
msgstr "حذف افزودنی ها"
|
7927 |
|
7928 |
#: includes/addon/class-gf-addon.php:5180
|
7929 |
#, php-format
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: gravityforms,gravity forms,persian gravity forms,persian gravityforms,grav
|
|
4 |
Donate link: http://gravityforms.ir
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 4.9.6
|
7 |
-
Stable tag: 2.3.
|
8 |
License: GPL 2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
بسته کامل ایرانی ساز گرویتی فرم
|
@@ -52,6 +52,9 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
52 |
|
53 |
|
54 |
== Changelog ==
|
|
|
|
|
|
|
55 |
= 2.3.0.2 =
|
56 |
* رفع مشکل ریز نسخه 2.3.0
|
57 |
= 2.3.0.1 =
|
@@ -159,5 +162,5 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
159 |
* انتشار نسخه اولیه
|
160 |
|
161 |
== Upgrade Notice ==
|
162 |
-
= 2.3.
|
163 |
-
*
|
4 |
Donate link: http://gravityforms.ir
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 4.9.6
|
7 |
+
Stable tag: 2.3.1
|
8 |
License: GPL 2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
بسته کامل ایرانی ساز گرویتی فرم
|
52 |
|
53 |
|
54 |
== Changelog ==
|
55 |
+
= 2.3.1 =
|
56 |
+
* رفع مشکل ظاهر نشدن فرم
|
57 |
+
* توابع متناسب با درگاه های پرداخت
|
58 |
= 2.3.0.2 =
|
59 |
* رفع مشکل ریز نسخه 2.3.0
|
60 |
= 2.3.0.1 =
|
162 |
* انتشار نسخه اولیه
|
163 |
|
164 |
== Upgrade Notice ==
|
165 |
+
= 2.3.1 =
|
166 |
+
* رفع مشکل ظاهر نشدن فرم - توابع متناسب با درگاه های پرداخت
|