Re: [fw-general] Zend Framework 1.8.0 sanity check tarballs available

2009-04-28 Thread Robert Castley

http://jotbug.org now running on 1.8.0 :-)

Had to setFallback on autoloader temporarily until we can refactor to  
support 1.8.0 fully :-)


Thank you!

- Robert


On 28 Apr 2009, at 06:42, Matthew Weier O'Phinney wrote:


We have posted sanity check tarballs of the upcoming 1.8.0 release on
the site. You may get them at the following URLs:

   http://framework.zend.com/releases/preview/ZendFramework-1.8.0.tar.gz
   http://framework.zend.com/releases/preview/ZendFramework-1.8.0.zip
   http://framework.zend.com/releases/preview/ZendFramework-1.8.0-minimal.tar.gz
   http://framework.zend.com/releases/preview/ZendFramework-1.8.0-minimal.zip
   http://framework.zend.com/releases/preview/ZendAMF-1.8.0.tar.gz
   http://framework.zend.com/releases/preview/ZendAMF-1.8.0.zip
   http://framework.zend.com/releases/preview/ZendGdata-1.8.0.tar.gz
   http://framework.zend.com/releases/preview/ZendGdata-1.8.0.zip
   http://framework.zend.com/releases/preview/ 
ZendInfoCard-1.8.0.tar.gz

   http://framework.zend.com/releases/preview/ZendInfoCard-1.8.0.zip

Please let the Zend Framework team know ASAP if you notice any  
critical

errors. We will be releasing within the next few days.

For those who have contributed to this release, thanks again for all  
the

hard work -- the end is in sight!

--
Matthew Weier O'Phinney
Project Lead| matt...@zend.com
Zend Framework  | http://framework.zend.com/



- Robert
robert.cast...@gmail.com





[fw-general] Zend_Payment Paypal, MoneyBookers, Tranzila. Looking for review

2009-04-28 Thread Vadim Gabriel
Hey,

I have just finished writing down 3 blog posts regarding the usage of each
of the current supported gateways by Zend_Payment. All of them were tested
already (Paypal was tested as much as i could test it). Since there are lots
of text written and the code examples are fairly long i decided to post this
in a blog rather in the wiki. The wiki loads very slow for me as it is and
posting so much text will just make the Page load even slower and look
longer. (I am still trying to figure out how to use those tabs)

So i will appreciate any feedback from who ever was/is willing to help by
either contributing to the code and/or posting some feedback. I think most
of it is done but you can always make something even better.

I have taken the time to add some methods i thought will be very usefull
(EX: Ability to return a formatted URL for paypal/moneybookers webscr
payment)

Zend_Payment_Gateway_Tranzila -
http://www.vadimg.co.il/2009/04/28/zend_payment-using-tranzila-as-the-gateway/

Zend_Payment_Gateway_MoneyBookers -
http://www.vadimg.co.il/2009/04/28/zend_payment-using-moneybookers-as-the-gateway/

Zend_Payment_Gateway_Paypal -
http://www.vadimg.co.il/2009/04/28/zend_payment-using-paypal-as-the-gateway/

I have taken the time to add all methods supported by Paypal and
MoneyBookers into this component. The more members trying this the better.
By that we could eliminate all bugs we will find. Altough the blog is
written in another language all three blog posts were written in English to
address to as many members as possible.

You can comment in the posts or here, Doesn't matter.

Thanks.
-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] Zend_Payment Paypal, MoneyBookers, Tranzila. Looking for review

2009-04-28 Thread Cem Derin


Zend_Payment_Gateway_Tranzila - 
http://www.vadimg.co.il/2009/04/28/zend_payment-using-tranzila-as-the-gateway/


Zend_Payment_Gateway_MoneyBookers - 
http://www.vadimg.co.il/2009/04/28/zend_payment-using-moneybookers-as-the-gateway/


Zend_Payment_Gateway_Paypal - 
http://www.vadimg.co.il/2009/04/28/zend_payment-using-paypal-as-the-gateway/



(FYI: Looks like the code in your blog has lost its indentation)



Re: [fw-general] Zend_Payment Paypal, MoneyBookers, Tranzila. Looking for review

2009-04-28 Thread Vadim Gabriel
Thanks. I just copy pasted it. It's just a draft.

Vince.

On Tue, Apr 28, 2009 at 1:26 PM, Cem Derin c...@wysiwyg.de wrote:


  Zend_Payment_Gateway_Tranzila -
 http://www.vadimg.co.il/2009/04/28/zend_payment-using-tranzila-as-the-gateway/

 Zend_Payment_Gateway_MoneyBookers -
 http://www.vadimg.co.il/2009/04/28/zend_payment-using-moneybookers-as-the-gateway/

 Zend_Payment_Gateway_Paypal -
 http://www.vadimg.co.il/2009/04/28/zend_payment-using-paypal-as-the-gateway/

  (FYI: Looks like the code in your blog has lost its indentation)




-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] Zend_Payment Paypal, MoneyBookers, Tranzila. Looking for review

2009-04-28 Thread till
Can you push it into a repository somewhere? E.g. Google Code, Github
or whatever?
I'd have a lot of comments, but it's hard to do that on your blog entry...

