گرویتی فرم فارسی - Version 1.7.4

Version Description

  • Fixed : Some Minor bugs
Download this release

Release Info

Developer hannanstd
Plugin Icon 128x128 گرویتی فرم فارسی
Version 1.7.4
Comparing to
See all releases

Code changes from version 1.7.3 to 1.7.4

Persian_Gravityforms_By_HANNANStd.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Persian Gravity Forms
4
  Plugin URI: https://wordpress.org/plugins/persian-gravity-forms/
5
  Description: Gravity Forms for Iranian
6
- Version: 1.7.3
7
  Requires at least: 3.8
8
  Author: HANNAN Ebrahimi Setoode
9
  Author URI: http://www.gravityforms.ir/
@@ -52,6 +52,8 @@ class GravityFormsPersian {
52
  add_action('gform_field_advanced_settings', array( $this, 'Add_Melli_Cart_Field_Setting_By_HANNANStd'), 10, 2);
53
  add_action('gform_entries_first_column', array($this ,'First_Column_Actions_By_HANNANStd'), 10, 5);
54
  add_action('gform_entry_post_save', array($this ,'Update_Lead_No_Gateway_By_HANNANStd'), 10, 2);
 
 
55
  //filters
56
  add_filter('update_footer', array( $this, 'GravityForms_Footer_Left_By_HANNANStd'), 11);
57
  add_filter('load_textdomain_mofile', array( $this, 'Load_Textdomain_Mo_File_By_HANNANStd'), 10, 2 );
@@ -88,6 +90,16 @@ class GravityFormsPersian {
88
  }
89
  }
