Ejemplo n.º 1
0
/**
 * Returns corporate users search form
 * 
 * @global object $ubillingConfig
 * @return string
 */
function web_CorpsSearchForm()
{
    global $ubillingConfig;
    $alterCfg = $ubillingConfig->getAlter();
    $result = '';
    if ($alterCfg['CORPS_ENABLED']) {
        $result .= wf_tag('h3') . __('Corporate users') . wf_tag('h3', true);
        if ($alterCfg['SEARCHADDR_AUTOCOMPLETE']) {
            $corps = new Corps();
            $corpsDataRaw = $corps->getCorps();
            $corpsNames = array();
            if (!empty($corpsDataRaw)) {
                foreach ($corpsDataRaw as $io => $each) {
                    $corpsNames[] = $each['corpname'];
                }
            }
            $inputs = wf_AutocompleteTextInput('searchcorpname', $corpsNames, '', '', false, '30');
        } else {
            $inputs = wf_TextInput('searchcorpname', '', '', false, '30');
        }
        $inputs .= wf_Submit(__('Search'));
        $result .= wf_Form('?module=corps&show=search', 'POST', $inputs, '');
    }
    return $result;
}
Ejemplo n.º 2
0
/**
 * Returns task editing form
 * 
 * @global object $ubillingConfig
 * @param int $taskid
 * @return string
 */
function ts_TaskModifyForm($taskid)
{
    global $ubillingConfig;
    $altercfg = $ubillingConfig->getAlter();
    $taskid = vf($taskid, 3);
    $taskdata = ts_GetTaskData($taskid);
    $result = '';
    $allemployee = ts_GetAllEmployee();
    $activeemployee = ts_GetActiveEmployee();
    $alljobtypes = ts_GetAllJobtypes();
    if (!empty($taskdata)) {
        $inputs = wf_HiddenInput('modifytask', $taskid);
        $inputs .= '<!--ugly hack to prevent datepicker autoopen --> <input type="text" name="shittyhackmod" style="width: 0; height: 0; top: -100px; position: absolute;"/>';
        if (cfr('TASKMANDATE')) {
            $inputs .= wf_DatePickerPreset('modifystartdate', $taskdata['startdate']);
        } else {
            $inputs .= wf_HiddenInput('modifystartdate', $taskdata['startdate']);
        }
        $inputs .= wf_TimePickerPreset('modifystarttime', $taskdata['starttime'], '', false);
        $inputs .= wf_tag('label') . __('Target date') . wf_tag('sup') . '*' . wf_tag('sup', true) . wf_tag('label', true);
        $inputs .= wf_delimiter();
        $inputs .= wf_tag('br');
        if ($altercfg['SEARCHADDR_AUTOCOMPLETE']) {
            $alladdress = zb_AddressGetFulladdresslistCached();
            natsort($alladdress);
            $inputs .= wf_AutocompleteTextInput('modifytaskaddress', $alladdress, __('Address') . '<sup>*</sup>', $taskdata['address'], true, '30');
        } else {
            $inputs .= wf_TextInput('modifytaskaddress', __('Address') . '<sup>*</sup>', $taskdata['address'], true, '30');
        }
        $inputs .= wf_tag('br');
        //custom login text input
        $inputs .= wf_TextInput('modifytasklogin', __('Login'), $taskdata['login'], true, 30);
        $inputs .= wf_tag('br');
        $inputs .= wf_TextInput('modifytaskphone', __('Phone') . '<sup>*</sup>', $taskdata['phone'], true, '30');
        $inputs .= wf_tag('br');
        $inputs .= wf_Selector('modifytaskjobtype', $alljobtypes, __('Job type'), $taskdata['jobtype'], true);
        $inputs .= wf_tag('br');
        $inputs .= wf_Selector('modifytaskemployee', $activeemployee, __('Who should do'), $taskdata['employee'], true);
        $inputs .= wf_tag('br');
        $inputs .= wf_tag('label') . __('Job note') . wf_tag('label', true) . wf_tag('br');
        $inputs .= wf_TextArea('modifytaskjobnote', '', $taskdata['jobnote'], true, '35x5');
        $inputs .= wf_Submit(__('Save'));
        $result = wf_Form("", 'POST', $inputs, 'glamour');
        $result .= __('All fields marked with an asterisk are mandatory');
    }
    return $result;
}
Ejemplo n.º 3
0
 /**
  * Returns ajax selector reply for outcoming operation creation form
  * 
  * @param string $destMark
  * @return string
  */
 public function outcomindAjaxDestSelector($destMark)
 {
     $result = '';
     $destMark = vf($destMark);
     $result .= wf_HiddenInput('newoutdesttype', $destMark);
     switch ($destMark) {
         case 'task':
             $tasksTmp = array();
             $allJobTypes = ts_GetAllJobtypes();
             $allUndoneTasks = ts_GetUndoneTasksArray();
             if (!empty($allUndoneTasks)) {
                 foreach ($allUndoneTasks as $io => $each) {
                     $tasksTmp[$io] = $each['address'] . ' - ' . $allJobTypes[$each['jobtype']];
                 }
             }
             $result .= wf_Selector('newoutdestparam', $tasksTmp, __('Undone tasks'), '', false);
             break;
         case 'contractor':
             $result .= wf_Selector('newoutdestparam', $this->allContractors, __('Contractor'), '', false);
             break;
         case 'employee':
             $result .= wf_Selector('newoutdestparam', $this->activeEmployee, __('Worker'), '', false);
             break;
         case 'storage':
             $result .= wf_Selector('newoutdestparam', $this->allStorages, __('Warehouse storage'), '', false);
             break;
         case 'user':
             $allUsers = zb_UserGetAllIPs();
             if (!empty($allUsers)) {
                 $allUsers = array_flip($allUsers);
             }
             $result .= wf_AutocompleteTextInput('newoutdestparam', $allUsers, __('Login'), '', false);
             break;
         case 'sale':
             $result .= wf_HiddenInput('newoutdestparam', 'true');
             break;
         case 'cancellation':
             $result .= wf_HiddenInput('newoutdestparam', 'true');
             break;
         case 'mistake':
             $result .= wf_HiddenInput('newoutdestparam', 'true');
             break;
         default:
             $result = __('Strange exeption');
             break;
     }
     return $result;
 }