On Tue, Apr 28, 2009 at 12:29 PM, Vadim Gabriel vadim...@gmail.com wrote:
 Thanks. I just copy pasted it. It's just a draft.

 Vince.

 On Tue, Apr 28, 2009 at 1:26 PM, Cem Derin c...@wysiwyg.de wrote:

 Zend_Payment_Gateway_Tranzila -
 http://www.vadimg.co.il/2009/04/28/zend_payment-using-tranzila-as-the-gateway/

 Zend_Payment_Gateway_MoneyBookers -
 http://www.vadimg.co.il/2009/04/28/zend_payment-using-moneybookers-as-the-gateway/

 Zend_Payment_Gateway_Paypal -
 http://www.vadimg.co.il/2009/04/28/zend_payment-using-paypal-as-the-gateway/

 (FYI: Looks like the code in your blog has lost its indentation)




 --
 Vincent Gabriel.
 Lead Developer, Senior Support.
 Zend Certified Engineer.
 Zend Framework Certified Engineer.
 -- http://www.vadimg.co.il/






Re: [fw-general] Zend_Payment Paypal, MoneyBookers, Tranzila. Looking for review

2009-04-28 Thread Vadim Gabriel
Hey,

Yea sure.

http://code.google.com/p/zendpayment/

Your help is more then welcome and appreciated.

Vince.

On Tue, Apr 28, 2009 at 1:58 PM, till klimp...@gmail.com wrote:

 Can you push it into a repository somewhere? E.g. Google Code, Github
 or whatever?
 I'd have a lot of comments, but it's hard to do that on your blog entry...

 On Tue, Apr 28, 2009 at 12:29 PM, Vadim Gabriel vadim...@gmail.com
 wrote:
  Thanks. I just copy pasted it. It's just a draft.
 
  Vince.
 
  On Tue, Apr 28, 2009 at 1:26 PM, Cem Derin c...@wysiwyg.de wrote:
 
  Zend_Payment_Gateway_Tranzila -
 
 http://www.vadimg.co.il/2009/04/28/zend_payment-using-tranzila-as-the-gateway/
 
  Zend_Payment_Gateway_MoneyBookers -
 
 http://www.vadimg.co.il/2009/04/28/zend_payment-using-moneybookers-as-the-gateway/
 
  Zend_Payment_Gateway_Paypal -
 
 http://www.vadimg.co.il/2009/04/28/zend_payment-using-paypal-as-the-gateway/
 
  (FYI: Looks like the code in your blog has lost its indentation)
 
 
 
 
  --
  Vincent Gabriel.
  Lead Developer, Senior Support.
  Zend Certified Engineer.
  Zend Framework Certified Engineer.
  -- http://www.vadimg.co.il/
 
 
 
 




-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


[fw-general] h1Zend_PDF support which PDF Versionh1

2009-04-28 Thread Kexiao Liao

What is the PDF file format version Zend_PDF support right now? I have
several PDF files under  version 1.6 and version 1.7,  It seems Zend_PDF
does not support these kinds of pdf file version.
Can anyone give some detail information about the PDF file version which
Zend_PDF supports. Thanks in advance.

Kevin

-- 
View this message in context: 
http://www.nabble.com/%3Ch1%3EZend_PDF-support-which-PDF-Version%3Ch1%3E-tp23276895p23276895.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] h1Zend_PDF support which PDF Versionh1

2009-04-28 Thread Vadim Gabriel
Hey,

From what you can understand in the manual the component supports PDF files
v 1.4 and up. So i think it should support 1.6  1.7.

What's the problem your having?

Vince.

On Tue, Apr 28, 2009 at 4:12 PM, Kexiao Liao li...@ccf.org wrote:


 What is the PDF file format version Zend_PDF support right now? I have
 several PDF files under  version 1.6 and version 1.7,  It seems Zend_PDF
 does not support these kinds of pdf file version.
 Can anyone give some detail information about the PDF file version which
 Zend_PDF supports. Thanks in advance.

 Kevin

 --
 View this message in context:
 http://www.nabble.com/%3Ch1%3EZend_PDF-support-which-PDF-Version%3Ch1%3E-tp23276895p23276895.html
 Sent from the Zend Framework mailing list archive at Nabble.com.




-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/


Re: [fw-general] h1Zend_PDF support which PDF Versionh1

2009-04-28 Thread Kexiao Liao

Uploaded file(WebContents.pdf) is a pdf file under 1.7 version which was
created through TCPDF
(http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf) library.
When I use Zend_Pdf::load($fileName) to load this pdf file into Zend_Pdf, I
got following errors:
 
Fatal error: Uncaught exception 'Zend_Pdf_Exception' with message
'Unsupported PDF version. Zend_Pdf supports PDF 1.0-1.4. Current version -
'1.70'' in /var/www/ZendFramework-1.7.7/library/Zend/Pdf/Parser.php:409
Stack trace: #0 /var/www/ZendFramework-1.7.7/library/Zend/Pdf.php(297):
Zend_Pdf_Parser-__construct('../WebContents',
Object(Zend_Pdf_ElementFactory_Proxy), true) #1
/var/www/ZendFramework-1.7.7/library/Zend/Pdf.php(250):
Zend_Pdf-__construct('../WebContents', NULL, true) #2
/home/liaok/liaok/public_html/neon/InfReqFor/pdf/CreatePdfView.php(33):
Zend_Pdf::load('../WebContents') #3 {main} thrown in
/var/www/ZendFramework-1.7.7/library/Zend/Pdf/Parser.php on line 409

 





