This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class tables_mytable { | |
function beforeSave(Dataface_Record $record){ | |
if ( $record->valueChanged('status') and $record->val('status') === 'Broken' ){ | |
$record->pouch['send_broken_email'] = true; | |
} | |
} | |
function afterSave(Dataface_Record $record){ | |
if ( @$record->pouch['send_broken_email'] ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class tables_mytable { | |
function beforeSave(Dataface_Record $record){ | |
if ( $record->valueChanged('status') and $record->val('status') === 'Broken' ){ | |
$callbacks = array(); | |
$callbacks[] = function(Dataface_Record $record){ | |
mail(...); | |
}; | |
$record->pouch['afterSave_callbacks'] = $callbacks; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class tables_issues { | |
... | |
function status__renderCell(Dataface_Record $record){ | |
$options = array( | |
'Select...', | |
'Open', | |
'Closed', | |
); | |
$currVal = $record->val('status'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[status] | |
widget:type=select | |
vocabulary=statuses | |
noLinkFromListView=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alert('here'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class tables_issues { | |
... | |
function status__renderCell(Dataface_Record $record){ | |
Dataface_JavascriptTool::getInstance() | |
->import('editable_status.js'); | |
$options = array( | |
'Select...', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A closure: An anonymous javascript function, that is called | |
// immediately after creation. | |
(function(){ | |
// Enter javascript code here. | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//require <jquery.packed.js> | |
//require <xataface/IO.js> | |
(function(){ | |
// Get a short handle to the jQuery object | |
var $ = jQuery; | |
//.. rest of javascript here | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//require <jquery.packed.js> | |
//require <xataface/IO.js> | |
(function(){ | |
var $ = jQuery; | |
//registerXatafaceDecorator() is like $(document).ready() except that it may also be called | |
// when a node is loaded via ajax. | |
registerXatafaceDecorator(function(node){ | |
$('select.status-drop-down[data-record-id]', node).change(function(){ | |
var recordId = $(this).attr('data-record-id'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function block__before_instructions_widget(){ | |
Dataface_JavascriptTool::getInstance() | |
->import('tables/job_postings/import_instructions.js'); | |
echo '<button class="import-job-posting-instructions">Copy Instructions from Prev. Semester</button>'; | |
} |