action; //$move_class = preg_replace("/_/", "-", $this->action); //$move_date = preg_replace("/_/", "", $this->action) . "_date"; $move_type = preg_replace("/.*_/", "", $this->action); ?>
element('customers', array ('config' => array ('grid_div_id' => 'customers-list', 'grid_div_class' => 'text-below', 'caption' => ('Select Customer'), 'grid_setup' => array('hiddengrid' => isset($customer['id'])), 'grid_events' => array('onSelectRow' => array('ids' => 'if (ids != null){onRowSelect("#"+$(this).attr("id"), "customer", ids);}'), 'onHeaderClick' => array('gridstate' => 'onGridState("#"+$(this).attr("id"), "customer", gridstate)'), ), 'nolinks' => true, 'limit' => 10, ))); } echo ('
' . '' . '' . '
' . "\n"); if ($move_type !== 'out') { echo $this->element('units', array ('config' => array ('grid_div_id' => 'units-list', 'grid_div_class' => 'text-below', 'caption' => ('Select Unit'), 'grid_setup' => array('hiddengrid' => isset($unit['id'])), 'grid_events' => array('onSelectRow' => array('ids' => 'if (ids != null){onRowSelect("#"+$(this).attr("id"), "unit", ids);}'), 'onHeaderClick' => array('gridstate' => 'onGridState("#"+$(this).attr("id"), "unit", gridstate)'), ), 'action' => 'unoccupied', 'nolinks' => true, 'limit' => 10, ))); } echo ('
' . '' . '' . '
' . "\n"); echo $form->create(null, array('id' => 'move-inout-form', 'url' => array('controller' => 'leases', 'action' => $move_action))); echo $form->input("Lease.customer_id", array('id' => 'customer-id', 'type' => 'hidden', 'value' => 0)); echo $form->input("Lease.unit_id", array('id' => 'unit-id', 'type' => 'hidden', 'value' => 0)); if ($move_type === 'out') { echo $form->input('Lease.id', array('type' => 'hidden', 'value' => $lease['id'], )); } echo $this->element('form_table', array('class' => "item move-inout entry", 'field_prefix' => 'Lease', 'fields' => array ('move'.$move_type.'_date' => array('opts' => array('type' => 'text', 'id' => "LeaseMoveDate"), 'between' => 'Now', ), "comment" => ($move_type !== 'out' ? array('opts' => array('size' => 50)) : null), ))); if ($move_type === 'out') { echo('


Be sure that you really want to move this customer out of the unit,
' . 'select the correct moveout date,' . 'and press the "Perform Move Out" button.' . "\n"); } // Set up a redirect page. I use lower case 'redirect' here // to avoid the model convention, which starts with upper-case. if (isset($redirect)) { foreach ($redirect AS $name => $value) { echo $form->input("redirect.$name", array('type' => 'hidden', 'value' => $value, )); } } echo $form->end('Perform Move ' . ucfirst($move_type)); ?>