vince. wrote:
 
 Hey,
 
 From what you can understand in the manual the component supports PDF
 files
 v 1.4 and up. So i think it should support 1.6  1.7.
 
 What's the problem your having?
 
 Vince.
 
 On Tue, Apr 28, 2009 at 4:12 PM, Kexiao Liao li...@ccf.org wrote:
 

 What is the PDF file format version Zend_PDF support right now? I have
 several PDF files under  version 1.6 and version 1.7,  It seems Zend_PDF
 does not support these kinds of pdf file version.
 Can anyone give some detail information about the PDF file version which
 Zend_PDF supports. Thanks in advance.

 Kevin

 --
 View this message in context:
 http://www.nabble.com/%3Ch1%3EZend_PDF-support-which-PDF-Version%3Ch1%3E-tp23276895p23276895.html
 Sent from the Zend Framework mailing list archive at Nabble.com.


 
 
 -- 
 Vincent Gabriel.
 Lead Developer, Senior Support.
 Zend Certified Engineer.
 Zend Framework Certified Engineer.
 -- http://www.vadimg.co.il/
 
 
http://www.nabble.com/file/p23277283/WebContents.pdf WebContents.pdf 
-- 
View this message in context: 
http://www.nabble.com/%3Ch1%3EZend_PDF-support-which-PDF-Version%3Ch1%3E-tp23276895p23277283.html
Sent from the Zend Framework mailing list archive at Nabble.com.



RE: [fw-general] h1Zend_PDF support which PDF Versionh1

2009-04-28 Thread Liao, Kexiao
Attachment is a pdf file under 1.7 version which was created through
TCPDF (http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf)
library. When I use Zend_Pdf::load($fileName) to load this pdf file into
Zend_Pdf, I got following errors:
 
Fatal error: Uncaught exception 'Zend_Pdf_Exception' with message
'Unsupported PDF version. Zend_Pdf supports PDF 1.0-1.4. Current version
- '1.70'' in
/var/www/ZendFramework-1.7.7/library/Zend/Pdf/Parser.php:409 Stack
trace: #0 /var/www/ZendFramework-1.7.7/library/Zend/Pdf.php(297):
Zend_Pdf_Parser-__construct('../WebContents',
Object(Zend_Pdf_ElementFactory_Proxy), true) #1
/var/www/ZendFramework-1.7.7/library/Zend/Pdf.php(250):
Zend_Pdf-__construct('../WebContents', NULL, true) #2
/home/liaok/liaok/public_html/neon/InfReqFor/pdf/CreatePdfView.php(33):
Zend_Pdf::load('../WebContents') #3 {main} thrown in
/var/www/ZendFramework-1.7.7/library/Zend/Pdf/Parser.php on line 409

 
Kevin
 



From: Vadim Gabriel [mailto:vadim...@gmail.com] 
Sent: Tuesday, April 28, 2009 09:17
To: Liao, Kexiao
Cc: fw-general@lists.zend.com
Subject: Re: [fw-general] h1Zend_PDF support which PDF Versionh1


Hey,

From what you can understand in the manual the component supports PDF
files v 1.4 and up. So i think it should support 1.6  1.7.

What's the problem your having?

Vince.


On Tue, Apr 28, 2009 at 4:12 PM, Kexiao Liao li...@ccf.org wrote:



What is the PDF file format version Zend_PDF support right now?
I have
several PDF files under  version 1.6 and version 1.7,  It seems
Zend_PDF
does not support these kinds of pdf file version.
Can anyone give some detail information about the PDF file
version which
Zend_PDF supports. Thanks in advance.

Kevin

--
View this message in context: 
http://www.nabble.com/%3Ch1%3EZend_PDF-support-which-PDF-Version%3Ch1%3E
-tp23276895p23276895.html
Sent from the Zend Framework mailing list archive at Nabble.com.






-- 
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/





===

P Please consider the environment before printing this e-mail

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News  World Report (2008).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.


WebContents.pdf
Description: WebContents.pdf


Re: [fw-general] h1Zend_PDF support which PDF Versionh1

2009-04-28 Thread Tobias Gies

Hey Kevin,

as you can see in the exception text, Zend_Pdf supports PDF 1.0 - 1.4.

Best regards,
Tobias

Liao, Kexiao schrieb:
Attachment is a pdf file under 1.7 version which was created through 
TCPDF 
(http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf) library. 
When I use Zend_Pdf::load($fileName) to load this pdf file into 
Zend_Pdf, I got following errors:
 
*Fatal error*: Uncaught exception 'Zend_Pdf_Exception' with message 
'Unsupported PDF version. Zend_Pdf supports PDF 1.0-1.4. Current 
version - '1.70'' in 
/var/www/ZendFramework-1.7.7/library/Zend/Pdf/Parser.php:409 Stack 
trace: #0 /var/www/ZendFramework-1.7.7/library/Zend/Pdf.php(297): 
Zend_Pdf_Parser-__construct('../WebContents', 
Object(Zend_Pdf_ElementFactory_Proxy), true) #1 
/var/www/ZendFramework-1.7.7/library/Zend/Pdf.php(250): 
Zend_Pdf-__construct('../WebContents', NULL, true) #2 
/home/liaok/liaok/public_html/neon/InfReqFor/pdf/CreatePdfView.php(33): 
Zend_Pdf::load('../WebContents') #3 {main} thrown in 
*/var/www/ZendFramework-1.7.7/library/Zend/Pdf/Parser.php* on line *409*
 
