medma_job_management - Version 0.1.2

Version Notes

This is a first release version

Download this release

Release Info

Developer Medma Infomatix
Extension medma_job_management
Version 0.1.2
Comparing to
See all releases


Code changes from version 0.1.1 to 0.1.2

app/code/community/Medma/Job/Block/Adminhtml/Jobbackend/Grid.php CHANGED
@@ -27,23 +27,22 @@ class Medma_Job_Block_Adminhtml_Jobbackend_Grid extends Mage_Adminhtml_Block_Wid
27
  'index' => 'job_id',
28
  ));
29
 
30
- $this->addColumn('applicant_name', array(
31
- 'header' => Mage::helper('job')->__('Applicant Name'),
32
- 'align' =>'left',
33
- 'index' => 'applicant_name',
34
- ));
35
-
36
- $this->addColumn('applicant_email', array(
37
- 'header' => Mage::helper('job')->__('Applicant Email'),
38
- 'width' => '150px',
39
- 'index' => 'applicant_email',
40
- ));
41
-
42
- $this->addColumn('applicant_phone', array(
43
- 'header' => Mage::helper('job')->__('Applicant Phone'),
44
- 'width' => '150px',
45
- 'index' => 'applicant_phone',
46
- ));
47
 
48
  $this->addColumn('filename', array(
49
  'header' => Mage::helper('job')->__('File Path'),
@@ -51,8 +50,8 @@ class Medma_Job_Block_Adminhtml_Jobbackend_Grid extends Mage_Adminhtml_Block_Wid
51
  'index' => 'filename',
52
  ));
53
 
54
- $this->addExportType('*/*/exportCsv', Mage::helper('job')->__('CSV'));
55
- $this->addExportType('*/*/exportXml', Mage::helper('job')->__('XML'));
56
 
57
  return parent::_prepareColumns();
58
  }
27
  'index' => 'job_id',
28
  ));
29
 
30
+ $this->addColumn('applicant_email', array(
31
+ 'header' => Mage::helper('job')->__('Email'),
32
+ 'width' => '150px',
33
+ 'index' => 'applicant_email',
34
+ ));
35
+
36
+ $newColumns = Mage::getModel('job/columns')->fetchColumns();
37
+ if($newColumns){
38
+ foreach($newColumns as $newColumn){
39
+ $this->addColumn($newColumn['fieldName'], array(
40
+ 'header' => Mage::helper('job')->__($newColumn['colName']),
41
+ 'align' =>'left',
42
+ 'index' => $newColumn['fieldName'],
43
+ ));
44
+ }
45
+ }
 
46
 
47
  $this->addColumn('filename', array(
48
  'header' => Mage::helper('job')->__('File Path'),
50
  'index' => 'filename',
51
  ));
52
 
53
+ $this->addExportType('*/*/exportCsv', Mage::helper('job')->__('CSV'));
54
+ $this->addExportType('*/*/exportXml', Mage::helper('job')->__('XML'));
55
 
56
  return parent::_prepareColumns();
57
  }
