PrescriptionPayment - Version 0.1.2

Version Notes

Stable version. Please check https://github.com/codedge/prescriptionpayment for updates

Download this release

Release Info

Developer Holger Lösken
Extension PrescriptionPayment
Version 0.1.2
Comparing to
See all releases


Code changes from version 0.1.1 to 0.1.2

app/code/community/Ce/PrescriptionPayment/Block/Adminhtml/Sales/Order/Prescriptionpayment.php CHANGED
@@ -27,9 +27,15 @@ class Ce_PrescriptionPayment_Block_Adminhtml_Sales_Order_Prescriptionpayment
27
 
28
  /**
29
  * Get the prescriptions uploaded for this order
 
 
30
  */
31
  public function getPrescriptions()
32
  {
33
- return "";
 
 
 
 
34
  }
35
  }
27
 
28
  /**
29
  * Get the prescriptions uploaded for this order
30
+ *
31
+ * @return array
32
  */
33
  public function getPrescriptions()
34
  {
35
+ $files = Mage::getSingleton('prescriptionpayment/prescriptionpayment')
36
+ ->getCollection()
37
+ ->addFieldToFilter('order_id', $this->getOrder()->getId());
38
+
39
+ return $files;
40
  }
41
  }
app/code/community/Ce/PrescriptionPayment/Helper/Data.php CHANGED
@@ -36,4 +36,17 @@ class Ce_PrescriptionPayment_Helper_Data extends Mage_Core_Helper_Abstract
36
 
37
  return false;
38
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  }
36
 
37
  return false;
38
  }
39
+
40
+ /**
41
+ * Get the filename from a complete path
42
+ *
43
+ * @param $fileWithPath
44
+ * @return mixed
45
+ */
46
+ public function getFilenameFromPath($fileWithPath)
47
+ {
48
+ $arrMatch = preg_split('/\//', $fileWithPath);
49
+
50
+ return end($arrMatch);
51
+ }
52
  }
app/code/community/Ce/PrescriptionPayment/Model/Observer.php CHANGED
@@ -114,6 +114,7 @@ class Ce_PrescriptionPayment_Model_Observer
114
  $model->setCreatedTime(now());
115
  $model->setUpdateTime(now());
116
  $model->save();
 
117
  }
118
 
119
  // Remove files from session
114
  $model->setCreatedTime(now());
115
  $model->setUpdateTime(now());
116
  $model->save();
117
+ $model->unsetData();
118
  }
119
 
120
  // Remove files from session
app/code/community/Ce/PrescriptionPayment/Model/Prescriptionpayment.php CHANGED
@@ -219,6 +219,6 @@ class Ce_PrescriptionPayment_Model_Prescriptionpayment
219
  */
220
  public function clearUploadedFiles()
221
  {
222
- Mage::getSingleton( 'customer/session' )->setData($this->_code . 'Files', array());
223
  }
224
  }
219
  */
220
  public function clearUploadedFiles()
221
  {
222
+ Mage::getSingleton( 'customer/session' )->unsetData($this->_code . 'Files');
223
  }
224
  }
app/code/community/Ce/PrescriptionPayment/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Ce_PrescriptionPayment>
5
- <version>0.1.1</version>
6
  </Ce_PrescriptionPayment>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Ce_PrescriptionPayment>
5
+ <version>0.1.2</version>
6
  </Ce_PrescriptionPayment>
7
  </modules>
8
  <global>
app/design/adminhtml/default/default/template/prescriptionpayment/order/view/tab/prescriptions.phtml CHANGED
@@ -27,6 +27,19 @@
27
  </div>
28
  <fieldset>
29
  <?php echo Mage::helper('prescriptionpayment')->__('Uploaded files') ?>:
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  </fieldset>
31
  </div>
32
  <div class="clear"></div>
27
  </div>
28
  <fieldset>
29
  <?php echo Mage::helper('prescriptionpayment')->__('Uploaded files') ?>:
30
+ <table class="form-list" cellspacing="0">
31
+ <tbody>
32
+ <?php foreach($this->getPrescriptions() as $item): ?>
33
+ <tr>
34
+ <td>
35
+ <a href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'prescriptionpayment' . $item->getFile() ?>" target="_blank">
36
+ <?php echo Mage::helper('prescriptionpayment')->getFilenameFromPath($item->getFile()) ?>
37
+ </a>
38
+ </td>
39
+ </tr>
40
+ <?php endforeach ?>
41
+ </tbody>
42
+ </table>
43
  </fieldset>
44
  </div>