Kevin
 



*From:* Vadim Gabriel [mailto:vadim...@gmail.com]
*Sent:* Tuesday, April 28, 2009 09:17
*To:* Liao, Kexiao
*Cc:* fw-general@lists.zend.com
*Subject:* Re: [fw-general] h1Zend_PDF support which PDF Versionh1

Hey,

From what you can understand in the manual the component supports PDF 
files v 1.4 and up. So i think it should support 1.6  1.7.


What's the problem your having?

Vince.

On Tue, Apr 28, 2009 at 4:12 PM, Kexiao Liao li...@ccf.org 
mailto:li...@ccf.org wrote:



What is the PDF file format version Zend_PDF support right now? I have
several PDF files under  version 1.6 and version 1.7,  It seems
Zend_PDF
does not support these kinds of pdf file version.
Can anyone give some detail information about the PDF file version
which
Zend_PDF supports. Thanks in advance.

Kevin

--
View this message in context:

http://www.nabble.com/%3Ch1%3EZend_PDF-support-which-PDF-Version%3Ch1%3E-tp23276895p23276895.html
Sent from the Zend Framework mailing list archive at Nabble.com.




--
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.
-- http://www.vadimg.co.il/



===

P Please consider the environment before printing this e-mail



Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News  World Report (2008).  
Visit us online at http://www.clevelandclinic.org for

a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.
  




Re: [fw-general] Zend_Payment Paypal, MoneyBookers, Tranzila. Looking for review

2009-04-28 Thread till
Hey,

so here are some thoughts. I'm commenting mostly on paypal, since I'm
familiar with them. I think most of this applies to your other
drivers/gateways as well. From what I remember with working with
Paypal (we do a lot of subscriptions), it's a pain to work with the
API and it's far from obvious. I think the objective should be to make
it usable to the developer.

First off, one question. We are doing subscriptions, and the way it's
setup is, that Paypal notifies us. This notification is independent of
the general request and the customer. They aim to do it in 'realtime',
but it can sometimes take up to five minutes for Paypal to notify us
that the 'order' has been processed while the customer has already
seen a 'Thank you for your money' on Paypal's website. Now, the Q is
-- how do I receive these notifications with your code?

I couldn't figure it out, because what I have to do is wait for a
request from paypal and resubmit all parameters for verification. But
maybe I've overlooked that one. So apologies in advance.

On to my feedback, I hope you don't mind. (Just let me stress again,
that even though I got some things that I'd like to see
improved/changed, I really appreciate the work done so far very much.)

1) generally, don't use private, as it makes extending your code
'harder'. I couldn't override/extend the paypal gateway and then I
couldn't access the httpclient. Use protected instead.

2) Generally public class members (variables and methods) shouldn't be
prefixed with '_', only protected and private should.

3) Provide a way for people to override the Zend_Http_Client, e.g.:
public function __construct(Zend_Http_Client $client = null)
{
  if ($client !== null) {
$this-client = $client;
  } else {
// create instance here
  }
}

Maybe also add a setter, setHttpClient(Zend_Http_Client $client).

4) use set and get more appropriately, e.g. creditcardInfo(), should
be something like, setCreditcardInfo() (or maybe, setCreditcard()?).

5) Methods such as 'addressVerify' could be more simple/convenient for
the developer, e.g. isVerifiedAddress($street, $etc) -- it would
return a boolean. I don't see why 'addressVerify' in its current form
returns an array. A boolean would be more straight to the point (kind
of like you did with isSuccess()).

6) In general/IMHO, there's too much in one class. I understand that
it's all related to paypal, but authorization, transaction management,
etc. could be phased out into subclasses.

e.g.:
Zend_Payment_Gateway_Paypal_Transaction
(Zend/Payment/Gateway/Paypal/Transaction.php)

$paypal = Zend_Payment::factory('paypal');
$transaction = $paypal-transaction();
$transaction-get($id);
$transaction-doRefund($id, 'full');
$transaction-search('2009-04-27');

Or:
$order = $transaction-create(...);
$order-setCustomer(Zend_Payment_Gateway_Paypal_Customer $customer);
...

Zend_Payment_Gateway_Paypal_Customer
(Zend/Payment/Gateway/Paypal/Customer.php)

$customer = $paypal-customer($id); // an identifier of the customer
$customer-getBalance();
$customer-getAddressbook();
$customer-addAddress();
$customer-isVerified();

(These are just examples, as of how the interface could be more intuitive.)

7) header() calls in your library should be avoided at all costs for
multiple reasons, e.g. it makes it harder (for yourself) in terms of
testability. And what if I wanted to display the link instead to my
customer? (E.g. click here to continue to paypal). Instead those
methods should be renamed to, 'getExpressCheckoutLink',
'getBillingAgreementLink' (or similar). With the getter, the developer
can either pipe it to header() himself, or do the redirect using the
framework code, or display the link in a view so people click on it
themselves, etc..

