Exemplo n.º 1
0
 public function install()
 {
     parent::install();
     $category = new Category();
     $category->name = GO::t('general', 'notes');
     $category->save();
     $category->acl->addGroup(GO::config()->group_everyone, Acl::READ_PERMISSION);
 }
Exemplo n.º 2
0
 public function install()
 {
     parent::install();
     $category = new Model\Category();
     $category->name = \GO::t('general', 'bookmarks');
     $category->save();
     $category->acl->addGroup(\GO::config()->group_internal, \GO\Base\Model\Acl::READ_PERMISSION);
 }
Exemplo n.º 3
0
 public function install()
 {
     if (\GO::modules()->isInstalled('site')) {
         $alreadyExists = \GO\Site\Model\Site::model()->findSingleByAttribute('module', 'defaultsite');
         if (!$alreadyExists) {
             $siteProperties = array('name' => \GO::t('name', 'defaultsite'), 'user_id' => 1, 'domain' => '*', 'module' => 'defaultsite', 'ssl' => '0', 'mod_rewrite' => '0', 'mod_rewrite_base_path' => '/', 'base_path' => '', 'language' => '');
             $defaultSite = new \GO\Site\Model\Site();
             $defaultSite->setAttributes($siteProperties);
             $defaultSite->save();
         }
     }
     return parent::install();
 }
Exemplo n.º 4
0
 public function install()
 {
     parent::install();
     $cron = new \GO\Base\Cron\CronJob();
     $cron->name = 'Dropbox sync';
     $cron->active = true;
     $cron->runonce = false;
     $cron->minutes = '*';
     $cron->hours = '*';
     $cron->monthdays = '*';
     $cron->months = '*';
     $cron->weekdays = '*';
     $cron->job = 'GO\\Dropbox\\Cron\\Sync';
     $cron->save();
 }
Exemplo n.º 5
0
 public function install()
 {
     if (GO::modules()->isInstalled('site')) {
         $alreadyExists = Site::model()->findSingleByAttribute('module', 'adminmanual');
         if (!$alreadyExists) {
             $siteProperties = array('name' => "Manual", 'user_id' => 1, 'domain' => '*', 'module' => 'manualsite', 'ssl' => '0', 'mod_rewrite' => '0', 'mod_rewrite_base_path' => '/', 'base_path' => '', 'language' => 'en');
             $defaultSite = new Site();
             $defaultSite->setAttributes($siteProperties);
             $defaultSite->save();
             $home = new GO\Site\Model\Content();
             $home->site_id = $defaultSite->id;
             $home->title = "Home";
             $home->slug = "";
             $home->template = "/manualsite/home";
             $home->save();
             $chapter = new GO\Site\Model\Content();
             $chapter->parent_id = $home->id;
             $chapter->site_id = $home->id;
             $chapter->title = "Example chapter";
             $chapter->content = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
             $chapter->slug = "example-chapter";
             $chapter->template = "/manualsite/content";
             $chapter->save();
             $sub = new GO\Site\Model\Content();
             $sub->parent_id = $chapter->id;
             $sub->site_id = $defaultSite->id;
             $sub->title = "Sub 1";
             $sub->content = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
             $sub->slug = "example-chapter";
             $sub->template = "/manualsite/content";
             $sub->save();
             $sub = new GO\Site\Model\Content();
             $sub->parent_id = $chapter->id;
             $sub->site_id = $defaultSite->id;
             $sub->title = "Sub 2";
             $sub->content = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
             $sub->slug = "example-chapter";
             $sub->template = "/manualsite/content";
             $sub->save();
         }
         $category = \GO\Customfields\Model\Category::model()->createIfNotExists("GO\\Site\\Model\\Site", "Extra");
         \GO\Customfields\Model\Field::model()->createIfNotExists($category->id, "Google tracking code");
     }
     return parent::install();
 }
Exemplo n.º 6
0
 public function install()
 {
     parent::install();
     $domains = empty(\GO::config()->serverclient_domains) ? array() : explode(',', \GO::config()->serverclient_domains);
     foreach ($domains as $domain) {
         if (!empty($domain)) {
             $domainModel = new Model\Domain();
             $domainModel->domain = $domain;
             $domainModel->save();
             $mailboxModel = new Model\Mailbox();
             $mailboxModel->domain_id = $domainModel->id;
             $mailboxModel->username = '******' . $domain;
             $mailboxModel->password = '******';
             $mailboxModel->name = "System administrator";
             $mailboxModel->save();
         }
     }
 }