app/code/community/Medma/Job/Model/Columns.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Job_Model_Columns
3
+ {
4
+
5
+ const Table_Name = 'job_manager';
6
+
7
+ public function addNewColumn($columnName,$require)
8
+ {
9
+ if($require==0)
10
+ {
11
+ $defination = 'varchar(255) null';
12
+ }
13
+ else
14
+ {
15
+ $defination = 'varchar(255) not null';
16
+ }
17
+ $resource = Mage::getSingleton('core/resource');
18
+ $jobTable = $resource->getTableName(Medma_Job_Model_Columns::Table_Name);
19
+ $write = $resource->getConnection('core_write');
20
+ $output = $write->addColumn($jobTable,$columnName,$defination);
21
+ return $output;
22
+ }
23
+
24
+ public function fetchColumns()
25
+ {
26
+ $newCol='';
27
+ $resource = Mage::getSingleton('core/resource');
28
+ $jobTable = $resource->getTableName(Medma_Job_Model_Columns::Table_Name);
29
+ $read = $resource->getConnection('core_read');
30
+ $query = 'show columns from '.$jobTable;
31
+ $fields = $read->fetchAll($query);
32
+ $i=0;
33
+ foreach($fields as $field)
34
+ {
35
+ if (strpos($field['Field'],'newcol_') !== false)
36
+ {
37
+ $newCol[$i]['fieldName'] = $field['Field'];//var_dump($field);exit;
38
+
39
+ $name = str_replace('newcol_','',$field['Field']);
40
+ $newCol[$i]['colName'] = ucwords(str_replace('_',' ',$name));
41
+ if($field['Null']==='NO')
42
+ {
43
+ $newCol[$i]['required'] = 'YES';
44
+ }
45
+ else
46
+ {
47
+ $newCol[$i]['required'] = 'NO';
48
+ }
49
+
50
+ $i++;
51
+ }
52
+ }
53
+ //exit;
54
+ return $newCol;
55
+ }
56
+ public function dropColumns($columnName)
57
+ {
58
+ $resource = Mage::getSingleton('core/resource');
59
+ $jobTable = $resource->getTableName(Medma_Job_Model_Columns::Table_Name);
60
+ $write = $resource->getConnection('core_write');
61
+ $output = $write->dropColumn($jobTable,$columnName);
62
+ return $output;
63
+ }
64
+ public function changeColumn($oldcolumnName,$newcolumnName,$require)
65
+ {
66
+ if($require==0)
67
+ {
68
+ $defination = 'varchar(255) null';
69
+ }
70
+ else
71
+ {
72
+ $defination = 'varchar(255) not null';
73
+ }
74
+ $resource = Mage::getSingleton('core/resource');
75
+ $jobTable = $resource->getTableName(Medma_Job_Model_Columns::Table_Name);
76
+ $write = $resource->getConnection('core_write');
77
+ $output = $write->changeColumn($jobTable,$oldcolumnName,$newcolumnName,$defination);
78
+ return $output;
79
+ }
80
+ }
app/code/community/Medma/Job/Model/Resource/__Setup.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Medma_Job_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
4
+ {
5
+
6
+ public function addNewColumn()
7
+ {
8
+ /*$installer = new Mage_Core_Model_Resource_Setup('job_setup');
9
+ $connection = $installer->getConnection();
10
+ $installer->startSetup();
11
+ $installer->getConnection()
12
+ ->addColumn($installer->getTable('job_manager'),
13
+ 'test',Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
14
+ array(
15
+ 'type' => 'text',
16
+ 'nullable' => true,
17
+ 'default' => null,
18
+ )
19
+ );
20
+ $installer->endSetup();*/
21
+
22
+ echo $this->getTable('job_manager');
23
+ }
24
+
25
+ }
26
+ ?>
app/code/community/Medma/Job/controllers/Adminhtml/AddcolumnsController.php ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Job_Adminhtml_AddcolumnsController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction()
5
+ {
6
+ $this->loadLayout();
7
+ $this->_setActiveMenu('job/addcolumns');
8
+ $this->_addBreadcrumb($this->__('Add columns'), $this->__('Add columns'));
9
+ $this->renderLayout();
10
+ }
11
+ public function saveAction()
12
+ {
13
+ try
14
+ {
15
+ $columnName = $this->getRequest()->getParam('add_col');
16
+ $columnName = str_replace(' ','_',strtolower($columnName));
17
+ $columnName = 'newcol_'.$columnName;
18
+
19
+ $require = $this->getRequest()->getParam('requiredCol');
20
+
21
+ $output = Mage::getModel('job/columns')->addNewColumn($columnName,$require);
22
+ //var_dump($output);exit;
23
+ if($output instanceof Varien_Db_Statement_Pdo_Mysql)
24
+ {
25
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('job')->__('Column added successfully'));
26
+ }
27
+ else if($output===true)
28
+ {
29
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('job')->__('The column name already exist'));
30
+ }
31
+ else
32
+ {
33
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('job')->__('Column is not added successfully'));
34
+ }
35
+ }
36
+ catch(Exception $e)
37
+ {
38
+ Mage::getSingleton('adminhtml/session')->addError($e);
39
+ }
40
+ return $this->_redirectUrl($this->getUrl('job/adminhtml_managecolumns'));
41
+ }
42
+ }
43
+ ?>
app/code/community/Medma/Job/controllers/Adminhtml/JobbackendController.php CHANGED
@@ -2,25 +2,6 @@
2
 
3
  class Medma_Job_Adminhtml_JobbackendController extends Mage_Adminhtml_Controller_Action
