/** * Login form */ public function mainAction() { $this->fc->user->addHelper('html_form'); $this->page->set('title', 'TaskFreak! ' . TR::get('security', 'login')); $this->page->add('css', array('form.css', 'freak.css', 'login.css')); $this->page->add('js', 'form.js'); $this->setView('login/login'); $this->view(); }
public function htmlRights() { if ($this->isEmpty('actags')) { return ''; } $arr = explode(',', $this->get('actags')); $arrTrans = array(); if (in_array('task_see_all', $arr)) { $arrTrans[] = TR::html('ui', 'task_manager'); } if (in_array('admin_user', $arr)) { $arrTrans[] = TR::html('ui', 'user_admin'); } return implode(', ', $arrTrans); }
/** * create timer */ public function mainReaction() { $date = VarDte::sanitize($_POST['date'], $err); $start = VarTim::sanitize($_POST['start_time'], $err); $stop = VarTim::sanitize($_POST['stop_time'], $err); $spent = VarDur::sanitize($_POST['spent'], $err); $this->data = new TimerModel(); $this->data->set('task_id', $_POST['id']); if ($start) { $this->data->set('start', $_POST['date'] . ' ' . $_POST['start_time']); } if ($stop) { $this->data->set('stop', $_POST['date'] . ' ' . $_POST['stop_time']); } if ($spent) { $this->data->set('spent', $_POST['spent']); } /* echo '<pre>'; print_r($_POST); echo "\n\n"; echo "date : $date\n"; echo "start : $start : ".$this->data->get('start')."\n"; echo "stop : $stop : ".$this->data->get('stop')."\n"; echo "spent: $spent\n"; echo '</pre>'; */ $this->data->setCheck(); if ($this->data->check()) { $this->data->connectDb(); $this->data->set('manual', 1); $this->data->insert(); } /* echo $this->data; exit; */ echo '<script type="text/javascript">'; echo "reloadList(); window.setTimeout('\$.fn.colorbox.close()',1000);"; echo '</script>'; echo '<p class="empty">' . TR::html('message', 'time_added') . '</p>'; return false; }
echo $this->fc->controller; ?> " /> <input type="hidden" name="a" value="<?php echo $this->fc->action; ?> " /> <?php } ?> <input type="text" name="search" value="<?php echo $this->search; ?> " tabindex="4" /> <button id="b_submit" type="submit" name="go" value="1"><?php TR::phtml('data', 'search'); ?> </button> <button id="b_clear" type="button" onclick="this.form.elements['search'].value='';this.form.submit()">x</button> </p> </form> </div> <div id="dlist" class="tasks"> <?php if ($this->expand) { $this->incView('include/list-expand'); } else { $this->incView('include/list-compact'); } ?> </div>
<small id="dv_priority">...</small> </li> <li class="arrow"> <small id="dv_spent">...</small> <a href="#details-spent">Time spent</a> </li> </ul> <p> <input id="dv_id" type="hidden" name="id" value="" /> <input id="dv_action" type="hidden" name="action" value="" /> <span id="dv_stop" class="hide"><a href="#" class="react darkButton"><?php TR::phtml('button', 'stop'); ?> </a></span> <span id="dv_start" class="hide"><a href="#" class="react lightButton"><?php TR::phtml('button', 'start'); ?> </a></span> </p> <?php $this->incView('iphone/inc_foot'); ?> </form> <div id="details-spent"> <div class="toolbar"> <h1>Task timesheet</h1> <a href="#" class="back">Back</a> <!-- a href="" class="button slideup">+</a --> </div> <ul class="rounded"> </ul>
" value="" /></li> <li><textarea id="i_note" type="text" name="note" placeholder="<?php TR::phtml('task', 'note'); ?> "></textarea></li> </ul> <ul class="edit rounded"> <li><input id="i_deadline" type="number" name="deadline" placeholder="<?php TR::phtml('form', 'deadline'); ?> " value="" /></li> <li><?php echo $this->edit->iSelectTranslate('priority', 'priority'); ?> </li> <li><?php echo $this->edit->iSelectTranslate('status', 'task'); ?> </li> </ul> <p> <input type="hidden" id="i_id" name="id" value="" /> <a href="#" class="save lightButton"><?php TR::phtml('button', 'save'); ?> </a> </p> <?php $this->incView('iphone/inc_foot'); ?> </form>
<span id="dtimer"><?php echo $this->current->getRealSpent(); ?> </span> <?php echo $this->current->html('title'); ?> </p> <?php } else { ?> <div id="timerstatus"> <button type="submit" id="b_save" name="save" value="1" tabindex="2"><?php TR::phtml('button', 'save'); ?> </button> <button type="submit" id="b_start" name="start" value="1" tabindex="3"><?php TR::phtml('button', 'save_and_start'); ?> </button> </div> <p> <input type="text" name="title" value="" tabindex="1" /> </p> <?php } if (isset($this->jsCode)) { echo '<script type="text/javascript">'; echo $this->jsCode; echo '</script>'; }
// time spent echo '<td>'; echo '<a href="' . $this->fc->getUrl('timer', 'delete', $params) . '" class="onhold ajax confirm" rel="tab2">' . TR::html('button', 'delete') . '</a>'; echo $this->data->getTimeSpent(); echo '</td>'; echo '</tr>'; } while ($this->data->next()); ?> </tbody> <tfoot> <tr> <td colspan="2"><?php TR::phtml('ui', 'total'); ?> </td> <td><?php echo TaskSummary::htmlTime($total); ?> </td> </tr> </tfoot> </table> <?php } else { echo '<p class="empty">' . TR::html('ui', 'history_empty') . '</p>'; } ?> <p class="empty"><a href="#tab3" onclick="tabber.show(3); return false;"><?php TR::phtml('ui', 'report_spent'); ?> </a></p>
?> ')"><?php TR::phtml('button', 'done'); ?> </a></span> </p> <?php } else { // task is paused (requested from ajax only) ?> <p class="dual"> <span><a id="b_resume" href="#resume" class="lightButton action"><?php TR::phtml('button', 'resume'); ?> </a></span> <span><a id="b_stop" href="#stop" class="darkButton action"><?php TR::phtml('button', 'stop'); ?> </a></span> </p> <?php } ?> <script type="text/javascript"> jQuery(function () { $(".action").tap(function (e) { return app.taskAction(this); }); }); </script> </form>
protected function _addJsSettings() { $js = "var RELOAD_URI='" . APP_WWW_URI . "task/main/ajax/1'; var URLMODREWRITE=true; "; if (!APP_URL_REWRITE) { $js = "var RELOAD_URI='" . APP_WWW_URI . "?c=task&a=main&ajax=1'; var URLMODREWRITE=false; "; } // translations $js .= "var LANGRUNNING='" . TR::html('task', 'running') . "'; "; $js .= "var LANGCONFIRM='" . TR::html('data', 'delete_confirm') . "'; "; $this->page->add('jsCode', $js); }
<?php $this->incView('include/page-top', false); ?> <div id="sidepanel"> <?php $this->fc->loadLangFile('help_multi_creation.php'); ?> </div> <?php $hh = new HtmlFormHelper(); echo $hh->iForm('task_batch', 'post', $this->fc->thisUrl()); echo '<p>' . $hh->iTextArea('data') . '</p>'; echo '<p><button type="submit" name="save" value="1" class="save">' . TR::html('button', 'create') . '</button></p>'; echo '</form>'; $this->incView('include/page-bot', false);
public static function htmlTime($spent, $stopped = true) { if (empty($spent)) { if ($stopped) { return '--:--'; } else { return TR::html('task', 'running'); } } $h = floor($spent / 60); $m = $spent - $h * 60; return str_pad($h, 2, '0', STR_PAD_LEFT) . ':' . str_pad($m, 2, '0', STR_PAD_LEFT); }
</ul> </li> <?php } ?> <li class="buttons"> <button type="submit" name="save" value="1" class="save"><?php TR::phtml('button', 'save'); ?> </button> <?php if ($this->canDeleteThisUser) { ?> <a href="<?php echo $this->fc->getUrl('admin', 'delete', array('id' => $this->data->getUid())); ?> " onclick="return confirm('<?php TR::phtml('data', 'delete_confirm'); ?> ');" class="button marge delete"><?php TR::phtml('button', 'delete'); ?> </a> <?php } ?> </li> </ol> <?php $this->incView('include/page-bot', false);
<?php $this->incView('include/page-top', false); ?> <h1><?php TR::phtml('ui', 'select_user'); ?> </h1> <ul> <?php while ($this->data->next()) { echo '<li>'; if ($this->data->getUid() == $this->switch_id) { echo $this->data->html('nickname'); } else { echo '<a href="' . $this->fc->getUrl('admin', 'switch', array('id' => $this->data->getUid())) . '">' . $this->data->html('nickname') . '</a>'; } echo '</li>'; } ?> </ul> <?php $this->incView('include/page-bot', false);
?> </tbody> <tfoot> <tr> <td colspan="3"> <a href="javascript:checkAll('f_tasks')"><?php TR::phtml('ui', 'select_all'); ?> </a> | <?php foreach ($this->actions as $key => $label) { echo ' <button type="submit" name="' . $key . '" ' . 'value="1">' . TR::html('button', $label) . '</button>'; } ?> </td> <td colspan="2"><?php TR::phtml('ui', 'total'); ?> </td> <td><?php echo TaskSummary::htmlTime($total); ?> </td> </tr> </tfoot> </table> </form> <?php } else { echo '<p class="empty">' . TR::html('error', 'search_empty') . '</p>'; }
<div id="dtop"> <h1><a href="<?php echo APP_WWW_URI; ?> ">TaskFreak</a></h1> <div id="duser"> <?php if (APP_SETUP_USER_MODEL && $this->fc->user->isLoggedIn()) { echo '<p><a href="javascript:showmenu()">' . $this->fc->user->html('nickname'); if ($this->fc->getSessionVariable('switch_id') != $this->fc->user->getUid()) { echo ' as ' . varStr::html($this->fc->getSessionVariable('switch_name')); } echo '<br /><small>' . TR::html('ui', 'user_menu') . '</small></a></p>'; echo '<ul id="dmenu">'; if ($this->fc->user->checkAcl('task_see_all')) { echo '<li><a href="' . $this->fc->getUrl('admin', 'switch') . '" class="ajax box">' . TR::html('ui', 'switch') . '</a></li>'; } echo '<li><a href="' . $this->fc->getUrl('admin', 'edit', array('id' => $this->fc->user->getUid())) . '" class="ajax box">' . TR::html('security', 'my_account') . '</a></li>'; if ($this->fc->user->checkAcl('admin_user')) { echo '<li><a href="' . $this->fc->getUrl('admin') . '">' . TR::html('ui', 'admin') . '</a></li>'; } echo '<li><a href="' . $this->fc->getUrl('login', 'out') . '">' . TR::html('security', 'logout') . '</a></li>'; echo '</ul>'; } else { echo 'TaskFreak!<br /><small>Time Tracking</small>'; } ?> </div> </div> <div id="dwork">
console.log('edit clicked'); return app.editAction(this); }); console.log('wiiiired'); }); </script> <?php $this->incView('iphone/inc_foot'); ?> </form> <div id="details-<?php echo $this->data->getUid(); ?> -spent"> <div class="toolbar"> <h1>Task timesheet</h1> <a href="#" class="back">Back</a> <a href="<?php echo $this->fc->getUrl('iphone', 'timer', array('id' => $this->data->getUid())); ?> " class="button slideup">+</a> </div> <?php if ($str) { echo $str; } else { echo '<ul class="rounded"><li>' . TR::html('ui', 'history_empty') . '</li></ul>'; } $this->incView('iphone/inc_foot'); ?> </div>
public function updateImage(Request $request) { $return['ok'] = 0; $id = $request->input('tagId'); $imageName = $request->input('name'); try { $tagService = new tagService(); $return['data'] = $tagService->updateImage($id, $imageName); $return['ok'] = 1; } catch (Exception $e) { // @codeCoverageIgnoreStart $return['error'] = TR::l('EDITOR/MESSAGE/ERROR/SHARE_BIN'); $return['errorMsg'] = $e->getMessage(); Binumi_Util::logErr($e->getMessage()); // @codeCoverageIgnoreEnd } return response()->json($return); }
<tr> <th><?php TR::phtml('form', 'status'); ?> </th> <td><?php echo $this->data->htmlStatus(); ?> </td> </tr> <?php if (!$this->data->isEmpty('note')) { ?> <tr> <th><?php TR::phtml('task', 'note'); ?> </th> <td><?php echo $this->data->html('note'); ?> </td> </tr> <?php } ?> </tbody> </table> </div> <div id="tab2" class="tab"> <?php
/** * change task status */ protected function _taskStatus() { $this->current = TaskSummary::loadCurrent(); $arrReload = array(); if ($id = $this->fc->getReqVar('id')) { if ($this->current && $this->current->getUid() != $id) { // we have a running task, but it's not the requested one // so first, we need to stop it. $cid = $this->current->getUid(); TimerModel::stop($cid); // and we'll have to reload the page details later $arrReload[] = $cid; } else { $this->current = new TaskSummary(); $this->current->connectDb(); $this->current->setUid($id); $this->current->load(); } if ($this->current->getUid()) { // -TODO- check rights switch ($this->fc->getReqVar('action')) { case 'pause': // try to pause if ($this->current && $this->current->getUid() == $id) { // ok, task is actually running TimerModel::stop($id); $this->current->set('stop', APP_SQL_NOW); $this->jsCode .= ""; } else { // nope, requested task is not running, show error FC::log_debug('error trying to pause non running task'); header('HTTP/1.0 403 Forbidden'); exit; } $this->setView('iphone/inc_timer'); $this->viewRaw(); break; case 'resume': case 'start': TimerModel::start($id); $this->current = TaskSummary::loadCurrent(); $this->jsCode = "clockstart();"; $this->setView('iphone/inc_timer'); $this->viewRaw(); break; case 'stop': if (TimerModel::stop($id)) { $this->jsCode = "clockstatus();"; } else { $this->jsCode = "alert('" . TR::get('error', 'action_failed') . "');"; } $this->current = false; break; case 'close': if (TimerModel::stop($id)) { $this->jsCode = "clockstatus();"; $this->current->updateStatus(1); // mark as done $this->current = false; } break; } // need to reload newly modified task details $arrReload[] = $id; } return false; } // reaching this point means an error has occured header('HTTP/1.0 404 Not Found'); exit; }
/** * generates a select (drop down) */ public function iSelectTranslate($key, $section, $options = '') { if (isset($this->obj)) { $options = $this->obj->getPropertyOptions($key); } if (empty($options['options'])) { FC::log_warn("iRadio {$key} does not provide options"); return $key . ' (no option)'; } $str = '<select id="i_' . $key . '" name="' . $key . '">'; $i = 1; foreach ($options['options'] as $val => $lbl) { $str .= '<option value="' . $val . '"'; if ($options['value'] == $val) { $str .= ' selected="selected"'; } $str .= ' value="' . $val . '">' . TR::html($section, $lbl) . '</option>'; $i++; } return $str . '</select>'; }
<li> <label for="i_username"><?php TR::phtml('form', 'username'); ?> </label> <input id="i_username" type="text" name="username" value="<?php echo $this->fc->user->value('username'); ?> " /> </li> <li> <label for="i_password"><?php TR::phtml('form', 'password'); ?> </label> <input id="i_password" type="password" name="password" value="" /> </li> <li class="buttons"> <button type="submit" name="login" value="1" class="submit"><?php TR::phtml('button', 'login'); ?> </button> </li> </ol> </form> <?php if ($GLOBALS['config']['log_debug'] == 2) { $this->fc->user->htmlAllErrors(); echo $this->fc->user; } $this->incView('include/page-bot', false);
<li class="arrow"><a href="#list-st0"><?php TR::phtml('pages', 'todo'); ?> </a><small class="counter"><?php echo $this->dataTodo->count(); ?> </small></li> <li class="arrow"><a href="#list-st1"><?php TR::phtml('pages', 'done'); ?> </a><small class="counter"><?php echo $this->dataDone->count(); ?> </small></li> <li class="arrow"><a href="#list-st2"><?php TR::phtml('pages', 'valid'); ?> </a><small class="counter"><?php echo $this->dataValid->count(); ?> </small></li> </ul> <?php /* if (count($this->dataTags)) { ?> <h2>By Tag</h2> <ul class="rounded"> <?php foreach ($this->dataTags as $row) { $tag = trim($row['tag']);
<?php echo $this->data->iSelectTranslate('status', 'task'); ?> </li> <li class="inline"> <?php echo $this->data->iCheckBox('archived'); ?> <label for="i_archived"><?php TR::phtml('ui', 'mark_archived'); ?> </label> </li> <li class="nline buttons"> <button type="submit" name="save" value="1" class="save"><?php TR::phtml('button', 'save_task'); ?> </button> </li> </ol> <script type="text/javascript" src="<?php echo APP_WWW_URI . 'asset/js/jquery.jdpicker.js'; ?> "></script> <script type="text/javascript"> $(document).ready(function(){ $('#f_task_edit').submit(function() { if ($.trim($('#i_title').val())) { return true; } else { $('#f_title').addClass('error');
<?php while ($this->data->next()) { $id = $this->data->getUid(); echo '<tr>'; echo '<td>'; echo '<a href="' . $this->fc->getUrl('admin', 'edit', array('id' => $id)) . '" class="onhold ajax box" title="' . TR::html('button', 'edit') . '">' . TR::html('button', 'edit') . '</a>'; echo $this->data->html('nickname'); if ($tmp = $this->data->htmlRights()) { echo ' <small>' . $tmp . '</small>'; } echo '</td>'; echo '<td>' . $this->data->html('last_login_date') . '</td>'; echo '</tr>'; } ?> </tbody> </table> <?php } else { ?> <p class="empty"><?php TR::html('data', 'search_empty'); ?> </p> <?php } ?> </div> </div> <?php $this->incView('include/page-bot', false);
<li> <label><?php TR::phtml('form', 'stop'); ?> </label> <input type="text" id="i_stop_time" name="stop_time" class="time" /> </li> <li class="nline"> <label><?php TR::phtml('task', 'spent'); ?> </label> <input type="text" id="i_spent" name="spent" class="duration" value="00:00" /> </li> <li class="nline buttons"> <button type="submit" name="save" value="1" class="save"><?php TR::phtml('button', 'save_report'); ?> </button> <a href="javascript:document.task_timer.reset()"><?php TR::phtml('button', 'reset'); ?> </a> </li> </ol> <hr class="clear" /> <div class="help"> <?php $this->fc->loadLangFile('help_timer_creation.php'); ?> </div>