diff options
| author | ivan <ivan> | 2002-10-04 12:56:36 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2002-10-04 12:56:36 +0000 | 
| commit | 86f41071c9f7a088e89998b87b65822ca32d3bcd (patch) | |
| tree | 2208746a35ed3c78cbc5bced0934e00e96be0739 /httemplate | |
| parent | e98319438189ccb880db60393f0f8d63c0739e14 (diff) | |
working on the road:
  - easier "change package" link for changing one package to another
  - sqlradius export now compatible with Pg
  - indices on phone numbers
  - install instructions specify Pg 7.1 (at least until ILIKE thing is changed)
  - searching on phone number fragments
Diffstat (limited to 'httemplate')
| -rw-r--r-- | httemplate/docs/install.html | 2 | ||||
| -rwxr-xr-x | httemplate/edit/process/cust_pkg.cgi | 25 | ||||
| -rwxr-xr-x | httemplate/search/cust_main.cgi | 19 | ||||
| -rwxr-xr-x | httemplate/view/cust_main.cgi | 3 | 
4 files changed, 33 insertions, 16 deletions
| diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html index 74aa9a286..4862feb9e 100644 --- a/httemplate/docs/install.html +++ b/httemplate/docs/install.html @@ -12,7 +12,7 @@ Before installing, you need:    <li><a href="http://rsync.samba.org/">rsync</a>    <li>A <b>transactional</b> database engine <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">supported</a> by Perl's <a href="http://dbi.perl.org">DBI</a>.      <ul> -      <li><a href="http://www.postgresql.org/">PostgreSQL</a> (v7 or higher) is recommended. +      <li><a href="http://www.postgresql.org/">PostgreSQL</a> is recommended (v7.1.x or later, not 7.0.x).        <li>MySQL versions before 4.1 do not support standard SQL subqueries and are <b>NOT SUPPORTED</b>.  If you are a developer who wishes to contribute MySQL 3.x/4.0 support, see <a href="http://pouncequick.420.am/rt/Ticket/Display.html?id=438">ticket #438</a> in the bug-tracking system and ask on the -devel mailing list.  <!--       <li>MySQL has been reported to work.           <b>MySQL's default <a href="http://www.mysql.com/doc/M/y/MyISAM.html">MyISAM</a> and <a href="http://www.mysql.com/doc/I/S/ISAM.html">ISAM</a> table types are not supported</b>.  If you want to use MySQL, you <b>must</b> use one of the new <a href="http://www.mysql.com/doc/T/a/Table_types.html">transaction-safe table types</a> such as <a href="http://www.mysql.com/doc/B/D/BDB.html">BDB</a> or <a href="http://www.mysql.com/doc/I/n/InnoDB.html">InnoDB</a>, and set it as the default table type using the <code>--default-table-type=BDB</code> or <code>--default-table-type=InnoDB</code> <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Command-line_options">mysqld command-line option</a> or by setting <code>default-table-type=BDB</code> or <code>default-table-type=InnoDB</code> in the <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_MySQL_Database_Administration.html#Option_files">my.cnf option file</a>. --> diff --git a/httemplate/edit/process/cust_pkg.cgi b/httemplate/edit/process/cust_pkg.cgi index f8c9f5151..df8471c27 100755 --- a/httemplate/edit/process/cust_pkg.cgi +++ b/httemplate/edit/process/cust_pkg.cgi @@ -11,16 +11,23 @@ my @remove_pkgnums = map {    $1;  } $cgi->param('remove_pkg'); +my $error_redirect;  my @pkgparts; -foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { -  if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { -    my $num_pkgs = $1; -    while ( $num_pkgs-- ) { -      push @pkgparts,$pkgpart; +if ( $cgi->param('new_pkgpart') =~ /^(\d+)$/ ) { #came from misc/change_pkg.cgi +  $error_redirect = "misc/change_pkg.cgi"; +  @pkgparts = ($1); +} else { #came from edit/cust_pkg.cgi +  $error_redirect = "edit/cust_pkg.cgi"; +  foreach my $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { +    if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) { +      my $num_pkgs = $1; +      while ( $num_pkgs-- ) { +        push @pkgparts,$pkgpart; +      } +    } else { +      $error = "Illegal quantity"; +      last;      } -  } else { -    $error = "Illegal quantity"; -    last;    }  } @@ -28,7 +35,7 @@ $error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums);  if ($error) {    $cgi->param('error', $error); -  print $cgi->redirect(popurl(2). "cust_pkg.cgi?". $cgi->query_string ); +  print $cgi->redirect(popurl(3). $error_redirect. '?'. $cgi->query_string );  } else {    print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");  } diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 0a98b1891..ac238b63e 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -636,12 +636,19 @@ sub phonesearch {    my $phone = $cgi->param('phone_text'); -  #false laziness with Record::ut_phonen, only works with US/CA numbers... +  #(no longer really) false laziness with Record::ut_phonen +  #only works with US/CA numbers...    $phone =~ s/\D//g; -  $phone =~ /^(\d{3})(\d{3})(\d{4})(\d*)$/ -    or eidiot gettext('illegal_phone'). ": $phone"; -  $phone = "$1-$2-$3"; -  $phone .= " x$4" if $4; +  if ( $phone =~ /^(\d{3})(\d{3})(\d{4})(\d*)$/ ) { +    $phone = "$1-$2-$3"; +    $phone .= " x$4" if $4; +  } elsif ( $phone =~ /^(\d{3})(\d{4})$/ ) { +    $phone = "$1-$2"; +  } elsif ( $phone =~ /^(\d{3,4})$/ ) { +    $phone = $1; +  } else { +    eidiot gettext('illegal_phone'). ": $phone"; +  }    my @fields = qw(daytime night fax);    push @fields, qw(ship_daytime ship_night ship_fax) @@ -650,7 +657,7 @@ sub phonesearch {    for my $field ( @fields ) {      push @cust_main, qsearch ( 'cust_main',                                  { $field => { 'op'    => 'LIKE', -                                             'value' => "$phone%" } } ); +                                             'value' => "%$phone%" } } );    }    \@cust_main; diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 0610bc324..707de8d70 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -370,6 +370,9 @@ foreach my $package (@packages) {          qq!$pkg - $comment ( <a href="$pkgview">Details</a> )!;         # | !; +  print qq! ( <A HREF="${p}misc/change_pkg.cgi?$pkgnum">!. +        'Change package</A> )'; +    #false laziness with view/cust_pkg.cgi, but i'm trying to make that go away so    unless ( $package->getfield('cancel') ) {      print ' ( '; | 