4
  {
5
- public function preDispatch(){
6
- parent::preDispatch();
7
-
8
- #register domain event starts
9
-
10
- $generalEmail = Mage::getStoreConfig('trans_email/ident_general/email');
11
- $domainName = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
12
-
13
-
14
- Mage::dispatchEvent('medma_domain_authentication',
15
- array(
16
- 'email' => $generalEmail,
17
- 'domain_name'=>$domainName,
18
- )
19
-
20
- );
21
- #register domain event ends
22
- }
23
-
24
  public function indexAction()
25
  {
26
  $this->loadLayout()
2
 
3
  class Medma_Job_Adminhtml_JobbackendController extends Mage_Adminhtml_Controller_Action
4
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  public function indexAction()
6
  {
7
  $this->loadLayout()
app/code/community/Medma/Job/controllers/Adminhtml/ManagecolumnsController.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Medma_Job_Adminhtml_ManagecolumnsController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+
5
+ public function indexAction()
6
+ {
7
+ $this->loadLayout();
8
+ $this->_setActiveMenu('job/managecolumns');
9
+ $this->renderLayout();
10
+ }
11
+ public function editAction()
12
+ {
13
+ $this->loadLayout();
14
+ $this->_setActiveMenu('job/managecolumns');
15
+ $this->renderLayout();
16
+ }
17
+ public function deleteAction()
18
+ {
19
+ $delColumns = $this->getRequest()->getParam('delColumns');
20
+ try{
21
+ if($delColumns)
22
+ {
23
+ foreach($delColumns as $delColumn)
24
+ {
25
+ Mage::getModel('job/columns')->dropColumns($delColumn);
26
+ }
27
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('job')->__('Column(s) deleted successfully'));
28
+
29
+ }
30
+ else
31
+ {
32
+ Mage::getSingleton('adminhtml/session')->addError(Mage::helper('job')->__('Please select a column'));
33
+ }
34
+ }
35
+ catch(Exception $e)
36
+ {
37
+ Mage::getSingleton('adminhtml/session')->addError($e);
38
+ }
39
+ return $this->_redirect('*/*');
40
+ }
41
+ public function editcolAction()
42
+ {
43
+ try
44
+ {
45
+ $columnsInfo = $this->getRequest()->getParams();
46
+
47
+ $oldcolumnName = $columnsInfo['fieldName'];
48
+
49
+ $newcolumnName = str_replace(' ','_',strtolower($columnsInfo['add_col']));
50
+ $newcolumnName = 'newcol_'.$newcolumnName;
51
+
52
+ $require = $columnsInfo['requiredCol'];
53
+
54
+ $output = Mage::getModel('job/columns')->changeColumn($oldcolumnName,$newcolumnName,$require);
55
+
56
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('job')->__('Column edited successfully'));
57
+
58
+ }
59
+ catch(Exception $e)
60
+ {
61
+ Mage::getSingleton('adminhtml/session')->addError($e);
62
+ }
63
+ return $this->_redirect('*/*');
64
+ }
65
+ }
66
+ ?>
app/code/community/Medma/Job/controllers/IndexController.php CHANGED
@@ -1,26 +1,6 @@
1
  <?php
2
  class Medma_Job_IndexController extends Mage_Core_Controller_Front_Action
3
  {
4
-
5
- public function preDispatch(){
6
- parent::preDispatch();
7
-
8
- #register domain event starts
9
-
10
- $generalEmail = Mage::getStoreConfig('trans_email/ident_general/email');
11
- $domainName = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
12
-
13
-
14
- Mage::dispatchEvent('medma_domain_authentication',
15
- array(
16
- 'email' => $generalEmail,
17
- 'domain_name'=>$domainName,
18
- )
19
-
20
- );
21
- #register domain event ends
22
- }
23
-
24
  public function IndexAction()
25
  {
26
  $this->loadLayout();
@@ -46,33 +26,34 @@ class Medma_Job_IndexController extends Mage_Core_Controller_Front_Action
46
  if ($data = $this->getRequest()->getPost())
47
  {
48
  //echo "Test 1".$_FILES['filename']['name'];
49
- if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '')
50
- {
51
  try {
52
- /* Starting upload */
53
- $uploader = new Varien_File_Uploader('filename');
 
 
54
 
55
- /* Any extention would work */
56
- $uploader->setAllowedExtensions(array('doc','docx','txt','odt'));
57
- $uploader->setAllowRenameFiles(false);
58
-
59
- /*
60
- * Set the file upload mode
61
- * false -> get the file directly in the specified folder
62
- * true -> get the file in the product like folders
63
- * (file.jpg will go in something like /media/f/i/file.jpg)
64
- */
65
- $uploader->setFilesDispersion(false);
66
 
67
- // We set media as the upload dir
68
- $path = Mage::getBaseDir('media') . DS .'cv';
69
- $uploader->save($path, $_FILES['filename']['name'] );
70
-
71
- //this way the name is saved in DB
72
- $data['filename'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'cv/'.$_FILES['filename']['name'];
73
 
74
- //echo $data['filename']; exit;
 
75
 
 
 
76
  $model = Mage::getModel('job/jobmanagement');
77
 
78
  $model->setData($data)
@@ -83,13 +64,16 @@ class Medma_Job_IndexController extends Mage_Core_Controller_Front_Action
83
 
84
  }
85
  catch (Exception $e) {
86
- Mage::getSingleton('core/session')->addError($e->getMessage());
87
- Mage::getSingleton('core/session')->setFormData($data);
88
- $this->_redirect('*/*/');
89
- }
90
 
91
- }
92
  }
93
  $this->_redirect('*/*/');
94
  }
 
 
 
 
95
  }
1
  <?php
2
  class Medma_Job_IndexController extends Mage_Core_Controller_Front_Action
