Beispiel #1
0
function tombolApproval($url, $model)
{
    if (getPermission()) {
        //Permission Jabatan
        $a = getPermissionEmployee()->JOBGRADE_ID;
        $b = getPermission()->BTN_SIGN1;
        //if(getPermissionEmployee()->JOBGRADE_ID == 'S' OR getPermissionEmployee()->JOBGRADE_ID == 'M' OR getPermissionEmployee()->JOBGRADE_ID == 'SM' AND getPermission()->BTN_SIGN1==1 ){
        if ($a == 'SEVP' or $a == 'EVP' or $a == 'SVP' or $a == 'VP' or $a == 'AVP' or $a == 'SM' or $a == 'M' or $a == 'AM' or $a == 'S' and $b == 1) {
            if ($model->STATUS == 0 || $model->STATUS == 1) {
                // 0=process 101=Approved
                $title = Yii::t('app', 'approved');
                $options = [];
                $icon = '<span class="glyphicon glyphicon-ok"></span>';
                $label = $icon . ' ' . $title;
                $url = Url::toRoute(['/purchasing/sales-order/approved', 'kd' => $model->KD_SA]);
                //$url = Url::toRoute(['/purchasing/sales-order/approved']);
                //$url = Url::toRoute(['/purchasing/sales-order/approved']);
                $options['tabindex'] = '-1';
                return '<li>' . Html::a($label, $url, $options) . '</li>' . PHP_EOL;
            }
        }
    }
}
Beispiel #2
0
function tombolCancel($url, $model)
{
    if (getPermission()) {
        //Permission Jabatan
        $a = getPermissionEmployee()->JOBGRADE_ID;
        $b = getPermission()->BTN_SIGN1;
        if ($a == 'SEVP' or $a == 'EVP' or $a == 'SVP' or $a == 'VP' or $a == 'AVP' or $a == 'SM' or $a == 'M' or $a == 'AM' or $a == 'S' and $b == 1) {
            if ($model->STATUS !== 101 or $model->STATUS !== 4 or $model->STATUS !== 3 or $model->STATUS !== 0) {
                // 0=process 4= Reject
                $title = Yii::t('app', 'Cancel');
                $options = ['id' => 'cancel', 'data-pjax' => true, 'data-toggle-cancel' => $model->ID];
                $icon = '<span class="glyphicon glyphicon-ok"></span>';
                $label = $icon . ' ' . $title;
                return '<li>' . Html::a($label, '', $options) . '</li>' . PHP_EOL;
            }
        }
    }
}