Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Mon May 20, 2019 8:49 pm
Hosted Voice Broadcast


All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Admin Interface - Show calender On Expiry date
PostPosted: Thu May 10, 2007 6:12 am 
Offline
User avatar

Joined: Sun Apr 29, 2007 4:08 am
Posts: 14
Hi
I want to add a javascript Calender
On Expiry Date Field on Create Customes on Admin web Interface .

Can anybody Help me regarding this issue.

Thanks in advance.


Top
 Profile  
 
 Post subject: Hello Mutaherul
PostPosted: Thu May 10, 2007 11:27 pm 
Offline
User avatar

Joined: Mon Apr 30, 2007 6:43 am
Posts: 1060
Location: Canada
I have made many ugly hacks in A2Billing. Here is one of them that will allow you to have a calendar for your date fields.

This will only do it for the expirationdate field, but I am confident that you will be able to make the same changes for other date fields.

Find the file "/form_data/FG_var_card.inc"

In that file, change the following field entry :

Code:
$HD_Form -> AddEditElement (gettext("EXPIRY DATE"),
  "expirationdate",
  '$value',
  "INPUT",
  "id='expirationdate' size=40 maxlength=40 $comp_date_plus ondblclick=\"return showCalendar('expirationdate', 'yyyy-mm-dd');\"",
  "10",
  "Insert the expiration date",
  "" , "", "",   "", "", "", "NO-NULL", gettext("please respect the format YYYY-MM-DD HH:MM:SS. For instance, '2004-12-31 00:00:00'"), "", "res_display_dateformat");


to make it look like

Code:
$hack=<<<EOT
   <link rel="stylesheet" type="text/css" media="all" href="javascript/calendar/calendar-mos.css" title="green" />
   <!-- import the calendar script -->
   <script type="text/javascript" src="javascript/calendar/calendar.js"></script>
   <!-- import the language module -->
   <script type="text/javascript" src="javascript/calendar/lang/calendar-en.js"></script>
   <script type="text/javascript" src="javascript/mambojavascript.js"></script>
EOT;

$HD_Form -> AddEditElement (gettext("EXPIRY DATE"),
  "expirationdate",
  '$value',
  "INPUT",
  "id='expirationdate' size=40 maxlength=40 $comp_date_plus ondblclick=\"return showCalendar('expirationdate', 'yyyy-mm-dd');\"",
  "10",
  "Insert the expiration date",
  "" , "", "",   "", "", "", "NO-NULL", gettext("please respect the format YYYY-MM-DD HH:MM:SS. For instance, '2004-12-31 00:00:00'").$hack, "", "res_display_dateformat");


and expand the attached calendar javascript library in the "/javascript" folder of your A2Billing installation.

Usage: Just double-click inside the date field in the form and enjoy


Attachments:
File comment: My FG_var_card.inc file. This may be a little different from yours, but it should be just fine
FG_var_card.zip [5.48 KiB]
Downloaded 143 times
File comment: Javascript Calendar library
calendar.zip [16.95 KiB]
Downloaded 144 times
Top
 Profile  
 
 Post subject:
PostPosted: Mon May 14, 2007 1:33 pm 
Offline

Joined: Thu Oct 19, 2006 9:56 am
Posts: 300
Location: Athens, Greece
I guess I have some code, too :P
:lamo:


Attachments:
0001-Make-calendar-work-for-card-expiration.patch.gz [7.32 KiB]
Downloaded 156 times
Top
 Profile  
 
 Post subject: Thanks xrg
PostPosted: Tue May 15, 2007 4:11 am 
Offline
User avatar

Joined: Sun Apr 29, 2007 4:08 am
Posts: 14
Thanks .
Yes, from your idia ,i made the change on Class.FormHandler.AddForm.inc.php and Class.FormHandler.EditForm.inc.php
------------------------
<script language="JavaScript" src="./javascript/calendar1.js"></script>
----------------------
<?php
}elseif ( strtoupper ($this->FG_TABLE_ADITION[$i][3])== strtoupper ("POPUPDATE")){
?>
<INPUT class="form_enter" name=<?php echo $this->FG_TABLE_ADITION[$i][1]?> <?php echo $this->FG_TABLE_ADITION[$i][4]?> <?php if($this->VALID_SQL_REG_EXP){ echo stripslashes($list[0][$i]) ; }else{ echo $this->FG_TABLE_ADITION[$i][1]; }?> >
<a href='javascript:cal4.popup();'><img src="img/cal.gif" width="16" height="16" border="0" title="Click Here to Pick up the date" alt="Click Here to Pick up the date"></a>
<script language="JavaScript">
var cal4 = new calendar1(document.myForm.expirationdate);
cal4.year_scroll = false;
cal4.time_comp = true;
</script>
--------------------------------------------------------------

so I have made a new type POPUPDATE...and
you just put POPUPDATE instead of INPUT on "/form_data/FG_var_card.inc

$HD_Form -> AddEditElement (gettext("EXPIRY DATE"),
"expirationdate",
'$value',
"INPUT", ..... .. . . . . .. . . . .

It will work.

for Class.FormHandler.EditForm.inc.php file just make a change on $this->FG_TABLE_EDITION[$i][3]) ...where on Class.FormHandler.AddForm.inc.php it is $this->FG_TABLE_ADITION[$i][3


-----------
Thanks for you response.
Keep in Touch


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 
Voice Broadcast System


All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group