90
  public function init(){
 
 
 
 
 
 
 
 
 
 
91
  require_once("include/Jalali.php");
92
  require_once("include/Post_Content_Merge_Tags.php");
93
  $rel_path = dirname( plugin_basename( $this->file ) ) . '/languages/';
@@ -243,7 +255,7 @@ class GravityFormsPersian {
243
  ?>
244
  <script type='text/javascript'>
245
  fieldSettings["date"] += ", .Jalali_setting";
246
- fieldSettings["mellicart"] = ".conditional_logic_field_setting, .label_setting, .admin_label_setting, .size_setting, .rules_setting, .visibility_setting, .duplicate_setting, .default_value_setting, .description_setting, .css_class_setting, .mellicart_setting";
247
  //fieldSettings["keyboard"] = ".label_setting, .keyboard_setting";
248
  jQuery(document).bind("gform_load_field_settings", function(event, field, form){
249
  jQuery("#check_jalali").attr("checked", field["check_jalali"] == true);
@@ -470,11 +482,12 @@ class GravityFormsPersian {
470
  $wp_session['refid'] = $form["id"].$lead["id"];
471
  @session_start();
472
  $_SESSION["refid"] = $form["id"].$lead["id"];
473
- RGFormsModel::update_lead($lead);
474
  return $lead;
475
  }
476
  public function GformReplaceMergeTags_By_HANNANStd($text, $form, $lead, $url_encode, $esc_html, $nl2br, $format){
477
  $gateway = gform_get_meta($lead['id'], 'payment_gateway');
 
478
  if ($lead['payment_status']=="Active" || $lead['payment_status']=="Paid")
479
  $payment_status = __("Paid", "Persian_Gravityforms_By_HANNANStd");
480
  if ($lead['payment_status']=="Failed")
@@ -628,11 +641,8 @@ class GravityFormsPersian {
628
  $is_gravityforms_page = (substr($_GET['page'],0,12) == 'gravityforms') ? 1 : 0;
629
  else
630
  $is_gravityforms_page = 0;
631
- if (is_rtl() && ($page_prefix[0]=="gf" || RGForms::is_gravity_page() || $is_gravityforms_page == 1 ||
632
- $_SERVER['REQUEST_URI'] == '/wp-admin/' || $_SERVER['REQUEST_URI'] == '/wp-admin' ||
633
- $_SERVER['REQUEST_URI'] == '/wp-admin/index.php' || $_SERVER['REQUEST_URI'] == '/wp-admin/index.php/'))
634
- {
635
- wp_enqueue_style('Persian_GravityForms', plugins_url ( '/assets/css/admin-styles.css', __FILE__, null, GFCommon::$version ) );
636
  wp_print_styles('gform_tooltip','Persian_GravityForms' );
637
  wp_dequeue_script('jquery-ui-datepicker');
638
  wp_dequeue_script(array("jquery-ui-datepicker"));
@@ -729,6 +739,7 @@ class GravityFormsPersian {
729
  $product_index = 1;
730
  $total = 0;
731
  $discount = 0;
 
732
  foreach($products["products"] as $product){
733
  $option_fields = "";
734
  $price = GFCommon::to_number($product["price"]);
@@ -799,7 +810,7 @@ class GravityFormsPersian {
799
  return plugins_url( '', __FILE__ );
800
  }
801
  public function version(){
802
- return '1.7.3';
803
  }
804
  public function Add_HANNANStd_Field_By_HANNANStd( $field_groups ) {
805
  foreach( $field_groups as &$group ){
@@ -855,20 +866,19 @@ class GravityFormsPersian {
855
  {
856
  $lead = RGFormsModel::get_lead($lead_id);
857
  $post_id = $lead["post_id"];
858
- $post_link = "";
859
- if(is_numeric($post_id) && GFCommon::is_post_field($field))
860
- {
861
- $post_link = "You can <a href='post.php?action=edit&post=$post_id'>edit this post</a> from the post page.";
862
- }
863
- $currency = $lead["currency"];
864
  }
 
 
865
  $max_length = "";
866
  $html5_attributes = "";
867
  if(empty($html_input_type))
868
  $html_input_type = "text";
869
  $max_length = "maxlength=10";
870
  $tabindex = GFCommon::get_tabindex();
871
- return sprintf("<div class='ginput_container'><input onblur='MelliCard_Checker_Javascript_By_HANNANStd_%d(this);' name='input_%d' id='%s' type='%s' value='%s' class='melli_cart %s' $max_length $tabindex $html5_attributes %s/></div><p class='city mellicart' id='city_%d'></p>", $id, $id, $field_id, $html_input_type, esc_attr($value), esc_attr($class), $disabled_text, $id);
 
 
872
  }
873
  if ( $field["type"] == "keyboard" ) {
874
  $id = $field["id"];
@@ -879,15 +889,24 @@ class GravityFormsPersian {
879
  {
880
  $lead = RGFormsModel::get_lead($lead_id);
881
  $post_id = $lead["post_id"];
882
- $post_link = "";
883
- if(is_numeric($post_id) && GFCommon::is_post_field($field))
884
- {
885
- $post_link = "You can <a href='post.php?action=edit&post=$post_id'>edit this post</a> from the post page.";
886
- }
887
  }
888
  return sprintf("<input name='input_%d' id='%s' type='hidden' value=''/>", $id, $id);
889
  }
890
- return $input;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
891
  }
892
  public function Add_Melli_Cart_Field_Setting_By_HANNANStd( $position, $form_id ){
893
  if( $position == 50 ){
3
  Plugin Name: Persian Gravity Forms
4
  Plugin URI: https://wordpress.org/plugins/persian-gravity-forms/
5
  Description: Gravity Forms for Iranian
6
+ Version: 1.7.4
7
  Requires at least: 3.8
8
  Author: HANNAN Ebrahimi Setoode
9
  Author URI: http://www.gravityforms.ir/
52
  add_action('gform_field_advanced_settings', array( $this, 'Add_Melli_Cart_Field_Setting_By_HANNANStd'), 10, 2);
53
  add_action('gform_entries_first_column', array($this ,'First_Column_Actions_By_HANNANStd'), 10, 5);
54
  add_action('gform_entry_post_save', array($this ,'Update_Lead_No_Gateway_By_HANNANStd'), 10, 2);
55
+ add_action( 'gform_pre_submission', array( $this, 'Mellicart_Pre_Submission_By_HANNANStd' ) );
56
+
57
  //filters
58
  add_filter('update_footer', array( $this, 'GravityForms_Footer_Left_By_HANNANStd'), 11);
59
  add_filter('load_textdomain_mofile', array( $this, 'Load_Textdomain_Mo_File_By_HANNANStd'), 10, 2 );
90
  }
91
  }
92
  public function init(){
93
+ if ( get_option( 'gform_pending_installation' ) ) {
94
+ update_option( 'gform_pending_installation', false );
95
+ $current_version = get_option( 'rg_form_version' );
96
+ if ( $current_version === false ){
97
+ if(class_exists("GFCommon"))
98
+ update_option( 'rg_form_version', GFCommon::$version );
99
+ else
100
+ update_option( 'rg_form_version', '1.9.0' );
101
+ }
102
+ }
103
  require_once("include/Jalali.php");
104
  require_once("include/Post_Content_Merge_Tags.php");
105
  $rel_path = dirname( plugin_basename( $this->file ) ) . '/languages/';
255
  ?>
256
  <script type='text/javascript'>
257
  fieldSettings["date"] += ", .Jalali_setting";
258
+ fieldSettings["mellicart"] = ".placeholder_setting, .label_placement_setting, .prepopulate_field_setting, .conditional_logic_field_setting, .label_setting, .admin_label_setting, .size_setting, .rules_setting, .visibility_setting, .duplicate_setting, .default_value_setting, .description_setting, .css_class_setting, .mellicart_setting";
259
  //fieldSettings["keyboard"] = ".label_setting, .keyboard_setting";
260
  jQuery(document).bind("gform_load_field_settings", function(event, field, form){
261
  jQuery("#check_jalali").attr("checked", field["check_jalali"] == true);
482
  $wp_session['refid'] = $form["id"].$lead["id"];
483
  @session_start();
484
  $_SESSION["refid"] = $form["id"].$lead["id"];
485
+ GFAPI::update_entry($lead);
486
  return $lead;
487
  }
488
  public function GformReplaceMergeTags_By_HANNANStd($text, $form, $lead, $url_encode, $esc_html, $nl2br, $format){
489
  $gateway = gform_get_meta($lead['id'], 'payment_gateway');
490
+ $payment_status = '';
491
  if ($lead['payment_status']=="Active" || $lead['payment_status']=="Paid")
492
  $payment_status = __("Paid", "Persian_Gravityforms_By_HANNANStd");
493
  if ($lead['payment_status']=="Failed")
641
  $is_gravityforms_page = (substr($_GET['page'],0,12) == 'gravityforms') ? 1 : 0;
642
  else
643
  $is_gravityforms_page = 0;
644
+ if ( is_rtl() && ($page_prefix[0]=="gf" || RGForms::is_gravity_page() || $is_gravityforms_page == 1 )) {
645
+ wp_enqueue_style('Persian_GravityForms', plugins_url ( '/assets/css/admin.css', __FILE__, null, GFCommon::$version ) );
 
 
 
646
  wp_print_styles('gform_tooltip','Persian_GravityForms' );
647
  wp_dequeue_script('jquery-ui-datepicker');
648
  wp_dequeue_script(array("jquery-ui-datepicker"));
739
  $product_index = 1;
740
  $total = 0;
741
  $discount = 0;
742
+ $price = 0;
743
  foreach($products["products"] as $product){
744
  $option_fields = "";
745
  $price = GFCommon::to_number($product["price"]);
810
  return plugins_url( '', __FILE__ );
811
  }
812
  public function version(){
813
+ return '1.7.4';
814
  }
815
  public function Add_HANNANStd_Field_By_HANNANStd( $field_groups ) {
816
  foreach( $field_groups as &$group ){
866
  {
867
  $lead = RGFormsModel::get_lead($lead_id);
868
  $post_id = $lead["post_id"];
869
+
 
 
 
 
 
870
  }
871
+
872
+ $placeholder_attribute = GFCommon::get_field_placeholder_attribute( $field );
873
  $max_length = "";
874
  $html5_attributes = "";
875
  if(empty($html_input_type))
876
  $html_input_type = "text";
877
  $max_length = "maxlength=10";
878
  $tabindex = GFCommon::get_tabindex();
879
+ return sprintf("<div class='ginput_container'>
880
+ <input onblur='MelliCard_Checker_Javascript_By_HANNANStd_%d(this);' name='input_%d' id='%s' type='%s' value='%s' class='melli_cart %s' $placeholder_attribute $max_length $tabindex $html5_attributes %s/>
881
+ </div><p class='city mellicart' id='city_%d'></p>", $id, $id, $field_id, $html_input_type, esc_attr($value), esc_attr($class), $disabled_text, $id);
882
  }
883
  if ( $field["type"] == "keyboard" ) {
884
  $id = $field["id"];
889
  {
890
  $lead = RGFormsModel::get_lead($lead_id);
891
  $post_id = $lead["post_id"];
 
 
 
 
 
892
  }
893
  return sprintf("<input name='input_%d' id='%s' type='hidden' value=''/>", $id, $id);
894
  }
895
+ return $input;
896
+ }
897
+ public function Mellicart_Pre_Submission_By_HANNANStd( $form ) {
898
+ $mellicart_fields = GFCommon::get_fields_by_type( $form, array( 'mellicart' ) );
899
+ foreach ( (array) $mellicart_fields as $field ) {
900
+ $input_name = "input_{$field['id']}";
901
+ $input_value = ! rgempty( $input_name ) ? rgpost( $input_name ) : "";
902
+ if ( !empty( $input_value ) ) {
903
+ if (strlen($input_value) == 8 )
904
+ $_POST[ "input_{$field['id']}" ] = '00'.$input_value;
905
+ if (strlen($input_value) == 9 )
906
+ $_POST[ "input_{$field['id']}" ] = '0'.$input_value;
907
+ $_POST[ "input_{$field['id']}" ] = $input_value;
908
+ }
909
+ }
910
  }
911
  public function Add_Melli_Cart_Field_Setting_By_HANNANStd( $position, $form_id ){
912
  if( $position == 50 ){
assets/css/{admin-styles.css → admin.css} RENAMED
@@ -81,4 +81,5 @@ margin: 0 69px 0 99px !important;
81
  .ui-tabs .ui-tabs-nav li {
82
  margin-left: 0.2em !important;
83
  margin-right: 0 !important;
 
84
  }
81
  .ui-tabs .ui-tabs-nav li {
82
  margin-left: 0.2em !important;
83
  margin-right: 0 !important;
84
+ float: right !important;
85
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: gravityforms,gravity forms,persian gravity forms,persian gravityforms,grav
4
  Donate link: http://www.webforest.ir
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
- Stable tag: 1.7.3
8
  License: GPL 2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  This WordPress plugin extends the Gravity Forms plugin and its addons with the Persian language .
@@ -84,6 +84,8 @@ You can read complete documentations on the [GravityForms.ir](http://www.Gravity
84
  19. Iranian National Code field Advanced setting
85
 
86
  == Changelog ==
 
 
87
  = 1.7.3 =
88
  * update translation file
89
  = 1.7.2 =
@@ -154,6 +156,8 @@ You can read complete documentations on the [GravityForms.ir](http://www.Gravity
154
  * First version
155
 
156
  == Upgrade Notice ==
 
 
157
  = 1.7.3 =
158
  * update translation file
159
  = 1.7.2 =
4
  Donate link: http://www.webforest.ir
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
+ Stable tag: 1.7.4
8
  License: GPL 2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
  This WordPress plugin extends the Gravity Forms plugin and its addons with the Persian language .
84
  19. Iranian National Code field Advanced setting
85
 
86
  == Changelog ==
87
+ = 1.7.4 =
88
+ * Fixed : Some Minor bugs
89
  = 1.7.3 =
90
  * update translation file
91
  = 1.7.2 =
156
  * First version
157
 
158
  == Upgrade Notice ==
159
+ = 1.7.4 =
160
+ * Fixed : Some Minor bugs
161
  = 1.7.3 =
162
  * update translation file
163
  = 1.7.2 =