8) Simplify control-flow, e.g. in your current form, massPay() should
look like this instead:
public function massPay(array $_receivers=array() )
{
  if (count($_receivers) == 0) {
return null;
  }
  $this-addParam('METHOD', 'MassPay');
  foreach($_receivers as $i = $receiver) {
$this-addParam('L_EMAIL'.$i, $receiver['email']);
$this-addParam('L_AMT'.$i, urlencode($receiver['amount']));
$this-addParam('L_UNIQUEID'.$i, urlencode($receiver['uniqueID']));
$this-addParam('L_NOTE'.$i, urlencode($receiver['note']));
  }
  return $this-_buildRequest();
}

Save an is_array() by forcing the type to array in the method's
signature, and (my personal favorite) exit the method early if there's
nothing to process.

9) phpdoc and general CS could use some love. :)

10) Since you're using Zend_Http_Client in your code, you should trap
its exceptions, and re-cast, e.g.:

(in Zend_Payment_Gateway_Paypal::_buildRequest())

try {
   $this-client-request();
} catch (Zend_Http_Client_Exception $e) {
   $msg = Message: {$e-getMessage()}, Code: {$e-getCode()};
   throw new Zend_Payment_Exception($msg, Zend_Payment::ERR_HTTP);
}

11) I'm not sure, if I'm the only one using exception codes, but I'd
also like to see that across the board. 

RE: [fw-general] How to set up dependant dropdowns in form

2009-04-28 Thread Anthony Smith
Thanks Brad.

 

Now I had one other question. Let's say my data looks like this:

