function store()
 {
     $q = new DBQuery();
     $q->addTable('project_designer_options');
     $q->addReplace('pd_option_user', $this->pd_option_user);
     $q->addReplace('pd_option_view_project', $this->pd_option_view_project);
     $q->addReplace('pd_option_view_gantt', $this->pd_option_view_gantt);
     $q->addReplace('pd_option_view_tasks', $this->pd_option_view_tasks);
     $q->addReplace('pd_option_view_actions', $this->pd_option_view_actions);
     $q->addReplace('pd_option_view_addtasks', $this->pd_option_view_addtasks);
     $q->addReplace('pd_option_view_files', $this->pd_option_view_files);
     $q->addWhere('pd_option_user = ' . $this->pd_option_user);
     $q->exec();
 }
Exemplo n.º 2
0
 public function store(CAppUI $AppUI = null)
 {
     global $AppUI;
     $q = new DBQuery();
     $q->addTable('project_designer_options');
     $q->addReplace('pd_option_user', $this->pd_option_user);
     $q->addReplace('pd_option_view_project', $this->pd_option_view_project);
     $q->addReplace('pd_option_view_gantt', $this->pd_option_view_gantt);
     $q->addReplace('pd_option_view_tasks', $this->pd_option_view_tasks);
     $q->addReplace('pd_option_view_actions', $this->pd_option_view_actions);
     $q->addReplace('pd_option_view_addtasks', $this->pd_option_view_addtasks);
     $q->addReplace('pd_option_view_files', $this->pd_option_view_files);
     $q->addWhere('pd_option_user = ' . (int) $this->pd_option_user);
     $q->exec();
 }
Exemplo n.º 3
0
 function updateUserSpecificTaskPriority($user_task_priority = 0, $user_id = 0, $task_id = NULL)
 {
     $q = new DBQuery();
     // use task_id of given object if the optional parameter task_id is empty
     $task_id = empty($task_id) ? $this->task_id : $task_id;
     $q->addTable('user_tasks');
     $q->addReplace('user_id', $user_id);
     $q->addReplace('task_id', $task_id);
     $q->addReplace('user_task_priority', $user_task_priority);
     $q->exec();
     $q->clear();
 }
