コード例 #1
0
ファイル: obj.street_lighting.php プロジェクト: r3-gis/EcoGIS
 /**
  * Return the UDM
  * @param array $request    the request
  * @return array            the result data
  */
 public function confirmDeleteStreetLighting($request)
 {
     $db = ezcDbInstance::get();
     $lang = R3Locale::getLanguageID();
     $id = (int) $request['id'];
     $name = $db->query("SELECT sl_full_name_{$lang} AS sw_title FROM street_lighting_data WHERE sl_id={$id}")->fetchColumn();
     $hasEnergyMeter = R3EcoGisHelper::hasEnergyMeter('STREET_LIGHTING', $id);
     $hasDocument = R3EcoGisHelper::hasDocument('STREET_LIGHTING', $id);
     if (!$hasEnergyMeter && !$hasDocument && $this->tryDeleteData($id)) {
         return array('status' => R3_AJAX_NO_ERROR, 'confirm' => sprintf(_('Sei sicuro di voler cancellare il tratto "%s"?'), $name));
     }
     return array('status' => R3_AJAX_NO_ERROR, 'alert' => sprintf(_('Impossibile cancellare il tratto "%s", poichè vi sono dei dati ad esso associati'), $name));
 }
コード例 #2
0
ファイル: obj.building.php プロジェクト: r3-gis/EcoGIS
 public function askDelBuilding($request)
 {
     $db = ezcDbInstance::get();
     $lang = R3Locale::getLanguageID();
     $id = forceInteger($request['id'], 0, false, '.');
     $name = $db->query("SELECT bu_name_{$lang} FROM building WHERE bu_id={$id}")->fetchColumn();
     $hasEnergyMeter = R3EcoGisHelper::hasEnergyMeter('BUILDING', $id);
     $hasDocument = R3EcoGisHelper::hasDocument('BUILDING', $id);
     if (!$hasEnergyMeter && !$hasDocument && $this->tryDeleteData($id)) {
         return array('status' => R3_AJAX_NO_ERROR, 'confirm' => sprintf(_("Sei sicuro di voler cancellare l'edificio \"%s\"?"), $name));
     } else {
         return array('status' => R3_AJAX_NO_ERROR, 'alert' => _('Impossibile cancellare questo edificio poichè vi sono dei dati ad esso legati'));
     }
 }
コード例 #3
0
ファイル: obj.global_plain.php プロジェクト: r3-gis/EcoGIS
 public function askDelGlobalPlain($request)
 {
     $db = ezcDbInstance::get();
     $id = (int) @$request['id'];
     R3Security::checkGlobalPlain($id);
     $lang = R3Locale::getLanguageID();
     $name = $db->query("SELECT gp_name_{$lang} AS gp_name FROM global_plain_data WHERE gp_id=" . (int) $request['id'])->fetchColumn();
     if (R3EcoGisHelper::hasGlobalPlainRowHasGauge($id)) {
         return array('status' => R3_AJAX_NO_ERROR, 'alert' => _("Impossibile cancellare questo piano d'azione, poichè vi sono definiti degli indicatori ad esso legati"));
     }
     if (R3EcoGisHelper::hasDocument('GLOBAL_PLAIN', $id)) {
         return array('status' => R3_AJAX_NO_ERROR, 'alert' => _("Impossibile cancellare questo piano d'azione, poichè vi sono dei documenti ad esso legati"));
     }
     return array('status' => R3_AJAX_NO_ERROR, 'confirm' => sprintf(_("Sei sicuro di voler cancellare il piano di azione \"%s\"?"), $name));
 }