From abde0791d0f8af091a1b806cb0cdf1e7dfdc1a93 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Mon, 15 Jun 2020 16:01:35 +0530 Subject: fixed content --- pspice_to_kicad.module | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pspice_to_kicad.module b/pspice_to_kicad.module index 07881b9..6389719 100755 --- a/pspice_to_kicad.module +++ b/pspice_to_kicad.module @@ -736,7 +736,7 @@ function pspice_to_kicad_convert_approved() Dear " . $user_data->name . ", -The uploaded PSpice file " . $row->upload_filename . " is successfully converted to Kicad format. This can be used in http://esim.fossee.in . You can download the converted file from http://esim.fossee.in/pspice-to-kicad/download/file/" . $fileid . " +The uploaded PSpice file " . $row->upload_filename . " is successfully converted to Kicad format. This can be used in https://esim.fossee.in . You can download the converted file from https://esim.fossee.in/pspice-to-kicad/download/file/" . $fileid . " Best Wishes,
" . variable_get('site_name', '') . " Team,
@@ -852,8 +852,7 @@ function pspice_to_kicad_upload_form_validate() } if (!pspice_to_kicad_check_valid_filename($_FILES['files']['name'][$file_form_name])) { - form_set_error($file_form_name, t('Invalid file name specified. No Space are allowed in - a filename.')); + form_set_error($file_form_name, t('Invalid file name specified. No Space are allowed in a filename.')); } } -- cgit From ba7013f58b0d8348ae1502f0e45c646c9faa3470 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Mon, 15 Jun 2020 16:07:27 +0530 Subject: updated the delete permission --- pspice_to_kicad.module | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/pspice_to_kicad.module b/pspice_to_kicad.module index 6389719..7764cb9 100755 --- a/pspice_to_kicad.module +++ b/pspice_to_kicad.module @@ -1,22 +1,4 @@ array( - "title" => t("Access pspice_to_kicad"), - "description" => t("Allows users to view converted."), - ), - "manage pspice_to_kicad" => array( - "title" => t("Upload pspice_to_kicad Files"), - "description" => t("Allows users to upload files for pspice to kicad convertor."), - ), - "convert pspice_to_kicad" => array( - "title" => t("Files to be converted"), - "description" => t("Allows admin to see files to be convert from pspice to kicad."), - ), - - ); -} function pspice_to_kicad_menu() { @@ -107,7 +89,7 @@ function pspice_to_kicad_menu() 'title' => 'Delete File', 'description' => 'Delete File', 'page callback' => 'pspice_to_kicad_delete_file', - 'access arguments' => array("convert pspice_to_kicad"), + 'access arguments' => array("delete pspice_to_kicad file"), 'type' => MENU_CALLBACK, ); @@ -148,6 +130,29 @@ function pspice_to_kicad_menu() return $items; } +function pspice_to_kicad_permission() +{ + return array( + "access pspice_to_kicad" => array( + "title" => t("Access pspice_to_kicad"), + "description" => t("Allows users to view converted."), + ), + "manage pspice_to_kicad" => array( + "title" => t("Upload pspice_to_kicad Files"), + "description" => t("Allows users to upload files for pspice to kicad convertor."), + ), + "convert pspice_to_kicad" => array( + "title" => t("Files to be converted"), + "description" => t("Allows admin to see files to be convert from pspice to kicad."), + ), + "delete pspice_to_kicad file" => array( + "title" => t("Files to be deleted"), + "description" => t("Allows admin to delete files from pspice to kicad."), + ), + + ); +} + function pspice_to_kicad_check_valid_filename($file_name) { if (preg_match("/\\s/", $file_name)) { -- cgit From b0aa07925c667119d475682793821aa4cd39ee39 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Mon, 15 Jun 2020 16:15:45 +0530 Subject: updated delete function --- pspice_to_kicad.module | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pspice_to_kicad.module b/pspice_to_kicad.module index 7764cb9..95828fc 100755 --- a/pspice_to_kicad.module +++ b/pspice_to_kicad.module @@ -1115,7 +1115,6 @@ function pspice_to_kicad_delete_file() $querycheck = db_select('custom_kicad_convertor'); $querycheck->fields('custom_kicad_convertor'); $querycheck->condition('id', $fileid); - $querycheck->condition('converted_flag', "1"); $resultcheck = $querycheck->execute(); $number_of_rows = $resultcheck->rowCount(); @@ -1128,7 +1127,7 @@ function pspice_to_kicad_delete_file() } else { - drupal_set_message('Already converted file cannot be delete.', 'error'); + drupal_set_message('File can not be deleted. Please contact to site administrator', 'error'); drupal_goto("pspice-to-kicad/convert"); return; } @@ -1141,7 +1140,6 @@ function pspice_to_kicad_delete_file_form($form, &$form_state, $fileid) $querycheck = db_select('custom_kicad_convertor'); $querycheck->fields('custom_kicad_convertor'); $querycheck->condition('id', $fileid); - $querycheck->condition('converted_flag', "1"); $resultcheck = $querycheck->execute(); $number_of_rows = $resultcheck->rowCount(); @@ -1191,7 +1189,6 @@ function pspice_to_kicad_delete_file_form_submit($form, &$form_state) $querycheck = db_select('custom_kicad_convertor'); $querycheck->fields('custom_kicad_convertor'); $querycheck->condition('id', $fileid); - $querycheck->condition('converted_flag', "1"); $resultcheck = $querycheck->execute(); $row = $resultcheck->fetchObject(); -- cgit From 350dfa082482fe29598e6c9eab39b189ba689216 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Mon, 15 Jun 2020 16:20:59 +0530 Subject: updated email --- pspice_to_kicad.module | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pspice_to_kicad.module b/pspice_to_kicad.module index 95828fc..79371d1 100755 --- a/pspice_to_kicad.module +++ b/pspice_to_kicad.module @@ -401,7 +401,7 @@ function pspice_to_kicad_add_form_submit($form, &$form_state) $from = variable_get('kicad_from_email', ''); $bcc = variable_get('kicad_emails', ''); $cc = variable_get('kicad_cc_emails', ''); - $subject = "Successful upload of PSpice schematic"; + $subject = "[esim.in][PSpice to KiCad Converter] Successful upload of PSpice schematic"; $email_body = " @@ -735,7 +735,7 @@ function pspice_to_kicad_convert_approved() $from = variable_get('kicad_from_email', ''); $bcc = variable_get('kicad_emails', ''); $cc = variable_get('kicad_cc_emails', ''); - $subject = "PSpice file converted successfully"; + $subject = "[esim.in][PSpice to KiCad Converter] PSpice file converted successfully"; $email_body = " @@ -1212,7 +1212,7 @@ function pspice_to_kicad_delete_file_form_submit($form, &$form_state) $from = variable_get('kicad_from_email', ''); $bcc = variable_get('kicad_emails', ''); $cc = variable_get('kicad_cc_emails', ''); - $subject = "PSpice to KiCad converter: Uploaded schematic file deleted"; + $subject = "[esim.in][PSpice to KiCad Converter] PSpice to KiCad converter: Uploaded schematic file deleted"; $email_body = " -- cgit From 54e7af632961f52d81e4c1cb2a2827560f86871f Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Mon, 15 Jun 2020 16:23:40 +0530 Subject: updated settings --- settings.inc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/settings.inc b/settings.inc index 60a6eed..6676e92 100755 --- a/settings.inc +++ b/settings.inc @@ -1,7 +1,7 @@ 'textfield', @@ -41,6 +41,15 @@ function pspicefile_settings_form($form_state) '#required' => true, '#default_value' => variable_get('pspice_files_extensions', ''), ); + $form['extensions']['pdfpspicefile'] = array( + '#type' => 'textfield', + '#title' => t('Allowed PDF file extensions'), + '#description' => t('A comma separated list WITHOUT SPACE of source file extensions that are permitted to be uploaded on the server'), + '#size' => 50, + '#maxlength' => 255, + '#required' => true, + '#default_value' => variable_get('pdfpspicefile_files_extensions', ''), + ); $form['extensions']['kicadcorrectedfile'] = array( '#type' => 'textfield', '#title' => t('Allowed Kicad corrected file extensions'), @@ -69,6 +78,7 @@ function pspicefile_settings_form_submit($form, &$form_state) variable_set('kicad_cc_emails', $form_state['values']['cc_emails']); variable_set('kicad_from_email', $form_state['values']['from_email']); variable_set('pspice_files_extensions', $form_state['values']['pspicefile']); + variable_set('pdfpspicefile_files_extensions', $form_state['values']['pdfpspicefile']); variable_set('kicad_corrected_files_extensions', $form_state['values']['kicadcorrectedfile']); drupal_set_message(t('Settings updated'), 'status'); } -- cgit