3
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  public function IndexAction()
5
  {
6
  $this->loadLayout();
26
  if ($data = $this->getRequest()->getPost())
27
  {
28
  //echo "Test 1".$_FILES['filename']['name'];
29
+
 
30
  try {
31
+ if(isset($_FILES['filename']['name']) && $_FILES['filename']['name'] != '')
32
+ {
33
+ /* Starting upload */
34
+ $uploader = new Varien_File_Uploader('filename');
35
 
36
+ /* Any extention would work */
37
+ $uploader->setAllowedExtensions(array('doc','docx','txt','odt','pdf'));
38
+ $uploader->setAllowRenameFiles(false);
39
+
40
+ /*
41
+ * Set the file upload mode
42
+ * false -> get the file directly in the specified folder
43
+ * true -> get the file in the product like folders
44
+ * (file.jpg will go in something like /media/f/i/file.jpg)
45
+ */
46
+ $uploader->setFilesDispersion(false);
47
 
48
+ // We set media as the upload dir
49
+ $path = Mage::getBaseDir('media') . DS .'cv';
50
+ $uploader->save($path, $_FILES['filename']['name'] );
 
 
 
51
 
52
+ //this way the name is saved in DB
53
+ $data['filename'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).'cv/'.$_FILES['filename']['name'];
54
 
55
+ //echo $data['filename']; exit;
56
+ }
57
  $model = Mage::getModel('job/jobmanagement');
58
 
59
  $model->setData($data)
64
 
65
  }
66
  catch (Exception $e) {
67
+ Mage::getSingleton('core/session')->addError($e->getMessage().' File type should be doc/docx/txt/odt/pdf');
68
+ Mage::getSingleton('core/session')->setFormData($data);
69
+ $this->_redirect('*/*/');
70
+ }
71
 
 
72
  }
73
  $this->_redirect('*/*/');
74
  }
75
+ public function testAction()
76
+ {
77
+ Mage::getModel('job/columns')->dropColumns('newcol_test_field2');
78
+ }
79
  }
app/code/community/Medma/Job/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Medma_Job>
5
- <version>0.1.1</version>
6
  </Medma_Job>
7
  </modules>
8
  <frontend>
@@ -24,16 +24,6 @@
24
  </layout>
25
  </frontend>
26
  <global>
27
- <events>
28
- <medma_domain_authentication>
29
- <observers>
30
- <medma_job_observer>
31
- <class>Medma_Job_Model_Authenticate</class>
32
- <method>saveDomain</method>
33
- </medma_job_observer>
34
- </observers>
35
- </medma_domain_authentication>
36
- </events>
37
  <helpers>
38
  <job>
39
  <class>Medma_Job_Helper</class>
@@ -101,6 +91,11 @@
101
  <sort_order>0</sort_order>
102
  <action>job/adminhtml_jobbackend</action>
103
  </jobbackend>
 
 
 
 
 
104
  </children>
105
  </job>
106
  </menu>
@@ -118,6 +113,9 @@
118
  <jobbackend translate="title">
119
  <title>Job Management</title>
120
  </jobbackend>
 
 
 
121
  </children>
122
  </job>
123
  </children>
2
  <config>
3
  <modules>
4
  <Medma_Job>
5
+ <version>0.1.2</version>
6
  </Medma_Job>
7
  </modules>
8
  <frontend>
24
  </layout>
25
  </frontend>
26
  <global>
 
 
 
 
 
 
 
 
 
 
27
  <helpers>
28
  <job>
29
  <class>Medma_Job_Helper</class>
91
  <sort_order>0</sort_order>
92
  <action>job/adminhtml_jobbackend</action>
93
  </jobbackend>
94
+ <managecolumns module="job">
95
+ <title>Manage Columns</title>
96
+ <sort_order>1</sort_order>
97
+ <action>job/adminhtml_managecolumns</action>
98
+ </managecolumns>
99
  </children>
100
  </job>
101
  </menu>
113
  <jobbackend translate="title">
114
  <title>Job Management</title>
115
  </jobbackend>
116
+ <managecolumns translate="title">
117
+ <title>Manage Columns</title>
118
+ </managecolumns>
119
  </children>
120
  </job>
121
  </children>
app/code/community/Medma/Job/sql/job_setup/mysql4-upgrade-0.1.0-0.1.1.php CHANGED
@@ -21,11 +21,7 @@ $installer = $this;
21
 
22
  $installer->startSetup();
23
 
24
- /**
25
-
26
- write your modulename
27
 
28
- **/
29
 
