コード例 #1
0
ファイル: function.php プロジェクト: Kristuff/twidoo
function update_task($task)
{
    delete_task($task['i']);
    add_task($task);
}
<?php

if (isset($_REQUEST['cmd'])) {
    $cmd = $_REQUEST['cmd'];
    switch ($cmd) {
        case 1:
            task_preview();
            break;
        case 2:
            delete_task();
            break;
        case 3:
            add_task();
            break;
        case 4:
            update_task();
            break;
        case 5:
            display_tasks();
            break;
        case 6:
            search_task();
            break;
        case 7:
            user_login();
            break;
        case 8:
            delete_tasks();
            break;
        case 9:
            select_collaborator();
コード例 #3
0
<?php

session_start();
require_once '../file-includes.php';
$postdata = file_get_contents("php://input");
$request = json_decode($postdata);
$info = array();
$info[] = fix_string($request->task);
$info[] = fix_string($request->importance);
$info[] = (string) date('d-m-Y');
$info[] = '-';
$userID = get_userID_session();
add_task($info, $userID);
コード例 #4
0
function change_activity($Ticket_Number, $activity)
{
    $last_activity = Ticket::get_ticket_activity_id($Ticket_Number);
    if ($last_activity != $activity) {
        $last_activity = Ticket::get_activity_name($last_activity);
        $new_activity = Ticket::get_activity_name($activity);
        $result = Ticket::change_activity_id($Ticket_Number, $activity);
        $sender = whoami();
        $comment = "activity changed from \\'{$last_activity}\\' to \\'{$new_activity}\\'";
        add_task($Ticket_Number, $comment);
        notify_change($Ticket_Number, $comment);
    }
}
コード例 #5
0
ファイル: action.php プロジェクト: Kristuff/twidoo
//Execution du code en fonction de l'action
switch ($_['action']) {
    case 'addTask':
        if ($myUser != false) {
            $date = explode('/', $_['d']);
            if (count($date) != 3 or empty($date[0]) or empty($date[1]) or empty($date[2])) {
                $return['error'] = 'Le format de date n\'est pas valide.';
            } else {
                if (!checkdate($date[1], $date[0], $date[2])) {
                    $return['error'] = 'Le format de date n\'est pas valide.';
                } else {
                    $task['i'] = time() . rand(0, 200);
                    $task['n'] = stripslashes(html_entity_decode($_['n']));
                    $task['d'] = $_['d'];
                    $task['s'] = 0;
                    add_task($task);
                    $return['info'] = 'T&acirc;che correctement ajout&eacute;e.';
                }
            }
        } else {
            $return['error'] = 'Vous devez &eacute;tre connect&eacute; pour effectuer cette action';
        }
        break;
    case 'updateTask':
        if ($myUser != false) {
            $task = array('i' => $_['i'], 'n' => $_['n'], 'd' => $_['d'], 's' => $_['s']);
            update_task($task);
            $return['info'] = 'T&acirc;che correctement modifi&eacute;e.';
        } else {
            $return['error'] = 'Vous devez &eacute;tre connect&eacute; pour effectuer cette action';
        }
コード例 #6
0
ファイル: default_task_add.php プロジェクト: huaminglee/Code
if ($wbs_id == "2") {
    $wbs = $task_id . ">" . $wbs_id;
} else {
    $wbs = $row_Recordset_task['csa_remark5'] . ">" . $row_Recordset_task['TID'] . ">" . $wbs_id;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
    $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if (isset($_POST["MM_insert"]) && $_POST["MM_insert"] == "form1") {
    if ($_POST['user_cc'] == null) {
        $cc_post = $_POST['user_cc'];
    } else {
        $cc_post = "[" . implode(",", $_POST['user_cc']) . "]";
    }
    $newID = add_task($cc_post, $_POST['csa_from_user'], $to_user_arr['0'], $project_id, $_POST['csa_type'], $_POST['csa_text'], $_POST['csa_priority'], $_POST['csa_temp'], $_POST['plan_start'], $_POST['plan_end'], $_POST['plan_hour'], $_POST['csa_remark2'], $_POST['csa_create_user'], $_POST['csa_last_user'], $task_id, $wbs, $wbs_id, $_SESSION['MM_uid'], $csa_tag, $csa_remark1);
    $last_use_arr = pushlastuse($to_user_arr["0"], $to_user_arr["1"], $myid);
    if ($project_url == 1) {
        $insertGoTo = "project_view.php?recordID={$project_id}";
    } else {
        if ($user_url == 1) {
            $insertGoTo = "user_view.php?recordID={$user_id}";
        } else {
            $insertGoTo = "default_task_edit.php?editID={$newID}";
        }
    }
    if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= strpos($insertGoTo, '?') ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
    }
    $msg_to = $to_user_arr['0'];
コード例 #7
0
ファイル: install.php プロジェクト: sany217/WeiXin
    $func_id = $ROW[0];
    $func_id += 1;
    $sql_office = "INSERT INTO SYS_FUNCTION (FUNC_ID,MENU_ID,FUNC_NAME,FUNC_CODE) VALUES ('{$func_id}','{$mn['mid']}','{$mn['name']}','{$mn['code']}');";
    exequery(TD::conn(), $sql_office);
    $query = "select FUNC_ID_STR from user_priv where USER_PRIV = '1'";
    $cursor = exequery(TD::conn(), $query);
    if (($ROW = mysql_fetch_array($cursor)) && !find_id($ROW['FUNC_ID_STR'], $func_id)) {
        $update = "update user_priv set FUNC_ID_STR = '" . $ROW['FUNC_ID_STR'] . "{$func_id},' where USER_PRIV = '1'";
        exequery(TD::conn(), $update);
    }
    cache_menu();
}
//Add instant message offline push task
$taskcode = "inst_msg_offl_push";
$taskfile = dirname($_SERVER['PHP_SELF']) . "/task/instant_msg_offline_push.php";
add_task($taskfile, $taskcode);
$UPDATE_TIPS = "<div class=\"update_tips\">" . _("安装 微信企业号功能包 成功!") . "</div>";
echo $UPDATE_TIPS;
ob_end_clean();
////////////////////////////////////////////
function add_task($file, $code)
{
    $qry = "SELECT * FROM office_task WHERE TASK_CODE='{$code}'";
    $csr = exequery(TD::conn(), $qry);
    if ($row = mysql_fetch_array($csr)) {
    } else {
        $qry = "INSERT INTO `office_task` (`TASK_TYPE`, `INTERVAL`, `EXEC_TIME`, `LAST_EXEC`,\n\t\t\t\t`EXEC_FLAG`, `EXEC_MSG`, `TASK_URL`, `TASK_NAME`, `TASK_DESC`, `TASK_CODE`, `USE_FLAG`,\n\t\t\t\t`SYS_TASK`, `EXT_DATA`) VALUES(\n\t\t\t\t'0',\n\t\t\t\t1,\n\t\t\t\t'00:00:00',\n\t\t\t\t'0000-00-00 00:00:00',\n\t\t\t\t1,\n\t\t\t\t'0000-00-00 00:00:00',\n\t\t\t\t'{$file}',\n\t\t\t\t'即时通讯离线消息推送',\n\t\t\t\t'定时将OA精灵离线消息推送到微信企业号',\n\t\t\t\t'{$code}',\n\t\t\t\t'1',\n\t\t\t\t'0',\n\t\t\t\t'')";
        exequery(TD::conn(), $qry);
        //Add system parameter
        include_once "inc/utility_all.php";
        add_sys_para(array("WEIXINQY_MSGCHECK_TIME" => ""));
コード例 #8
0
    
    	<?php 
if (isset($_POST['new_task']) and is_log()) {
    $continue = true;
    $this->form_validation->set_rules('receiver_id', get_lang('Receiver'), 'required');
    $this->form_validation->set_rules('title', get_lang('Title'), 'required|min_length[3]|max_length[50]');
    $this->form_validation->set_rules('content', get_lang('Message'), 'required|min_length[3]|max_length[5000]');
    if ($this->form_validation->run() == FALSE) {
        alertbox('alert-danger', '', validation_errors());
    } else {
        $data['receiver_id'] = $this->input->post('receiver_id');
        $data['start_date'] = $this->input->post('start_date');
        $data['finish_date'] = $this->input->post('finish_date');
        $data['title'] = $this->input->post('title');
        $data['content'] = $plus_content . $this->input->post('content');
        $task_id = add_task($data);
        if ($task_id > 0) {
            add_log(array('date' => $_POST['log_time'], 'type' => 'task', 'title' => get_lang('New Task'), 'description' => get_lang('Posted a new task') . ' [' . $_POST['display_name'] . ']'));
            alertbox('alert-success', get_lang('The new task has been created.'));
        } else {
            alertbox('alert-danger', get_lang('Error!'));
        }
    }
}
if (isset($_GET['invoice_id'])) {
    $invoice = get_invoice($_GET['invoice_id']);
    $account = get_account(array('id' => $invoice['account_id']));
    $plus_content = '
			<div class="bs-callout bs-callout-danger">
      			<h4>' . get_lang('Invoice') . ': <a href="' . site_url('invoice/view/' . $invoice['id']) . '" target="_blank">#' . $invoice['id'] . '</a> / <small>' . $account['name'] . '</small></h4>
				<br />
コード例 #9
0
ファイル: agenda.php プロジェクト: IMR18/web
require "functions_agenda.php";
if (isset($_GET["action"])) {
    $action = $_GET["action"];
    $p = json_decode(file_get_contents("php://input"));
    $db = PDO();
    switch ($action) {
        case "getTasks":
            $group = isset($_GET["group"]) && !empty($_GET["group"]) ? $_GET["group"] : 0;
            $from = isset($_GET["from"]) && !empty($_GET["from"]) ? $_GET["from"] : 0;
            $res = get_tasks($db, $group, $from);
            break;
        case "addTask":
            if (!isset($p->title)) {
                $res = array('status' => false, 'msg' => "NO PARAMETERS");
            } else {
                $res = array('status' => add_task($db, issetor($p->title), issetor($p->description), issetor($p->deadline), issetor($p->worklevel), issetor($p->groupe), issetor($p->UID)), 'msg' => "{$p->title} est ajouté");
            }
            break;
        case "deleteTask":
            if (!isset($p->id)) {
                $res = array('status' => false, 'msg' => "NO PARAMETERS");
            } else {
                $res = array('status' => deleteTask($db, issetor($p->id)), 'msg' => "{$p->title} est supprimée");
            }
            break;
        case "editTask":
            if (!isset($p->id)) {
                $res = array('status' => false, 'msg' => "NO PARAMETERS");
            } else {
                $res = array('status' => editTask($db, issetor($p->title), issetor($p->description), issetor($p->deadline), issetor($p->worklevel), issetor($p->groupe), issetor($p->UID), $p->id), 'msg' => "{$p->title} est modifiée");
            }
コード例 #10
0
ファイル: task_add.php プロジェクト: chris1201/Hammer
    $time = time();
    // $argJson = base64_encode(json_encode($arguments));
    // $argJson = json_encode($arguments,JSON_FORCE_OBJECT);
    $argJson = json_encode($arguments);
    $argJson = mysql_real_escape_string($argJson);
    $userid = get_userid();
    var_dump($argJson);
    $query = "INSERT INTO Task(Target,Start_Time,Arguments,Status,User_ID) VALUES('{$target}',{$time},'{$argJson}','waiting',{$userid})";
    // echo $query . '<br>';
    $result = mysql_query($query);
    if ($result) {
        return True;
    } else {
        echo mysql_error();
        return False;
    }
}
// $method = check_sql(trim($_REQUEST['method']));
// $target = check_sql(trim($_REQUEST['target']));
// var_dump($_REQUEST);
$arguments = $_REQUEST['config'];
$arguments['plugins'] = json_decode($arguments['plugins'], true);
$target = check_sql(trim($arguments['global']['target']));
if (strlen($target) > 32) {
    $target = substr($target, 0, 32) . '...';
}
// var_dump($arguments);
if ($target and $target != '') {
    $ret = add_task($target, $arguments);
}
echo $ret;
コード例 #11
0
ファイル: index.php プロジェクト: petrofcikmatus/simple-todo
<?php

if (!is_logged_in()) {
    redirect("login");
}
if (is_post()) {
    if (add_task(get_user_id())) {
        redirect();
    }
}
$tasks = get_tasks(get_user_id());
include_header(array("title" => "your todo list", "show_logout" => true));
?>
    <div class="row">

        <div class="col-md-12">
            <form id="js-form-add" method="post">
                <div class="form-group">
                        <textarea class="form-control" name="text" id="js-text" rows="4"
                                  placeholder="is there something to do?"><?php 
echo isset($_POST["text"]) ? plain($_POST["text"]) : "";
?>
</textarea>
                </div>
                <div class="form-group js-hide">
                    <button class="btn btn-sm btn-danger" type="submit">add new task</button>
                </div>
            </form>
        </div>

        <div class="col-md-12">
コード例 #12
0
ファイル: ajax.php プロジェクト: petrofcikmatus/simple-todo
<?php

if (is_post() && is_ajax() && ($id = add_task(get_user_id()))) {
    $message = array('status' => 'success', 'id' => $id);
} else {
    $message = array('status' => 'error');
}
header('Content-Type: application/json');
echo json_encode($message);