Exemple #1
0
function get_task($id)
{
    $target = array();
    $tasks = get_tasks();
    foreach ($tasks as $task) {
        if ($task['i'] == $id) {
            $target = $task;
        }
    }
    return $target;
}
Exemple #2
0
 if (isset($_GET['p'])) {
     $uri = $_GET['p'];
 } else {
     $uri = '/';
 }
 if ($uri === '/') {
     echo json_encode(array('result' => array()));
 } else {
     if (strpos($uri, '/services') !== false) {
         echo get_services($_GET);
     } else {
         if (strpos($uri, '/change_service') !== false) {
             echo edit_service($_POST);
         } else {
             if (strpos($uri, '/tasks') !== false) {
                 echo get_tasks($_GET);
             } else {
                 if (strpos($uri, '/change_tasks') !== false) {
                     echo edit_task($_POST);
                 } else {
                     if (strpos($uri, '/discussions') !== false) {
                         echo get_discussions($_GET);
                     } else {
                         if (strpos($uri, '/projects') !== false) {
                             echo get_projects($_GET);
                         } else {
                             if (strpos($uri, '/companies') !== false) {
                                 echo get_company($_GET);
                             } else {
                                 if (strpos($uri, '/company_reviews') !== false) {
                                     echo get_company_review($_GET);
Exemple #3
0
echo base_url();
?>
public/js/jquery.jSlider.js" type="text/javascript"></script>
</head>
<body>
	<div class="crmpage">
		<?php 
echo $this->load->view('common/logoheader', null, true);
?>
		<?php 
echo get_menu();
?>
	
		<div class="container">
			<div class="column span-5" id="tasks">
				<?php 
echo get_tasks_js() . get_tasks();
?>
			</div>
			<div class="column span-19 last" style="width: 80%;">
				<?php 
echo get_rss();
?>
			</div>
		</div>		
		<?php 
echo $this->load->view('common/footer', null, true);
?>
	</div>
</body>
</html>
Exemple #4
0
function display_tasks()
{
    global $tasks_header, $tasks_footer;
    echo $tasks_header;
    $start = 0;
    $count = 10;
    $start_s = 0;
    $count_s = 10;
    if (isset($_GET["st"]) && isset($_GET["nb"])) {
        $start = $_GET["st"];
        $count = $_GET["nb"];
        $start_s = intval($_GET["st"]);
        $count_s = intval($_GET["nb"]);
    }
    $task_count = get_tasks_count();
    $nb_pages = $task_count / $count_s;
    $req = get_tasks($start, $count);
    // security checks done in db.php :]
    echo '
	    <div class="container100">
		<table class="std">
	        <tr><th class="std">#</th><th class="std">MD5</th><th class="std">ANALYSES :: SCORE</th><th class="std">SOURCES</th><th class="std">VIEW TASK</th></tr>';
    while ($res = $req->fetchArray()) {
        $alerts_msg = "";
        $alerts = get_task_alerts($res["task_id"]);
        while ($alert = $alerts->fetchArray()) {
            $criticity = 'green';
            if ($alert['criticity'] == 2) {
                $criticity = 'orange';
            } elseif ($alert['criticity'] == 1) {
                $criticity = 'red';
            }
            $alerts_msg .= '<br /><span style="color:' . $criticity . '">' . secure_display($alert['label']) . ': ' . secure_display($alert['description']) . '</span>';
        }
        $submitions = get_task_submitions($res["task_id"]);
        $counts = array();
        $signs = array();
        while ($sub = $submitions->fetchArray()) {
            $source_info = get_source_info($sub["source_type"], $sub["source_id"], TRUE);
            if (in_array($source_info, $signs)) {
                $counts[array_search($source_info, $signs)]++;
            } else {
                $counts[] = 1;
                $signs[] = $source_info;
            }
        }
        $source_data = '';
        for ($i = 0; $i < count($counts); $i++) {
            if ($signs[$i] != 'MANUAL' && $counts[$i] != 1) {
                $counts[$i]--;
            }
            $source_data .= $signs[$i] . ' (' . $counts[$i] . ')<br />';
        }
        echo '
	        <tr onclick="document.location.href=\'' . $_SERVER['PHP_SELF'] . '?display_task=' . $res["task_id"] . '\'"><td>' . $res['task_id'] . '</td><td>' . $res['md5'] . $alerts_msg . '</td><td>';
        display_task_analyses_short($res["task_id"]);
        echo '</td><td>' . $source_data . '</td><td><a href="' . $_SERVER['PHP_SELF'] . '?display_task=' . $res["task_id"] . '" style="color:blue;">display info</a></td></tr>';
    }
    echo '
                </table>
                <a href="' . $_SERVER['PHP_SELF'] . '?display_tasks&st=' . ($start_s - $count_s) . '&nb=' . $count_s . '">&lt;--</a>&nbsp;
                <a href="' . $_SERVER['PHP_SELF'] . '?display_tasks&st=' . ($start_s + $count_s) . '&nb=' . $count_s . '">&gt;--</a>
                <br />
                <form action="' . $_SERVER['PHP_SELF'] . '" method="GET">
                        <input type="hidden" name="display_tasks" />
                        PAGE <select name="st" />';
    for ($i = 0; $i < $nb_pages; $i++) {
        $sel = '';
        if ($i * $count_s == $start_s) {
            $sel = " selected ";
        }
        echo '<option value="' . $i * $count_s . '"' . $sel . '>' . ($i + 1) . '</option>';
    }
    echo '</select><input type="submit" value="OK" />
                        Display <select name="nb">';
    if ($count_s != 10) {
        echo '
                                <option value="' . $count_s . '">' . $count_s . '</option>';
    }
    echo '
                                <option value="10">10</option>
                                <option value="20">20</option>
                                <option value="50">50</option>
                                <option value="100">100</option>
                        </select> results.
                </form>
         </div>';
    echo $tasks_footer;
}
Exemple #5
0
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
*/
echo <<<H
<html>
<head>
<meta charset="utf-8">
<style>
li { margin-bottom: 0.9em; }
.dt { display: block; color: #555; font-size: 80%; }
</style>
</head>
<body>
H;
$app_path = realpath(dirname(__FILE__) . '/..');
require $app_path . '/conf/conf.php';
require $app_path . '/lib/lib.php';
try {
    echo html_render_tasks(get_tasks($dsn));
} catch (Exception $e) {
    error_log($e->getMessage());
    die;
}
function print_day_at_a_glance($date, $user, $can_add = 0)
{
    global $CELLBG, $DISPLAY_TASKS_IN_GRID, $DISPLAY_UNAPPROVED, $first_slot, $hour_arr, $last_slot, $rowspan, $rowspan_arr, $TABLEBG, $THBG, $THFG, $TIME_SLOTS, $today, $TODAYCELLBG, $WORK_DAY_END_HOUR, $WORK_DAY_START_HOUR;
    if (empty($TIME_SLOTS)) {
        return translate('Error TIME_SLOTS undefined!') . "<br />\n";
    }
    $get_unapproved = $DISPLAY_UNAPPROVED == 'Y';
    // Get, combine and sort the events for this date.
    $ev = combine_and_sort_events(get_entries($date, $get_unapproved), get_repeating_entries($user, $date));
    if ($date >= date('Ymd') && (empty($DISPLAY_TASKS_IN_GRID) || $DISPLAY_TASKS_IN_GRID == 'Y')) {
        $ev = combine_and_sort_events($ev, get_tasks($date, $get_unapproved));
    }
    $hour_arr = $rowspan_arr = array();
    $interval = 1440 / $TIME_SLOTS;
    // Number of minutes per slot
    $first_slot = intval($WORK_DAY_START_HOUR * 60 / $interval);
    $last_slot = intval($WORK_DAY_END_HOUR * 60 / $interval);
    for ($i = 0, $cnt = count($ev); $i < $cnt; $i++) {
        if ($get_unapproved || $ev[$i]->getStatus() == 'A') {
            html_for_event_day_at_a_glance($ev[$i], $date);
        }
    }
    $last_row = -1;
    $ret = '';
    $rowspan = 0;
    // Squish events that use the same cell into the same cell.
    // For example, an event from 8:00-9:15 and another from 9:30-9:45 both
    // want to show up in the 8:00-9:59 cell.
    for ($i = $first_slot < 0 ? $first_slot : 0; $i < $TIME_SLOTS; $i++) {
        if ($rowspan > 1) {
            if (!empty($hour_arr[$i])) {
                $diff_start_time = $i - $last_row;
                if (!empty($rowspan_arr[$i])) {
                    if ($rowspan_arr[$i] > 1 && $rowspan_arr[$i] + $diff_start_time > $rowspan_arr[$last_row]) {
                        $rowspan_arr[$last_row] = $rowspan_arr[$i] + $diff_start_time;
                    }
                    $rowspan += $rowspan_arr[$i] - 1;
                } else {
                    $rowspan_arr[$last_row] += $rowspan_arr[$i];
                }
                // This will move entries apart that appear in one field,
                // yet start on different hours.
                for ($u = $diff_start_time; $u > 0; $u--) {
                    $hour_arr[$last_row] .= "<br />\n";
                }
                $hour_arr[$last_row] .= $hour_arr[$i];
                $hour_arr[$i] = '';
                $rowspan_arr[$i] = 0;
            }
            $rowspan--;
        } else {
            if (!empty($rowspan_arr[$i]) && $rowspan_arr[$i] > 1) {
                $last_row = $i;
                $rowspan = $rowspan_arr[$i];
            }
        }
    }
    $ret .= '
    <table class="main glance" cellspacing="0" cellpadding="0">' . (empty($hour_arr[9999]) ? '' : '
      <tr>
        <th class="empty">&nbsp;</th>
        <td class="hasevents">' . $hour_arr[9999] . '</td>
      </tr>');
    $rowspan = 0;
    for ($i = $first_slot; $i <= $last_slot; $i++) {
        $time_h = intval($i * $interval / 60);
        $time_m = $i * $interval % 60;
        $addIcon = $can_add ? html_for_add_icon($date, $time_h, $time_m, $user) : '';
        $ret .= '
      <tr>
        <th class="row">' . display_time(($time_h * 100 + $time_m) * 100) . '</th>';
        if ($rowspan > 1) {
            // This might mean there's an overlap, or it could mean one event
            // ends at 11:15 and another starts at 11:30.
            if (!empty($hour_arr[$i])) {
                $ret .= '
        <td class="hasevents">' . $addIcon . $hour_arr[$i] . '</td>';
            }
            $rowspan--;
        } else {
            $ret .= '
        <td ';
            if (empty($hour_arr[$i])) {
                $ret .= ($date == date('Ymd', $today) ? ' class="today"' : '') . '>' . ($can_add ? $addIcon : '&nbsp;');
            } else {
                $rowspan = empty($rowspan_arr[$i]) ? '' : $rowspan_arr[$i];
                $ret .= ($rowspan > 1 ? 'rowspan="' . $rowspan . '"' : '') . 'class="hasevents">' . $addIcon . $hour_arr[$i];
            }
            $ret .= '</td>';
        }
        $ret .= '
      </tr>';
    }
    return $ret . '
    </table>';
}
Exemple #7
0
<?php

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 {
Exemple #8
0
<?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">
Exemple #9
0
 $weekdays[$i] = weekday_name(($i + $WEEK_START) % 7, $DISPLAY_LONG_DAYS);
 $dateYmd = date('Ymd', $days[$i]);
 $header[$i] = $weekdays[$i] . '<br />' . date_to_str($dateYmd, $DATE_FORMAT_MD, false, true);
 // .
 // Generate header row.
 $class = $dateYmd == date('Ymd', $today) ? ' class="today"' : (is_weekend($days[$i]) ? ' class="weekend"' : '');
 $headerStr .= '
           <th ' . $class . '>' . ($can_add ? html_for_add_icon($dateYmd, '', '', $user) : '') . '<p style="margin:.75em 0 0 0"><a href="day.php?' . $u_url . 'date=' . $dateYmd . $caturl . '">' . $header[$i] . '</a></p></th>';
 $date = date('Ymd', $days[$i]);
 $hour_arr = $rowspan_arr = $tk = array();
 // .
 // Get, combine and sort, static and repeating events for this date.
 $ev = combine_and_sort_events(get_entries($date, $get_unapproved), get_repeating_entries($user, $date));
 // .
 // Then sort in any tasks due for this day and before.
 $ev = combine_and_sort_events($ev, $date >= date('Ymd') ? get_tasks($date, $get_unapproved) : $tk);
 for ($j = 0, $cnt = count($ev); $j < $cnt; $j++) {
     if ($get_unapproved || $ev[$j]->getStatus() == 'A') {
         html_for_event_week_at_a_glance($ev[$j], $date);
     }
 }
 // .
 // Squish events that use the same cell into the same cell.
 // For example, an event from 8:00-9:15 and another from 9:30-9:45
 // both want to show up in the 8:00-9:59 cell.
 $last_row = -1;
 $rowspan = 0;
 for ($j = 0; $j < $TIME_SLOTS; $j++) {
     if ($rowspan > 1) {
         if (!empty($hour_arr[$j])) {
             $diff_start_time = $j - $last_row;
}
?>

<div class="vcalendar">
<?php 
echo "<dl>\n";
echo "<!-- \nstartTime: {$startDate}\nendTime: {$endDate}\nstartDate: " . "{$date}\nnumDays: {$numDays}\nuser: {$username}\nevents: " . count($events) . "\nrepeated_events: " . count($repeated_events) . " -->\n";
$eventinfo = '';
$numEvents = 0;
$endDateYmd = date('Ymd', $endDate);
for ($i = $startDate; date('Ymd', $i) <= $endDateYmd && $numEvents < $maxEvents; $i += ONE_DAY) {
    $d = date('Ymd', $i);
    $entries = get_entries($d, $get_unapproved);
    $rentries = get_repeating_entries($username, $d, $get_unapproved);
    $ev = combine_and_sort_events($entries, $rentries);
    $tentries = get_tasks($d, $get_unapproved);
    $ev = combine_and_sort_events($ev, $tentries);
    $ev_cnt = count($ev);
    echo "<!-- {$d} " . count($ev) . " -->\n";
    if ($ev_cnt > 0) {
        echo "<!-- XXX -->\n";
        //print "<dt>" . date_to_str ( $d,  translate ( '__month__ __dd__' ), true, true ) . "</dt>\n<dd>";
        echo '<dt>' . date_to_str($d) . "</dt>\n<dd>";
        for ($j = 0; $j < $ev_cnt && $numEvents < $maxEvents; $j++) {
            print_upcoming_event($ev[$j], $d);
            $numEvents++;
        }
        echo "</dd>\n";
    }
}
echo "</dl>\n";
Exemple #11
0
        <span></span>
        </div>

        <div id="infoMessage"  class="alert alert-info hide">
          <button class="close" data-dismiss="alert" type="button">×</button>
        <strong></strong>
        <span></span>
        </div>
   
        
        
         
    
      <div class="row show-grid">
        <?php 
    $tasks = get_tasks($filter);
    foreach ($tasks as $task) {
        ?>
        <div class="span12 todo-list-item">
          
          <?php 
        switch ($task['s']) {
            case '0':
                echo '<span onclick="changeTaskState(\'' . $task['i'] . '\',1,this);" class="label label-important label-todo pointer"><i class="icon-remove icon-white"></i> <span>A faire </span></span>';
                break;
            case '1':
                echo '<span onclick="changeTaskState(\'' . $task['i'] . '\',2,this);" class="label label-info label-todo pointer"><i class="icon-time icon-white"></i> <span>En cours </span></span>';
                break;
            case '2':
                echo '<span onclick="changeTaskState(\'' . $task['i'] . '\',0,this);" class="label label-success label-todo pointer"><i class="icon-ok icon-white"></i> <span>Fait </span></span>';
                break;
Exemple #12
0
 protected function getlist()
 {
     $this->session->set_userdata('tasks_page', element('p', $this->a_uri_assoc, null));
     return get_tasks();
 }
Exemple #13
0
:</td><td><?php 
echo get_online();
?>
</td></tr>
            	<tr><td><img align="top" style="margin-top:0px;margin-right:5px;margin-left:5px;" src="images/icons/offline.png"><?php 
echo $lang[$l][62];
?>
:</td><td><?php 
echo get_offline();
?>
</td></tr>
			<tr><td><img align="top" style="margin-top:0px;margin-right:5px;margin-left:5px;" src="images/icons/tasks.png"><?php 
echo $lang[$l][40];
?>
:</td><td><?php 
echo get_tasks();
?>
</td></tr>
			<tr><td><img align="top" style="margin-top:0px;margin-right:5px;margin-left:5px;" src="images/icons/downloads.png"><?php 
echo $lang[$l][41];
?>
:</td><td><?php 
echo get_loaded();
?>
</td></tr>
			</table>
		</td>
		<td style="background:#fff;" align="center">
			<?php 
echo get_chart_data();
?>
 // An event will be included one time for each participant.
 $ev = get_entries($date);
 // Keep track of duplicates.
 $completed_ids = array();
 $evcnt = count($ev);
 for ($i = 0; $i < $evcnt; $i++) {
     $id = $ev[$i]->getID();
     if (!empty($completed_ids[$id])) {
         continue;
     }
     $completed_ids[$id] = 1;
     process_event($id, $ev[$i]->getName(), $ev[$i]->getDateTimeTS(), $ev[$i]->getEndDateTimeTS());
 }
 // Get tasks for this date.
 // A task will be included one time for each participant.
 $tks = get_tasks($date);
 // Keep track of duplicates.
 $completed_ids = array();
 $tkscnt = count($tks);
 for ($i = 0; $i < $tkscnt; $i++) {
     $id = $tks[$i]->getID();
     if (!empty($completed_ids[$id])) {
         continue;
     }
     $completed_ids[$id] = 1;
     $is_task = true;
     process_event($id, $tks[$i]->getName(), $tks[$i]->getDateTimeTS(), $tks[$i]->getDueDateTimeTS(), $dateTS);
 }
 $is_task = false;
 // Get repeating events...tasks are not included at this time.
 if ($debug) {