PageRenderTime 47ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/plugins/wp-lister-for-ebay/views/listings_edit_page.php

https://bitbucket.org/sanders_nick/my-maxi-skirt
PHP | 280 lines | 198 code | 67 blank | 15 comment | 40 complexity | 48515db7c58097078f7cdcfb0878ad04 MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause, AGPL-1.0, GPL-3.0, LGPL-2.1
  1. <?php include_once( dirname(__FILE__).'/common_header.php' ); ?>
  2. <style type="text/css">
  3. /* sideboxes */
  4. #side-sortables .postbox input.text_input,
  5. #side-sortables .postbox select.select {
  6. width: 50%;
  7. }
  8. #side-sortables .postbox label.text_label {
  9. width: 45%;
  10. }
  11. .postbox h3 {
  12. cursor: default;
  13. }
  14. /* backwards compatibility to WP 3.3 */
  15. #poststuff #post-body.columns-2 {
  16. margin-right: 300px;
  17. }
  18. #poststuff #post-body {
  19. padding: 0;
  20. }
  21. #post-body.columns-2 #postbox-container-1 {
  22. float: right;
  23. margin-right: -300px;
  24. width: 280px;
  25. }
  26. #poststuff .postbox-container {
  27. width: 100%;
  28. }
  29. #major-publishing-actions {
  30. border-top: 1px solid #F5F5F5;
  31. clear: both;
  32. margin-top: -2px;
  33. padding: 10px 10px 8px;
  34. }
  35. #post-body .misc-pub-section {
  36. max-width: 100%;
  37. border-right: none;
  38. }
  39. </style>
  40. <?php
  41. $item_details = $wpl_item['profile_data']['details'];
  42. ?>
  43. <div class="wrap wplister-page">
  44. <div class="icon32" style="background: url(<?php echo $wpl_plugin_url; ?>img/hammer-32x32.png) no-repeat;" id="wpl-icon"><br /></div>
  45. <h2><?php echo __('Edit Listing','wplister') ?></h2>
  46. <?php echo $wpl_message ?>
  47. <form method="post" action="<?php echo $wpl_form_action; ?>">
  48. <div id="poststuff">
  49. <div id="post-body" class="metabox-holder columns-2">
  50. <div id="postbox-container-1" class="postbox-container">
  51. <div id="side-sortables" class="meta-box">
  52. <!-- first sidebox -->
  53. <div class="postbox" id="submitdiv">
  54. <!--<div title="Click to toggle" class="handlediv"><br></div>-->
  55. <h3><span><?php echo __('Update','wplister'); ?></span></h3>
  56. <div class="inside">
  57. <div id="submitpost" class="submitbox">
  58. <div id="misc-publishing-actions">
  59. <div class="misc-pub-section">
  60. <!-- optional revise item on save -->
  61. <?php if ( ( $wpl_item['status'] == 'published' ) || ( $wpl_item['status'] == 'changed' ) ): ?>
  62. <p><?php _e('Your changes to this item will only be updated on eBay when you revise this item.','wplister') ?></p>
  63. <input type="checkbox" name="wpl_e2e_revise_item_on_save" value="yes" id="revise_item_on_save" />
  64. <label for="revise_item_on_save"><?php _e('revise this item when saving','wplister') ?></label>
  65. <?php else: ?>
  66. <p>This item has not been published yet.</p>
  67. <?php endif; ?>
  68. </div>
  69. </div>
  70. <div id="major-publishing-actions">
  71. <div id="publishing-action">
  72. <input type="hidden" name="action" value="save_listing" />
  73. <input type="hidden" name="wpl_e2e_listing_id" value="<?php echo $wpl_item['id']; ?>" />
  74. <input type="hidden" name="wpl_e2e_status" value="<?php echo $wpl_item['status']; ?>" >
  75. <input type="submit" value="<?php echo __('Update','wplister'); ?>" id="publish" class="button-primary" name="save">
  76. </div>
  77. <div class="clear"></div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="postbox" id="TemplatesBox">
  83. <h3><span><?php echo __('Template','wplister'); ?></span></h3>
  84. <div class="inside">
  85. <?php foreach ($wpl_template_files as $tpl) : ?>
  86. <?php
  87. $tpl_name = $tpl['template_name'];
  88. $tpl_path = $tpl['template_path'];
  89. $checked = ( $wpl_item['template'] == $tpl_path ) ? 'checked="checked"' : '';
  90. ?>
  91. <input type="radio" value="<?php echo $tpl_path ?>" id="template-<?php echo basename($tpl_path) ?>" name="wpl_e2e_template" class="post-format" <?php echo $checked ?> >
  92. <label for="template-<?php echo basename($tpl_path) ?>"><?php echo $tpl_name ?></label><br>
  93. <?php endforeach; ?>
  94. </div>
  95. </div>
  96. <div class="postbox" id="HelpBox">
  97. <h3><span><?php echo __('Information','wplister'); ?></span></h3>
  98. <div class="inside">
  99. <p>
  100. Editing a single listing might come in handy when you need to fix a single title or price.
  101. But it is not recommended as part of your workflow.
  102. </p>
  103. <p>
  104. If you find yourself editing single listings on a regular basis,
  105. you should contact us and describe your requirements. We will then work out a solution which benefts all users.
  106. </p>
  107. </div>
  108. </div>
  109. </div>
  110. </div> <!-- #postbox-container-2 -->
  111. <div id="postbox-container-2" class="postbox-container">
  112. <div class="meta-box-sortables ui-sortable">
  113. <div class="postbox" id="GeneralSettingsBox">
  114. <h3><span><?php echo __('Item settings','wplister'); ?></span></h3>
  115. <div class="inside">
  116. <div id="titlediv" style="margin-bottom:5px;">
  117. <div id="titlewrap">
  118. <label for="wpl-text-auction_title" class="text_label"><?php echo __('Title','wplister'); ?>:</label>
  119. <input type="text" name="wpl_e2e_auction_title" size="30" value="<?php echo $wpl_item['auction_title']; ?>" id="title" autocomplete="off" style="width:65%;">
  120. </div>
  121. </div>
  122. <label for="wpl-text-price" class="text_label"><?php echo __('Price / Start price','wplister'); ?>:</label>
  123. <input type="text" name="wpl_e2e_price" id="wpl-text-price" value="<?php echo $wpl_item['price']; ?>" class="text_input" />
  124. <p class="desc" style="display: block;"><?php echo __('This will have no effect on product variations.','wplister'); ?></p>
  125. <!br class="clear" />
  126. <label for="wpl-text-quantity" class="text_label"><?php echo __('Quantity','wplister'); ?>:</label>
  127. <input type="text" name="wpl_e2e_quantity" id="wpl-text-quantity" value="<?php echo $wpl_item['quantity']; ?>" class="text_input" />
  128. <p class="desc" style="display: block;"><?php echo __('This will have no effect on product variations.','wplister'); ?></p>
  129. <!br class="clear" />
  130. <label for="wpl-text-listing_duration" class="text_label"><?php echo __('Duration','wplister'); ?>: *</label>
  131. <select id="wpl-text-listing_duration" name="wpl_e2e_listing_duration" title="Laufzeit" class=" required-entry select">
  132. <option value="">-- <?php echo __('Please select','wplister'); ?> --</option>
  133. <option value="Days_3" <?php if ( $wpl_item['listing_duration'] == 'Days_3' ): ?>selected="selected"<?php endif; ?>>3 <?php echo __('Days','wplister'); ?></option>
  134. <option value="Days_5" <?php if ( $wpl_item['listing_duration'] == 'Days_5' ): ?>selected="selected"<?php endif; ?>>5 <?php echo __('Days','wplister'); ?></option>
  135. <option value="Days_7" <?php if ( $wpl_item['listing_duration'] == 'Days_7' ): ?>selected="selected"<?php endif; ?>>7 <?php echo __('Days','wplister'); ?></option>
  136. <option value="Days_10" <?php if ( $wpl_item['listing_duration'] == 'Days_10' ): ?>selected="selected"<?php endif; ?>>10 <?php echo __('Days','wplister'); ?></option>
  137. <option value="Days_30" <?php if ( $wpl_item['listing_duration'] == 'Days_30' ): ?>selected="selected"<?php endif; ?>>30 <?php echo __('Days','wplister'); ?></option>
  138. <option value="Days_60" <?php if ( $wpl_item['listing_duration'] == 'Days_60' ): ?>selected="selected"<?php endif; ?>>60 <?php echo __('Days','wplister'); ?></option>
  139. <option value="Days_90" <?php if ( $wpl_item['listing_duration'] == 'Days_90' ): ?>selected="selected"<?php endif; ?>>90 <?php echo __('Days','wplister'); ?></option>
  140. <option value="GTC" <?php if ( $wpl_item['listing_duration'] == 'GTC' ): ?>selected="selected"<?php endif; ?>><?php echo __('Good Till Canceled','wplister'); ?> (GTC)</option>
  141. </select>
  142. <br class="clear" />
  143. </div>
  144. </div>
  145. <div class="postbox" id="DeveloperToolBox" style="display:none;">
  146. <h3><span><?php echo __('Developer options','wplister'); ?></span></h3>
  147. <div class="inside">
  148. <p>
  149. You should not normally need to modify the following settings. Use at your own risk!
  150. </p>
  151. <label for="wpl-text-quantity_sold" class="text_label"><?php echo __('Items sold','wplister'); ?>:</label>
  152. <input type="text" name="wpl_e2e_quantity_sold" size="30" value="<?php echo $wpl_item['quantity_sold']; ?>" class="text_input" />
  153. <br class="clear" />
  154. <label for="wpl-text-ebay_id" class="text_label"><?php echo __('eBay Item ID','wplister'); ?>:</label>
  155. <input type="text" name="wpl_e2e_ebay_id" size="30" value="<?php echo $wpl_item['ebay_id']; ?>" class="text_input" />
  156. <br class="clear" />
  157. <label for="wpl-text-listing_status" class="text_label"><?php echo __('Listing status','wplister'); ?>:</label>
  158. <select id="wpl-text-listing_status" name="wpl_e2e_listing_status" title="Laufzeit" class=" required-entry select">
  159. <option value="prepared" <?php if ( $wpl_item['status'] == 'prepared' ): ?>selected="selected"<?php endif; ?>><?php echo __('prepared','wplister'); ?></option>
  160. <option value="verified" <?php if ( $wpl_item['status'] == 'verified' ): ?>selected="selected"<?php endif; ?>><?php echo __('verified','wplister'); ?></option>
  161. <option value="published" <?php if ( $wpl_item['status'] == 'published' ): ?>selected="selected"<?php endif; ?>><?php echo __('published','wplister'); ?></option>
  162. <option value="sold" <?php if ( $wpl_item['status'] == 'sold' ): ?>selected="selected"<?php endif; ?>><?php echo __('sold','wplister'); ?></option>
  163. <option value="ended" <?php if ( $wpl_item['status'] == 'ended' ): ?>selected="selected"<?php endif; ?>><?php echo __('ended','wplister'); ?></option>
  164. <option value="changed" <?php if ( $wpl_item['status'] == 'changed' ): ?>selected="selected"<?php endif; ?>><?php echo __('changed','wplister'); ?></option>
  165. </select>
  166. <br class="clear" />
  167. <label for="wpl-text-post_id" class="text_label"><?php echo __('Product ID','wplister'); ?>:</label>
  168. <input type="text" name="wpl_e2e_post_id" size="30" value="<?php echo $wpl_item['post_id']; ?>" class="text_input" />
  169. <br class="clear" />
  170. <label for="wpl-enable_dev_mode" class="text_label"><?php echo __('Update advances settings','wplister'); ?>:</label>
  171. <input type="checkbox" name="wpl_e2e_enable_dev_mode" id="wpl-enable_dev_mode" value="1" class="checkbox_input" />
  172. <span style="line-height: 24px">
  173. <?php echo __('Yes, I know what I am doing.','wplister'); ?>
  174. </span>
  175. <br class="clear" />
  176. </div>
  177. </div>
  178. <div class="submit" style="padding-top: 0; float: right; display:none;">
  179. <input type="submit" value="<?php echo __('Save listing','wplister'); ?>" name="submit" class="button-primary">
  180. </div>
  181. </div> <!-- .meta-box-sortables -->
  182. </div> <!-- #postbox-container-2 -->
  183. </div> <!-- #post-body -->
  184. <br class="clear">
  185. </div> <!-- #poststuff -->
  186. </form>
  187. <?php if ( get_option('wplister_log_level') > 6 ): ?>
  188. <pre><?php #print_r($wpl_int_shipping_options); ?></pre>
  189. <pre><?php print_r($wpl_item); ?></pre>
  190. <?php endif; ?>
  191. <script type="text/javascript">
  192. jQuery( document ).ready(
  193. function () {
  194. // check required values on submit
  195. jQuery('.wplister-page form').on('submit', function() {
  196. // duration is required
  197. if ( jQuery('#wpl-text-listing_duration')[0].value == '' ) {
  198. alert('Please select a listing duration.'); return false;
  199. }
  200. // dispatch time is required
  201. if ( jQuery('#wpl-text-dispatch_time')[0].value == '' ) {
  202. alert('Please enter a handling time.'); return false;
  203. }
  204. // first category is required
  205. if ( jQuery('#wpl-text-ebay_category_1_id')[0].value == '' ) {
  206. alert('Please select a main category.'); return false;
  207. }
  208. return true;
  209. })
  210. }
  211. );
  212. </script>
  213. </div>