45
  <div class="clear"></div>
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PrescriptionPayment</name>
4
- <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
@@ -14,9 +14,9 @@
14
  It enables the shop owner to let the customer select which items shall be paid via a prescription. Those items value will be set to 0.00. All other items can be paid via other payment methods (f. ex. PayPal).</description>
15
  <notes>Stable version. Please check https://github.com/codedge/prescriptionpayment for updates</notes>
16
  <authors><author><name>Holger L&#xF6;sken</name><user>codedge</user><email>post@codedge.de</email></author></authors>
17
- <date>2013-05-19</date>
18
- <time>10:55:08</time>
19
- <contents><target name="magecommunity"><dir name="Ce"><dir name="PrescriptionPayment"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="b704ed2bdd65b4ce3a4a0c26d2747d2c"/><dir name="Sales"><dir name="Order"><file name="Prescriptionpayment.php" hash="2bcf9c3c10e910460f809e50179b2ee3"/><dir name="View"><dir name="Tab"><file name="Prescriptions.php" hash="a8d9e2e4cf0fcb248252574515df77c5"/></dir></dir></dir></dir></dir><file name="Items.php" hash="bded2c200295547d495c719c27d01d67"/></dir><dir name="Helper"><file name="Data.php" hash="d1e1f46e0177c6d96c35b98a2aa14831"/></dir><dir name="Model"><file name="Observer.php" hash="f144f7e250ad541672d186e83ff65384"/><file name="Prescriptionpayment.php" hash="0e4d4466bb1425ce526c45cb892e917a"/><dir name="Resource"><dir name="Prescriptionpayment"><file name="Collection.php" hash="d2832c12e80c463215a9207972e98a3d"/></dir><file name="Prescriptionpayment.php" hash="9bbe9c4f2bbbc887f4b9bae6e4d414b2"/></dir></dir><dir name="controllers"><file name="ItemsController.php" hash="b31dfbfd5a579e0615f9feb06d56b1d0"/></dir><dir name="etc"><file name="config.xml" hash="696d4598b701a18a71c5eb3e908c829f"/><file name="system.xml" hash="cfc5c5fda957d198d0fe6e2e0df107be"/></dir><dir name="sql"><dir name="prescriptionpayment_setup"><file name="mysql4-install-0.1.0.php" hash="44af96f8e0ec3961b458cae89191efe9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="prescriptionpayment"><file name="choose_payment.phtml" hash="293339e56babbfbfa6440b9f5c2aeeed"/><dir name="item"><file name="default.phtml" hash="5fd5f616a714102c5fc55ffb7fa4ae37"/></dir><file name="onepage_link.phtml" hash="80beb697df60eae9a012561553354bdd"/><dir name="selectitems"><file name="uploader.phtml" hash="4324af2b3ebd5cb9863c2aedb22bd285"/></dir><file name="selectitems.phtml" hash="c45576cdb02e377d2011a3d49b4f5894"/></dir></dir><dir name="layout"><file name="ce_prescriptionpayment.xml" hash="810eb7696493ea92b8730fffcfc89741"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="prescriptionpayment"><file name="notifications.phtml" hash="3bc8c15a8be0a7beb42578ea3747b3f2"/><dir name="order"><dir name="view"><dir name="tab"><file name="info.phtml" hash="27c9c1407dbc7148c8d19e33b00e1261"/><file name="prescriptions.phtml" hash="c0c0a981a4ff38a96f1b65a707661d95"/></dir></dir></dir></dir></dir><dir name="layout"><file name="ce_prescriptionpayment.xml" hash="ad64d3458a37f0d7fdb90f31f334f9f3"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Ce_PrescriptionPayment.csv" hash="34be67dec4e5877bec766b9343399b45"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="js"><dir name="prescriptionpayment"><file name="jquery.form.js" hash="30462a68d2d2ea5733f8687c27d4e783"/><file name="pp-custom.js" hash="7144209f4cd26457fc3894cf69ffddc9"/></dir><file name="jquery-noconflict.js" hash="102c661f414e2f525bdfa04b47065605"/><file name="jquery-1.8.3.min.js" hash="e1288116312e4728f98923c79b034b67"/></dir><dir name="css"><dir name="prescriptionpayment"><file name="pp-custom.css" hash="045a7290990b2e831fda743c25283362"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ce_PrescriptionPayment.xml" hash="00be1ebba9d1706e92c55f18eea40e70"/></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.2.0</min><max>5.4.9</max></php></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PrescriptionPayment</name>
4
+ <version>0.1.2</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
14
  It enables the shop owner to let the customer select which items shall be paid via a prescription. Those items value will be set to 0.00. All other items can be paid via other payment methods (f. ex. PayPal).</description>