{identifier:TERRITORY,items:[

{SUB:8-8-19-6,TERRITORY:8-8-19-66-1-3-25},

{SUB:8-8-19-6,TERRITORY:8-8-19-66-1-2-24}, ..

 

Instead of this:

{identifier:name,items:[

{name:0,0:Lion},

{name:1,0:Cheeta},

{name:2,0:Cat}, ...

 

 

I want to USE the SUB values to get the values for the TERRITORY. How do
I do that? 



From: Bart McLeod [mailto:mcl...@spaceweb.nl] 
Sent: Monday, April 27, 2009 11:22 AM
To: 411161
Cc: fw-general@lists.zend.com
Subject: Re: [fw-general] How to set up dependant dropdowns in form

 

You should be using dojo selects in the first place, I have a working
example (4files):
file index.phtml (in scripts/ directory)
?php echo $this-doctype() ?
html
head
?php echo $this-headTitle() ? 
?php echo $this-headMeta() ? 
?php echo $this-headLink() ? 
?php echo $this-headStyle() ? 
?php 

$this-dojo()-setLocalPath('/zf/js/dojo/dojo.js')
 -addStyleSheetModule('dijit.themes.tundra');
echo $this-dojo()-enable();
echo $this-headScript();
?

/head
body class=tundra
?php echo $this-form ?
?php echo $this-inlineScript() ?
/body
/html

//following files in root directory
file index.php:

?php
require_once 'autoload.php';
$view = new Zend_View();
Zend_Dojo::enableView($view);

$form = new Zend_Dojo_Form('myform');
$form-setView($view);

$autoComplete1 = new Zend_Dojo_Form_Element_FilteringSelect('sel_1');
//$autoComplete1 = new Zend_Form_Element_Select('sel_1');
$autoComplete1-setMultiOptions(
array('Cats', 'Dogs')
);
$autoComplete1-setAttrib('onchange', dijit.byId('sel_2').searchAttr =
dijit.byId('sel_1').getValue();return true);
$autoComplete1-setLabel('Select 1');
$form-addElement($autoComplete1);
$searchAttribute = @$_GET['sel_1'];
if( ! in_array($searchAttribute, array('0', '1'))){
$searchAttribute = '0';
}
$form-addElement(
'FilteringSelect',
'sel_2',
 array(
 'label' = 'Select 2',
 'storeId' = 'myData',
 'storeType'= 'dojo.data.ItemFileReadStore',
 'storeParams' = array( 'url' = '/zf/dojo.php',),
 'dijitParams' = array( 'searchAttr' = $searchAttribute,
),
 )
);
$form-addElement('submit','go');
$form-populate($_GET);
$view-form = $form-render();
$view-addBasePath('E:\werk\zf fixes\testsite');
echo $view-render('index.phtml');

?

file dojo.php:
?php
require_once 'autoload.php';

$data = new Zend_Dojo_Data();
$data-setIdentifier('name');

$cats = array('Lion', 'Cheeta', 'Cat');

foreach ($cats as $key = $cat) {
$data-addItem(array('name' = $key, '0' = $cat));
}

$dogs = array(3 = 'Bello', 4 = 'Blix', 5 = 'Freddy', 6 = 'Hungry
Bill');
foreach ($dogs as $key = $dog) {
$data-addItem(array('name' = $key,1 = $dog));
}

echo $data;

file autoload.php: (depecated)
?php

require_once 'Zend/Loader.php';
/**
 * Loads all Zend Framework classes automagically
 *
 * @param string $className
 */
function __autoload($className){
Zend_Loader::loadClass($className);
}

?

Hope this helps,

Bart

411161 schreef: 

 
 
Ace Paul wrote:
  

I have a form, which I would like to use dependent drop downs
in. I can't
seem to find anything about it hear, after looking all morning
trying to
work it out.
I have one field race_country
when an option is selected I would like to show the cities in
that
country.
The following is what I have currently in the form, which will
show all
countries and all cities.
Any help would be great. thanks
 
$table = new Country();
foreach ($table-fetchAll() as $c) {
$country-addMultiOption($c-country_id, $c-country_name);
}
 $this-addElement( $country);
  
 $city = new Zend_Form_Element_Select('race_city');
$city-setLabel('City')
 -setRequired(true);
 
$table = new City();
foreach ($table-fetchAll() as $c) {
$city-addMultiOption($c-city_id, $c-city_name);
}
 $this-addElement( $city);
 


 
Does anyone have a complete example of this?
 
I used this example to get it up and going:
http://techchorus.net/autocomplete-example-zenddojoformelementfilterings
elect-and-zenddojodata
 
With the change located in the comments:
div dojoType=dojo.data.ItemFileReadStore url=/strain/list
jsId=strainStore/div
 
but I am having trouble trying to do dependent drop downs. Any good
references out there, or is this too early to attempt with Zend   Dojo?
 
  


[fw-general] No default controller directory registered with front controller

2009-04-28 Thread iceangel89

i have set up an application using Zend_Tool then make it modular

/application
   /modules
  /default
  /module1
  /module2 ...

in application.ini made abit of change

resources.frontController.modulesdirectory = APPLICATION_PATH /modules
resources.frontController.defaultmodule = default

but now it says 

Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with
message 'No default controller directory registered with front controller

how can i setdefault controller?
-- 
View this message in context: 
http://www.nabble.com/No-default-controller-directory-registered-with-front-controller-tp23277936p23277936.html
Sent from the Zend Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend_Payment Paypal, MoneyBookers, Tranzila. Looking for review

2009-04-28 Thread Chris MacPherson
I have just been working with the ProtX gateway (now SagePay) and they 
also require a verification like Paypal's that Till mentioned. This 
means we have to process a response from them AFTER the initial 
transaction has taken place. This response may not be immediate.


I know you haven't included ProtX / SagePay in your list of gateways but 
I would probably be extending you classes in the near future so would be 
interested to hear how this would be done.


I really appreciate the effort you are putting in to this, I will be 
looking forward to using it when it's released :)


till wrote:

Hey,

so here are some thoughts. I'm commenting mostly on paypal, since I'm
familiar with them. I think most of this applies to your other
drivers/gateways as well. From what I remember with working with
Paypal (we do a lot of subscriptions), it's a pain to work with the
API and it's far from obvious. I think the objective should be to make
it usable to the developer.

First off, one question. We are doing subscriptions, and the way it's
setup is, that Paypal notifies us. This notification is independent of
the general request and the customer. They aim to do it in 'realtime',
but it can sometimes take up to five minutes for Paypal to notify us
that the 'order' has been processed while the customer has already
seen a 'Thank you for your money' on Paypal's website. Now, the Q is
-- how do I receive these notifications with your code?

I couldn't figure it out, because what I have to do is wait for a
request from paypal and resubmit all parameters for verification. But
maybe I've overlooked that one. So apologies in advance.

On to my feedback, I hope you don't mind. (Just let me stress again,
that even though I got some things that I'd like to see
improved/changed, I really appreciate the work done so far very much.)

1) generally, don't use private, as it makes extending your code
'harder'. I couldn't override/extend the paypal gateway and then I
couldn't access the httpclient. Use protected instead.

2) Generally public class members (variables and methods) shouldn't be
prefixed with '_', only protected and private should.

3) Provide a way for people to override the Zend_Http_Client, e.g.:
public function __construct(Zend_Http_Client $client = null)
{
  if ($client !== null) {
$this-client = $client;
  } else {
// create instance here
  }
}

Maybe also add a setter, setHttpClient(Zend_Http_Client $client).

4) use set and get more appropriately, e.g. creditcardInfo(), should
be something like, setCreditcardInfo() (or maybe, setCreditcard()?).

5) Methods such as 'addressVerify' could be more simple/convenient for
the developer, e.g. isVerifiedAddress($street, $etc) -- it would
return a boolean. I don't see why 'addressVerify' in its current form
returns an array. A boolean would be more straight to the point (kind
of like you did with isSuccess()).

6) In general/IMHO, there's too much in one class. I understand that
it's all related to paypal, but authorization, transaction management,
etc. could be phased out into subclasses.

e.g.:
Zend_Payment_Gateway_Paypal_Transaction
(Zend/Payment/Gateway/Paypal/Transaction.php)

$paypal = Zend_Payment::factory('paypal');
$transaction = $paypal-transaction();
$transaction-get($id);
$transaction-doRefund($id, 'full');
$transaction-search('2009-04-27');

Or:
$order = $transaction-create(...);
$order-setCustomer(Zend_Payment_Gateway_Paypal_Customer $customer);
...

Zend_Payment_Gateway_Paypal_Customer
(Zend/Payment/Gateway/Paypal/Customer.php)

$customer = $paypal-customer($id); // an identifier of the customer
$customer-getBalance();
$customer-getAddressbook();
$customer-addAddress();
$customer-isVerified();

