We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16034
    • 107 Posts
    Thanks for the feedback.

    rfoster: I’ve verified your findings, and put it on the tracker, will take a closer look at it soon.

    http://gregorian.lighthouseapp.com/projects/34912/tickets/30-validation-for-startdate-enddate-does-not-work
      MODx snippet-glossary 101:
      Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
      • 29076
      • 615 Posts
      Quote from: MediaGuy at Aug 09, 2009, 04:44 AM

      This looks great, can you also manage the calendar from the backend/manager?
      Thanks for sharing this. It’s really looks promising. But my clients just don’t want to log in several places to get things done, so I also ask if there is possible to get the admin part in the MODx back end. smiley
        I think, thererfor I am! But what I am, and why...?
        • 16034
        • 107 Posts
        They only have to log in once, the default behaviour is that manager-users can edit the calendar.

        Editing from the back-end is on the roadmap but is not a priority right now since the page I use it on has all editing on the frontend.
        (Now I’ve also added it to the bug tracker so it actually shows up on the roadmap.)
        http://gregorian.lighthouseapp.com/projects/34912-gregorian/tickets/31-make-a-module-for-backend-handling-of-the-calendar
        If someone else should be interested in implementing some backend editing don’t hesitate to fork on GitHub and implement it. I’ll gladly give some info on where to start, and as said earlier, it’s not a lot of work.

        My current priority is bugfixes for the beta-version, and a refactor/rewrite with a much more modular architecture, which should make maintenance and expansion a whole easier in the future. (Take a look at the ’refactoring’ branch on github if you’re interested.)
          MODx snippet-glossary 101:
          Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
          • 16034
          • 107 Posts
          Fixed the date validation bug. Was a simple typo ($e_field => $e_fields). Fixed on the demo-site and committed in the 1.0 branch on github:
          http://github.com/Kleist/Gregorian/tree/1.0
            MODx snippet-glossary 101:
            Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
            • 4429
            • 429 Posts
            Is it possible to have this display the results in an actual calendar format? At the moment it is jsut a list
              • 16034
              • 107 Posts
              No, currently only the list format is supported. Since that’s what I need ;-)
                MODx snippet-glossary 101:
                Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control
                • 4172
                • 5,888 Posts
                ok, did a simple testinstallation.
                great work, Kleist, thanks for sharing!

                I wanted to render the events from gregorian with bloX (full templefied outputs from arrays) , so I did little work on gregrorian to get the event-array.

                added new view class ’GregorianEventarrayView.class.php’:

                <?php
                
                class GregorianEventarrayView  {
                
                	/**
                	 * @var GregorianConfig object
                	 */
                	private $config = NULL;
                	private $_events = array(); // Array of GregorianEvent objects
                
                    public function __construct(&$modx, &$xpdo) {
                 		$this->config = new GregorianConfig();
                    }
                    public function setCalendar(&$cal) {
                    	$this->cal = &$cal;
                    }
                    /**
                     * Set config variable
                     * @param string Config name
                     * @param mixed Config value (default: true)
                     * @return none
                     */
                    public function set($name,$value = true) {
                        return $this->config->set($name,$value);
                    }
                	/**
                	 * The overall method for showing a view.
                	 * @return unknown_type
                	 */
                    public function render() {
                        //$this->_preRender();
                        //$events = $this->cal->getEventsMeta();
                		$this->_events = $this->cal->getFutureEvents();
                		
                		$events=array();
                		foreach($this->_events as $key=>$e){
                			//echo '<pre>'.print_r($e->toArray(),true).'</pre>';
                			$events[]=$e->toArray();
                		}
                		return $events;
                
                	}
                
                }


                in GregorianController.class.php
                changed

                    	switch ($this->_action) {
                    		case 'show':
                					$output .= $events;	
                			
                     			break;


                to:

                    	switch ($this->_action) {
                    		case 'show':
                			    $events=$this->_getView();
                				if (is_array($events)){//added by Bruno for returning eventarray
                					$output = $events;	
                				}else{
                					$output .= $events;	
                				}
                     			break;


                now I can use for example this code as a blox-project ’getdatas.php’-file to generate the calendar-view:

                <?php
                
                $view='Eventarray';
                $this->greg_output = include $modx->config['base_path']  . 'assets/snippets/Gregorian/Gregorian.snippet.php';
                
                //print_r($this->greg_output);
                
                foreach($this->greg_output as & $event){
                	$event['Time']=strtotime($event['dtstart']);
                	$event['Timeend']=strtotime($event['dtend']);
                }
                
                $month = abs($this->bloxconfig['month']);
                $year=$this->bloxconfig['year'];
                $timestampfirstday = xetadodb_mktime(0, 0, 0, $month, 01, $year);
                
                $cal=$this->xettcal->getMonthCal($year, $month);
                $bloxdatas=$this->xettcal->makeMonthArray($this->xetconfig,$cal,array(),$this->greg_output);
                
                
                //echo '<pre>'.print_r($bloxdatas,true).'</pre>';
                
                $bloxdatas['tsconfig'] = $timestampfirstday;
                
                
                ?> 
                


                prepare my project-templates for my needs and get this result:

                (very simple, only for this test, nothing formatted)

                would be nice to have a function in gregorian $this->cal->getEventsBetweenStartAndEnd($start,$end); wink


                  -------------------------------

                  you can buy me a beer, if you like MIGX

                  http://webcmsolutions.de/migx.html

                  Thanks!
                  • 16034
                  • 107 Posts
                  Nice to see someone is using it!

                  I don’t have the time to look at you changes now (or do any other MODx-stuff), but definitely will, and if they’ll fit in I’ll include them.

                  You’re welcome to make a fork on Github, do your changes, and request a pull on Github. (I suggest you make the changes based on the master-branch. I might not continue development on the older code since the master-branch is based on a lot better design, and is pretty close to another beta-release.)

                  /Kleist
                    MODx snippet-glossary 101:
                    Ditto = Content Lister -- Wayfinder == Menu Builder -- Jot = Comment Control