15
  <notes>Stable version. Please check https://github.com/codedge/prescriptionpayment for updates</notes>
16
  <authors><author><name>Holger L&#xF6;sken</name><user>codedge</user><email>post@codedge.de</email></author></authors>
17
+ <date>2013-06-04</date>
18
+ <time>17:33:59</time>
19
+ <contents><target name="magecommunity"><dir name="Ce"><dir name="PrescriptionPayment"><dir name="Block"><dir name="Adminhtml"><file name="Notifications.php" hash="b704ed2bdd65b4ce3a4a0c26d2747d2c"/><dir name="Sales"><dir name="Order"><file name="Prescriptionpayment.php" hash="06d7ad190a66112741a7f2433ac41574"/><dir name="View"><dir name="Tab"><file name="Prescriptions.php" hash="a8d9e2e4cf0fcb248252574515df77c5"/></dir></dir></dir></dir></dir><file name="Items.php" hash="bded2c200295547d495c719c27d01d67"/></dir><dir name="Helper"><file name="Data.php" hash="f3cd5a2e7a01c50807347233e1679bac"/></dir><dir name="Model"><file name="Observer.php" hash="44c0e492838c195b5284cab2653b050d"/><file name="Prescriptionpayment.php" hash="be5080a55cf0904ae20a92ce1f275d4e"/><dir name="Resource"><dir name="Prescriptionpayment"><file name="Collection.php" hash="d2832c12e80c463215a9207972e98a3d"/></dir><file name="Prescriptionpayment.php" hash="9bbe9c4f2bbbc887f4b9bae6e4d414b2"/></dir></dir><dir name="controllers"><file name="ItemsController.php" hash="b31dfbfd5a579e0615f9feb06d56b1d0"/></dir><dir name="etc"><file name="config.xml" hash="e8673eb77f7e74143c554ed2beaec6da"/><file name="system.xml" hash="cfc5c5fda957d198d0fe6e2e0df107be"/></dir><dir name="sql"><dir name="prescriptionpayment_setup"><file name="mysql4-install-0.1.0.php" hash="44af96f8e0ec3961b458cae89191efe9"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="prescriptionpayment"><file name="choose_payment.phtml" hash="293339e56babbfbfa6440b9f5c2aeeed"/><dir name="item"><file name="default.phtml" hash="5fd5f616a714102c5fc55ffb7fa4ae37"/></dir><file name="onepage_link.phtml" hash="80beb697df60eae9a012561553354bdd"/><dir name="selectitems"><file name="uploader.phtml" hash="4324af2b3ebd5cb9863c2aedb22bd285"/></dir><file name="selectitems.phtml" hash="c45576cdb02e377d2011a3d49b4f5894"/></dir></dir><dir name="layout"><file name="ce_prescriptionpayment.xml" hash="810eb7696493ea92b8730fffcfc89741"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="prescriptionpayment"><file name="notifications.phtml" hash="3bc8c15a8be0a7beb42578ea3747b3f2"/><dir name="order"><dir name="view"><dir name="tab"><file name="info.phtml" hash="27c9c1407dbc7148c8d19e33b00e1261"/><file name="prescriptions.phtml" hash="4d632fad378b6990192defef95c46e05"/></dir></dir></dir></dir></dir><dir name="layout"><file name="ce_prescriptionpayment.xml" hash="ad64d3458a37f0d7fdb90f31f334f9f3"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="de_DE"><file name="Ce_PrescriptionPayment.csv" hash="34be67dec4e5877bec766b9343399b45"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="default"><dir name="default"><dir name="js"><dir name="prescriptionpayment"><file name="jquery.form.js" hash="30462a68d2d2ea5733f8687c27d4e783"/><file name="pp-custom.js" hash="7144209f4cd26457fc3894cf69ffddc9"/></dir><file name="jquery-noconflict.js" hash="102c661f414e2f525bdfa04b47065605"/><file name="jquery-1.8.3.min.js" hash="e1288116312e4728f98923c79b034b67"/></dir><dir name="css"><dir name="prescriptionpayment"><file name="pp-custom.css" hash="045a7290990b2e831fda743c25283362"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Ce_PrescriptionPayment.xml" hash="00be1ebba9d1706e92c55f18eea40e70"/></dir></target></contents>
20
  <compatible/>
21
  <dependencies><required><php><min>5.2.0</min><max>5.4.9</max></php></required></dependencies>
22
  </package>