(These are just examples, as of how the interface could be more intuitive.)

7) header() calls in your library should be avoided at all costs for
multiple reasons, e.g. it makes it harder (for yourself) in terms of
testability. And what if I wanted to display the link instead to my
customer? (E.g. click here to continue to paypal). Instead those
methods should be renamed to, 'getExpressCheckoutLink',
'getBillingAgreementLink' (or similar). With the getter, the developer
can either pipe it to header() himself, or do the redirect using the
framework code, or display the link in a view so people click on it
themselves, etc..

8) Simplify control-flow, e.g. in your current form, massPay() should
look like this instead:
public function massPay(array $_receivers=array() )
{
  if (count($_receivers) == 0) {
return null;
  }
  $this-addParam('METHOD', 'MassPay');
  foreach($_receivers as $i = $receiver) {
$this-addParam('L_EMAIL'.$i, $receiver['email']);
$this-addParam('L_AMT'.$i, urlencode($receiver['amount']));
$this-addParam('L_UNIQUEID'.$i, urlencode($receiver['uniqueID']));
$this-addParam('L_NOTE'.$i, urlencode($receiver['note']));
  }
  return $this-_buildRequest();
}

Save an is_array() by forcing the type to array in the method's
signature, 

Re: [fw-general] No default controller directory registered with front controller

2009-04-28 Thread Cem Derin

Hi,

The error message says, that you did not specify an controller 
_directory_! You can set a controller directory with the 
setControllerDirectory-Method of the front controller instance.


Cheers,

Cem

Fatal error: Uncaught exception 'Zend_Application_Bootstrap_Exception' with
message 'No default controller directory registered with front controller

how can i setdefault controller?
  




Re: [fw-general] Zend_Payment Paypal, MoneyBookers, Tranzila. Looking for review

2009-04-28 Thread Vadim Gabriel
Hey,

Wow. Talking about feedback. Those are some great pointers you have right
there. I will tackle them starting tomorrow to make it as much as developer
friendly as possible. Now to your pointers

About the first question you had with the notification upon payment or
subscription. From what i have read about it on paypal's developer central
and across the web is that you specify a return url or a notify_url that
paypal 'pings' or silently callbacks and that link can just be an action in
a controller that uses one of the methods to process the payment. I am not
sure if this is the exact case but in my testing (using sandbox) my
subscriptions were processed fine. So more testing on this or ideas will be
required i assume. To receive notifications based on the way your processing
the request the _parseIPNResponse will be used for 3 methods that actually
need it and they are documented in the class. I am not that familiar with
Paypal so if anyone willing to give this a go and test/edit the code he is
more then welcome.

1) Yea i agree. private will be changed to protected.

2) Yet again another CS thing, i will go over the code and try and make it
more CS complint.

3) Great idea. I will do just that. and include the setter method as well.

4) yea i could probably do that.

5) What if i want to get the returned array and use it's contents for
storing? I see the point of having isVerfiedAddress but wouldn't it be a
better idea to have both then just returning a single boolean value?

6) I was thinking about that while i was wrtting this. But then i said for
consistency i should stick with one class for each gateway. It's not a
problem to split those up to there appropriate classes. That's why i wanted
this feedback. The question is if this is something that more developers
would like to see? And in what way to split them up?

7) They maybe not named the way you said it but by default they return the
link not redirect. If you pass a boolean value of true to the $autoRedirect
then it will redirect. Both options are available.

8) Yea, i could probably use that for all methods.

9) Ahh i tried really hard on this one (phpdoc) and i provided the right
phpdoc style for the file, class, methods and property names. What did i
miss? Could you be more specific?

10) Yes, I was thinking if throwing exceptions will be a better choice then
just storing the error message returned in a class variables and then
retriving them later on. At some point i even included both. Do you think
throwing exceptions will be best handled? If so i could probably throw them
then just storing the message in a varible.

11) Actually that's already exists. and used in the Tranzila gateway. If you
take a look at the Zend_Payment_Gateway_Abstract you will notice them

/**
 * Payment result codes
 */
const APPROVED = 100; // payment approved
const DECLINED = 101; // payment declined
const OTHER = 102; // other
const FRAUD = 103; // fraud detected
const DUPLICATE = 104; // duplicate
const REVIEW = 105; // marked for reivew
const CCNUMBER_INVALID = 106;
const CVV_INVALID = 107;
const CCNUMBER_MISSING = 108;
const CCNUMBER_EXPIRED = 109;
const TRANSACTION_TYPE_INVALID = 110;
const TRANSACTION_CODE_INVALID = 111;
const CREDIT_TYPE_NOT_SUPPORTED = 112;
const CURRENCY_NOT_SUPPORTED = 113;
const GATEWAY_INACCESSIBLE = 114;
const FILL_ALL_FIELDS = 115;


Thanks again for the feedback. And if you or anyone else would like to help
out, It will be apprecaited.

Vince.




