CVS edit link for slip

I am requesting CVS access so I can release and maintain UberPOS, a module that provides a point of sales interface for Ubercart.

The module is available at: http://uberpos.com/node/7

More information is available at that site.

It can also be demo'd there.

Comments

slip’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new11.88 KB

Here's the module as an attachment!

slip’s picture

StatusFileSize
new11.88 KB

Whoops, attached a slightly old version.

Here's a the recent one.

ConnorK’s picture

Minor comment. Only had a quick lookover of the code.

Between lines 247 and 356 of the .module, you're unnecessarily using double-quoted strings compared to your use of single-quoted strings all throughout the rest of your code.

$result = db_query("SELECT * FROM {uc_order_products} WHERE order_product_id = %d", $item);

versus

$result = db_query('SELECT * FROM {uc_order_products} WHERE order_product_id = %d', $item);

Maybe fix this to keep consistency?

avpaderno’s picture

Issue tags: +Module review
avpaderno’s picture

Status: Needs review » Needs work
  1. jQuery.ScrollTo should be removed; files available from third-party web site must not be added into Drupal.org CVS.
  2. The CSS style should be moved from uberpos-receipt.tpl.php into a separate file.
  3.   $form['search']['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Save configuration'),
        '#suffix' => l(t('Cancel changes'), 'admin/store/settings/pos'),
      );
    

    Add a second submit button.

  4. function uberpos_install() {
      drupal_install_schema('uberpos');
    
      $t = get_t();
     

    t() is available during installation of a module, as Drupal executes a full bootstrap, in that case.

  5. See the Drupal coding standards to understand how a module code should be written.
  6.     include_once(drupal_get_path('module', uc_credit) . '/uc_credit.admin.inc');
    

    There is a Drupal function to use in the case you need to load a file of another module.

  7.   include_once(drupal_get_path('module', 'uberpos') . '/uberpos-login.tpl.php');
    

    That is not the way a theme template is used.

  8.   $output['head'] = drupal_get_html_head();
      $output['scripts'] = drupal_get_js();
      $output['favicon'] = theme_get_setting('toggle_favicon') ? "<link rel='shortcut icon' href='". theme_get_setting('favicon') ."' type='image/x-icon' />\n" : '';
      $output['language'] = $language->language;
    
      /* Show any existing drupal system messages and require them to be cleared */
      $all_messages = drupal_get_messages();
      foreach($all_messages as $type => $messages) {
        foreach($messages as $message) {
          $_SESSION['clear_message'] .= '<div id="sys-message">' . $message . '</div>';
        }
      }
    
      $drupal_css = drupal_add_css();
    

    That is all code that belongs to a theme, not a module.

  9. uberpos.tpl.php returns the output of a full HTML page that includes a Drupal form; that is not the correct way to proceed.
slip’s picture

ConnorK,

Good point on the quotes. I'll fix that up.

KiamLaLuno,

Thanks for the feedback!

1, 3, 4, 5 OK

2 I'll do my best. I did it that way because of some tricky js I needed to implement to print part of a page. There should be a way tho...

6 OK, found module_load_include

7-9 Maybe you're right. I'm not sure tho. I was following print.module's example because I wanted to avoid the theme. Essentially people using this will not want any theme (in most cases). Point of sales systems generally take up the entire screen. If I understand you, I'd have to create a 'nothing' theme to output the content in. Then I think confusion would arise as non tech shopowners would have to switch between themes when views their site/using their POS. Or they would have to have two separate user accounts with different themes set. I wanted to avoid that.

What do you think? The way I see it, doing it through a theme would add confusion, while doing it the way I'm doing it is at least a tiny bit standard, as the print module does it this way (not standard enough?).

Thanks again for the quick responses.

avpaderno’s picture

The module you are referring has a different purpose. The pages shown by print.module are thought to be used for printing.

In the case of your module, removing the output generated by Drupal, or third-party modules (and changing how the page is rendered) is not desired.

slip’s picture

StatusFileSize
new8.26 KB

Please take a look at the new version attached. I believe I've addressed all of the issues mentioned about.

slip’s picture

Status: Needs work » Needs review

forgot to change the status.

slip’s picture

Is there anyway I can help speed up the CVS application process? I guess I could help out reviewing other apps???

I know you guys have over 80 open applications because there's so much interest in starting Drupal projects, so I definitely understand the delay. I'm planning on giving presentations soon to a couple Drupal groups on UberPOS and I'd like for it to have a project page.

avpaderno’s picture

Status: Needs review » Fixed
  1.     else if ($input == 'CC') {
          $form_state['redirect'] = 'admin/store/pos/'. $order->order_id .'/cred
    it';
    

    It seems a new line character slipped in.

  2.   $result = db_query('SELECT nid FROM {uc_products} WHERE model LIKE \'%s\'', $input);
    

    It would be better to use db_query("SELECT nid FROM {uc_products} WHERE model LIKE '%s'", $input).

  3.     'description' => t('Log of void commands.'),
    

    Schema descriptions should not be passed to t() anymore.

slip’s picture

Thanks!

Status: Fixed » Closed (fixed)
Issue tags: -Module review

Automatically closed -- issue fixed for 2 weeks with no activity.

avpaderno’s picture

Component: Miscellaneous » new project application
Assigned: Unassigned » avpaderno
Issue summary: View changes
Status: Closed (fixed) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.