30
  $installer->run("
31
 
21
 
22
  $installer->startSetup();
23
 
 
 
 
24
 
 
25
 
26
  $installer->run("
27
 
app/code/community/Medma/Job/sql/job_setup/mysql4-upgrade-0.1.1-0.1.2.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Medma Lenswebshop Module.
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Magento Team
8
+ * that is bundled with this package of Medma Infomatix Pvt. Ltd.
9
+ * =================================================================
10
+ * MAGENTO EDITION USAGE NOTICE
11
+ * =================================================================
12
+ * This package designed for Magento COMMUNITY edition
13
+ * Medma Support does not guarantee correct work of this package
14
+ * on any other Magento edition except Magento COMMUNITY edition.
15
+ * =================================================================
16
+ */
17
+
18
+
19
+
20
+ $installer = $this;
21
+
22
+ $installer->startSetup();
23
+
24
+
25
+ $installer->run("
26
+
27
+ ALTER TABLE `{$this->getTable('job_manager')}` DROP COLUMN applicant_name;
28
+ ALTER TABLE `{$this->getTable('job_manager')}` DROP COLUMN applicant_phone;
29
+
30
+ ");
31
+
32
+ $installer->endSetup();
33
+ ?>
app/design/adminhtml/default/default/layout/job.xml CHANGED
@@ -1,8 +1,23 @@
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
  <job_adminhtml_jobbackend_index>
4
- <reference name="content">
5
- <block type="job/adminhtml_jobbackend_grid" name="jobbackend.grid"/>
6
- </reference>
7
  </job_adminhtml_jobbackend_index>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  </layout>
1
  <?xml version="1.0"?>
2
  <layout version="0.1.0">
3
  <job_adminhtml_jobbackend_index>
4
+ <reference name="content">
5
+ <block type="job/adminhtml_jobbackend_grid" name="jobbackend.grid"/>
6
+ </reference>
7
  </job_adminhtml_jobbackend_index>
8
+ <job_adminhtml_addcolumns_index>
9
+ <reference name="content">
10
+ <block type="core/template" name="jobbackend.addcolumns" template="job/addcolumns.phtml"/>
11
+ </reference>
12
+ </job_adminhtml_addcolumns_index>
13
+ <job_adminhtml_managecolumns_index>
14
+ <reference name="content">
15
+ <block type="core/template" name="jobbackend.addcolumns" template="job/managecolumns.phtml"/>
16
+ </reference>
17
+ </job_adminhtml_managecolumns_index>
18
+ <job_adminhtml_managecolumns_edit>
19
+ <reference name="content">
20
+ <block type="core/template" name="jobbackend.addcolumns" template="job/editcolumns.phtml"/>
21
+ </reference>
22
+ </job_adminhtml_managecolumns_edit>
23
  </layout>
app/design/adminhtml/default/default/template/job/addcolumns.phtml ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form action="<?php echo Mage::helper('adminhtml')->getUrl('job/adminhtml_addcolumns/save')?>" method="post"/>
2
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey()?>"/>
3
+ <div class="entry-edit">
4
+ <div class="entry-edit-head">
5
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Add new column')?></h4>
6
+ </div>
7
+ <div class="box">
8
+ <div class="hor-scroll">
9
+ <table cellspacing="0" class="form-list">
10
+ <tbody>
11
+ <tr>
12
+ <td class="label"><?php echo $this->__('Column Name')?></span></td>
13
+ <td class="value">
14
+ <input class="input-text" type="text" name="add_col"/>
15
+ </td>
16
+ </tr>
17
+ <tr>
18
+ <td class="label"><?php echo $this->__('Required')?></span></td>
19
+ <td class="value">
20
+ <select name="requiredCol">
21
+ <option value="0"><?php echo $this->__('Not Required')?></option>
22
+ <option value="1"><?php echo $this->__('Required')?></option>
23
+ </select>
24
+ </td>
25
+ </tr>
26
+ <tr><td>&nbsp;</td></tr>
27
+ <tr>
28
+ <td class="a-left"><button title="<?php echo $this->__('Save Column')?>" type="submit"><span><span><span><?php echo $this->__('Save Column')?></span></span></span></button></td>
29
+ </tr>
30
+ </tbody>
31
+ </table>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </form>
app/design/adminhtml/default/default/template/job/editcolumns.phtml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <form action="<?php echo Mage::helper('adminhtml')->getUrl('job/adminhtml_managecolumns/editcol')?>" method="post"/>
2
+ <?php $colData = $this->getRequest()->getParams()?>
3
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey()?>"/>
4
+ <div class="entry-edit">
5
+ <div class="entry-edit-head">
6
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Edit column')?></h4>
7
+ </div>
8
+ <div class="box">
9
+ <div class="hor-scroll">
10
+ <table cellspacing="0" class="form-list">
11
+ <tbody>
12
+ <tr>
13
+ <td class="label"><?php echo $this->__('Column Name')?></span></td>
14
+ <td class="value">
15
+ <input class="input-text" type="text" name="add_col" value="<?php echo $colData['colName']?>"/>
16
+ <input type="hidden" name="fieldName" value="<?php echo $colData['fieldName']?>"/>
17
+ </td>
18
+ </tr>
19
+ <tr>
20
+ <td class="label"><?php echo $this->__('Required')?></span></td>
21
+ <td class="value">
22
+ <select name="requiredCol">
23
+ <option value="0" <?php if($colData['required']=='NO'):?>selected="selected"<?php endif;?>><?php echo $this->__('Not Required')?></option>
24
+ <option value="1" <?php if($colData['required']=='YES'):?>selected="selected"<?php endif;?>><?php echo $this->__('Required')?></option>
25
+ </select>
26
+ </td>
27
+ </tr>
28
+ <tr><td>&nbsp;</td></tr>
29
+ <tr>
30
+ <td class="a-left"><button title="<?php echo $this->__('Edit Column')?>" type="submit"><span><span><span><?php echo $this->__('Save Column')?></span></span></span></button></td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </form>
app/design/adminhtml/default/default/template/job/managecolumns.phtml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="content-header">
2
+ <table cellspacing="0">
3
+ <tbody><tr>
4
+ <td style="width:50%;"><h3 class="icon-head head-products"><?php echo $this->__('Manage Columns')?></h3></td>
5
+ <td class="a-right">
6
+ <button title="<?php echo $this->__('Add Column')?>" type="button" class="scalable add" onclick="setLocation('<?php echo Mage::helper('adminhtml')->getUrl('job/adminhtml_addcolumns')?>')" style=""><span><span><span><?php echo $this->__('Add Column')?></span></span></span></button></td>
7
+ </tr>
8
+ </tbody></table>
9
+ </div>
10
+ <form action="<?php echo Mage::helper('adminhtml')->getUrl('job/adminhtml_managecolumns/delete')?>" method="post"/>
11
+ <?php $newColumns = Mage::getModel('job/columns')->fetchColumns();?>
12
+ <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey()?>"/>
13
+ <div class="entry-edit">
14
+ <div class="entry-edit-head">
15
+ <h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Select columns')?></h4>
16
+ </div>
17
+ <div class="box">
18
+ <div class="hor-scroll">
19
+ <table cellspacing="0" class="form-list" style="width:100%">
20
+ <?php if($newColumns):?>
21
+ <thead>
22
+ <tr>
23
+ <th class="a-left" style="width:5px;"><?php echo $this->__('Select')?></th>
24
+ <th class="a-left" style="width:175px;"><?php echo $this->__('Column Name')?></th>
25
+ <th class="a-left" style="width:175px;"><?php echo $this->__('Require')?></th>
26
+ <th class="a-left"><?php echo $this->__('Edit Column')?></th>
27
+ </tr>
28
+ <tr><td>&nbsp;</td></tr>
29
+ </thead>
30
+ <?php endif;?>
31
+ <tbody>
32
+ <?php
33
+ $i=0;
34
+ if($newColumns):
35
+ foreach($newColumns as $newColumn):
36
+ ?>
37
+ <tr>
38
+ <td class="a-left" style="width:5px;"><input type="checkbox" name="delColumns[<?php echo $i++?>]" value="<?php echo $newColumn['fieldName']?>"/></td>
39
+ <td class="a-left" style="width:175px;">
40
+ <?php echo $this->__($newColumn['colName'])?>
41
+ </td>
42
+ <td class="a-left" style="width:175px;">
43
+ <?php echo $this->__($newColumn['required'])?>
44
+ </td>
45
+ <td class="a-left">
46
+ <a href="<?php echo Mage::helper('adminhtml')->getUrl('job/adminhtml_managecolumns/edit/').'?colName='.$newColumn['colName'].'&fieldName='.$newColumn['fieldName'].'&required='.$newColumn['required']?>">
47
+ <?php echo $this->__('Edit')?>
48
+ </a>
49
+ </td>
50
+ </tr>
51
+ <?php endforeach;?>
52
+
53
+ <tr><td>&nbsp;</td></tr>
54
+ <tr>
55
+ <td class="a-left"><button title="<?php echo $this->__('Delete Column(s)')?>" type="submit"><span><span><span><?php echo $this->__('Delete Column(s)')?></span></span></span></button></td>
56
+ </tr>
57
+ <?php else:?>
58
+ <tr><td><?php echo $this->__('No additional Column exist')?></td></tr>
59
+ <?php endif;?>
60
+ </tbody>
61
+ </table>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </form>
app/design/frontend/default/default/template/job/index.phtml CHANGED
@@ -1,55 +1,50 @@
1
- <?php
2
- /*
3
- * Module : Job Management
4
- * Powered By
5
- * Anx Medma
6
- */
7
- ?>
8
-
9
- <h1>Job Management</h1>
10
 
11
  <form action="<?php echo $this->getPostUrl('job/index/save') ?>" id="jobForm" method="post" enctype="multipart/form-data">
12
  <div class="fieldset">
13
- <h2 class="legend">Applicant Information</h2>
14
- <ul class="form-list">
15
- <li class="fields">
16
- <div class="field">
17
- <label for="name" class="required"><em>*</em>Applicant Name</label>
18
- <div class="input-box">
19
- <input name="applicant_name" id="applicant_name" title="Applicant Name" class="input-text required-entry" type="text">
20
- </div>
21
- </div>
22
- <div class="field">
23
- <label for="email" class="required"><em>*</em>Email</label>
24
- <div class="input-box">
25
- <input name="applicant_email" id="applicant_email" title="Applicant Email" value="" class="input-text required-entry validate-email" type="text">
26
- </div>
27
- </div>
28
- </li>
29
- <li>
30
- <label for="telephone">Telephone</label>
31
- <div class="input-box">
32
- <input name="applicant_phone" id="applicant_phone" title="Applicant Phone" value="" class="input-text" type="text">
33
- </div>
34
- </li>
 
 
35
  </ul>
36
  </div>
 
37
  <div class="fieldset">
38
- <h2 class="legend">Upload CV</h2>
39
  <ul class="form-list">
40
  <li class="fields">
41
  <div class="field">
42
- <label for="name" class="required"><em>*</em>Upload</label>
43
  <div class="input-box">
44
- <input type="file" name="filename" id="filename" title="Upload File" value="" class="required-entry" />
45
  </div>
46
  </div>
47
  </li>
48
  </ul>
49
  </div>
50
  <div class="buttons-set">
51
- <p class="required">* Required Fields</p>
52
- <button type="submit" title="Submit" class="button"><span><span>Submit</span></span></button>
53
  </div>
54
  </form>
55
 
1
+ <h1><?php echo $this->__('Job Management')?></h1>
 
 
 
 
 
 
 
 
2
 
3
  <form action="<?php echo $this->getPostUrl('job/index/save') ?>" id="jobForm" method="post" enctype="multipart/form-data">
4
  <div class="fieldset">
5
+ <h2 class="legend"><?php echo $this->__('Applicant Information')?></h2>
6
+ <ul class="form-list">
7
+ <li>
8
+ <label for="applicant_email" class="required"><em>*</em><?php echo $this->__('Email');?></label>
9
+ <div class="input-box">
10
+ <input name="applicant_email" id="applicant_email" title="<?php echo $this->__('Email');?>" value="" class="input-text required-entry validate-email" type="text">
11
+ </div>
12
+ </li>
13
+ <?php
14
+ $newColumns = Mage::getModel('job/columns')->fetchColumns();
15
+ if($newColumns):
16
+ ?>
17
+ <?php foreach($newColumns as $newColumn):?>
18
+ <li>
19
+ <label for="<?php echo $newColumn['fieldName']?>" <?php if($newColumn['required']=='YES'):?>class="required"<?php endif;?>>
20
+ <?php if($newColumn['required']=='YES'):?><em>*</em><?php endif;?>
21
+ <?php echo $this->__($newColumn['colName'])?>
22
+ </label>
23
+ <div class="input-box">
24
+ <input name="<?php echo $newColumn['fieldName']?>" id="<?php echo $newColumn['fieldName']?>" title="<?php echo $this->__($newColumn['colName'])?>" value="" class="input-text <?php if($newColumn['required']=='YES'):?>required-entry<?php endif;?>" type="text">
25
+ </div>
26
+ </li>
27
+ <?php endforeach;?>
28
+ <?php endif;?>
29
  </ul>
30
  </div>
31
+
32
  <div class="fieldset">
33
+ <h2 class="legend"><?php echo $this->__('Upload')?></h2>
34
  <ul class="form-list">
35
  <li class="fields">
36
  <div class="field">
37
+ <label for="name"><?php echo $this->__('Upload')?></label>
38
  <div class="input-box">
39
+ <input type="file" name="filename" id="filename" title="<?php echo $this->__('Upload')?>" value=""/>
40
  </div>
41
  </div>
42
  </li>
43
  </ul>
44
  </div>
45
  <div class="buttons-set">
46
+ <p class="required">* <?php echo $this->__('Required Fields')?></p>
47
+ <button type="submit" title="<?php echo $this->__('Submit')?>" class="button"><span><span><?php echo $this->__('Submit')?></span></span></button>
48
  </div>
49
  </form>
50
 
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>medma_job_management</name>
4
- <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,9 +10,9 @@
10
  <description>Medma offers a section for adding a careers option to your store</description>
11
  <notes>This is a first release version</notes>
12
  <authors><author><name>Medma_Infomatix</name><user>Medma_Infomatix</user><email>gaurav@medma.in</email></author></authors>
13
- <date>2014-01-21</date>
14
- <time>10:10:38</time>
15
- <contents><target name="magecommunity"><dir name="Medma"><dir name="Job"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Jobbackend"><file name="Edit.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="Grid.php" hash="8b533a04b92966fd27700d8b32f7a179"/></dir><file name="Jobbackend.php" hash="1e929e331fdfd77516d815053980d7ac"/></dir><file name="Index.php" hash="bda36f4d481cf4558dd8ef547de180f0"/></dir><dir name="Helper"><file name="Data.php" hash="041134e77527eaa974f7b6428a89785a"/></dir><dir name="Model"><file name="Authenticate.php" hash="cd7897b5ccea7dc458042f0e57895236"/><file name="Jobmanagement.php" hash="ed3ce4642391593b83482ff81ea4cac9"/><dir name="Mysql4"><dir name="Jobmanagement"><file name="Collection.php" hash="f0caf42962ecd569390132bcd8788232"/></dir><file name="Jobmanagement.php" hash="3275740d7d05f872b33392f760626b96"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="JobbackendController.php" hash="bd8298cf0b06492099d6bc3b3cf7e13b"/></dir><file name="IndexController.php" hash="b54993614f897a4cb6864796ce261aeb"/></dir><dir name="etc"><file name="config.xml" hash="c659e21baefd9ad9c4a30b6b8a099263"/></dir><dir name="sql"><dir name="job_setup"><file name="mysql4-install-0.1.0.php" hash="947e0160dfb3a1190cdabed2f6869d2a"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="6313379aab28efbf9f8f493dc70acc0f"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="job"><file name="index.phtml" hash="57e0dc33ae2f6c1654e849aef6a77931"/></dir></dir><dir name="layout"><file name="job.xml" hash="2df851d767c9fa3939ece46762b62244"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="job.xml" hash="452312eaebcfbc53d53c832da9ed3f91"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Medma_Job.xml" hash="7405985e231df64bdf3d4970e6c1bc60"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>medma_job_management</name>
4
+ <version>0.1.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/OSL-3.0">OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>Medma offers a section for adding a careers option to your store</description>
11
  <notes>This is a first release version</notes>
12
  <authors><author><name>Medma_Infomatix</name><user>Medma_Infomatix</user><email>gaurav@medma.in</email></author></authors>
13
+ <date>2014-01-24</date>
14
+ <time>13:00:05</time>
15
+ <contents><target name="magecommunity"><dir name="Medma"><dir name="Job"><dir><dir name="Block"><dir name="Adminhtml"><dir name="Jobbackend"><file name="Edit.php" hash="d41d8cd98f00b204e9800998ecf8427e"/><file name="Grid.php" hash="8d26da7c287787fc6ecaa7d6d7c7a5f4"/></dir><file name="Jobbackend.php" hash="1e929e331fdfd77516d815053980d7ac"/></dir><file name="Index.php" hash="bda36f4d481cf4558dd8ef547de180f0"/></dir><dir name="Helper"><file name="Data.php" hash="041134e77527eaa974f7b6428a89785a"/></dir><dir name="Model"><file name="Authenticate.php" hash="cd7897b5ccea7dc458042f0e57895236"/><file name="Columns.php" hash="010d84436d72f5e2fbdb5e1a0087f207"/><file name="Jobmanagement.php" hash="ed3ce4642391593b83482ff81ea4cac9"/><dir name="Mysql4"><dir name="Jobmanagement"><file name="Collection.php" hash="f0caf42962ecd569390132bcd8788232"/></dir><file name="Jobmanagement.php" hash="3275740d7d05f872b33392f760626b96"/></dir><dir name="Resource"><file name="__Setup.php" hash="0e442e5af53225eeb4157da9a41da3fd"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AddcolumnsController.php" hash="5d766f51462bb8eeb6583530233ef332"/><file name="JobbackendController.php" hash="36797cf05ab904ea25a7cde104b57cdc"/><file name="ManagecolumnsController.php" hash="3632cdc8a20bc80aada5880ae4a746a3"/></dir><file name="IndexController.php" hash="4cfa5a517b1636ae518ed95b51cf3714"/></dir><dir name="etc"><file name="config.xml" hash="001327b0bd7364a4b47fcce9f2686d22"/></dir><dir name="sql"><dir name="job_setup"><file name="mysql4-install-0.1.0.php" hash="947e0160dfb3a1190cdabed2f6869d2a"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="bc3bb9c7662e3d4ecee7ba9b0f76059d"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="cf0854340afe6f1809a463b3511fdab2"/></dir></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="template"><dir name="job"><file name="index.phtml" hash="8cac880441b987841ad4ae7292867fbb"/></dir></dir><dir name="layout"><file name="job.xml" hash="2df851d767c9fa3939ece46762b62244"/></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="job.xml" hash="c5f4a945e55c6c801f607f0a472289fe"/></dir><dir name="template"><dir name="job"><file name="addcolumns.phtml" hash="6391b115ac2f31a727703bbdb6e83e48"/><file name="editcolumns.phtml" hash="29b0e3663d3e03331d5280d9a2463c21"/><file name="managecolumns.phtml" hash="e90cd97c167a0a957d20b22a599466e3"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Medma_Job.xml" hash="7405985e231df64bdf3d4970e6c1bc60"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
18
  </package>