Forum

Welcome to ProjeQtOr new Forum. We migrated old forum to the new website.
You will find all your posts here, with your usual account.
Just one point : you’ll have to reinitialize your password. Use “Lost password” feature.

v11 - create new us...
 
Notifications
Clear all

v11 - create new user - no 'newGui' records in Today table

4 Posts
2 Users
0 Reactions
1,262 Views
 M
(@mkavurcic)
Posts: 43
Active Member
Topic starter
 
[#9063]

please check

here is quick hack - Today.php:
/* ============================================================================
 * Parameter is a global kind of object for parametring.
 * It may be on user level, on project level or on global level.
 */
require_once('_securityCheck.php');
class Today extends SqlElement {

  // extends SqlElement, so has $id
  public $id;    // redefine $id to specify its visiblez place
  public $idUser;
  public $scope;
  public $staticSection;
  public $idReport;
  public $sortOrder;
  public $idle;
 
  public static $staticList=array('Projects','AssignedTasks','ResponsibleTasks', 'AccountableTasks', 'IssuerRequestorTasks','ProjectsTasks','Documents');
  //mk add
  public static $newGuiList=array('Projects','Message','Documents', 'Todo', 'ResponsibleTodoList','News');
//end mk add
  public $_noHistory=true; // Will never save history for this object
 
  /** ==========================================================================
   * Constructor
   * @param $id the id of the object in the database (null if not stored yet)
   * @return void
   */
  function __construct($id = NULL, $withoutDependentObjects=false) {
    parent::__construct($id,$withoutDependentObjects);
  }

 
  /** ==========================================================================
   * Destructor
   * @return void
   */
  function __destruct() {
    parent::__destruct();
  }
 
  function delete() {
      $p=new TodayParameter();
      $res=$p->purge("idToday=".$this->id);
      return parent::delete();
  }

// ============================================================================*******
// GET VALIDATION SCRIPT
// ============================================================================
*******

  /** ==========================================================================
   * Return the validation sript for some fields
   * @return the validation javascript (for dojo frameword)
   */
 
  public static function insertStaticItems() {
    $user=getSessionUser();
    $sort=0;
    foreach (self::$staticList as $static) {
      $crit=array('idUser'=>$user->id, 'scope'=>'static', 'staticSection'=>$static);
      $sort+=1;
      $item=SqlElement::getSingleSqlElementFromCriteria('Today', $crit);
      if (!$item->id) {
        $item->sortOrder=$sort;
        $item->idle=0;
        $item->scope='static';
        $item->save();
      }
    }
    //mk add
    $sort=0;
    foreach (self::$newGuiList as $static) {
      $crit=array('idUser'=>$user->id, 'scope'=>'newGui', 'staticSection'=>$static);
      $sort+=1;
      $item=SqlElement::getSingleSqlElementFromCriteria('Today', $crit);
      if (!$item->id) {
        $item->sortOrder=$sort;
        $item->idle=0;
        $item->scope='newGui';
        $item->save();
      }
    }
    //end mk add
  }
}
?>


 
Posted : 27 Sep 2023 18H18
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

Sorry, I don't understand the purpose of the code you propose


 
Posted : 29 Sep 2023 19H45
 M
(@mkavurcic)
Posts: 43
Active Member
Topic starter
 

please try the following:
create new user in v11; login as user; no newGui sections available on Today screen


 
Posted : 29 Sep 2023 19H57
babynus
(@babynus)
Posts: 14953
Main Contributor Admin
 

I understand now.
Thank you.
Ticket recorded.


 
Posted : 29 Sep 2023 20H13
Share:

Scroll to Top