Exemplo n.º 4
0
 public function indexStrings()
 {
     global $AppUI, $w2Pconfig;
     $nwords_indexed = 0;
     /* Workaround for indexing large files:
      ** Based on the value defined in config data,
      ** files with file_size greater than specified limit
      ** are not indexed for searching.
      ** Negative value :<=> no filesize limit
      */
     $index_max_file_size = w2PgetConfig('index_max_file_size', 0);
     if ($index_max_file_size < 0 || $obj->file_size <= $index_max_file_size * 1024) {
         // get the parser application
         $parser = $w2Pconfig['parser_' . $this->file_type];
         if (!$parser) {
             $parser = $w2Pconfig['parser_default'];
         }
         if (!$parser) {
             return false;
         }
         // buffer the file
         $this->_filepath = W2P_BASE_DIR . '/files/' . $this->file_project . '/' . $this->file_real_filename;
         $fp = fopen($this->_filepath, 'rb');
         $x = fread($fp, $this->file_size);
         fclose($fp);
         // parse it
         $parser = $parser . ' ' . $this->_filepath;
         $pos = strpos($parser, '/pdf');
         if (false !== $pos) {
             $x = `{$parser} -`;
         } else {
             $x = `{$parser}`;
         }
         // if nothing, return
         if (strlen($x) < 1) {
             return 0;
         }
         // remove punctuation and parse the strings
         $x = str_replace(array('.', ',', '!', '@', '(', ')'), ' ', $x);
         $warr = explode(' ', $x);
         $wordarr = array();
         $nwords = count($warr);
         for ($x = 0; $x < $nwords; $x++) {
             $newword = $warr[$x];
             if (!preg_match('[[:punct:]]', $newword) && mb_strlen(mb_trim($newword)) > 2 && !preg_match('[[:digit:]]', $newword)) {
                 $wordarr[$newword] = $x;
             }
         }
         // filter out common strings
         $ignore = w2PgetSysVal('FileIndexIgnoreWords');
         $ignore = str_replace(' ,', ',', $ignore);
         $ignore = str_replace(', ', ',', $ignore);
         $ignore = explode(',', $ignore);
         foreach ($ignore as $w) {
             unset($wordarr[$w]);
         }
         $nwords_indexed = count($wordarr);
         // insert the strings into the table
         while (list($key, $val) = each($wordarr)) {
             $q = new DBQuery();
             $q->addTable('files_index');
             $q->addReplace('file_id', $this->file_id);
             $q->addReplace('word', $key);
             $q->addReplace('word_placement', $val);
             $q->exec();
             $q->clear();
         }
     }
     return $nwords_indexed;
 }
     if ($upd_task->task_id) {
         //If parent is self task
         //print_r($bulk_task_dependency);die;
         if ($bulk_task_dependency == '0') {
             $upd_task->task_dynamic = 0;
             $upd_task->store();
             $q = new DBQuery();
             $q->setDelete('task_dependencies');
             $q->addWhere('dependencies_task_id=' . $upd_task->task_id);
             $q->exec();
         } elseif (!($bulk_task_dependency == $upd_task->task_id)) {
             $upd_task->task_dynamic = 31;
             $upd_task->store();
             $q = new DBQuery();
             $q->addTable('task_dependencies');
             $q->addReplace('dependencies_task_id', $upd_task->task_id);
             $q->addReplace('dependencies_req_task_id', $bulk_task_dependency);
             $q->exec();
             //Lets recalc the dependency
             $dep_task = new CTask();
             $dep_task->load($bulk_task_dependency);
             if ($dep_task->task_id) {
                 $dep_task->shiftDependentTasks();
             }
         }
     }
 }
 //Action: Modify priority
 if (isset($_POST['bulk_task_priority']) && $bulk_task_priority != '') {
     if ($upd_task->task_id) {
         $upd_task->task_priority = $bulk_task_priority;
Exemplo n.º 6
0
 function indexStrings()
 {
     global $AppUI, $dPconfig;
     // get the parser application
     $parser = @$dPconfig['parser_' . $this->file_type];
     if (!$parser) {
         $parser = $dPconfig['parser_default'];
     }
     if (!$parser) {
         return false;
     }
     // buffer the file
     $this->_filepath = DP_BASE_DIR . '/files/' . $this->file_project . '/' . $this->file_real_filename;
     $fp = fopen($this->_filepath, "rb");
     $x = fread($fp, $this->file_size);
     fclose($fp);
     // parse it
     $parser = $parser . " " . $this->_filepath;
     $pos = strpos($parser, '/pdf');
     if (false !== $pos) {
         $x = `{$parser} -`;
     } else {
         $x = `{$parser}`;
     }
     // if nothing, return
     if (strlen($x) < 1) {
         return 0;
     }
     // remove punctuation and parse the strings
     $x = str_replace(array(".", ",", "!", "@", "(", ")"), " ", $x);
     $warr = split("[[:space:]]", $x);
     $wordarr = array();
     $nwords = count($warr);
     for ($x = 0; $x < $nwords; $x++) {
         $newword = $warr[$x];
         if (!ereg("[[:punct:]]", $newword) && strlen(trim($newword)) > 2 && !ereg("[[:digit:]]", $newword)) {
             $wordarr[] = array("word" => $newword, "wordplace" => $x);
         }
     }
     db_exec("LOCK TABLES files_index WRITE");
     // filter out common strings
     $ignore = array();
     include DP_BASE_DIR . '/modules/files/file_index_ignore.php';
     foreach ($ignore as $w) {
         unset($wordarr[$w]);
     }
     // insert the strings into the table
     while (list($key, $val) = each($wordarr)) {
         $q = new DBQuery();
         $q->addTable('files_index');
         $q->addReplace("file_id", $this->file_id);
         $q->addReplace("word", $wordarr[$key]['word']);
         $q->addReplace("word_placement", $wordarr[$key]['wordplace']);
         $q->exec();
         $q->clear();
     }
     db_exec("UNLOCK TABLES;");
     return nwords;
 }
Exemplo n.º 7
0
 function indexStrings()
 {
     global $AppUI, $dPconfig;
     // get the parser application
     $parser = @$dPconfig['parser_' . $this->file_type];
     if (!$parser) {
         $parser = $dPconfig['parser_default'];
     }
     if (!$parser) {
         return false;
     }
     // buffer the file
     $filepath = DP_BASE_DIR . '/files/' . $this->file_project . '/' . $this->file_real_filename;
     $fp = fopen($filepath, 'rb');
     $x = fread($fp, $this->file_size);
     fclose($fp);
     // parse it
     $parser = $parser . ' ' . $filepath;
     $pos = mb_strpos($parser, '/pdf');
     $x = $pos !== false ? `{$parser} -` : `{$parser}`;
     // if nothing, return
     if (mb_strlen($x) < 1) {
         return 0;
     }
     // remove punctuation and parse the strings
     $x = str_replace(array('.', ',', '!', '@', '(', ')'), ' ', $x);
     $warr = mb_split('[[:space:]]', $x);
     $wordarr = array();
     $nwords = count($warr);
     for ($x = 0; $x < $nwords; $x++) {
         $newword = $warr[$x];
         if (!ereg('[[:punct:]]', $newword) && !ereg('[[:digit:]]', $newword) && mb_strlen(trim($newword)) > 2) {
             $wordarr[] = array('word' => $newword, 'wordplace' => $x);
         }
     }
     db_exec('LOCK TABLES files_index WRITE');
     // filter out common strings
     $ignore = array();
     include_once DP_BASE_DIR . '/modules/files/file_index_ignore.php';
     foreach ($ignore as $w) {
         unset($wordarr[$w]);
     }
     // insert the strings into the table
     while (list($key, $val) = each($wordarr)) {
         $q = new DBQuery();
         $q->addTable('files_index');
         $q->addReplace('file_id', $this->file_id);
         $q->addReplace('word', $wordarr[$key]['word']);
         $q->addReplace('word_placement', $wordarr[$key]['wordplace']);
         $q->exec();
         $q->clear();
     }
     db_exec('UNLOCK TABLES;');
     return nwords;
 }