selfservice priority sort order, #14029
[freeside.git] / httemplate / misc / change_pkg.cgi
index 16b7071..2ab9329 100755 (executable)
@@ -1,38 +1,49 @@
-<% include('/elements/header-popup.html', "Change Package") %>
+<& /elements/header-popup.html, mt("Change Package") &>
 
-<% include('/elements/error.html') %>
+<SCRIPT TYPE="text/javascript" SRC="../elements/order_pkg.js"></SCRIPT>
 
-<FORM ACTION="<% $p %>edit/process/change-cust_pkg.html" METHOD=POST>
+<& /elements/error.html &>
+
+<FORM NAME="OrderPkgForm" ACTION="<% $p %>edit/process/change-cust_pkg.html" METHOD=POST>
 <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<% $pkgnum %>">
 
 <% ntable('#cccccc') %>
 
   <TR>
-    <TH ALIGN="right">Current package</TH>
+    <TH ALIGN="right"><% mt('Current package') |h %></TH>
     <TD COLSPAN=7>
       <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B> - <% $part_pkg->comment |h %>
     </TD>
   </TR>
 
-  <% include('/elements/tr-select-cust-part_pkg.html',
-               'pre_label'  => 'New',
+  <& /elements/tr-select-cust-part_pkg.html,
+               'pre_label'  => emt('New'),
                'curr_value' => scalar($cgi->param('pkgpart')),
                'classnum'   => $part_pkg->classnum,
                'cust_main'  => $cust_main,
-               #'extra_sql'    => ' AND pkgpart != '. $cust_pkg->pkgpart,
-            )
-  %>
+  &>
 
-  <% include('/elements/tr-select-cust_location.html',
+  <& /elements/tr-select-cust_location.html,
                'cgi'       => $cgi,
                'cust_main' => $cust_main,
-            )
-  %>
+  &>
 
 </TABLE>
 
+<& /elements/standardize_locations.html,
+            'form'       => "OrderPkgForm",
+            'onlyship'   => 1,
+            'no_company' => 1,
+            'callback'   => 'document.OrderPkgForm.submit();',
+&>
+
 <BR>
-<INPUT TYPE="submit" VALUE="Change package">
+<INPUT NAME    = "submitButton"
+       TYPE    = "button"
+       VALUE   = "<% mt("Change package") |h %>"
+       onClick = "this.disabled=true; standardize_new_location();"
+       <% scalar($cgi->param('pkgpart')) ? '' : 'DISABLED' %>
+>
 
 </FORM>
 </BODY>