Last year I created a patch to the sql-ledger in Debian that would allow including a website in addition to an address, telephone number, etc. I have updated the patch so that it applies against sql-ledger 1.2.15. Since user configurations are now stored in the database, I had to add a colunns to the users_conf table: ALTER TABLE users_conf ADD COLUMN website text; As I was messing around with the templates, I saw that the customized templates I created from the older version of sql-ledger will not work. So, I will update the templates to work with smbledger and submit those as a seperate patch. In the meantime, however, the attached patch allows the user to have a website. Regards, -Roberto -- Roberto C. Sánchez http://people.connexer.com/~roberto http://www.connexer.com
diff -uNr ledgersmb-1.2.15.orig/LedgerSMB/User.pm ledgersmb-1.2.15/LedgerSMB/User.pm --- ledgersmb-1.2.15.orig/LedgerSMB/User.pm 2008-08-18 14:15:07.000000000 -0400 +++ ledgersmb-1.2.15/LedgerSMB/User.pm 2008-09-01 23:11:27.000000000 -0400 @@ -56,7 +56,7 @@ email, fax, menuwidth, name, numberformat, password, print, printer, role, sid, signature, stylesheet, tel, templates, - timeout, vclimit, u.username + timeout, vclimit, website, u.username FROM users_conf as uc, users as u WHERE u.username = ? AND u.id = uc.id;" @@ -138,7 +140,7 @@ email, fax, menuwidth, name, numberformat, password, print, printer, role, sid, signature, stylesheet, tel, templates, - timeout, vclimit, u.username + timeout, vclimit, website, u.username FROM users_conf as uc, users as u WHERE u.username = ? AND u.id = uc.id;" @@ -713,7 +723,7 @@ print = ?, printer = ?, role = ?, sid = ?, signature = ?, stylesheet = ?, tel = ?, templates = ?, timeout = ?, - vclimit = ? + vclimit = ?, website = ? WHERE id = ?;" ); @@ -732,7 +742,8 @@ $self->{sid}, $self->{signature}, $self->{stylesheet}, $self->{tel}, $self->{templates}, $self->{timeout}, - $self->{vclimit}, $userID + $self->{vclimit}, $self->{website}, + $userID ); if ( $oldPassword ne $self->{password} ) { @@ -761,7 +772,7 @@ dbport, dbuser, email, fax, menuwidth, name, numberformat, print, printer, role, sid, signature, stylesheet, tel, templates, - timeout, vclimit, id, password) + timeout, vclimit, website, id, password) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, md5(?));" @@ -782,8 +793,8 @@ $self->{sid}, $self->{signature}, $self->{stylesheet}, $self->{tel}, $self->{templates}, $self->{timeout}, - $self->{vclimit}, $userID, - $self->{password} + $self->{vclimit}, $self->{website}, + $userID, $self->{password} ); } @@ -888,7 +899,7 @@ currency dateformat dbconnect dbdriver dbhost dbname dboptions dbpasswd dbport dbuser email fax menuwidth name numberformat password printer role sid signature stylesheet tel templates - timeout vclimit); + timeout vclimit website); @conf; diff -uNr ledgersmb-1.2.15.orig/bin/admin.pl ledgersmb-1.2.15/bin/admin.pl --- ledgersmb-1.2.15.orig/bin/admin.pl 2008-08-18 14:14:57.000000000 -0400 +++ ledgersmb-1.2.15/bin/admin.pl 2008-09-01 23:11:56.000000000 -0400 @@ -541,6 +541,10 @@ <th align="right">| . $locale->text('Address') . qq|</th> <td><textarea name="address" rows="4" cols="35">$myconfig->{address}</textarea></td> </tr> + <tr valign="top"> + <th align="right">| . $locale->text('Website') . qq|</th> + <td><input name="website" size="35" value="$myconfig->{website}" /></td> + </tr> </table> </td> <td> diff -uNr ledgersmb-1.2.15.orig/bin/am.pl ledgersmb-1.2.15/bin/am.pl --- ledgersmb-1.2.15.orig/bin/am.pl 2008-08-18 14:14:59.000000000 -0400 +++ ledgersmb-1.2.15/bin/am.pl 2008-09-01 23:11:56.000000000 -0400 @@ -2331,6 +2331,10 @@ <th align="right">| . $locale->text('Address') . qq|</th> <td><textarea name=address rows=4 cols=35>$myconfig{address}</textarea></td> </tr> + <tr valign=top> + <th align="right">| . $locale->text('Website') . qq|</th> + <td><input name=website size=35 value="$myconfig{website}"></td> + </tr> </table> </td> <td> diff -uNr ledgersmb-1.2.15.orig/bin/io.pl ledgersmb-1.2.15/bin/io.pl --- ledgersmb-1.2.15.orig/bin/io.pl 2008-08-18 14:14:57.000000000 -0400 +++ ledgersmb-1.2.15/bin/io.pl 2008-09-01 23:11:55.000000000 -0400 @@ -1641,14 +1641,14 @@ push @vars, ( "${inv}number", "${inv}date", "${due}date" ); - for (qw(company address tel fax businessnumber)) { + for (qw(company address website tel fax businessnumber)) { $form->{$_} = $myconfig{$_}; } $form->{address} =~ s/\\n/\n/g; for (qw(name email)) { $form->{"user$_"} = $myconfig{$_} } - push @vars, qw(company address tel fax businessnumber username useremail); + push @vars, qw(company address website tel fax businessnumber username useremail); for (qw(notes intnotes)) { $form->{$_} =~ s/^\s+//g }
Attachment:
signature.asc
Description: Digital signature