xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
Commit d6b54bd62c35ca1e58b4b7e45bb5d3e48844712b

Fixed suggestions' 'yesterday' report.
Author: Catalin(ux) M. BOIE
Author date (UTC): 2015-07-09 03:30
Committer name: Catalin(ux) M. BOIE
Committer date (UTC): 2015-07-09 03:30
Parent(s): 062bd66f4c403116edd34d592ac668732a0dde05
Signing key:
Tree: f75138ae31532907d4a892dc4ac1c420469ff0be
File Lines added Lines deleted
inc/admin.inc.php 7 4
inc/struct.inc.php 1 0
File inc/admin.inc.php changed (mode: 100644) (index 4a59268..c789d85)
... ... function rg_init($db, $rg)
266 266 function rg_admin_report1_suggestions($db, $from, $to) function rg_admin_report1_suggestions($db, $from, $to)
267 267 { {
268 268 $ret = array(); $ret = array();
269 $ret['yesterday'] = "";
269 $ret['yesterday'] = 0;
270 $ret['yesterday_text'] = '';
271 $ret['total'] = 0;
270 272
271 273 // Total // Total
272 274 $sql = "SELECT COUNT(*) AS total FROM suggestions"; $sql = "SELECT COUNT(*) AS total FROM suggestions";
273 275 $res = rg_sql_query($db, $sql); $res = rg_sql_query($db, $sql);
274 276 if ($res === FALSE) { if ($res === FALSE) {
275 $ret['total'] = "ERR";
277 $ret['total'] = -1;
276 278 } else { } else {
277 279 $row = rg_sql_fetch_array($res); $row = rg_sql_fetch_array($res);
278 280 $ret['total'] = $row['total']; $ret['total'] = $row['total'];
 
... ... function rg_admin_report1_suggestions($db, $from, $to)
295 297 $list .= sprintf("%8u %s\n", $list .= sprintf("%8u %s\n",
296 298 $row['uid'], $row['suggestion']); $row['uid'], $row['suggestion']);
297 299 } }
300 $ret['yesterday'] = $count;
298 301 if ($count) if ($count)
299 $ret['yesterday'] = "\nYesterday suggestions"
302 $ret['yesterday_text'] = "\nYesterday suggestions"
300 303 . " (" . $count . "):\n" . $list; . " (" . $count . "):\n" . $list;
301 304 } }
302 305 rg_sql_free_result($res); rg_sql_free_result($res);
 
... ... function rg_admin_report1($db, $rg)
391 394 $rg['mail']['subject'] = 'RocketGit report' $rg['mail']['subject'] = 'RocketGit report'
392 395 . ' [' . $users . '/' . $total_users . ']' . ' [' . $users . '/' . $total_users . ']'
393 396 . ' [' . $repos . '/' . $total_repos . ']' . ' [' . $repos . '/' . $total_repos . ']'
394 . $sug['yesterday'] . 's';
397 . ' ' . $sug['yesterday'] . 's';
395 398 $rg['mail']['body'] = $body; $rg['mail']['body'] = $body;
396 399 rg_mail_template("mail/admin/report1", $rg); rg_mail_template("mail/admin/report1", $rg);
397 400 } }
File inc/struct.inc.php changed (mode: 100644) (index 6d5654f..da058c3)
... ... $rg_sql_struct[33]['other'] = array(
423 423
424 424 TODO: do not fill email in suggestions - we have the uid! TODO: do not fill email in suggestions - we have the uid!
425 425 TODO: "suggestion_drop_email" => "ALTER TABLE suggestions DROP email" TODO: "suggestion_drop_email" => "ALTER TABLE suggestions DROP email"
426 TODO: change report1 to activate yesterday suggestions!
426 427 */ */
427 428
428 429 // This must be the last line // This must be the last line
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master