You are here:  » Add info of jobs

Support Forum



Add info of jobs

Submitted by sirmanu on Fri, 2021-09-10 07:12 in

Hi David.

How can I add a new button in Admin Home (feed Management) of edit job (if feed exists) next to register?

Also, in automation_tool_edit.php, I want to be able to see Last OK Run and Status.

Thank you!

Submitted by support on Fri, 2021-09-10 09:35

Hi,

To add the button edit admin/index.php and look for the following code at line 8:

  require("admin_header.php");

...and REPLACE with:

  require("admin_header.php");
  $sql = "SELECT * FROM `".$config_databaseTablePrefix."jobs`";
  database_querySelect($sql,$rows);
  $jobIds = array();
  foreach($rows as $row)
  {
    $jobIds[$row["filename"]] = $row["id"];
  }

Then look for the following code at (now) line 161:

        admin_tool("Register","feeds_register_step1.php?filename=".urlencode($filename),TRUE,FALSE);

...and REPLACE with:

        admin_tool("Register","feeds_register_step1.php?filename=".urlencode($filename),TRUE,FALSE);
        if (isset($jobIds[$filename]))
        {
          admin_tool("Edit Job","automation_tool_edit.php?id=".$jobIds[$filename],TRUE,FALSE);
        }

For the job info; edit admin/automation_tool_edit.php and look for the following code at line 128:

    widget_formBegin();

...and REPLACE with:

  print "<table>";
  print "<tr>";
  print "<th>".translate("Last OK Run")."</th>";
  print "<th>".translate("Status")."</th>";
  print "</tr>";
  print "<tr>";
  print "<td class='pta_mid'>".($jobs[0]["lastrun"]?date("Y-m-d H:i:s",$jobs[0]["lastrun"]):"-")."</td>";
  print "<td class='pta_mid' style='font-size:x-small; color:".($jobs[0]["status"]=="OK"?"darkgreen":"red").";'>".($jobs[0]["status"]?$jobs[0]["status"]:"-")."</td>";
  print "</tr>";
  print "</table>";
  widget_formBegin();

Cheers,
David.
--
PriceTapestry.com

Submitted by sirmanu on Sat, 2021-09-11 15:36

Thank you David. It is working as expected :)