PageRenderTime 52ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/inventory/inventory_edit_control.inc.php

http://tracmor.googlecode.com/
PHP | 137 lines | 98 code | 9 blank | 30 comment | 10 complexity | 071999b75c70fbd05e7cd4779a8d5972 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1
  1. <?php
  2. /*
  3. * Copyright (c) 2009, Tracmor, LLC
  4. *
  5. * This file is part of Tracmor.
  6. *
  7. * Tracmor is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * Tracmor is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with Tracmor; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. // Build array of all fields to display
  22. $arrInventoryFields[] = array('name' => 'Short Description:', 'value' => $this->lblShortDescription->Render(false) . $this->txtShortDescription->RenderWithError(false));
  23. $arrInventoryFields[] = array('name' => 'Category:', 'value' => $this->lblCategory->Render(false) . $this->lstCategory->RenderWithError(false));
  24. $arrInventoryFields[] = array('name' => 'Manufacturer:', 'value' => $this->lblManufacturer->Render(false) . $this->lstManufacturer->RenderWithError(false));
  25. $arrInventoryFields[] = array('name' => 'Inventory Code:', 'value' => $this->lblInventoryModelCode->Render(false) . $this->txtInventoryModelCode->RenderWithError(false));
  26. $arrInventoryFields[] = array('name' => 'Long Description:', 'value' => $this->pnlLongDescription->Render(false) . $this->txtLongDescription->RenderWithError(false));
  27. // Custom Fields
  28. if ($this->arrCustomFields) {
  29. foreach ($this->arrCustomFields as $field) {
  30. //if ($this->blnEditMode) {
  31. //Display Custom Field in Edit Mode if the role has "View" access
  32. // if(($field['blnView'])){
  33. if(!$this->blnEditMode || $field['blnView']){
  34. $arrInventoryFields[] = array('name' => $field['lbl']->Name.':', 'value' => $field['lbl']->Render(false).$field['input']->RenderWithError(false));
  35. }
  36. // }
  37. //}// Display Custom Field in Create Mode if the role has "Edit" access or is it required
  38. //elseif($field['blnEdit'] || $field['blnRequired']){
  39. // $arrInventoryFields[] = array('name' => $field['lbl']->Name.':', 'value' => $field['lbl']->Render(false).$field['input']->RenderWithError(false));
  40. // }
  41. }
  42. }
  43. // Show quantity and metadata if this is not a new inventory model
  44. if ($this->blnEditMode) {
  45. $arrInventoryFields[] = array('name' => 'Quantity:', 'value' => $this->lblTotalQuantity->Render(false));
  46. $arrInventoryFields[] = array('name' => 'Date Created:', 'value' => $this->lblCreationDate->Render(false));
  47. $arrInventoryFields[] = array('name' => 'Date Modified:', 'value' => $this->lblModifiedDate->Render(false));
  48. }
  49. ?>
  50. <div class="title">Inventory: <?php $this->lblHeaderInventoryModelCode->Render(); ?> </div>
  51. <table class="datagrid" cellpadding="5" cellspacing="0" border="0" >
  52. <tr>
  53. <td class="record_header">
  54. <?php
  55. $this->btnEdit->Render();
  56. $this->btnSave->RenderWithError();
  57. echo('&nbsp;');
  58. $this->atcAttach->RenderWithError();
  59. echo('&nbsp;');
  60. $this->btnCancel->RenderWithError();
  61. $this->btnDelete->RenderWithError();
  62. ?>
  63. </td>
  64. </tr>
  65. <tr>
  66. <td>
  67. <table cellpadding="0" cellspacing="0">
  68. <tr>
  69. <td style="vertical-align:top;">
  70. <table cellpadding="0" cellspacing="0">
  71. <?php
  72. if(isset($arrInventoryFields)){
  73. for ($i=0;$i<ceil(count($arrInventoryFields)/2);$i++) {
  74. echo('<tr>');
  75. echo('<td class="record_field_name">'. $arrInventoryFields[$i]['name'] .'&nbsp;</td>');
  76. echo('<td class="record_field_value">'. $arrInventoryFields[$i]['value'] .'&nbsp;</td>');
  77. echo('</tr>');
  78. }
  79. }
  80. ?>
  81. </table>
  82. </td>
  83. <td style="vertical-align:top;">
  84. <table cellpadding="0" cellspacing="0">
  85. <?php
  86. if(isset($arrInventoryFields)){
  87. for ($i=ceil(count($arrInventoryFields)/2);$i<count($arrInventoryFields);$i++) {
  88. echo('<tr>');
  89. echo('<td class="record_field_name">'. $arrInventoryFields[$i]['name'] .'&nbsp;</td>');
  90. echo('<td class="record_field_value">'. $arrInventoryFields[$i]['value'] .'&nbsp;</td>');
  91. echo('</tr>');
  92. }
  93. }
  94. ?>
  95. </table>
  96. </td>
  97. </tr>
  98. </table>
  99. </td>
  100. </tr>
  101. </table>
  102. <?php
  103. $this->pnlAttachments->Render();
  104. ?>
  105. <br class="item_divider">
  106. <?php
  107. if ($this->blnEditMode) {
  108. $this->btnMove->Render();
  109. $this->btnTakeOut->Render();
  110. $this->btnRestock->Render();
  111. $this->btnShip->Render();
  112. $this->btnReceive->Render();
  113. echo '<br class="item_divider />';
  114. echo '<br class="item_divider />';
  115. echo('<div class="title">Quantity by Location</div>');
  116. $this->dtgInventoryQuantities->RenderWithError();
  117. echo '<br class="item_divider" />';
  118. echo '<div class="title">Transactions</div>';
  119. $this->dtgInventoryTransaction->RenderWithError();
  120. }
  121. ?>
  122. <br class="item_divider">
  123. <?php
  124. if ($this->blnEditMode) {
  125. $this->lblShipmentReceipt->Render();
  126. $this->dtgShipmentReceipt->RenderWithError();
  127. }
  128. ?>