Esempio n. 1
0
 /**
  * Returns change log for currently loaded row in displayable HTML format
  */
 public function getChangeLogForDisplay($ps_css_id = null)
 {
     $o_log = new ApplicationChangeLog();
     return $o_log->getChangeLogForRowForDisplay($this, $ps_css_id);
 }
Esempio n. 2
0
 /**
  *
  */
 public function getWatchedItems($pn_user_id, $pn_table_num = null)
 {
     require_once __CA_LIB_DIR__ . '/core/ApplicationChangeLog.php';
     if (!$pn_user_id) {
         return null;
     }
     $t_changelog = new ApplicationChangeLog();
     $o_db = $this->getDb();
     $o_dm = $this->getAppDatamodel();
     $sql = "";
     $va_items = array();
     if ($pn_table_num) {
         $sql = " AND table_num = {$pn_table_num}";
     }
     $q_watched_items = $o_db->query("\n\t\t\tSELECT watch_id, row_id, table_num \n\t\t\tFROM ca_watch_list \n\t\t\tWHERE \n\t\t\t\tuser_id = ? {$sql} \n\t\t\tORDER BY watch_id DESC", $pn_user_id);
     if ($q_watched_items->numRows() > 0) {
         while ($q_watched_items->nextRow()) {
             $t_item_table = $o_dm->getInstanceByTableNum($q_watched_items->get("table_num"), true);
             if ($t_item_table->hasField('deleted') && $t_item_table->get('deleted') == 1) {
                 continue;
             }
             $t_item_table->load($q_watched_items->get("row_id"));
             $va_items[] = array("watch_id" => $q_watched_items->get("watch_id"), "row_id" => $q_watched_items->get("row_id"), "table_num" => $q_watched_items->get("table_num"), "table_name" => $t_item_table->TableName(), "displayName" => $t_item_table->getLabelForDisplay(), "idno" => $t_item_table->get("idno"), "item_type" => $t_item_table->getProperty('NAME_SINGULAR'), "primary_key" => $t_item_table->getPrimaryKey(), "change_log" => $t_changelog->getChangeLogForRowForDisplay($t_item_table));
         }
     }
     return $va_items;
 }