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 | |
var $virtualFields = array( | |
'full_name' => "CONCAT(`Contact`.`first_name`, ' ', `Contact`.`last_name`)", | |
'directory_name' => "CONCAT(`Contact`.`last_name`, ', ', `Contact`.`first_name`)", | |
'abbr_name' => "CONCAT(LEFT(`Contact`.`first_name`, 1), '. ', `Contact`.`last_name`)" | |
); |
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 | |
function _findAccessible($state, $query, $results = array()) { | |
if ($state == 'before') { | |
if (isset($query[0]) && is_numeric($query[0])) { | |
$query['conditions'][$this->alias . '.id'] = $query[0]; | |
} | |
$query['fields'] = $this->primaryKey; | |
$query['recursive'] = -1; | |
return $query; | |
} elseif ($state == 'after') { |
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 AppController extends Controller { | |
function beforeFilter() { | |
$this->loadModel('ErpContract'); | |
debug($this->ErpContract->find('first', array( | |
'fields' => array('No_', 'Change Order No_') | |
))); | |
} | |
} |
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 Page extends AppModel { | |
var $_findMethods = array( | |
'index' => true, | |
); | |
function _findRevision($state, $query, $results = array()) { | |
if ($state == 'before') { | |
if (empty($query['slug'])) { |
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 | |
return $this->find('all', array( | |
'contain' => array( | |
'ExceptionWorkflowLog', | |
'Procedure(id,cpt,expected_amount,allowed_amount,difference_amount)', | |
'Procedure.Claim(id,number)', | |
'Procedure.Claim.Group(abbr)' | |
), | |
'conditions' => $conditions, | |
'order' => array('PaymentException.created', 'PaymentException.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
load 'deploy' if respond_to?(:namespace) | |
# basics | |
set :branch, "master" | |
set :scm, "git" | |
set :deploy_via, :remote_cache | |
# ssh | |
set :user, "shared-user" | |
ssh_options[:forward_agent] = true |
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 | |
$this->PaymentException->bindModel(array( | |
'hasOne' => array( | |
'Claim' => array( | |
'foreignKey' => false, | |
'conditions' => array('Claim.id = Procedure.claim_id') | |
), | |
'Payer' => array( | |
'foreignKey' => false, | |
'conditions' => array('Payer.id = Procedure.payer_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
# Controller - | |
<?php | |
$this->paginate = array( | |
'limit' => 50, | |
'contain' => array( | |
'ExceptionWorkflowLog', | |
'Procedure(id,cpt,expected_amount,allowed_total,difference_amount)', | |
'Procedure.Claim(id,number)', | |
'Procedure.Claim.Group(abbr)', | |
'Procedure.Payer(abbr)' |
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 FileTreeHelper extends AppHelper { | |
var $elements = array( | |
'tree' => '<ul class="tree">%s</ul>', | |
'folder' => '<li id="tree-folder_%d" class="folder open"> | |
<div class="folder-name-wrap"><span class="icon">Sort</span><span class="folder-name">%s</span></div> | |
<div class="folder-contents"><ul class="folders">%s</ul><ul class="files">%s</ul></div></li>', | |
'file' => '<li id="tree-file_%d" class="file"><span class="icon">Sort</span><span class="file-name">%s</span></li>' | |
); | |
var $settings = array(); |
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 PaymentException extends AppModel { | |
var $actsAs = array('SoftDeletable'); | |
var $belongsTo = array('Procedure'); | |
var $hasMany = array( | |
'ExceptionWorkflowLog' => array( | |
'dependent' => true, | |
'order' => array('ExceptionWorkflowLog.created') | |
) | |
); |