On Tue, Apr 28, 2009 at 5:03 PM, till klimp...@gmail.com wrote:

 Hey,

 so here are some thoughts. I'm commenting mostly on paypal, since I'm
 familiar with them. I think most of this applies to your other
 drivers/gateways as well. From what I remember with working with
 Paypal (we do a lot of subscriptions), it's a pain to work with the
 API and it's far from obvious. I think the objective should be to make
 it usable to the developer.

 First off, one question. We are doing subscriptions, and the way it's
 setup is, that Paypal notifies us. This notification is independent of
 the general request and the customer. They aim to do it in 'realtime',
 but it can sometimes take up to five minutes for Paypal to notify us
 that the 'order' has been processed while the customer has already
 seen a 'Thank you for your money' on Paypal's website. Now, the Q is
 -- how do I receive these notifications with your code?

 I couldn't figure it out, because what I have to do is wait for a
 request from paypal and resubmit all parameters for verification. But
 maybe I've overlooked that one. So apologies in advance.

 On to my feedback, I hope you don't mind. (Just let me stress again,
 that even though I got some things that I'd like to see
 improved/changed, I really appreciate the work done so far very much.)

 1) generally, don't use private, as it makes extending your code
 'harder'. I couldn't override/extend the 

Re: [fw-general] Zend_Payment Paypal, MoneyBookers, Tranzila. Looking for review

2009-04-28 Thread till
On Tue, Apr 28, 2009 at 6:48 PM, Vadim Gabriel vadim...@gmail.com wrote:
 Hey,

 Wow. Talking about feedback. Those are some great pointers you have right
 there. I will tackle them starting tomorrow to make it as much as developer
 friendly as possible. Now to your pointers

 About the first question you had with the notification upon payment or
 subscription. From what i have read about it on paypal's developer central
 and across the web is that you specify a return url or a notify_url that
 paypal 'pings' or silently callbacks and that link can just be an action in
 a controller that uses one of the methods to process the payment. I am not
 sure if this is the exact case but in my testing (using sandbox) my
 subscriptions were processed fine. So more testing on this or ideas will be
 required i assume. To receive notifications based on the way your processing
 the request the _parseIPNResponse will be used for 3 methods that actually
 need it and they are documented in the class. I am not that familiar with
 Paypal so if anyone willing to give this a go and test/edit the code he is
 more then welcome.

 (...)
 5) What if i want to get the returned array and use it's contents for
 storing? I see the point of having isVerfiedAddress but wouldn't it be a
 better idea to have both then just returning a single boolean value?

That would be a different method though. I mean, personally, I have
nothing against anyone storing the data, I just meant that is*()
methods should be reserved for true/false cases. I'm following PHP
basically -- is_file, is_readable, is_array, ...

 6) I was thinking about that while i was wrtting this. But then i said for
 consistency i should stick with one class for each gateway. It's not a
 problem to split those up to there appropriate classes. That's why i wanted
 this feedback. The question is if this is something that more developers
 would like to see? And in what way to split them up?

IMHO, it would be nice since it makes the API more simple and cleaner.

 7) They maybe not named the way you said it but by default they return the
 link not redirect. If you pass a boolean value of true to the $autoRedirect
 then it will redirect. Both options are available.

That's a fair compromise. ;-)

 (...)
 9) Ahh i tried really hard on this one (phpdoc) and i provided the right
 phpdoc style for the file, class, methods and property names. What did i
 miss? Could you be more specific?

Oh, basically I think you could improve the documentation by completing it.

I also like @see, or @uses. I'm not so sure what the ZF CS requires or
allows. Best double-check the manual. Some of the descriptions could
be more detailed (I thought), but sometimes an easier name for a
method or maybe breaking it up into sub classes would make that
irrelevant.

 10) Yes, I was thinking if throwing exceptions will be a better choice then
 just storing the error message returned in a class variables and then
 retriving them later on. At some point i even included both. Do you think
 throwing exceptions will be best handled? If so i could probably throw them
 then just storing the message in a varible.

Maybe allow people to control the behavior?

 11) Actually that's already exists. and used in the Tranzila gateway. If you
 take a look at the Zend_Payment_Gateway_Abstract you will notice them

You're right, I oversaw that. Then my request would be to use them
everywhere in order to make it consistent.

 (...)
 Thanks again for the feedback. And if you or anyone else would like to help
 out, It will be apprecaited.

I can give feedback always. That's for sure!
Also, we are in the process of evaluating different providers right
now. Maybe I can contribute another gateway.

Is Tranzila any good?

Cheers,
Till


[fw-general] Zend_Form DisplayGroup ViewScript decorator

2009-04-28 Thread Kostyantyn Shakhov
I’m trying to use a ViewScript decorator for DisplayGroup of a
Zend_Form. The view script contains form elements wrapped in a table.

In the Form:

$this-addDisplayGroup(
array([fields]),
'[group_name]',
array( 'legend' = '[name] ')
);

$group = $this-getDisplayGroup('[group_name]');

$group -setDecorators(array(
array('FormElements', array('viewScript' = '[view script]')),
 'Fieldset'
 ));

It displays the group with the legend but omit the html table markup.
How could I fix it?


[fw-general] jotBug is iPhone/Touch friendly

2009-04-28 Thread Robert Castley

With thanks to Phil and the iUI project - http://code.google.com/p/iui/

jotBug now has a iPhone/Touch web frontend :-)


Test it for yourself @http://jotbug.org from your iPhone/Touch :-)

All running on ZF 1.8.0 :-)

- Robert
robert.cast...@gmail.com