placing text into 520 tag. Help plz.!
hello, i want to embed this code in 520 tag so that it places text file into 520 (abstract) tag before saving the record .... the following php code accepts a pdf file path, converts it 2 text and place it into the text area. $file=$_POST['file']; exec ("pdftotext $file '/var/www/testFile.txt'"); exec ("tr -d '\012' </var/www/testFile.txt> /var/www/tf.txt"); $myFile = "/var/www/tf.txt"; $fh = fopen($myFile, 'r'); $theData = fread($fh, 10000000); fclose($fh); echo '<textarea name="stuff" cols="60" rows="10">'; echo stripslashes($theData); echo '</textarea><br>'; want to place this text into the abstract field(520 tag). plz help me doing this. Thank u :)
i want to embed this code in 520 tag so that it places text file into 520 (abstract) tag before saving the record ....
I assume you mean that you want to do this in the Koha Cataloging interface?
echo '<textarea name="stuff" cols="60" rows="10">'; echo stripslashes($theData); echo '</textarea><br>';
This might work if you were working with Perl (which is what Koha is written in) and you were modifying the addbiblio.pl script. As it is you have a couple of options: 1. Deploy your PHP script as a separate page. Copy the resulting text from your PHP page and copy it manually into the relevant textarea in Koha's MARC editor. 2. Configure your PHP script to return plain text and write a some custom javascript to use AJAX to grab the text from the PHP script and automatically populate the 520 tag textarea. It sounds possible, but I'm not sure how you would connect the two pieces: how would the MARC editor pass an identifying token to the PHP script to tell it which record to pull? That's something you'd have to figure out. -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
This could be done as a plugin for the marc editor, if you can write perl. I think that would be by far the best solution. Check out the existing plugins for some guidance. I shouldn't be much harder to do in perl that it is in php. Kyle http://www.kylehall.info Information Technology Crawford County Federated Library System ( http://www.ccfls.org ) On Tue, Mar 23, 2010 at 9:05 AM, Owen Leonard <oleonard@myacpl.org> wrote:
i want to embed this code in 520 tag so that it places text file into 520 (abstract) tag before saving the record ....
I assume you mean that you want to do this in the Koha Cataloging interface?
echo '<textarea name="stuff" cols="60" rows="10">'; echo stripslashes($theData); echo '</textarea><br>';
This might work if you were working with Perl (which is what Koha is written in) and you were modifying the addbiblio.pl script. As it is you have a couple of options:
1. Deploy your PHP script as a separate page. Copy the resulting text from your PHP page and copy it manually into the relevant textarea in Koha's MARC editor.
2. Configure your PHP script to return plain text and write a some custom javascript to use AJAX to grab the text from the PHP script and automatically populate the 520 tag textarea. It sounds possible, but I'm not sure how you would connect the two pieces: how would the MARC editor pass an identifying token to the PHP script to tell it which record to pull? That's something you'd have to figure out.
-- Owen
-- Web Developer Athens County Public Libraries http://www.myacpl.org _______________________________________________ Koha mailing list Koha@lists.katipo.co.nz http://lists.katipo.co.nz/mailman/listinfo/koha
Thanks a lot Owen.
i think the 1st option given by u is easier to implement.
1. Deploy your PHP script as a separate page. Copy the resulting text from your PHP page and copy it manually into the relevant textarea in Koha's MARC editor.
i am new to koha. so could u plz tell how i can edit the file to add an extra button near the 520 tag, on clicking the button a text window pops out, from which i can copy and paste the contents manually. i think the files that must be edited are /home/koha/intranet/cgi-bin/cataloguing/addbiblio.pl /home/koha/intranet/htdocs/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl plz help me.
i am new to koha. so could u plz tell how i can edit the file to add an extra button near the 520 tag, on clicking the button a text window pops out, from which i can copy and paste the contents manually.
Why do you need to pop up a window if you're going to copy and paste manually? Why not paste directly into the textarea on the MARC edit screen? -- Owen -- Web Developer Athens County Public Libraries http://www.myacpl.org
participants (3)
-
arun j -
Kyle Hall -
Owen Leonard