Exemplo n.º 1
0
     if (wf_CheckPost(array('modifystartdate', 'modifytaskaddress', 'modifytaskphone'))) {
         if (zb_checkDate($_POST['modifystartdate'])) {
             $taskid = $_POST['modifytask'];
             ts_ModifyTask($taskid, $_POST['modifystartdate'], $_POST['modifystarttime'], $_POST['modifytaskaddress'], @$_POST['modifytasklogin'], $_POST['modifytaskphone'], $_POST['modifytaskjobtype'], $_POST['modifytaskemployee'], $_POST['modifytaskjobnote']);
             rcms_redirect("?module=taskman&edittask=" . $taskid);
         } else {
             show_error(__('Wrong date format'));
         }
     } else {
         show_error(__('All fields marked with an asterisk are mandatory'));
     }
 }
 //if marking task as done
 if (isset($_POST['changetask'])) {
     if (wf_CheckPost(array('editenddate', 'editemployeedone'))) {
         if (zb_checkDate($_POST['editenddate'])) {
             //editing task sub
             $editid = vf($_POST['changetask']);
             simple_update_field('taskman', 'enddate', $_POST['editenddate'], "WHERE `id`='" . $editid . "'");
             simple_update_field('taskman', 'employeedone', $_POST['editemployeedone'], "WHERE `id`='" . $editid . "'");
             simple_update_field('taskman', 'donenote', $_POST['editdonenote'], "WHERE `id`='" . $editid . "'");
             simple_update_field('taskman', 'status', '1', "WHERE `id`='" . $editid . "'");
             //flushing darkvoid after changing task
             $darkVoid = new DarkVoid();
             $darkVoid->flushCache();
             log_register('TASKMAN DONE [' . $editid . ']');
             //generate job for some user
             if (wf_CheckPost(array('generatejob', 'generatelogin', 'generatejobid'))) {
                 stg_add_new_job($_POST['generatelogin'], curdatetime(), $_POST['editemployeedone'], $_POST['generatejobid'], 'TASKID:[' . $_POST['changetask'] . ']');
                 log_register("TASKMAN GENJOB (" . $_POST['generatelogin'] . ') VIA [' . $_POST['changetask'] . ']');
             }
Exemplo n.º 2
0
 /**
  * 
  * @return void/error notice
  */
 public function catchCreateRequest()
 {
     $result = '';
     if (wf_CheckPost(array('newschedlogin', 'newschedaction', 'newscheddate'))) {
         $date = $_POST['newscheddate'];
         $action = $_POST['newschedaction'];
         $param = $_POST['newschedparam'];
         $note = $_POST['newschednote'];
         $login = $_POST['newschedlogin'];
         if (zb_checkDate($date)) {
             switch ($action) {
                 //this action types requires non empty parameter
                 case 'addcash':
                     if ($param) {
                         if (zb_checkMoney($param)) {
                             $this->createTask($date, $login, $action, $param, $note);
                         } else {
                             $result = __('Wrong format of a sum of money to pay');
                         }
                     } else {
                         $result = __('No all of required fields is filled');
                     }
                     break;
                 case 'corrcash':
                     if ($param) {
                         if (zb_checkMoney($param)) {
                             $this->createTask($date, $login, $action, $param, $note);
                         } else {
                             $result = __('Wrong format of a sum of money to pay');
                         }
                     } else {
                         $result = __('No all of required fields is filled');
                     }
                     break;
                 case 'setcash':
                     if ($param) {
                         if (zb_checkMoney($param)) {
                             $this->createTask($date, $login, $action, $param, $note);
                         } else {
                             $result = __('Wrong format of a sum of money to pay');
                         }
                     } else {
                         $result = __('No all of required fields is filled');
                     }
                     break;
                 case 'credit':
                     if ($param >= 0) {
                         if (zb_checkMoney($param)) {
                             $this->createTask($date, $login, $action, $param, $note);
                         } else {
                             $result = __('Wrong format of a sum of money to pay');
                         }
                     } else {
                         $result = __('No all of required fields is filled');
                     }
                     break;
                 case 'creditexpire':
                     if ($param) {
                         if (zb_checkDate($param)) {
                             $this->createTask($date, $login, $action, $param, $note);
                         } else {
                             $result = __('Wrong date format');
                         }
                     } else {
                         $result = __('No all of required fields is filled');
                     }
                     break;
                 case 'tariffchange':
                     if ($param) {
                         $this->createTask($date, $login, $action, $param, $note);
                     } else {
                         $result = __('No all of required fields is filled');
                     }
                     break;
                 case 'tagadd':
                     if ($param) {
                         $this->createTask($date, $login, $action, $param, $note);
                     } else {
                         $result = __('No all of required fields is filled');
                     }
                     break;
                 case 'tagdel':
                     if ($param) {
                         $this->createTask($date, $login, $action, $param, $note);
                     } else {
                         $result = __('No all of required fields is filled');
                     }
                     break;
                     //for this task types parameter may be empty
                 //for this task types parameter may be empty
                 case 'freeze':
                     $this->createTask($date, $login, $action, $param, $note);
                     break;
                 case 'unfreeze':
                     $this->createTask($date, $login, $action, $param, $note);
                     break;
                 case 'reset':
                     $this->createTask($date, $login, $action, $param, $note);
                     break;
                 case 'setspeed':
                     $this->createTask($date, $login, $action, $param, $note);
                     break;
                 case 'down':
                     $this->createTask($date, $login, $action, $param, $note);
                     break;
                 case 'undown':
                     $this->createTask($date, $login, $action, $param, $note);
                     break;
                 case 'ao':
                     $this->createTask($date, $login, $action, $param, $note);
                     break;
                 case 'unao':
                     $this->createTask($date, $login, $action, $param, $note);
                     break;
             }
         } else {
             $result = __('Wrong date format');
         }
     } else {
         $result = __('Something went wrong');
     }
     return $result;
 }