Log in
Subscribe Now!Subscription:
$99/6 months - $149/12 months
Had a positive JobGrok experience?
Leave us a review here.
 JobGrok
Welcome Guest   [Register]  [Login]
 Subject :Ternary switches in static_raw don't seem to be working (1.2.0).. 2009-12-16 06:26:01 
wrduncan
Senior Boarder
Joined: 2009-06-12 12:33:12
Posts: 76
Location

Just noticed that the ternary switches (days of the week availability) don't seem to be working. I am only getting Sunday listed on the pdf file. Anyone have any thoughts on how to fix this?

 

Thanks.

IP Logged
Last Edited On: 2009-12-16 06:26:01 By wrduncan for the Reason Added version number
 Subject :Re:Ternary switches in static_raw don't seem to be working (1.2.0).. 2009-12-16 06:56:56 
wrduncan
Senior Boarder
Joined: 2009-06-12 12:33:12
Posts: 76
Location

Temporary fix (was the best I could come up with, I'm sure the developers will have a better, more permanent solution:

This seems to work, but it introduces a temporary variable, and makes the code a little heavier:

	if ($this->params->get('employment_information_available','1') == '1')
{
$availTemp = '';
$this->application->monday=='1' ? $availTemp.='Monday, ':'';
$this->application->tuesday=='1' ? $availTemp.='Tuesday, ':'';
$this->application->wednesday=='1' ? $availTemp.='Wednesday, ':'';
$this->application->thursday=='1' ? $availTemp.='Thursday, ':'';
$this->application->friday=='1' ? $availTemp.= 'Friday, ':'';
$this->application->saturday=='1' ? $availTemp.='Saturday, ':'';
$this->application->sunday=='1' ? $availTemp.='Sunday':'';
$pdf->outCombo(JTEXT::_('AVAILABLE'),$availTemp);
}

This gives me what I needed, except it doesn't evaluate the spaces and commas very well. For some reason it wasn't liking the space at the end of the ternary argument, or the string of them all together. Dunno.

IP Logged
Page # 


Powered by ccBoard


Search