Exemplo n.º 7
0
 public function install()
 {
     parent::install();
     $group = new Model\Group();
     $group->name = \GO::t('calendars', 'calendar');
     $group->save();
     $cron = new \GO\Base\Cron\CronJob();
     $cron->name = 'Calendar publisher';
     $cron->active = true;
     $cron->runonce = false;
     $cron->minutes = '0';
     $cron->hours = '*';
     $cron->monthdays = '*';
     $cron->months = '*';
     $cron->weekdays = '*';
     $cron->job = 'GO\\Calendar\\Cron\\CalendarPublisher';
     $cron->save();
 }
Exemplo n.º 8
0
 public function install()
 {
     parent::install();
     $template = new \GO\files\Model\Template();
     $template->name = \GO::t('wordtextdoc', 'files');
     $template->content = file_get_contents(\GO::modules()->files->path . 'install/templates/empty.docx');
     $template->extension = 'docx';
     $template->save();
     $template->acl->addGroup(\GO::config()->group_internal, \GO\Base\Model\Acl::READ_PERMISSION);
     $template = new \GO\files\Model\Template();
     $template->name = \GO::t('ootextdoc', 'files');
     $template->content = file_get_contents(\GO::modules()->files->path . 'install/templates/empty.odt');
     $template->extension = 'odt';
     $template->save();
     $template->acl->addGroup(\GO::config()->group_internal, \GO\Base\Model\Acl::READ_PERMISSION);
 }
Exemplo n.º 9
0
    public function install()
    {
        parent::install();
        $default_language = \GO::config()->default_country;
        if (empty($default_language)) {
            $default_language = 'US';
        }
        $addressbook = new Model\Addressbook();
        $addressbook->setAttributes(array('user_id' => 1, 'name' => \GO::t('prospects', 'addressbook')));
        $addressbook->save();
        $addressbook->acl->addGroup(\GO::config()->group_internal, \GO\Base\Model\Acl::WRITE_PERMISSION);
        $addressbook = new Model\Addressbook();
        $addressbook->setAttributes(array('user_id' => 1, 'name' => \GO::t('suppliers', 'addressbook')));
        $addressbook->save();
        $addressbook->acl->addGroup(\GO::config()->group_internal, \GO\Base\Model\Acl::WRITE_PERMISSION);
        if (!is_dir(\GO::config()->file_storage_path . 'contacts/contact_photos')) {
            mkdir(\GO::config()->file_storage_path . 'contacts/contact_photos', 0755, true);
        }
        $addressbook = new Model\Addressbook();
        $addressbook->setAttributes(array('user_id' => 1, 'name' => \GO::t('customers', 'addressbook')));
        $addressbook->save();
        $addressbook->acl->addGroup(\GO::config()->group_internal, \GO\Base\Model\Acl::WRITE_PERMISSION);
        //Each user should have a contact
        $stmt = \GO\Base\Model\User::model()->find(\GO\Base\Db\FindParams::newInstance()->ignoreAcl());
        while ($user = $stmt->fetch()) {
            $user->createContact();
        }
        $message = new \GO\Base\Mail\Message();
        $message->setHtmlAlternateBody('{salutation},<br />
<br />
{body}<br />
<br />
' . \GO::t('greet', 'addressbook') . '<br />
<br />
<br />
{user:name}<br />
{usercompany:name}<br />');
        $template = new Model\Template();
        $template->setAttributes(array('content' => $message->toString(), 'name' => \GO::t('default'), 'type' => Model\Template::TYPE_EMAIL, 'user_id' => 1));
        $template->save();
        $template->acl->addGroup(\GO::config()->group_internal);
        $dt = Model\Template::model()->findSingleByAttribute('name', 'Letter');
        if (!$dt) {
            $dt = new Model\Template();
            $dt->type = Model\Template::TYPE_DOCUMENT;
            $dt->content = file_get_contents(\GO::modules()->addressbook->path . 'install/letter_template.docx');
            $dt->extension = 'docx';
            $dt->name = 'Letter';
            $dt->save();
            $dt->acl->addGroup(\GO::config()->group_internal);
        }
        $this->setFolderPermissions();
    }