Example #1
0
 public function clearAllFlaggedOfFollowupflag(&$uri, &$params, &$criteria, $original)
 {
     //remove apenas se vier o id da Followupflag
     if (isset($uri['id'])) {
         $result = Controller::find(array('concept' => 'followupflagged'), null, array('filter' => array('=', 'followupflagId', $uri['id'])));
         foreach ($result as $flagged) {
             Controller::delete(array('concept' => 'followupflagged', 'id' => $flagged['id']), false, false);
         }
         Controller::deleteALL(array('concept' => 'followupflagged'), null, array('filter' => array('=', 'followupflagId', $uri['id'])));
     }
 }
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program; if not, see www.gnu.org/licenses or write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301 USA.
*
* This code is based on the OpenXchange Connector and on the Prognus pSync
* Connector both developed by the community and licensed under the GPL
* version 2 or above as published by the Free Software Foundation.
*
* You can contact Prognus Software Livre headquarters at Av. Tancredo Neves,
* 6731, PTI, Edifício do Saber, 3º floor, room 306, Foz do Iguaçu - PR - Brasil
* or at e-mail address prognus@prognus.com.br.
*
* Descrição rápida do arquivo
*
* Descrição detalhada do arquivo... (se necessário)
*
* @package    Prototype (Mail)
* @license    http://www.gnu.org/copyleft/gpl.html GPL
* @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
* @version    2.4
* @sponsor    Caixa Econômica Federal
* @since      Arquivo disponibilizado na versão 2.4
*/
include_once dirname(__FILE__) . '/../../api/controller.php';
Controller::deleteALL(array('concept' => 'mailAttachment'), false, array('filter' => array('<', 'dtstamp', gmmktime() - 86400)));
Example #3
0
 public function deleteCalendarSignatureDependences(&$uri, &$params, &$criteria, $original)
 {
     $signature = Controller::read($uri, array('isOwner', 'calendar', 'user'));
     if ($signature['isOwner'] == '1') {
         $calendarToSchedulables = Controller::find(array('concept' => 'calendarToSchedulable'), null, array('filter' => array('=', 'calendar', $signature['calendar'])));
         $schedulables = array();
         if (is_array($calendarToSchedulables)) {
             foreach ($calendarToSchedulables as $key => $calendarToSchedulable) {
                 $schedulables[] = $calendarToSchedulable['schedulable'];
             }
         }
         if (!empty($schedulables)) {
             Controller::deleteALL(array('concept' => 'schedulable'), null, array('filter' => array('IN', 'id', $schedulables)));
         }
         Controller::delete(array('concept' => 'calendar', 'id' => $signature['calendar']));
         $autoCommit = Controller::service('PostgreSQL')->execResultSql('Select config_value FROM phpgw_config WHERE config_app = \'expressoCalendar\' AND config_name = \'expressoCalendar_autoImportCalendars\'');
         if (isset($autoCommit[0]) && $autoCommit[0]['config_value'] == 'true') {
             $defaultCalendar = Controller::find(array('concept' => 'modulePreference'), array('value', 'id'), array('filter' => array('and', array('=', 'name', 'dafaultImportCalendar'), array('=', 'module', 'expressoCalendar'), array('=', 'user', $signature['user']))));
             if (isset($defaultCalendar[0]) && $defaultCalendar[0]['value'] == $signature['calendar']) {
                 Controller::delete(array('concept' => 'modulePreference', 'id' => $defaultCalendar[0]['id']));
             }
         }
         $permissions = Controller::find(array('concept' => 'calendarToPermission'), array('id'), array('filter' => array('=', 'calendar', $signature['calendar'])));
         if ($permissions && count($permissions) > 0) {
             $ids = array();
             foreach ($permissions as $key => $value) {
                 array_push($ids, $value['id']);
             }
             Controller::deleteALL(array('concept' => 'calendarToPermission'), null, array('filter' => array('IN', 'id', $ids)));
         }
     }
 }