PHP

Developing drupal module with customizable views

I was assigned a task to add more reports to casetracker module. This module is powerful. Anyway, it is not mature yet. There are only a few default reports. They are not enough at least for me and my colleage. In particular, the default reports just offer me to view list of all projects, my projects, all cases, my cases and advanced search. Well, what we want is all open cases, all resolved cases and a block to show my open cases.

PHP SAPRFC: Learning by Example

After the hobby goodies of Craig has been published last week, you might be interesting to try programming SAP in PHP using SAPRFC. Are you ABAPer? Are you Javaer? Are you PHPer? In the world of SAP, ABAPers are the must to customize SAP R/3. To develop a web application, ABAP/4 is not the best choice. Java and PHP are better. Anyway, from the past 4 years, SAP has officially supported Java interfacing to SAP R/3 through JCo. So some ABAPers have moved themselves to Java. At least they know how to program a Java-based web application using SAP NetWeaver Developer Studio.

Scripting the SAP

SAP is one of the most biggest player in ERP market. It has its own language called ABAP/4. Since naturally, SAP R/3, the main product line, is 3-tier architecture, says database, server, and client, you it also has its own client aka SAP GUI. However, the world has changed to web so SAP pushed lots of effort to provide programming interface in popular languages; Java and .NET. IMHO, Java and .NET are only suitable for large enterprise and they absolutely consume resources. You need big machine to run Java and .NET. By the way, the user’s requirements are many more simpler. They just want a simple web interface to back-office data, some of them are in DBMS and some of them are in SAP R/3. SAP Enterprise Portal is too big for this situation. PHP is just enough.

Understand Magic Quotes in PHP

Have you ever heard about magic quotes? Today I have just realize why it must be called magic quotes. My objective was just to install phpMyAdmin on CentOS 4.2. I supposed it should be done in an hour. However, I stucked on generating the configuration file, config.inc.php. The symptom are as follows.

Patch for LDAP Integration module in Drupal 4.7

According to the previous post, the patch is not complete for all functions. I found a problem according to attributes mapping. The attributes changed in Drupal are not synchronized to LDAP because of missing some options in administer interface. So below is the new patch.

Convert TIS-620 to UTF-8 in PHP

In case you don’t have iconv and mbstring, you might use below function to convert TIS-620 to UTF-8.

function tis620_to_utf8($text) {
  $utf8 = "";
  for ($i = 0; $i < strlen($text); $i++) {
    $a = substr($text, $i, 1);
    $val = ord($a);
 
    if ($val < 0x80) {
      $utf8 .= $a;
    } elseif ((0xA1 <= $val && $val < 0xDA) || (0xDF <= $val && $val <= 0xFB)) {